KTH framework for Nek5000 toolboxes; testing version
0.0.1
|
Diverse tools for matht or data operations. More...
Files | |
file | math_tools.f |
Set of math related tools for KTH modules. | |
Functions | |
real function | math_stepf (x) |
Step function. More... | |
real function | math_ran_dst (ix, iy, iz, ieg, xl, fcoeff) |
Give random distribution depending on position. More... | |
real function | math_ran_rng (lower, upper) |
Give random number in the defined range. More... | |
real function | math_zbqlu01 () |
Marsaglia-Zaman random number generator. More... | |
subroutine | math_zbqlini (seed) |
Initialise Marsaglia-Zaman random number generator. More... | |
subroutine | math_edgind (istart, istop, iskip, iedg, nx, ny, nz) |
Give bounds for loops to extract edge of a 3D element. More... | |
subroutine | math_etovec (vec, edg, vfld, nx, ny, nz) |
Extract 3D element edge. More... | |
subroutine | math_rot3da (vo, vi, va, an) |
3D rotation of a vector along given axis. More... | |
Diverse tools for matht or data operations.
Set of math related routines for toolbox
subroutine math_edgind | ( | integer | istart, |
integer | istop, | ||
integer | iskip, | ||
integer | iedg, | ||
integer | nx, | ||
integer | ny, | ||
integer | nz | ||
) |
Give bounds for loops to extract edge of a 3D element.
[out] | istart | lower loop bound |
[out] | istop | upper loop bound |
[out] | iskip | stride |
[in] | iedg | edge number |
[in] | nx,ny,nz | element size |
Definition at line 252 of file math_tools.f.
subroutine math_etovec | ( | real, dimension(nx) | vec, |
integer | edg, | ||
real, dimension(nx*ny*nz) | vfld, | ||
integer | nx, | ||
integer | ny, | ||
integer | nz | ||
) |
Extract 3D element edge.
[out] | vec | vector containg edge values |
[in] | edg | edge number |
[in] | vfld | pointer to singe element in the field |
[in] | nx,ny,nz | element size |
Definition at line 298 of file math_tools.f.
References math_edgind().
real function math_ran_dst | ( | 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 random number generator is implementted in ran1. This totally ad-hoc random number generator below could be preferable to the original 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 |
Definition at line 54 of file math_tools.f.
real function math_ran_rng | ( | real | lower, |
real | upper | ||
) |
Give random number in the defined range.
[in] | lower,upper | range for random numer |
Definition at line 81 of file math_tools.f.
References math_zbqlu01().
subroutine math_rot3da | ( | real, dimension(ldim) | vo, |
real, dimension(ldim) | vi, | ||
real, dimension(ldim) | va, | ||
real | an | ||
) |
3D rotation of a vector along given axis.
[in] | vo | output vector |
[in] | vi | input vector |
[in] | va | rotation axis |
[in] | an | rotation angle |
Definition at line 331 of file math_tools.f.
References copy().
real function math_stepf | ( | real | x | ) |
Step function.
Continuous step function:
with and
[in] | x | function argument |
Definition at line 20 of file math_tools.f.
subroutine math_zbqlini | ( | integer | seed | ) |
Initialise Marsaglia-Zaman random number generator.
To initialise the random number generator - either repeatably or nonrepeatably.
[in] | seed | number which generates elements of the array ZBQLIX |
Definition at line 179 of file math_tools.f.
real function math_zbqlu01 |
Marsaglia-Zaman random number generator.
Returns a uniform random number between 0 & 1, using a Marsaglia-Zaman type subtract-with-borrow generator.
Definition at line 119 of file math_tools.f.