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

#include <FourierSingleModePoints.h>

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

Public Member Functions

virtual ~FourierSingleModePoints ()
 
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)
 
 FourierSingleModePoints (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

 FourierSingleModePoints ()
 Default constructor should not be called except by Create method. More...
 
 FourierSingleModePoints (const FourierSingleModePoints &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)
 
NekDouble PeriodicSincFunction (const NekDouble x, const NekDouble h)
 

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 47 of file FourierSingleModePoints.h.

Constructor & Destructor Documentation

◆ ~FourierSingleModePoints()

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

Definition at line 50 of file FourierSingleModePoints.h.

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

51  {
52  }

◆ FourierSingleModePoints() [1/3]

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

Definition at line 61 of file FourierSingleModePoints.h.

References CreateMatrix(), Nektar::LibUtilities::eFourierEvenlySpaced, Nektar::LibUtilities::eFourierSingleModeSpaced, 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.

61  :PointsBaseType(key)
62  {
63  namespace pl = std::placeholders;
64  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussLegendre),
65  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
66  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMLegendre),
67  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
68  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauPLegendre),
69  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
70  m_InterpManager.RegisterCreator(PointsKey(0, eGaussLobattoLegendre),
71  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
72  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussChebyshev),
73  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
74  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMChebyshev),
75  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
76  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauPChebyshev),
77  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
78  m_InterpManager.RegisterCreator(PointsKey(0, eGaussLobattoChebyshev),
79  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
80  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha0Beta1),
81  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
82  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha0Beta2),
83  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
84  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha1Beta0),
85  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
86  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha2Beta0),
87  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
88  m_InterpManager.RegisterCreator(PointsKey(0, ePolyEvenlySpaced),
89  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
90  m_InterpManager.RegisterCreator(PointsKey(0, eFourierEvenlySpaced),
91  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
92  m_InterpManager.RegisterCreator(PointsKey(0, eFourierSingleModeSpaced),
93  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
94  }
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
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 Non Evenly-spaced points for Single Mode analysis
Definition: PointsType.h:66
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:59
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:57
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:56
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
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

◆ FourierSingleModePoints() [2/3]

Nektar::LibUtilities::FourierSingleModePoints::FourierSingleModePoints ( )
private

Default constructor should not be called except by Create method.

◆ FourierSingleModePoints() [3/3]

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

Copy constructor should not be called.

Member Function Documentation

◆ CalculateDerivMatrix()

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

◆ CalculateInterpMatrix()

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

Definition at line 140 of file FourierSingleModePoints.cpp.

Referenced by GetI().

141  {
142  boost::ignore_unused(npts, xpoints, interp);
143  }

◆ CalculatePoints()

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

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

Definition at line 50 of file FourierSingleModePoints.cpp.

References ASSERTL0, Nektar::LibUtilities::Points< NekDouble >::CalculatePoints(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_points, and Nektar::LibUtilities::Points< NekDouble >::m_pointsKey.

51  {
52  // Allocate the storage for points
54  unsigned int npts = m_pointsKey.GetNumPoints();
55 
56  if(npts==1)
57  {
58  m_points[0][0] = 0.25;
59  }
60  else
61 
62  {
63  ASSERTL0(npts==2, "Fourier points for single mode analysis should be 2");
64 
65  m_points[0][0] = 0.0;
66  m_points[0][1] = 0.5;
67  }
68  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Array< OneD, DataType > m_points[3]
Definition: Points.h:381
unsigned int GetNumPoints() const
Definition: Points.h:107

◆ CalculateWeights()

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

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

Definition at line 70 of file FourierSingleModePoints.cpp.

References Nektar::LibUtilities::Points< NekDouble >::CalculateWeights(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::LibUtilities::Points< NekDouble >::m_pointsKey, and Nektar::LibUtilities::Points< NekDouble >::m_weights.

71  {
72  // Allocate the storage for points
74 
75  unsigned int npts = m_pointsKey.GetNumPoints();
76  //Here I need to insert the weight for the new point distribution
77  for(unsigned int i=0; i<npts; ++i)
78  {
79  m_weights[i] = 1.0;
80  }
81  }
Array< OneD, DataType > m_weights
Definition: Points.h:382
unsigned int GetNumPoints() const
Definition: Points.h:107

◆ Create()

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

Definition at line 90 of file FourierSingleModePoints.cpp.

Referenced by ~FourierSingleModePoints().

91  {
92  std::shared_ptr<Points<NekDouble> > returnval(MemoryManager<FourierSingleModePoints>::AllocateSharedPtr(key));
93 
94  returnval->Initialize();
95 
96  return returnval;
97  }
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::FourierSingleModePoints::CreateMatrix ( const PointsKey pkey)

Delegate to function below.

Definition at line 100 of file FourierSingleModePoints.cpp.

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

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

101  {
102  int numpoints = pkey.GetNumPoints();
103  Array<OneD, const NekDouble> xpoints;
104 
105  PointsManager()[pkey]->GetPoints(xpoints);
106 
107  /// Delegate to function below.
108  return GetI(numpoints, xpoints);
109  }
PointsManagerT & PointsManager(void)
const MatrixSharedPtrType GetI(const PointsKey &pkey)

◆ GetI() [1/3]

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

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

Definition at line 111 of file FourierSingleModePoints.cpp.

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

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

112  {
113  ASSERTL0(pkey.GetPointsDim()==1, "Fourier Points can only interp to other 1d point distributions");
114 
115  return m_InterpManager[pkey];
116 
117  }
#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::FourierSingleModePoints::GetI ( const Array< OneD, const NekDouble > &  x)
virtual

Delegate to function below.

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

Definition at line 119 of file FourierSingleModePoints.cpp.

References GetI().

120  {
121  int numpoints = 1;
122 
123  /// Delegate to function below.
124  return GetI(numpoints, x);
125  }
const MatrixSharedPtrType GetI(const PointsKey &pkey)

◆ GetI() [3/3]

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

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

Definition at line 127 of file FourierSingleModePoints.cpp.

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

128  {
129  Array<OneD, NekDouble> interp(GetNumPoints()*numpoints);
130 
131  CalculateInterpMatrix(numpoints, x, interp);
132 
133  NekDouble* t = interp.data();
134  unsigned int np = GetNumPoints();
135  std::shared_ptr< NekMatrix<NekDouble> > returnval(MemoryManager<NekMatrix<NekDouble> >::AllocateSharedPtr(numpoints,np,t));
136 
137  return returnval;
138  }
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
double NekDouble
unsigned int GetNumPoints() const
Definition: Points.h:272

◆ PeriodicSincFunction()

NekDouble Nektar::LibUtilities::FourierSingleModePoints::PeriodicSincFunction ( const NekDouble  x,
const NekDouble  h 
)
private

Member Data Documentation

◆ initPointsManager

bool Nektar::LibUtilities::FourierSingleModePoints::initPointsManager
staticprivate