Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Nektar::LibUtilities::NodalPrismEvenlySpaced Class Reference

#include <NodalPrismEvenlySpaced.h>

Inheritance diagram for Nektar::LibUtilities::NodalPrismEvenlySpaced:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LibUtilities::NodalPrismEvenlySpaced:
Collaboration graph
[legend]

Public Member Functions

virtual ~NodalPrismEvenlySpaced ()
 
 NodalPrismEvenlySpaced (const PointsKey &key)
 
const MatrixSharedPtrType GetI (const PointsKey &pkey)
 
const MatrixSharedPtrType GetI (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z)
 
- Public Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual ~Points ()
 
virtual void Initialize (void)
 
unsigned int GetPointsDim () const
 
unsigned int GetNumPoints () const
 
unsigned int GetTotNumPoints () const
 
PointsType GetPointsType () const
 
const Array< OneD, const
DataType > & 
GetZ () const
 
const Array< OneD, const
DataType > & 
GetW () const
 
void GetZW (Array< OneD, const DataType > &z, Array< OneD, const DataType > &w) const
 
void GetPoints (Array< OneD, const DataType > &x) const
 
void GetPoints (Array< OneD, const DataType > &x, Array< OneD, const DataType > &y) const
 
void GetPoints (Array< OneD, const DataType > &x, Array< OneD, const DataType > &y, Array< OneD, const DataType > &z) const
 
const MatrixSharedPtrTypeGetD (Direction dir=xDir) const
 
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x)
 
virtual const MatrixSharedPtrType GetI (unsigned int numpoints, const Array< OneD, const DataType > &x)
 
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y)
 
virtual const MatrixSharedPtrType GetGalerkinProjection (const PointsKey &pkey)
 

Static Public Member Functions

static boost::shared_ptr
< PointsBaseType
Create (const PointsKey &key)
 

Private Member Functions

 NodalPrismEvenlySpaced ()
 Default constructor should not be called except by Create matrix. More...
 
void CalculatePoints ()
 
void CalculateWeights ()
 
void CalculateDerivMatrix ()
 
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)
 

Additional Inherited Members

- Public Types inherited from Nektar::LibUtilities::Points< NekDouble >
typedef NekDouble DataType
 
typedef boost::shared_ptr
< NekMatrix< DataType > > 
MatrixSharedPtrType
 
- Protected Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
 Points (const PointsKey &key)
 
- Protected Attributes inherited from Nektar::LibUtilities::Points< NekDouble >
PointsKey m_pointsKey
 
Array< OneD, DataTypem_points [3]
 
Array< OneD, DataTypem_weights
 
MatrixSharedPtrType m_derivmatrix [3]
 
NekManager< PointsKey,
NekMatrix< DataType >
, PointsKey::opLess
m_InterpManager
 
NekManager< PointsKey,
NekMatrix< DataType >
, PointsKey::opLess
m_GalerkinProjectionManager
 

Detailed Description

Definition at line 52 of file NodalPrismEvenlySpaced.h.

Constructor & Destructor Documentation

virtual Nektar::LibUtilities::NodalPrismEvenlySpaced::~NodalPrismEvenlySpaced ( )
inlinevirtual

Definition at line 55 of file NodalPrismEvenlySpaced.h.

56  {
57 
58  }
Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( const PointsKey key)
inline

Definition at line 60 of file NodalPrismEvenlySpaced.h.

60  :PointsBaseType(key)
61  {
62 
63  }
Points< NekDouble > PointsBaseType
Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( )
inlineprivate

Default constructor should not be called except by Create matrix.

Definition at line 96 of file NodalPrismEvenlySpaced.h.

97  {
98  }
static const PointsKey NullPointsKey(0, eNoPointsType)
Points< NekDouble > PointsBaseType

Member Function Documentation

void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateDerivMatrix ( )
privatevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 388 of file NodalPrismEvenlySpaced.cpp.

389  {
390 
391  }
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateInterpMatrix ( const Array< OneD, const NekDouble > &  xi,
const Array< OneD, const NekDouble > &  yi,
const Array< OneD, const NekDouble > &  zi,
Array< OneD, NekDouble > &  interp 
)
private

Definition at line 378 of file NodalPrismEvenlySpaced.cpp.

References ASSERTL0.

Referenced by GetI().

