Gyselalib++
 
Loading...
Searching...
No Matches
CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag > Class Template Reference

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

Public Types

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

Public Member Functions

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

Detailed Description

template<class X, class Y, class Corner1Tag, class Corner2Tag, class Corner3Tag>
class CartesianToBarycentric< 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

◆ CartesianToBarycentric() [1/3]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::CartesianToBarycentric ( 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.

◆ CartesianToBarycentric() [2/3]

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

A copy operator for the mapping operator.

Parameters
otherThe object to be copied.

◆ CartesianToBarycentric() [3/3]

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::CartesianToBarycentric ( CartesianToBarycentric< 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 >
CartesianToBarycentric & CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator= ( CartesianToBarycentric< 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 >
CartesianToBarycentric & CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator= ( CartesianToBarycentric< 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()()

template<class X , class Y , class Corner1Tag , class Corner2Tag , class Corner3Tag >
KOKKOS_FUNCTION CoordResult CartesianToBarycentric< X, Y, Corner1Tag, Corner2Tag, Corner3Tag >::operator() ( CoordArg const &  pos) const
inline

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

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

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