Gyselalib++
CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > Class Template Reference

A class to convert cartesian coordinates to barycentric coordinates on a triangle. More...

Inheritance diagram for CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >:
CoordinateConverter< ddc::Coordinate< X, Y >, ddc::Coordinate< Corner1Tag, Corner2Tag, Corner3Tag > > CoordinateConverter< ddc::Coordinate< Corner1Tag, Corner2Tag, Corner3Tag >, ddc::Coordinate< X, Y > >

Public Types

using BarycentricCoord = ddc::Coordinate< Corner1Tag, Corner2Tag, Corner3Tag >
 The type of a coordinate in the barycentric coordinate system.
 
using CartesianCoord = ddc::Coordinate< X, Y >
 The type of a coordinate in the cartesian coordinate system.
 

Public Member Functions

 CartesianToBarycentricCoordinates (CartesianCoord const &corner1, CartesianCoord const &corner2, CartesianCoord const &corner3)
 Construct the operator which converts between the coordinate systems. More...
 
 CartesianToBarycentricCoordinates (CartesianToBarycentricCoordinates const &other)=default
 A copy operator for the mapping operator. More...
 
 CartesianToBarycentricCoordinates (CartesianToBarycentricCoordinates &&x)=default
 A r-value copy operator for the mapping operator. More...
 
 ~CartesianToBarycentricCoordinates ()=default
 The destructor of the mapping operator.
 
CartesianToBarycentricCoordinatesoperator= (CartesianToBarycentricCoordinates const &x)=default
 A copy operator for the mapping operator. More...
 
CartesianToBarycentricCoordinatesoperator= (CartesianToBarycentricCoordinates &&x)=default
 A r-value copy operator for the mapping operator. More...
 
KOKKOS_FUNCTION BarycentricCoord operator() (CartesianCoord const &pos) const final
 The operator to get the equivalent barycentric coordinate of the cartesian coordinate. More...
 
KOKKOS_FUNCTION CartesianCoord operator() (BarycentricCoord const &pos) const final
 The operator to get the equivalent cartesian coordinate of the barycentric coordinate. More...
 

Detailed Description

template<class X, class Y, class Corner1Tag, class Corner2Tag, class Corner3Tag>
class CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >

A class to convert cartesian coordinates to barycentric coordinates on a triangle.

Tags are used to identify the corners of the triangle. This ensures that there are different types for coordinate systems related to different triangles.

Template Parameters
XThe tag of the x dimension of the cartesian coordinates.
YThe tag of the y dimension of the cartesian coordinates.
Corner1TagA tag identifying the first corner of the triangle.
Corner2TagA tag identifying the second corner of the triangle.
Corner3TagA tag identifying the third corner of the triangle.

Constructor & Destructor Documentation

◆ CartesianToBarycentricCoordinates() [1/3]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::CartesianToBarycentricCoordinates ( CartesianCoord const &  corner1,
CartesianCoord const &  corner2,
CartesianCoord const &  corner3 
)
inline

Construct the operator which converts between the coordinate systems.

Parameters
[in]corner1The coordinates of the first corner of the triangle.
[in]corner2The coordinates of the second corner of the triangle.
[in]corner3The coordinates of the third corner of the triangle.

◆ CartesianToBarycentricCoordinates() [2/3]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::CartesianToBarycentricCoordinates ( CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > const &  other)
default

A copy operator for the mapping operator.

Parameters
otherThe object to be copied.

◆ CartesianToBarycentricCoordinates() [3/3]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::CartesianToBarycentricCoordinates ( CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > &&  x)
default

A r-value copy operator for the mapping operator.

Parameters
xThe object to be consumed.

Member Function Documentation

◆ operator=() [1/2]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentricCoordinates& CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator= ( CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > const &  x)
default

A copy operator for the mapping operator.

Parameters
xThe object to be copied.
Returns
A reference to this class instance.

◆ operator=() [2/2]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentricCoordinates& CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator= ( CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > &&  x)
default

A r-value copy operator for the mapping operator.

Parameters
xThe object to be consumed.
Returns
A reference to this class instance.

◆ operator()() [1/2]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
KOKKOS_FUNCTION BarycentricCoord CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator() ( CartesianCoord const &  pos) const
inlinefinalvirtual

The operator to get the equivalent barycentric coordinate of the cartesian coordinate.

Parameters
[in]posThe known cartesian coordinate.
Returns
The equivalent barycentric coordinate.

Implements CoordinateConverter< ddc::Coordinate< X, Y >, ddc::Coordinate< Corner1Tag, Corner2Tag, Corner3Tag > >.

◆ operator()() [2/2]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
KOKKOS_FUNCTION CartesianCoord CartesianToBarycentricCoordinates< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator() ( BarycentricCoord const &  pos) const
inlinefinalvirtual

The operator to get the equivalent cartesian coordinate of the barycentric coordinate.

Parameters
[in]posThe known barycentric coordinate.
Returns
The equivalent cartesian coordinate.

Implements CoordinateConverter< ddc::Coordinate< Corner1Tag, Corner2Tag, Corner3Tag >, ddc::Coordinate< X, Y > >.


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