dune-grid-glue 2.9
|
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 | |
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.
typedef Coordinate::field_type Dune::GridGlue::Projection< Coordinate >::Field |
Scalar type.
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.
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.
Dune::GridGlue::Projection< Coordinate >::Projection | ( | const Field | overlap = Field(0) , |
const Field | max_normal_product = Field(-0.1) |
||
) |
overlap | allowed overlap |
max_normal_product | maximum value for scalar product ν(x)·ν(Φ(x)) |
|
inline |
Edge-edge intersections.
void Dune::GridGlue::Projection< Coordinate >::epsilon | ( | const Field | epsilon | ) |
Set epsilon used for floating-point comparisons.
epsilon | new epsilon used for floating-point comaprisons |
|
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.
((Φ(xᵢ))ᵢ, (Φ⁻¹(yⱼ))ⱼ)
in barycentric coordinates
|
inline |
Number of edge intersections.
void Dune::GridGlue::Projection< Coordinate >::project | ( | const std::tuple< Corners &, Corners & > & | corners, |
const std::tuple< Normals &, Normals & > & | normals | ||
) |
Do the actual projection.
corners | euclidean coordinates of corners of preimage and image |
normals | normals at corners of preimage and image |
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> |
|
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ⱼ
.
xᵢ
(yⱼ
)
|
staticconstexpr |
dimension of coordinates
|
staticconstexpr |
maximum number of edge-edge intersections
See also \seealso edgeIntersections()