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

#include <BLPoints.h>

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

Public Member Functions

virtual ~BLPoints ()
 
boost::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 boost::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)
 

Additional Inherited Members

- Public Types inherited from Nektar::LibUtilities::Points< NekDouble >
typedef NekDouble DataType
 
typedef boost::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 47 of file BLPoints.h.

Constructor & Destructor Documentation

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

Definition at line 50 of file BLPoints.h.

51  {
52  }
Nektar::LibUtilities::BLPoints::BLPoints ( const PointsKey key)
inline

Definition at line 67 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.

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

Default constructor should not be called except by Create method.

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

Copy constructor should not be called.

Member Function Documentation

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

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

Definition at line 97 of file BLPoints.cpp.

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

98  {
99  //// Allocate the derivative matrix.
101  }
virtual void CalculateDerivMatrix()
Definition: Points.h:371
void Nektar::LibUtilities::BLPoints::CalculateInterpMatrix ( unsigned int  npts,
const Array< OneD, const NekDouble > &  xpoints,
Array< OneD, NekDouble > &  interp 
)
private

Definition at line 152 of file BLPoints.cpp.

Referenced by GetI().

153  {
154 
155  }
void Nektar::LibUtilities::BLPoints::CalculatePoints ( )
privatevirtual

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

Definition at line 45 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, Nektar::LibUtilities::Points< NekDouble >::m_pointsKey, and npts.

46  {
47  // Allocate the storage for points.
49  unsigned int npts = m_pointsKey.GetNumPoints();
50 
51  // Derived power coefficient.
54  "Must set factor in BLPoints key");
55 
56  if (fabs(r-1.0) < 1e-6)
57  {
58  NekDouble tmp = 2.0/(npts-1.0);
59  for (unsigned int i = 0; i < npts; ++i)
60  {
61  m_points[0][i] = -1.0 + i * tmp;
62  }
63  }
64  else
65  {
66  NekDouble a = 2.0 * (1.0-r) / (1.0 - pow(r,(double)npts));
67  m_points[0][0] = -1.0;
68 
69  for (unsigned int i = 1; i < npts; ++i)
70  {
71  m_points[0][i] = m_points[0][i-1] + a*pow(r,(double)i);
72  }
73 
74  m_points[0][npts-1] = 1.0;
75  }
76 
78  {
79  vector<NekDouble> tmp(npts);
80  for (unsigned int i = 0; i < npts; ++i)
81  {
82  tmp[i] = - m_points[0][npts-1-i];
83  }
84 
85  for (unsigned int i = 0; i < npts; ++i)
86  {
87  m_points[0][i] = tmp[i];
88  }
89  }
90  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
NekDouble GetFactor() const
Definition: Points.h:116
static std::string npts
Definition: InputFld.cpp:43
double NekDouble
static const NekDouble kNekUnsetDouble
1D power law distribution for boundary layer points
Definition: PointsType.h:67
unsigned int GetNumPoints() const
Definition: Points.h:106
Array< OneD, DataType > m_points[3]
Definition: Points.h:349
PointsType GetPointsType() const
Definition: Points.h:111
void Nektar::LibUtilities::BLPoints::CalculateWeights ( )
privatevirtual

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

Definition at line 92 of file BLPoints.cpp.

93  {
94 
95  }
boost::shared_ptr< Points< NekDouble > > Nektar::LibUtilities::BLPoints::Create ( const PointsKey key)
static

Definition at line 103 of file BLPoints.cpp.

104  {
105  boost::shared_ptr<Points<NekDouble> > returnval(MemoryManager<BLPoints>::AllocateSharedPtr(key));
106 
107  returnval->Initialize();
108 
109  return returnval;
110  }
boost::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::CreateMatrix ( const PointsKey pkey)

Delegate to function below.

Definition at line 113 of file BLPoints.cpp.

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

Referenced by BLPoints().

114  {
115  int numpoints = pkey.GetNumPoints();
116  Array<OneD, const NekDouble> xpoints;
117 
118  PointsManager()[pkey]->GetPoints(xpoints);
119 
120  /// Delegate to function below.
121  return GetI(numpoints, xpoints);
122  }
PointsManagerT & PointsManager(void)
const MatrixSharedPtrType GetI(const PointsKey &pkey)
Definition: BLPoints.cpp:124
const boost::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::BLPoints::GetI ( const PointsKey pkey)
virtual

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

Definition at line 124 of file BLPoints.cpp.

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

Referenced by CreateMatrix(), and GetI().

125  {
126  ASSERTL0(pkey.GetPointsDim()==1, "Fourier Points can only interp to other 1d point distributions");
127 
128  return m_InterpManager[pkey];
129  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:352
const boost::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 131 of file BLPoints.cpp.

References GetI().

132  {
133  int numpoints = 1;
134 
135  /// Delegate to function below.
136  return GetI(numpoints, x);
137  }
const MatrixSharedPtrType GetI(const PointsKey &pkey)
Definition: BLPoints.cpp:124
const boost::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 139 of file BLPoints.cpp.

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

140  {
141  Array<OneD, NekDouble> interp(GetNumPoints()*numpoints);
142 
143  CalculateInterpMatrix(numpoints, x, interp);
144 
145  NekDouble* t = interp.data();
146  unsigned int np = GetNumPoints();
147  boost::shared_ptr< NekMatrix<NekDouble> > returnval(MemoryManager<NekMatrix<NekDouble> >::AllocateSharedPtr(numpoints,np,t));
148 
149  return returnval;
150  }
double NekDouble
unsigned int GetNumPoints() const
Definition: Points.h:246
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
Definition: BLPoints.cpp:152