PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
Integrates a function using the trapezoidal rule. More...
Public Member Functions | |
integer function | calc_int_eqd (var, step_size, var_int) |
equidistant version More... | |
integer function | calc_int_reg (var, x, var_int) |
regular version More... | |
Integrates a function using the trapezoidal rule.
This function can be defined on an equidistant grid or a regular one:
\[\int_1^n f(x) dx = \sum_{k=1}^{n-1} {\left(f(k+1)+f(k)\right) \frac{\Delta_x}{2}},\]
is used, with \(n\) the number of points, which are assumed to be equidistant with a given step size \(Delta_x\).\[\int_1^n f(x) dx = \sum_{k=1}^{n-1} {\left(f(k+1)+f(k)\right) \frac{x(k+1)-x(k)}{2}}, \]
is used, with \(n\) the number of points.\[\int_1^n f(x) dx = \int_1^{n-1} f(x) dx + \left(f(n)+f(n-1)\right) \frac{x(n)-x(n-1)}{2},\]
which is used hereDefinition at line 160 of file num_utilities.f90.
integer function num_utilities::calc_int::calc_int_eqd | ( | real(dp), dimension(:), intent(in) | var, |
real(dp), intent(in) | step_size, | ||
real(dp), dimension(:), intent(inout) | var_int | ||
) |
equidistant version
[in,out] | var_int | integrated variable |
[in] | var | variable to be integrated |
[in] | step_size | step size of abscissa |
Definition at line 327 of file num_utilities.f90.
integer function num_utilities::calc_int::calc_int_reg | ( | real(dp), dimension(:), intent(in) | var, |
real(dp), dimension(:), intent(in) | x, | ||
real(dp), dimension(:), intent(inout) | var_int | ||
) |
regular version
[in,out] | var_int | integrated variable |
[in] | var | variable to be integrated |
[in] | x | abscissa |
Definition at line 286 of file num_utilities.f90.