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){
175 vector<int> iEdge_01;
176 vector<int> iEdge_12;
177 vector<int> iEdge_23;
178 vector<int> iEdge_30;
179 vector<int> iEdge_04;
180 vector<int> iEdge_14;
181 vector<int> iEdge_25;
182 vector<int> iEdge_35;
183 vector<int> iEdge_45;
184 vector<int> iFace_0123;
185 vector<int> iFace_014;
186 vector<int> iFace_1254;
187 vector<int> iFace_325;
188 vector<int> iFace_0354;
189 vector<int> interiorVolumePoints;
193 for(
int z=0, index=0; z<
npts; ++z){
194 for(
int y=0; y<
npts; ++y){
195 for(
int x=0; x<npts-z; ++x, ++index){
196 if (isVertex(x,y,z,npts))
198 vertex.push_back(index);
200 else if (isEdge(x,y,z,npts))
202 if (isEdge_01(x,y,z,npts))
204 iEdge_01.push_back(index);
206 else if (isEdge_12(x,y,z,npts))
208 iEdge_12.push_back(index);
210 else if (isEdge_23(x,y,z,npts))
212 iEdge_23.push_back(index);
214 else if (isEdge_30(x,y,z,npts))
216 iEdge_30.push_back(index);
218 else if (isEdge_04(x,y,z,npts))
220 iEdge_04.push_back(index);
222 else if (isEdge_14(x,y,z,npts))
224 iEdge_14.push_back(index);
226 else if (isEdge_25(x,y,z,npts))
228 iEdge_25.push_back(index);
230 else if (isEdge_35(x,y,z,npts))
232 iEdge_35.push_back(index);
234 else if (isEdge_45(x,y,z,npts))
236 iEdge_45.push_back(index);
239 else if (isFace(x,y,z,npts))
241 if (isFace_0123(x,y,z,npts))
243 iFace_0123.push_back(index);
245 else if (isFace_014(x,y,z,npts))
247 iFace_014.push_back(index);
249 else if (isFace_1254(x,y,z,npts))
251 iFace_1254.push_back(index);
253 else if (isFace_325(x,y,z,npts))
255 iFace_325.push_back(index);
257 else if (isFace_0354(x,y,z,npts))
259 iFace_0354.push_back(index);
264 interiorVolumePoints.push_back(index);
270 for (
unsigned int n=0; n<vertex.size(); ++n)
272 map.push_back(vertex[n]);
275 for (
unsigned int n=0; n<iEdge_01.size(); ++n)
277 map.push_back(iEdge_01[n]);
280 for (
unsigned int n=0; n<iEdge_12.size(); ++n)
282 map.push_back(iEdge_12[n]);
285 for (
unsigned int n=0; n<iEdge_23.size(); ++n)
287 map.push_back(iEdge_23[n]);
290 for (
unsigned int n=0; n<iEdge_30.size(); ++n)
292 map.push_back(iEdge_30[n]);
295 for (
unsigned int n=0; n<iEdge_04.size(); ++n)
297 map.push_back(iEdge_04[n]);
300 for (
unsigned int n=0; n<iEdge_14.size(); ++n)
302 map.push_back(iEdge_14[n]);
305 for (
unsigned int n=0; n<iEdge_25.size(); ++n)
307 map.push_back(iEdge_25[n]);
310 for (
unsigned int n=0; n<iEdge_35.size(); ++n)
312 map.push_back(iEdge_35[n]);
315 for (
unsigned int n=0; n<iEdge_45.size(); ++n)
317 map.push_back(iEdge_45[n]);
320 for (
unsigned int n=0; n<iFace_0123.size(); ++n)
322 map.push_back(iFace_0123[n]);
325 for (
unsigned int n=0; n<iFace_014.size(); ++n)
327 map.push_back(iFace_014[n]);
330 for(
unsigned int n=0; n<iFace_1254.size(); ++n)
332 map.push_back(iFace_1254[n]);
335 for(
unsigned int n=0; n<iFace_325.size(); ++n)
337 map.push_back(iFace_325[n]);
340 for(
unsigned int n=0; n<iFace_0354.size(); ++n)
342 map.push_back(iFace_0354[n]);
345 for(
unsigned int n=0; n<interiorVolumePoints.size(); ++n)
347 map.push_back(interiorVolumePoints[n]);
355 for(
unsigned int index=0; index<map.size(); ++index)
357 points[0][index] =
m_points[0][index];
358 points[1][index] =
m_points[1][index];
359 points[2][index] =
m_points[2][index];
362 for(
unsigned int index=0; index<map.size(); ++index)
364 m_points[0][index] = points[0][map[index]];
365 m_points[1][index] = points[1][map[index]];
366 m_points[2][index] = points[2][map[index]];
383 ASSERTL0(
false,
"Not yet implemented");
397 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)
unsigned int GetTotNumPoints() const
#define ASSERTL0(condition, msg)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
virtual void CalculatePoints()
Defines a specification for a set of points.
void CalculateDerivMatrix()
unsigned int GetNumPoints() const
Array< OneD, DataType > m_points[3]
static boost::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void NodalPointReorder3d()