46bool isVertex(
size_t t,
size_t y,
size_t npts)
48 return (t == 0 && y == 0) || (t == 1 && y == 0) || (t == 2 && y == 0) ||
49 (t == 0 && y == (npts - 1)) || (t == 1 && y == (npts - 1)) ||
50 (t == 2 && y == (npts - 1));
53bool isEdge_01(
size_t t,
size_t y,
size_t npts)
55 return y == 0 && t > 2 && t <= npts;
58bool isEdge_12(
size_t t, [[maybe_unused]]
size_t y,
59 [[maybe_unused]]
size_t npts)
64bool isEdge_23(
size_t t,
size_t y,
size_t npts)
66 return y == (npts - 1) && t > 2 && t <= npts;
69bool isEdge_30(
size_t t, [[maybe_unused]]
size_t y,
70 [[maybe_unused]]
size_t npts)
75bool isEdge_04(
size_t t,
size_t y,
size_t npts)
77 return y == 0 && t >= 3 + 2 * (npts - 2) && t < 3 + 3 * (npts - 2);
80bool isEdge_14(
size_t t,
size_t y,
size_t npts)
82 return y == 0 && t >= 3 + (npts - 2) && t < 3 + 2 * (npts - 2);
85bool isEdge_25(
size_t t,
size_t y,
size_t npts)
87 return y == npts - 1 && t >= 3 + (npts - 2) && t < 3 + 2 * (npts - 2);
90bool isEdge_35(
size_t t,
size_t y,
size_t npts)
92 return y == npts - 1 && t >= 3 + 2 * (npts - 2) && t < 3 + 3 * (npts - 2);
95bool isEdge_45(
size_t t, [[maybe_unused]]
size_t y,
96 [[maybe_unused]]
size_t npts)
101bool isEdge(
size_t t,
size_t y,
size_t npts)
103 return isEdge_01(t, y, npts) || isEdge_12(t, y, npts) ||
104 isEdge_23(t, y, npts) || isEdge_30(t, y, npts) ||
105 isEdge_04(t, y, npts) || isEdge_14(t, y, npts) ||
106 isEdge_25(t, y, npts) || isEdge_35(t, y, npts) ||
107 isEdge_45(t, y, npts);
110bool isFace_0123(
size_t t, [[maybe_unused]]
size_t y,
size_t npts)
112 return t < 3 + (npts - 2);
115bool isFace_014([[maybe_unused]]
size_t t,
size_t y,
116 [[maybe_unused]]
size_t npts)
121bool isFace_1254(
size_t t, [[maybe_unused]]
size_t y,
size_t npts)
123 return t < 3 + 2 * (npts - 2) && t >= 3 + (npts - 2);
126bool isFace_325([[maybe_unused]]
size_t t,
size_t y,
size_t npts)
128 return y == (npts - 1);
131bool isFace_0354(
size_t t, [[maybe_unused]]
size_t y,
size_t npts)
133 return t < 3 + 3 * (npts - 2) && t >= 3 + 2 * (npts - 2);
136bool isFace(
size_t t,
size_t y,
size_t npts)
138 return isFace_0123(t, y, npts) || isFace_014(t, y, npts) ||
139 isFace_1254(t, y, npts) || isFace_325(t, y, npts) ||
140 isFace_0354(t, y, npts);
160 for (
size_t y = 0, index = 0; y < npts; y++)
162 for (
size_t t = 0; t < u1.size(); t++, index++)
180 vector<int> iEdge_01;
181 vector<int> iEdge_12;
182 vector<int> iEdge_23;
183 vector<int> iEdge_30;
184 vector<int> iEdge_04;
185 vector<int> iEdge_14;
186 vector<int> iEdge_25;
187 vector<int> iEdge_35;
188 vector<int> iEdge_45;
189 vector<int> iFace_0123;
190 vector<int> iFace_014;
191 vector<int> iFace_1254;
192 vector<int> iFace_325;
193 vector<int> iFace_0354;
194 vector<int> interiorVolumePoints;
198 for (
size_t y = 0, index = 0; y < npts; y++)
200 for (
size_t t = 0; t < npts * (npts + 1) / 2; t++, index++)
202 if (isVertex(t, y, npts))
204 vertex.push_back(index);
206 else if (isEdge(t, y, npts))
208 if (isEdge_01(t, y, npts))
210 iEdge_01.push_back(index);
212 else if (isEdge_12(t, y, npts))
214 iEdge_12.push_back(index);
216 else if (isEdge_23(t, y, npts))
218 iEdge_23.push_back(index);
220 else if (isEdge_30(t, y, npts))
222 iEdge_30.push_back(index);
224 else if (isEdge_04(t, y, npts))
226 iEdge_04.push_back(index);
228 else if (isEdge_14(t, y, npts))
230 iEdge_14.push_back(index);
232 else if (isEdge_25(t, y, npts))
234 iEdge_25.push_back(index);
236 else if (isEdge_35(t, y, npts))
238 iEdge_35.push_back(index);
240 else if (isEdge_45(t, y, npts))
242 iEdge_45.push_back(index);
245 else if (isFace(t, y, npts))
247 if (isFace_0123(t, y, npts))
249 iFace_0123.push_back(index);
251 else if (isFace_014(t, y, npts))
253 iFace_014.push_back(index);
255 else if (isFace_1254(t, y, npts))
257 iFace_1254.push_back(index);
259 else if (isFace_325(t, y, npts))
261 iFace_325.push_back(index);
263 else if (isFace_0354(t, y, npts))
265 iFace_0354.push_back(index);
270 interiorVolumePoints.push_back(index);
276 std::swap(vertex[2], vertex[4]);
278 std::reverse(iEdge_23.begin(), iEdge_23.end());
279 std::reverse(iEdge_30.begin(), iEdge_30.end());
280 std::reverse(iEdge_04.begin(), iEdge_04.end());
281 std::reverse(iEdge_35.begin(), iEdge_35.end());
284 for (
size_t i = 0; i < npts - 2; i++)
286 for (
size_t j = i + 1; j < npts - 2; j++)
288 std::swap(iFace_1254[i * (npts - 2) + j],
289 iFace_1254[j * (npts - 2) + i]);
292 for (
size_t i = 0; i < npts - 2; i++)
294 std::reverse(iFace_0354.begin() + (i * (npts - 2)),
295 iFace_0354.begin() + (i * (npts - 2) + npts - 2));
297 for (
size_t i = 0; i < npts - 2; i++)
299 for (
size_t j = i + 1; j < npts - 2; j++)
301 std::swap(iFace_0354[i * (npts - 2) + j],
302 iFace_0354[j * (npts - 2) + i]);
306 for (
size_t n = 0; n < vertex.size(); ++n)
308 map.push_back(vertex[n]);
311 for (
size_t n = 0; n < iEdge_01.size(); ++n)
313 map.push_back(iEdge_01[n]);
316 for (
size_t n = 0; n < iEdge_12.size(); ++n)
318 map.push_back(iEdge_12[n]);
321 for (
size_t n = 0; n < iEdge_23.size(); ++n)
323 map.push_back(iEdge_23[n]);
326 for (
size_t n = 0; n < iEdge_30.size(); ++n)
328 map.push_back(iEdge_30[n]);
331 for (
size_t n = 0; n < iEdge_04.size(); ++n)
333 map.push_back(iEdge_04[n]);
336 for (
size_t n = 0; n < iEdge_14.size(); ++n)
338 map.push_back(iEdge_14[n]);
341 for (
size_t n = 0; n < iEdge_25.size(); ++n)
343 map.push_back(iEdge_25[n]);
346 for (
size_t n = 0; n < iEdge_35.size(); ++n)
348 map.push_back(iEdge_35[n]);
351 for (
size_t n = 0; n < iEdge_45.size(); ++n)
353 map.push_back(iEdge_45[n]);
356 for (
size_t n = 0; n < iFace_0123.size(); ++n)
358 map.push_back(iFace_0123[n]);
361 for (
size_t n = 0; n < iFace_014.size(); ++n)
363 map.push_back(iFace_014[n]);
366 for (
size_t n = 0; n < iFace_1254.size(); ++n)
368 map.push_back(iFace_1254[n]);
371 for (
size_t n = 0; n < iFace_325.size(); ++n)
373 map.push_back(iFace_325[n]);
376 for (
size_t n = 0; n < iFace_0354.size(); ++n)
378 map.push_back(iFace_0354[n]);
381 for (
size_t n = 0; n < interiorVolumePoints.size(); ++n)
383 map.push_back(interiorVolumePoints[n]);
391 for (
size_t index = 0; index < map.size(); ++index)
393 points[0][index] =
m_points[0][index];
394 points[1][index] =
m_points[1][index];
395 points[2][index] =
m_points[2][index];
398 for (
size_t index = 0; index < map.size(); ++index)
400 m_points[0][index] = points[0][map[index]];
401 m_points[1][index] = points[1][map[index]];
402 m_points[2][index] = points[2][map[index]];
431 std::shared_ptr<NekMatrix<NekDouble>> mat =
432 m_util->GetInterpolationMatrix(xi);
433 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
442 PointsBaseType::v_CalculateDerivMatrix();
451 std::shared_ptr<PointsBaseType> returnval(
454 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...
std::shared_ptr< NodalUtilPrism > m_util
void NodalPointReorder3d()
void v_CalculateWeights() 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_CalculatePoints() final
void v_CalculateDerivMatrix() final
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
static bool initPointsManager[]
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)
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eNodalPrismElec
3D electrostatically spaced points on a Prism
std::vector< double > w(NPUPPER)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)