382  {
383  ASSERTL0(false, "Not yet implemented");
384  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculatePoints ( )
privatevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 145 of file NodalPrismEvenlySpaced.cpp.

References Nektar::LibUtilities::Points< NekDouble >::CalculatePoints(), Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, NodalPointReorder3d(), and npts.

146  {
147  // Allocate the storage for points
149 
150  // Populate m_points
151  unsigned int npts = GetNumPoints();
152  NekDouble delta = 2.0/(npts - 1.0);
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){
156  NekDouble xi = -1.0 + x*delta;
157  NekDouble yi = -1.0 + y*delta;
158  NekDouble zi = -1.0 + z*delta;
159 
160  m_points[0][index] = xi;
161  m_points[1][index] = yi;
162  m_points[2][index] = zi;
163  }
164  }
165  }
166 
168  }
Array< OneD, DataType > m_points[3]
Definition: Points.h:349
unsigned int GetNumPoints() const
Definition: Points.h:246
static std::string npts
Definition: InputFld.cpp:43
double NekDouble
void Nektar::LibUtilities::NodalPrismEvenlySpaced::CalculateWeights ( )
privatevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 370 of file NodalPrismEvenlySpaced.cpp.

371  {
372 
373  }
boost::shared_ptr< PointsBaseType > Nektar::LibUtilities::NodalPrismEvenlySpaced::Create ( const PointsKey key)
static

Definition at line 393 of file NodalPrismEvenlySpaced.cpp.

394  {
395  boost::shared_ptr<PointsBaseType> returnval(MemoryManager<NodalPrismEvenlySpaced>::AllocateSharedPtr(key));
396 
397  returnval->Initialize();
398 
399  return returnval;
400  }
const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::GetI ( const PointsKey pkey)
inlinevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 68 of file NodalPrismEvenlySpaced.h.

References ASSERTL0, Nektar::LibUtilities::PointsKey::GetPointsDim(), and Nektar::LibUtilities::PointsManager().

