7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Tests mesh::actions::SurfaceIntegral"
10 #include <boost/test/unit_test.hpp>
38 m_argc = boost::unit_test::framework::master_test_suite().argc;
39 m_argv = boost::unit_test::framework::master_test_suite().argv;
73 mesh_generator->
options().
set(
"lengths",std::vector<Real>(2,10.));
74 mesh_generator->
options().
set(
"nb_cells",std::vector<Uint>(2,5));
78 boost::shared_ptr<CreateField> create_field = allocate_component<CreateField>(
"create_field");
79 std::vector<std::string> functions;
80 functions.push_back(
"f=1.");
81 create_field->
options().
set(
"functions",functions);
82 create_field->options().set(
"name",std::string(
"field"));
84 create_field->transform(mesh);
88 boost::shared_ptr<SurfaceIntegral> surface_integration = allocate_component<SurfaceIntegral>(
"surface_integration");
89 surface_integration->
options().
set(
"order",1u);
91 BOOST_CHECK_EQUAL(surface_integral,40.);
94 boost::shared_ptr<VolumeIntegral> volume_integration = allocate_component<VolumeIntegral>(
"volume_integration");
95 volume_integration->options().set(
"order",1u);
97 BOOST_CHECK_EQUAL(volume_integral,100.);
105 mesh_generator->
options().
set(
"lengths",std::vector<Real>(3,10.));
106 mesh_generator->
options().
set(
"nb_cells",std::vector<Uint>(3,5));
110 boost::shared_ptr<CreateField> create_field = allocate_component<CreateField>(
"create_field");
111 std::vector<std::string> functions;
112 functions.push_back(
"f=1.");
113 create_field->
options().
set(
"functions",functions);
114 create_field->options().set(
"name",std::string(
"field"));
116 create_field->transform(mesh);
120 boost::shared_ptr<SurfaceIntegral> surface_integration = allocate_component<SurfaceIntegral>(
"surface_integration");
121 surface_integration->
options().
set(
"order",1u);
126 boost::shared_ptr<VolumeIntegral> volume_integration = allocate_component<VolumeIntegral>(
"volume_integration");
127 volume_integration->options().set(
"order",1u);
129 BOOST_CHECK_EQUAL(volume_integral,1000.);
142 BOOST_AUTO_TEST_SUITE_END()
Safe pointer to an object. This is the supported method for referring to components.
int m_argc
possibly common functions used on the tests below
TestFixture()
common setup for each test case
URI uri() const
Construct the full path.
common::URI uri(ComponentWrapper &self)
Generate a simple carthesian P1 mesh without grading.
Mesh & generate()
generate, wraps execute() and returns the mesh reference
Basic Classes for Mesh applications used by COOLFluiD.
BOOST_AUTO_TEST_CASE(Initiate)
Handle< Component > get_child(const std::string &name)
void initiate(int argc, char **argv)
void init(int argc=0, char **args=0)
Top-level namespace for coolfluid.
common::Component & root() const
Gives the default root component.
Action derived classes for mesh manipulations.
Region & topology() const
Handle< Component > handle()
Get a handle to the component.
Dictionary & geometry_fields() const
static Comm & instance()
Return a reference to the current PE.
void set(const std::string &pname, const boost::any &val)
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Most basic kernel library.
~TestFixture()
common tear-down for each test case