Files | |
file | math_tools.f |
Set of math related tools for KTH modules. | |
Functions/Subroutines | |
real function | mth_stepf (x) |
Step function. More... | |
real function | mth_rand (ix, iy, iz, ieg, xl, fcoeff) |
Give random distribution depending on position. More... | |
real function mth_rand | ( | integer | ix, |
integer | iy, | ||
integer | iz, | ||
integer | ieg, | ||
real, dimension(ldim) | xl, | ||
real, dimension(3) | fcoeff | ||
) |
Give random distribution depending on position.
The original Nek5000 rundom number generator is implementted in ran1. This totally ad-hoc random number generator below could be preferable to the origina one for the simple reason that it gives the same initial cindition independent of the number of processors, which is important for code verification.
[in] | ix,iy,iz | GLL point index |
[in] | ieg | global element number |
[in] | xl | physical point coordinates |
[in] | fcoeff | function coefficients |
real function mth_stepf | ( | real | x | ) |
Step function.
Continuous step function:
\begin{eqnarray*} stepf(x) = \left\{ \begin{array}{ll} 0 &\mbox{ if $x \leq x_{min}$} \\ \left(1+e^{\left((x-1)^{-1} + x^{-1}\right)}\right)^{-1} &\mbox{ if $x \leq x_{max}$} \\ 1 &\mbox{ if $x > x_{max}$} \end{array} \right. \end{eqnarray*}
with \( x_{min} = 0.02\) and \( x_{max}=0.98\)
[in] | x | function argument |