69  {
70  ASSERTL0(pkey.GetPointsDim() == 3,
71  "NodalPrismEvenlySpaced Points can only interp to "
72  "other 3d point distributions");
73  Array<OneD, const NekDouble> x, y, z;
74  PointsManager()[pkey]->GetPoints(x, y, z);
75  return GetI(x, y, z);
76  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
PointsManagerT & PointsManager(void)
const MatrixSharedPtrType GetI(const PointsKey &pkey)
const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::GetI ( const Array< OneD, const NekDouble > &  x,
const Array< OneD, const NekDouble > &  y,
const Array< OneD, const NekDouble > &  z 
)
inlinevirtual

Reimplemented from Nektar::LibUtilities::Points< NekDouble >.

Definition at line 78 of file NodalPrismEvenlySpaced.h.

References CalculateInterpMatrix(), and Nektar::LibUtilities::Points< NekDouble >::GetTotNumPoints().

82  {
83  int numpoints = x.num_elements();
84  unsigned int np = GetTotNumPoints();
85 
86  Array<OneD, NekDouble> interp(GetTotNumPoints()*numpoints);
87  CalculateInterpMatrix(x, y, z, interp);
88 
89  NekDouble* d = interp.data();
90  return MemoryManager<NekMatrix<NekDouble> >
91  ::AllocateSharedPtr(numpoints, np, d);
92  }
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
double NekDouble
unsigned int GetTotNumPoints() const
Definition: Points.h:251
void Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPointReorder3d ( )
private

Definition at line 170 of file NodalPrismEvenlySpaced.cpp.

References Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::GetTotNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, and npts.

Referenced by CalculatePoints().

171  {
172  unsigned int npts = GetNumPoints();
173  using std::vector;
174  vector<int> vertex;
175  vector<int> iEdge_01; // interior edge 0
176  vector<int> iEdge_12; // interior edge 1
177  vector<int> iEdge_23; // interior edge 2
178  vector<int> iEdge_30; // interior edge 3
179  vector<int> iEdge_04; // interior edge 4
180  vector<int> iEdge_14; // interior edge 5
181  vector<int> iEdge_25; // interior edge 6
182  vector<int> iEdge_35; // interior edge 7
183  vector<int> iEdge_45; // interior edge 8
184  vector<int> iFace_0123; // interior face 0
185  vector<int> iFace_014; // interior face 1
186  vector<int> iFace_1254; // interior face 2
187  vector<int> iFace_325; // interior face 3
188  vector<int> iFace_0354; // interior face 4
189  vector<int> interiorVolumePoints; // interior volume points
190  vector<int> map;
191 
192  // Build the lattice prism left to right - bottom to top
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))
197  {
198  vertex.push_back(index);
199  }
200  else if (isEdge(x,y,z,npts))
201  {
202  if (isEdge_01(x,y,z,npts))
203  {
204  iEdge_01.push_back(index);
205  }
206  else if (isEdge_12(x,y,z,npts))
207  {
208  iEdge_12.push_back(index);
209  }
210  else if (isEdge_23(x,y,z,npts))
211  {
212  iEdge_23.push_back(index);
213  }
214  else if (isEdge_30(x,y,z,npts))
215  {
216  iEdge_30.push_back(index);
217  }
218  else if (isEdge_04(x,y,z,npts))
219  {
220  iEdge_04.push_back(index);
221  }
222  else if (isEdge_14(x,y,z,npts))
223  {
224  iEdge_14.push_back(index);
225  }
226  else if (isEdge_25(x,y,z,npts))
227  {
228  iEdge_25.push_back(index);
229  }
230  else if (isEdge_35(x,y,z,npts))
231  {
232  iEdge_35.push_back(index);
233  }
234  else if (isEdge_45(x,y,z,npts))
235  {
236  iEdge_45.push_back(index);
237  }
238  }
239  else if (isFace(x,y,z,npts))
240  {
241  if (isFace_0123(x,y,z,npts))
242  {
243  iFace_0123.push_back(index);
244  }
245  else if (isFace_014(x,y,z,npts))
246  {
247  iFace_014.push_back(index);
248  }
249  else if (isFace_1254(x,y,z,npts))
250  {
251  iFace_1254.push_back(index);
252  }
253  else if (isFace_325(x,y,z,npts))
254  {
255  iFace_325.push_back(index);
256  }
257  else if (isFace_0354(x,y,z,npts))
258  {
259  iFace_0354.push_back(index);
260  }
261  }
262  else
263  {
264  interiorVolumePoints.push_back(index);
265  }
266  }
267  }
268  }
269 
270  for (unsigned int n=0; n<vertex.size(); ++n)
271  {
272  map.push_back(vertex[n]);
273  }
274 
275  for (unsigned int n=0; n<iEdge_01.size(); ++n)
276  {
277  map.push_back(iEdge_01[n]);
278  }
279 
280  for (unsigned int n=0; n<iEdge_12.size(); ++n)
281  {
282  map.push_back(iEdge_12[n]);
283  }
284 
285  for (unsigned int n=0; n<iEdge_23.size(); ++n)
286  {
287  map.push_back(iEdge_23[n]);
288  }
289 
290  for (unsigned int n=0; n<iEdge_30.size(); ++n)
291  {
292  map.push_back(iEdge_30[n]);
293  }
294 
295  for (unsigned int n=0; n<iEdge_04.size(); ++n)
296  {
297  map.push_back(iEdge_04[n]);
298  }
299 
300  for (unsigned int n=0; n<iEdge_14.size(); ++n)
301  {
302  map.push_back(iEdge_14[n]);
303  }
304 
305  for (unsigned int n=0; n<iEdge_25.size(); ++n)
306  {
307  map.push_back(iEdge_25[n]);
308  }
309 
310  for (unsigned int n=0; n<iEdge_35.size(); ++n)
311  {
312  map.push_back(iEdge_35[n]);
313  }
314 
315  for (unsigned int n=0; n<iEdge_45.size(); ++n)
316  {
317  map.push_back(iEdge_45[n]);
318  }
319 
320  for (unsigned int n=0; n<iFace_0123.size(); ++n)
321  {
322  map.push_back(iFace_0123[n]);
323  }
324 
325  for (unsigned int n=0; n<iFace_014.size(); ++n)
326  {
327  map.push_back(iFace_014[n]);
328  }
329 
330  for(unsigned int n=0; n<iFace_1254.size(); ++n)
331  {
332  map.push_back(iFace_1254[n]);
333  }
334 
335  for(unsigned int n=0; n<iFace_325.size(); ++n)
336  {
337  map.push_back(iFace_325[n]);
338  }
339 
340  for(unsigned int n=0; n<iFace_0354.size(); ++n)
341  {
342  map.push_back(iFace_0354[n]);
343  }
344 
345  for(unsigned int n=0; n<interiorVolumePoints.size(); ++n)
346  {
347  map.push_back(interiorVolumePoints[n]);
348  }
349 
350  Array<OneD, NekDouble> points[3];
351  points[0] = Array<OneD, NekDouble>(GetTotNumPoints());
352  points[1] = Array<OneD, NekDouble>(GetTotNumPoints());
353  points[2] = Array<OneD, NekDouble>(GetTotNumPoints());
354 
355  for(unsigned int index=0; index<map.size(); ++index)
356  {
357  points[0][index] = m_points[0][index];
358  points[1][index] = m_points[1][index];
359  points[2][index] = m_points[2][index];
360  }
361 
362  for(unsigned int index=0; index<map.size(); ++index)
363  {
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]];
367  }
368  }
Array< OneD, DataType > m_points[3]
Definition: Points.h:349
unsigned int GetNumPoints() const
Definition: Points.h:246
static std::string npts
Definition: InputFld.cpp:43
unsigned int GetTotNumPoints() const
Definition: Points.h:251