49bool isVertex(
size_t x,
size_t y,
size_t z,
size_t npts)
51 return (x == 0 && y == 0 &&
z == 0) ||
52 (x == (npts - 1) && y == 0 &&
z == 0) ||
53 (x == 0 && y == (npts - 1) &&
z == 0) ||
54 (x == 0 && y == 0 &&
z == (npts - 1));
57bool isEdge_01([[maybe_unused]]
size_t x,
size_t y,
size_t z,
58 [[maybe_unused]]
size_t npts)
60 return y == 0 &&
z == 0;
63bool isEdge_12(
size_t x,
size_t y,
size_t z,
size_t npts)
65 return z == 0 && x + y == npts - 1;
68bool isEdge_20(
size_t x, [[maybe_unused]]
size_t y,
size_t z,
69 [[maybe_unused]]
size_t npts)
71 return x == 0 &&
z == 0;
74bool isEdge_03(
size_t x,
size_t y, [[maybe_unused]]
size_t z,
75 [[maybe_unused]]
size_t npts)
77 return x == 0 && y == 0;
80bool isEdge_13(
size_t x,
size_t y,
size_t z,
size_t npts)
82 return y == 0 && x +
z == npts - 1;
85bool isEdge_23(
size_t x,
size_t y,
size_t z,
size_t npts)
87 return x == 0 && y +
z == npts - 1;
90bool isEdge(
size_t x,
size_t y,
size_t z,
size_t npts)
92 return isEdge_01(x, y,
z, npts) || isEdge_12(x, y,
z, npts) ||
93 isEdge_20(x, y,
z, npts) || isEdge_03(x, y,
z, npts) ||
94 isEdge_13(x, y,
z, npts) || isEdge_23(x, y,
z, npts);
97bool isFace_012([[maybe_unused]]
size_t x, [[maybe_unused]]
size_t y,
size_t z,
98 [[maybe_unused]]
size_t npts)
103bool isFace_013([[maybe_unused]]
size_t x,
size_t y, [[maybe_unused]]
size_t z,
104 [[maybe_unused]]
size_t npts)
109bool isFace_123(
size_t x,
size_t y,
size_t z,
size_t npts)
111 return x + y +
z == npts - 1;
114bool isFace_203(
size_t x, [[maybe_unused]]
size_t y, [[maybe_unused]]
size_t z,
115 [[maybe_unused]]
size_t npts)
120bool isFace(
size_t x,
size_t y,
size_t z,
size_t npts)
122 return isFace_012(x, y,
z, npts) || isFace_013(x, y,
z, npts) ||
123 isFace_123(x, y,
z, npts) || isFace_203(x, y,
z, npts);
136 for (
size_t z = 0, index = 0;
z < npts; ++
z)
138 for (
size_t y = 0; y < npts -
z; ++y)
140 for (
size_t x = 0; x < npts -
z - y; ++x, ++index)
163 vector<int> iEdge_01;
164 vector<int> iEdge_12;
165 vector<int> iEdge_20;
166 vector<int> iEdge_03;
167 vector<int> iEdge_13;
168 vector<int> iEdge_23;
169 vector<int> iFace_012;
170 vector<int> iFace_013;
171 vector<int> iFace_123;
172 vector<int> iFace_203;
173 vector<int> interiorVolumePoints;
177 for (
size_t z = 0, index = 0;
z < npts; ++
z)
179 for (
size_t y = 0; y < npts -
z; ++y)
181 for (
size_t x = 0; x < npts -
z - y; ++x, ++index)
184 if (isVertex(x, y,
z, npts))
187 vertex.push_back(index);
189 else if (isEdge(x, y,
z, npts))
192 if (isEdge_01(x, y,
z, npts))
195 iEdge_01.push_back(index);
197 else if (isEdge_12(x, y,
z, npts))
200 iEdge_12.push_back(index);
202 else if (isEdge_20(x, y,
z, npts))
205 iEdge_20.insert(iEdge_20.begin(), index);
207 else if (isEdge_03(x, y,
z, npts))
210 iEdge_03.push_back(index);
212 else if (isEdge_13(x, y,
z, npts))
215 iEdge_13.push_back(index);
217 else if (isEdge_23(x, y,
z, npts))
220 iEdge_23.push_back(index);
223 else if (isFace(x, y,
z, npts))
226 if (isFace_012(x, y,
z, npts))
229 iFace_012.push_back(index);
231 else if (isFace_013(x, y,
z, npts))
234 iFace_013.push_back(index);
236 else if (isFace_123(x, y,
z, npts))
239 iFace_123.push_back(index);
241 else if (isFace_203(x, y,
z, npts))
244 iFace_203.push_back(index);
250 interiorVolumePoints.push_back(index);
258 for (
size_t n = 0; n < vertex.size(); ++n)
261 map.push_back(vertex[n]);
264 for (
size_t n = 0; n < iEdge_01.size(); ++n)
267 map.push_back(iEdge_01[n]);
270 for (
size_t n = 0; n < iEdge_12.size(); ++n)
273 map.push_back(iEdge_12[n]);
276 for (
size_t n = 0; n < iEdge_20.size(); ++n)
279 map.push_back(iEdge_20[n]);
282 for (
size_t n = 0; n < iEdge_03.size(); ++n)
285 map.push_back(iEdge_03[n]);
288 for (
size_t n = 0; n < iEdge_13.size(); ++n)
291 map.push_back(iEdge_13[n]);
294 for (
size_t n = 0; n < iEdge_23.size(); ++n)
297 map.push_back(iEdge_23[n]);
300 for (
size_t n = 0; n < iFace_012.size(); ++n)
303 map.push_back(iFace_012[n]);
306 for (
size_t n = 0; n < iFace_013.size(); ++n)
309 map.push_back(iFace_013[n]);
312 for (
size_t n = 0; n < iFace_123.size(); ++n)
315 map.push_back(iFace_123[n]);
318 for (
size_t n = 0; n < iFace_203.size(); ++n)
321 map.push_back(iFace_203[n]);
324 for (
size_t n = 0; n < interiorVolumePoints.size(); ++n)
327 map.push_back(interiorVolumePoints[n]);
334 for (
size_t index = 0; index < map.size(); ++index)
337 points[0][index] =
m_points[0][index];
338 points[1][index] =
m_points[1][index];
339 points[2][index] =
m_points[2][index];
342 for (
size_t index = 0; index < map.size(); ++index)
345 m_points[0][index] = points[0][map[index]];
346 m_points[1][index] = points[1][map[index]];
347 m_points[2][index] = points[2][map[index]];
375 std::shared_ptr<NekMatrix<NekDouble>> mat =
376 m_util->GetInterpolationMatrix(xi);
377 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
386 PointsBaseType::v_CalculateDerivMatrix();
396 std::shared_ptr<PointsBaseType> returnval(
399 returnval->Initialize();
bool RegisterCreator(const KeyType &key, const CreateFuncType &createFunc)
Register the given function and associate it with the key. The return value is just to facilitate cal...
void v_CalculatePoints() final
static bool initPointsManager[]
std::shared_ptr< NodalUtilTetrahedron > m_util
void NodalPointReorder3d()
void v_CalculateDerivMatrix() final
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
void v_CalculateWeights() final
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
MatrixSharedPtrType m_derivmatrix[3]
Derivative matrices.
virtual void v_CalculatePoints()
size_t GetNumPoints() const
size_t GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
virtual void v_CalculateWeights()
Defines a specification for a set of points.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
PointsManagerT & PointsManager(void)
@ eNodalTetEvenlySpaced
3D Evenly-spaced points on a Tetrahedron
std::vector< double > w(NPUPPER)
std::vector< double > z(NPUPPER)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)