@@ -521,3 +521,38 @@ BOOST_AUTO_TEST_CASE(check_fixed_vector)
521521 BOOST_REQUIRE_THROW (TS.wholeSimulation (), openfluid::base::FrameworkException);
522522 }
523523}
524+
525+
526+ BOOST_AUTO_TEST_CASE (check_fixed_matrix)
527+ {
528+ openfluid::machine::GeneratorSpecs Specs{openfluid::fluidx::GeneratorDescriptor::GeneratorMethod::FIXED,
529+ {{" SU" ," a" }},
530+ openfluid::core::Value::MATRIX};
531+ {
532+ // TEST MATRIX
533+ std::cout << " checking fixed matrix " << std::endl;
534+ openfluid::ware::WareParams_t Params = {{" deltat" , " 0" }, {" fixedvalue" , " [[3,2],[5,4]]" }};
535+
536+ TestSimulation TS;
537+ TS.defaultSetup ();
538+ TS.addGenerator (Specs, Params);
539+ TS.wholeSimulation ();
540+
541+ const auto Matrix = TS.getLatestValue (" SU" , 1 , " a" ).value ()->asMatrixValue ();
542+ BOOST_REQUIRE_CLOSE (Matrix.get (1 ,1 ), 4 , 0.00001 );
543+ }
544+
545+ {
546+ // TEST VECTOR CELLS FROM VAL
547+ std::cout << " checking fixed matrix CELLS FROM VAL" << std::endl;
548+ openfluid::ware::WareParams_t Params = {{" deltat" , " 0" }, {" fixedvalue" , " 2.4" }, {" varsize" ," [3,6]" }};
549+
550+ TestSimulation TS;
551+ TS.defaultSetup ();
552+ TS.addGenerator (Specs, Params);
553+ TS.wholeSimulation ();
554+
555+ const auto Matrix = TS.getLatestValue (" SU" , 1 , " a" ).value ()->asMatrixValue ();
556+ BOOST_REQUIRE_CLOSE (Matrix.get (1 ,1 ), 2.4 , 0.00001 );
557+ }
558+ }
0 commit comments