7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Proposition for new element / shapefunction API"
11 #include <boost/test/unit_test.hpp>
53 LagrangeP0::Triag::MappedCoordsT mapped_coord = (LagrangeP0::Triag::MappedCoordsT() << 0, 0 ).finished();
55 LagrangeP0::Triag::ValueT values = LagrangeP0::Triag::value( mapped_coord );
56 const RealMatrix& local_coords = LagrangeP0::Triag::local_coordinates();
58 std::cout <<
"static : values = " << values << std::endl;
59 std::cout <<
"static : local_coords = " << local_coords << std::endl;
61 LagrangeP0::Triag::compute_value(mapped_coord, values);
62 std::cout <<
"static : values = " << values << std::endl;
64 const RealMatrix& line_local_coords = LagrangeP1::Line::local_coordinates();
74 boost::shared_ptr<ShapeFunction> sf = allocate_component< ShapeFunctionT<LagrangeP0::Triag> >(
"sf");
77 const RealMatrix& local_coords = sf->local_coordinates();
80 std::cout <<
"dynamic: local_coords = " << local_coords << std::endl;
82 sf->compute_value(mapped_coord,values);
83 std::cout <<
"dynamic: values = " << values << std::endl;
98 std::cout <<
"static : centroid = " << centroid.transpose() << std::endl;
112 boost::shared_ptr< ElementType > etype = build_component_abstract_type<ElementType>(
"cf3.mesh.LagrangeP1.Triag2D",
"etype");
113 etype->compute_centroid(nodes,centroid);
114 std::cout <<
"dynamic: centroid = " << centroid.transpose() << std::endl;
123 boost::shared_ptr< ElementType > quad_face = build_component_abstract_type<ElementType>(
"cf3.mesh.LagrangeP1.Quad3D",
"etype");
133 quad_face->compute_normal(quad_face_nodes,
normal);
134 std::cout <<
"dynamic: normal = " <<
normal.transpose() << std::endl;
135 std::cout <<
"dynamic: sf = " << etype->shape_function().derived_type_name() << std::endl;
136 std::cout <<
"dynamic: sf = " << quad_face->shape_function().derived_type_name() << std::endl;
137 std::cout <<
"dynamic: sf = " << etype->face_type(0).derived_type_name() << std::endl;
139 std::cout <<
"dynamic: type = " << etype->derived_type_name() << std::endl;
146 BOOST_AUTO_TEST_SUITE_END()
boost::proto::terminal< SFOp< NormalOp > >::type const normal
Translation from dynamic to static API.
~Test_ShapeFunction_Fixture()
common tear-down for each test case
BOOST_AUTO_TEST_CASE(sf_static_version)
2D Lagrange P1 Triangular Element type This class provides the lagrangian shape function describing t...
static void compute_centroid(const NodesT &nodes, CoordsT ¢roid)
boost::proto::terminal< SFOp< NodesOp > >::type const nodes
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealMatrix
Dynamic sized matrix of Real scalars.
Holds the Component class, as well as the ComponentIterator class plus some functions related to comp...
Eigen::Matrix< Real, nb_nodes, Hexa3D_traits::dimension > NodesT
Eigen::Matrix< Real, 1, Eigen::Dynamic > RealRowVector
Dynamic sized row vector.
Basic Classes for Mesh applications used by COOLFluiD.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Top-level namespace for coolfluid.
Eigen::Matrix< Real, Hexa3D_traits::dimension, 1 > CoordsT
common::Environment & environment() const
void set(const std::string &pname, const boost::any &val)
Test_ShapeFunction_Fixture()
common setup for each test case
Most basic kernel library.