Gyselalib++
CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian > Class Template Reference

A class describing a mapping from a Cartesian domain to a pseudo-Cartesian. More...

Public Types

using CartesianCoordinate = ddc::Coordinate< typename MappingToCartesian::cartesian_tag_x, typename MappingToCartesian::cartesian_tag_y >
 The type of a coordinate in the Cartesian geometry.
 
using cartesian_tag_x = typename MappingToCartesian::cartesian_tag_x
 The X dimension in the Cartesian geometry.
 
using cartesian_tag_y = typename MappingToCartesian::cartesian_tag_y
 The Y dimension in the Cartesian geometry.
 
using pseudo_cartesian_tag_x = typename MappingToPseudoCartesian::cartesian_tag_x
 The X dimension in the pseudo-Cartesian geometry.
 
using pseudo_cartesian_tag_y = typename MappingToPseudoCartesian::cartesian_tag_y
 The Y dimension in the pseudo-Cartesian geometry.
 
using CoordArg = ddc::Coordinate< cartesian_tag_x, cartesian_tag_y >
 The type of the argument of the function described by this mapping.
 
using CoordResult = ddc::Coordinate< pseudo_cartesian_tag_x, pseudo_cartesian_tag_y >
 The type of the result of the function described by this mapping.
 

Public Member Functions

 CartesianToPseudoCartesian (MappingToPseudoCartesian mapping_to_pseudo_cartesian, MappingToCartesian mapping_to_cartesian, double epsilon)
 Construct an instance of the class. More...
 
KOKKOS_FUNCTION void jacobian_matrix (CoordRTheta const &coord_rtheta, Matrix_2x2 &J) const
 Compute the full Jacobian matrix. More...
 
KOKKOS_FUNCTION double jacobian (CoordRTheta const &coord_rtheta) const
 Compute the determinant of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double jacobian_11 (CoordRTheta const &coord_rtheta) const
 Compute the (1,1) coefficient of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double jacobian_12 (CoordRTheta const &coord_rtheta) const
 Compute the (1,2) coefficient of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double jacobian_21 (CoordRTheta const &coord_rtheta) const
 Compute the (2,1) coefficient of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double jacobian_22 (CoordRTheta const &coord_rtheta) const
 Compute the (2,2) coefficient of the Jacobian matrix. More...
 
KOKKOS_FUNCTION void inv_jacobian_matrix (CoordRTheta const &coord_rtheta, Matrix_2x2 &J) const
 Compute the full inverse of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double inv_jacobian_11 (CoordRTheta const &coord_rtheta) const
 Compute the (1,1) coefficient of the inverse of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double inv_jacobian_12 (CoordRTheta const &coord_rtheta) const
 Compute the (1,2) coefficient of the inverse of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double inv_jacobian_21 (CoordRTheta const &coord_rtheta) const
 Compute the (2,1) coefficient of the inverse of the Jacobian matrix. More...
 
KOKKOS_FUNCTION double inv_jacobian_22 (CoordRTheta const &coord_rtheta) const
 Compute the (2,2) coefficient of the inverse of the Jacobian matrix. More...
 

Detailed Description

template<class MappingToCartesian, class MappingToPseudoCartesian>
class CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >

A class describing a mapping from a Cartesian domain to a pseudo-Cartesian.

This operation is carried out using 2 curvilinear to Cartesian mappings. The Cartesian to pseudo-Cartesian mapping is obtained by combining these 2 mappings.

Constructor & Destructor Documentation

◆ CartesianToPseudoCartesian()

template<class MappingToCartesian , class MappingToPseudoCartesian >
CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::CartesianToPseudoCartesian ( MappingToPseudoCartesian  mapping_to_pseudo_cartesian,
MappingToCartesian  mapping_to_cartesian,
double  epsilon 
)
inline

Construct an instance of the class.

