OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::TriangleQuadrature< NumericReturnType, T > Class Template Reference

A class for integrating a function using numerical quadrature over triangular domains. More...

#include <TriangleQuadrature.hpp>

Static Public Member Functions

static NumericReturnType Integrate (const std::function< NumericReturnType(const Vector< T, 2 > &)> &f, const TriangleQuadratureRule &rule, const T &area)
 Numerically integrates the function f over a triangle using the given quadrature rule and the initial value.
 
static NumericReturnType Integrate (const std::function< NumericReturnType(const Vector< T, 3 > &)> &f, const TriangleQuadratureRule &rule, const T &area)
 Alternative signature for Integrate() that uses three-dimensional barycentric coordinates.
 

Detailed Description

template<typename NumericReturnType, typename T>
class OpenMD::TriangleQuadrature< NumericReturnType, T >

A class for integrating a function using numerical quadrature over triangular domains.

Template Parameters
NumericReturnTypethe output type of the function being integrated. Commonly will be a IEEE floating point scalar (e.g., double), but could be a VectorXd, or any other numeric type that supports both scalar multiplication (i.e., operator*(const NumericReturnType&, double) and addition with another of the same type (i.e., operator+(const NumericReturnType&, const NumericReturnType&)).
Tthe scalar type of the function being integrated over. Supported types are currently only IEEE floating point scalars.

Definition at line 35 of file TriangleQuadrature.hpp.

Member Function Documentation

◆ Integrate() [1/2]

template<typename NumericReturnType , typename T >
NumericReturnType OpenMD::TriangleQuadrature< NumericReturnType, T >::Integrate ( const std::function< NumericReturnType(const Vector< T, 2 > &)> & f,
const TriangleQuadratureRule & rule,
const T & area )
static

Numerically integrates the function f over a triangle using the given quadrature rule and the initial value.

Parameters
f(p)a function that returns a numerical value for point p in the domain of the triangle, specified in barycentric coordinates. The barycentric coordinates are given by (p[0], p[1], 1 - p[0] - p[1]).
areathe area of the triangle.

Definition at line 61 of file TriangleQuadrature.hpp.

References OpenMD::TriangleQuadratureRule::quadrature_points(), and OpenMD::TriangleQuadratureRule::weights().

◆ Integrate() [2/2]

template<typename NumericReturnType , typename T >
NumericReturnType OpenMD::TriangleQuadrature< NumericReturnType, T >::Integrate ( const std::function< NumericReturnType(const Vector< T, 3 > &)> & f,
const TriangleQuadratureRule & rule,
const T & area )
static

Alternative signature for Integrate() that uses three-dimensional barycentric coordinates.

Parameters
f(p)a function that returns a numerical value for point p in the domain of the triangle, specified in barycentric coordinates. The barycentric coordinates are given by (p[0], p[1], p[2]).
areathe area of the triangle.

Definition at line 88 of file TriangleQuadrature.hpp.


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