LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
lf::quad Namespace Reference

Rules for numerical quadrature on reference entity shapes. More...

Classes

class  QuadRule
 Represents a Quadrature Rule over one of the Reference Elements. More...
 
class  QuadRuleCache
 A cache for make_QuadRule() More...
 

Typedefs

using quadDegree_t = unsigned int
 

Functions

std::tuple< Eigen::VectorXd, Eigen::VectorXd > GaussLegendre (unsigned num_points)
 
std::tuple< Eigen::VectorXd, Eigen::VectorXd > GaussJacobi (quadDegree_t num_points, double alpha, double beta)
 Computes the quadrature points and weights for the interval [-1,1] of a Gauss-Jacobi quadrature rule with weight function \( (1-x)^\alpha (1+x)^\beta \).
 
std::tuple< Eigen::VectorXd, Eigen::VectorXd > GaussLegendre (unsigned int num_points)
 Computes the quadrature points and weights for the interval [0,1] of a Gauss-Legendre quadrature rule using a newton algorithm.
 
QuadRule make_QuadRule (base::RefEl ref_el, unsigned degree)
 Returns a QuadRule object for the given Reference Element and Degree.
 
QuadRule make_TriaQR_MidpointRule ()
 midpoint quadrature rule for triangles
 
QuadRule make_TriaQR_EdgeMidpointRule ()
 edge midpoint quadrature rule for reference triangles
 
QuadRule make_QuadQR_EdgeMidpointRule ()
 edge midpoint quadrature rule for unit square (= reference quad)
 
QuadRule make_TriaQR_P6O4 ()
 Six point triangular quadrature rule of order 4.
 
QuadRule make_TriaQR_P7O6 ()
 Seven point triangular quadrature rule of order 6.
 
QuadRule make_TriaQR_P1O2 ()
 
QuadRule make_TriaQR_P3O3 ()
 
QuadRule make_QuadQR_MidpointRule ()
 midpoint quadrature rule for quadrilaterals
 
QuadRule make_QuadQR_P1O2 ()
 
QuadRule make_QuadQR_P4O2 ()
 
QuadRule make_QuadQR_P4O4 ()
 Fourth-order tensor product Gauss rule for quadrilaterals.
 
QuadRule make_QuadRuleNodal (base::RefEl ref_el)
 Create a quadrature rule that evaluates the quadrand only at the nodes of the reference element.
 
std::ostream & operator<< (std::ostream &stream, const lf::quad::QuadRule &quadrule)
 Output operator for quadrature rules.
 

Detailed Description

Rules for numerical quadrature on reference entity shapes.

Quadrature rules are specified by

Refer to Lecture Document Paragraph 2.7.5.39.

Typedef Documentation

◆ quadDegree_t

using lf::quad::quadDegree_t = unsigned int

Definition at line 19 of file quad_rule.h.

Function Documentation

◆ GaussJacobi()

std::tuple< Eigen::VectorXd, Eigen::VectorXd > lf::quad::GaussJacobi ( quadDegree_t num_points,
double alpha,
double beta )

Computes the quadrature points and weights for the interval [-1,1] of a Gauss-Jacobi quadrature rule with weight function \( (1-x)^\alpha (1+x)^\beta \).

Parameters
num_pointsThe number of points/weights that should be used.
alphaThe exponent of the weight function
betaThe exponent of the weight function
Returns
The nodes(first) and weights(second) of the quadrature rule

Definition at line 71 of file gauss_quadrature.cc.

Referenced by make_QuadRule().

◆ GaussLegendre() [1/2]

std::tuple< Eigen::VectorXd, Eigen::VectorXd > lf::quad::GaussLegendre ( unsigned int num_points)

Computes the quadrature points and weights for the interval [0,1] of a Gauss-Legendre quadrature rule using a newton algorithm.

Parameters
num_pointsThe number of points/weights that should be used.
Returns
The nodes (first) and weights(second) of the quadrature rule.

◆ GaussLegendre() [2/2]

std::tuple< Eigen::VectorXd, Eigen::VectorXd > lf::quad::GaussLegendre ( unsigned num_points)

Definition at line 16 of file gauss_quadrature.cc.

Referenced by make_QuadRule().

◆ make_QuadRule()

QuadRule lf::quad::make_QuadRule ( base::RefEl ref_el,
unsigned degree )

Returns a QuadRule object for the given Reference Element and Degree.

Parameters
ref_elThe type of reference element
degreeThe minimum degree that the QuadRule object should have.
Returns
A QuadRule object for the given reference element and with a degree >= degree

This method tries to return optimal quadrature rules when possible:

  • For Segments it returns Gauss-Legendre quadrature rules
  • For Triangles, it returns specific, hard-coded quadrature rules up to order 50, afterwards, the Duffy-Transform to map a tensor Gaussian Quadrature on a Square to the triangle.
  • For Quadrilaterals it uses tensor products of Gauss-Legendre rules

Definition at line 21 of file make_quad_rule.cc.

References GaussJacobi(), GaussLegendre(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), and lf::base::RefEl::kTria().

Referenced by lf::geometry::test_utils::checkChildGeometryVolume(), lf::quad::QuadRuleCache::Get(), make_QuadQR_MidpointRule(), make_QuadQR_P4O4(), lf::uscalfe::ReactionDiffusionElementMatrixProvider< SCALAR, DIFF_COEFF, REACTION_COEFF >::ReactionDiffusionElementMatrixProvider(), and lf::uscalfe::ScalarLoadElementVectorProvider< SCALAR, MESH_FUNCTION >::ScalarLoadElementVectorProvider().

◆ make_QuadRuleNodal()

QuadRule lf::quad::make_QuadRuleNodal ( base::RefEl ref_el)

Create a quadrature rule that evaluates the quadrand only at the nodes of the reference element.

Parameters
ref_elThe reference element for which the quadrule is.
Returns
A quadrature rule of order 1.

Definition at line 14 of file make_quad_rule_nodal.cc.

References lf::base::RefEl::kTria(), lf::base::RefEl::NodeCoords(), and lf::base::RefEl::NumNodes().

◆ operator<<()

std::ostream & lf::quad::operator<< ( std::ostream & stream,
const lf::quad::QuadRule & quadrule )

Output operator for quadrature rules.

Parameters
streamThe stream to which this function should output
quadrulethe quadrature rule to be printed
Returns
The stream itself.
See also
QuadRule::PrintInfo()

Definition at line 19 of file quad_rule.cc.

References lf::quad::QuadRule::PrintInfo().