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). | |
CartesianToCircular & | operator= (CartesianToCircular const &x)=default |
Assign a CartesianToCircular from another CartesianToCircular (lvalue). | |
CartesianToCircular & | operator= (CartesianToCircular &&x)=default |
Assign a CartesianToCircular from another temporary CartesianToCircular (rvalue). | |
KOKKOS_FUNCTION ddc::Coordinate< R, Theta > | operator() (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, Y > | get_inverse_mapping () const |
Get the inverse mapping. | |
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 \).
|
inline |
Instantiate a CartesianToCircular from another CartesianToCircular (lvalue).
[in] | other | CartesianToCircular mapping used to instantiate the new one. |
|
default |
Instantiate a Curvilinear2DToCartesian from another temporary CartesianToCircular (rvalue).
[in] | x | Curvilinear2DToCartesian mapping used to instantiate the new one. |
|
default |
Assign a CartesianToCircular from another CartesianToCircular (lvalue).
[in] | x | CartesianToCircular mapping used to assign. |
|
default |
Assign a CartesianToCircular from another temporary CartesianToCircular (rvalue).
[in] | x | CartesianToCircular mapping used to assign. |
|
inline |
Convert the coordinate (x,y) to the equivalent \( (r, \theta) \) coordinate.
[in] | coord | The coordinate to be converted. |
|
inline |
Compute the Jacobian, the determinant of the Jacobian matrix of the mapping.
[in] | coord | The coordinate where we evaluate the Jacobian. |
|
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.
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
[out] | matrix | The Jacobian matrix returned. |
|
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} \).
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
|
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} \).
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
|
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} \).
[in] | coord | The coordinate where we evaluate the Jacobian matrix. . |
|
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} \).
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
|
inline |
Get the inverse mapping.