Nektar++
Public Member Functions | Protected Member Functions | List of all members
Nektar::Utilities::NodalUtilTriMonomial Class Reference
Inheritance diagram for Nektar::Utilities::NodalUtilTriMonomial:
[legend]

Public Member Functions

 NodalUtilTriMonomial (int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
 
virtual ~NodalUtilTriMonomial ()
 
- Public Member Functions inherited from Nektar::LibUtilities::NodalUtilTriangle
 NodalUtilTriangle (int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
 Construct the nodal utility class for a triangle. More...
 
virtual ~NodalUtilTriangle ()
 
- Public Member Functions inherited from Nektar::LibUtilities::NodalUtil
NekVector< NekDoubleGetWeights ()
 Obtain the integration weights for the given nodal distribution. More...
 
SharedMatrix GetVandermonde ()
 Return the Vandermonde matrix for the nodal distribution. More...
 
SharedMatrix GetVandermondeForDeriv (int dir)
 Return the Vandermonde matrix of the derivative of the basis functions for the nodal distribution. More...
 
SharedMatrix GetDerivMatrix (int dir)
 Return the derivative matrix for the nodal distribution. More...
 
SharedMatrix GetInterpolationMatrix (Array< OneD, Array< OneD, NekDouble > > &xi)
 Construct the interpolation matrix used to evaluate the basis at the points xi inside the element. More...
 

Protected Member Functions

virtual NekVector< NekDoublev_OrthoBasis (const int mode)
 Return the value of the modal functions for the triangular element at the nodal points m_xi for a given mode. More...
 
virtual NekVector< NekDoublev_OrthoBasisDeriv (const int dir, const int mode)
 Return the value of the derivative of the modal functions for the triangular element at the nodal points m_xi for a given mode. More...
 
virtual std::shared_ptr< NodalUtilv_CreateUtil (Array< OneD, Array< OneD, NekDouble > > &xi)
 Construct a NodalUtil object of the appropriate element type for a given set of points. More...
 
- Protected Member Functions inherited from Nektar::LibUtilities::NodalUtilTriangle
virtual NekDouble v_ModeZeroIntegral ()
 Return the value of the integral of the zero-th mode for this element. More...
 
virtual int v_NumModes ()
 Calculate the number of degrees of freedom for this element. More...
 
- Protected Member Functions inherited from Nektar::LibUtilities::NodalUtil
 NodalUtil (int degree, int dim)
 Set up the NodalUtil object. More...
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::NodalUtilTriangle
std::vector< std::pair< int, int > > m_ordering
 Mapping from the \( (i,j) \) indexing of the basis to a continuous ordering. More...
 
Array< OneD, Array< OneD, NekDouble > > m_eta
 Collapsed coordinates \( (\eta_1, \eta_2) \) of the nodal points. More...
 
- Protected Attributes inherited from Nektar::LibUtilities::NodalUtil
int m_dim
 Dimension of the nodal element. More...
 
int m_degree
 Degree of the nodal element. More...
 
int m_numPoints
 Total number of nodal points. More...
 
Array< OneD, Array< OneD, NekDouble > > m_xi
 Coordinates of the nodal points defining the basis. More...
 

Detailed Description

Definition at line 406 of file ProcessVarOpti.cpp.

Constructor & Destructor Documentation

◆ NodalUtilTriMonomial()

Nektar::Utilities::NodalUtilTriMonomial::NodalUtilTriMonomial ( int  degree,
Array< OneD, NekDouble r,
Array< OneD, NekDouble s 
)
inline

Definition at line 409 of file ProcessVarOpti.cpp.

411  : NodalUtilTriangle(degree, r, s)
412  {
413  }
NodalUtilTriangle(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a triangle.
Definition: NodalUtil.cpp:238

◆ ~NodalUtilTriMonomial()

virtual Nektar::Utilities::NodalUtilTriMonomial::~NodalUtilTriMonomial ( )
inlinevirtual

Definition at line 415 of file ProcessVarOpti.cpp.

416  {
417  }

Member Function Documentation

◆ v_CreateUtil()

virtual std::shared_ptr<NodalUtil> Nektar::Utilities::NodalUtilTriMonomial::v_CreateUtil ( Array< OneD, Array< OneD, NekDouble > > &  xi)
inlineprotectedvirtual

Construct a NodalUtil object of the appropriate element type for a given set of points.

This function is used inside NodalUtil::GetInterpolationMatrix so that the (potentially non-square) Vandermonde matrix can be constructed to create the interpolation matrix at an arbitrary set of points in the domain.

Parameters
xiDistribution of nodal points to create utility with.

Reimplemented from Nektar::LibUtilities::NodalUtilTriangle.

Definition at line 443 of file ProcessVarOpti.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

445  {
447  m_degree, xi[0], xi[1]);
448  }
int m_degree
Degree of the nodal element.
Definition: NodalUtil.h:107
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ v_OrthoBasis()

virtual NekVector<NekDouble> Nektar::Utilities::NodalUtilTriMonomial::v_OrthoBasis ( const int  mode)
inlineprotectedvirtual

Return the value of the modal functions for the triangular element at the nodal points m_xi for a given mode.

In a triangle, we use the orthogonal basis

\[ \psi_{m(ij)} = \sqrt{2} P^{(0,0)}_i(\xi_1) P_j^{(2i+1,0)}(\xi_2) (1-\xi_2)^i \]

where \( m(ij) \) is the mapping defined in NodalUtilTriangle::m_ordering and \( J_n^{(\alpha,\beta)}(z) \) denotes the standard Jacobi polynomial.

Parameters
modeThe mode of the orthogonal basis to evaluate.
Returns
Vector containing orthogonal basis evaluated at the points m_xi.

Reimplemented from Nektar::LibUtilities::NodalUtilTriangle.

Definition at line 420 of file ProcessVarOpti.cpp.

References CG_Iterations::modes.

421  {
422  // Monomial basis.
423  std::pair<int, int> modes = m_ordering[mode];
424  NekVector<NekDouble> ret(m_numPoints);
425 
426  for (int i = 0; i < m_numPoints; ++i)
427  {
428  ret(i) =
429  pow(m_xi[0][i], modes.first) * pow(m_xi[1][i], modes.second);
430  }
431 
432  return ret;
433  }
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
Definition: NodalUtil.h:183
Array< OneD, Array< OneD, NekDouble > > m_xi
Coordinates of the nodal points defining the basis.
Definition: NodalUtil.h:111
int m_numPoints
Total number of nodal points.
Definition: NodalUtil.h:109

◆ v_OrthoBasisDeriv()

virtual NekVector<NekDouble> Nektar::Utilities::NodalUtilTriMonomial::v_OrthoBasisDeriv ( const int  dir,
const int  mode 
)
inlineprotectedvirtual

Return the value of the derivative of the modal functions for the triangular element at the nodal points m_xi for a given mode.

Note that this routine must use the chain rule combined with the collapsed coordinate derivatives as described in Sherwin & Karniadakis (2nd edition), pg 150.

Parameters
dirCoordinate direction in which to evaluate the derivative.
modeThe mode of the orthogonal basis to evaluate.
Returns
Vector containing the derivative of the orthogonal basis evaluated at the points m_xi.

Reimplemented from Nektar::LibUtilities::NodalUtilTriangle.

Definition at line 435 of file ProcessVarOpti.cpp.

References Nektar::ErrorUtil::efatal, and NEKERROR.

437  {
438  boost::ignore_unused(dir, mode);
439  NEKERROR(ErrorUtil::efatal, "OrthoBasisDeriv: not supported");
440  return NekVector<NekDouble>();
441  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:209