35#include <boost/core/ignore_unused.hpp>
50bool isVertex(
size_t x,
size_t y,
size_t z,
size_t npts)
52 return (x == 0 && y == 0 &&
z == 0) ||
53 (x == (npts - 1) && y == 0 &&
z == 0) ||
54 (x == (npts - 1) && y == (npts - 1) &&
z == 0) ||
55 (x == 0 && y == (npts - 1) &&
z == 0) ||
56 (x == 0 && y == 0 &&
z == (npts - 1)) ||
57 (x == 0 && y == (npts - 1) &&
z == (npts - 1));
60bool isEdge_01(
size_t x,
size_t y,
size_t z,
size_t npts)
62 boost::ignore_unused(x, npts);
63 return y == 0 &&
z == 0;
66bool isEdge_12(
size_t x,
size_t y,
size_t z,
size_t npts)
68 boost::ignore_unused(y);
69 return x == (npts - 1) &&
z == 0;
72bool isEdge_23(
size_t x,
size_t y,
size_t z,
size_t npts)
74 boost::ignore_unused(x);
75 return y == (npts - 1) &&
z == 0;
78bool isEdge_30(
size_t x,
size_t y,
size_t z,
size_t npts)
80 boost::ignore_unused(y, npts);
81 return x == 0 &&
z == 0;
84bool isEdge_04(
size_t x,
size_t y,
size_t z,
size_t npts)
86 boost::ignore_unused(
z, npts);
87 return x == 0 && y == 0;
90bool isEdge_14(
size_t x,
size_t y,
size_t z,
size_t npts)
92 return x +
z == (npts - 1) && y == 0;
95bool isEdge_25(
size_t x,
size_t y,
size_t z,
size_t npts)
97 return x +
z == (npts - 1) && y == (npts - 1);
100bool isEdge_35(
size_t x,
size_t y,
size_t z,
size_t npts)
102 boost::ignore_unused(
z);
103 return x == 0 && y == (npts - 1);
106bool isEdge_45(
size_t x,
size_t y,
size_t z,
size_t npts)
108 boost::ignore_unused(y);
109 return x == 0 &&
z == (npts - 1);
112bool isEdge(
size_t x,
size_t y,
size_t z,
size_t npts)
114 return isEdge_01(x, y,
z, npts) || isEdge_12(x, y,
z, npts) ||
115 isEdge_23(x, y,
z, npts) || isEdge_30(x, y,
z, npts) ||
116 isEdge_04(x, y,
z, npts) || isEdge_14(x, y,
z, npts) ||
117 isEdge_25(x, y,
z, npts) || isEdge_35(x, y,
z, npts) ||
118 isEdge_45(x, y,
z, npts);
121bool isFace_0123(
size_t x,
size_t y,
size_t z,
size_t npts)
123 boost::ignore_unused(x, y, npts);
127bool isFace_014(
size_t x,
size_t y,
size_t z,
size_t npts)
129 boost::ignore_unused(x,
z, npts);
133bool isFace_1254(
size_t x,
size_t y,
size_t z,
size_t npts)
135 boost::ignore_unused(y);
136 return x +
z == npts - 1;
139bool isFace_325(
size_t x,
size_t y,
size_t z,
size_t npts)
141 boost::ignore_unused(x,
z);
142 return y == (npts - 1);
145bool isFace_0354(
size_t x,
size_t y,
size_t z,
size_t npts)
147 boost::ignore_unused(y,
z, npts);
151bool isFace(
size_t x,
size_t y,
size_t z,
size_t npts)
153 return isFace_0123(x, y,
z, npts) || isFace_014(x, y,
z, npts) ||
154 isFace_1254(x, y,
z, npts) || isFace_325(x, y,
z, npts) ||
155 isFace_0354(x, y,
z, npts);
168 for (
size_t z = 0, index = 0;
z < npts; ++
z)
170 for (
size_t y = 0; y < npts; ++y)
172 for (
size_t x = 0; x < npts -
z; ++x, ++index)
195 vector<int> iEdge_01;
196 vector<int> iEdge_12;
197 vector<int> iEdge_23;
198 vector<int> iEdge_30;
199 vector<int> iEdge_04;
200 vector<int> iEdge_14;
201 vector<int> iEdge_25;
202 vector<int> iEdge_35;
203 vector<int> iEdge_45;
204 vector<int> iFace_0123;
205 vector<int> iFace_014;
206 vector<int> iFace_1254;
207 vector<int> iFace_325;
208 vector<int> iFace_0354;
209 vector<int> interiorVolumePoints;
213 for (
size_t z = 0, index = 0;
z < npts; ++
z)
215 for (
size_t y = 0; y < npts; ++y)
217 for (
size_t x = 0; x < npts -
z; ++x, ++index)
219 if (isVertex(x, y,
z, npts))
221 vertex.push_back(index);
223 else if (isEdge(x, y,
z, npts))
225 if (isEdge_01(x, y,
z, npts))
227 iEdge_01.push_back(index);
229 else if (isEdge_12(x, y,
z, npts))
231 iEdge_12.push_back(index);
233 else if (isEdge_23(x, y,
z, npts))
235 iEdge_23.push_back(index);
237 else if (isEdge_30(x, y,
z, npts))
239 iEdge_30.push_back(index);
241 else if (isEdge_04(x, y,
z, npts))
243 iEdge_04.push_back(index);
245 else if (isEdge_14(x, y,
z, npts))
247 iEdge_14.push_back(index);
249 else if (isEdge_25(x, y,
z, npts))
251 iEdge_25.push_back(index);
253 else if (isEdge_35(x, y,
z, npts))
255 iEdge_35.push_back(index);
257 else if (isEdge_45(x, y,
z, npts))
259 iEdge_45.push_back(index);
262 else if (isFace(x, y,
z, npts))
264 if (isFace_0123(x, y,
z, npts))
266 iFace_0123.push_back(index);
268 else if (isFace_014(x, y,
z, npts))
270 iFace_014.push_back(index);
272 else if (isFace_1254(x, y,
z, npts))
274 iFace_1254.push_back(index);
276 else if (isFace_325(x, y,
z, npts))
278 iFace_325.push_back(index);
280 else if (isFace_0354(x, y,
z, npts))
282 iFace_0354.push_back(index);
287 interiorVolumePoints.push_back(index);
293 for (
size_t n = 0; n < vertex.size(); ++n)
295 map.push_back(vertex[n]);
298 for (
size_t n = 0; n < iEdge_01.size(); ++n)
300 map.push_back(iEdge_01[n]);
303 for (
size_t n = 0; n < iEdge_12.size(); ++n)
305 map.push_back(iEdge_12[n]);
308 for (
size_t n = 0; n < iEdge_23.size(); ++n)
310 map.push_back(iEdge_23[n]);
313 for (
size_t n = 0; n < iEdge_30.size(); ++n)
315 map.push_back(iEdge_30[n]);
318 for (
size_t n = 0; n < iEdge_04.size(); ++n)
320 map.push_back(iEdge_04[n]);
323 for (
size_t n = 0; n < iEdge_14.size(); ++n)
325 map.push_back(iEdge_14[n]);
328 for (
size_t n = 0; n < iEdge_25.size(); ++n)
330 map.push_back(iEdge_25[n]);
333 for (
size_t n = 0; n < iEdge_35.size(); ++n)
335 map.push_back(iEdge_35[n]);
338 for (
size_t n = 0; n < iEdge_45.size(); ++n)
340 map.push_back(iEdge_45[n]);
343 for (
size_t n = 0; n < iFace_0123.size(); ++n)
345 map.push_back(iFace_0123[n]);
348 for (
size_t n = 0; n < iFace_014.size(); ++n)
350 map.push_back(iFace_014[n]);
353 for (
size_t n = 0; n < iFace_1254.size(); ++n)
355 map.push_back(iFace_1254[n]);
358 for (
size_t n = 0; n < iFace_325.size(); ++n)
360 map.push_back(iFace_325[n]);
363 for (
size_t n = 0; n < iFace_0354.size(); ++n)
365 map.push_back(iFace_0354[n]);
368 for (
size_t n = 0; n < interiorVolumePoints.size(); ++n)
370 map.push_back(interiorVolumePoints[n]);
378 for (
size_t index = 0; index < map.size(); ++index)
380 points[0][index] =
m_points[0][index];
381 points[1][index] =
m_points[1][index];
382 points[2][index] =
m_points[2][index];
385 for (
size_t index = 0; index < map.size(); ++index)
387 m_points[0][index] = points[0][map[index]];
388 m_points[1][index] = points[1][map[index]];
389 m_points[2][index] = points[2][map[index]];
418 std::shared_ptr<NekMatrix<NekDouble>> mat =
419 m_util->GetInterpolationMatrix(xi);
420 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
429 PointsBaseType::v_CalculateDerivMatrix();
439 std::shared_ptr<PointsBaseType> returnval(
442 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 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[]
virtual void v_CalculateDerivMatrix() override final
virtual void v_CalculatePoints() override final
std::shared_ptr< NodalUtilPrism > m_util
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
virtual void v_CalculateWeights() override final
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)
The above copyright notice and this permission notice shall be included.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)