45 namespace LibUtilities
49 bool isVertex(
int x,
int y,
int z,
int npts)
51 return (x == 0 && y == 0 && z == 0 ) ||
52 (x == (npts-1) && y == 0 && z == 0 ) ||
53 (x == (npts-1) && y == (npts-1) && z == 0 ) ||
54 (x == 0 && y == (npts-1) && z == 0 ) ||
55 (x == 0 && y == 0 && z == (npts-1)) ||
56 (x == 0 && y == (npts-1) && z == (npts-1));
59 bool isEdge_01(
int x,
int y,
int z,
int npts)
61 return y == 0 && z == 0;
64 bool isEdge_12(
int x,
int y,
int z,
int npts)
66 return x == (npts-1) && z == 0;
69 bool isEdge_23(
int x,
int y,
int z,
int npts)
71 return y == (npts-1) && z == 0;
74 bool isEdge_30(
int x,
int y,
int z,
int npts)
76 return x == 0 && z == 0;
79 bool isEdge_04(
int x,
int y,
int z,
int npts)
81 return x == 0 && y == 0;
84 bool isEdge_14(
int x,
int y,
int z,
int npts)
86 return x + z == (npts-1) && y == 0;
89 bool isEdge_25(
int x,
int y,
int z,
int npts)
91 return x + z == (npts-1) && y == (npts-1);
94 bool isEdge_35(
int x,
int y,
int z,
int npts)
96 return x == 0 && y == (npts-1);
99 bool isEdge_45(
int x,
int y,
int z,
int npts)
101 return x == 0 && z == (npts-1);
104 bool isEdge(
int x,
int y,
int z,
int npts){
105 return isEdge_01(x,y,z,npts) || isEdge_12(x,y,z,npts) ||
106 isEdge_23(x,y,z,npts) || isEdge_30(x,y,z,npts) ||
107 isEdge_04(x,y,z,npts) || isEdge_14(x,y,z,npts) ||
108 isEdge_25(x,y,z,npts) || isEdge_35(x,y,z,npts) ||
109 isEdge_45(x,y,z,npts);
112 bool isFace_0123(
int x,
int y,
int z,
int npts)
117 bool isFace_014(
int x,
int y,
int z,
int npts)
122 bool isFace_1254(
int x,
int y,
int z,
int npts)
124 return x + z == npts-1;
127 bool isFace_325(
int x,
int y,
int z,
int npts)
129 return y == (npts-1);
132 bool isFace_0354(
int x,
int y,
int z,
int npts)
137 bool isFace(
int x,
int y,
int z,
int npts){
138 return isFace_0123(x,y,z,npts) || isFace_014(x,y,z,npts) ||
139 isFace_1254(x,y,z,npts) || isFace_325(x,y,z,npts) ||
140 isFace_0354(x,y,z,npts);
153 for(
unsigned int z=0, index=0; z<
npts; ++z){
154 for(
int y=0; y<
npts; ++y){
155 for(
int x=0; x<npts-z; ++x, ++index){
177 vector<int> iEdge_01;
178 vector<int> iEdge_12;
179 vector<int> iEdge_23;
180 vector<int> iEdge_30;
181 vector<int> iEdge_04;
182 vector<int> iEdge_14;
183 vector<int> iEdge_25;
184 vector<int> iEdge_35;
185 vector<int> iEdge_45;
186 vector<int> iFace_0123;
187 vector<int> iFace_014;
188 vector<int> iFace_1254;
189 vector<int> iFace_325;
190 vector<int> iFace_0354;
191 vector<int> interiorVolumePoints;
195 for(
int z=0, index=0; z<
npts; ++z){
196 for(
int y=0; y<
npts; ++y){
197 for(
int x=0; x<npts-z; ++x, ++index){
198 if (isVertex(x,y,z,npts))
200 vertex.push_back(index);
202 else if (isEdge(x,y,z,npts))
204 if (isEdge_01(x,y,z,npts))
206 iEdge_01.push_back(index);
208 else if (isEdge_12(x,y,z,npts))
210 iEdge_12.push_back(index);
212 else if (isEdge_23(x,y,z,npts))
214 iEdge_23.push_back(index);
216 else if (isEdge_30(x,y,z,npts))
218 iEdge_30.push_back(index);
220 else if (isEdge_04(x,y,z,npts))
222 iEdge_04.push_back(index);
224 else if (isEdge_14(x,y,z,npts))
226 iEdge_14.push_back(index);
228 else if (isEdge_25(x,y,z,npts))
230 iEdge_25.push_back(index);
232 else if (isEdge_35(x,y,z,npts))
234 iEdge_35.push_back(index);
236 else if (isEdge_45(x,y,z,npts))
238 iEdge_45.push_back(index);
241 else if (isFace(x,y,z,npts))
243 if (isFace_0123(x,y,z,npts))
245 iFace_0123.push_back(index);
247 else if (isFace_014(x,y,z,npts))
249 iFace_014.push_back(index);
251 else if (isFace_1254(x,y,z,npts))
253 iFace_1254.push_back(index);
255 else if (isFace_325(x,y,z,npts))
257 iFace_325.push_back(index);
259 else if (isFace_0354(x,y,z,npts))
261 iFace_0354.push_back(index);
266 interiorVolumePoints.push_back(index);
272 for (
unsigned int n=0; n<vertex.size(); ++n)
274 map.push_back(vertex[n]);
277 for (
unsigned int n=0; n<iEdge_01.size(); ++n)
279 map.push_back(iEdge_01[n]);
282 for (
unsigned int n=0; n<iEdge_12.size(); ++n)
284 map.push_back(iEdge_12[n]);
287 for (
unsigned int n=0; n<iEdge_23.size(); ++n)
289 map.push_back(iEdge_23[n]);
292 for (
unsigned int n=0; n<iEdge_30.size(); ++n)
294 map.push_back(iEdge_30[n]);
297 for (
unsigned int n=0; n<iEdge_04.size(); ++n)
299 map.push_back(iEdge_04[n]);
302 for (
unsigned int n=0; n<iEdge_14.size(); ++n)
304 map.push_back(iEdge_14[n]);
307 for (
unsigned int n=0; n<iEdge_25.size(); ++n)
309 map.push_back(iEdge_25[n]);
312 for (
unsigned int n=0; n<iEdge_35.size(); ++n)
314 map.push_back(iEdge_35[n]);
317 for (
unsigned int n=0; n<iEdge_45.size(); ++n)
319 map.push_back(iEdge_45[n]);
322 for (
unsigned int n=0; n<iFace_0123.size(); ++n)
324 map.push_back(iFace_0123[n]);
327 for (
unsigned int n=0; n<iFace_014.size(); ++n)
329 map.push_back(iFace_014[n]);
332 for(
unsigned int n=0; n<iFace_1254.size(); ++n)
334 map.push_back(iFace_1254[n]);
337 for(
unsigned int n=0; n<iFace_325.size(); ++n)
339 map.push_back(iFace_325[n]);
342 for(
unsigned int n=0; n<iFace_0354.size(); ++n)
344 map.push_back(iFace_0354[n]);
347 for(
unsigned int n=0; n<interiorVolumePoints.size(); ++n)
349 map.push_back(interiorVolumePoints[n]);
357 for(
unsigned int index=0; index<map.size(); ++index)
359 points[0][index] =
m_points[0][index];
360 points[1][index] =
m_points[1][index];
361 points[2][index] =
m_points[2][index];
364 for(
unsigned int index=0; index<map.size(); ++index)
366 m_points[0][index] = points[0][map[index]];
367 m_points[1][index] = points[1][map[index]];
368 m_points[2][index] = points[2][map[index]];
398 boost::shared_ptr<NekMatrix<NekDouble> > mat =
399 m_util->GetInterpolationMatrix(xi);
400 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(),
420 returnval->Initialize();
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 boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void CalculatePoints()
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
MatrixSharedPtrType m_derivmatrix[3]
Array< OneD, DataType > m_points[3]
boost::shared_ptr< NodalUtilPrism > m_util
unsigned int GetNumPoints() const
Array< OneD, DataType > m_weights
Defines a specification for a set of points.
virtual void CalculateDerivMatrix()
void CalculateDerivMatrix()
unsigned int GetRows() const
static boost::shared_ptr< PointsBaseType > Create(const PointsKey &key)
unsigned int GetTotNumPoints() const
void NodalPointReorder3d()
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Array< OneD, DataType > & GetPtr()
virtual void CalculateWeights()