7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Tests mesh::actions::FieldCreation"
10 #include <boost/test/unit_test.hpp>
44 m_argc = boost::unit_test::framework::master_test_suite().argc;
45 m_argv = boost::unit_test::framework::master_test_suite().argv;
85 mesh_generator->
options().
set(
"nb_cells",std::vector<Uint>(2,10));
88 boost::shared_ptr<Rotate> rotate_mesh = allocate_component<Rotate>(
"rotate_mesh");
91 rotate_mesh->options().set(
"axis_point",std::vector<Real>(2,
math::Consts::pi()));
92 rotate_mesh->execute();
94 boost::shared_ptr<CreateField> create_field = allocate_component<CreateField>(
"create_field");
95 std::vector<std::string> functions;
96 functions.push_back(
"f=cos(x)+cos(y)");
97 functions.push_back(
"U[2]=[x,y]");
98 create_field->options().set(
"functions",functions);
99 create_field->options().set(
"name",std::string(
"field"));
101 create_field->transform(rect);
106 boost::shared_ptr<ComputeFieldGradient> compute_gradient = allocate_component<ComputeFieldGradient>(
"compute_gradient");
109 compute_gradient->options().set(
"field",field.
handle());
110 compute_gradient->options().set(
"field_gradient",grad.handle());
112 compute_gradient->execute();
115 fields.push_back(field.
uri());
116 fields.push_back(grad.uri());
117 rect.
write_mesh(
"file:out-utest-mesh-actions-fieldcreation.msh",fields);
130 BOOST_AUTO_TEST_SUITE_END()
void write_mesh(const common::URI &file, const std::vector< common::URI > fields=std::vector< common::URI >())
Field & create_field(const std::string &name, const Uint cols)
Create a new field in this group.
static Handle< Mesh > mesh
common values accessed by all tests goes here
URI uri() const
Construct the full path.
common::URI uri(ComponentWrapper &self)
Generate a simple carthesian P1 mesh without grading.
~TestFieldCreation_Fixture()
common tear-down for each test case
Real pi()
Definition of the Pi constant.
Mesh & generate()
generate, wraps execute() and returns the mesh reference
Basic Classes for Mesh applications used by COOLFluiD.
Handle< Component > get_child(const std::string &name)
void initiate(int argc, char **argv)
int m_argc
possibly common functions used on the tests below
Top-level namespace for coolfluid.
BOOST_AUTO_TEST_CASE(execute)
std::vector< URI > fields
common::Component & root() const
Gives the default root component.
Action derived classes for mesh manipulations.
Classes offering a MPI interface for COOLFluiD.
Handle< Component > handle()
Get a handle to the component.
Dictionary & geometry_fields() const
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.
TestFieldCreation_Fixture()
common setup for each test case