oomph::OneDimensionalLegendreShape< NNODE_1D > Class Template Reference

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

#include <shape.h>

+ Inheritance diagram for oomph::OneDimensionalLegendreShape< NNODE_1D >:

Public Member Functions

 OneDimensionalLegendreShape (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 ()
 Static function used to populate the stored positions. More...
 
static double nodal_position (const unsigned &n)
 

Static Public Attributes

static Vector< doublez
 

Static Private Attributes

static bool Nodes_calculated = false
 

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

template<unsigned NNODE_1D>
class oomph::OneDimensionalLegendreShape< NNODE_1D >

Class that returns the shape functions associated with legendre.

Constructor & Destructor Documentation

◆ OneDimensionalLegendreShape()

template<unsigned NNODE_1D>
oomph::OneDimensionalLegendreShape< NNODE_1D >::OneDimensionalLegendreShape ( const double s)
inline

Constructor.

1256  : Shape(NNODE_1D)
1257  {
1258  using namespace Orthpoly;
1259 
1260  unsigned p = NNODE_1D - 1;
1261  // Now populate the shape function
1262  for (unsigned i = 0; i < NNODE_1D; i++)
1263  {
1264  // If we're at one of the nodes, the value must be 1.0
1265  if (std::fabs(s - z[i]) < Orthpoly::eps)
1266  {
1267  (*this)[i] = 1.0;
1268  }
1269  // Otherwise use the lagrangian interpolant
1270  else
1271  {
1272  (*this)[i] = (1.0 - s * s) * dlegendre(p, s) /
1273  (p * (p + 1) * legendre(p, z[i]) * (z[i] - s));
1274  }
1275  }
1276  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
float * p
Definition: Tutorial_Map_using.cpp:9
static Vector< double > z
Definition: shape.h:1238
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 oomph::OneDimensionalLegendreShape< NNODE_1D >::z.

Member Function Documentation

◆ calculate_nodal_positions()

template<unsigned NNODE_1D>
static void oomph::OneDimensionalLegendreShape< NNODE_1D >::calculate_nodal_positions ( )
inlinestatic

Static function used to populate the stored positions.

1242  {
1243  if (!Nodes_calculated)
1244  {
1245  Orthpoly::gll_nodes(NNODE_1D, z);
1246  Nodes_calculated = true;
1247  }
1248  }
static bool Nodes_calculated
Definition: shape.h:1235
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(), oomph::OneDimensionalLegendreShape< NNODE_1D >::Nodes_calculated, and oomph::OneDimensionalLegendreShape< NNODE_1D >::z.

Referenced by oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::dshape_local(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::dshape_local(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::dshape_local(), oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::local_coordinate_of_node(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::local_coordinate_of_node(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::local_coordinate_of_node(), oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::local_one_d_fraction_of_node(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::local_one_d_fraction_of_node(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::local_one_d_fraction_of_node(), oomph::QSpectralElement< 1, NNODE_1D >::QSpectralElement(), oomph::QSpectralElement< 2, NNODE_1D >::QSpectralElement(), oomph::QSpectralElement< 3, NNODE_1D >::QSpectralElement(), oomph::PRefineableQElement< 1, INITIAL_NNODE_1D >::shape(), oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::shape(), and oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::shape().

◆ nodal_position()

Member Data Documentation

◆ Nodes_calculated

template<unsigned NNODE_1D>
bool oomph::OneDimensionalLegendreShape< NNODE_1D >::Nodes_calculated = false
staticprivate

◆ z


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