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

virtual const MatrixSharedPtrType v_GetI (const PointsKey &pkey) override final
 
virtual const MatrixSharedPtrType v_GetI (const Array< OneD, const NekDouble > &x) override final
 
virtual const MatrixSharedPtrType v_GetI (size_t numpoints, const Array< OneD, const NekDouble > &x) override 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
 
virtual void v_CalculatePoints () override
 
virtual void v_CalculateWeights () override
 
virtual 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 44 of file BLPoints.h.

Constructor & Destructor Documentation

◆ ~BLPoints()

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

Definition at line 47 of file BLPoints.h.

48 {
49 }

◆ BLPoints() [1/3]

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

Definition at line 56 of file BLPoints.h.

56 : PointsBaseType(key)
57 {
58 namespace pl = std::placeholders;
59 m_InterpManager.RegisterCreator(
60 PointsKey(0, eGaussGaussLegendre),
61 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
62 m_InterpManager.RegisterCreator(
63 PointsKey(0, eGaussRadauMLegendre),
64 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
65 m_InterpManager.RegisterCreator(
66 PointsKey(0, eGaussRadauPLegendre),
67 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
68 m_InterpManager.RegisterCreator(
69 PointsKey(0, eGaussLobattoLegendre),
70 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
71 m_InterpManager.RegisterCreator(
72 PointsKey(0, eGaussGaussChebyshev),
73 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
74 m_InterpManager.RegisterCreator(
75 PointsKey(0, eGaussRadauMChebyshev),
76 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
77 m_InterpManager.RegisterCreator(
78 PointsKey(0, eGaussRadauPChebyshev),
79 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
80 m_InterpManager.RegisterCreator(
81 PointsKey(0, eGaussLobattoChebyshev),
82 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
83 m_InterpManager.RegisterCreator(
84 PointsKey(0, eGaussRadauMAlpha0Beta1),
85 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
86 m_InterpManager.RegisterCreator(
87 PointsKey(0, eGaussRadauMAlpha0Beta2),
88 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
89 m_InterpManager.RegisterCreator(
90 PointsKey(0, eGaussRadauMAlpha1Beta0),
91 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
92 m_InterpManager.RegisterCreator(
93 PointsKey(0, eGaussRadauMAlpha2Beta0),
94 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
95 m_InterpManager.RegisterCreator(
96 PointsKey(0, ePolyEvenlySpaced),
97 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
98 m_InterpManager.RegisterCreator(
99 PointsKey(0, eFourierEvenlySpaced),
100 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
101 m_InterpManager.RegisterCreator(
102 PointsKey(0, eBoundaryLayerPoints),
103 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
104 m_InterpManager.RegisterCreator(
105 PointsKey(0, eBoundaryLayerPointsRev),
106 std::bind(&BLPoints::CreateMatrix, this, pl::_1));
107 }
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
Definition: BLPoints.cpp:117
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:369
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 ( )
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 157 of file BLPoints.cpp.

160{
161 boost::ignore_unused(npts, xpoints, interp);
162
163 ASSERTL0(false,
164 "CalculateInterpMatrix not available for Boundary Layer Points");
165}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215

References ASSERTL0.

◆ Create()

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

Definition at line 107 of file BLPoints.cpp.

108{
109 std::shared_ptr<Points<NekDouble>> returnval(
111
112 returnval->Initialize();
113
114 return returnval;
115}
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 117 of file BLPoints.cpp.

119{
120 boost::ignore_unused(pkey);
121
122 ASSERTL0(false, "CreateMatrix not available for Boundary Layer Points");
123
124 return nullptr;
125}

References ASSERTL0.

Referenced by BLPoints().

◆ v_CalculateDerivMatrix()

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

Definition at line 101 of file BLPoints.cpp.

102{
103 //// Allocate the derivative matrix.
104 Points<NekDouble>::v_CalculateDerivMatrix();
105}

◆ v_CalculatePoints()

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

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

Definition at line 50 of file BLPoints.cpp.

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

98{
99}

◆ v_GetI() [1/3]

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

Definition at line 137 of file BLPoints.cpp.

139{
140 boost::ignore_unused(x);
141
142 ASSERTL0(false, "Interp not available for Boundary Layer Points");
143
144 return nullptr;
145}

References ASSERTL0.

◆ v_GetI() [2/3]

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

Definition at line 127 of file BLPoints.cpp.

129{
130 boost::ignore_unused(pkey);
131
132 ASSERTL0(false, "Interp not available for Boundary Layer Points");
133
134 return nullptr;
135}

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 
)
finaloverrideprotectedvirtual

Definition at line 147 of file BLPoints.cpp.

149{
150 boost::ignore_unused(numpoints, x);
151
152 ASSERTL0(false, "Interp not available for Boundary Layer Points");
153
154 return nullptr;
155}

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:107
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:169
PointsManagerT & PointsManager(void)

Definition at line 118 of file BLPoints.h.