oomph::OneDLegendreShapeParam Class Reference

Class that returns the shape functions associated with legendre. More...

#include <Qspectral_elements.h>

+ Inheritance diagram for oomph::OneDLegendreShapeParam:

Public Member Functions

 OneDLegendreShapeParam (const unsigned &order, const double &s)
 Constructor. More...
 
- Public Member Functions inherited from oomph::Shape
 Shape (const unsigned &N)
 Constructor for a single-index set of shape functions. More...
 
 Shape (const unsigned &N, const unsigned &M)
 Constructor for a two-index set of shape functions. More...
 
 Shape (const Shape &shape)=delete
 Broken copy constructor. More...
 
 Shape ()
 
void operator= (const Shape &shape)
 
void operator= (Shape *const &shape_pt)
 
 ~Shape ()
 Destructor, clear up the memory allocated by the object. More...
 
void resize (const unsigned &N, const unsigned &M=1)
 Change the size of the storage. More...
 
doubleoperator[] (const unsigned &i)
 Overload the bracket operator to provide access to values. More...
 
const doubleoperator[] (const unsigned &i) const
 Overload the bracket operator (const version) More...
 
doubleoperator() (const unsigned &i)
 Overload the round bracket operator to provide access to values. More...
 
const doubleoperator() (const unsigned &i) const
 Overload the round bracket operator (const version) More...
 
doubleoperator() (const unsigned &i, const unsigned &j)
 Overload the round bracket operator, allowing for two indices. More...
 
const doubleoperator() (const unsigned &i, const unsigned &j) const
 
unsigned nindex1 () const
 Return the range of index 1 of the shape function object. More...
 
unsigned nindex2 () const
 Return the range of index 2 of the shape function object. More...
 

Static Public Member Functions

static void calculate_nodal_positions (const unsigned &order)
 Static function used to populate the stored positions. More...
 
static double nodal_position (const unsigned &order, const unsigned &n)
 

Static Public Attributes

static std::map< unsigned, Vector< double > > z
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::Shape
void range_check (const unsigned &i, const unsigned &j) const
 Private function that checks whether the index is in range. More...
 
- Protected Attributes inherited from oomph::Shape
doublePsi
 
doubleAllocated_storage
 
unsigned Index1
 Size of the first index of the shape function. More...
 
unsigned Index2
 Size of the second index of the shape function. More...
 

Detailed Description

Class that returns the shape functions associated with legendre.

Constructor & Destructor Documentation

◆ OneDLegendreShapeParam()

oomph::OneDLegendreShapeParam::OneDLegendreShapeParam ( const unsigned order,
const double s 
)
inline

Constructor.

68  : Shape(order)
69  {
70  using namespace Orthpoly;
71 
72  unsigned p = order - 1;
73  // Now populate the shape function
74  for (unsigned i = 0; i < order; i++)
75  {
76  // If we're at one of the nodes, the value must be 1.0
77  if (std::fabs(s - z[order][i]) < Orthpoly::eps)
78  {
79  (*this)[i] = 1.0;
80  }
81  // Otherwise use the lagrangian interpolant
82  else
83  {
84  (*this)[i] =
85  (1.0 - s * s) * dlegendre(p, s) /
86  (p * (p + 1) * legendre(p, z[order][i]) * (z[order][i] - s));
87  }
88  }
89  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
float * p
Definition: Tutorial_Map_using.cpp:9
static std::map< unsigned, Vector< double > > z
Definition: Qspectral_elements.h:48
Shape()
Definition: shape.h:137
RealScalar s
Definition: level1_cplx_impl.h:130
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
double dlegendre(const unsigned &p, const double &x)
Definition: orthpoly.h:121
const double eps
Definition: orthpoly.h:52
double legendre(const unsigned &p, const double &x)
Definition: orthpoly.h:57

References oomph::Orthpoly::dlegendre(), oomph::Orthpoly::eps, boost::multiprecision::fabs(), i, oomph::Orthpoly::legendre(), p, s, and z.

Member Function Documentation

◆ calculate_nodal_positions()

static void oomph::OneDLegendreShapeParam::calculate_nodal_positions ( const unsigned order)
inlinestatic

Static function used to populate the stored positions.

52  {
53  // If we haven't already calculated these
54  if (z.find(order) == z.end())
55  {
56  Orthpoly::gll_nodes(order, z[order]);
57  }
58  }
void gll_nodes(const unsigned &Nnode, Vector< double > &x)
Calculates the Gauss Lobatto Legendre abscissas for degree p = NNode-1.
Definition: orthpoly.cc:33

References oomph::Orthpoly::gll_nodes(), and z.

◆ nodal_position()

static double oomph::OneDLegendreShapeParam::nodal_position ( const unsigned order,
const unsigned n 
)
inlinestatic
62  {
63  return z[order][n];
64  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11

References n, and z.

Member Data Documentation

◆ z


The documentation for this class was generated from the following files: