OGS
anonymous_namespace{MapBulkElementPoint.cpp} Namespace Reference

Functions

MathLib::Point3d getBulkElementPointLine (std::size_t const face_id)
MathLib::Point3d getBulkElementPointTri (std::size_t const face_id, MathLib::WeightedPoint const &wp)
MathLib::Point3d getBulkElementPointQuad (std::size_t const face_id, MathLib::WeightedPoint const &wp)
MathLib::Point3d getBulkElementPointHex (std::size_t const face_id, MathLib::WeightedPoint const &wp)
MathLib::Point3d getBulkElementPointPrism (std::size_t const face_id, MathLib::WeightedPoint const &wp)
MathLib::Point3d getBulkElementPointPyramid (std::size_t const face_id, MathLib::WeightedPoint const &wp)
MathLib::Point3d getBulkElementPointTet (std::size_t const face_id, MathLib::WeightedPoint const &wp)

Function Documentation

◆ getBulkElementPointHex()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointHex ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given 2d boundary point wp of a hexahedron face to the corresponding 3d point of the hexahedron.

The input and output coordinates are natural coordinates of the quad and hex, respectively.

Definition at line 88 of file MapBulkElementPoint.cpp.

90{
91 auto const r = wp[0];
92 auto const s = wp[1];
93
94 switch (face_id)
95 {
96 case 0:
97 return MathLib::Point3d{{-s, -r, -1}};
98 case 1:
99 return MathLib::Point3d{{-r, -1, -s}};
100 case 2:
101 return MathLib::Point3d{{+1, -r, -s}};
102 case 3:
103 return MathLib::Point3d{{+r, +1, -s}};
104 case 4:
105 return MathLib::Point3d{{-1, +r, -s}};
106 case 5:
107 return MathLib::Point3d{{-r, -s, +1}};
108 default:
109 OGS_FATAL("Invalid face id '{:d}' for the hexahedron.", face_id);
110 }
111}
#define OGS_FATAL(...)
Definition Error.h:19

References OGS_FATAL.

◆ getBulkElementPointLine()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointLine ( std::size_t const face_id)

Maps the given 0d end point wp of a line to the corresponding 1d point on the line.

The result is given in local coordinates of the line element.

Definition at line 14 of file MapBulkElementPoint.cpp.

15{
16 switch (face_id)
17 {
18 case 0:
19 return MathLib::Point3d{{-1, 0, 0}};
20 case 1:
21 return MathLib::Point3d{{1, 0, 0}};
22 default:
23 OGS_FATAL("Invalid face id '{:d}' for a line.", face_id);
24 }
25}

References OGS_FATAL.

◆ getBulkElementPointPrism()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointPrism ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given lower dimensional 2d boundary point wp of a quad or triangle element, given in local coordinates of the quad or triangle, to a 3d point existing on a prism face also in local coordinates.

Definition at line 116 of file MapBulkElementPoint.cpp.

118{
119 auto const r = wp[0];
120 auto const s = wp[1];
121
122 switch (face_id)
123 {
124 case 0:
125 // tri, top; r, s in [0, 1]
126 return MathLib::Point3d{{s, r, -1}};
127 case 1:
128 {
129 // quad; r, s in [-1, 1]
130 auto const r01 = 0.5 * (r + 1); // in [0, 1]
131 return MathLib::Point3d{{1 - r01, 0, -s}};
132 }
133 case 2:
134 {
135 // quad; r, s in [-1, 1]
136 auto const r01 = 0.5 * (r + 1); // in [0, 1]
137 return MathLib::Point3d{{r01, 1 - r01, -s}};
138 }
139 case 3:
140 {
141 // quad; r, s in [-1, 1]
142 auto const r01 = 0.5 * (r + 1); // in [0, 1]
143 return MathLib::Point3d{{0, r01, -s}};
144 }
145 case 4:
146 // tri, bottom; r, s in [0, 1]
147 return MathLib::Point3d{{r, s, 1}};
148 default:
149 OGS_FATAL("Invalid face id '{:d}' for the prism.", face_id);
150 }
151}

References OGS_FATAL.

◆ getBulkElementPointPyramid()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointPyramid ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given lower dimensional 2d boundary point wp of a quad or triangle element, given in local coordinates of the quad or triangle, to a 3d point existing on a pyramid face also in local coordinates.

