PB3D [2.47]
Ideal linear high-n MHD stability in 3-D
Loading...
Searching...
No Matches
eq_utilities::transf_deriv Interface Reference

Calculates derivatives in a coordinate system B from derivatives in a coordinates system A, making use of the transformation matrix \(\overline{\text{T}}_\text{B}^\text{A}\). More...

Public Member Functions

integer recursive function transf_deriv_3_ind (x_a, t_ba, x_b, max_deriv, deriv_b, deriv_a_input)
 3-D scalar version with one derivative
integer function transf_deriv_3_arr (x_a, t_ba, x_b, max_deriv, derivs)
 3-D scalar version with multiple derivatives
integer function transf_deriv_3_arr_2d (x_a, t_ba, x_b, max_deriv, derivs)
 3-D matrix version with multiple derivatives
integer recursive function transf_deriv_1_ind (x_a, t_ba, x_b, max_deriv, deriv_b, deriv_a_input)
 1-D scalar version with one derivative

Detailed Description

Calculates derivatives in a coordinate system B from derivatives in a coordinates system A, making use of the transformation matrix \(\overline{\text{T}}_\text{B}^\text{A}\).

The routine works by exchanging the derivatives in the coordinates B for derivatives in coordinates A using the formula

\[\mathbf{D}_\text{B}^m X = \overline{\text{T}}_\text{B}^\text{A} \mathbf{D}^1_\text{A} \left(\mathbf{D}^{m-1}_\text{B} X\right) , \]

where \(\mathbf{D}^m\) is a tensor of rank \(m\) that contains all the derivatives of total rank \(m\). For example,

\[\mathbf{D}^1 = \vec{D} = \left(\begin{array}{c}\frac{\partial}{\partial u^1} \\ \frac{\partial}{\partial u^2} \\ \frac{\partial}{\partial u^3} \end{array}\right) \]

This is done for the derivatives in each of the coordinates B until degree 0 is reached.

Furthermore, each of these degrees of derivatives in coordinates B can be be derived optionally in the original coordinate system A, which yields the formula:

\[ \mathbf{D}^p_\text{A} \left(\mathbf{D}^m_\text{B} X \right) = \sum_q \left(\begin{array}{c}p\\q\end{array}\right) \mathbf{D}^q_\text{A} \left(\overline{\text{T}}_\text{B}^\text{A}\right) \left(\mathbf{D}^{p-q}_\text{A} \mathbf{D}^1_\text{A}\right) \left( \mathbf{D}^{m-1}_\text{B} X \right)\]

This way, ultimately the desired derivatives in the coordinates B can be obtained recursively from the lower orders in the coordinates B and higher orders in the coordinates A.

For example:

  • For order \(M\), the formula can be used with \(p=0\).
  • For this, it is necessary that \(\mathbf{D}^1_\text{A} \mathbf{D}^{m-1}_\text{B} X\) be precalculated, which can be done using the formula with \(p=1\) and \(m=M-1\).
  • For this, it is necessary that \(\mathbf{D}^1_\text{A} \mathbf{D}^{M-1}_\text{B} X\) and \(\mathbf{D}^2_\text{A} \mathbf{D}^{M-1}_\text{B} X\) are precalculated, which can be done with \(p=1\) and \(m=M-1\) as well as \(p=2\) and \(m=M-1\).
  • etc.
See also
[17] for more detailed information.
Returns
ierr

Definition at line 118 of file eq_utilities.f90.

Member Function/Subroutine Documentation

◆ transf_deriv_1_ind()

integer recursive function eq_utilities::transf_deriv::transf_deriv_1_ind ( real(dp), dimension(1:,0:), intent(in) x_a,
real(dp), dimension(1:,0:), intent(in) t_ba,
real(dp), dimension(1:), intent(inout) x_b,
integer, intent(in) max_deriv,
integer, intent(in) deriv_b,
integer, intent(in), optional deriv_a_input )

1-D scalar version with one derivative

Parameters
[in]x_avariable and derivs. in coord. system A
[in,out]x_brequested derivs. of variable in coord. system B
[in]t_batransf. mat. and derivs. between coord. systems A and B
[in]deriv_a_inputderivs. in coord. system A (optional)
[in]deriv_bderivs. in coord. system B
[in]max_derivmaximum degrees of derivs.

Definition at line 679 of file eq_utilities.f90.

◆ transf_deriv_3_arr()

integer function eq_utilities::transf_deriv::transf_deriv_3_arr ( real(dp), dimension(1:,1:,1:,0:,0:,0:), intent(in) x_a,
real(dp), dimension(1:,1:,1:,1:,0:,0:,0:), intent(in) t_ba,
real(dp), dimension(1:,1:,1:,0:,0:,0:), intent(inout) x_b,
integer, intent(in) max_deriv,
integer, dimension(:,:), intent(in) derivs )

3-D scalar version with multiple derivatives

Parameters
[in]x_avariable and derivs. in coord. system A
[in]t_batransf. mat. and derivs. between coord. systems A and B
[in,out]x_brequested derivs. of variable in coord. system B
[in]max_derivmaximum degrees of derivs.
[in]derivsseries of derivs. (in coordinate system B)

Definition at line 613 of file eq_utilities.f90.

◆ transf_deriv_3_arr_2d()

integer function eq_utilities::transf_deriv::transf_deriv_3_arr_2d ( real(dp), dimension(1:,1:,1:,1:,0:,0:,0:), intent(in) x_a,
real(dp), dimension(1:,1:,1:,1:,0:,0:,0:), intent(in) t_ba,
real(dp), dimension(1:,1:,1:,1:,0:,0:,0:), intent(inout) x_b,
integer, intent(in) max_deriv,
integer, dimension(:,:), intent(in) derivs )

3-D matrix version with multiple derivatives

Parameters
[in]x_avariable and derivs. in coord. system A
[in]t_batransf. mat. and derivs. between coord. systems A and B
[in,out]x_brequested derivs. of variable in coord. system B
[in]max_derivmaximum degrees of derivs.
[in]derivsseries of derivs. (in coordinate system B)

Definition at line 638 of file eq_utilities.f90.

Here is the call graph for this function:

◆ transf_deriv_3_ind()

integer recursive function eq_utilities::transf_deriv::transf_deriv_3_ind ( real(dp), dimension(1:,1:,1:,0:,0:,0:), intent(in) x_a,
real(dp), dimension(1:,1:,1:,1:,0:,0:,0:), intent(in) t_ba,
real(dp), dimension(1:,1:,1:), intent(inout) x_b,
integer, intent(in) max_deriv,
integer, dimension(:), intent(in) deriv_b,
integer, dimension(:), intent(in), optional deriv_a_input )

3-D scalar version with one derivative

Parameters
[in]x_avariable and derivs. in coord. system A
[in]t_batransf. mat. and derivs. between coord. systems A and B
[in,out]x_brequested derivs. of variable in coord. system B
[in]max_derivmaximum degrees of derivs.
[in]deriv_bderivs. in coord. system B
[in]deriv_a_inputderivs. in coord. system A (optional)

Definition at line 506 of file eq_utilities.f90.


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