Nektar++
Public Member Functions | Static Public 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)
 
const MatrixSharedPtrType GetI (const PointsKey &pkey)
 
const MatrixSharedPtrType GetI (const Array< OneD, const NekDouble > &x)
 
const MatrixSharedPtrType GetI (unsigned int numpoints, const Array< OneD, const NekDouble > &x)
 
 BLPoints (const PointsKey &key)
 
- Public Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
virtual ~Points ()
 
virtual 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
 
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
 
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y)
 
virtual const MatrixSharedPtrType GetI (const Array< OneD, const DataType > &x, const Array< OneD, const DataType > &y, const Array< OneD, const DataType > &z)
 
virtual const MatrixSharedPtrType GetGalerkinProjection (const PointsKey &pkey)
 

Static Public Member Functions

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

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...
 
void CalculatePoints ()
 
void CalculateWeights ()
 
void CalculateDerivMatrix ()
 
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 Member Functions inherited from Nektar::LibUtilities::Points< NekDouble >
 Points (const PointsKey &key)
 
- Protected Attributes inherited from Nektar::LibUtilities::Points< NekDouble >
PointsKey m_pointsKey
 
Array< OneD, DataTypem_points [3]
 
Array< OneD, DataTypem_weights
 
MatrixSharedPtrType m_derivmatrix [3]
 
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.

References Create(), CreateMatrix(), GetI(), and LIB_UTILITIES_EXPORT.

50  {
51  }

◆ BLPoints() [1/3]

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

Definition at line 66 of file BLPoints.h.

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::eGaussRadauMAlpha0Beta2, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eGaussRadauMAlpha2Beta0, Nektar::LibUtilities::eGaussRadauMChebyshev, Nektar::LibUtilities::eGaussRadauMLegendre, Nektar::LibUtilities::eGaussRadauPChebyshev, Nektar::LibUtilities::eGaussRadauPLegendre, Nektar::LibUtilities::ePolyEvenlySpaced, and Nektar::LibUtilities::Points< NekDouble >::m_InterpManager.

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

◆ 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

◆ CalculateDerivMatrix()

void Nektar::LibUtilities::BLPoints::CalculateDerivMatrix ( )
privatevirtual

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

Definition at line 103 of file BLPoints.cpp.

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

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

◆ CalculateInterpMatrix()

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

Definition at line 158 of file BLPoints.cpp.

Referenced by GetI().

159  {
160  boost::ignore_unused(npts, xpoints, interp);
161  }

◆ CalculatePoints()

void Nektar::LibUtilities::BLPoints::CalculatePoints ( )
privatevirtual

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

Definition at line 51 of file BLPoints.cpp.

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

52  {
53  // Allocate the storage for points.
55  unsigned int npts = m_pointsKey.GetNumPoints();
56 
57  // Derived power coefficient.
60  "Must set factor in BLPoints key");
61 
62  if (fabs(r-1.0) < 1e-6)
63  {
64  NekDouble tmp = 2.0/(npts-1.0);
65  for (unsigned int i = 0; i < npts; ++i)
66  {
67  m_points[0][i] = -1.0 + i * tmp;
68  }
69  }
70  else
71  {
72  NekDouble a = 2.0 * (1.0-r) / (1.0 - pow(r,(double)(npts-1)));
73  m_points[0][0] = -1.0;
74 
75  for (unsigned int i = 1; i < npts; ++i)
76  {
77  m_points[0][i] = m_points[0][i-1] + a*pow(r,(double)(i-1));
78  }
79 
80  m_points[0][npts-1] = 1.0;
81  }
82 
84  {
85  std::vector<NekDouble> tmp(npts);
86  for (unsigned int i = 0; i < npts; ++i)
87  {
88  tmp[i] = - m_points[0][npts-1-i];
89  }
90 
91  for (unsigned int i = 0; i < npts; ++i)
92  {
93  m_points[0][i] = tmp[i];
94  }
95  }
96  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
PointsType GetPointsType() const
Definition: Points.h:112
NekDouble GetFactor() const
Definition: Points.h:117
double NekDouble
static const NekDouble kNekUnsetDouble
1D power law distribution for boundary layer points
Definition: PointsType.h:68
Array< OneD, DataType > m_points[3]
Definition: Points.h:381
unsigned int GetNumPoints() const
Definition: Points.h:107

◆ CalculateWeights()

void Nektar::LibUtilities::BLPoints::CalculateWeights ( )
privatevirtual

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

Definition at line 98 of file BLPoints.cpp.

99  {
100 
101  }

◆ Create()

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

Definition at line 109 of file BLPoints.cpp.

Referenced by ~BLPoints().

110  {
111  std::shared_ptr<Points<NekDouble> > returnval(MemoryManager<BLPoints>::AllocateSharedPtr(key));
112 
113  returnval->Initialize();
114 
115  return returnval;
116  }
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.

References GetI(), Nektar::LibUtilities::PointsKey::GetNumPoints(), and Nektar::LibUtilities::PointsManager().

Referenced by BLPoints(), and ~BLPoints().

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

◆ GetI() [1/3]

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

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

Definition at line 130 of file BLPoints.cpp.

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

Referenced by CreateMatrix(), GetI(), and ~BLPoints().

131  {
132  ASSERTL0(pkey.GetPointsDim()==1, "Fourier Points can only interp to other 1d point distributions");
133 
134  return m_InterpManager[pkey];
135  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:384

◆ GetI() [2/3]

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

Delegate to function below.

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

Definition at line 137 of file BLPoints.cpp.

References GetI().

138  {
139  int numpoints = 1;
140 
141  /// Delegate to function below.
142  return GetI(numpoints, x);
143  }
const MatrixSharedPtrType GetI(const PointsKey &pkey)
Definition: BLPoints.cpp:130

◆ GetI() [3/3]

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

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

Definition at line 145 of file BLPoints.cpp.

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

146  {
147  Array<OneD, NekDouble> interp(GetNumPoints()*numpoints);
148 
149  CalculateInterpMatrix(numpoints, x, interp);
150 
151  NekDouble* t = interp.data();
152  unsigned int np = GetNumPoints();
153  std::shared_ptr< NekMatrix<NekDouble> > returnval(MemoryManager<NekMatrix<NekDouble> >::AllocateSharedPtr(numpoints,np,t));
154 
155  return returnval;
156  }
double NekDouble
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
Definition: BLPoints.cpp:158
unsigned int GetNumPoints() const
Definition: Points.h:272

Member Data Documentation

◆ initPointsManager

bool Nektar::LibUtilities::BLPoints::initPointsManager
staticprivate
Initial value:

Definition at line 120 of file BLPoints.h.