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::NodalTetElec Class Reference

#include <NodalTetElec.h>

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

Public Member Functions

virtual ~NodalTetElec ()
 
 NodalTetElec (const PointsKey &key)
 
- Public Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual ~Points ()
 
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
 
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 (unsigned int 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

virtual const MatrixSharedPtrType v_GetI (const PointsKey &pkey) override
 
virtual 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_CalculateBaryWeights ()
 This function calculates the barycentric weights used for enhanced interpolation speed. More...
 
 Points (const PointsKey &key)
 
virtual const MatrixSharedPtrType v_GetI (const Array< OneD, const DataType > &x)
 
virtual const MatrixSharedPtrType v_GetI (unsigned int, const Array< OneD, const DataType > &x)
 
virtual const MatrixSharedPtrType v_GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y)
 
virtual const MatrixSharedPtrType v_GetGalerkinProjection (const PointsKey &pkey)
 

Private Member Functions

 NodalTetElec ()
 
void NodalPointReorder3d ()
 
virtual void v_CalculatePoints () override
 
virtual void v_CalculateWeights () override
 
virtual void v_CalculateDerivMatrix () override
 
void CalculateInterpMatrix (const Array< OneD, const NekDouble > &xia, const Array< OneD, const NekDouble > &yia, const Array< OneD, const NekDouble > &zia, Array< OneD, NekDouble > &interp)
 

Private Attributes

std::shared_ptr< NodalUtilTetrahedronm_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 51 of file NodalTetElec.h.

Constructor & Destructor Documentation

◆ ~NodalTetElec()

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

Definition at line 54 of file NodalTetElec.h.

55  {
56  }

◆ NodalTetElec() [1/2]

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

Definition at line 61 of file NodalTetElec.h.

61  : PointsBaseType(key)
62  {
63  }
Points< NekDouble > PointsBaseType

◆ NodalTetElec() [2/2]

Nektar::LibUtilities::NodalTetElec::NodalTetElec ( )
inlineprivate

Definition at line 97 of file NodalTetElec.h.

98  {
99  }
static const PointsKey NullPointsKey(0, eNoPointsType)

Member Function Documentation

◆ CalculateInterpMatrix()

void Nektar::LibUtilities::NodalTetElec::CalculateInterpMatrix ( const Array< OneD, const NekDouble > &  xia,
const Array< OneD, const NekDouble > &  yia,
const Array< OneD, const NekDouble > &  zia,
Array< OneD, NekDouble > &  interp 
)
private

Definition at line 211 of file NodalTetElec.cpp.

216 {
217  Array<OneD, Array<OneD, NekDouble>> xi(3);
218  xi[0] = xia;
219  xi[1] = yia;
220  xi[2] = zia;
221 
222  std::shared_ptr<NekMatrix<NekDouble>> mat =
223  m_util->GetInterpolationMatrix(xi);
224  Vmath::Vcopy(mat->GetRows() * mat->GetColumns(), mat->GetRawPtr(), 1,
225  &interp[0], 1);
226 }
std::shared_ptr< NodalUtilTetrahedron > m_util
Definition: NodalTetElec.h:95
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255

References m_util, and Vmath::Vcopy().

Referenced by v_GetI().

◆ Create()

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

Definition at line 238 of file NodalTetElec.cpp.

