4 #include <sll/view.hpp>
6 #include "mapping_tools.hpp"
16 template <
class Mapping,
class PositionCoordinate =
typename Mapping::CoordArg>
45 KOKKOS_INLINE_FUNCTION Matrix_2x2
operator()(PositionCoordinate
const& coord)
const
48 if constexpr (has_2d_inv_jacobian_v<Mapping, PositionCoordinate>) {
51 static_assert(has_2d_jacobian_v<Mapping, PositionCoordinate>);
52 double jacob = m_mapping.
jacobian(coord);
53 assert(fabs(jacob) > 1e-15);
54 matrix[0][0] = m_mapping.
jacobian_22(coord) / jacob;
55 matrix[0][1] = -m_mapping.
jacobian_12(coord) / jacob;
56 matrix[1][0] = -m_mapping.
jacobian_21(coord) / jacob;
57 matrix[1][1] = m_mapping.
jacobian_11(coord) / jacob;
72 KOKKOS_INLINE_FUNCTION
double inv_jacobian_11(PositionCoordinate
const& coord)
const
74 if constexpr (has_2d_inv_jacobian_v<Mapping, PositionCoordinate>) {
77 static_assert(has_2d_jacobian_v<Mapping, PositionCoordinate>);
78 double jacob = m_mapping.
jacobian(coord);
79 assert(fabs(jacob) > 1e-15);
94 KOKKOS_INLINE_FUNCTION
double inv_jacobian_12(PositionCoordinate
const& coord)
const
96 if constexpr (has_2d_inv_jacobian_v<Mapping, PositionCoordinate>) {
99 static_assert(has_2d_jacobian_v<Mapping, PositionCoordinate>);
100 double jacob = m_mapping.
jacobian(coord);
101 assert(fabs(jacob) > 1e-15);
117 if constexpr (has_2d_inv_jacobian_v<Mapping, PositionCoordinate>) {
120 static_assert(has_2d_jacobian_v<Mapping, PositionCoordinate>);
121 double jacob = m_mapping.
jacobian(coord);
122 assert(fabs(jacob) > 1e-15);
139 if constexpr (has_2d_inv_jacobian_v<Mapping, PositionCoordinate>) {
142 static_assert(has_2d_jacobian_v<Mapping, PositionCoordinate>);
143 double jacob = m_mapping.
jacobian(coord);
144 assert(fabs(jacob) > 1e-15);
A class for describing the circular 2D mapping.
Definition: circular_to_cartesian.hpp:45
KOKKOS_FUNCTION double jacobian_21(ddc::Coordinate< R, Theta > const &coord) const
Compute the (2,1) coefficient of the Jacobian matrix.
Definition: circular_to_cartesian.hpp:221
KOKKOS_FUNCTION double jacobian_22(ddc::Coordinate< R, Theta > const &coord) const
Compute the (2,2) coefficient of the Jacobian matrix.
Definition: circular_to_cartesian.hpp:238
KOKKOS_FUNCTION double inv_jacobian_11(ddc::Coordinate< R, Theta > const &coord) const
Compute the (1,1) coefficient of the inverse Jacobian matrix.
Definition: circular_to_cartesian.hpp:288
KOKKOS_FUNCTION double inv_jacobian_12(ddc::Coordinate< R, Theta > const &coord) const
Compute the (1,2) coefficient of the inverse Jacobian matrix.
Definition: circular_to_cartesian.hpp:304
KOKKOS_FUNCTION double jacobian_11(ddc::Coordinate< R, Theta > const &coord) const
Compute the (1,1) coefficient of the Jacobian matrix.
Definition: circular_to_cartesian.hpp:186
KOKKOS_FUNCTION double jacobian_12(ddc::Coordinate< R, Theta > const &coord) const
Compute the (1,2) coefficient of the Jacobian matrix.
Definition: circular_to_cartesian.hpp:203
KOKKOS_FUNCTION double inv_jacobian_22(ddc::Coordinate< R, Theta > const &coord) const
Compute the (2,2) coefficient of the inverse Jacobian matrix.
Definition: circular_to_cartesian.hpp:338
KOKKOS_FUNCTION void inv_jacobian_matrix(ddc::Coordinate< R, Theta > const &coord, Matrix_2x2 &matrix) const
Compute full inverse Jacobian matrix.
Definition: circular_to_cartesian.hpp:265
KOKKOS_FUNCTION double inv_jacobian_21(ddc::Coordinate< R, Theta > const &coord) const
Compute the (2,1) coefficient of the inverse Jacobian matrix.
Definition: circular_to_cartesian.hpp:320
KOKKOS_FUNCTION double jacobian(ddc::Coordinate< R, Theta > const &coord) const
Compute the Jacobian, the determinant of the Jacobian matrix of the mapping.
Definition: circular_to_cartesian.hpp:144
A class to calculate the inverse of the Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:18
KOKKOS_INLINE_FUNCTION double inv_jacobian_11(PositionCoordinate const &coord) const
Compute the (1,1) coefficient of the inverse Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:72
KOKKOS_FUNCTION InverseJacobianMatrix(Mapping const &mapping)
A constructor for the InverseJacobianMatrix.
Definition: inverse_jacobian_matrix.hpp:27
KOKKOS_INLINE_FUNCTION double inv_jacobian_21(PositionCoordinate const &coord) const
Compute the (2,1) coefficient of the inverse Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:115
KOKKOS_INLINE_FUNCTION Matrix_2x2 operator()(PositionCoordinate const &coord) const
Compute full inverse Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:45
KOKKOS_INLINE_FUNCTION double inv_jacobian_12(PositionCoordinate const &coord) const
Compute the (1,2) coefficient of the inverse Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:94
KOKKOS_INLINE_FUNCTION double inv_jacobian_22(PositionCoordinate const &coord) const
Compute the (2,2) coefficient of the inverse Jacobian matrix.
Definition: inverse_jacobian_matrix.hpp:137