6#include "cartesian_to_circular.hpp"
7#include "circular_to_cartesian.hpp"
8#include "czarny_to_cartesian.hpp"
9#include "discrete_to_cartesian.hpp"
10#include "mapping_tools.hpp"
26template <
class Mapping,
class CoordRTheta>
30template <
class Mapping1,
class Mapping2>
40template <
class X,
class Y,
class R,
class Theta,
class Xpc,
class Ypc>
45 ddc::Coordinate<R, Theta>>
48 using CoordRTheta = ddc::Coordinate<R, Theta>;
96template <
class X,
class Y,
class R,
class Theta,
class Xpc,
class Ypc>
99 ddc::Coordinate<R, Theta>>
102 using CoordRTheta = ddc::Coordinate<R, Theta>;
135 = m_mapping.template get<CzarnyToCartesian<R, Theta, X, Y>>().epsilon();
136 const double e = m_mapping.template get<CzarnyToCartesian<R, Theta, X, Y>>().e();
137 const double xi = Kokkos::sqrt(1. / (1. - epsilon * epsilon * 0.25));
138 const double sqrt_eps_2 = Kokkos::sqrt(1. + epsilon * epsilon);
139 J[0][0] = -sqrt_eps_2;
142 J[1][1] = (2 - sqrt_eps_2) / e / xi;
156 class SplineEvaluator,
166 ddc::Coordinate<R, Theta>>
169 using CoordRTheta = ddc::Coordinate<R, Theta>;
176 using IdxRangeR =
typename SplineEvaluator::evaluation_domain_type1;
177 using IdxRangeTheta =
typename SplineEvaluator::evaluation_domain_type2;
178 using IdxR =
typename IdxRangeR::discrete_element_type;
179 using IdxTheta =
typename IdxRangeTheta::discrete_element_type;
232 = m_mapping.template get<
241 IdxR ir(idx_range_singular_point.front());
242 for (IdxTheta ip : IdxRangeTheta(idx_range_singular_point)) {
243 ddc::Coordinate<R, Theta> coord(ddc::coordinate(ir), ddc::coordinate(ip));
246 double th = ddc::get<Theta>(coord);
247 Matrix_2x2 J_circ_r_rtheta;
248 J_circ_r_rtheta[0][0] = Kokkos::cos(th);
249 J_circ_r_rtheta[0][1] = Kokkos::sin(th);
250 J_circ_r_rtheta[1][0] = -Kokkos::sin(th);
251 J_circ_r_rtheta[1][1] = Kokkos::cos(th);
254 J_theta = inverse(mat_mul(J_first_order, J_circ_r_rtheta));
256 J[0][0] += J_theta[0][0];
257 J[0][1] += J_theta[0][1];
258 J[1][0] += J_theta[1][0];
259 J[1][1] += J_theta[1][1];
262 int const theta_size = idx_range_singular_point.size();
263 J[0][0] /= theta_size;
264 J[0][1] /= theta_size;
265 J[1][0] /= theta_size;
266 J[1][1] /= theta_size;
A class for describing the circular 2D mapping.
Definition cartesian_to_circular.hpp:40
A class for describing the circular 2D mapping.
Definition circular_to_cartesian.hpp:43
A class which describes a mapping which is constructed by combining two mappings.
Definition combined_mapping.hpp:26
A class for describing the Czarny 2D mapping.
Definition czarny_to_cartesian.hpp:50
A class for describing discrete 2D mappings from the logical domain to the physical domain.
Definition discrete_to_cartesian.hpp:32
KOKKOS_INLINE_FUNCTION Matrix_2x2 first_order_jacobian_matrix_r_rtheta(ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const
Get the first order expansion of the Jacobian matrix with the theta component divided by r.
Definition discrete_to_cartesian.hpp:283
KOKKOS_INLINE_FUNCTION IdxRangeRTheta idx_range_singular_point() const
Get the index range describing the points which should be used to evaluate functions at the central p...
Definition discrete_to_cartesian.hpp:303
KOKKOS_INLINE_FUNCTION Matrix_2x2 operator()() const
Compute the full inverse Jacobian matrix from a coordinate system (x_pc, y_pc) to a coordinate system...
Definition inv_jacobian_o_point.hpp:79
KOKKOS_FUNCTION InvJacobianOPoint(Mapping const &mapping)
The constructor of InvJacobianOPoint.
Definition inv_jacobian_o_point.hpp:63
KOKKOS_INLINE_FUNCTION Matrix_2x2 operator()() const
Compute the full inverse Jacobian matrix from a coordinate system (x_pc, y_pc) to a coordinate system...
Definition inv_jacobian_o_point.hpp:131
KOKKOS_FUNCTION InvJacobianOPoint(Mapping const &mapping)
The constructor of InvJacobianOPoint.
Definition inv_jacobian_o_point.hpp:117
InvJacobianOPoint< CombinedMapping< DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CartesianToCircular< Xpc, Ypc, R, Theta > >, ddc::Coordinate< R, Theta > >::InvJacobianOPoint KOKKOS_FUNCTION InvJacobianOPoint(Mapping const &mapping)
The constructor of InvJacobianOPoint.
Definition inv_jacobian_o_point.hpp:189
InvJacobianOPoint< CombinedMapping< DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CartesianToCircular< Xpc, Ypc, R, Theta > >, ddc::Coordinate< R, Theta > >::operator() KOKKOS_FUNCTION Matrix_2x2 operator()() const
Compute the full inverse Jacobian matrix from a coordinate system (x_pc, y_pc) to a coordinate system...
Definition inv_jacobian_o_point.hpp:229
An operator for calculating the inverse of the Jacobian at an O-point.
Definition inv_jacobian_o_point.hpp:27
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