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 95 of file MapBulkElementPoint.cpp.

97{
98 auto const r = wp[0];
99 auto const s = wp[1];
100
101 switch (face_id)
102 {
103 case 0:
104 return MathLib::Point3d{{-s, -r, -1}};
105 case 1:
106 return MathLib::Point3d{{-r, -1, -s}};
107 case 2:
108 return MathLib::Point3d{{+1, -r, -s}};
109 case 3:
110 return MathLib::Point3d{{+r, +1, -s}};
111 case 4:
112 return MathLib::Point3d{{-1, +r, -s}};
113 case 5:
114 return MathLib::Point3d{{-r, -s, +1}};
115 default:
116 OGS_FATAL("Invalid face id '{:d}' for the hexahedron.", face_id);
117 }
118}
#define OGS_FATAL(...)
Definition Error.h:26

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 21 of file MapBulkElementPoint.cpp.

22{
23 switch (face_id)
24 {
25 case 0:
26 return MathLib::Point3d{{-1, 0, 0}};
27 case 1:
28 return MathLib::Point3d{{1, 0, 0}};
29 default:
30 OGS_FATAL("Invalid face id '{:d}' for a line.", face_id);
31 }
32}

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 123 of file MapBulkElementPoint.cpp.

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

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 163 of file MapBulkElementPoint.cpp.

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

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 70 of file MapBulkElementPoint.cpp.

72{
73 auto const r = wp[0];
74
75 switch (face_id)
76 {
77 case 0:
78 return MathLib::Point3d{{-r, +1, 0}};
79 case 1:
80 return MathLib::Point3d{{-1, -r, 0}};
81 case 2:
82 return MathLib::Point3d{{+r, -1, 0}};
83 case 3:
84 return MathLib::Point3d{{+1, +r, 0}};
85 default:
86 OGS_FATAL("Invalid face id '{:d}' for the quad.", face_id);
87 }
88}

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 193 of file MapBulkElementPoint.cpp.

195{
196 auto const r = wp[0];
197 auto const s = wp[1];
198 auto const t = 1 - r - s;
199
200 switch (face_id)
201 {
202 case 0:
203 return MathLib::Point3d{{s, r, 0}};
204 case 1:
205 return MathLib::Point3d{{r, 0, s}};
206 case 2:
207 return MathLib::Point3d{{t, r, s}};
208 case 3:
209 return MathLib::Point3d{{0, t, s}};
210 default:
211 OGS_FATAL("Invalid face id '{:d}' for the tetrahedron.", face_id);
212 }
213}

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 42 of file MapBulkElementPoint.cpp.

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

References OGS_FATAL.