A class for describing the Czarny 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 | |
CzarnyToCartesian (double epsilon, double e) | |
Instantiate a CzarnyToCartesian from parameters. | |
KOKKOS_FUNCTION | CzarnyToCartesian (CzarnyToCartesian const &other) |
Instantiate a CzarnyToCartesian from another CzarnyToCartesian (lvalue). | |
CzarnyToCartesian (CzarnyToCartesian &&x)=default | |
Instantiate a CzarnyToCartesian from another temporary CzarnyToCartesian (rvalue). | |
CzarnyToCartesian & | operator= (CzarnyToCartesian const &x)=default |
Assign a CzarnyToCartesian from another CzarnyToCartesian (lvalue). | |
CzarnyToCartesian & | operator= (CzarnyToCartesian &&x)=default |
Assign a CzarnyToCartesian from another temporary CzarnyToCartesian (rvalue). | |
KOKKOS_FUNCTION double | epsilon () const |
Return the \( \epsilon \) parameter. | |
KOKKOS_FUNCTION double | e () const |
Return the \( e \) parameter. | |
KOKKOS_FUNCTION ddc::Coordinate< X, Y > | operator() (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. | |
CartesianToCzarny< X, Y, R, Theta > | get_inverse_mapping () const |
Get the inverse mapping. | |
A class for describing the Czarny 2D mapping.
The mapping \( (r,\theta)\mapsto (x,y) \) is defined by
\( x(r,\theta) = \frac{1}{\epsilon} \left( 1 - \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} \right),\)
\( y(r,\theta) = \frac{e\xi r \sin(\theta)}{2 -\sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} },\)
with \( \xi = 1/\sqrt{1 - \epsilon^2 /4} \) and \( e \) and \( \epsilon \) given as parameters. It and its Jacobian matrix are invertible everywhere except for \( r = 0 \).
Its Jacobian coefficients are defined as follow
\( J_{11}(r,\theta) = - \cos(\theta)\frac{1}{ \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} } \)
\( J_{12}(r,\theta) = r\sin(\theta)\frac{1}{ \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} } \)
\( J_{21}(r,\theta) = \cos(\theta)\frac{e\epsilon \xi r\sin(\theta)}{ \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} \left( 2 - \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} \right)^2 } + \sin(\theta)\frac{e\xi }{ 2- \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} }\)
\( J_{22}(r,\theta) = r \sin(\theta)\frac{- e\epsilon \xi r \sin(\theta)}{ \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} \left( 2 - \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} \right)^2 } + r\cos(\theta)\frac{e\xi }{ 2 -\sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))} }\).
and \( \det(J(r, \theta)) = \frac{- r}{ \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))}} \frac{e\xi}{2 - \sqrt{1 + \epsilon(\epsilon + 2 r \cos(\theta))}}. \)
|
inline |
Instantiate a CzarnyToCartesian from parameters.
[in] | epsilon | The \( \epsilon \) parameter in the definition of the mapping CzarnyToCartesian. |
[in] | e | The \( e \) parameter in the definition of the mapping CzarnyToCartesian. |
|
inline |
Instantiate a CzarnyToCartesian from another CzarnyToCartesian (lvalue).
[in] | other | CzarnyToCartesian mapping used to instantiate the new one. |
|
default |
Instantiate a CzarnyToCartesian from another temporary CzarnyToCartesian (rvalue).
[in] | x | CzarnyToCartesian mapping used to instantiate the new one. |
|
default |
Assign a CzarnyToCartesian from another CzarnyToCartesian (lvalue).
[in] | x | CzarnyToCartesian mapping used to assign. |
|
default |
Assign a CzarnyToCartesian from another temporary CzarnyToCartesian (rvalue).
[in] | x | CzarnyToCartesian mapping used to assign. |
|
inline |
|
inline |
|
inline |
Convert the \( (r, \theta) \) coordinate to the equivalent (x,y) 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} : (r,\theta)\mapsto (x,y) \), the (1,1) coefficient of the Jacobian matrix is given by \( \frac{\partial x}{\partial r} \).
[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} : (r,\theta)\mapsto (x,y) \), the (1,2) coefficient of the Jacobian matrix is given by \( \frac{\partial x}{\partial \theta} \).
[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} : (r,\theta)\mapsto (x,y) \), the (2,1) coefficient of the Jacobian matrix is given by \( \frac{\partial y}{\partial r} \).
[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} : (r,\theta)\mapsto (x,y) \), the (2,2) coefficient of the Jacobian matrix is given by \( \frac{\partial y}{\partial \theta} \).
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
|
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.
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
[out] | matrix | The inverse Jacobian matrix returned. |
|
inline |
Compute the (1,1) coefficient of the inverse Jacobian matrix.
Be careful because not all mappings are invertible, especially at the center point.
[in] | coord | The coordinate where we evaluate the inverse Jacobian matrix. |
|
inline |
Compute the (1,2) coefficient of the inverse Jacobian matrix.
Be careful because not all mappings are invertible, especially at the center point.
[in] | coord | The coordinate where we evaluate the inverse Jacobian matrix. |
|
inline |
Compute the (2,1) coefficient of the inverse Jacobian matrix.
Be careful because not all mappings are invertible, especially at the center point.
[in] | coord | The coordinate where we evaluate the inverse Jacobian matrix. |
|
inline |
Compute the (2,2) coefficient of the inverse Jacobian matrix.
Be careful because not all mappings are invertible, especially at the center point.
[in] | coord | The coordinate where we evaluate the inverse Jacobian matrix. |
|
inline |
Get the inverse mapping.