7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for heat-conduction related proto operations"
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
15 #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 10
50 using namespace boost;
59 BOOST_CHECK_CLOSE(a, b, threshold);
104 for(
Uint i = 0; i != 100; ++i)
106 const Real
n = 1. + 2. *
static_cast<Real
>(i);
118 T = T*(initial_temp - ambient_temp) + ambient_temp
157 boost::shared_ptr<solver::actions::Iterate> time_loop = allocate_component<solver::actions::Iterate>(
"TimeLoop");
165 boost::mpl::vector1<mesh::LagrangeP1::Line1D> allowed_elements;
168 boost::shared_ptr<UFEM::BoundaryConditions>
bc = allocate_component<UFEM::BoundaryConditions>(
"BoundaryConditions");
175 << allocate_component<math::LSS::ZeroLSS>(
"ZeroLSS")
176 << create_proto_action
188 _T(temperature) += lss_action->invdt() *
transpose(
N(temperature))*
N(temperature)
190 lss_action->system_matrix +=
_T + 0.5 *
_A,
196 << allocate_component<math::LSS::SolveLSS>(
"SolveLSS")
205 boost::shared_ptr<MeshGenerator>
create_line = build_component_abstract_type<MeshGenerator>(
"cf3.mesh.SimpleMeshGenerator",
"create_line");
206 create_line->options().set(
"mesh",domain.uri()/
"Mesh");
207 create_line->options().set(
"lengths",std::vector<Real>(
DIM_1D,
length));
208 create_line->options().set(
"nb_cells",std::vector<Uint>(
DIM_1D, nb_segments));
209 Mesh&
mesh = create_line->generate();
211 lss_action->options().set(
"regions", std::vector<URI>(1, mesh.
topology().
uri()));
212 ic->get_child(
"Initialize")->options().set(
"regions", std::vector<URI>(1, mesh.
topology().
uri()));
213 ic->get_child(
"InitializeAnalytical")->options().set(
"regions", std::vector<URI>(1, mesh.
topology().
uri()));
215 bc->add_constant_bc(
"xneg",
"Temperature", ambient_temp);
216 bc->add_constant_bc(
"xpos",
"Temperature", ambient_temp);
228 std::cout <<
"Checking solution at time " << t << std::endl;
229 set_analytical_solution(mesh.
topology(),
"TemperatureAnalytical", UFEM::Tags::source_terms());
236 std::cout << solver.
tree() << std::endl;
239 BOOST_AUTO_TEST_SUITE_END()
boost::proto::terminal< SFOp< ShapeFunctionOp > >::type const N
std::vector< std::string > StringsT
Time & create_time(const std::string &name="Time")
Create Time component.
static boost::proto::terminal< ZeroTag >::type _0
Placeholder for the zero matrix.
virtual mesh::Domain & create_domain(const std::string &name)
creates a domain in this model
Safe pointer to an object. This is the supported method for referring to components.
external boost library namespace
virtual physics::PhysModel & create_physics(const std::string &builder)
static boost::proto::terminal< ElementSystemMatrix< boost::mpl::int_< 0 > > >::type const _A
Some predefined element matrices (more can be user-defined, but you have to change the number in the ...
Handle< common::Action > add_unsteady_solver(const std::string &builder_name)
static boost::proto::terminal< ElementSystemMatrix< boost::mpl::int_< 1 > > >::type const _T
Basic Classes for Solver applications used by CF.
URI uri() const
Construct the full path.
static boost::proto::terminal< NodalValuesTag >::type const nodal_values
static boost::proto::terminal< ElementQuadratureTag >::type element_quadrature
Use element_quadrature(expr1, expr2, ..., exprN) to evaluate a group of expressions.
boost::shared_ptr< ElementsExpression< ExprT, ElementTypes > > elements_expression(ElementTypes, const ExprT &expr)
static boost::proto::terminal< double(*)(double) >::type const _exp
Manage a collection of UFEM solvers.
void for_each_node(mesh::Region &root_region, const ExprT &expr)
Static functions for mathematical constants.
std::vector< Uint > SizesT
Storage for time, and time steps for unsteady simulation.
boost::proto::terminal< TransposeFunction >::type const transpose
boost::proto::terminal< SFOp< NablaOp > >::type const nabla
Real pi()
Definition of the Pi constant.
void check_close(const Real a, const Real b, const Real threshold)
Check close, fo testing purposes.
const Uint write_interval
Basic Classes for Mesh applications used by COOLFluiD.
BOOST_AUTO_TEST_CASE(InitMPI)
tuple model
Global confifuration.
Handle< Component > get_child(const std::string &name)
static boost::proto::terminal< void(*)(Real, Real, Real) >::type const _check_close
void init(int argc=0, char **args=0)
Top-level namespace for coolfluid.
virtual void simulate()
Simulates this model.
std::string tree(bool basic_mode=false, Uint depth=0, Uint recursion_level=0) const
boost::proto::terminal< SFOp< CoordinatesOp > >::type const coordinates
static boost::proto::terminal< double(*)(double) >::type const _sin
common::Component & root() const
Gives the default root component.
static boost::proto::terminal< ExpressionGroupTag >::type group
Use group(expr1, expr2, ..., exprN) to evaluate a group of expressions.
common::Environment & environment() const
unsigned int Uint
typedef for unsigned int
boost::shared_ptr< ProtoAction > create_proto_action(const std::string &name, const boost::shared_ptr< Expression > &expression)
Create a new ProtoAction, immediatly setting the expression.
Region & topology() const
boost::shared_ptr< NodesExpression< ExprT, boost::mpl::range_c< Uint, 1, 4 > > > nodes_expression(const ExprT &expr)
Time & time()
Reference to the time.
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.
void set_analytical_solution(Region ®ion, const std::string &field_name, const std::string &var_name)
Write the analytical solution, according to "A Heat transfer textbook", section 5.3.