Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::qfree Namespace Reference

Namespaces

namespace  internal

Typedefs

template<bool PPoly, typename FloatType, typename IndexType>
using AreaIntegral2D
template<bool PPoly, typename FloatType, typename IndexType>
using EdgeIntegral2D
template<bool PPoly, typename FloatType, typename IndexType>
using VolumeIntegral3D
template<bool PPoly, typename FloatType, typename IndexType>
using LowerIntegral3D
template<typename DataType, int Dim>
using Point

Functions

template<bool PPoly, typename FloatType, typename IndexType>
std::pair< AreaIntegral2D< PPoly, FloatType, IndexType >, EdgeIntegral2D< PPoly, FloatType, IndexType > > integrateMonomialsQFree2D (const geometry::Cell2D< FloatType, IndexType > &cell, IndexType deg)
 Computes the 2D area and edge integrals over a polygonal cell without requiring quadrature points of all monomials up to a fixed degree.
template<bool PPoly, bool Pruning, typename FloatType, typename IndexType>
std::pair< VolumeIntegral3D< PPoly, FloatType, IndexType >, LowerIntegral3D< PPoly, FloatType, IndexType > > integrateMonomialsQFree3D (const geometry::Cell3D< FloatType, IndexType > &elem, IndexType deg)
 Computes the volume and lower-dimensional integrals over a 3D element without quadrature.
