7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for cf3::math::VariablesDescriptor"
10 #include <boost/test/unit_test.hpp>
23 BOOST_AUTO_TEST_SUITE( VariablesDescriptorSuite )
30 boost::shared_ptr<VariablesDescriptor>
descriptor = allocate_component<VariablesDescriptor>(
"descriptor");
35 BOOST_CHECK_EQUAL(descriptor->size(), 1);
36 BOOST_CHECK_EQUAL(descriptor->user_variable_name(
"a"),
"a");
38 descriptor->options().set(
"a_variable_name", std::string(
"b"));
40 BOOST_CHECK_EQUAL(descriptor->user_variable_name(
"a"),
"b");
46 boost::shared_ptr<VariablesDescriptor>
descriptor = allocate_component<VariablesDescriptor>(
"descriptor");
54 BOOST_CHECK_EQUAL(descriptor->size(), 8);
55 BOOST_CHECK_EQUAL(descriptor->size(
"v1"), 2);
56 BOOST_CHECK_EQUAL(descriptor->size(
"v2"), 2);
57 BOOST_CHECK_EQUAL(descriptor->size(
"t1"), 4);
58 BOOST_CHECK_EQUAL(descriptor->offset(
"v1"), 0);
59 BOOST_CHECK_EQUAL(descriptor->offset(
"v2"), 2);
60 BOOST_CHECK_EQUAL(descriptor->offset(
"t1"), 4);
63 BOOST_CHECK_EQUAL(descriptor->size(), 15);
64 BOOST_CHECK_EQUAL(descriptor->size(
"v1"), 3);
65 BOOST_CHECK_EQUAL(descriptor->size(
"v2"), 3);
66 BOOST_CHECK_EQUAL(descriptor->size(
"t1"), 9);
67 BOOST_CHECK_EQUAL(descriptor->offset(
"v1"), 0);
68 BOOST_CHECK_EQUAL(descriptor->offset(
"v2"), 3);
69 BOOST_CHECK_EQUAL(descriptor->offset(
"t1"), 6);
72 BOOST_CHECK_EQUAL(descriptor->description(),
"v1[vector],v2[vector],t1[tensor],s[scalar]");
78 boost::shared_ptr<VariablesDescriptor>
descriptor = allocate_component<VariablesDescriptor>(
"descriptor");
83 descriptor->set_variables(
"a, b[v], c[t]");
85 BOOST_CHECK_EQUAL(descriptor->size(), 7);
86 BOOST_CHECK_EQUAL(descriptor->description(),
"a[scalar],b[vector],c[tensor]");
89 BOOST_CHECK_EQUAL(descriptor->dimensionality(
"b"), VariablesDescriptor::Dimensionalities::VECTOR);
90 BOOST_CHECK_EQUAL(descriptor->dimensionality(
"c"), VariablesDescriptor::Dimensionalities::TENSOR);
96 boost::shared_ptr<VariablesDescriptor>
descriptor = allocate_component<VariablesDescriptor>(
"descriptor");
101 descriptor->set_variables(
"a[5]");
103 BOOST_CHECK_EQUAL(descriptor->size(), 5);
104 BOOST_CHECK_EQUAL(descriptor->description(),
"a1[scalar],a2[scalar],a3[scalar],a4[scalar],a5[scalar]");
109 BOOST_AUTO_TEST_SUITE_END()
111
Basic Classes for Mathematical applications used by COOLFluiD.
BOOST_AUTO_TEST_CASE(PushBackScalar)
Top-level namespace for coolfluid.
Most basic kernel library.