dune-grid-glue  2.9
Functions
Dune::GridGlue::ProjectionImplementation Namespace Reference

Functions

template<typename Coordinate , typename Field >
Coordinate corner (unsigned c)
 
std::pair< unsigned, unsigned > edgeToCorners (unsigned edge)
 
template<typename Coordinate , typename Corners >
Corners::value_type interpolate (const Coordinate &x, const Corners &corners)
 
template<typename Coordinate , typename Normals >
Normals::value_type interpolate_unit_normals (const Coordinate &x, const Normals &normals)
 
template<typename Coordinate , typename Field >
bool inside (const Coordinate &x, const Field &epsilon)
 

Function Documentation

◆ corner()

template<typename Coordinate , typename Field >
Coordinate Dune::GridGlue::ProjectionImplementation::corner ( unsigned  c)
inline

Return corner coordinates of a simplex.

Given the number c of a corner, this function returns the coordinate of the cth corner of the standard simplex with the same dimension as Coordinate.

Parameters
ccorner number
Returns
coordinate of cth corner of the standard simplex

◆ edgeToCorners()

std::pair<unsigned, unsigned> Dune::GridGlue::ProjectionImplementation::edgeToCorners ( unsigned  edge)
inline

Translate edge to corner numbers.

Given the number edge of an edge of a triangle, this function returns the number of the corners belonging to it.

Parameters
edgeedge number of a triangle
Returns
numbers of corners of the edge

◆ inside()

template<typename Coordinate , typename Field >
bool Dune::GridGlue::ProjectionImplementation::inside ( const Coordinate &  x,
const Field &  epsilon 
)
inline

Check if the point x is inside the standard simplex.

This functions checks if the point x is in the inside (or on the boundary) of the standard simplex, that is xᵢ ≥ 0 and ∑ xᵢ ≤ 1.

Parameters
xcoordinates of point to check
epsilontolerance used for floating-point comparisions
Returns
true if x is inside, false otherwise

◆ interpolate()

template<typename Coordinate , typename Corners >
Corners::value_type Dune::GridGlue::ProjectionImplementation::interpolate ( const Coordinate &  x,
const Corners &  corners 
)
inline

Convert barycentric coordinates to euclidian coordinates.

This function converts barycentric coordinates x with respect to the triangle with corners corners to euclidian coordinates. For the result y the following equation holds: yᵢ = (cornersᵢ₊₁ - corners₀) xᵢ

Note that this can also be for linear interpolation of normals given on the corners, but this does not preserve the norm (e.g. for unit normals).

Parameters
xbarycentric coordinates
cornerscoordinates or normals at the corners
Returns
euclidian coordinates or interpolated normal

◆ interpolate_unit_normals()

template<typename Coordinate , typename Normals >
Normals::value_type Dune::GridGlue::ProjectionImplementation::interpolate_unit_normals ( const Coordinate &  x,
const Normals &  normals 
)
inline

Interpolate between unit normals on corners of a simplex.

This functions interpolates between unit normals given on corners of a simplex using linear interpolation.

Parameters
xbarycentric coordinates
normalsunit normals at corners
Returns
unit normal at x \seealso interpolate(const Coordinate&, const Corners&)