Gyselalib++
 
Loading...
Searching...
No Matches
CartesianToCircular< X, Y, R, Theta > Class Template Reference

A class for describing the circular 2D mapping. More...

Public Types

using cartesian_tag_x = X
 Indicate the first physical coordinate.
 
using cartesian_tag_y = Y
 Indicate the second physical coordinate.
 
using curvilinear_tag_r = R
 Indicate the first logical coordinate.
 
using curvilinear_tag_theta = Theta
 Indicate the second logical coordinate.
 
using CoordArg = ddc::Coordinate< X, Y >
 The type of the argument of the function described by this mapping.
 
using CoordResult = ddc::Coordinate< R, Theta >
 The type of the result of the function described by this mapping.
 

Public Member Functions

KOKKOS_FUNCTION CartesianToCircular (CartesianToCircular const &other)
 Instantiate a CartesianToCircular from another CartesianToCircular (lvalue).
 
 CartesianToCircular (CartesianToCircular &&x)=default
 Instantiate a Curvilinear2DToCartesian from another temporary CartesianToCircular (rvalue).
 
CartesianToCircularoperator= (CartesianToCircular const &x)=default
 Assign a CartesianToCircular from another CartesianToCircular (lvalue).
 
CartesianToCircularoperator= (CartesianToCircular &&x)=default
 Assign a CartesianToCircular from another temporary CartesianToCircular (rvalue).
 
KOKKOS_FUNCTION ddc::Coordinate< R, Thetaoperator() (ddc::Coordinate< X, Y > const &coord) const
 Convert the coordinate (x,y) to the equivalent \( (r, \theta) \) coordinate.
 
KOKKOS_FUNCTION double jacobian (ddc::Coordinate< X, Y > const &coord)
 Compute the Jacobian, the determinant of the Jacobian matrix of the mapping.
 
KOKKOS_FUNCTION void jacobian_matrix (ddc::Coordinate< X, Y > const &coord, Matrix_2x2 &matrix)
 Compute full Jacobian matrix.
 
KOKKOS_FUNCTION double jacobian_11 (ddc::Coordinate< X, Y > const &coord)
 Compute the (1,1) coefficient of the Jacobian matrix.
 
KOKKOS_FUNCTION double jacobian_12 (ddc::Coordinate< X, Y > const &coord)
 Compute the (1,2) coefficient of the Jacobian matrix.
 
KOKKOS_FUNCTION double jacobian_21 (ddc::Coordinate< X, Y > const &coord)
 Compute the (2,1) coefficient of the Jacobian matrix.
 
KOKKOS_FUNCTION double jacobian_22 (ddc::Coordinate< X, Y > const &coord)
 Compute the (2,2) coefficient of the Jacobian matrix.
 
CircularToCartesian< R, Theta, X, Yget_inverse_mapping () const
 Get the inverse mapping.
 

Detailed Description

template<class X, class Y, class R, class Theta>
class CartesianToCircular< X, Y, R, Theta >

A class for describing the circular 2D mapping.

The mapping \( (x,y)\mapsto (r,\theta) \) is defined as follow :

\( r(x,y) = \sqrt x^2+y^2 ,\)

\( \theta(x,y) = atan2(\frac{y}{x}) .\)

It and its Jacobian matrix are invertible everywhere except for \( r = 0 \).

The Jacobian matrix coefficients are defined as follow

\( J_{11}(r,\theta) =\frac{2x}{\sqrt{x^2+y^2}} \)

\( J_{12}(r,\theta) =\frac{2y}{\sqrt{x^2+y^2}} \)

\( J_{21}(r,\theta) =\frac{-y}{(x^2+y^2)^2} \)

\( J_{22}(r,\theta) =\frac{x}{(x^2+y^2)^2} \)

and the matrix determinant: \( det(J) = r \).

Constructor & Destructor Documentation

◆ CartesianToCircular() [1/2]

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION CartesianToCircular< X, Y, R, Theta >::CartesianToCircular ( CartesianToCircular< X, Y, R, Theta > const &  other)
inline

Instantiate a CartesianToCircular from another CartesianToCircular (lvalue).

Parameters
[in]otherCartesianToCircular mapping used to instantiate the new one.

◆ CartesianToCircular() [2/2]

template<class X , class Y , class R , class Theta >
CartesianToCircular< X, Y, R, Theta >::CartesianToCircular ( CartesianToCircular< X, Y, R, Theta > &&  x)
default

Instantiate a Curvilinear2DToCartesian from another temporary CartesianToCircular (rvalue).

Parameters
[in]xCurvilinear2DToCartesian mapping used to instantiate the new one.

Member Function Documentation

◆ operator=() [1/2]

template<class X , class Y , class R , class Theta >
CartesianToCircular & CartesianToCircular< X, Y, R, Theta >::operator= ( CartesianToCircular< X, Y, R, Theta > const &  x)
default

Assign a CartesianToCircular from another CartesianToCircular (lvalue).

Parameters
[in]xCartesianToCircular mapping used to assign.
Returns
The CartesianToCircular assigned.

◆ operator=() [2/2]

template<class X , class Y , class R , class Theta >
CartesianToCircular & CartesianToCircular< X, Y, R, Theta >::operator= ( CartesianToCircular< X, Y, R, Theta > &&  x)
default

Assign a CartesianToCircular from another temporary CartesianToCircular (rvalue).

Parameters
[in]xCartesianToCircular mapping used to assign.
Returns
The CartesianToCircular assigned.

◆ operator()()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION ddc::Coordinate< R, Theta > CartesianToCircular< X, Y, R, Theta >::operator() ( ddc::Coordinate< X, Y > const &  coord) const
inline

Convert the coordinate (x,y) to the equivalent \( (r, \theta) \) coordinate.

Parameters
[in]coordThe coordinate to be converted.
Returns
The equivalent coordinate.

◆ jacobian()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION double CartesianToCircular< X, Y, R, Theta >::jacobian ( ddc::Coordinate< X, Y > const &  coord)
inline

Compute the Jacobian, the determinant of the Jacobian matrix of the mapping.

Parameters
[in]coordThe coordinate where we evaluate the Jacobian.
Returns
A double with the value of the determinant of the Jacobian matrix.

◆ jacobian_matrix()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION void CartesianToCircular< X, Y, R, Theta >::jacobian_matrix ( ddc::Coordinate< X, Y > const &  coord,
Matrix_2x2 &  matrix 
)
inline

Compute full Jacobian matrix.

For some computations, we need the complete Jacobian matrix or just the coefficients. The coefficients can be given independently with the functions jacobian_11, jacobian_12, jacobian_21 and jacobian_22.

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
[out]matrixThe Jacobian matrix returned.
See also
Jacobian::jacobian_11
Jacobian::jacobian_12
Jacobian::jacobian_21
Jacobian::jacobian_22

◆ jacobian_11()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION double CartesianToCircular< X, Y, R, Theta >::jacobian_11 ( ddc::Coordinate< X, Y > const &  coord)
inline

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

For a mapping given by \( \mathcal{F} : (x,y)\mapsto (r,\theta) \), the (1,1) coefficient of the Jacobian matrix is given by \( \frac{\partial r}{\partial x} \).

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
Returns
A double with the value of the (1,1) coefficient of the Jacobian matrix.

◆ jacobian_12()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION double CartesianToCircular< X, Y, R, Theta >::jacobian_12 ( ddc::Coordinate< X, Y > const &  coord)
inline

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

For a mapping given by \( \mathcal{F} : (x,y)\mapsto (r,\theta) \), the (1,2) coefficient of the Jacobian matrix is given by \( \frac{\partial \theta}{\partial x} \).

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
Returns
A double with the value of the (1,2) coefficient of the Jacobian matrix.

◆ jacobian_21()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION double CartesianToCircular< X, Y, R, Theta >::jacobian_21 ( ddc::Coordinate< X, Y > const &  coord)
inline

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

For a mapping given by \( \mathcal{F} : (x,y)\mapsto (r,\theta) \), the (2,1) coefficient of the Jacobian matrix is given by \( \frac{\partial r}{\partial y} \).

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix. .
Returns
A double with the value of the (2,1) coefficient of the Jacobian matrix.

◆ jacobian_22()

template<class X , class Y , class R , class Theta >
KOKKOS_FUNCTION double CartesianToCircular< X, Y, R, Theta >::jacobian_22 ( ddc::Coordinate< X, Y > const &  coord)
inline

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

For a mapping given by \( \mathcal{F} : (x,y)\mapsto (r,\theta) \), the (2,2) coefficient of the Jacobian matrix is given by \( \frac{\partial \theta}{\partial y} \).

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
Returns
A double with the value of the (2,2) coefficient of the Jacobian matrix.

◆ get_inverse_mapping()

template<class X , class Y , class R , class Theta >
CircularToCartesian< R, Theta, X, Y > CartesianToCircular< X, Y, R, Theta >::get_inverse_mapping ( ) const
inline

Get the inverse mapping.

Returns
The inverse mapping.

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