7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for the Hexa3D shape function"
10 #include <boost/assign/list_of.hpp>
11 #include <boost/test/unit_test.hpp>
14 #include <Eigen/StdVector>
39 mapped_coords(0.5, 0.4, 0.1),
50 0., 1., 1.).finished()
62 0., 1., 1.).finished()
116 ETYPE::SF::ValueT reference_result;
117 reference_result << 0.03375, 0.10125, 0.23625, 0.07875, 0.04125, 0.12375, 0.28875, 0.09625;
119 ETYPE::SF::ValueT result;
120 ETYPE::SF::compute_value(mapped_coords, result);
123 vector_test(result, reference_result, accumulator);
129 ConstFunctor ftor(unit_nodes);
132 gauss_integrate<1, GeoShape::HEXA>(ftor, ftor.mapped_coords, result);
133 BOOST_CHECK_CLOSE(result, 1., 0.000001);
153 parallelepiped.block<4, 1>(4,
XX).array() += 1.;
154 parallelepiped.block<4, 1>(4,
YY).array() += 0.3;
159 std::vector<ETYPE::NodesT,Eigen::aligned_allocator<ETYPE::NodesT> > test_nodes;
160 test_nodes.push_back(unit_nodes);
161 test_nodes.push_back(skewed_nodes);
162 test_nodes.push_back(inverted);
163 test_nodes.push_back(bignodes);
164 test_nodes.push_back(biginverted);
165 test_nodes.push_back(parallelepiped);
166 const std::vector<Real> ulps_list = boost::assign::list_of(15.)(max_ulps)(max_ulps)(15.)(max_ulps)(20.);
170 ETYPE::SF::ValueT sf;
171 ETYPE::SF::compute_value(mapped_coords, sf);
173 std::cout <<
"Looking for coords " << coords <<
" in mapped coords " << mapped_coords << std::endl;
186 ETYPE::SF::GradientT expected;
187 expected(
KSI, 0) = -0.06750;
188 expected(
ETA, 0) = -0.05625;
189 expected(
ZTA, 0) = -0.03750;
190 expected(
KSI, 1) = 0.06750;
191 expected(
ETA, 1) = -0.16875;
192 expected(
ZTA, 1) = -0.1125;
193 expected(
KSI, 2) = 0.1575;
194 expected(
ETA, 2) = 0.16875;
195 expected(
ZTA, 2) = -0.2625;
196 expected(
KSI, 3) = -0.1575;
197 expected(
ETA, 3) = 0.05625;
198 expected(
ZTA, 3) = -0.08750;
199 expected(
KSI, 4) = -0.08250;
200 expected(
ETA, 4) = -0.06875;
201 expected(
ZTA, 4) = 0.03750;
202 expected(
KSI, 5) = 0.08250;
203 expected(
ETA, 5) = -0.20625;
204 expected(
ZTA, 5) = 0.1125;
205 expected(
KSI, 6) = 0.1925;
206 expected(
ETA, 6) = 0.20625;
207 expected(
ZTA, 6) = 0.2625;
208 expected(
KSI, 7) = -0.1925;
209 expected(
ETA, 7) = 0.06875;
210 expected(
ZTA, 7) = 0.08750;
212 ETYPE::SF::GradientT result;
213 ETYPE::SF::compute_gradient(mapped_coords, result);
229 expected(0,0) = 0.5625;
230 expected(0,1) = 0.06250;
231 expected(0,2) = 0.06250;
232 expected(1,0) = 0.07500;
233 expected(1,1) = 0.5750;
234 expected(1,2) = 0.07500;
235 expected(2,0) = 0.1125;
236 expected(2,1) = 0.1125;
237 expected(2,2) = 0.6125;
250 expected(0,0) = 0.34375;
251 expected(0,1) = -0.03125;
252 expected(0,2) = -0.03125;
253 expected(1,0) = -0.03750;
254 expected(1,1) = 0.3375;
255 expected(1,2) = -0.03750;
256 expected(2,0) = -0.05625;
257 expected(2,1) = -0.05625;
258 expected(2,2) = 0.31875;
285 BOOST_AUTO_TEST_SUITE_END()
static void compute_jacobian_adjoint(const MappedCoordsT &mapped_coord, const NodesT &nodes, JacobianT &result)
~Hexa3DFixture()
common tear-down for each test case
boost::proto::terminal< SFOp< JacobianDeterminantOp > >::type const jacobian_determinant
static void compute_jacobian(const MappedCoordsT &mapped_coord, const NodesT &nodes, MatrixType &jacobian)
static Real jacobian_determinant(const MappedCoordsT &mapped_coord, const NodesT &nodes)
ETYPE::MappedCoordsT mapped_coords
static bool is_coord_in_element(const CoordsT &coord, const NodesT &nodes)
Real max(const Real a, const Real b)
Maximum between two scalars.
Hexa3DFixture()
common setup for each test case
Real e()
Definition of the Unit charge [C].
boost::proto::terminal< SFOp< NodesOp > >::type const nodes
ConstFunctor(const ETYPE::NodesT &node_list)
Eigen::Matrix< Real, nb_nodes, Hexa3D_traits::dimension > NodesT
Basic Classes for Mesh applications used by COOLFluiD.
const ETYPE::NodesT skewed_nodes
namespace holding LagrangeP1 shape functions and elements
const ETYPE::NodesT unit_nodes
Top-level namespace for coolfluid.
static void compute_mapped_coordinate(const CoordsT &coord, const NodesT &nodes, MappedCoordsT &mapped_coord)
BOOST_AUTO_TEST_CASE(Volume)
Eigen::Matrix< Real, Hexa3D_traits::dimension, 1 > CoordsT
Functions to provide integration over elements.
Hexa3D_traits::SF::MappedCoordsT MappedCoordsT
unsigned int Uint
typedef for unsigned int
const ETYPE::MappedCoordsT mapped_coords
common values accessed by all tests goes here
const ETYPE::NodesT & m_nodes
static Real volume(const NodesT &nodes)
Eigen::Matrix< Real, Hexa3D_traits::SF::dimensionality, Hexa3D_traits::dimension > JacobianT
static const Uint nb_nodes
2D Lagrange P1 Triangular Element type This class provides the lagrangian shape function describing t...