7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Tests the assembly on a single element"
10 #include <boost/test/unit_test.hpp>
12 #define BOOST_PROTO_MAX_ARITY 10
13 #ifdef BOOST_MPL_LIMIT_METAFUNCTION_ARITY
14 #undef BOOST_MPL_LIMIT_METAFUNCTION_ARITY
16 #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 10
44 using namespace boost;
51 template<U
int Dim,
typename ExprT>
52 void run_model(
const boost::shared_ptr<Mesh>&
mesh,
const ExprT& initial_condition_expression,
const Real
eps = 1
e-10)
54 boost::shared_ptr<common::Group>
root = allocate_component<Group>(
"Root");
57 physics::PhysModel& physical_model = model->create_physics(
"cf3.UFEM.NavierStokesPhysics");
64 physical_model.
options().
set(
"dynamic_viscosity", 1.);
71 domain.add_component(mesh);
72 mesh->raise_mesh_loaded();
74 solver->configure_option_recursively(
"regions", std::vector<URI>(1, mesh->topology().uri()));
77 const std::vector<std::string> disabled_actions = boost::assign::list_of(
"BoundaryConditions")(
"SolveLSS")(
"Update");
78 lss_action->options().set(
"disabled_actions", disabled_actions);
80 lss_action->options().set(
"use_specializations",
true);
83 for_each_node<Dim>(mesh->topology(), initial_condition_expression);
89 for(
Uint i = 0; i != matsize; ++i)
90 for(
Uint j = 0; j != matsize; ++j)
91 lss.
matrix()->get_value(i, j, spec_result(i,j));
93 lss_action->options().set(
"use_specializations",
false);
98 for(
Uint i = 0; i != matsize; ++i)
99 for(
Uint j = 0; j != matsize; ++j)
100 lss.
matrix()->get_value(i, j, generic_result(i,j));
108 boost::shared_ptr<Mesh> mesh_ptr = allocate_component<Mesh>(
"mesh");
110 mesh.initialize_nodes(3, 2);
111 Dictionary& geometry_dict = mesh.geometry_fields();
113 coords << a[0] << a[1] << b[0] << b[1] << c[0] << c[1];
116 Elements& cells = mesh.topology().create_region(
"cells").create_elements(
"cf3.mesh.LagrangeP1.Triag2D", geometry_dict);
125 boost::shared_ptr<Mesh> mesh_ptr = allocate_component<Mesh>(
"mesh");
128 mesh.initialize_nodes(4, 3);
129 Dictionary& geometry_dict = mesh.geometry_fields();
131 coords << a[0] << a[1] << a[2] << b[0] << b[1] << b[2] << c[0] << c[1] << c[2] << d[0] << d[1] << d[2];
134 Elements& cells = mesh.topology().create_region(
"cells").create_elements(
"cf3.mesh.LagrangeP1.Tetra3D", geometry_dict);
143 for(
Uint i = 0; i != a.rows(); ++i)
144 for(
Uint j = 0; j != a.cols(); ++j)
145 BOOST_CHECK_CLOSE(
a(i,j),
b(i,j),
eps);
200 RealMatrix3 n_op; n_op << 0., 1., 0., -1., 0., 0., 0., 0., 0.;
205 BOOST_AUTO_TEST_SUITE_END()
void check_close(const Real a, const Real b, const Real threshold)
Check close, for testing purposes.
boost::shared_ptr< Mesh > create_tetra(const RealVector3 &a, const RealVector3 &b, const RealVector3 &c, const RealVector3 &d)
boost::shared_ptr< Mesh > create_triangle(const RealVector2 &a, const RealVector2 &b, const RealVector2 &c)
void check_close(const RealMatrix &a, const RealMatrix &b, const Real eps)
Safe pointer to an object. This is the supported method for referring to components.
external boost library namespace
Space & geometry_space() const
Basic Classes for Solver applications used by CF.
Handle< LSS::Matrix > matrix()
Accessor to matrix.
const Field & coordinates() const
Real e()
Definition of the Unit charge [C].
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealMatrix
Dynamic sized matrix of Real scalars.
void run_model(const boost::shared_ptr< Mesh > &mesh, const ExprT &initial_condition_expression, const Real eps=1e-10)
Storage for time, and time steps for unsteady simulation.
BOOST_AUTO_TEST_CASE(InitMPI)
Basic Classes for Mesh applications used by COOLFluiD.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
tuple model
Global confifuration.
void init(int argc=0, char **args=0)
Top-level namespace for coolfluid.
std::vector< std::string > StringsT
void resize(const Uint nb_elem)
std::vector< Uint > SizesT
common::Environment & environment() const
boost::shared_ptr< Component > remove_component(const std::string &name)
Remove a (sub)component of this component.
unsigned int Uint
typedef for unsigned int
Eigen::Matrix< Real, 2, 2 > RealMatrix2
Fixed size 2x2 matrix.
Eigen::Matrix< Real, 2, 1 > RealVector2
Fixed size 2x1 column vector.
Eigen::Matrix< Real, 3, 3 > RealMatrix3
Fixed size 3x3 matrix.
static Comm & instance()
Return a reference to the current PE.
void set(const std::string &pname, const boost::any &val)
Most basic kernel library.
Connectivity & connectivity()
connectivity table to dictionary entries
Eigen::Matrix< Real, 3, 1 > RealVector3
Fixed size 3x1 column vector.