OGS
NumLib::IntegrationGaussLegendreTri Class Reference

Detailed Description

Gauss-Legendre quadrature rule for triangles.

Gauss-Legendre quadrature rule for triangles is originally given as

\[ \int F(x,y) dx dy = \int F(x(r, s), y(r, s)) j(r,s) dr ds \approx \frac{1}{2} \sum_i ( F(x(r_i, s_i), y(r_i, s_i)) w_i ) \]

To make it consistent with other elements, we rewrite the above formula as

\[ \int F(x,y) dx dy \approx \sum_i ( F(x(r_i, s_i), y(r_i, s_i)) w'_i ) \]

by defining the new weight \( w'=\frac{1}{2} w \).

Definition at line 26 of file IntegrationGaussLegendreTri.h.

#include <IntegrationGaussLegendreTri.h>

Public Member Functions

 IntegrationGaussLegendreTri (unsigned order=2)
void setIntegrationOrder (unsigned order)
 Change the integration order.
unsigned getIntegrationOrder () const
 return current integration order.
unsigned getNumberOfPoints () const
 return the number of sampling points
MathLib::WeightedPoint getWeightedPoint (unsigned const igp) const

Static Public Member Functions

static MathLib::WeightedPoint getWeightedPoint (unsigned const order, unsigned const igp)
template<typename Method>
static MathLib::WeightedPoint getWeightedPoint (unsigned const igp)
static unsigned getNumberOfPoints (unsigned order)

Private Attributes

unsigned _order
unsigned _n_sampl_pt {0}

Constructor & Destructor Documentation

◆ IntegrationGaussLegendreTri()

NumLib::IntegrationGaussLegendreTri::IntegrationGaussLegendreTri ( unsigned order = 2)
inlineexplicit

Construct this object with the given integration order

Parameters
orderintegration order (default 2)

Definition at line 34 of file IntegrationGaussLegendreTri.h.

34 : _order(order)
35 {
36 this->setIntegrationOrder(order);
37 }
void setIntegrationOrder(unsigned order)
Change the integration order.

References _order, and setIntegrationOrder().

Member Function Documentation

◆ getIntegrationOrder()

unsigned NumLib::IntegrationGaussLegendreTri::getIntegrationOrder ( ) const
inline

return current integration order.

Definition at line 47 of file IntegrationGaussLegendreTri.h.

47{ return _order; }

References _order.

Referenced by getWeightedPoint().

◆ getNumberOfPoints() [1/2]

unsigned NumLib::IntegrationGaussLegendreTri::getNumberOfPoints ( ) const
inline

return the number of sampling points

Definition at line 50 of file IntegrationGaussLegendreTri.h.

References _n_sampl_pt.

Referenced by setIntegrationOrder().

◆ getNumberOfPoints() [2/2]

unsigned NumLib::IntegrationGaussLegendreTri::getNumberOfPoints ( unsigned order)
inlinestatic

get the number of integration points

Parameters
orderthe number of integration points
Returns
the number of points

Definition at line 99 of file IntegrationGaussLegendreTri.h.

100 {
101 switch (order)
102 {
103 case 1:
105 case 2:
107 case 3:
109 case 4:
111 }
112 OGS_FATAL("Integration order {:d} not implemented for triangles.",
113 order);
114 }
#define OGS_FATAL(...)
Definition Error.h:19
static MATHLIB_EXPORT const unsigned NPoints

References MathLib::GaussLegendreTri< ORDER >::NPoints, and OGS_FATAL.

◆ getWeightedPoint() [1/3]

template<typename Method>
MathLib::WeightedPoint NumLib::IntegrationGaussLegendreTri::getWeightedPoint ( unsigned const igp)
inlinestatic

Definition at line 88 of file IntegrationGaussLegendreTri.h.

89 {
90 return MathLib::WeightedPoint(Method::X[igp], 0.5 * Method::W[igp]);
91 }

◆ getWeightedPoint() [2/3]

MathLib::WeightedPoint NumLib::IntegrationGaussLegendreTri::getWeightedPoint ( unsigned const igp) const
inline

get coordinates of a integration point

Parameters
igpThe integration point index
Returns
a weighted point

Definition at line 58 of file IntegrationGaussLegendreTri.h.

59 {
61 }
unsigned getIntegrationOrder() const
return current integration order.
MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const

References getIntegrationOrder(), and getWeightedPoint().

Referenced by getWeightedPoint(), and getWeightedPoint().

◆ getWeightedPoint() [3/3]

MathLib::WeightedPoint NumLib::IntegrationGaussLegendreTri::getWeightedPoint ( unsigned const order,
unsigned const igp )
inlinestatic

get coordinates of a integration point

Parameters
orderthe number of integration points
igpthe sampling point id
Returns
weight

Definition at line 70 of file IntegrationGaussLegendreTri.h.

71 {
72 switch (order)
73 {
74 case 1:
76 case 2:
78 case 3:
80 case 4:
82 }
83 OGS_FATAL("Integration order {:d} not implemented for triangles.",
84 order);
85 }

References getWeightedPoint(), and OGS_FATAL.

◆ setIntegrationOrder()

void NumLib::IntegrationGaussLegendreTri::setIntegrationOrder ( unsigned order)
inline

Change the integration order.

Definition at line 40 of file IntegrationGaussLegendreTri.h.

41 {
42 _order = order;
44 }
unsigned getNumberOfPoints() const
return the number of sampling points

References _n_sampl_pt, _order, and getNumberOfPoints().

Referenced by IntegrationGaussLegendreTri().

Member Data Documentation

◆ _n_sampl_pt

unsigned NumLib::IntegrationGaussLegendreTri::_n_sampl_pt {0}
private

Definition at line 118 of file IntegrationGaussLegendreTri.h.

118{0};

Referenced by getNumberOfPoints(), and setIntegrationOrder().

◆ _order

unsigned NumLib::IntegrationGaussLegendreTri::_order
private

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