oomph::GaussLegendre< 2, NPTS_1D > Class Template Reference

2D Gauss Legendre integration class More...

#include <integral.h>

+ Inheritance diagram for oomph::GaussLegendre< 2, NPTS_1D >:

Public Member Functions

 GaussLegendre ()
 Deafault constructor. Calculates and stores GLL nodes. More...
 
unsigned nweight () const
 Number of integration points of the scheme. More...
 
double knot (const unsigned &i, const unsigned &j) const
 Return coordinate s[j] (j=0) of integration point i. More...
 
double weight (const unsigned &i) const
 Return weight of integration point i. More...
 
- Public Member Functions inherited from oomph::Integral
 Integral ()
 Default constructor (empty) More...
 
 Integral (const Integral &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Integral &)=delete
 Broken assignment operator. More...
 
virtual ~Integral ()
 Virtual destructor (empty) More...
 
virtual Vector< doubleknot (const unsigned &i) const
 Return local coordinates of i-th intergration point. Broken virtual. More...
 

Private Attributes

double Knot [NPTS_1D *NPTS_1D][2]
 Array to hold weight and knot points. More...
 
double Weight [NPTS_1D *NPTS_1D]
 

Static Private Attributes

static const unsigned long int Npts = NPTS_1D * NPTS_1D
 Number of integration points in scheme. More...
 

Detailed Description

template<unsigned NPTS_1D>
class oomph::GaussLegendre< 2, NPTS_1D >

2D Gauss Legendre integration class

Constructor & Destructor Documentation

◆ GaussLegendre()

template<unsigned NPTS_1D>
oomph::GaussLegendre< 2, NPTS_1D >::GaussLegendre

Deafault constructor. Calculates and stores GLL nodes.

Calculate positions and weights for the 2D Gauss Legendre integration class

1590  {
1591  // Tempoarary storage for the 1D knots and weights
1592  Vector<double> s(NPTS_1D), w(NPTS_1D);
1593  // Call the function to populate the array
1594  Orthpoly::gl_nodes(NPTS_1D, s, w);
1595  int i_fast = 0, i_slow = 0;
1596  for (unsigned i = 0; i < NPTS_1D * NPTS_1D; i++)
1597  {
1598  if (i_fast == NPTS_1D)
1599  {
1600  i_fast = 0;
1601  i_slow++;
1602  }
1603  Knot[i][0] = s[i_fast];
1604  Knot[i][1] = s[i_slow];
1605  Weight[i] = w[i_fast] * w[i_slow];
1606  i_fast++;
1607  }
1608  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RowVector3d w
Definition: Matrix_resize_int.cpp:3
double Weight[NPTS_1D *NPTS_1D]
Definition: integral.h:1557
double Knot[NPTS_1D *NPTS_1D][2]
Array to hold weight and knot points.
Definition: integral.h:1556
RealScalar s
Definition: level1_cplx_impl.h:130
void gl_nodes(const unsigned &Nnode, Vector< double > &x)
Definition: orthpoly.cc:105

References oomph::Orthpoly::gl_nodes(), i, s, w, and ProblemParameters::Weight.

Member Function Documentation

◆ knot()

template<unsigned NPTS_1D>
double oomph::GaussLegendre< 2, NPTS_1D >::knot ( const unsigned i,
const unsigned j 
) const
inlinevirtual

Return coordinate s[j] (j=0) of integration point i.

Implements oomph::Integral.

1572  {
1573  return Knot[i][j];
1574  }
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References i, and j.

◆ nweight()

template<unsigned NPTS_1D>
unsigned oomph::GaussLegendre< 2, NPTS_1D >::nweight ( ) const
inlinevirtual

Number of integration points of the scheme.

Implements oomph::Integral.

1566  {
1567  return Npts;
1568  }
static const unsigned long int Npts
Number of integration points in scheme.
Definition: integral.h:1553

◆ weight()

template<unsigned NPTS_1D>
double oomph::GaussLegendre< 2, NPTS_1D >::weight ( const unsigned i) const
inlinevirtual

Return weight of integration point i.

Implements oomph::Integral.

1578  {
1579  return Weight[i];
1580  }

References i, and ProblemParameters::Weight.

Member Data Documentation

◆ Knot

template<unsigned NPTS_1D>
double oomph::GaussLegendre< 2, NPTS_1D >::Knot[NPTS_1D *NPTS_1D][2]
private

Array to hold weight and knot points.

◆ Npts

template<unsigned NPTS_1D>
const unsigned long int oomph::GaussLegendre< 2, NPTS_1D >::Npts = NPTS_1D * NPTS_1D
staticprivate

Number of integration points in scheme.

◆ Weight

template<unsigned NPTS_1D>
double oomph::GaussLegendre< 2, NPTS_1D >::Weight[NPTS_1D *NPTS_1D]
private

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