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){
116 return isEdge_01(x,y,z,npts) || isEdge_12(x,y,z,npts) ||
117 isEdge_23(x,y,z,npts) || isEdge_30(x,y,z,npts) ||
118 isEdge_04(x,y,z,npts) || isEdge_14(x,y,z,npts) ||
119 isEdge_25(x,y,z,npts) || isEdge_35(x,y,z,npts) ||
120 isEdge_45(x,y,z,npts);
123 bool isFace_0123(
int x,
int y,
int z,
int npts)
125 boost::ignore_unused(x, y, npts);
129 bool isFace_014(
int x,
int y,
int z,
int npts)
131 boost::ignore_unused(x, z, npts);
135 bool isFace_1254(
int x,
int y,
int z,
int npts)
137 boost::ignore_unused(y);
138 return x + z == npts-1;
141 bool isFace_325(
int x,
int y,
int z,
int npts)
143 boost::ignore_unused(x, z);
144 return y == (npts-1);
147 bool isFace_0354(
int x,
int y,
int z,
int npts)
149 boost::ignore_unused(y, z, npts);
153 bool isFace(
int x,
int y,
int z,
int npts){
154 return isFace_0123(x,y,z,npts) || isFace_014(x,y,z,npts) ||
155 isFace_1254(x,y,z,npts) || isFace_325(x,y,z,npts) ||
156 isFace_0354(x,y,z,npts);
169 for(
unsigned int z=0, index=0; z<npts; ++z){
170 for(
unsigned int y=0; y<npts; ++y){
171 for(
unsigned int x=0; x<npts-z; ++x, ++index){
193 vector<int> iEdge_01;
194 vector<int> iEdge_12;
195 vector<int> iEdge_23;
196 vector<int> iEdge_30;
197 vector<int> iEdge_04;
198 vector<int> iEdge_14;
199 vector<int> iEdge_25;
200 vector<int> iEdge_35;
201 vector<int> iEdge_45;
202 vector<int> iFace_0123;
203 vector<int> iFace_014;
204 vector<int> iFace_1254;
205 vector<int> iFace_325;
206 vector<int> iFace_0354;
207 vector<int> interiorVolumePoints;
211 for(
unsigned int z=0, index=0; z<npts; ++z){
212 for(
unsigned int y=0; y<npts; ++y){
213 for(
unsigned int x=0; x<npts-z; ++x, ++index){
214 if (isVertex(x,y,z,npts))
216 vertex.push_back(index);
218 else if (isEdge(x,y,z,npts))
220 if (isEdge_01(x,y,z,npts))
222 iEdge_01.push_back(index);
224 else if (isEdge_12(x,y,z,npts))
226 iEdge_12.push_back(index);
228 else if (isEdge_23(x,y,z,npts))
230 iEdge_23.push_back(index);
232 else if (isEdge_30(x,y,z,npts))
234 iEdge_30.push_back(index);
236 else if (isEdge_04(x,y,z,npts))
238 iEdge_04.push_back(index);
240 else if (isEdge_14(x,y,z,npts))
242 iEdge_14.push_back(index);
244 else if (isEdge_25(x,y,z,npts))
246 iEdge_25.push_back(index);
248 else if (isEdge_35(x,y,z,npts))
250 iEdge_35.push_back(index);
252 else if (isEdge_45(x,y,z,npts))
254 iEdge_45.push_back(index);
257 else if (isFace(x,y,z,npts))
259 if (isFace_0123(x,y,z,npts))
261 iFace_0123.push_back(index);
263 else if (isFace_014(x,y,z,npts))
265 iFace_014.push_back(index);
267 else if (isFace_1254(x,y,z,npts))
269 iFace_1254.push_back(index);
271 else if (isFace_325(x,y,z,npts))
273 iFace_325.push_back(index);
275 else if (isFace_0354(x,y,z,npts))
277 iFace_0354.push_back(index);
282 interiorVolumePoints.push_back(index);
288 for (
unsigned int n=0; n<vertex.size(); ++n)
290 map.push_back(vertex[n]);
293 for (
unsigned int n=0; n<iEdge_01.size(); ++n)
295 map.push_back(iEdge_01[n]);
298 for (
unsigned int n=0; n<iEdge_12.size(); ++n)
300 map.push_back(iEdge_12[n]);
303 for (
unsigned int n=0; n<iEdge_23.size(); ++n)
305 map.push_back(iEdge_23[n]);
308 for (
unsigned int n=0; n<iEdge_30.size(); ++n)
310 map.push_back(iEdge_30[n]);
313 for (
unsigned int n=0; n<iEdge_04.size(); ++n)
315 map.push_back(iEdge_04[n]);
318 for (
unsigned int n=0; n<iEdge_14.size(); ++n)
320 map.push_back(iEdge_14[n]);
323 for (
unsigned int n=0; n<iEdge_25.size(); ++n)
325 map.push_back(iEdge_25[n]);
328 for (
unsigned int n=0; n<iEdge_35.size(); ++n)
330 map.push_back(iEdge_35[n]);
333 for (
unsigned int n=0; n<iEdge_45.size(); ++n)
335 map.push_back(iEdge_45[n]);
338 for (
unsigned int n=0; n<iFace_0123.size(); ++n)
340 map.push_back(iFace_0123[n]);
343 for (
unsigned int n=0; n<iFace_014.size(); ++n)
345 map.push_back(iFace_014[n]);
348 for(
unsigned int n=0; n<iFace_1254.size(); ++n)
350 map.push_back(iFace_1254[n]);
353 for(
unsigned int n=0; n<iFace_325.size(); ++n)
355 map.push_back(iFace_325[n]);
358 for(
unsigned int n=0; n<iFace_0354.size(); ++n)
360 map.push_back(iFace_0354[n]);
363 for(
unsigned int n=0; n<interiorVolumePoints.size(); ++n)
365 map.push_back(interiorVolumePoints[n]);
373 for(
unsigned int index=0; index<map.size(); ++index)
375 points[0][index] =
m_points[0][index];
376 points[1][index] =
m_points[1][index];
377 points[2][index] =
m_points[2][index];
380 for(
unsigned int index=0; index<map.size(); ++index)
382 m_points[0][index] = points[0][map[index]];
383 m_points[1][index] = points[1][map[index]];
384 m_points[2][index] = points[2][map[index]];
414 std::shared_ptr<NekMatrix<NekDouble> > mat =
415 m_util->GetInterpolationMatrix(xi);
416 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(),
436 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[]
std::shared_ptr< NodalUtilPrism > m_util
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void CalculateDerivMatrix()
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 CalculateWeights()
virtual void CalculateDerivMatrix()
unsigned int GetNumPoints() const
virtual void CalculatePoints()
unsigned int GetTotNumPoints() const
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
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)