Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Nektar::LibUtilities::FourierSingleModePoints Class Reference

#include <FourierSingleModePoints.h>

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

Public Member Functions

virtual ~FourierSingleModePoints ()
 
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)
 
 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 boost::shared_ptr
< PointsBaseType
Create (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)
 

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::opLess
m_InterpManager
 
NekManager< PointsKey,
NekMatrix< DataType >
, PointsKey::opLess
m_GalerkinProjectionManager
 

Detailed Description

Definition at line 51 of file FourierSingleModePoints.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file FourierSingleModePoints.h.

55  {
56  }
Nektar::LibUtilities::FourierSingleModePoints::FourierSingleModePoints ( const PointsKey key)
inline

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

65  :PointsBaseType(key)
66  {
67  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussLegendre),
68  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
69  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMLegendre),
70  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
71  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauPLegendre),
72  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
73  m_InterpManager.RegisterCreator(PointsKey(0, eGaussLobattoLegendre),
74  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
75  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussChebyshev),
76  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
77  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMChebyshev),
78  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
79  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauPChebyshev),
80  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
81  m_InterpManager.RegisterCreator(PointsKey(0, eGaussLobattoChebyshev),
82  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
83  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha0Beta1),
84  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
85  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha0Beta2),
86  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
87  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha1Beta0),
88  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
89  m_InterpManager.RegisterCreator(PointsKey(0, eGaussRadauMAlpha2Beta0),
90  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
91  m_InterpManager.RegisterCreator(PointsKey(0, ePolyEvenlySpaced),
92  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
93  m_InterpManager.RegisterCreator(PointsKey(0, eFourierEvenlySpaced),
94  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
95  m_InterpManager.RegisterCreator(PointsKey(0, eFourierSingleModeSpaced),
96  boost::bind(&FourierSingleModePoints::CreateMatrix, this, _1));
97 
98  }
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
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
boost::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:64
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 Non Evenly-spaced points for Single Mode analysis
Definition: PointsType.h:65
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:58
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:56
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:352
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::FourierSingleModePoints::FourierSingleModePoints ( )
private

Default constructor should not be called except by Create method.

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

Copy constructor should not be called.

Member Function Documentation

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

Definition at line 136 of file FourierSingleModePoints.cpp.

Referenced by GetI().

137  {
138 
139 
140  }
void Nektar::LibUtilities::FourierSingleModePoints::CalculatePoints ( )
privatevirtual

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

Definition at line 46 of file FourierSingleModePoints.cpp.

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

47  {
48  // Allocate the storage for points
50  unsigned int npts = m_pointsKey.GetNumPoints();
51 
52  if(npts==1)
53  {
54  m_points[0][0] = 0.25;
55  }
56  else
57 
58  {
59  ASSERTL0(npts==2, "Fourier points for single mode analysis should be 2");
60 
61  m_points[0][0] = 0.0;
62  m_points[0][1] = 0.5;
63  }
64  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
Array< OneD, DataType > m_points[3]
Definition: Points.h:349
static std::string npts
Definition: InputFld.cpp:43
unsigned int GetNumPoints() const
Definition: Points.h:106
void Nektar::LibUtilities::FourierSingleModePoints::CalculateWeights ( )
privatevirtual

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

Definition at line 66 of file FourierSingleModePoints.cpp.

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

67  {
68  // Allocate the storage for points
70 
71  unsigned int npts = m_pointsKey.GetNumPoints();
72  //Here I need to insert the weight for the new point distribution
73  for(unsigned int i=0; i<npts; ++i)
74  {
75  m_weights[i] = 1.0;
76  }
77  }
static std::string npts
Definition: InputFld.cpp:43
Array< OneD, DataType > m_weights
Definition: Points.h:350
unsigned int GetNumPoints() const
Definition: Points.h:106
boost::shared_ptr< Points< NekDouble > > Nektar::LibUtilities::FourierSingleModePoints::Create ( const PointsKey key)
static

Definition at line 86 of file FourierSingleModePoints.cpp.

87  {
88  boost::shared_ptr<Points<NekDouble> > returnval(MemoryManager<FourierSingleModePoints>::AllocateSharedPtr(key));
89 
90  returnval->Initialize();
91 
92  return returnval;
93  }
boost::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::FourierSingleModePoints::CreateMatrix ( const PointsKey pkey)

Delegate to function below.

Definition at line 96 of file FourierSingleModePoints.cpp.

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

Referenced by FourierSingleModePoints().

97  {
98  int numpoints = pkey.GetNumPoints();
99  Array<OneD, const NekDouble> xpoints;
100 
101  PointsManager()[pkey]->GetPoints(xpoints);
102 
103  /// Delegate to function below.
104  return GetI(numpoints, xpoints);
105  }
const MatrixSharedPtrType GetI(const PointsKey &pkey)
PointsManagerT & PointsManager(void)
const boost::shared_ptr< NekMatrix< NekDouble > > Nektar::LibUtilities::FourierSingleModePoints::GetI ( const PointsKey pkey)
virtual

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

Definition at line 107 of file FourierSingleModePoints.cpp.

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

Referenced by CreateMatrix(), and GetI().

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

Delegate to function below.

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

Definition at line 115 of file FourierSingleModePoints.cpp.

References GetI().

116  {
117  int numpoints = 1;
118 
119  /// Delegate to function below.
120  return GetI(numpoints, x);
121  }
const MatrixSharedPtrType GetI(const PointsKey &pkey)
const boost::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 123 of file FourierSingleModePoints.cpp.

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

124  {
125  Array<OneD, NekDouble> interp(GetNumPoints()*numpoints);
126 
127  CalculateInterpMatrix(numpoints, x, interp);
128 
129  NekDouble* t = interp.data();
130  unsigned int np = GetNumPoints();
131  boost::shared_ptr< NekMatrix<NekDouble> > returnval(MemoryManager<NekMatrix<NekDouble> >::AllocateSharedPtr(numpoints,np,t));
132 
133  return returnval;
134  }
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
unsigned int GetNumPoints() const
Definition: Points.h:246
double NekDouble
NekDouble Nektar::LibUtilities::FourierSingleModePoints::PeriodicSincFunction ( const NekDouble  x,
const NekDouble  h 
)
private