|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with explicit math functions. More...
Data Types | |
| type | splinedata |
| Data type for spline functions. More... | |
| interface | funcvalue |
| Evaluates a function. More... | |
| interface | funcderivative |
| Evaluates the derivative of a function. More... | |
Functions/Subroutines | |
| subroutine, private | funcvalue1 (ikf, ifunc, rfunc, x, fn, ierr) |
| Evaluates an explicit function. More... | |
| subroutine, private | funcvalue2 (ikf, ifunc, rfunc, x, fn, ierr) |
| Evaluates an (possibly) multi-argument explicit function. More... | |
| subroutine, private | funcderivative1 (ikf, iorder, ifunc, rfunc, x, fn, ierr) |
| Evaluates the derivative of an explicit function. More... | |
| subroutine, private | funcderivative2 (ikf, iorder, ifunc, rfunc, x, fn, ierr) |
| Evaluates the derivative of a multi-argument explicit function. More... | |
| subroutine | funcintegral (ikf, iorder, ifunc, rfunc, x, fn, ierr) |
| Integrates an explicit function from 0.0 to x. More... | |
| logical function | canintegrateexplicitly (funcType, intOrder) |
| Query function telling if a function can be integrated explicitly. More... | |
| subroutine, private | outofrangeerror (X, X0, X1) |
| Prints an error message when function argument is out of range. More... | |
| real(dp) function | func1 (IFUNC, RFUNC, T, X) |
| Simple sinusoidal function. More... | |
| real(dp) function | func2 (RFUNC, T, X, useTmin) |
| Complex sinusoidal function composed of two sine waves. More... | |
| real(dp) function | func4 (IFUNC, RFUNC, T, X, IERR) |
| Complex sinusoidal function composed of many sine waves. More... | |
| real(dp) function | func5 (IKF, IFUNC, RFUNC, constT, IERR) |
| Servo simulator function. More... | |
| real(dp) function | func6 (IKF, IFUNC, RFUNC, T, IERR) |
| Spline function. More... | |
| subroutine | deallocatesplines () |
| Deallocates all spline function data. More... | |
| subroutine, private | splin3 (X, Y, DERIV, N, Z, FVALUE, FDERIV, M, IOP, IERR) |
| Computes a spline approximation from a set of points. More... | |
| real(dp) function | func8 (RFUNC, T, X, IERR) |
| Evaluates the streamline wave profile at point X and time T. More... | |
| real(dp) function | func9 (IFUNC, RFUNC, T, X, IERR) |
| Evaluates the embedded wave profile at point X and time T. More... | |
| real(dp) function | func10 (IKF, IFUNC, RFUNC, X, IERR) |
| Evaluates a piece-wise linear function at the given point. More... | |
| real(dp) function, private | func10diff (IKF, IFUNC, RFUNC, X, IERR) |
| Evaluates the derivative of a piece-wise linear function. More... | |
| real(dp) function, private | func10integral (IKF, IFUNC, RFUNC, X, IORD, IERR) |
| Integrates a piece-wise linear function from 0.0 to X. More... | |
| real(dp) function | func11 (RFUNC, T) |
| Ramp function. More... | |
| real(dp) function, private | rampintegral (IORD, X, OFFSET, SLOPE, X0, X3) |
| Integrate a ramp function from 0.0 to X. More... | |
| real(dp) function | func12 (RFUNC, T) |
| Step function. More... | |
| real(dp) function | func13 (RFUNC, T) |
| Square pulse function. More... | |
| real(dp) function | func14 (RFUNC, T) |
| Dirac pulse function. More... | |
| real(dp) function | func15 (RFUNC) |
| Constant function. More... | |
| real(dp) function | func16 (RFUNC, T) |
| Extended ramp function. More... | |
| real(dp) function | func17 (RFUNC, T) |
| Linear function. More... | |
| real(dp) function | func18 (ikf, iFunc, rFunc, arg, ierr) |
| Calls a C-function to read and interpolate a function from a file. More... | |
| real(dp) function, private | func18integral (ikf, iFunc, rFunc, arg, iorder, ierr) |
| Calls a C-function to read and integrate a function from a file. More... | |
| real(dp) function | func19 (ikf, iFunc, arg, ierr) |
| Calls a C-function to get function value of an expression function. More... | |
| real(dp) function | func19diff (ikf, iFunc, arg, ierr) |
| Calls a C-function to get derivative of an expression function. More... | |
| real(dp) function | func20 (ikf, iFunc, args, ierr) |
| Calls a C-function to get function value of an expression function. More... | |
| real(dp) function | func20diff (ikf, iFunc, args, ierr) |
| Calls a C-function to get derivative of an expression function. More... | |
| real(dp) function | func21 (ikf, iFunc, rFunc, args, ierr) |
| Calls a C-function to get function value of a user-defined function. More... | |
| real(dp) function | func21diff (ikf, iFunc, rFunc, args, ierr) |
| Calls a C-function to get derivative of a user-defined function. More... | |
| real(dp) function | func22 (IKF, RFUNC, T, IERR) |
| Smooth trajectory function. More... | |
Variables | |
| integer, parameter, private | dp = kind(1.0D0) |
| 8-byte real (double) More... | |
| real(dp), parameter, private | pi = 3.141592653589793238_dp |
| The value of π. More... | |
| real(dp), parameter, private | twopi = PI+PI |
| The value of 2π. More... | |
| real(dp), parameter, private | epsarg_p = 1.0e-15_dp |
| Argument tolerance. More... | |
| integer, parameter | maxfunc_p = 22 |
| Number of function types. More... | |
| integer, parameter | sinusoidal_p = 1 |
| integer, parameter | compl_sinus_p = 2 |
| integer, parameter | delayed_compl_sinus_p = 3 |
| integer, parameter | wave_sinus_p = 4 |
| integer, parameter | lin_vel_var_p = 5 |
| integer, parameter | spline_p = 6 |
| integer, parameter | wave_stokes5_p = 7 |
| integer, parameter | wave_streamline_p = 8 |
| integer, parameter | wave_embedded_p = 9 |
| integer, parameter | lin_var_p = 10 |
| integer, parameter | ramp_p = 11 |
| integer, parameter | step_p = 12 |
| integer, parameter | square_puls_p = 13 |
| integer, parameter | dirac_puls_p = 14 |
| integer, parameter | constant_p = 15 |
| integer, parameter | lim_ramp_p = 16 |
| integer, parameter | scale_p = 17 |
| integer, parameter | device_function_p = 18 |
| integer, parameter | math_expression_p = 19 |
| integer, parameter | user_defined_p = 21 |
| integer, parameter | smooth_traj_p = 22 |
| character(len=19), dimension(maxfunc_p), parameter | functype_p = (/ 'SINUSOIDAL ', 'COMPL_SINUS ', 'DELAYED_COMPL_SINUS', 'WAVE_SINUS ', 'LIN_VEL_VAR ', 'SPLINE ', 'WAVE_STOKES5 ', 'WAVE_STREAMLINE ', 'WAVE_EMBEDDED ', 'LIN_VAR ', 'RAMP ', 'STEP ', 'SQUARE_PULS ', 'DIRAC_PULS ', 'CONSTANT ', 'LIM_RAMP ', 'SCALE ', 'DEVICE_FUNCTION ', 'MATH_EXPRESSION ', 'MATH_EXPRESSION ', 'USER_DEFINED ', 'SMOOTH_TRAJ ' /) |
| Function type names. More... | |
| integer, save | dbgfunc = 0 |
| File unit number of debug print. More... | |
| integer, parameter | nspln_p = 6 |
| Max. number of spline functions in core. More... | |
| type(splinedata), dimension(nspln_p), save, private | spl |
| Internal spline data buffer. More... | |
| integer, dimension(nspln_p), save | last = 0 |
| Identifier for splines in core. More... | |
Module with explicit math functions.
This module contains a collection of Fortran functions for evaluating explicit math functions. It consists of the following functions:
Originally, this module was writtene by Ole Iver Sivertsen (OIS) in 1984, and later converted to Fortran90 by Bjorn Haugen in 1999.
| logical function explicitfunctionsmodule::canintegrateexplicitly | ( | integer, intent(in) | funcType, |
| integer, intent(in) | intOrder | ||
| ) |
Query function telling if a function can be integrated explicitly.
| subroutine explicitfunctionsmodule::deallocatesplines |
Deallocates all spline function data.
| real(dp) function explicitfunctionsmodule::func1 | ( | integer, dimension(3), intent(in) | IFUNC, |
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | X | ||
| ) |
Simple sinusoidal function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func10 | ( | integer, intent(in) | IKF, |
| integer, dimension(:), intent(in) | IFUNC, | ||
| real(dp), dimension(:,:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | X, | ||
| integer, intent(inout) | IERR | ||
| ) |
Evaluates a piece-wise linear function at the given point.
| [in] | IKF | Function identification number |
| [in] | IFUNC | Integer function input parameters |
| [in] | RFUNC | Real function input parameters |
| [in] | X | Function argument |
| [out] | ierr | Error indicator |

|
private |
Evaluates the derivative of a piece-wise linear function.
| [in] | IKF | Function identification number |
| [in] | IFUNC | Integer function input parameters |
| [in] | RFUNC | Real function input parameters |
| [in] | X | Function argument |
| [out] | ierr | Error indicator |

|
private |
Integrates a piece-wise linear function from 0.0 to X.
| [in] | IKF | Function identification number |
| [in] | IFUNC | Integer function input parameters |
| [in] | RFUNC | Real function input parameters |
| [in] | X | Function argument, upper range of integration domain |
| [in] | IORD | Integration order (0, 1, or 2) |
| [out] | ierr | Error indicator |

| real(dp) function explicitfunctionsmodule::func11 | ( | real(dp), dimension(3), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Ramp function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func12 | ( | real(dp), dimension(3), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Step function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func13 | ( | real(dp), dimension(4), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Square pulse function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func14 | ( | real(dp), dimension(4), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Dirac pulse function.
The following is from the original FORTRAN-77 documententation:

Constant function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func16 | ( | real(dp), dimension(4), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Extended ramp function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func17 | ( | real(dp), dimension(1), intent(in) | RFUNC, |
| real(dp), intent(in) | T | ||
| ) |
Linear function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func18 | ( | integer, intent(in) | ikf, |
| integer, dimension(5), intent(in) | iFunc, | ||
| real(dp), dimension(2), intent(in) | rFunc, | ||
| real(dp), intent(in) | arg, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to read and interpolate a function from a file.

|
private |
Calls a C-function to read and integrate a function from a file.

| real(dp) function explicitfunctionsmodule::func19 | ( | integer, intent(in) | ikf, |
| integer, dimension(3), intent(in) | iFunc, | ||
| real(dp), intent(in) | arg, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get function value of an expression function.

| real(dp) function explicitfunctionsmodule::func19diff | ( | integer, intent(in) | ikf, |
| integer, dimension(3), intent(in) | iFunc, | ||
| real(dp), intent(in) | arg, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get derivative of an expression function.

| real(dp) function explicitfunctionsmodule::func2 | ( | real(dp), dimension(:), intent(in) | RFUNC, |
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | X, | ||
| logical, intent(in) | useTmin | ||
| ) |
Complex sinusoidal function composed of two sine waves.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func20 | ( | integer, intent(in) | ikf, |
| integer, dimension(4), intent(in) | iFunc, | ||
| real(dp), dimension(:), intent(in) | args, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get function value of an expression function.

| real(dp) function explicitfunctionsmodule::func20diff | ( | integer, intent(in) | ikf, |
| integer, dimension(4), intent(in) | iFunc, | ||
| real(dp), dimension(:), intent(in) | args, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get derivative of an expression function.

| real(dp) function explicitfunctionsmodule::func21 | ( | integer, intent(in) | ikf, |
| integer, dimension(4), intent(in) | iFunc, | ||
| real(dp), dimension(:), intent(in) | rFunc, | ||
| real(dp), dimension(:), intent(in) | args, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get function value of a user-defined function.

| real(dp) function explicitfunctionsmodule::func21diff | ( | integer, intent(in) | ikf, |
| integer, dimension(4), intent(in) | iFunc, | ||
| real(dp), dimension(:), intent(in) | rFunc, | ||
| real(dp), dimension(:), intent(in) | args, | ||
| integer, intent(inout) | ierr | ||
| ) |
Calls a C-function to get derivative of a user-defined function.

| real(dp) function explicitfunctionsmodule::func22 | ( | integer, intent(in) | IKF, |
| real(dp), dimension(4), intent(in) | RFUNC, | ||
| real(dp), intent(in) | T, | ||
| integer, intent(inout) | IERR | ||
| ) |
Smooth trajectory function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func4 | ( | integer, dimension(:), intent(in) | IFUNC, |
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | X, | ||
| integer, intent(inout) | IERR | ||
| ) |
Complex sinusoidal function composed of many sine waves.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func5 | ( | integer, intent(in) | IKF, |
| integer, dimension(:), intent(in) | IFUNC, | ||
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | constT, | ||
| integer, intent(inout) | IERR | ||
| ) |
Servo simulator function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func6 | ( | integer, intent(in) | IKF, |
| integer, dimension(:), intent(in) | IFUNC, | ||
| real(dp), dimension(:,:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | T, | ||
| integer, intent(inout) | IERR | ||
| ) |
Spline function.
The following is from the original FORTRAN-77 documententation:

| real(dp) function explicitfunctionsmodule::func8 | ( | real(dp), dimension(:), intent(in) | RFUNC, |
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | X, | ||
| integer, intent(inout) | IERR | ||
| ) |
Evaluates the streamline wave profile at point X and time T.
| [in] | RFUNC | Wave data, output from wavefunctionsmodule::initfunc8 |
| [in] | T | Current time |
| [in] | X | Current position |
| [out] | IERR | Error indicator |

| real(dp) function explicitfunctionsmodule::func9 | ( | integer, dimension(:), intent(in) | IFUNC, |
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | X, | ||
| integer, intent(inout) | IERR | ||
| ) |
Evaluates the embedded wave profile at point X and time T.
| [in] | IFUNC | Wave data, output from wavefunctionsmodule::initfunc9 |
| [in] | RFUNC | Wave data, output from wavefunctionsmodule::initfunc9 |
| [in] | T | Current time |
| [in] | X | Current position |
| [out] | IERR | Error indicator |

|
private |
Evaluates the derivative of an explicit function.
| [in] | ikf | Function identification number |
| [in] | iorder | Derivative order |
| [in] | ifunc | Integer function input parameters |
| [in] | rfunc | Real function input parameters |
| [in] | x | Function argument |
| [out] | fn | Derivative of function |
| [out] | ierr | Error indicator |
|
private |
Evaluates the derivative of a multi-argument explicit function.
| [in] | ikf | Function identification number |
| [in] | iorder | Derivative order |
| [in] | ifunc | Integer function input parameters |
| [in] | rfunc | Real function input parameters |
| [in] | x | Function arguments |
| [out] | fn | Derivative of function |
| [out] | ierr | Error indicator |
| subroutine explicitfunctionsmodule::funcintegral | ( | integer, intent(in) | ikf, |
| integer, intent(in) | iorder, | ||
| integer, dimension(:), intent(in) | ifunc, | ||
| real(dp), dimension(:), intent(in) | rfunc, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(out) | fn, | ||
| integer, intent(inout) | ierr | ||
| ) |
Integrates an explicit function from 0.0 to x.
| [in] | ikf | Function identification number |
| [in] | iorder | Integration order |
| [in] | ifunc | Integer function input parameters |
| [in] | rfunc | Real function input parameters |
| [in] | x | Function arguments |
| [out] | fn | Integral of function |
| [out] | ierr | Error indicator |

|
private |
Evaluates an explicit function.
| [in] | ikf | Function identification number |
| [in] | ifunc | Integer function input parameters |
| [in] | rfunc | Real function input parameters |
| [in] | x | Function argument |
| [out] | fn | Value of function |
| [out] | ierr | Error indicator |
|
private |
Evaluates an (possibly) multi-argument explicit function.
| [in] | ikf | Function identification number |
| [in] | ifunc | Integer function input parameters |
| [in] | rfunc | Real function input parameters |
| [in] | x | Function arguments |
| [out] | fn | Value of function |
| [out] | ierr | Error indicator |
|
private |
Prints an error message when function argument is out of range.
|
private |
Integrate a ramp function from 0.0 to X.
| [in] | IORD | Integration order (1 or 2) |
| [in] | X | End point of integration |
| [in] | OFFSET | Function value offset |
| [in] | SLOPE | Ramp slope |
| [in] | X0 | Start point for ramp |
| [in] | X3 | End point for ramp |

|
private |
Computes a spline approximation from a set of points.
The following is from the original FORTRAN-77 documententation:
| integer, parameter explicitfunctionsmodule::compl_sinus_p = 2 |
| integer, parameter explicitfunctionsmodule::constant_p = 15 |
| integer, save explicitfunctionsmodule::dbgfunc = 0 |
File unit number of debug print.
| integer, parameter explicitfunctionsmodule::delayed_compl_sinus_p = 3 |
| integer, parameter explicitfunctionsmodule::device_function_p = 18 |
| integer, parameter explicitfunctionsmodule::dirac_puls_p = 14 |
|
private |
8-byte real (double)
|
private |
Argument tolerance.
| character(len=19), dimension(maxfunc_p), parameter explicitfunctionsmodule::functype_p = (/ 'SINUSOIDAL ', 'COMPL_SINUS ', 'DELAYED_COMPL_SINUS', 'WAVE_SINUS ', 'LIN_VEL_VAR ', 'SPLINE ', 'WAVE_STOKES5 ', 'WAVE_STREAMLINE ', 'WAVE_EMBEDDED ', 'LIN_VAR ', 'RAMP ', 'STEP ', 'SQUARE_PULS ', 'DIRAC_PULS ', 'CONSTANT ', 'LIM_RAMP ', 'SCALE ', 'DEVICE_FUNCTION ', 'MATH_EXPRESSION ', 'MATH_EXPRESSION ', 'USER_DEFINED ', 'SMOOTH_TRAJ ' /) |
Function type names.
| integer, dimension(nspln_p), save explicitfunctionsmodule::last = 0 |
Identifier for splines in core.
| integer, parameter explicitfunctionsmodule::lim_ramp_p = 16 |
| integer, parameter explicitfunctionsmodule::lin_var_p = 10 |
| integer, parameter explicitfunctionsmodule::lin_vel_var_p = 5 |
| integer, parameter explicitfunctionsmodule::math_expression_p = 19 |
| integer, parameter explicitfunctionsmodule::maxfunc_p = 22 |
Number of function types.
| integer, parameter explicitfunctionsmodule::nspln_p = 6 |
Max. number of spline functions in core.
|
private |
The value of π.
| integer, parameter explicitfunctionsmodule::ramp_p = 11 |
| integer, parameter explicitfunctionsmodule::scale_p = 17 |
| integer, parameter explicitfunctionsmodule::sinusoidal_p = 1 |
| integer, parameter explicitfunctionsmodule::smooth_traj_p = 22 |
|
private |
Internal spline data buffer.
| integer, parameter explicitfunctionsmodule::spline_p = 6 |
| integer, parameter explicitfunctionsmodule::square_puls_p = 13 |
| integer, parameter explicitfunctionsmodule::step_p = 12 |
|
private |
The value of 2π.
| integer, parameter explicitfunctionsmodule::user_defined_p = 21 |
| integer, parameter explicitfunctionsmodule::wave_embedded_p = 9 |
| integer, parameter explicitfunctionsmodule::wave_sinus_p = 4 |
| integer, parameter explicitfunctionsmodule::wave_stokes5_p = 7 |
| integer, parameter explicitfunctionsmodule::wave_streamline_p = 8 |