Flow123d  master-f44eb46
Public Member Functions | Protected Attributes | List of all members
Quadrature Class Reference

Base class for quadrature rules on simplices in arbitrary dimensions. More...

#include <quadrature.hh>

Inheritance diagram for Quadrature:
Inheritance graph
[legend]
Collaboration diagram for Quadrature:
Collaboration graph
[legend]

Public Member Functions

 Quadrature (const Quadrature &q)
 Copy constructor. More...
 
 Quadrature (unsigned int dimension, unsigned int n_quadrature_points=0)
 Constructor. More...
 
virtual ~Quadrature ()
 Constructor from quadrature of lower dimension (e.g. for side integration). More...
 
unsigned int dim () const
 
void resize (unsigned int n_q_points)
 Modify the number of quadrature points. More...
 
unsigned int size () const
 Returns number of quadrature points. More...
 
template<unsigned int point_dim>
Armor::ArmaVec< double, point_dim > point (unsigned int i) const
 Returns the ith quadrature point. More...
 
Armor::Array< double >::ArrayMatSet set (uint i)
 
const Armor::Array< double > & get_points () const
 Return a reference to the whole array of quadrature points. More...
 
double weight (unsigned int i) const
 Returns the ith weight. More...
 
double & weight (unsigned int i)
 Returns the ith weight (non-const version). More...
 
const std::vector< double > & get_weights () const
 Return a reference to the whole array of weights. More...
 
Quadratureoperator= (const Quadrature &q)
 
template<unsigned int bulk_dim>
Quadrature make_from_side (unsigned int sid) const
 
template<>
Quadrature make_from_side (FMT_UNUSED unsigned int sid) const
 
template<>
Quadrature make_from_side (unsigned int sid) const
 
template<>
Armor::ArmaVec< double, 0 > point (unsigned int i) const
 

Protected Attributes

const unsigned int dim_
 Dimension of quadrature points. More...
 
Armor::Array< double > quadrature_points
 List of quadrature points. More...
 
std::vector< double > weights
 List of weights to the quadrature points. More...
 

Detailed Description

Base class for quadrature rules on simplices in arbitrary dimensions.

This class stores quadrature points and weights on the reference line, triangle or tetrahedron, respectively. Quadrature rules are used for evaluation of integrals over elements. In particular, for a reference element $E$ we have:

\[ \int_E f(x)\,dx \approx \sum_{i=1}^{N} w_i f(p_i), \]

where $\{w_i\}$, $\{p_i\}$ are the quadrature weights and the quadrature points, respectively.

TODO:

Definition at line 48 of file quadrature.hh.

Constructor & Destructor Documentation

◆ Quadrature() [1/2]

Quadrature::Quadrature ( const Quadrature q)

Copy constructor.

Definition at line 39 of file quadrature.cc.

Here is the caller graph for this function:

◆ Quadrature() [2/2]

Quadrature::Quadrature ( unsigned int  dimension,
unsigned int  n_quadrature_points = 0 
)

Constructor.

Parameters
n_quadrature_pointsNumber of quadrature points to be allocated.

Definition at line 32 of file quadrature.cc.

◆ ~Quadrature()

virtual Quadrature::~Quadrature ( )
inlinevirtual

Constructor from quadrature of lower dimension (e.g. for side integration).

Parameters
sub_quadraturelower dimensional (dim-1) quadrature
sidlocal index of side Virtual destructor.

Definition at line 68 of file quadrature.hh.

Member Function Documentation

◆ dim()

unsigned int Quadrature::dim ( ) const
inline

Definition at line 72 of file quadrature.hh.

Here is the caller graph for this function:

◆ get_points()

const Armor::Array<double>& Quadrature::get_points ( ) const
inline

Return a reference to the whole array of quadrature points.

Definition at line 99 of file quadrature.hh.

Here is the caller graph for this function:

◆ get_weights()

const std::vector<double>& Quadrature::get_weights ( ) const
inline

Return a reference to the whole array of weights.

Definition at line 111 of file quadrature.hh.

◆ make_from_side() [1/3]

template<>
Quadrature Quadrature::make_from_side ( FMT_UNUSED unsigned int  sid) const

Definition at line 70 of file quadrature.cc.

◆ make_from_side() [2/3]

template<>
template Quadrature Quadrature::make_from_side< 3 > ( unsigned int  sid) const

Definition at line 77 of file quadrature.cc.

◆ make_from_side() [3/3]

template<unsigned int bulk_dim>
Quadrature Quadrature::make_from_side ( unsigned int  sid) const

Create bulk quadrature from side quadrature.

Consider *this as quadrature on a side of an element and create higher dimensional quadrature considering side index.

Definition at line 47 of file quadrature.cc.

Here is the caller graph for this function:

◆ operator=()

Quadrature & Quadrature::operator= ( const Quadrature q)

Definition at line 23 of file quadrature.cc.

◆ point() [1/2]

template<unsigned int point_dim>
Armor::ArmaVec< double, point_dim > Quadrature::point ( unsigned int  i) const
inline

Returns the ith quadrature point.

Definition at line 151 of file quadrature.hh.

Here is the caller graph for this function:

◆ point() [2/2]

template<>
Armor::ArmaVec<double, 0> Quadrature::point ( unsigned int  i) const
inline

Definition at line 151 of file quadrature.hh.

◆ resize()

void Quadrature::resize ( unsigned int  n_q_points)
inline

Modify the number of quadrature points.

Parameters
n_q_pointsNew number of quadrature points.

Definition at line 79 of file quadrature.hh.

◆ set()

Armor::Array<double>::ArrayMatSet Quadrature::set ( uint  i)
inline

Definition at line 93 of file quadrature.hh.

Here is the caller graph for this function:

◆ size()

unsigned int Quadrature::size ( ) const
inline

Returns number of quadrature points.

Definition at line 86 of file quadrature.hh.

Here is the caller graph for this function:

◆ weight() [1/2]

double& Quadrature::weight ( unsigned int  i)
inline

Returns the ith weight (non-const version).

Definition at line 107 of file quadrature.hh.

◆ weight() [2/2]

double Quadrature::weight ( unsigned int  i) const
inline

Returns the ith weight.

Definition at line 103 of file quadrature.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ dim_

const unsigned int Quadrature::dim_
protected

Dimension of quadrature points.

Definition at line 129 of file quadrature.hh.

◆ quadrature_points

Armor::Array<double> Quadrature::quadrature_points
protected

List of quadrature points.

To be filled by the constructors of the derived classes.

Definition at line 136 of file quadrature.hh.

◆ weights

std::vector<double> Quadrature::weights
protected

List of weights to the quadrature points.

To be filled by the constructors of the derived classes.

Definition at line 143 of file quadrature.hh.


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