Gyselalib++
 
Loading...
Searching...
No Matches
CombinedMapping< Mapping1, Mapping2 > Class Template Reference

A class which describes a mapping which is constructed by combining two mappings. More...

Public Types

using CoordArg = typename Mapping2::CoordArg
 The type of the argument of the function described by this mapping.
 
using CoordResult = typename Mapping1::CoordResult
 The type of the result of the function described by this mapping.
 
using CoordJacobian = typename Mapping2::CoordResult
 The coordinate system on which the Jacobian is described.
 

Public Member Functions

template<class Map1 , std::enable_if_t<(has_singular_o_point_inv_jacobian_v< Map1 >)||(has_singular_o_point_inv_jacobian_v< InverseMapping2 >), bool > = true>
 CombinedMapping (Map1 mapping_1, Mapping2 mapping_2, double epsilon)
 Build a CombinedMapping from the component mappings.
 
template<class Map1 , std::enable_if_t< !((has_singular_o_point_inv_jacobian_v< Map1 >)||(has_singular_o_point_inv_jacobian_v< InverseMapping2 >)), bool > = true>
 CombinedMapping (Map1 mapping_1, Mapping2 mapping_2)
 Build a CombinedMapping from the component mappings.
 
CoordResult operator() (CoordArg coord)
 Convert the argument coordinate to the equivalent result coordinate.
 
KOKKOS_INLINE_FUNCTION void jacobian_matrix (CoordJacobian const &coord, Matrix_2x2 &matrix) const
 Compute full Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double jacobian_11 (CoordJacobian const &coord_rtheta) const
 Compute the (1,1) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double jacobian_12 (CoordJacobian const &coord_rtheta) const
 Compute the (1,2) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double jacobian_21 (CoordJacobian const &coord_rtheta) const
 Compute the (2,1) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double jacobian_22 (CoordJacobian const &coord_rtheta) const
 Compute the (2,2) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double jacobian (CoordJacobian const &coord_rtheta) const
 Compute the determinant of the Jacobian matrix.
 
KOKKOS_FUNCTION void inv_jacobian_matrix (CoordJacobian const &coord, Matrix_2x2 &matrix) const
 Compute the full inverse Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double inv_jacobian_11 (CoordJacobian const &coord_rtheta) const
 Compute the (1,1) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double inv_jacobian_12 (CoordJacobian const &coord_rtheta) const
 Compute the (1,2) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double inv_jacobian_21 (CoordJacobian const &coord_rtheta) const
 Compute the (2,1) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double inv_jacobian_22 (CoordJacobian const &coord_rtheta) const
 Compute the (2,2) coefficient of the Jacobian matrix.
 
KOKKOS_INLINE_FUNCTION double inv_jacobian (CoordJacobian const &coord_rtheta) const
 Compute the determinant of the Jacobian matrix.
 
template<class Mapping >
KOKKOS_INLINE_FUNCTION Mapping const & get () const
 Get access to one of the internal mappings.
 

Detailed Description

template<class Mapping1, class Mapping2>
class CombinedMapping< Mapping1, Mapping2 >

A class which describes a mapping which is constructed by combining two mappings.

Let us denote Mapping1 as \( \mathcal{F} \) and Mapping2 as \( \mathcal{G} \) then this mapping represents: \( \mathcal{F} \circ \mathcal{G} \)

There are therefore 3 domains in this calculation \( \Omega_{start} \), \( \Omega_{mid} \) and \( \Omega_{end} \) with \( \mathcal{F}(\Omega_{mid})\rightarrow\Omega_{end} \) and \( \mathcal{G}(\Omega_{start})\rightarrow\Omega_{mid} \)

The functions in this mapping are defined on the coordinate system associated with the domain \( \Omega_{mid} \).

Constructor & Destructor Documentation

◆ CombinedMapping() [1/2]

template<class Mapping1 , class Mapping2 >
template<class Map1 , std::enable_if_t<(has_singular_o_point_inv_jacobian_v< Map1 >)||(has_singular_o_point_inv_jacobian_v< InverseMapping2 >), bool > = true>
CombinedMapping< Mapping1, Mapping2 >::CombinedMapping ( Map1  mapping_1,
Mapping2  mapping_2,
double  epsilon 
)
inline

Build a CombinedMapping from the component mappings.

This constructor should be used if the inverse jacobian of the first mapping, or the jacobian of the second mapping cannot be evaluated at the O-point.

Parameters
[in]mapping_1The first mapping.
[in]mapping_2The second mapping.
[in]epsilonThe parameter \( \varepsilon \) which determines when a point is close enough to the central O-point for linearization to be required when calculating the inverse of the Jacobian. The Jacobian is linearized on \( r \in [0, \varepsilon] \).

◆ CombinedMapping() [2/2]

template<class Mapping1 , class Mapping2 >
template<class Map1 , std::enable_if_t< !((has_singular_o_point_inv_jacobian_v< Map1 >)||(has_singular_o_point_inv_jacobian_v< InverseMapping2 >)), bool > = true>
CombinedMapping< Mapping1, Mapping2 >::CombinedMapping ( Map1  mapping_1,
Mapping2  mapping_2 
)
inline

