eTurb
KTH Toolbox: math

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...
 

Detailed Description

Function/Subroutine Documentation

◆ mth_rand()

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.

Parameters
[in]ix,iy,izGLL point index
[in]iegglobal element number
[in]xlphysical point coordinates
[in]fcoefffunction coefficients
Returns
random distribution

◆ mth_stepf()

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\)

Parameters
[in]xfunction argument
Returns
mth_stepf