dune-grid-glue  2.3.0
Classes | Functions
Projection Namespace Reference

This namespace contains helper functions for the projection of two triangular surface on each other. More...

Classes

class  EdgeIntersectionHelper
 Helper class that provides static methods for the computation of the intersection of surface element edges projected onto each other. More...
 
class  EdgeIntersectionHelper< 1, 2, T >
 
class  EdgeIntersectionHelper< 2, 3, T >
 
class  ProjectionHelper
 Helper class that provides static methods to compute the projection and inverse projection of a point along some given directions. More...
 
class  ProjectionHelper< 1, 2, T >
 
class  ProjectionHelper< 2, 3, T >
 

Functions

template<class T , int dim>
static Dune::FieldVector< T, dim > crossProduct (const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
 Compute the cross product of two vectors. More...
 
template<int dim, int dimworld, class T >
static bool projection (const Dune::FieldVector< T, dimworld > &corner, const Dune::FieldVector< T, dimworld > &direction, const std::vector< Dune::FieldVector< T, dimworld > > &targetCorners, Dune::FieldVector< T, dim > &image, const T overlap=1e-1)
 Compute the projection of a point along a given direction into the convex hull of some target points. More...
 
template<int dim, int dimworld, class T >
static bool inverseProjection (const std::vector< Dune::FieldVector< T, dimworld > > &corners, const std::vector< Dune::FieldVector< T, dimworld > > &directions, const Dune::FieldVector< T, dimworld > &target, Dune::FieldVector< T, dim > &preImage, const T overlap=1e-1)
 Compute the inverse projection of a point onto some surface element where the projection is done across directions which are associated to corners of an surface element. More...
 
template<int dim, int dimworld, class T = double>
static void addEdgeIntersections (const std::vector< Dune::FieldVector< T, dimworld > > &corners1, const std::vector< Dune::FieldVector< T, dimworld > > &corners2, const std::vector< Dune::FieldVector< T, dimworld > > &directions1, const Dune::GeometryType &gt1, const Dune::GeometryType &gt2, std::vector< Dune::array< Dune::FieldVector< T, dim >, 2 > > &polygonCorners, const std::vector< int > &hitCorners, std::bitset<(1<< dim)> &neighborIntersects1, std::bitset<(1<< dim)> &neighborIntersects2, const T overlap=1e-1)
 Compute the projection along given directions of surface element edges onto target edges. More...
 

Detailed Description

This namespace contains helper functions for the projection of two triangular surface on each other.

Function Documentation

template<int dim, int dimworld, class T = double>
static void Projection::addEdgeIntersections ( const std::vector< Dune::FieldVector< T, dimworld > > &  corners1,
const std::vector< Dune::FieldVector< T, dimworld > > &  corners2,
const std::vector< Dune::FieldVector< T, dimworld > > &  directions1,
const Dune::GeometryType &  gt1,
const Dune::GeometryType &  gt2,
std::vector< Dune::array< Dune::FieldVector< T, dim >, 2 > > &  polygonCorners,
const std::vector< int > &  hitCorners,
std::bitset<(1<< dim)> &  neighborIntersects1,
std::bitset<(1<< dim)> &  neighborIntersects2,
const T  overlap = 1e-1 
)
static

Compute the projection along given directions of surface element edges onto target edges.

Parameters
corners1The coordinates of the surface element corners whose edges are projected.
corners2The coordinates of the surface element corners on which is projected.
directions1The directions along which the projection is done.
gt1The geometry type of the projected surface element.
gt2The geometry type of the target surface element.
polygonCornersIf intersection points are found their local coordinates are added to this vector.
hitCornersVector containing information on which surface element corners are projected on each other.
neighborIntersects1If two edges intersect then the corresponding surface element neighbors also intersect. This information for the projected surface element is stored in the bitfield.
neighborIntersects2If two edges intersect then the corresponding surface element neighbors also intersect. This information for the surface element on which is projected is stored in the bitfield.
overlapThe amount of overlap that is allowed, i.e. projection among the opposite direction is valid if the scaling is smaller than overlap.

References Projection::EdgeIntersectionHelper< dim, dimworld, T >::addEdgeIntersections().

template<class T , int dim>
static Dune::FieldVector<T,dim> Projection::crossProduct ( const Dune::FieldVector< T, dim > &  a,
const Dune::FieldVector< T, dim > &  b 
)
static

Compute the cross product of two vectors.

Referenced by Projection::ProjectionHelper< 2, 3, T >::inverseProjection().

template<int dim, int dimworld, class T >
static bool Projection::inverseProjection ( const std::vector< Dune::FieldVector< T, dimworld > > &  corners,
const std::vector< Dune::FieldVector< T, dimworld > > &  directions,
const Dune::FieldVector< T, dimworld > &  target,
Dune::FieldVector< T, dim > &  preImage,
const T  overlap = 1e-1 
)
static

Compute the inverse projection of a point onto some surface element where the projection is done across directions which are associated to corners of an surface element.

Parameters
cornersThe coordinates of the corners.
directionsThe directions along which the projection is done.
targetThe point whose inverse projection is computed.
preImageThe pre-image of the target point in local coordinates of the surface element.
overlapThe amount of overlap that is allowed, i.e. projection among the opposite direction is valid if the scaling is smaller than overlap.
Returns
Returns true if the computed pre-image is within the convex hull of the corner points.

References Projection::ProjectionHelper< dim, dimworld, T >::inverseProjection().

template<int dim, int dimworld, class T >
static bool Projection::projection ( const Dune::FieldVector< T, dimworld > &  corner,
const Dune::FieldVector< T, dimworld > &  direction,
const std::vector< Dune::FieldVector< T, dimworld > > &  targetCorners,
Dune::FieldVector< T, dim > &  image,
const T  overlap = 1e-1 
)
static

Compute the projection of a point along a given direction into the convex hull of some target points.

Parameters
cornerThe coordinates of the point that is projected.
directionThe direction along which an intersection with the target surface element is searched.
targetCornersThe corner coordinates of the target surface element.
imageThe projected corner in local coordinates of the target surface element.
overlapThe amount of overlap that is allowed, i.e. projection among the opposite direction is valid if the scaling is smaller than overlap.
Returns
Returns true if the computed image is within the convex hull of the target corner points.

References Projection::ProjectionHelper< dim, dimworld, T >::projection().