Loading...
Searching...
No Matches
Dune::GridGlue::Projection< Coordinate > Class Template Reference

Projection of a line (triangle) on another line (triangle). More...

`#include <dune/grid-glue/common/projection.hh>`

## Classes

struct | EdgeIntersection
| Intersection between two edges of a triangle. More...

## Public Types

typedef Coordinate::field_type | Field
| Scalar type.
typedef std::array< Coordinate, dim > | Images
| List of corner images.
typedef Images | Preimages

## Public Member Functions

| Projection (const Field overlap=Field(0), const Field max_normal_product=Field(-0.1))
void | epsilon (const Field epsilon)
| Set epsilon used for floating-point comparisons.
template<typename Corners, typename Normals>
void | project (const std::tuple< Corners &, Corners & > &corners, const std::tuple< Normals &, Normals & > &normals)
| Do the actual projection.
const std::tuple< Images, Preimages > & | images () const
| Images and preimages of corners.
const std::tuple< std::bitset< dim >, std::bitset< dim > > & | success () const
| Indicate whether projection (inverse projection) is valid for each corner or not.
unsigned | numberOfEdgeIntersections () const
| Number of edge intersections.
const std::array< EdgeIntersection, maxEdgeIntersections > & | edgeIntersections () const
| Edge-edge intersections.

## Static Public Attributes

static constexpr unsigned | dim = Coordinate::dimension
| dimension of coordinates
static constexpr unsigned | maxEdgeIntersections = dim == 3 ? 9 : 0
| maximum number of edge-edge intersections

## Detailed Description

template<typename Coordinate>
class Dune::GridGlue::Projection< Coordinate >

Projection of a line (triangle) on another line (triangle).

This class implements methods to project a line (2d) or triangle (3d) on another line (triangle) along normal field given by values at the corners.

## Member Typedef Documentation

## Field

template<typename Coordinate>

typedef Coordinate::field_type Dune::GridGlue::Projection< Coordinate >::Field

Scalar type.

## Images

template<typename Coordinate>

typedef std::array<Coordinate, dim> Dune::GridGlue::Projection< Coordinate >::Images

List of corner images.

This type is used to return the list of images Φ(xᵢ) of the corners xᵢ in barycentric coordinates with respect to the image simplex. The last entry is used to return the (signed) distance along the normal.

## Preimages

template<typename Coordinate>

typedef Images Dune::GridGlue::Projection< Coordinate >::Preimages

List of corner preimages.

This is used as Images, but for the preimages Φ⁻¹(yᵢ) of the corners yᵢ of the image simplex.

## Constructor & Destructor Documentation

## Projection()

template<typename Coordinate>

Dune::GridGlue::Projection< Coordinate >::Projection | ( | const Field | overlap = Field(0),
|  | const Field | max_normal_product = Field(-0.1) )

Parameters

  overlap | allowed overlap
  max_normal_product | maximum value for scalar product ν(x)·ν(Φ(x))

## Member Function Documentation

## edgeIntersections()

template<typename Coordinate>

const std::array< EdgeIntersection, maxEdgeIntersections > & Dune::GridGlue::Projection< Coordinate >::edgeIntersections | ( |  | ) | const

inline

Edge-edge intersections.

Note
  project() must be called before this method can be used.

Warning
  Only the first numberOfEdgeIntersections() entries are valid edge intersections.

## epsilon()

template<typename Coordinate>

void Dune::GridGlue::Projection< Coordinate >::epsilon | ( | const Field | epsilon | ) |

Set epsilon used for floating-point comparisons.

Parameters

  epsilon | new epsilon used for floating-point comaprisons

## images()

template<typename Coordinate>

const std::tuple< Images, Preimages > & Dune::GridGlue::Projection< Coordinate >::images | ( |  | ) | const

inline

Images and preimages of corners.

Returns a pair of arrays. The first array contains the images `Φ(xᵢ)` of the corners `xᵢ`. The second array contains the preimages `Φ⁻¹(yⱼ)` of the corners `yⱼ`.

The first d-1 values are the barycentric coordinates with respect to the corners of the (pre)image, the last value is the signed distance between the projected point and its (pre)image along the normal at the projected preimage corner or the inverse projected image corner.

Note
  project() must be called before this method can be used.

Returns
  pair of arrays giving `((Φ(xᵢ))ᵢ, (Φ⁻¹(yⱼ))ⱼ)` in barycentric coordinates

success()

## numberOfEdgeIntersections()

template<typename Coordinate>

unsigned Dune::GridGlue::Projection< Coordinate >::numberOfEdgeIntersections | ( |  | ) | const

inline

Number of edge intersections.

Note
  project() must be called before this method can be used.

edgeIntersections()

## project()

template<typename Coordinate>
template<typename Corners, typename Normals>

void Dune::GridGlue::Projection< Coordinate >::project | ( | const std::tuple< Corners &, Corners & > & | corners,
|  | const std::tuple< Normals &, Normals & > & | normals )

Do the actual projection.

Parameters

  corners | euclidean coordinates of corners of preimage and image
  normals | normals at corners of preimage and image

Template Parameters

  Corners | list of corner coordinates, should be `std::vector<Coordinate>` or `std::array<Coordinate, n>`
  Normals | list of corner normals, should be `std::vector<Coordinate>` or `std::array<Coordinate, n>`

## success()

template<typename Coordinate>

const std::tuple< std::bitset< dim >, std::bitset< dim > > & Dune::GridGlue::Projection< Coordinate >::success | ( |  | ) | const

inline

Indicate whether projection (inverse projection) is valid for each corner or not.

Returns a pair of bitsets. The first bitset indicates if the projection `Φ(xᵢ)` is valid for each corner `xᵢ`, that is that `Φ(xᵢ)` could be computed and lies in the image simplex. The second bitset indicates the same for the inverse projection `Φ⁻¹(yⱼ)` for the corners `yⱼ`.

Note
  project() must be called before this method can be used.

Returns
  pair of bitsets indicating success of (inverse) projection at corners `xᵢ` (`yⱼ`)

## Member Data Documentation

## dim

template<typename Coordinate>

unsigned Dune::GridGlue::Projection< Coordinate >::dim = Coordinate::dimension

static constexpr

dimension of coordinates

## maxEdgeIntersections

template<typename Coordinate>

unsigned Dune::GridGlue::Projection< Coordinate >::maxEdgeIntersections = dim == 3 ? 9 : 0

static constexpr

maximum number of edge-edge intersections

See also \seealso edgeIntersections()

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

- projection.hh
- projection_impl.hh