7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for cf3::actions"
12 #include <boost/test/unit_test.hpp>
14 #include <boost/assign/list_of.hpp>
60 using namespace boost::unit_test::framework;
61 Core::instance().initiate( master_test_suite().argc, master_test_suite().argv);
67 Core::instance().terminate();
78 BOOST_AUTO_TEST_SUITE( TestActionsSuite )
84 Core::instance().environment().options().set(
"log_level",(
Uint)
DEBUG);
89 Core::instance().tools().
get_child(
"LoadMesh")->handle<
LoadMesh>()->load_mesh_into(
"../../../resources/rotation-tg-p1.neu", *mesh);
91 std::vector<URI> regions = list_of(mesh->
topology().
uri()/
URI(
"inlet"))
103 BOOST_CHECK_NO_THROW( node_loop2->execute() );
119 Core::instance().tools().
get_child(
"LoadMesh")->handle<
LoadMesh>()->load_mesh_into(
"../../../resources/rotation-tg-p1.neu", *mesh);
121 std::vector<URI> regions = list_of(mesh->
topology().
uri());
124 boost::shared_ptr< MeshTransformer > facebuilder = build_component_abstract_type<MeshTransformer>(
"cf3.mesh.actions.BuildFaces",
"facebuilder");
133 BOOST_CHECK_NO_THROW( face_loop->execute() );
135 boost::shared_ptr< MeshTransformer > info = build_component_abstract_type<MeshTransformer>(
"cf3.mesh.actions.Info",
"info");
136 info->transform(mesh);
152 Core::instance().tools().
get_child(
"LoadMesh")->handle<
LoadMesh>()->load_mesh_into(
"../../../resources/rotation-tg-p1.neu", *mesh);
168 BOOST_CHECK(find_components_recursively<Cells>(mesh->
topology()).size() > 0);
191 compute_volume->
options().
set(
"loop_index",12u);
197 BOOST_CHECK_EQUAL( volumes[P0_space.
connectivity()[12][0]][0] , 0.0035918050864676932);
203 elem_loop->
action(
"cf3.solver.actions.ComputeVolume").
options().
set(
"volume",volumes.
uri());
213 fields.push_back(volumes.
uri());
214 fields.push_back(field.
uri());
215 fields.push_back(areas.
uri());
216 boost::shared_ptr< MeshWriter > gmsh_writer = build_component_abstract_type<MeshWriter>(
"cf3.mesh.gmsh.Writer",
"meshwriter");
217 gmsh_writer->options().set(
"fields",fields);
218 gmsh_writer->options().set(
"mesh",mesh);
219 gmsh_writer->options().set(
"file",
URI(
"quadtriag.msh"));
220 gmsh_writer->execute();
239 std::vector<URI> topology = list_of(mesh->
topology().
uri());
246 compute_all_cell_volumes->options().set(
"regions",topology);
249 compute_all_cell_volumes->action().options().set(
"volume",field.
uri());
252 compute_all_cell_volumes->execute();
255 fields.push_back(field.
uri());
256 boost::shared_ptr< MeshWriter > gmsh_writer = build_component_abstract_type<MeshWriter>(
"cf3.mesh.gmsh.Writer",
"meshwriter");
257 gmsh_writer->options().set(
"fields",fields);
258 gmsh_writer->options().set(
"mesh",mesh);
259 gmsh_writer->options().set(
"file",
URI(
"test_utest-actions_ForAllElementsT.msh"));
260 gmsh_writer->execute();
267 BOOST_AUTO_TEST_SUITE_END()
269 #define CFinfo
these are always defined
Field & create_field(const std::string &name, const Uint cols)
Create a new field in this group.
LoopOperation & create_loop_operation(const std::string action_provider)
Dictionary & create_discontinuous_space(const std::string &space_name, const std::string &space_lib_name, const std::vector< Handle< Entities > > &entities)
BOOST_AUTO_TEST_CASE(Node_Looping_Test)
Basic Classes for Solver applications used by CF.
URI uri() const
Construct the full path.
Handle< Component > access_component(const URI &path) const
Basic Classes for Mesh applications used by COOLFluiD.
const Handle< Space const > & space(const Handle< Entities const > &entities) const
Handle< Component > get_child(const std::string &name)
Top-level namespace for coolfluid.
~CoreInit()
global tear-down
CoreInit()
global initiate
std::vector< URI > fields
boost::shared_ptr< Component > remove_component(const std::string &name)
Remove a (sub)component of this component.
unsigned int Uint
typedef for unsigned int
BOOST_GLOBAL_FIXTURE(GlobalFixture) BOOST_AUTO_TEST_CASE(MeshStats)
Accumulate some statistics about the cell volumes.
virtual void execute()=0
execute the action
Region & topology() const
virtual void execute()
execute the action
Dictionary & geometry_fields() const
Base class for defining CF components.
void set(const std::string &pname, const boost::any &val)
virtual const LoopOperation & action(const std::string &name) const
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.
Connectivity & connectivity()
connectivity table to dictionary entries