33 #ifndef __H__UG__REFERENCE_MAPPING_TEST__
34 #define __H__UG__REFERENCE_MAPPING_TEST__
51 void OctReferenceMappingTest(std::vector<number> vCornerCoord0, std::vector<number> vCornerCoord1, std::vector<number> vCornerCoord2,
52 std::vector<number> vCornerCoord3, std::vector<number> vCornerCoord4, std::vector<number> vCornerCoord5,
53 std::vector<number> vGlobPos)
55 UG_LOG(
">> Starting OctReferenceMappingTest: " << std::endl);
57 std::vector<MathVector<3, number> > vCornerCoords;
58 std::vector<MathVector<3, number> > vLocPos(1, 0.0);
59 std::vector<MathVector<3, number> > vGlobPositions;
62 vGlobPositions.push_back(GlobPos);
64 MathVector<3> CornerCoord0(vCornerCoord0[0], vCornerCoord0[1], vCornerCoord0[2]);
65 MathVector<3> CornerCoord1(vCornerCoord1[0], vCornerCoord1[1], vCornerCoord1[2]);
66 MathVector<3> CornerCoord2(vCornerCoord2[0], vCornerCoord2[1], vCornerCoord2[2]);
67 MathVector<3> CornerCoord3(vCornerCoord3[0], vCornerCoord3[1], vCornerCoord3[2]);
68 MathVector<3> CornerCoord4(vCornerCoord4[0], vCornerCoord4[1], vCornerCoord4[2]);
69 MathVector<3> CornerCoord5(vCornerCoord5[0], vCornerCoord5[1], vCornerCoord5[2]);
71 vCornerCoords.push_back(CornerCoord0);
72 vCornerCoords.push_back(CornerCoord1);
73 vCornerCoords.push_back(CornerCoord2);
74 vCornerCoords.push_back(CornerCoord3);
75 vCornerCoords.push_back(CornerCoord4);
76 vCornerCoords.push_back(CornerCoord5);
83 UG_CATCH_THROW(
"OctReferenceMappingTest() could not map global to local.");
85 UG_LOG(
"Calculated vLocPos: " << vLocPos[0] << std::endl);
89 void TetReferenceMappingTest(std::vector<number> vCornerCoord0, std::vector<number> vCornerCoord1, std::vector<number> vCornerCoord2,
90 std::vector<number> vCornerCoord3, std::vector<number> vGlobPos)
92 UG_LOG(
">> Starting TetReferenceMappingTest: " << std::endl);
94 std::vector<MathVector<3, number> > vCornerCoords;
95 std::vector<MathVector<3, number> > vLocPos(1, 0.0);
96 std::vector<MathVector<3, number> > vGlobPositions;
99 vGlobPositions.push_back(GlobPos);
101 MathVector<3> CornerCoord0(vCornerCoord0[0], vCornerCoord0[1], vCornerCoord0[2]);
102 MathVector<3> CornerCoord1(vCornerCoord1[0], vCornerCoord1[1], vCornerCoord1[2]);
103 MathVector<3> CornerCoord2(vCornerCoord2[0], vCornerCoord2[1], vCornerCoord2[2]);
104 MathVector<3> CornerCoord3(vCornerCoord3[0], vCornerCoord3[1], vCornerCoord3[2]);
106 vCornerCoords.push_back(CornerCoord0);
107 vCornerCoords.push_back(CornerCoord1);
108 vCornerCoords.push_back(CornerCoord2);
109 vCornerCoords.push_back(CornerCoord3);
116 UG_CATCH_THROW(
"TetReferenceMappingTest() could not map global to local.");
118 UG_LOG(
"Calculated vLocPos: " << vLocPos[0] << std::endl);
124 std::vector<number> vGlobPos)
126 UG_LOG(
">> Starting EdgeReferenceMappingTest: " << std::endl);
128 std::vector<MathVector<3, number> > vCornerCoords;
129 std::vector<MathVector<1, number> > vLocPos(1, 0.0);
130 std::vector<MathVector<3, number> > vGlobPositions;
132 MathVector<3> GlobPos(vGlobPos[0], vGlobPos[1], vGlobPos[2]);
133 vGlobPositions.push_back(GlobPos);
135 MathVector<3> CornerCoord0(vCornerCoord0[0], vCornerCoord0[1], vCornerCoord0[2]);
136 MathVector<3> CornerCoord1(vCornerCoord1[0], vCornerCoord1[1], vCornerCoord1[2]);
138 vCornerCoords.push_back(CornerCoord0);
139 vCornerCoords.push_back(CornerCoord1);
146 UG_CATCH_THROW(
"EdgeReferenceMappingTest() could not map global to local.");
148 UG_LOG(
"Calculated vLocPos: " << vLocPos[0] << std::endl);
virtual base class for reference mappings
Definition: reference_mapping_provider.h:53
virtual void global_to_local(MathVector< dim > &locPos, const MathVector< worldDim > &globPos, const size_t maxIter=1000, const number tol=1e-10) const =0
map global coordinate to local coordinate
a mathematical Vector with N entries.
Definition: math_vector.h:97
#define UG_CATCH_THROW(msg)
Definition: error.h:64
#define UG_LOG(msg)
Definition: log.h:367
bool PointIsInsideTetrahedron(const vector_t &v, const vector_t &v0, const vector_t &v1, const vector_t &v2, const vector_t &v3)
Returns true if the point lies inside or on the boundary of a tetrahedron.
Definition: math_util_impl.hpp:1110
@ ROID_TETRAHEDRON
Definition: grid_base_objects.h:80
@ ROID_EDGE
Definition: grid_base_objects.h:77
@ ROID_OCTAHEDRON
Definition: grid_base_objects.h:84
void TetReferenceMappingTest(std::vector< number > vCornerCoord0, std::vector< number > vCornerCoord1, std::vector< number > vCornerCoord2, std::vector< number > vCornerCoord3, std::vector< number > vGlobPos)
Definition: reference_mapping_test.h:89
void OctReferenceMappingTest(std::vector< number > vCornerCoord0, std::vector< number > vCornerCoord1, std::vector< number > vCornerCoord2, std::vector< number > vCornerCoord3, std::vector< number > vCornerCoord4, std::vector< number > vCornerCoord5, std::vector< number > vGlobPos)
Definition: reference_mapping_test.h:51
void EdgeReferenceMappingTest(std::vector< number > vCornerCoord0, std::vector< number > vCornerCoord1, std::vector< number > vGlobPos)
Definition: reference_mapping_test.h:123