48 namespace LibUtilities
55 bool isVertex(
int x,
int y,
int z,
int npts){
56 return (x==0 && y==0 && z==0) || (x==(npts-1) && y==0 && z==0) || (x==0 && y==(npts-1) && z==0) || (x==0 && y==0 && z==(npts-1));
59 bool isEdge_01(
int x,
int y,
int z,
int npts){
63 bool isEdge_12(
int x,
int y,
int z,
int npts){
64 return z==0 && x + y == npts -1;
67 bool isEdge_20(
int x,
int y,
int z,
int npts){
71 bool isEdge_03(
int x,
int y,
int z,
int npts){
75 bool isEdge_13(
int x,
int y,
int z,
int npts){
76 return y==0 && x + z == npts -1;
79 bool isEdge_23(
int x,
int y,
int z,
int npts){
80 return x==0 && y + z == npts -1;
83 bool isEdge(
int x,
int y,
int z,
int npts){
84 return isEdge_01(x,y,z,npts)||isEdge_12(x,y,z,npts)||isEdge_20(x,y,z,npts)
85 ||isEdge_03(x,y,z,npts)||isEdge_13(x,y,z,npts)||isEdge_23(x,y,z,npts);
88 bool isFace_012(
int x,
int y,
int z,
int npts){
92 bool isFace_013(
int x,
int y,
int z,
int npts){
96 bool isFace_123(
int x,
int y,
int z,
int npts){
100 bool isFace_203(
int x,
int y,
int z,
int npts){
104 bool isFace(
int x,
int y,
int z,
int npts){
105 return isFace_012(x, y, z, npts) || isFace_013(x, y, z, npts)
106 || isFace_123(x, y, z, npts) || isFace_203(x, y, z, npts);
119 for(
unsigned int z=0, index=0; z<
npts; ++z){
120 for(
int y=0; y<npts-z; ++y){
121 for(
int x=0; x<npts-z-y; ++x, ++index){
143 vector<int> iEdge_01;
144 vector<int> iEdge_12;
145 vector<int> iEdge_20;
146 vector<int> iEdge_03;
147 vector<int> iEdge_13;
148 vector<int> iEdge_23;
149 vector<int> iFace_012;
150 vector<int> iFace_013;
151 vector<int> iFace_123;
152 vector<int> iFace_203;
153 vector<int> interiorVolumePoints;
157 for(
int z=0, index=0; z<
npts; ++z){
158 for(
int y=0; y<npts-z; ++y){
159 for(
int x=0; x<npts-z-y; ++x, ++index){
161 if( isVertex(x,y,z,npts) ){
163 vertex.push_back(index);
165 }
else if( isEdge(x,y,z,npts) ){
167 if( isEdge_01(x,y,z,npts) ){
169 iEdge_01.push_back(index);
171 }
else if( isEdge_12(x,y,z,npts) ){
173 iEdge_12.push_back(index);
175 }
else if( isEdge_20(x,y,z,npts) ){
177 iEdge_20.insert(iEdge_20.begin(), index);
179 }
else if( isEdge_03(x,y,z,npts) ){
181 iEdge_03.push_back(index);
183 }
else if( isEdge_13(x,y,z,npts) ){
185 iEdge_13.push_back(index);
187 }
else if( isEdge_23(x,y,z,npts) ){
189 iEdge_23.push_back(index);
193 }
else if( isFace(x,y,z,npts) ) {
195 if( isFace_012(x,y,z,npts) ){
197 iFace_012.push_back(index);
199 }
else if( isFace_013(x,y,z,npts) ){
201 iFace_013.push_back(index);
203 }
else if( isFace_123(x,y,z,npts) ){
205 iFace_123.push_back(index);
207 }
else if( isFace_203(x,y,z,npts) ){
209 iFace_203.push_back(index);
214 interiorVolumePoints.push_back(index);
222 for(
unsigned int n=0; n<vertex.size(); ++n){
224 map.push_back(vertex[n]);
227 for(
unsigned int n=0; n<iEdge_01.size(); ++n){
229 map.push_back(iEdge_01[n]);
232 for(
unsigned int n=0; n<iEdge_12.size(); ++n){
234 map.push_back(iEdge_12[n]);
237 for(
unsigned int n=0; n<iEdge_20.size(); ++n){
239 map.push_back(iEdge_20[n]);
242 for(
unsigned int n=0; n<iEdge_03.size(); ++n){
244 map.push_back(iEdge_03[n]);
247 for(
unsigned int n=0; n<iEdge_13.size(); ++n){
249 map.push_back(iEdge_13[n]);
252 for(
unsigned int n=0; n<iEdge_23.size(); ++n){
254 map.push_back(iEdge_23[n]);
257 for(
unsigned int n=0; n<iFace_012.size(); ++n){
259 map.push_back(iFace_012[n]);
262 for(
unsigned int n=0; n<iFace_013.size(); ++n){
264 map.push_back(iFace_013[n]);
267 for(
unsigned int n=0; n<iFace_123.size(); ++n){
269 map.push_back(iFace_123[n]);
272 for(
unsigned int n=0; n<iFace_203.size(); ++n){
274 map.push_back(iFace_203[n]);
277 for(
unsigned int n=0; n<interiorVolumePoints.size(); ++n){
279 map.push_back(interiorVolumePoints[n]);
287 for(
unsigned int index=0; index<map.size(); ++index){
289 points[0][index] =
m_points[0][index];
290 points[1][index] =
m_points[1][index];
291 points[2][index] =
m_points[2][index];
295 for(
unsigned int index=0; index<map.size(); ++index){
297 m_points[0][index] = points[0][map[index]];
298 m_points[1][index] = points[1][map[index]];
299 m_points[2][index] = points[2][map[index]];
332 boost::shared_ptr<NekMatrix<NekDouble> > mat =
333 m_util->GetInterpolationMatrix(xi);
334 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(),
354 returnval->Initialize();
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...
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
MatrixSharedPtrType m_derivmatrix[3]
void CalculateDerivMatrix()
Array< OneD, DataType > m_points[3]
static boost::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void NodalPointReorder3d()
unsigned int GetNumPoints() const
boost::shared_ptr< NodalUtilTetrahedron > m_util
Array< OneD, DataType > m_weights
Defines a specification for a set of points.
virtual void CalculateDerivMatrix()
unsigned int GetRows() const
unsigned int GetTotNumPoints() const
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Array< OneD, DataType > & GetPtr()
virtual void CalculateWeights()