35 #include <boost/core/ignore_unused.hpp>
45 namespace LibUtilities
53 bool isVertex(
int x,
int y,
int z,
int npts)
55 return (x == 0 && y == 0 && z == 0) ||
56 (x == (npts - 1) && y == 0 && z == 0) ||
57 (x == (npts - 1) && y == (npts - 1) && z == 0) ||
58 (x == 0 && y == (npts - 1) && z == 0) ||
59 (x == 0 && y == 0 && z == (npts - 1)) ||
60 (x == 0 && y == (npts - 1) && z == (npts - 1));
63 bool isEdge_01(
int x,
int y,
int z,
int npts)
65 boost::ignore_unused(x, npts);
66 return y == 0 && z == 0;
69 bool isEdge_12(
int x,
int y,
int z,
int npts)
71 boost::ignore_unused(y);
72 return x == (npts - 1) && z == 0;
75 bool isEdge_23(
int x,
int y,
int z,
int npts)
77 boost::ignore_unused(x);
78 return y == (npts - 1) && z == 0;
81 bool isEdge_30(
int x,
int y,
int z,
int npts)
83 boost::ignore_unused(y, npts);
84 return x == 0 && z == 0;
87 bool isEdge_04(
int x,
int y,
int z,
int npts)
89 boost::ignore_unused(z, npts);
90 return x == 0 && y == 0;
93 bool isEdge_14(
int x,
int y,
int z,
int npts)
95 return x + z == (npts - 1) && y == 0;
98 bool isEdge_25(
int x,
int y,
int z,
int npts)
100 return x + z == (npts - 1) && y == (npts - 1);
103 bool isEdge_35(
int x,
int y,
int z,
int npts)
105 boost::ignore_unused(z);
106 return x == 0 && y == (npts - 1);
109 bool isEdge_45(
int x,
int y,
int z,
int npts)
111 boost::ignore_unused(y);
112 return x == 0 && z == (npts - 1);
115 bool isEdge(
int x,
int y,
int z,
int npts)
117 return isEdge_01(x, y, z, npts) || isEdge_12(x, y, z, npts) ||
118 isEdge_23(x, y, z, npts) || isEdge_30(x, y, z, npts) ||
119 isEdge_04(x, y, z, npts) || isEdge_14(x, y, z, npts) ||
120 isEdge_25(x, y, z, npts) || isEdge_35(x, y, z, npts) ||
121 isEdge_45(x, y, z, npts);
124 bool isFace_0123(
int x,
int y,
int z,
int npts)
126 boost::ignore_unused(x, y, npts);
130 bool isFace_014(
int x,
int y,
int z,
int npts)
132 boost::ignore_unused(x, z, npts);
136 bool isFace_1254(
int x,
int y,
int z,
int npts)
138 boost::ignore_unused(y);
139 return x + z == npts - 1;
142 bool isFace_325(
int x,
int y,
int z,
int npts)
144 boost::ignore_unused(x, z);
145 return y == (npts - 1);
148 bool isFace_0354(
int x,
int y,
int z,
int npts)
150 boost::ignore_unused(y, z, npts);
154 bool isFace(
int x,
int y,
int z,
int npts)
156 return isFace_0123(x, y, z, npts) || isFace_014(x, y, z, npts) ||
157 isFace_1254(x, y, z, npts) || isFace_325(x, y, z, npts) ||
158 isFace_0354(x, y, z, npts);
171 for (
unsigned int z = 0, index = 0; z < npts; ++z)
173 for (
unsigned int y = 0; y < npts; ++y)
175 for (
unsigned int x = 0; x < npts - z; ++x, ++index)
198 vector<int> iEdge_01;
199 vector<int> iEdge_12;
200 vector<int> iEdge_23;
201 vector<int> iEdge_30;
202 vector<int> iEdge_04;
203 vector<int> iEdge_14;
204 vector<int> iEdge_25;
205 vector<int> iEdge_35;
206 vector<int> iEdge_45;
207 vector<int> iFace_0123;
208 vector<int> iFace_014;
209 vector<int> iFace_1254;
210 vector<int> iFace_325;
211 vector<int> iFace_0354;
212 vector<int> interiorVolumePoints;
216 for (
unsigned int z = 0, index = 0; z < npts; ++z)
218 for (
unsigned int y = 0; y < npts; ++y)
220 for (
unsigned int x = 0; x < npts - z; ++x, ++index)
222 if (isVertex(x, y, z, npts))
224 vertex.push_back(index);
226 else if (isEdge(x, y, z, npts))
228 if (isEdge_01(x, y, z, npts))
230 iEdge_01.push_back(index);
232 else if (isEdge_12(x, y, z, npts))
234 iEdge_12.push_back(index);
236 else if (isEdge_23(x, y, z, npts))
238 iEdge_23.push_back(index);
240 else if (isEdge_30(x, y, z, npts))
242 iEdge_30.push_back(index);
244 else if (isEdge_04(x, y, z, npts))
246 iEdge_04.push_back(index);
248 else if (isEdge_14(x, y, z, npts))
250 iEdge_14.push_back(index);
252 else if (isEdge_25(x, y, z, npts))
254 iEdge_25.push_back(index);
256 else if (isEdge_35(x, y, z, npts))
258 iEdge_35.push_back(index);
260 else if (isEdge_45(x, y, z, npts))
262 iEdge_45.push_back(index);
265 else if (isFace(x, y, z, npts))
267 if (isFace_0123(x, y, z, npts))
269 iFace_0123.push_back(index);
271 else if (isFace_014(x, y, z, npts))
273 iFace_014.push_back(index);
275 else if (isFace_1254(x, y, z, npts))
277 iFace_1254.push_back(index);
279 else if (isFace_325(x, y, z, npts))
281 iFace_325.push_back(index);
283 else if (isFace_0354(x, y, z, npts))
285 iFace_0354.push_back(index);
290 interiorVolumePoints.push_back(index);
296 for (
unsigned int n = 0; n < vertex.size(); ++n)
298 map.push_back(vertex[n]);
301 for (
unsigned int n = 0; n < iEdge_01.size(); ++n)
303 map.push_back(iEdge_01[n]);
306 for (
unsigned int n = 0; n < iEdge_12.size(); ++n)
308 map.push_back(iEdge_12[n]);
311 for (
unsigned int n = 0; n < iEdge_23.size(); ++n)
313 map.push_back(iEdge_23[n]);
316 for (
unsigned int n = 0; n < iEdge_30.size(); ++n)
318 map.push_back(iEdge_30[n]);
321 for (
unsigned int n = 0; n < iEdge_04.size(); ++n)
323 map.push_back(iEdge_04[n]);
326 for (
unsigned int n = 0; n < iEdge_14.size(); ++n)
328 map.push_back(iEdge_14[n]);
331 for (
unsigned int n = 0; n < iEdge_25.size(); ++n)
333 map.push_back(iEdge_25[n]);
336 for (
unsigned int n = 0; n < iEdge_35.size(); ++n)
338 map.push_back(iEdge_35[n]);
341 for (
unsigned int n = 0; n < iEdge_45.size(); ++n)
343 map.push_back(iEdge_45[n]);
346 for (
unsigned int n = 0; n < iFace_0123.size(); ++n)
348 map.push_back(iFace_0123[n]);
351 for (
unsigned int n = 0; n < iFace_014.size(); ++n)
353 map.push_back(iFace_014[n]);
356 for (
unsigned int n = 0; n < iFace_1254.size(); ++n)
358 map.push_back(iFace_1254[n]);
361 for (
unsigned int n = 0; n < iFace_325.size(); ++n)
363 map.push_back(iFace_325[n]);
366 for (
unsigned int n = 0; n < iFace_0354.size(); ++n)
368 map.push_back(iFace_0354[n]);
371 for (
unsigned int n = 0; n < interiorVolumePoints.size(); ++n)
373 map.push_back(interiorVolumePoints[n]);
381 for (
unsigned int index = 0; index < map.size(); ++index)
383 points[0][index] =
m_points[0][index];
384 points[1][index] =
m_points[1][index];
385 points[2][index] =
m_points[2][index];
388 for (
unsigned int index = 0; index < map.size(); ++index)
390 m_points[0][index] = points[0][map[index]];
391 m_points[1][index] = points[1][map[index]];
392 m_points[2][index] = points[2][map[index]];
421 std::shared_ptr<NekMatrix<NekDouble>> mat =
422 m_util->GetInterpolationMatrix(xi);
423 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
442 std::shared_ptr<PointsBaseType> returnval(
445 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)
virtual void v_CalculateWeights() override
virtual void v_CalculatePoints() override
static bool initPointsManager[]
virtual void v_CalculateDerivMatrix() override
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()
unsigned int GetNumPoints() const
unsigned int GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
virtual void v_CalculateDerivMatrix()
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.
Array< OneD, DataType > & GetPtr()
unsigned int GetRows() const
PointsManagerT & PointsManager(void)
@ eNodalPrismEvenlySpaced
3D Evenly-spaced points on a Prism
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)