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

 ~BLPoints () override
 
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)
 
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) final
 
const MatrixSharedPtrType v_GetI (const Array< OneD, const NekDouble > &x) final
 
const MatrixSharedPtrType v_GetI (size_t numpoints, const Array< OneD, const NekDouble > &x) final
 
- 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

 BLPoints ()=delete
 
 BLPoints (const BLPoints &points)=delete
 
void v_CalculatePoints () override
 
void v_CalculateWeights () override
 
void v_CalculateDerivMatrix () override
 
void CalculateInterpMatrix (size_t 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 42 of file BLPoints.h.

Constructor & Destructor Documentation

◆ ~BLPoints()

Nektar::LibUtilities::BLPoints::~BLPoints ( )
inlineoverride

Definition at line 45 of file BLPoints.h.

46 {
47 }

◆ BLPoints() [1/3]

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

Definition at line 54 of file BLPoints.h.

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

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 ( )
privatedelete

◆ BLPoints() [3/3]

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

Member Function Documentation

◆ CalculateInterpMatrix()

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

Definition at line 146 of file BLPoints.cpp.

150{
151 ASSERTL0(false,
152 "CalculateInterpMatrix not available for Boundary Layer Points");
153}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208

References ASSERTL0.

◆ Create()

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

Definition at line 103 of file BLPoints.cpp.

104{
105 std::shared_ptr<Points<NekDouble>> returnval(
107
108 returnval->Initialize();
109
110 return returnval;
111}
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)

Definition at line 113 of file BLPoints.cpp.

115{
116 ASSERTL0(false, "CreateMatrix not available for Boundary Layer Points");
117
118 return nullptr;
119}

References ASSERTL0.

Referenced by BLPoints().

◆ v_CalculateDerivMatrix()

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

Definition at line 97 of file BLPoints.cpp.

98{
99 //// Allocate the derivative matrix.
100 Points<NekDouble>::v_CalculateDerivMatrix();
101}

◆ v_CalculatePoints()

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

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

Definition at line 46 of file BLPoints.cpp.

47{
48 // Allocate the storage for points.
50 size_t npts = m_pointsKey.GetNumPoints();
51
52 // Derived power coefficient.
55 "Must set factor in BLPoints key");
56
57 if (fabs(r - 1.0) < 1e-6)
58 {
59 NekDouble tmp = 2.0 / (npts - 1.0);
60 for (size_t i = 0; i < npts; ++i)
61 {
62 m_points[0][i] = -1.0 + i * tmp;
63 }
64 }
65 else
66 {
67 NekDouble a = 2.0 * (1.0 - r) / (1.0 - pow(r, (double)(npts - 1)));
68 m_points[0][0] = -1.0;
69
70 for (size_t i = 1; i < npts; ++i)
71 {
72 m_points[0][i] = m_points[0][i - 1] + a * pow(r, (double)(i - 1));
73 }
74
75 m_points[0][npts - 1] = 1.0;
76 }
77
79 {
80 std::vector<NekDouble> tmp(npts);
81 for (size_t i = 0; i < npts; ++i)
82 {
83 tmp[i] = -m_points[0][npts - 1 - i];
84 }
85
86 for (size_t i = 0; i < npts; ++i)
87 {
88 m_points[0][i] = tmp[i];
89 }
90 }
91}
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
Definition: Points.h:356
PointsKey m_pointsKey
Points type for this points distributions.
Definition: Points.h:353
PointsType GetPointsType() const
Definition: Points.h:90
size_t GetNumPoints() const
Definition: Points.h:85
NekDouble GetFactor() const
Definition: Points.h:95
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 93 of file BLPoints.cpp.

94{
95}

◆ v_GetI() [1/3]

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

Definition at line 129 of file BLPoints.cpp.

131{
132 ASSERTL0(false, "Interp not available for Boundary Layer Points");
133
134 return nullptr;
135}

References ASSERTL0.

◆ v_GetI() [2/3]

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

Definition at line 121 of file BLPoints.cpp.

123{
124 ASSERTL0(false, "Interp not available for Boundary Layer Points");
125
126 return nullptr;
127}

References ASSERTL0.

◆ v_GetI() [3/3]

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

Definition at line 137 of file BLPoints.cpp.

140{
141 ASSERTL0(false, "Interp not available for Boundary Layer Points");
142
143 return nullptr;
144}

References ASSERTL0.

Member Data Documentation

◆ initPointsManager

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

Definition at line 116 of file BLPoints.h.