Loading...
Searching...
No Matches
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 `c`th corner of the standard simplex with the same dimension as `Coordinate`.

Parameters

  c | corner number

Returns
  coordinate of `c`th 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

  edge | edge 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

  x | coordinates of point to check
  epsilon | tolerance used for floating-point comparisons

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 euclidean coordinates.

This function converts barycentric coordinates `x` with respect to the triangle with corners `corners` to euclidean 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

  x | barycentric coordinates
  corners | coordinates or normals at the corners

Returns
  euclidean 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

  x | barycentric coordinates
  normals | unit normals at corners

Returns
  unit normal at `x` \seealso interpolate(const Coordinate&, const Corners&)