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

#include <BLPoints.h>

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

Public Member Functions

virtual ~BLPoints ()
 
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix (const PointsKey &pkey)
 
 BLPoints (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) override
 
virtual const MatrixSharedPtrType v_GetI (unsigned int numpoints, const Array< OneD, const NekDouble > &x) 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, const Array< OneD, const DataType > &y)
 
virtual const MatrixSharedPtrType v_GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y, const Array< OneD, const DataType > &z)
 
virtual const MatrixSharedPtrType v_GetGalerkinProjection (const PointsKey &pkey)
 

Private Member Functions

 BLPoints ()
 Default constructor should not be called except by Create method. More...
 
 BLPoints (const BLPoints &points)
 Copy constructor should not be called. More...
 
virtual void v_CalculatePoints () override
 
virtual void v_CalculateWeights () override
 
virtual void v_CalculateDerivMatrix () override
 
void CalculateInterpMatrix (unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
 

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 46 of file BLPoints.h.

Constructor & Destructor Documentation

◆ ~BLPoints()

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

Definition at line 49 of file BLPoints.h.

50  {
51  }

◆ BLPoints() [1/3]

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

Definition at line 58 of file BLPoints.h.

58  : PointsBaseType(key)
59  {
60  namespace pl = std::placeholders;
61  m_InterpManager.RegisterCreator(
62  PointsKey(0, eGaussGaussLegendre),
63  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
64  m_InterpManager.RegisterCreator(
65  PointsKey(0, eGaussRadauMLegendre),
66  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
67  m_InterpManager.RegisterCreator(
68  PointsKey(0, eGaussRadauPLegendre),
69  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
70  m_InterpManager.RegisterCreator(
71  PointsKey(0, eGaussLobattoLegendre),
72  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
73  m_InterpManager.RegisterCreator(
74  PointsKey(0, eGaussGaussChebyshev),
75  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
76  m_InterpManager.RegisterCreator(
77  PointsKey(0, eGaussRadauMChebyshev),
78  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
79  m_InterpManager.RegisterCreator(
80  PointsKey(0, eGaussRadauPChebyshev),
81  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
82  m_InterpManager.RegisterCreator(
83  PointsKey(0, eGaussLobattoChebyshev),
84  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
85  m_InterpManager.RegisterCreator(
86  PointsKey(0, eGaussRadauMAlpha0Beta1),
87  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
88  m_InterpManager.RegisterCreator(
89  PointsKey(0, eGaussRadauMAlpha0Beta2),
90  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
91  m_InterpManager.RegisterCreator(
92  PointsKey(0, eGaussRadauMAlpha1Beta0),
93  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
94  m_InterpManager.RegisterCreator(
95  PointsKey(0, eGaussRadauMAlpha2Beta0),
96  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
97  m_InterpManager.RegisterCreator(
98  PointsKey(0, ePolyEvenlySpaced),
99  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
100  m_InterpManager.RegisterCreator(
101  PointsKey(0, eFourierEvenlySpaced),
102  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
103  m_InterpManager.RegisterCreator(
104  PointsKey(0, eBoundaryLayerPoints),
105  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
106  m_InterpManager.RegisterCreator(
107  PointsKey(0, eBoundaryLayerPointsRev),
108  std::bind(&BLPoints::CreateMatrix, this, pl::_1));
109  }
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
Definition: BLPoints.cpp:119
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:383
Points< NekDouble > PointsBaseType
@ eGaussRadauMLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:49
@ eBoundaryLayerPoints
1D power law distribution for boundary layer points
Definition: PointsType.h:79
@ eGaussRadauMAlpha0Beta1
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:60
@ eGaussLobattoChebyshev
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:59
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:76
@ eGaussRadauPChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=1
Definition: PointsType.h:57
@ eGaussRadauMChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=-1
Definition: PointsType.h:55
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:53
@ eGaussGaussChebyshev
1D Gauss-Gauss-Chebyshev quadrature points
Definition: PointsType.h:54
@ eBoundaryLayerPointsRev
1D power law distribution for boundary layer points
Definition: PointsType.h:81
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:75
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
@ eGaussRadauPLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:51

References CreateMatrix(), Nektar::LibUtilities::eBoundaryLayerPoints, Nektar::LibUtilities::eBoundaryLayerPointsRev, Nektar::LibUtilities::eFourierEvenlySpaced, Nektar::LibUtilities::eGaussGaussChebyshev, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussLobattoChebyshev, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha0Beta1, Nektar::LibUtilities::eGaussRadauMChebyshev, Nektar::LibUtilities::eGaussRadauMLegendre, Nektar::LibUtilities::eGaussRadauPChebyshev, Nektar::LibUtilities::eGaussRadauPLegendre, Nektar::LibUtilities::ePolyEvenlySpaced, and Nektar::LibUtilities::Points< NekDouble >::m_InterpManager.

◆ BLPoints() [2/3]

Nektar::LibUtilities::BLPoints::BLPoints ( )
private

Default constructor should not be called except by Create method.

◆ BLPoints() [3/3]

Nektar::LibUtilities::BLPoints::BLPoints ( const BLPoints points)
private

Copy constructor should not be called.

Member Function Documentation

◆ CalculateInterpMatrix()

void Nektar::LibUtilities::BLPoints::CalculateInterpMatrix ( unsigned int  npts,
const Array< OneD, const NekDouble > &  xpoints,
Array< OneD, NekDouble > &  interp 
)
private

Definition at line 165 of file BLPoints.cpp.

168 {
169  boost::ignore_unused(npts, xpoints, interp);
170 }

Referenced by v_GetI().

◆ Create()

std::shared_ptr< Points< NekDouble > > Nektar::LibUtilities::BLPoints::Create ( const PointsKey key)
static

Definition at line 109 of file BLPoints.cpp.

110 {
111  std::shared_ptr<Points<NekDouble>> returnval(
113 
114  returnval->Initialize();
115 
116  return returnval;
117 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ CreateMatrix()

std::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::CreateMatrix ( const PointsKey pkey)

Delegate to function below.

Definition at line 119 of file BLPoints.cpp.

121 {
122  int numpoints = pkey.GetNumPoints();
123  Array<OneD, const NekDouble> xpoints;
124 
125  PointsManager()[pkey]->GetPoints(xpoints);
126 
127  /// Delegate to function below.
128  return GetI(numpoints, xpoints);
129 }
const MatrixSharedPtrType GetI(const PointsKey &key)
Definition: Points.h:336
PointsManagerT & PointsManager(void)

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

Referenced by BLPoints().

◆ v_CalculateDerivMatrix()

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

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

Definition at line 103 of file BLPoints.cpp.

104 {
105  //// Allocate the derivative matrix.
107 }
virtual void v_CalculateDerivMatrix()
Definition: Points.h:445

References Nektar::LibUtilities::Points< DataT >::v_CalculateDerivMatrix().

◆ v_CalculatePoints()

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

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

Definition at line 52 of file BLPoints.cpp.

53 {
54  // Allocate the storage for points.
56  unsigned int npts = m_pointsKey.GetNumPoints();
57 
58  // Derived power coefficient.
61  "Must set factor in BLPoints key");
62 
63  if (fabs(r - 1.0) < 1e-6)
64  {
65  NekDouble tmp = 2.0 / (npts - 1.0);
66  for (unsigned int i = 0; i < npts; ++i)
67  {
68  m_points[0][i] = -1.0 + i * tmp;
69  }
70  }
71  else
72  {
73  NekDouble a = 2.0 * (1.0 - r) / (1.0 - pow(r, (double)(npts - 1)));
74  m_points[0][0] = -1.0;
75 
76  for (unsigned int i = 1; i < npts; ++i)
77  {
78  m_points[0][i] = m_points[0][i - 1] + a * pow(r, (double)(i - 1));
79  }
80 
81  m_points[0][npts - 1] = 1.0;
82  }
83 
85  {
86  std::vector<NekDouble> tmp(npts);
87  for (unsigned int i = 0; i < npts; ++i)
88  {
89  tmp[i] = -m_points[0][npts - 1 - i];
90  }
91 
92  for (unsigned int i = 0; i < npts; ++i)
93  {
94  m_points[0][i] = tmp[i];
95  }
96  }
97 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
Definition: Points.h:375
PointsKey m_pointsKey
Points type for this points distributions.
Definition: Points.h:372
PointsType GetPointsType() const
Definition: Points.h:109
NekDouble GetFactor() const
Definition: Points.h:114
unsigned int GetNumPoints() const
Definition: Points.h:104
static const NekDouble kNekUnsetDouble
double NekDouble

References ASSERTL0, Nektar::LibUtilities::eBoundaryLayerPointsRev, Nektar::LibUtilities::PointsKey::GetFactor(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::LibUtilities::PointsKey::GetPointsType(), Nektar::NekConstants::kNekUnsetDouble, Nektar::LibUtilities::Points< NekDouble >::m_points, Nektar::LibUtilities::Points< NekDouble >::m_pointsKey, and Nektar::LibUtilities::Points< NekDouble >::v_CalculatePoints().

◆ v_CalculateWeights()

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

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

Definition at line 99 of file BLPoints.cpp.

100 {
101 }

◆ v_GetI() [1/3]

const std::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::v_GetI ( const Array< OneD, const NekDouble > &  x)
overrideprotectedvirtual

Delegate to function below.

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

Definition at line 140 of file BLPoints.cpp.

142 {
143  int numpoints = 1;
144 
145  /// Delegate to function below.
146  return GetI(numpoints, x);
147 }

References Nektar::LibUtilities::Points< NekDouble >::GetI().

◆ v_GetI() [2/3]

const std::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::v_GetI ( const PointsKey pkey)
overrideprotectedvirtual

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

Definition at line 131 of file BLPoints.cpp.

133 {
134  ASSERTL0(pkey.GetPointsDim() == 1,
135  "Fourier Points can only interp to other 1d point distributions");
136 
137  return m_InterpManager[pkey];
138 }

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

◆ v_GetI() [3/3]

const std::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::v_GetI ( unsigned int  numpoints,
const Array< OneD, const NekDouble > &  x 
)
overrideprotectedvirtual

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

Definition at line 149 of file BLPoints.cpp.

151 {
152  Array<OneD, NekDouble> interp(GetNumPoints() * numpoints);
153 
154  CalculateInterpMatrix(numpoints, x, interp);
155 
156  NekDouble *t = interp.data();
157  unsigned int np = GetNumPoints();
158  std::shared_ptr<NekMatrix<NekDouble>> returnval(
159  MemoryManager<NekMatrix<NekDouble>>::AllocateSharedPtr(numpoints, np,
160  t));
161 
162  return returnval;
163 }
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
Definition: BLPoints.cpp:165
unsigned int GetNumPoints() const
Definition: Points.h:273

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

Member Data Documentation

◆ initPointsManager

bool Nektar::LibUtilities::BLPoints::initPointsManager
staticprivate
Initial value:
= {
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
Definition: BLPoints.cpp:109
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

Definition at line 120 of file BLPoints.h.