oomph::OneDLegendreDShapeParam Class Reference

#include <Qspectral_elements.h>

+ Inheritance diagram for oomph::OneDLegendreDShapeParam:

Public Member Functions

 OneDLegendreDShapeParam (const unsigned &order, 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

◆ OneDLegendreDShapeParam()

oomph::OneDLegendreDShapeParam::OneDLegendreDShapeParam ( const unsigned order,
const double s 
)
inline
98  : Shape(order)
99  {
100  unsigned p = order - 1;
101  Vector<double> z = OneDLegendreShapeParam::z[order];
102 
103  bool root = false;
104  for (unsigned i = 0; i < order; i++)
105  {
106  unsigned rootnum = 0;
107  for (unsigned j = 0; j < order; j++)
108  { // Loop over roots to check if
109  if (std::fabs(s - z[j]) < 10.0 * Orthpoly::eps)
110  { // s happens to be a root.
111  root = true;
112  break;
113  }
114  rootnum += 1;
115  }
116  if (root == true)
117  {
118  if (i == rootnum && i == 0)
119  {
120  (*this)[i] = -(1.0 + p) * p / 4.0;
121  }
122  else if (i == rootnum && i == p)
123  {
124  (*this)[i] = (1.0 + p) * p / 4.0;
125  }
126  else if (i == rootnum)
127  {
128  (*this)[i] = 0.0;
129  }
130  else
131  {
132  (*this)[i] = Orthpoly::legendre(p, z[rootnum]) /
133  Orthpoly::legendre(p, z[i]) / (z[rootnum] - z[i]);
134  }
135  }
136  else
137  {
138  (*this)[i] =
139  ((1 + s * (s - 2 * z[i])) / (s - z[i]) * Orthpoly::dlegendre(p, s) -
140  (1 - s * s) * Orthpoly::ddlegendre(p, s)) /
141  p / (p + 1.0) / Orthpoly::legendre(p, z[i]) / (s - z[i]);
142  }
143  root = false;
144  }
145  }
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 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::OneDLegendreShapeParam::z.


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