35 #include <boost/core/ignore_unused.hpp>
45 namespace LibUtilities
53 bool isVertex(
int t,
int y,
int npts)
55 return (t == 0 && y == 0) || (t == 1 && y == 0) || (t == 2 && y == 0) ||
56 (t == 0 && y == (npts - 1)) || (t == 1 && y == (npts - 1)) ||
57 (t == 2 && y == (npts - 1));
60 bool isEdge_01(
int t,
int y,
int npts)
62 return y == 0 && t > 2 && t <= npts;
65 bool isEdge_12(
int t,
int y,
int npts)
67 boost::ignore_unused(y, npts);
71 bool isEdge_23(
int t,
int y,
int npts)
73 return y == (npts - 1) && t > 2 && t <= npts;
76 bool isEdge_30(
int t,
int y,
int npts)
78 boost::ignore_unused(y, npts);
82 bool isEdge_04(
int t,
int y,
int npts)
84 return y == 0 && t >= 3 + 2 * (npts - 2) && t < 3 + 3 * (npts - 2);
87 bool isEdge_14(
int t,
int y,
int npts)
89 return y == 0 && t >= 3 + (npts - 2) && t < 3 + 2 * (npts - 2);
92 bool isEdge_25(
int t,
int y,
int npts)
94 return y == npts - 1 && t >= 3 + (npts - 2) && t < 3 + 2 * (npts - 2);
97 bool isEdge_35(
int t,
int y,
int npts)
99 return y == npts - 1 && t >= 3 + 2 * (npts - 2) && t < 3 + 3 * (npts - 2);
102 bool isEdge_45(
int t,
int y,
int npts)
104 boost::ignore_unused(y, npts);
108 bool isEdge(
int t,
int y,
int npts)
110 return isEdge_01(t, y, npts) || isEdge_12(t, y, npts) ||
111 isEdge_23(t, y, npts) || isEdge_30(t, y, npts) ||
112 isEdge_04(t, y, npts) || isEdge_14(t, y, npts) ||
113 isEdge_25(t, y, npts) || isEdge_35(t, y, npts) ||
114 isEdge_45(t, y, npts);
117 bool isFace_0123(
int t,
int y,
int npts)
119 boost::ignore_unused(y);
120 return t < 3 + (npts - 2);
123 bool isFace_014(
int t,
int y,
int npts)
125 boost::ignore_unused(t, npts);
129 bool isFace_1254(
int t,
int y,
int npts)
131 boost::ignore_unused(y);
132 return t < 3 + 2 * (npts - 2) && t >= 3 + (npts - 2);
135 bool isFace_325(
int t,
int y,
int npts)
137 boost::ignore_unused(t);
138 return y == (npts - 1);
141 bool isFace_0354(
int t,
int y,
int npts)
143 boost::ignore_unused(y);
144 return t < 3 + 3 * (npts - 2) && t >= 3 + 2 * (npts - 2);
147 bool isFace(
int t,
int y,
int npts)
149 return isFace_0123(t, y, npts) || isFace_014(t, y, npts) ||
150 isFace_1254(t, y, npts) || isFace_325(t, y, npts) ||
151 isFace_0354(t, y, npts);
171 for (
unsigned int y = 0, index = 0; y < npts; y++)
173 for (
size_t t = 0; t < u1.size(); t++, index++)
191 vector<int> iEdge_01;
192 vector<int> iEdge_12;
193 vector<int> iEdge_23;
194 vector<int> iEdge_30;
195 vector<int> iEdge_04;
196 vector<int> iEdge_14;
197 vector<int> iEdge_25;
198 vector<int> iEdge_35;
199 vector<int> iEdge_45;
200 vector<int> iFace_0123;
201 vector<int> iFace_014;
202 vector<int> iFace_1254;
203 vector<int> iFace_325;
204 vector<int> iFace_0354;
205 vector<int> interiorVolumePoints;
209 for (
unsigned int y = 0, index = 0; y < npts; y++)
211 for (
unsigned int t = 0; t < npts * (npts + 1) / 2; t++, index++)
213 if (isVertex(t, y, npts))
215 vertex.push_back(index);
217 else if (isEdge(t, y, npts))
219 if (isEdge_01(t, y, npts))
221 iEdge_01.push_back(index);
223 else if (isEdge_12(t, y, npts))
225 iEdge_12.push_back(index);
227 else if (isEdge_23(t, y, npts))
229 iEdge_23.push_back(index);
231 else if (isEdge_30(t, y, npts))
233 iEdge_30.push_back(index);
235 else if (isEdge_04(t, y, npts))
237 iEdge_04.push_back(index);
239 else if (isEdge_14(t, y, npts))
241 iEdge_14.push_back(index);
243 else if (isEdge_25(t, y, npts))
245 iEdge_25.push_back(index);
247 else if (isEdge_35(t, y, npts))
249 iEdge_35.push_back(index);
251 else if (isEdge_45(t, y, npts))
253 iEdge_45.push_back(index);
256 else if (isFace(t, y, npts))
258 if (isFace_0123(t, y, npts))
260 iFace_0123.push_back(index);
262 else if (isFace_014(t, y, npts))
264 iFace_014.push_back(index);
266 else if (isFace_1254(t, y, npts))
268 iFace_1254.push_back(index);
270 else if (isFace_325(t, y, npts))
272 iFace_325.push_back(index);
274 else if (isFace_0354(t, y, npts))
276 iFace_0354.push_back(index);
281 interiorVolumePoints.push_back(index);
287 std::swap(vertex[2], vertex[4]);
289 std::reverse(iEdge_23.begin(), iEdge_23.end());
290 std::reverse(iEdge_30.begin(), iEdge_30.end());
291 std::reverse(iEdge_04.begin(), iEdge_04.end());
292 std::reverse(iEdge_35.begin(), iEdge_35.end());
295 for (
unsigned int i = 0; i < npts - 2; i++)
297 for (
unsigned int j = i + 1; j < npts - 2; j++)
299 std::swap(iFace_1254[i * (npts - 2) + j],
300 iFace_1254[j * (npts - 2) + i]);
303 for (
int i = 0; i < npts - 2; i++)
305 std::reverse(iFace_0354.begin() + (i * (npts - 2)),
306 iFace_0354.begin() + (i * (npts - 2) + npts - 2));
308 for (
unsigned int i = 0; i < npts - 2; i++)
310 for (
unsigned int j = i + 1; j < npts - 2; j++)
312 std::swap(iFace_0354[i * (npts - 2) + j],
313 iFace_0354[j * (npts - 2) + i]);
317 for (
unsigned int n = 0; n < vertex.size(); ++n)
319 map.push_back(vertex[n]);
322 for (
unsigned int n = 0; n < iEdge_01.size(); ++n)
324 map.push_back(iEdge_01[n]);
327 for (
unsigned int n = 0; n < iEdge_12.size(); ++n)
329 map.push_back(iEdge_12[n]);
332 for (
unsigned int n = 0; n < iEdge_23.size(); ++n)
334 map.push_back(iEdge_23[n]);
337 for (
unsigned int n = 0; n < iEdge_30.size(); ++n)
339 map.push_back(iEdge_30[n]);
342 for (
unsigned int n = 0; n < iEdge_04.size(); ++n)
344 map.push_back(iEdge_04[n]);
347 for (
unsigned int n = 0; n < iEdge_14.size(); ++n)
349 map.push_back(iEdge_14[n]);
352 for (
unsigned int n = 0; n < iEdge_25.size(); ++n)
354 map.push_back(iEdge_25[n]);
357 for (
unsigned int n = 0; n < iEdge_35.size(); ++n)
359 map.push_back(iEdge_35[n]);
362 for (
unsigned int n = 0; n < iEdge_45.size(); ++n)
364 map.push_back(iEdge_45[n]);
367 for (
unsigned int n = 0; n < iFace_0123.size(); ++n)
369 map.push_back(iFace_0123[n]);
372 for (
unsigned int n = 0; n < iFace_014.size(); ++n)
374 map.push_back(iFace_014[n]);
377 for (
unsigned int n = 0; n < iFace_1254.size(); ++n)
379 map.push_back(iFace_1254[n]);
382 for (
unsigned int n = 0; n < iFace_325.size(); ++n)
384 map.push_back(iFace_325[n]);
387 for (
unsigned int n = 0; n < iFace_0354.size(); ++n)
389 map.push_back(iFace_0354[n]);
392 for (
unsigned int n = 0; n < interiorVolumePoints.size(); ++n)
394 map.push_back(interiorVolumePoints[n]);
402 for (
unsigned int index = 0; index < map.size(); ++index)
404 points[0][index] =
m_points[0][index];
405 points[1][index] =
m_points[1][index];
406 points[2][index] =
m_points[2][index];
409 for (
unsigned int index = 0; index < map.size(); ++index)
411 m_points[0][index] = points[0][map[index]];
412 m_points[1][index] = points[1][map[index]];
413 m_points[2][index] = points[2][map[index]];
442 std::shared_ptr<NekMatrix<NekDouble>> mat =
443 m_util->GetInterpolationMatrix(xi);
444 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
462 std::shared_ptr<PointsBaseType> returnval(
465 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 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_CalculateDerivMatrix() override
virtual void v_CalculatePoints() override
virtual void v_CalculateWeights() override
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()
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)
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eNodalPrismElec
3D electrostatically 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)