PB3D  [2.45]
Ideal linear high-n MHD stability in 3-D
Public Member Functions | List of all members
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 More...
 
integer function transf_deriv_3_arr (X_A, T_BA, X_B, max_deriv, derivs)
 3-D scalar version with multiple derivatives More...
 
integer function transf_deriv_3_arr_2d (X_A, T_BA, X_B, max_deriv, derivs)
 3-D matrix version with multiple derivatives More...
 
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 More...
 

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:

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 681 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 615 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 640 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 508 of file eq_utilities.f90.

+ Here is the call graph for this function:

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