template<typename FloatType, typename IndexType, std::size_t Dim>
qrule::QuadratureRule< FloatType, Dim > computeFrugalQuadrature (datastructure::SimplexDataView< Dim, true, FloatType, IndexType > integrals)
template std::pair< AreaIntegral2D< true, double, int32_t >, EdgeIntegral2D< true, double, int32_t > > integrateMonomialsQFree2D< true, double, int32_t > (const geometry::Cell2D< double, int32_t > &cell, int32_t deg)
template std::pair< AreaIntegral2D< false, double, int32_t >, EdgeIntegral2D< false, double, int32_t > > integrateMonomialsQFree2D< false, double, int32_t > (const geometry::Cell2D< double, int32_t > &cell, int32_t deg)
template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > integrateMonomialsQFree3D< true, true, double, int32_t > (const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > integrateMonomialsQFree3D< true, false, double, int32_t > (const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > integrateMonomialsQFree3D< false, true, double, int32_t > (const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > integrateMonomialsQFree3D< false, false, double, int32_t > (const geometry::Cell3D< double, int32_t > &elem, int32_t deg)
template<bool PPoly, bool Pruning, std::size_t Dim, typename FloatType, typename IndexType>
auto integrateMonomialsQFree (const geometry::Cell< Dim, FloatType, IndexType > &elem, IndexType deg)

Typedef Documentation

◆ AreaIntegral2D

template<bool PPoly, typename FloatType, typename IndexType>
using vulpes::qfree::AreaIntegral2D
Initial value:
A class that represents a triangular or square matrix, with optional support for tensor-like multi-di...
Definition tensor.hpp:60

◆ EdgeIntegral2D

template<bool PPoly, typename FloatType, typename IndexType>
using vulpes::qfree::EdgeIntegral2D

◆ LowerIntegral3D

template<bool PPoly, typename FloatType, typename IndexType>
using vulpes::qfree::LowerIntegral3D
Initial value:
A class that represents a tetrahedral matrix or tensor, with optional support for higher-dimensional ...
Definition tensor.hpp:307

◆ Point

template<typename DataType, int Dim>
using vulpes::geometry::Point

◆ VolumeIntegral3D

template<bool PPoly, typename FloatType, typename IndexType>
using vulpes::qfree::VolumeIntegral3D

Function Documentation

◆ computeFrugalQuadrature()

template<typename FloatType, typename IndexType, std::size_t Dim>
qrule::QuadratureRule< FloatType, Dim > vulpes::qfree::computeFrugalQuadrature ( datastructure::SimplexDataView< Dim, true, FloatType, IndexType > integrals)

◆ integrateMonomialsQFree()

template<bool PPoly, bool Pruning, std::size_t Dim, typename FloatType, typename IndexType>
auto vulpes::qfree::integrateMonomialsQFree ( const geometry::Cell< Dim, FloatType, IndexType > & elem,
IndexType deg )

◆ integrateMonomialsQFree2D()

template<bool PPoly, typename FloatType, typename IndexType>
std::pair< AreaIntegral2D< PPoly, FloatType, IndexType >, EdgeIntegral2D< PPoly, FloatType, IndexType > > vulpes::qfree::integrateMonomialsQFree2D ( const geometry::Cell2D< FloatType, IndexType > & cell,
IndexType deg )

Computes the 2D area and edge integrals over a polygonal cell without requiring quadrature points of all monomials up to a fixed degree.

This function calculates the integrals over a 2D polygonal cell for both area and edges up to a given degree. It uses a recursive algorithm based on monomial basis functions, avoiding the need for quadrature points. The result is returned as a pair of AreaIntegral2D and EdgeIntegral2D objects. The template parameter PPoly controls whether the calculations are restricted to polynomial spaces up to a given degree in the sum of exponents of the components.

Template Parameters
PPolyBoolean template parameter indicating whether the polynomial space is truncated. If true, the integrals are calculated for the space \(\mathbb P^k\) (polynomials up to degree deg \( x^i y^j \) where \( i + j \leq \texttt{deg} \) ). If false, it considers all monomials in \( \mathbb Q^k \).
FloatTypeFloating point type (e.g., float, double) used for calculations.
IndexTypeInteger type used for indexing (e.g., int, size_t).
Parameters
[in]cellThe polygonal cell over which the integrals are computed. The vertices of the cell are stored in the vtxs member of the Cell2D object, which is a 2xN matrix where each column is the coordinate of a vertex.
[in]degThe maximum degree of monomials considered for the integrals. The degree is incremented by one for both area and edge integrals in the recursive calculations.
Returns
A std::pair consisting of:
  • AreaIntegral2D: The area integrals of monomials \( x^i y^j\) over the cell, for \( i + j \leq \text{deg} \).
  • EdgeIntegral2D: The edge integrals along each edge of the cell for the same monomials.
Note
: The algorithm loops over each edge (formally each vertex, but in 2D they are practically the same thing) and computes the relative edge integral. We set the origin of the polygon as (0, 0, 0), thus the area integrals can be computed by accumulating the edge integrals (without summing lower area integrals terms)

◆ integrateMonomialsQFree2D< false, double, int32_t >()

template std::pair< AreaIntegral2D< false, double, int32_t >, EdgeIntegral2D< false, double, int32_t > > vulpes::qfree::integrateMonomialsQFree2D< false, double, int32_t > ( const geometry::Cell2D< double, int32_t > & cell,
int32_t deg )

◆ integrateMonomialsQFree2D< true, double, int32_t >()

template std::pair< AreaIntegral2D< true, double, int32_t >, EdgeIntegral2D< true, double, int32_t > > vulpes::qfree::integrateMonomialsQFree2D< true, double, int32_t > ( const geometry::Cell2D< double, int32_t > & cell,
int32_t deg )

◆ integrateMonomialsQFree3D()

template<bool PPoly, bool Pruning, typename FloatType, typename IndexType>
std::pair< VolumeIntegral3D< PPoly, FloatType, IndexType >, LowerIntegral3D< PPoly, FloatType, IndexType > > vulpes::qfree::integrateMonomialsQFree3D ( const geometry::Cell3D< FloatType, IndexType > & elem,
IndexType deg )

Computes the volume and lower-dimensional integrals over a 3D element without quadrature.

This function calculates volume integrals (VolumeIntegral3D) and lower-dimensional integrals (LowerIntegral3D) for the given 3D element using an analytical, quadrature-free approach. The calculations involve evaluating integrals over edges and faces of the element using monomial expansions up to a specified degree. The template allows handling different configurations for polynomials of space \( \mathbb{P}^k \) or \( \mathbb{Q}^k \) (PPoly)

Template Parameters
PPolyA boolean template parameter to indicate if the function is using monomials of the space \( \mathbb{P}^k \). If true, the function skips monomials where the sum of exponents is exceeding the degree.
PruningA boolean template parameter to indicate if the edge pruning is applied. In order to apply it, it is necessary to assess the topology of the cell and do suitable pre-computations. The optimal choice of pre-computations is an open problem. For more details on the algorithm see Radley, Houston & Hubbard (2023). For an example heuristic see the Cell class.
FloatTypeThe floating-point type used for computations (e.g., float, double).
IndexTypeThe type used for indexing (typically an integer type).
Parameters
elemA constant reference to the Cell3D<FloatType, IndexType> object, which defines the 3D element, including its vertices (coords), edges (edges), faces (faces), and other structural details.
degThe degree of the polynomial or monomial expansions used for computing the integrals.
Returns
A pair of integrals:
Note
The algorithm is composed by two steps:
  1. Caching of needed quantities (e.g. edge - vertex distances)
  2. Integrals computations

The integrals are computed in a non-recursive manner, starting for the vertices, then edges, faces and finally volume. The center \( x_0 \) of the entities defining the polyhedron is chosen to be a vertex of the entity itself for edges and faces, and the origin (0, 0, 0) for the volume. The reason is that this allows for pruning of edge integrals in the computation of face integrals. Since the faces integrals are often needed, instead of pruning the face integrals during the computation of the volume integral, it is more convenient to avoid the sum of lower order monomials for the volume. Indeed this approach is a merge of Chin & Sukumar work (which is non-recursive) and the pruning technique proposed by Radley, Houston & Hubbard.

Several other modifications are applied in order to enhance efficiency. For more details see the comments in the source code.

References:

  • Chin, Eric B., Jean B. Lasserre, and N. Sukumar. "Numerical integration of homogeneous functions on convex and nonconvex polygons and polyhedra." Computational Mechanics 56 (2015): 967-981.
  • Antonietti, Paola F., Paul Houston, and Giorgio Pennesi. "Fast numerical integration on polytopic meshes with applications to discontinuous Galerkin finite element methods." Journal of Scientific Computing 77.3 (2018): 1339-1370.
  • Chin, Eric B., and N. Sukumar. "An efficient method to integrate polynomials over polytopes and curved solids." Computer Aided Geometric Design 82 (2020): 101914.
  • Radley, Thomas J., Paul Houston, and Matthew E. Hubbard. "Quadrature-free polytopic discontinuous Galerkin methods for transport problems." arXiv preprint arXiv:2310.10406 (2023).

◆ integrateMonomialsQFree3D< false, false, double, int32_t >()

template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > vulpes::qfree::integrateMonomialsQFree3D< false, false, double, int32_t > ( const geometry::Cell3D< double, int32_t > & elem,
int32_t deg )

◆ integrateMonomialsQFree3D< false, true, double, int32_t >()

template std::pair< VolumeIntegral3D< false, double, int32_t >, LowerIntegral3D< false, double, int32_t > > vulpes::qfree::integrateMonomialsQFree3D< false, true, double, int32_t > ( const geometry::Cell3D< double, int32_t > & elem,
int32_t deg )

◆ integrateMonomialsQFree3D< true, false, double, int32_t >()

template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > vulpes::qfree::integrateMonomialsQFree3D< true, false, double, int32_t > ( const geometry::Cell3D< double, int32_t > & elem,
int32_t deg )

◆ integrateMonomialsQFree3D< true, true, double, int32_t >()

template std::pair< VolumeIntegral3D< true, double, int32_t >, LowerIntegral3D< true, double, int32_t > > vulpes::qfree::integrateMonomialsQFree3D< true, true, double, int32_t > ( const geometry::Cell3D< double, int32_t > & elem,
int32_t deg )