46bool isVertex(
size_t x,
size_t y,
size_t z,
size_t npts)
48 return (x == 0 && y == 0 &&
z == 0) ||
49 (x == (npts - 1) && y == 0 &&
z == 0) ||
50 (x == (npts - 1) && y == (npts - 1) &&
z == 0) ||
51 (x == 0 && y == (npts - 1) &&
z == 0) ||
52 (x == 0 && y == 0 &&
z == (npts - 1)) ||
53 (x == 0 && y == (npts - 1) &&
z == (npts - 1));
56bool isEdge_01([[maybe_unused]]
size_t x,
size_t y,
size_t z,
57 [[maybe_unused]]
size_t npts)
59 return y == 0 &&
z == 0;
62bool isEdge_12(
size_t x, [[maybe_unused]]
size_t y,
size_t z,
size_t npts)
64 return x == (npts - 1) &&
z == 0;
67bool isEdge_23([[maybe_unused]]
size_t x,
size_t y,
size_t z,
size_t npts)
69 return y == (npts - 1) &&
z == 0;
72bool isEdge_30(
size_t x, [[maybe_unused]]
size_t y,
size_t z,
73 [[maybe_unused]]
size_t npts)
75 return x == 0 &&
z == 0;
78bool isEdge_04(
size_t x,
size_t y, [[maybe_unused]]
size_t z,
79 [[maybe_unused]]
size_t npts)
81 return x == 0 && y == 0;
84bool isEdge_14(
size_t x,
size_t y,
size_t z,
size_t npts)
86 return x +
z == (npts - 1) && y == 0;
89bool isEdge_25(
size_t x,
size_t y,
size_t z,
size_t npts)
91 return x +
z == (npts - 1) && y == (npts - 1);
94bool isEdge_35(
size_t x,
size_t y, [[maybe_unused]]
size_t z,
size_t npts)
96 return x == 0 && y == (npts - 1);
99bool isEdge_45(
size_t x, [[maybe_unused]]
size_t y,
size_t z,
size_t npts)
101 return x == 0 &&
z == (npts - 1);
104bool isEdge(
size_t x,
size_t y,
size_t z,
size_t npts)
106 return isEdge_01(x, y,
z, npts) || isEdge_12(x, y,
z, npts) ||
107 isEdge_23(x, y,
z, npts) || isEdge_30(x, y,
z, npts) ||
108 isEdge_04(x, y,
z, npts) || isEdge_14(x, y,
z, npts) ||
109 isEdge_25(x, y,
z, npts) || isEdge_35(x, y,
z, npts) ||
110 isEdge_45(x, y,
z, npts);
113bool isFace_0123([[maybe_unused]]
size_t x, [[maybe_unused]]
size_t y,
size_t z,
114 [[maybe_unused]]
size_t npts)
119bool isFace_014([[maybe_unused]]
size_t x,
size_t y, [[maybe_unused]]
size_t z,
120 [[maybe_unused]]
size_t npts)
125bool isFace_1254(
size_t x, [[maybe_unused]]
size_t y,
size_t z,
size_t npts)
127 return x +
z == npts - 1;
130bool isFace_325([[maybe_unused]]
size_t x,
size_t y, [[maybe_unused]]
size_t z,
133 return y == (npts - 1);
136bool isFace_0354(
size_t x, [[maybe_unused]]
size_t y, [[maybe_unused]]
size_t z,
137 [[maybe_unused]]
size_t npts)
142bool isFace(
size_t x,
size_t y,
size_t z,
size_t npts)
144 return isFace_0123(x, y,
z, npts) || isFace_014(x, y,
z, npts) ||
145 isFace_1254(x, y,
z, npts) || isFace_325(x, y,
z, npts) ||
146 isFace_0354(x, y,
z, npts);
159 for (
size_t z = 0, index = 0;
z < npts; ++
z)
161 for (
size_t y = 0; y < npts; ++y)
163 for (
size_t x = 0; x < npts -
z; ++x, ++index)
186 vector<int> iEdge_01;
187 vector<int> iEdge_12;
188 vector<int> iEdge_23;
189 vector<int> iEdge_30;
190 vector<int> iEdge_04;
191 vector<int> iEdge_14;
192 vector<int> iEdge_25;
193 vector<int> iEdge_35;
194 vector<int> iEdge_45;
195 vector<int> iFace_0123;
196 vector<int> iFace_014;
197 vector<int> iFace_1254;
198 vector<int> iFace_325;
199 vector<int> iFace_0354;
200 vector<int> interiorVolumePoints;
204 for (
size_t z = 0, index = 0;
z < npts; ++
z)
206 for (
size_t y = 0; y < npts; ++y)
208 for (
size_t x = 0; x < npts -
z; ++x, ++index)
210 if (isVertex(x, y,
z, npts))
212 vertex.push_back(index);
214 else if (isEdge(x, y,
z, npts))
216 if (isEdge_01(x, y,
z, npts))
218 iEdge_01.push_back(index);
220 else if (isEdge_12(x, y,
z, npts))
222 iEdge_12.push_back(index);
224 else if (isEdge_23(x, y,
z, npts))
226 iEdge_23.push_back(index);
228 else if (isEdge_30(x, y,
z, npts))
230 iEdge_30.push_back(index);
232 else if (isEdge_04(x, y,
z, npts))
234 iEdge_04.push_back(index);
236 else if (isEdge_14(x, y,
z, npts))
238 iEdge_14.push_back(index);
240 else if (isEdge_25(x, y,
z, npts))
242 iEdge_25.push_back(index);
244 else if (isEdge_35(x, y,
z, npts))
246 iEdge_35.push_back(index);
248 else if (isEdge_45(x, y,
z, npts))
250 iEdge_45.push_back(index);
253 else if (isFace(x, y,
z, npts))
255 if (isFace_0123(x, y,
z, npts))
257 iFace_0123.push_back(index);
259 else if (isFace_014(x, y,
z, npts))
261 iFace_014.push_back(index);
263 else if (isFace_1254(x, y,
z, npts))
265 iFace_1254.push_back(index);
267 else if (isFace_325(x, y,
z, npts))
269 iFace_325.push_back(index);
271 else if (isFace_0354(x, y,
z, npts))
273 iFace_0354.push_back(index);
278 interiorVolumePoints.push_back(index);
284 for (
size_t n = 0; n < vertex.size(); ++n)
286 map.push_back(vertex[n]);
289 for (
size_t n = 0; n < iEdge_01.size(); ++n)
291 map.push_back(iEdge_01[n]);
294 for (
size_t n = 0; n < iEdge_12.size(); ++n)
296 map.push_back(iEdge_12[n]);
299 for (
size_t n = 0; n < iEdge_23.size(); ++n)
301 map.push_back(iEdge_23[n]);
304 for (
size_t n = 0; n < iEdge_30.size(); ++n)
306 map.push_back(iEdge_30[n]);
309 for (
size_t n = 0; n < iEdge_04.size(); ++n)
311 map.push_back(iEdge_04[n]);
314 for (
size_t n = 0; n < iEdge_14.size(); ++n)
316 map.push_back(iEdge_14[n]);
319 for (
size_t n = 0; n < iEdge_25.size(); ++n)
321 map.push_back(iEdge_25[n]);
324 for (
size_t n = 0; n < iEdge_35.size(); ++n)
326 map.push_back(iEdge_35[n]);
329 for (
size_t n = 0; n < iEdge_45.size(); ++n)
331 map.push_back(iEdge_45[n]);
334 for (
size_t n = 0; n < iFace_0123.size(); ++n)
336 map.push_back(iFace_0123[n]);
339 for (
size_t n = 0; n < iFace_014.size(); ++n)
341 map.push_back(iFace_014[n]);
344 for (
size_t n = 0; n < iFace_1254.size(); ++n)
346 map.push_back(iFace_1254[n]);
349 for (
size_t n = 0; n < iFace_325.size(); ++n)
351 map.push_back(iFace_325[n]);
354 for (
size_t n = 0; n < iFace_0354.size(); ++n)
356 map.push_back(iFace_0354[n]);
359 for (
size_t n = 0; n < interiorVolumePoints.size(); ++n)
361 map.push_back(interiorVolumePoints[n]);
369 for (
size_t index = 0; index < map.size(); ++index)
371 points[0][index] =
m_points[0][index];
372 points[1][index] =
m_points[1][index];
373 points[2][index] =
m_points[2][index];
376 for (
size_t index = 0; index < map.size(); ++index)
378 m_points[0][index] = points[0][map[index]];
379 m_points[1][index] = points[1][map[index]];
380 m_points[2][index] = points[2][map[index]];
409 std::shared_ptr<NekMatrix<NekDouble>> mat =
410 m_util->GetInterpolationMatrix(xi);
411 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
420 PointsBaseType::v_CalculateDerivMatrix();
430 std::shared_ptr<PointsBaseType> returnval(
433 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_CalculateDerivMatrix() final
void NodalPointReorder3d()
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
static bool initPointsManager[]
void v_CalculatePoints() final
void v_CalculateWeights() final
std::shared_ptr< NodalUtilPrism > m_util
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)
@ eNodalPrismEvenlySpaced
3D Evenly-spaced points on a Prism
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)