Nektar++
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Nektar::LibUtilities::NodalPrismEvenlySpaced Class Reference

#include <NodalPrismEvenlySpaced.h>

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

Public Member Functions

 ~NodalPrismEvenlySpaced () override
 
 NodalPrismEvenlySpaced (const PointsKey &key)
 
- Public Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual ~Points ()
 
void Initialize (void)
 
size_t GetPointsDim () const
 
size_t GetNumPoints () const
 
size_t 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
 
const Array< OneD, const NekDouble > & GetBaryWeights () 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
 
const MatrixSharedPtrType GetI (const PointsKey &key)
 
const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x)
 
const MatrixSharedPtrType GetI (size_t uint, const Array< OneD, const DataType > &x)
 
const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y)
 
const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y, const Array< OneD, const DataType > &z)
 
const MatrixSharedPtrType GetGalerkinProjection (const PointsKey &pkey)
 

Static Public Member Functions

static std::shared_ptr< PointsBaseTypeCreate (const PointsKey &key)
 

Protected Member Functions

const MatrixSharedPtrType v_GetI (const PointsKey &pkey) override
 
const MatrixSharedPtrType v_GetI (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z) override
 
- Protected Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual void v_Initialize (void)
 
virtual void v_CalculatePoints ()
 
virtual void v_CalculateWeights ()
 

Private Member Functions

 NodalPrismEvenlySpaced ()=delete
 
 NodalPrismEvenlySpaced (const NodalPrismEvenlySpaced &points)=delete
 
void NodalPointReorder3d ()
 
void v_CalculatePoints () final
 
void v_CalculateWeights () final
 
void v_CalculateDerivMatrix () final
 
void CalculateInterpMatrix (const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
 

Private Attributes

std::shared_ptr< NodalUtilPrismm_util
 

Static Private Attributes

static bool initPointsManager []
 

Additional Inherited Members

- Public Types inherited from Nektar::LibUtilities::Points< NekDouble >
typedef NekDouble DataType
 
typedef std::shared_ptr< NekMatrix< DataType > > MatrixSharedPtrType
 
- Protected Attributes inherited from Nektar::LibUtilities::Points< NekDouble >
PointsKey m_pointsKey
 Points type for this points distributions. More...
 
Array< OneD, DataTypem_points [3]
 Storage for the point locations, allowing for up to a 3D points storage. More...
 
Array< OneD, DataTypem_weights
 Quadrature weights for the weights. More...
 
Array< OneD, DataTypem_bcweights
 Barycentric weights. More...
 
MatrixSharedPtrType m_derivmatrix [3]
 Derivative matrices. More...
 
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLessm_InterpManager
 
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLessm_GalerkinProjectionManager
 

Detailed Description

Definition at line 45 of file NodalPrismEvenlySpaced.h.

Constructor & Destructor Documentation

◆ ~NodalPrismEvenlySpaced()

Nektar::LibUtilities::NodalPrismEvenlySpaced::~NodalPrismEvenlySpaced ( )
inlineoverride

Definition at line 48 of file NodalPrismEvenlySpaced.h.

49 {
50 }

◆ NodalPrismEvenlySpaced() [1/3]

Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( const PointsKey key)
inline

Definition at line 52 of file NodalPrismEvenlySpaced.h.

52 : PointsBaseType(key)
53 {
54 }
Points< NekDouble > PointsBaseType

◆ NodalPrismEvenlySpaced() [2/3]

Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( )
privatedelete

◆ NodalPrismEvenlySpaced() [3/3]

Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPrismEvenlySpaced ( const NodalPrismEvenlySpaced points)
privatedelete

Member Function Documentation

◆ CalculateInterpMatrix()

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 399 of file NodalPrismEvenlySpaced.cpp.

403{
404 Array<OneD, Array<OneD, NekDouble>> xi(3);
405 xi[0] = xia;
406 xi[1] = yia;
407 xi[2] = zia;
408
409 std::shared_ptr<NekMatrix<NekDouble>> mat =
410 m_util->GetInterpolationMatrix(xi);
411 Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
412 &interp[0], 1);
413}
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References m_util, and Vmath::Vcopy().

Referenced by v_GetI().

◆ Create()

std::shared_ptr< PointsBaseType > Nektar::LibUtilities::NodalPrismEvenlySpaced::Create ( const PointsKey key)
static

Definition at line 427 of file NodalPrismEvenlySpaced.cpp.