Build a CombinedMapping from the component mappings.

This constructor should be used if both mappings can be safely evaluated at all points in space.

Parameters
[in]mapping_1The first mapping.
[in]mapping_2The second mapping.

Member Function Documentation

◆ operator()()

template<class Mapping1 , class Mapping2 >
CoordResult CombinedMapping< Mapping1, Mapping2 >::operator() ( CoordArg  coord)
inline

Convert the argument coordinate to the equivalent result coordinate.

Parameters
[in]coordThe coordinate to be converted.
Returns
The equivalent coordinate.

◆ jacobian_matrix()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION void CombinedMapping< Mapping1, Mapping2 >::jacobian_matrix ( CoordJacobian const &  coord,
Matrix_2x2 &  matrix 
) const
inline

Compute full Jacobian matrix.

For some computations, we need the complete Jacobian matrix or just the coefficients. This is calculated by combining the Jacobian matrices of the 2 curvilinear mappings.

\( J_{(x_{in}, y_{in})->(x_{out},y_{out})} = J_{F\circ G} \) \( = J_{(x_{mid}, y_{mid})->(x_{out},y_{out})}J_{(x_{in}, y_{in})->(x_{mid}, y_{mid})} = J_F J_G \) \( = J_{(x_{mid}, y_{mid})->(x_{out},y_{out})} [J_{(x_{mid}, y_{mid})->(x_{in}, y_{in})}]^{-1} = J_F [J_{G^{-1}}]^{-1} \)

The Jacobians that are used for the calculation must be mappings from \( (x_{mid}, y_{mid}) \) so they can be calculated on the correct coordinate system.

Parameters
[in]coordThe coordinate where we evaluate the Jacobian matrix.
[out]matrixThe calculated Jacobian matrix.

◆ jacobian_11()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::jacobian_11 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (1,1) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,1) coefficient of the Jacobian matrix.

◆ jacobian_12()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::jacobian_12 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (1,2) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,2) coefficient of the Jacobian matrix.

◆ jacobian_21()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::jacobian_21 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (2,1) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,1) coefficient of the Jacobian matrix.

◆ jacobian_22()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::jacobian_22 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (2,2) coefficient of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,2) coefficient of the Jacobian matrix.

◆ jacobian()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::jacobian ( CoordJacobian const &  coord_rtheta) const
inline

Compute the determinant of the Jacobian matrix.

See also
jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The determinant of the Jacobian matrix.

◆ inv_jacobian_matrix()

template<class Mapping1 , class Mapping2 >
KOKKOS_FUNCTION void CombinedMapping< Mapping1, Mapping2 >::inv_jacobian_matrix ( CoordJacobian const &  coord,
Matrix_2x2 &  matrix 
) const
inline

Compute the full inverse Jacobian matrix.

If one of the mappings is singular then this function linearises the inverse Jacobian between the O-point and \( r = \varepsilon \). The inverse Jacobian at the O-point is calculated using the class InvJacobianOPoint in this case. The inverse Jacobian at a point where the matrices are not singular is calculated using non_singular_inverse_jacobian_matrix

Parameters
[in]coordThe coordinate where we evaluate the inverse Jacobian matrix.
[out]matrixThe caluclated inverse Jacobian matrix.
See also
non_singular_inverse_jacobian_matrix

◆ inv_jacobian_11()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::inv_jacobian_11 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (1,1) coefficient of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,1) coefficient of the Jacobian matrix.

◆ inv_jacobian_12()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::inv_jacobian_12 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (1,2) coefficient of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (1,2) coefficient of the Jacobian matrix.

◆ inv_jacobian_21()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::inv_jacobian_21 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (2,1) coefficient of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,1) coefficient of the Jacobian matrix.

◆ inv_jacobian_22()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::inv_jacobian_22 ( CoordJacobian const &  coord_rtheta) const
inline

Compute the (2,2) coefficient of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The (2,2) coefficient of the Jacobian matrix.

◆ inv_jacobian()

template<class Mapping1 , class Mapping2 >
KOKKOS_INLINE_FUNCTION double CombinedMapping< Mapping1, Mapping2 >::inv_jacobian ( CoordJacobian const &  coord_rtheta) const
inline

Compute the determinant of the Jacobian matrix.

See also
inv_jacobian_matrix
Parameters
[in]coord_rthetaThe coordinate where we evaluate the Jacobian matrix.
Returns
The determinant of the Jacobian matrix.

◆ get()

template<class Mapping1 , class Mapping2 >
template<class Mapping >
KOKKOS_INLINE_FUNCTION Mapping const & CombinedMapping< Mapping1, Mapping2 >::get ( ) const
inline

Get access to one of the internal mappings.

Template Parameters
MappingThe mapping that we want to access.
Returns
A constant reference to the internal mapping.

The documentation for this class was generated from the following file: