PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
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... | |
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:
Definition at line 118 of file eq_utilities.f90.
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
[in] | x_a | variable and derivs. in coord. system A |
[in,out] | x_b | requested derivs. of variable in coord. system B |
[in] | t_ba | transf. mat. and derivs. between coord. systems A and B |
[in] | deriv_a_input | derivs. in coord. system A (optional) |
[in] | deriv_b | derivs. in coord. system B |
[in] | max_deriv | maximum degrees of derivs. |
Definition at line 681 of file eq_utilities.f90.
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
[in] | x_a | variable and derivs. in coord. system A |
[in] | t_ba | transf. mat. and derivs. between coord. systems A and B |
[in,out] | x_b | requested derivs. of variable in coord. system B |
[in] | max_deriv | maximum degrees of derivs. |
[in] | derivs | series of derivs. (in coordinate system B) |
Definition at line 615 of file eq_utilities.f90.
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
[in] | x_a | variable and derivs. in coord. system A |
[in] | t_ba | transf. mat. and derivs. between coord. systems A and B |
[in,out] | x_b | requested derivs. of variable in coord. system B |
[in] | max_deriv | maximum degrees of derivs. |
[in] | derivs | series of derivs. (in coordinate system B) |
Definition at line 640 of file eq_utilities.f90.
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
[in] | x_a | variable and derivs. in coord. system A |
[in] | t_ba | transf. mat. and derivs. between coord. systems A and B |
[in,out] | x_b | requested derivs. of variable in coord. system B |
[in] | max_deriv | maximum degrees of derivs. |
[in] | deriv_b | derivs. in coord. system B |
[in] | deriv_a_input | derivs. in coord. system A (optional) |
Definition at line 508 of file eq_utilities.f90.