PB3D  [2.45]
Ideal linear high-n MHD stability in 3-D
Public Member Functions | List of all members
grid_utilities::calc_tor_diff Interface Reference

Calculates the toroidal difference for a magnitude calculated on three toroidal points: two extremities and one in the middle. More...

Public Member Functions

integer function calc_tor_diff_0d (v_mag, theta, norm_disc_prec, absolute, r)
 0-D version More...
 
integer function calc_tor_diff_2d (v_com, theta, norm_disc_prec, absolute, r)
 2-D version More...
 

Detailed Description

Calculates the toroidal difference for a magnitude calculated on three toroidal points: two extremities and one in the middle.

This is done using the formula

\[ \frac{b-a}{b+a} , \]

for the relative difference between \(a\) and \(b\). This is useful when it is used to calculate a toroidal ripple and these are the extreme points.

The procedure also needs the map between the flux poloidal angle and the geometrical poloidal angle.

In a first step the quantity is interpolated on an equidistant grid in the geometrical poloidal angle.

The difference is then calculated for values of constant geometric poloidal angle.

Finally, this result is transformed back to the Flux coordinates.

Note
  1. The theta map should have first and last point equal.
  2. This routine should be used only for periodic quantities (so not for some of the Flux quantities that are defined along generally non-rational magnetic field lines).
Returns
ierr

Definition at line 109 of file grid_utilities.f90.

Member Function/Subroutine Documentation

◆ calc_tor_diff_0d()

integer function grid_utilities::calc_tor_diff::calc_tor_diff_0d ( real(dp), dimension(:,:,:), intent(inout)  v_mag,
real(dp), dimension(:,:,:), intent(in)  theta,
integer, intent(in)  norm_disc_prec,
logical, intent(in), optional  absolute,
real(dp), dimension(:), intent(in), optional  r 
)

0-D version

Parameters
[in,out]v_magmagnitude (dim1,dim2,dim3)
[in]thetageometric poloidal angle
[in]norm_disc_precprecision for normal derivatives
[in]absolutecalculate absolute, not relative, difference
[in]rnormal positions for theta

Definition at line 746 of file grid_utilities.f90.

◆ calc_tor_diff_2d()

integer function grid_utilities::calc_tor_diff::calc_tor_diff_2d ( real(dp), dimension(:,:,:,:,:), intent(inout)  v_com,
real(dp), dimension(:,:,:), intent(in)  theta,
integer, intent(in)  norm_disc_prec,
logical, intent(in), optional  absolute,
real(dp), dimension(:), intent(in), optional  r 
)

2-D version

Parameters
[in,out]v_comcovariant and contravariant components (dim1,dim2,dim3,3,2)
[in]thetageometric poloidal angle
[in]norm_disc_precprecision for normal derivatives
[in]absolutecalculate absolute, not relative, difference
[in]rnormal positions for theta

Definition at line 633 of file grid_utilities.f90.

+ Here is the call graph for this function:

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