429{
430 std::shared_ptr<PointsBaseType> returnval(
432
433 returnval->Initialize();
434
435 return returnval;
436}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ NodalPointReorder3d()

void Nektar::LibUtilities::NodalPrismEvenlySpaced::NodalPointReorder3d ( )
private

Definition at line 181 of file NodalPrismEvenlySpaced.cpp.

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

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

Referenced by v_CalculatePoints().

◆ v_CalculateDerivMatrix()

void Nektar::LibUtilities::NodalPrismEvenlySpaced::v_CalculateDerivMatrix ( )
finalprivate

Definition at line 417 of file NodalPrismEvenlySpaced.cpp.

418{
419 // Allocate the derivative matrix.
420 PointsBaseType::v_CalculateDerivMatrix();
421
422 m_derivmatrix[0] = m_util->GetDerivMatrix(0);
423 m_derivmatrix[1] = m_util->GetDerivMatrix(1);
424 m_derivmatrix[2] = m_util->GetDerivMatrix(2);
425}
MatrixSharedPtrType m_derivmatrix[3]
Derivative matrices.
Definition: Points.h:362

References Nektar::LibUtilities::Points< NekDouble >::m_derivmatrix, and m_util.

◆ v_CalculatePoints()

void Nektar::LibUtilities::NodalPrismEvenlySpaced::v_CalculatePoints ( )
finalprivatevirtual

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

Definition at line 151 of file NodalPrismEvenlySpaced.cpp.

152{
153 // Allocate the storage for points
155
156 // Populate m_points
157 size_t npts = GetNumPoints();
158 NekDouble delta = 2.0 / (npts - 1.0);
159 for (size_t z = 0, index = 0; z < npts; ++z)
160 {
161 for (size_t y = 0; y < npts; ++y)
162 {
163 for (size_t x = 0; x < npts - z; ++x, ++index)
164 {
165 NekDouble xi = -1.0 + x * delta;
166 NekDouble yi = -1.0 + y * delta;
167 NekDouble zi = -1.0 + z * delta;
168
169 m_points[0][index] = xi;
170 m_points[1][index] = yi;
171 m_points[2][index] = zi;
172 }
173 }
174 }
175
178 npts - 1, m_points[0], m_points[1], m_points[2]);
179}
double NekDouble

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, m_util, NodalPointReorder3d(), Nektar::LibUtilities::Points< NekDouble >::v_CalculatePoints(), and Nektar::UnitTests::z().

◆ v_CalculateWeights()

void Nektar::LibUtilities::NodalPrismEvenlySpaced::v_CalculateWeights ( )
finalprivatevirtual

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

Definition at line 384 of file NodalPrismEvenlySpaced.cpp.

385{
386 // Allocate the storage for points
388
389 typedef DataType T;
390
391 // Solve the Vandermonde system of integrals for the weight vector
392 NekVector<T> w = m_util->GetWeights();
393
394 m_weights = Array<OneD, T>(w.GetRows(), w.GetPtr());
395}
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
Definition: Points.h:358
std::vector< double > w(NPUPPER)

References m_util, Nektar::LibUtilities::Points< NekDouble >::m_weights, Nektar::LibUtilities::Points< NekDouble >::v_CalculateWeights(), and Nektar::UnitTests::w().

◆ v_GetI() [1/2]

const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::v_GetI ( const Array< OneD, const NekDouble > &  x,
const Array< OneD, const NekDouble > &  y,
const Array< OneD, const NekDouble > &  z 
)
inlineoverrideprotected

Definition at line 70 of file NodalPrismEvenlySpaced.h.

74 {
75 size_t numpoints = x.size();
76 size_t np = GetTotNumPoints();
77
78 Array<OneD, NekDouble> interp(GetTotNumPoints() * numpoints);
79 CalculateInterpMatrix(x, y, z, interp);
80
81 NekDouble *d = interp.data();
82 return MemoryManager<NekMatrix<NekDouble>>::AllocateSharedPtr(numpoints,
83 np, d);
84 }
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xi, const Array< OneD, const NekDouble > &yi, const Array< OneD, const NekDouble > &zi, Array< OneD, NekDouble > &interp)
std::vector< double > d(NPUPPER *NPUPPER)

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

◆ v_GetI() [2/2]

const MatrixSharedPtrType Nektar::LibUtilities::NodalPrismEvenlySpaced::v_GetI ( const PointsKey pkey)
inlineoverrideprotected

Definition at line 60 of file NodalPrismEvenlySpaced.h.

61 {
62 ASSERTL0(pkey.GetPointsDim() == 3,
63 "NodalPrismEvenlySpaced Points can only interp to "
64 "other 3d point distributions");
65 Array<OneD, const NekDouble> x, y, z;
66 PointsManager()[pkey]->GetPoints(x, y, z);
67 return GetI(x, y, z);
68 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
const MatrixSharedPtrType GetI(const PointsKey &key)
Definition: Points.h:317
PointsManagerT & PointsManager(void)

References ASSERTL0, Nektar::LibUtilities::Points< NekDouble >::GetI(), Nektar::LibUtilities::PointsKey::GetPointsDim(), Nektar::LibUtilities::PointsManager(), and Nektar::UnitTests::z().

Member Data Documentation

◆ initPointsManager

bool Nektar::LibUtilities::NodalPrismEvenlySpaced::initPointsManager
staticprivate
Initial value:
= {
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...
Definition: NekManager.hpp:168
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
@ eNodalPrismEvenlySpaced
3D Evenly-spaced points on a Prism
Definition: PointsType.h:86

Definition at line 87 of file NodalPrismEvenlySpaced.h.

◆ m_util

std::shared_ptr<NodalUtilPrism> Nektar::LibUtilities::NodalPrismEvenlySpaced::m_util
private