oomph::OneDimensionalLegendreDShape< NNODE_1D > Class Template Reference

#include <shape.h>

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

Public Member Functions

 OneDimensionalLegendreDShape (const double &s)
 
- 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...
 

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...
 

Constructor & Destructor Documentation

◆ OneDimensionalLegendreDShape()

template<unsigned NNODE_1D>
oomph::OneDimensionalLegendreDShape< NNODE_1D >::OneDimensionalLegendreDShape ( const double s)
inline
1291  : Shape(NNODE_1D)
1292  {
1293  unsigned p = NNODE_1D - 1;
1294  Vector<double> z = OneDimensionalLegendreShape<NNODE_1D>::z;
1295 
1296 
1297  bool root = false;
1298 
1299  for (unsigned i = 0; i < NNODE_1D; i++)
1300  {
1301  unsigned rootnum = 0;
1302  for (unsigned j = 0; j < NNODE_1D; j++)
1303  { // Loop over roots to check if
1304  if (std::fabs(s - z[j]) < 10 * Orthpoly::eps)
1305  { // s happens to be a root.
1306  root = true;
1307  break;
1308  }
1309  rootnum += 1;
1310  }
1311  if (root == true)
1312  {
1313  if (i == rootnum && i == 0)
1314  {
1315  (*this)[i] = -(1.0 + p) * p / 4.0;
1316  }
1317  else if (i == rootnum && i == p)
1318  {
1319  (*this)[i] = (1.0 + p) * p / 4.0;
1320  }
1321  else if (i == rootnum)
1322  {
1323  (*this)[i] = 0.0;
1324  }
1325  else
1326  {
1327  (*this)[i] = Orthpoly::legendre(p, z[rootnum]) /
1328  Orthpoly::legendre(p, z[i]) / (z[rootnum] - z[i]);
1329  }
1330  }
1331  else
1332  {
1333  (*this)[i] =
1334  ((1 + s * (s - 2 * z[i])) / (s - z[i]) * Orthpoly::dlegendre(p, s) -
1335  (1 - s * s) * Orthpoly::ddlegendre(p, s)) /
1336  p / (p + 1.0) / Orthpoly::legendre(p, z[i]) / (s - z[i]);
1337  }
1338  root = false;
1339  }
1340  }
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 ddlegendre(const unsigned &p, const double &x)
Definition: orthpoly.h:144
double legendre(const unsigned &p, const double &x)
Definition: orthpoly.h:57
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::Orthpoly::ddlegendre(), oomph::Orthpoly::dlegendre(), oomph::Orthpoly::eps, boost::multiprecision::fabs(), i, j, oomph::Orthpoly::legendre(), p, s, and oomph::OneDimensionalLegendreShape< NNODE_1D >::z.


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