239 {
240  std::shared_ptr<PointsBaseType> returnval(
242  returnval->Initialize();
243  return returnval;
244 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ NodalPointReorder3d()

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

Definition at line 246 of file NodalTetElec.cpp.

247 {
248  int cnt;
249  int istart, iend;
250 
251  const int nVerts = 4;
252  const int nEdgeInteriorPoints = GetNumPoints() - 2;
253  const int nFaceInteriorPoints =
254  (GetNumPoints() - 3) * (GetNumPoints() - 2) / 2;
255  // const int nBoundaryPoints = 4 + 6*nEdgeInteriorPoints +
256  // 4*nFaceInteriorPoints;
257  const int nAllPoints =
258  GetNumPoints() * (GetNumPoints() + 1) * (GetNumPoints() + 2) / 6;
259  if (nEdgeInteriorPoints == 0)
260  {
261  return;
262  }
263 
264  // group all edge 1 points
265  istart = nVerts;
266  for (int i = cnt = istart; i < nAllPoints; i++)
267  {
268  if (fabs(m_points[1][i] + 1.0) < NekConstants::kNekZeroTol &&
269  fabs(m_points[2][i] + 1.0) < NekConstants::kNekZeroTol)
270  {
271  std::swap(m_points[0][cnt], m_points[0][i]);
272  std::swap(m_points[1][cnt], m_points[1][i]);
273  std::swap(m_points[2][cnt], m_points[2][i]);
274  cnt++;
275  }
276  }
277 
278  // bubble sort edge 1 (counterclockwise numbering)
279  iend = istart + nEdgeInteriorPoints;
280  for (int i = istart; i < iend; i++)
281  {
282  for (int j = istart + 1; j < iend; j++)
283  {
284  if (m_points[0][j] < m_points[0][j - 1])
285  {
286  std::swap(m_points[0][j], m_points[0][j - 1]);
287  std::swap(m_points[1][j], m_points[1][j - 1]);
288  std::swap(m_points[2][j], m_points[2][j - 1]);
289  }
290  }
291  }
292 
293  // group the points of edge 2 together;
294  istart = iend;
295  for (int i = cnt = istart; i < nAllPoints; i++)
296  {
297  if (fabs(m_points[1][i] + m_points[0][i]) < NekConstants::kNekZeroTol &&
298  fabs(m_points[2][i] + 1.0) < NekConstants::kNekZeroTol)
299  {
300  std::swap(m_points[0][cnt], m_points[0][i]);
301  std::swap(m_points[1][cnt], m_points[1][i]);
302  std::swap(m_points[2][cnt], m_points[2][i]);
303  cnt++;
304  }
305  }
306 
307  // bubble sort edge 2 (counterclockwise numbering)
308  iend = istart + nEdgeInteriorPoints;
309  for (int i = istart; i < iend; i++)
310  {
311  for (int j = istart + 1; j < iend; j++)
312  {
313  if (m_points[1][j] < m_points[1][j - 1])
314  {
315  std::swap(m_points[0][j], m_points[0][j - 1]);
316  std::swap(m_points[1][j], m_points[1][j - 1]);
317  std::swap(m_points[2][j], m_points[2][j - 1]);
318  }
319  }
320  }
321 
322  // group the points of edge 3 together;
323  istart = iend;
324  for (int i = cnt = istart; i < nAllPoints; i++)
325  {
326  if (fabs(m_points[0][i] + 1.0) < NekConstants::kNekZeroTol &&
327  fabs(m_points[2][i] + 1.0) < NekConstants::kNekZeroTol)
328  {
329  std::swap(m_points[0][cnt], m_points[0][i]);
330  std::swap(m_points[1][cnt], m_points[1][i]);
331  std::swap(m_points[2][cnt], m_points[2][i]);
332  cnt++;
333  }
334  }
335 
336  // bubble sort edge 3 (counterclockwise numbering)
337  iend = istart + nEdgeInteriorPoints;
338  for (int i = istart; i < iend; i++)
339  {
340  for (int j = istart + 1; j < iend; j++)
341  {
342  if (m_points[1][j] > m_points[1][j - 1])
343  {
344  std::swap(m_points[0][j], m_points[0][j - 1]);
345  std::swap(m_points[1][j], m_points[1][j - 1]);
346  std::swap(m_points[2][j], m_points[2][j - 1]);
347  }
348  }
349  }
350 
351  // group the points of edge 4 together;
352  istart = iend;
353  for (int i = cnt = istart; i < nAllPoints; i++)
354  {
355  if (fabs(m_points[0][i] + 1.0) < NekConstants::kNekZeroTol &&
356  fabs(m_points[1][i] + 1.0) < NekConstants::kNekZeroTol)
357  {
358  std::swap(m_points[0][cnt], m_points[0][i]);
359  std::swap(m_points[1][cnt], m_points[1][i]);
360  std::swap(m_points[2][cnt], m_points[2][i]);
361  cnt++;
362  }
363  }
364 
365  // bubble sort edge 3 (counterclockwise numbering)
366  iend = istart + nEdgeInteriorPoints;
367  for (int i = istart; i < iend; i++)
368  {
369  for (int j = istart + 1; j < iend; j++)
370  {
371  if (m_points[2][j] < m_points[2][j - 1])
372  {
373  std::swap(m_points[0][j], m_points[0][j - 1]);
374  std::swap(m_points[1][j], m_points[1][j - 1]);
375  std::swap(m_points[2][j], m_points[2][j - 1]);
376  }
377  }
378  }
379 
380  // group the points of edge 5 together;
381  istart = iend;
382  for (int i = cnt = istart; i < nAllPoints; i++)
383  {
384  if (fabs(m_points[0][i] + m_points[2][i]) < NekConstants::kNekZeroTol &&
385  fabs(m_points[1][i] + 1.0) < NekConstants::kNekZeroTol)
386  {
387  std::swap(m_points[0][cnt], m_points[0][i]);
388  std::swap(m_points[1][cnt], m_points[1][i]);
389  std::swap(m_points[2][cnt], m_points[2][i]);
390  cnt++;
391  }
392  }
393 
394  // bubble sort edge 5 (counterclockwise numbering)
395  iend = istart + nEdgeInteriorPoints;
396  for (int i = istart; i < iend; i++)
397  {
398  for (int j = istart + 1; j < iend; j++)
399  {
400  if (m_points[2][j] < m_points[2][j - 1])
401  {
402  std::swap(m_points[0][j], m_points[0][j - 1]);
403  std::swap(m_points[1][j], m_points[1][j - 1]);
404  std::swap(m_points[2][j], m_points[2][j - 1]);
405  }
406  }
407  }
408 
409  // group the points of edge 6 together;
410  istart = iend;
411  for (int i = cnt = istart; i < nAllPoints; i++)
412  {
413  if (fabs(m_points[1][i] + m_points[2][i]) < NekConstants::kNekZeroTol &&
414  fabs(m_points[0][i] + 1.0) < NekConstants::kNekZeroTol)
415  {
416  std::swap(m_points[0][cnt], m_points[0][i]);
417  std::swap(m_points[1][cnt], m_points[1][i]);
418  std::swap(m_points[2][cnt], m_points[2][i]);
419  cnt++;
420  }
421  }
422 
423  // bubble sort edge 6 (counterclockwise numbering)
424  iend = istart + nEdgeInteriorPoints;
425  for (int i = istart; i < iend; i++)
426  {
427  for (int j = istart + 1; j < iend; j++)
428  {
429  if (m_points[2][j] < m_points[2][j - 1])
430  {
431  std::swap(m_points[0][j], m_points[0][j - 1]);
432  std::swap(m_points[1][j], m_points[1][j - 1]);
433  std::swap(m_points[2][j], m_points[2][j - 1]);
434  }
435  }
436  }
437 
438  if (GetNumPoints() < 4)
439  {
440  // no face points
441  return;
442  }
443 
444  // group the points of face 1 together;
445  istart = iend;
446  for (int i = cnt = istart; i < nAllPoints; i++)
447  {
448  if (fabs(m_points[2][i] + 1.0) < NekConstants::kNekZeroTol)
449  {
450  std::swap(m_points[0][cnt], m_points[0][i]);
451  std::swap(m_points[1][cnt], m_points[1][i]);
452  std::swap(m_points[2][cnt], m_points[2][i]);
453  cnt++;
454  }
455  }
456 
457  // bubble sort face1 (tensor numbering)
458  iend = istart + nFaceInteriorPoints;
459  bool repeat = true;
460  while (repeat)
461  {
462  repeat = false;
463  for (int i = istart; i < iend - 1; i++)
464  {
465  if (m_points[1][i] > m_points[1][i + 1])
466  {
467  std::swap(m_points[0][i + 1], m_points[0][i]);
468  std::swap(m_points[1][i + 1], m_points[1][i]);
469  std::swap(m_points[2][i + 1], m_points[2][i]);
470  repeat = true;
471  }
472  }
473  }
474  int offset = 0;
475  int npl = GetNumPoints() - 3;
476  while (npl > 1)
477  {
478  repeat = true;
479  while (repeat)
480  {
481  repeat = false;
482  for (int i = offset + istart; i < offset + istart + npl - 1; i++)
483  {
484  if (m_points[0][i] > m_points[0][i + 1])
485  {
486  std::swap(m_points[0][i + 1], m_points[0][i]);
487  std::swap(m_points[1][i + 1], m_points[1][i]);
488  std::swap(m_points[2][i + 1], m_points[2][i]);
489  repeat = true;
490  }
491  }
492  }
493  offset += npl;
494  npl--;
495  }
496 
497  // group the points of face 2 together;
498  istart = iend;
499  for (int i = cnt = istart; i < nAllPoints; i++)
500  {
501  if (fabs(m_points[1][i] + 1.0) < NekConstants::kNekZeroTol)
502  {
503  std::swap(m_points[0][cnt], m_points[0][i]);
504  std::swap(m_points[1][cnt], m_points[1][i]);
505  std::swap(m_points[2][cnt], m_points[2][i]);
506  cnt++;
507  }
508  }
509 
510  // bubble sort face2 (tensor numbering)
511  iend = istart + nFaceInteriorPoints;
512  repeat = true;
513  while (repeat)
514  {
515  repeat = false;
516  for (int i = istart; i < iend - 1; i++)
517  {
518  if (m_points[2][i] > m_points[2][i + 1])
519  {
520  std::swap(m_points[0][i + 1], m_points[0][i]);
521  std::swap(m_points[1][i + 1], m_points[1][i]);
522  std::swap(m_points[2][i + 1], m_points[2][i]);
523  repeat = true;
524  }
525  }
526  }
527  offset = 0;
528  npl = GetNumPoints() - 3;
529  while (npl > 1)
530  {
531  repeat = true;
532  while (repeat)
533  {
534  repeat = false;
535  for (int i = offset + istart; i < offset + istart + npl - 1; i++)
536  {
537  if (m_points[0][i] > m_points[0][i + 1])
538  {
539  std::swap(m_points[0][i + 1], m_points[0][i]);
540  std::swap(m_points[1][i + 1], m_points[1][i]);
541  std::swap(m_points[2][i + 1], m_points[2][i]);
542  repeat = true;
543  }
544  }
545  }
546  offset += npl;
547  npl--;
548  }
549 
550  // group the points of face 3 together;
551  istart = iend;
552  for (int i = cnt = istart; i < nAllPoints; i++)
553  {
554  if (fabs(m_points[1][i] + m_points[0][i] + m_points[2][i] + 1.0) <
555  1E-9) // nek zero tol too small
556  {
557  std::swap(m_points[0][cnt], m_points[0][i]);
558  std::swap(m_points[1][cnt], m_points[1][i]);
559  std::swap(m_points[2][cnt], m_points[2][i]);
560  cnt++;
561  }
562  }
563 
564  // bubble sort face3 (tensor numbering)
565  iend = istart + nFaceInteriorPoints;
566  repeat = true;
567  while (repeat)
568  {
569  repeat = false;
570  for (int i = istart; i < iend - 1; i++)
571  {
572  if (m_points[2][i] > m_points[2][i + 1])
573  {
574  std::swap(m_points[0][i + 1], m_points[0][i]);
575  std::swap(m_points[1][i + 1], m_points[1][i]);
576  std::swap(m_points[2][i + 1], m_points[2][i]);
577  repeat = true;
578  }
579  }
580  }
581  offset = 0;
582  npl = GetNumPoints() - 3;
583  while (npl > 1)
584  {
585  repeat = true;
586  while (repeat)
587  {
588  repeat = false;
589  for (int i = offset + istart; i < offset + istart + npl - 1; i++)
590  {
591  if (m_points[1][i] > m_points[1][i + 1])
592  {
593  std::swap(m_points[0][i + 1], m_points[0][i]);
594  std::swap(m_points[1][i + 1], m_points[1][i]);
595  std::swap(m_points[2][i + 1], m_points[2][i]);
596  repeat = true;
597  }
598  }
599  }
600  offset += npl;
601  npl--;
602  }
603 
604  // group the points of face 4 together;
605  istart = iend;
606  for (int i = cnt = istart; i < nAllPoints; i++)
607  {
608  if (fabs(m_points[0][i] + 1.0) < NekConstants::kNekZeroTol)
609  {
610  std::swap(m_points[0][cnt], m_points[0][i]);
611  std::swap(m_points[1][cnt], m_points[1][i]);
612  std::swap(m_points[2][cnt], m_points[2][i]);
613  cnt++;
614  }
615  }
616 
617  // bubble sort face4 (tensor numbering)
618  iend = istart + nFaceInteriorPoints;
619  repeat = true;
620  while (repeat)
621  {
622  repeat = false;
623  for (int i = istart; i < iend - 1; i++)
624  {
625  if (m_points[2][i] > m_points[2][i + 1])
626  {
627  std::swap(m_points[0][i + 1], m_points[0][i]);
628  std::swap(m_points[1][i + 1], m_points[1][i]);
629  std::swap(m_points[2][i + 1], m_points[2][i]);
630  repeat = true;
631  }
632  }
633  }
634  offset = 0;
635  npl = GetNumPoints() - 3;
636  while (npl > 1)
637  {
638  repeat = true;
639  while (repeat)
640  {
641  repeat = false;
642  for (int i = offset + istart; i < offset + istart + npl - 1; i++)
643  {
644  if (m_points[1][i] > m_points[1][i + 1])
645  {
646  std::swap(m_points[0][i + 1], m_points[0][i]);
647  std::swap(m_points[1][i + 1], m_points[1][i]);
648  std::swap(m_points[2][i + 1], m_points[2][i]);
649  repeat = true;
650  }
651  }
652  }
653  offset += npl;
654  npl--;
655  }
656 }
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
Definition: Points.h:375
unsigned int GetNumPoints() const
Definition: Points.h:273
static const NekDouble kNekZeroTol

References Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::NekConstants::kNekZeroTol, and Nektar::LibUtilities::Points< NekDouble >::m_points.

Referenced by v_CalculatePoints().

◆ v_CalculateDerivMatrix()

void Nektar::LibUtilities::NodalTetElec::v_CalculateDerivMatrix ( )
overrideprivatevirtual

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

Definition at line 228 of file NodalTetElec.cpp.

229 {
230  // Allocate the derivative matrix.
232 
233  m_derivmatrix[0] = m_util->GetDerivMatrix(0);
234  m_derivmatrix[1] = m_util->GetDerivMatrix(1);
235  m_derivmatrix[2] = m_util->GetDerivMatrix(2);
236 }
MatrixSharedPtrType m_derivmatrix[3]
Derivative matrices.
Definition: Points.h:381

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

◆ v_CalculatePoints()

void Nektar::LibUtilities::NodalTetElec::v_CalculatePoints ( )
overrideprivatevirtual

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

Definition at line 52 of file NodalTetElec.cpp.

53 {
54  // Allocate the storage for points
56 
57  int index = 0, isum = 0;
58  const int offset = 5; // offset to match Datafile
59  NekDouble b, c, d;
60  unsigned int numPoints = GetNumPoints();
61 
62  // initialize values
63  for (unsigned int i = 0; i < numPoints - 2; ++i)
64  {
65  index += NodalTetElecNPTS[i];
66  }
67 
68  for (unsigned int i = 0; i < NodalTetElecNPTS[numPoints - 2]; ++i, ++index)
69  {
70  // 1 Point Symmetry: aaaa
71  if (int(NodalTetElecData[index][0]))
72  {
73  b = NodalTetElecData[index][6];
74  c = NodalTetElecData[index][7];
75  d = NodalTetElecData[index][8];
76 
77  m_points[0][isum] = 2.0 * b - 1.0;
78  m_points[1][isum] = 2.0 * c - 1.0;
79  m_points[2][isum] = 2.0 * d - 1.0;
80  isum++;
81  continue;
82  } // end symmetry 1
83 
84  // 4 Point symmetry: aaab or abbb
85  if (int(NodalTetElecData[index][1]))
86  {
87  for (unsigned int j = 0; j < 4; ++j)
88  {
89  b = NodalTetElecData[index][offset + perm4_3d[j][1]];
90  c = NodalTetElecData[index][offset + perm4_3d[j][2]];
91  d = NodalTetElecData[index][offset + perm4_3d[j][3]];
92 
93  m_points[0][isum] = 2.0 * b - 1.0;
94  m_points[1][isum] = 2.0 * c - 1.0;
95  m_points[2][isum] = 2.0 * d - 1.0;
96  isum++;
97  } // end j
98  continue;
99  } // end symmetry 4
100 
101  // 6 Point symmetry: aabb
102  if (int(NodalTetElecData[index][2]))
103  {
104  for (unsigned int j = 0; j < 6; ++j)
105  {
106  b = NodalTetElecData[index][offset + perm6_3d[j][1]];
107  c = NodalTetElecData[index][offset + perm6_3d[j][2]];
108  d = NodalTetElecData[index][offset + perm6_3d[j][3]];
109 
110  m_points[0][isum] = 2.0 * b - 1.0;
111  m_points[1][isum] = 2.0 * c - 1.0;
112  m_points[2][isum] = 2.0 * d - 1.0;
113  isum++;
114  } // end j
115  continue;
116  } // end symmetry6
117 
118  // 12 Point symmetry: case aabc
119  if (int(NodalTetElecData[index][3]) == 1)
120  {
121  for (unsigned int j = 0; j < 12; ++j)
122  {
123  b = NodalTetElecData[index][offset + perm12A_3d[j][1]];
124  c = NodalTetElecData[index][offset + perm12A_3d[j][2]];
125  d = NodalTetElecData[index][offset + perm12A_3d[j][3]];
126 
127  m_points[0][isum] = 2.0 * b - 1.0;
128  m_points[1][isum] = 2.0 * c - 1.0;
129  m_points[2][isum] = 2.0 * d - 1.0;
130  isum++;
131  } // end j
132  continue;
133  } // end symmetry 12 aabc
134 
135  // 12 Point symmetry: case abcc
136  if (int(NodalTetElecData[index][3]) == 2)
137  {
138  for (unsigned int j = 0; j < 12; ++j)
139  {
140  b = NodalTetElecData[index][offset + perm12B_3d[j][1]];
141  c = NodalTetElecData[index][offset + perm12B_3d[j][2]];
142  d = NodalTetElecData[index][offset + perm12B_3d[j][3]];
143 
144  m_points[0][isum] = 2.0 * b - 1.0;
145  m_points[1][isum] = 2.0 * c - 1.0;
146  m_points[2][isum] = 2.0 * d - 1.0;
147  isum++;
148  } // end j
149  continue;
150  } // end symmetry 12 abcc
151 
152  // 12 Point symmetry: case abbc
153  if (int(NodalTetElecData[index][3]) == 3)
154  {
155  for (unsigned int j = 0; j < 12; ++j)
156  {
157  b = NodalTetElecData[index][offset + perm12C_3d[j][1]];
158  c = NodalTetElecData[index][offset + perm12C_3d[j][2]];
159  d = NodalTetElecData[index][offset + perm12C_3d[j][3]];
160 
161  m_points[0][isum] = 2.0 * b - 1.0;
162  m_points[1][isum] = 2.0 * c - 1.0;
163  m_points[2][isum] = 2.0 * d - 1.0;
164  isum++;
165  } // end j
166  continue;
167  } // end symmetry 12 abbc
168 
169  // 24 Point symmetry: case abcd
170  if (int(NodalTetElecData[index][4]))
171  {
172  for (unsigned int j = 0; j < 24; ++j)
173  {
174  b = NodalTetElecData[index][offset + perm24_3d[j][1]];
175  c = NodalTetElecData[index][offset + perm24_3d[j][2]];
176  d = NodalTetElecData[index][offset + perm24_3d[j][3]];
177 
178  m_points[0][isum] = 2.0 * b - 1.0;
179  m_points[1][isum] = 2.0 * c - 1.0;
180  m_points[2][isum] = 2.0 * d - 1.0;
181  isum++;
182  } // end j
183  continue;
184  } // end symmetry24abcd
185 
186  } // end npts
187 
189 
190  ASSERTL1((static_cast<unsigned int>(isum) == m_pointsKey.GetTotNumPoints()),
191  "sum not equal to npts");
192 
194  numPoints - 1, m_points[0], m_points[1], m_points[2]);
195 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
virtual void v_CalculatePoints()
Definition: Points.h:395
PointsKey m_pointsKey
Points type for this points distributions.
Definition: Points.h:372
unsigned int GetTotNumPoints() const
Definition: Points.h:177
static const unsigned int perm6_3d[6][4]
static const unsigned int perm12B_3d[12][4]
static const unsigned int perm12C_3d[12][4]
static const unsigned int perm12A_3d[12][4]
static const unsigned int NodalTetElecNPTS[NodalTetElecAvailable]
static const NekDouble NodalTetElecData[][9]
static const unsigned int perm24_3d[24][4]
static const unsigned int perm4_3d[4][4]
double NekDouble

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, Nektar::LibUtilities::Points< NekDouble >::GetNumPoints(), Nektar::LibUtilities::PointsKey::GetTotNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, Nektar::LibUtilities::Points< NekDouble >::m_pointsKey, m_util, NodalPointReorder3d(), Nektar::LibUtilities::NodalTetElecData, Nektar::LibUtilities::NodalTetElecNPTS, Nektar::LibUtilities::perm12A_3d, Nektar::LibUtilities::perm12B_3d, Nektar::LibUtilities::perm12C_3d, Nektar::LibUtilities::perm24_3d, Nektar::LibUtilities::perm4_3d, Nektar::LibUtilities::perm6_3d, and Nektar::LibUtilities::Points< DataT >::v_CalculatePoints().

◆ v_CalculateWeights()

void Nektar::LibUtilities::NodalTetElec::v_CalculateWeights ( )
overrideprivatevirtual

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

Definition at line 197 of file NodalTetElec.cpp.

198 {
199  // Allocate the storage for points
201 
202  typedef DataType T;
203 
204  // Solve the Vandermonde system of integrals for the weight vector
205  NekVector<T> w = m_util->GetWeights();
206  m_weights = Array<OneD, T>(w.GetRows(), w.GetPtr());
207 }
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
Definition: Points.h:377

References Nektar::NekVector< DataType >::GetPtr(), Nektar::NekVector< DataType >::GetRows(), m_util, Nektar::LibUtilities::Points< NekDouble >::m_weights, and Nektar::LibUtilities::Points< NekDouble >::v_CalculateWeights().

◆ v_GetI() [1/2]

virtual const MatrixSharedPtrType Nektar::LibUtilities::NodalTetElec::v_GetI ( const Array< OneD, const NekDouble > &  x,
const Array< OneD, const NekDouble > &  y,
const Array< OneD, const NekDouble > &  z 
)
inlineoverrideprotectedvirtual

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

Definition at line 76 of file NodalTetElec.h.

80  {
81  size_t numpoints = x.size();
82  unsigned int np = GetTotNumPoints();
83 
84  Array<OneD, NekDouble> interp(np * numpoints);
85  CalculateInterpMatrix(x, y, z, interp);
86 
87  NekDouble *d = interp.data();
88  return MemoryManager<NekMatrix<NekDouble>>::AllocateSharedPtr(numpoints,
89  np, d);
90  }
void CalculateInterpMatrix(const Array< OneD, const NekDouble > &xia, const Array< OneD, const NekDouble > &yia, const Array< OneD, const NekDouble > &zia, Array< OneD, NekDouble > &interp)
unsigned int GetTotNumPoints() const
Definition: Points.h:278

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

◆ v_GetI() [2/2]

virtual const MatrixSharedPtrType Nektar::LibUtilities::NodalTetElec::v_GetI ( const PointsKey pkey)
inlineoverrideprotectedvirtual

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

Definition at line 66 of file NodalTetElec.h.

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

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

Member Data Documentation

◆ initPointsManager

bool Nektar::LibUtilities::NodalTetElec::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:170
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
@ eNodalTetElec
3D Nodal Electrostatic Points on a Tetrahedron
Definition: PointsType.h:87

Definition at line 93 of file NodalTetElec.h.

◆ m_util

std::shared_ptr<NodalUtilTetrahedron> Nektar::LibUtilities::NodalTetElec::m_util
private