Parameters
[in]mapping_to_cartesianA curvilinear to Cartesian mapping.
[in]mapping_to_pseudo_cartesianA curvilinear to Cartesian mapping where the role of the Cartesian geometry is fulfilled by the pseudo-Cartesian geometry.
[in]epsilonThe parameter \( \varepsilon \) which determines when a point is close enough to the central O-point for linearization to be required when calculating the Jacobian.

Member Function Documentation

◆ jacobian_matrix()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION void CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian_matrix ( CoordRTheta const &  coord_rtheta,
Matrix_2x2 &  J 
) const
inline

Compute the full Jacobian matrix.

This is calculated by combining the Jacobian matrices of the 2 curvilinear mappings. If a point is within \( \varepsilon \) of the O-point then a linearisation is carried out between the Jacobian matrix at \( \varepsilon \) and the matrix at the O-point.

\( J_{(x,y)->(x_pC, y_pC)} = J_{(r, \theta)->(x_pC,y_pC)}J_{(x, y)->(r, \theta)} \) \( = J_{(r, \theta)->(x_pC,y_pC)} [J_{(r, \theta)->(x, y)}]^{-1} \)

Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
[out]JThe Jacobian matrix returned.

◆ jacobian()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian ( CoordRTheta const &  coord_rtheta) const
inline

Compute the determinant of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The determinant of the Jacobian matrix.

◆ jacobian_11()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian_11 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (1,1) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,1) coefficient of the Jacobian matrix.

◆ jacobian_12()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian_12 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (1,2) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,2) coefficient of the Jacobian matrix.

◆ jacobian_21()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian_21 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (2,1) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,1) coefficient of the Jacobian matrix.

◆ jacobian_22()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::jacobian_22 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (2,2) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,2) coefficient of the Jacobian matrix.

◆ inv_jacobian_matrix()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION void CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::inv_jacobian_matrix ( CoordRTheta const &  coord_rtheta,
Matrix_2x2 &  J 
) const
inline

Compute the full inverse of the Jacobian matrix.

This is calculated by combining the Jacobian matrices of the 2 curvilinear mappings. If a point is within \( \varepsilon \) of the O-point then a linearisation is carried out between the Jacobian matrix at \( \varepsilon \) and the matrix at the O-point.

\( [J_{(x,y)->(x_pC, y_pC)}]^{-1} = [J_{(r, \theta)->(x_pC, y_pC)} J_{(x, y)->(r, \theta)}]^{-1} \) \( = [J_{(r, \theta)->(x_pC, y_pC)} [J_{(x, y)->(r, \theta)}]^{-1}]^{-1} \) \( = J_{(x, y)->(r, \theta)} [J_{(r, \theta)->(x_pC, y_pC)}]^{-1} \)

Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
[out]JThe Jacobian matrix returned.

◆ inv_jacobian_11()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::inv_jacobian_11 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (1,1) coefficient of the inverse of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the inverse of the Jacobian matrix.
Returns
The (1,1) coefficient of the inverse of the Jacobian matrix.

◆ inv_jacobian_12()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::inv_jacobian_12 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (1,2) coefficient of the inverse of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the inverse of the Jacobian matrix.
Returns
The (1,2) coefficient of the inverse of the Jacobian matrix.

◆ inv_jacobian_21()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::inv_jacobian_21 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (2,1) coefficient of the inverse of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the inverse of the Jacobian matrix.
Returns
The (2,1) coefficient of the inverse of the Jacobian matrix.

◆ inv_jacobian_22()

template<class MappingToCartesian , class MappingToPseudoCartesian >
KOKKOS_FUNCTION double CartesianToPseudoCartesian< MappingToCartesian, MappingToPseudoCartesian >::inv_jacobian_22 ( CoordRTheta const &  coord_rtheta) const
inline

Compute the (2,2) coefficient of the inverse of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the inverse of the Jacobian matrix.
Returns
The (2,2) coefficient of the inverse of the Jacobian matrix.

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