8#include "mapping_tools.hpp"
11template <
class R,
class Theta,
class X,
class Y>
25template <
class X,
class Y,
class R,
class Theta>
122 KOKKOS_FUNCTION
double e()
const
134 KOKKOS_FUNCTION ddc::Coordinate<R, Theta>
operator()(ddc::Coordinate<X, Y>
const& coord)
const
136 const double x = ddc::get<X>(coord);
137 const double y = ddc::get<Y>(coord);
138 const double ex = 1. + m_epsilon * x;
139 const double ex2 = (m_epsilon * x * x - 2. * x - m_epsilon);
140 const double xi2 = 1. / (1. - m_epsilon * m_epsilon * 0.25);
141 const double xi = Kokkos::sqrt(xi2);
142 const double r = Kokkos::sqrt(y * y * ex * ex / (m_e * m_e * xi2) + ex2 * ex2 * 0.25);
143 double theta = Kokkos::atan2(2. * y * ex, (m_e * xi * ex2));
145 theta = 2 * M_PI + theta;
147 return ddc::Coordinate<R, Theta>(r, theta);
161namespace mapping_detail {
162template <
class X,
class Y,
class R,
class Theta,
class ExecSpace>
A class for describing the Czarny 2D mapping.
Definition cartesian_to_czarny.hpp:27
CzarnyToCartesian< R, Theta, X, Y > get_inverse_mapping() const
Get the inverse mapping.
Definition cartesian_to_czarny.hpp:155
KOKKOS_FUNCTION ddc::Coordinate< R, Theta > operator()(ddc::Coordinate< X, Y > const &coord) const
Convert the coordinate (x,y) to the equivalent coordinate.
Definition cartesian_to_czarny.hpp:134
CartesianToCzarny(CartesianToCzarny &&x)=default
Instantiate a CartesianToCzarny from another temporary CartesianToCzarny (rvalue).
CartesianToCzarny & operator=(CartesianToCzarny &&x)=default
Assign a CartesianToCzarny from another temporary CartesianToCzarny (rvalue).
KOKKOS_FUNCTION CartesianToCzarny(CartesianToCzarny const &other)
Instantiate a CartesianToCzarny from another CartesianToCzarny (lvalue).
Definition cartesian_to_czarny.hpp:67
CartesianToCzarny(double epsilon, double e)
Instantiate a CartesianToCzarny from parameters.
Definition cartesian_to_czarny.hpp:59
CartesianToCzarny & operator=(CartesianToCzarny const &x)=default
Assign a CartesianToCzarny from another CartesianToCzarny (lvalue).
ddc::Coordinate< R, Theta > CoordResult
The type of the result of the function described by this mapping.
Definition cartesian_to_czarny.hpp:41
KOKKOS_FUNCTION double epsilon() const
Return the parameter.
Definition cartesian_to_czarny.hpp:110
KOKKOS_FUNCTION double e() const
Return the parameter.
Definition cartesian_to_czarny.hpp:122
ddc::Coordinate< X, Y > CoordArg
The type of the argument of the function described by this mapping.
Definition cartesian_to_czarny.hpp:39
A class for describing the Czarny 2D mapping.
Definition czarny_to_cartesian.hpp:50
Define non periodic real R dimension.
Definition geometry.hpp:31
Define periodic real Theta dimension.
Definition geometry.hpp:42
Define non periodic real X dimension.
Definition geometry.hpp:278
Define non periodic real Y dimension.
Definition geometry.hpp:289