Definition at line 156 of file MapBulkElementPoint.cpp.

158{
159 auto const r = wp[0]; // in [0, 1] on tri faces, in [-1, 1] on quad face
160 auto const s = wp[1]; // in [0, 1] on tri faces, in [-1, 1] on quad face
161
162 // for tri phases, note: there r + s == 1, i.e., s == 1 => r == 0
163 auto const z = 2 * s - 1; // in [-1, 1] on tri faces
164 auto const w = s == 1 ? -1 : 2 * r / (1 - s) - 1;
165
166 switch (face_id)
167 {
168 case 0:
169 return MathLib::Point3d{{+w, -1.0, z}};
170 case 1:
171 return MathLib::Point3d{{+1.0, +w, z}};
172 case 2:
173 return MathLib::Point3d{{-w, +1.0, z}};
174 case 3:
175 return MathLib::Point3d{{-1.0, -w, z}};
176 case 4:
177 return MathLib::Point3d{{-s, -r, -1.0}};
178 default:
179 OGS_FATAL("Invalid face id '{:d}' for the pyramid.", face_id);
180 }
181}

References OGS_FATAL.

◆ getBulkElementPointQuad()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointQuad ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given lower dimensional boundary point wp of a line, i.e. the 1d integration point given in local coordinates of a line, to higher dimensional point of the quad face (defined by the quad element and the face id) also in local coordinates of the quad face.

Parameters
face_idthe id of the quad face the point will be mapped on
wpthe integration point of the lower dimensional element
Returns
the mapped point

Definition at line 63 of file MapBulkElementPoint.cpp.

65{
66 auto const r = wp[0];
67
68 switch (face_id)
69 {
70 case 0:
71 return MathLib::Point3d{{-r, +1, 0}};
72 case 1:
73 return MathLib::Point3d{{-1, -r, 0}};
74 case 2:
75 return MathLib::Point3d{{+r, -1, 0}};
76 case 3:
77 return MathLib::Point3d{{+1, +r, 0}};
78 default:
79 OGS_FATAL("Invalid face id '{:d}' for the quad.", face_id);
80 }
81}

References OGS_FATAL.

◆ getBulkElementPointTet()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointTet ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given lower dimensional 2d boundary point wp of a triangle element, given in local coordinates of the quad or triangle, to a 3d point existing on a tet face also in local coordinates.

Definition at line 186 of file MapBulkElementPoint.cpp.

188{
189 auto const r = wp[0];
190 auto const s = wp[1];
191 auto const t = 1 - r - s;
192
193 switch (face_id)
194 {
195 case 0:
196 return MathLib::Point3d{{s, r, 0}};
197 case 1:
198 return MathLib::Point3d{{r, 0, s}};
199 case 2:
200 return MathLib::Point3d{{t, r, s}};
201 case 3:
202 return MathLib::Point3d{{0, t, s}};
203 default:
204 OGS_FATAL("Invalid face id '{:d}' for the tetrahedron.", face_id);
205 }
206}

References OGS_FATAL.

◆ getBulkElementPointTri()

MathLib::Point3d anonymous_namespace{MapBulkElementPoint.cpp}::getBulkElementPointTri ( std::size_t const face_id,
MathLib::WeightedPoint const & wp )

Maps the given lower dimensional boundary point wp of a line, i.e. the 1d integration point given in local coordinates of a line, to higher dimensional point of the triangle face (defined by the triangle element and the face id) also in local coordinates of the triangle element.

Parameters
face_idthe id of the triangle face the point will be mapped on
wpthe integration point of the lower dimensional element
Returns
the mapped point

Definition at line 35 of file MapBulkElementPoint.cpp.

37{
38 // wp is a local coordinate of the 1D line face of the triangle. I.e., wp
39 // has only one relevant coordinate. This coordinate runs from -1 to 1.
40 auto const r = 0.5 * (wp[0] + 1); // in [0, 1]
41
42 switch (face_id)
43 {
44 case 0:
45 return MathLib::Point3d{{r, 0, 0}};
46 case 1:
47 return MathLib::Point3d{{1 - r, r, 0}};
48 case 2:
49 return MathLib::Point3d{{0, 1 - r, 0}};
50 default:
51 OGS_FATAL("Invalid face id '{:d}' for the tri.", face_id);
52 }
53}

References OGS_FATAL.