Gyselalib++
PseudoCartesianCompatibleMapping Class Referenceabstract

An operator to calculate the Jacobian matrix of the mapping from the physical domain to the pseudo-Cartesian domain at the central point. More...

Inheritance diagram for PseudoCartesianCompatibleMapping:
CircularToCartesian< X, Y, R, Theta > CzarnyToCartesian< X, Y, R, Theta > DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >

Public Types

using Matrix_2x2 = std::array< std::array< double, 2 >, 2 >
 The type of the pseudo-Cartesian Jacobian matrix and its inverse.
 

Public Member Functions

virtual KOKKOS_FUNCTION void to_pseudo_cartesian_jacobian_center_matrix (Matrix_2x2 &matrix) const =0
 Compute the full Jacobian matrix from the mapping to the pseudo-Cartesian mapping at the central point. More...
 
virtual KOKKOS_FUNCTION double to_pseudo_cartesian_jacobian_11_center () const =0
 Compute the (1,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point. More...
 
virtual KOKKOS_FUNCTION double to_pseudo_cartesian_jacobian_12_center () const =0
 Compute the (1,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point. More...
 
virtual KOKKOS_FUNCTION double to_pseudo_cartesian_jacobian_21_center () const =0
 Compute the (2,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point. More...
 
virtual KOKKOS_FUNCTION double to_pseudo_cartesian_jacobian_22_center () const =0
 Compute the (2,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point. More...
 

Detailed Description

An operator to calculate the Jacobian matrix of the mapping from the physical domain to the pseudo-Cartesian domain at the central point.

All operators which can calculate the pseudo-Cartesian Jacobian at the central point should inherit from this class.

Some mapping can be difficult to invert especially at the central point. In the case of a non-analytically invertible mapping, we can work in another domain called the pseudo-Cartesian domain. In this domain, it is easier to inverse the Jacobian matrix. The idea is detailed in Edoardo Zoni's article (Solving hyperbolic-elliptic problems on singular mapped disk-like domains with the method of characteristics and spline finite elements, https://doi.org/10.1016/j.jcp.2019.108889)

The mapping maps from the logical domain to the physical domain \( \mathcal{F}: (r,\theta) \mapsto (x, y)\). The pseudo-Cartesian domain is built with \( \mathcal{F} \) and using the circular mapping \( \mathcal{G} \):

  • \( \mathcal{G}_{11}(r, \theta) = \cos(\theta), \qquad\quad \mathcal{G}_{12}(r, \theta) = \sin(\theta) \),
  • \( \mathcal{G}_{21}(r, \theta) = -\frac{1}{r}\sin(\theta), \qquad\quad \mathcal{G}_{22}(r, \theta) = \frac{1}{r}\cos(\theta) \).

The pseudo-Cartesian domain is obtained by the composition of both mappings: \( (\mathcal{F} \circ \mathcal{G}^{-1})^{-1} \). This new mapping is invertible and its inverse at the central point is given by

  • \( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})_{11}(0, \theta) = \partial_r x (0, \theta) \cos(\theta) - \partial_{r \theta} x (0, \theta) \sin(\theta), \)
  • \( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})_{12}(0, \theta) = \partial_r x (0, \theta) \sin(\theta) + \partial_{r \theta} x (0, \theta) \cos(\theta), \)
  • \( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})_{21}(0, \theta) = \partial_r y (0, \theta) \cos(\theta) - \partial_{r \theta} y (0, \theta) \sin(\theta), \)
  • \( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})_{22}(0, \theta) = \partial_r y (0, \theta) \sin(\theta) + \partial_{r \theta} y (0, \theta) \cos(\theta). \)

The pseudo-Cartesian Jacobian matrix at the central point, \( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})^{-1}(0, \theta) \), is obtained by inversing this matrix.

For analytical invertible mappings, this technique is not necessary, but it is still possible to define and use the matrix in order to handle problems in a general manner.

Member Function Documentation

◆ to_pseudo_cartesian_jacobian_center_matrix()

virtual KOKKOS_FUNCTION void PseudoCartesianCompatibleMapping::to_pseudo_cartesian_jacobian_center_matrix ( Matrix_2x2 matrix) const
pure virtual

Compute the full Jacobian matrix from the mapping to the pseudo-Cartesian mapping at the central point.

Parameters
[out]matrixThe pseudo-Cartesian matrix evaluated at the central point.
See also
DiscreteToCartesian
BslAdvection
AdvectionDomain

Implemented in DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CzarnyToCartesian< X, Y, R, Theta >, and CircularToCartesian< X, Y, R, Theta >.

◆ to_pseudo_cartesian_jacobian_11_center()

virtual KOKKOS_FUNCTION double PseudoCartesianCompatibleMapping::to_pseudo_cartesian_jacobian_11_center ( ) const
pure virtual

Compute the (1,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

\( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})^{-1}_{11}(0, \theta) = \partial_r x (0, \theta) \cos(\theta) - \partial_{r \theta} x (0, \theta) \sin(\theta) \)

Parameters
[in]gridThe domain where the mapping is defined.
Returns
A double with the (1,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

Implemented in DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CzarnyToCartesian< X, Y, R, Theta >, and CircularToCartesian< X, Y, R, Theta >.

◆ to_pseudo_cartesian_jacobian_12_center()

virtual KOKKOS_FUNCTION double PseudoCartesianCompatibleMapping::to_pseudo_cartesian_jacobian_12_center ( ) const
pure virtual

Compute the (1,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

\( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})^{-1}_{12}(0, \theta) = \partial_r x (0, \theta) \sin(\theta) + \partial_{r \theta} x (0, \theta) \cos(\theta) \)

Parameters
[in]gridThe domain where the mapping is defined.
Returns
A double with the (1,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

Implemented in DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CzarnyToCartesian< X, Y, R, Theta >, and CircularToCartesian< X, Y, R, Theta >.

◆ to_pseudo_cartesian_jacobian_21_center()

virtual KOKKOS_FUNCTION double PseudoCartesianCompatibleMapping::to_pseudo_cartesian_jacobian_21_center ( ) const
pure virtual

Compute the (2,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

\( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})^{-1}_{21}(0, \theta) = \partial_r y (0, \theta) \cos(\theta) - \partial_{r \theta} y (0, \theta) \sin(\theta)\)

Parameters
[in]gridThe domain where the mapping is defined.
Returns
A double with the (2,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

Implemented in DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CzarnyToCartesian< X, Y, R, Theta >, and CircularToCartesian< X, Y, R, Theta >.

◆ to_pseudo_cartesian_jacobian_22_center()

virtual KOKKOS_FUNCTION double PseudoCartesianCompatibleMapping::to_pseudo_cartesian_jacobian_22_center ( ) const
pure virtual

Compute the (2,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

\( (J_{\mathcal{F}}J_{\mathcal{G}}^{-1})^{-1}_{22}(0, \theta) = \partial_r y (0, \theta) \sin(\theta) + \partial_{r \theta} y (0, \theta) \cos(\theta) \)

Parameters
[in]gridThe domain where the mapping is defined.
Returns
A double with the (2,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.

Implemented in DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >, CzarnyToCartesian< X, Y, R, Theta >, and CircularToCartesian< X, Y, R, Theta >.


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