Gyselalib++
 
Loading...
Searching...
No Matches
CircularToCartesian< R, Theta, X, Y > 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< R, Theta >
 The type of the argument of the function described by this mapping.
 
using CoordResult = ddc::Coordinate< X, Y >
 The type of the result of the function described by this mapping.
 

Public Member Functions

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

Detailed Description

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

A class for describing the circular 2D mapping.

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

\( x(r,\theta) = r \cos(\theta),\)

\( y(r,\theta) = r \sin(\theta).\)

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

The Jacobian matrix coefficients are defined as follow

\( J_{11}(r,\theta) = \cos(\theta)\)

\( J_{12}(r,\theta) = - r \sin(\theta)\)

\( J_{21}(r,\theta) = \sin(\theta)\)

\( J_{22}(r,\theta) = r \cos(\theta)\)

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

Constructor & Destructor Documentation

◆ CircularToCartesian() [1/2]

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

Instantiate a CircularToCartesian from another CircularToCartesian (lvalue).

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

◆ CircularToCartesian() [2/2]

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

Instantiate a CircularToCartesian from another temporary CircularToCartesian (rvalue).

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

Member Function Documentation

◆ operator=() [1/2]

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

Assign a CircularToCartesian from another CircularToCartesian (lvalue).

Parameters
[in]xCircularToCartesian mapping used to assign.
Returns
The CircularToCartesian assigned.

◆ operator=() [2/2]

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

Assign a CircularToCartesian from another temporary CircularToCartesian (rvalue).

Parameters
[in]xCircularToCartesian mapping used to assign.
Returns
The CircularToCartesian assigned.

◆ operator()()

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

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

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

◆ jacobian()

template<class R , class Theta , class X , class Y >
KOKKOS_FUNCTION double CircularToCartesian< R, Theta, X, Y >::jacobian ( ddc::Coordinate< R, Theta > const &  coord) const
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 R , class Theta , class X , class Y >
KOKKOS_FUNCTION void CircularToCartesian< R, Theta, X, Y >::jacobian_matrix ( ddc::Coordinate< R, Theta > const &  coord,
Matrix_2x2 &  matrix 
) const
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.

◆ jacobian_11()

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

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

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

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 R , class Theta , class X , class Y >
KOKKOS_FUNCTION double CircularToCartesian< R, Theta, X, Y >::jacobian_12 ( ddc::Coordinate< R, Theta > const &  coord) const
inline

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

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

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 R , class Theta , class X , class Y >
KOKKOS_FUNCTION double CircularToCartesian< R, Theta, X, Y >::jacobian_21 ( ddc::Coordinate< R, Theta > const &  coord) const
inline

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

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

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 R , class Theta , class X , class Y >
KOKKOS_FUNCTION double CircularToCartesian< R, Theta, X, Y >::jacobian_22 ( ddc::Coordinate< R, Theta > const &  coord) const
inline

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

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

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.

◆ inv_jacobian_matrix()

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

Compute full inverse Jacobian matrix.

For some computations, we need the complete inverse Jacobian matrix or just the coefficients. The coefficients can be given independently with the functions inv_jacobian_11, inv_jacobian_12, inv_jacobian_21 and inv_jacobian_22.

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
[out]matrixThe inverse Jacobian matrix returned.
See also
Jacobian::inv_jacobian_11
Jacobian::inv_jacobian_12
Jacobian::inv_jacobian_21
Jacobian::inv_jacobian_22

◆ inv_jacobian_11()

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

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

Be careful because not all mappings are invertible, especially at the center point.

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

◆ inv_jacobian_12()

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

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

Be careful because not all mappings are invertible, especially at the center point.

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

◆ inv_jacobian_21()

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

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

Be careful because not all mappings are invertible, especially at the center point.

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

◆ inv_jacobian_22()

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

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

Be careful because not all mappings are invertible, especially at the center point.

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

◆ get_inverse_mapping()

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

Get the inverse mapping.

Returns
The inverse mapping.

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