FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with data types representing function objects. More...
Data Types | |
type | functiontype |
Data type representing a function shape object. More... | |
type | enginetype |
Data type representing a general function object. More... | |
type | engineptrtype |
Data type representing a general function pointer. More... | |
interface | writeobject |
Standard routine for writing an object to file. More... | |
interface | getptrtoid |
Returns pointer to object with specified ID. More... | |
interface | functionvalue |
Returns the function value. More... | |
interface | functionderivative |
Returns a function derivative. More... | |
interface | deallocatefunctions |
Deallocates a function object. More... | |
Functions/Subroutines | |
type(functiontype) function, pointer | getptrtoidfunction (array, id) |
Returns pointer to (first) function shape object with specified ID. More... | |
type(enginetype) function, pointer | getptrtoidengine (array, id, usedByMech, index) |
Returns pointer to (first) general function with specified ID. More... | |
subroutine | nullifyfunction (func) |
Initializes a function shape object. More... | |
subroutine | nullifyengine (engine) |
Initializes a general function object. More... | |
subroutine | deallocatefunction (func) |
Deallocates a function shape object. More... | |
subroutine | deallocatefuncs (funcs) |
Deallocates all function shape objects. More... | |
subroutine | deallocateengine (engine) |
Deallocates a general function object. More... | |
subroutine | deallocateengines (engines) |
Deallocates all general function objects. More... | |
subroutine | writefunctiontype (func, lpu) |
Standard routine for writing an object to file. More... | |
subroutine | writeenginetype (engine, lpu) |
Standard routine for writing an object to file. More... | |
character(len=lid_p) function | getengineid (engine) |
Returns the id of an engine object, including function type. More... | |
real(dp) function | functionvalue1 (func, xArg, ierr) |
Evaluates the single-argument function f = f(x). More... | |
real(dp) function | functionvalue2 (func, xArg, ierr) |
Evaluates the multi-argument function f = f(x,y,z,...). More... | |
real(dp) function | functionderivative1 (func, xArg, derOrder, ierr, eps) |
Evaluates the derivative of a single-argument function f(x). More... | |
real(dp) function | functionderivative2 (func, xArg, dVar, derOrder, ierr, eps) |
Evaluates the derivative of a multi-argument function f(x,y,z,...). More... | |
real(dp) function | functionintegral (func, x0, x1, intOrder, ierr) |
Integrates a function shape over specified domain. More... | |
logical function | canintegrate (func, order) |
Checks whether a function can be integrated explicitly. More... | |
logical function | isctrlsysused (engines) |
Checks if any functions have a control system variable as argument. More... | |
subroutine | initrampfunction (Tstart, Tend, Tlength, Vmax, ierr) |
Initializes the ramp-up scaling function (smooth trajectory). More... | |
subroutine | getrampvalue (t, derOr, rVal, ierr) |
Evaluates the smooth trajectory ramp function. More... | |
Variables | |
type(functiontype), pointer, save | ourramp => null() |
Ramp function used for scaling of all general functions of time. More... | |
Module with data types representing function objects.
The module also contains subroutines for accessing or manipulating the function data, and for evaluating the functions themselves.
logical function functiontypemodule::canintegrate | ( | type(functiontype), pointer | func, |
integer, intent(in) | order | ||
) |
Checks whether a function can be integrated explicitly.
func | Pointer to a function shape object | |
[in] | order | Integration order |
subroutine functiontypemodule::deallocateengine | ( | type(enginetype), intent(inout) | engine | ) |
Deallocates a general function object.
engine | The functiontypemodule::enginetype object to deallocate |
subroutine functiontypemodule::deallocateengines | ( | type(enginetype), dimension(:), pointer | engines | ) |
Deallocates all general function objects.
engines | Array of all functiontypemodule::enginetype objects |
subroutine functiontypemodule::deallocatefuncs | ( | type(functiontype), dimension(:), pointer | funcs | ) |
Deallocates all function shape objects.
funcs | Array of all functiontypemodule::functiontype objects |
subroutine functiontypemodule::deallocatefunction | ( | type(functiontype), intent(inout) | func | ) |
Deallocates a function shape object.
func | The functiontypemodule::functiontype object to deallocate |
real(dp) function functiontypemodule::functionderivative1 | ( | type(functiontype), pointer | func, |
real(dp), intent(in) | xArg, | ||
integer, intent(in) | derOrder, | ||
integer, intent(inout) | ierr, | ||
real(dp), intent(in), optional | eps | ||
) |
Evaluates the derivative of a single-argument function f(x).
func | Pointer to the function shape to evaluate the derivative of | |
[in] | xArg | Function argument value to evaluate the derivative at |
[in] | derOrder | Derivative order (0, 1 or 2) |
ierr | Error flag | |
[in] | eps | Size of argument interval for numerical derivatives |
real(dp) function functiontypemodule::functionderivative2 | ( | type(functiontype), pointer | func, |
real(dp), dimension(:), intent(in) | xArg, | ||
integer, intent(in) | dVar, | ||
integer, intent(in) | derOrder, | ||
integer, intent(inout) | ierr, | ||
real(dp), intent(in), optional | eps | ||
) |
Evaluates the derivative of a multi-argument function f(x,y,z,...).
func | Pointer to the function shape to evaluate the derivative of | |
[in] | xArg | Function argument values to evaluate the derivative at |
[in] | dVar | Which argument to calculate derivative with respect to |
[in] | derOrder | Derivative order (0, 1 or 2) |
ierr | Error flag | |
[in] | eps | Size of argument interval for numerical derivatives |
real(dp) function functiontypemodule::functionintegral | ( | type(functiontype), pointer | func, |
real(dp), intent(in) | x0, | ||
real(dp), intent(in) | x1, | ||
integer, intent(in) | intOrder, | ||
integer, intent(inout) | ierr | ||
) |
Integrates a function shape over specified domain.
func | Pointer to the function shape to integrate | |
[in] | x0 | Lower bound of integration domain |
[in] | x1 | Upper bound of integration domain |
[in] | intOrder | Integration order (0, 1 or 2) |
ierr | Error flag |
real(dp) function functiontypemodule::functionvalue1 | ( | type(functiontype), pointer | func, |
real(dp), intent(in) | xArg, | ||
integer, intent(inout) | ierr | ||
) |
Evaluates the single-argument function f = f(x).
func | Pointer to the function shape to evaluate | |
[in] | xArg | Function argument value to evaluate the function at |
ierr | Error flag |
real(dp) function functiontypemodule::functionvalue2 | ( | type(functiontype), pointer | func, |
real(dp), dimension(:), intent(in) | xArg, | ||
integer, intent(inout) | ierr | ||
) |
Evaluates the multi-argument function f = f(x,y,z,...).
func | Pointer to the function shape to evaluate | |
[in] | xArg | Function argument values to evaluate the function at |
ierr | Error flag |
character(len=lid_p) function functiontypemodule::getengineid | ( | type(enginetype), intent(in) | engine | ) |
Returns the id of an engine object, including function type.
[in] | engine | The functiontypemodule::enginetype object to get id for |
type(enginetype) function, pointer functiontypemodule::getptrtoidengine | ( | type(enginetype), dimension(:), intent(in), target | array, |
integer, intent(in) | id, | ||
logical, intent(in), optional | usedByMech, | ||
integer, intent(out), optional | index | ||
) |
Returns pointer to (first) general function with specified ID.
[in] | array | Array of functiontypemodule::enginetype objects to search within |
[in] | id | Base ID of the object to search for |
[in] | usedByMech | If .true., flag the found object as used |
[out] | index | The array index of the found object |
If the general function is not found, NULL is returned.
type(functiontype) function, pointer functiontypemodule::getptrtoidfunction | ( | type(functiontype), dimension(:), intent(in), target | array, |
integer, intent(in) | id | ||
) |
Returns pointer to (first) function shape object with specified ID.
[in] | array | Array of functiontypemodule::functiontype objects to search within |
[in] | id | Base ID of the object to search for |
If the function shape is not found, NULL is returned.
subroutine functiontypemodule::getrampvalue | ( | real(dp), intent(inout) | t, |
integer, intent(in) | derOr, | ||
real(dp), intent(out) | rVal, | ||
integer, intent(inout) | ierr | ||
) |
Evaluates the smooth trajectory ramp function.
t | Time to evaluate ramp function at, set to end of ramp on exit | |
[in] | derOr | Derivative order (0 or 1) |
[out] | rVal | The ramp function value |
ierr | Error flag |
subroutine functiontypemodule::initrampfunction | ( | real(dp), intent(in) | Tstart, |
real(dp), intent(in) | Tend, | ||
real(dp), intent(in) | Tlength, | ||
real(dp), intent(in) | Vmax, | ||
integer, intent(out) | ierr | ||
) |
Initializes the ramp-up scaling function (smooth trajectory).
[in] | Tstart | Start time of trajectory |
[in] | Tend | End time of function |
[in] | Tlength | Total trajectory time |
[in] | Vmax | Maximum speed during trajectory |
[out] | ierr | Error flag |
logical function functiontypemodule::isctrlsysused | ( | type(enginetype), dimension(:), intent(in) | engines | ) |
Checks if any functions have a control system variable as argument.
engines | All general functions in the model |
subroutine functiontypemodule::nullifyengine | ( | type(enginetype), intent(out) | engine | ) |
Initializes a general function object.
engine | The functiontypemodule::enginetype object to initialize |
subroutine functiontypemodule::nullifyfunction | ( | type(functiontype), intent(out) | func | ) |
Initializes a function shape object.
func | The functiontypemodule::functiontype object to initialize |
subroutine functiontypemodule::writeenginetype | ( | type(enginetype), intent(in) | engine, |
integer, intent(in) | lpu | ||
) |
Standard routine for writing an object to file.
[in] | engine | The functiontypemodule::enginetype object to write |
[in] | lpu | File unit number to write to |
subroutine functiontypemodule::writefunctiontype | ( | type(functiontype), intent(in) | func, |
integer, intent(in) | lpu | ||
) |
Standard routine for writing an object to file.
[in] | func | The functiontypemodule::functiontype object to write |
[in] | lpu | File unit number to write to |
type(functiontype), pointer, save functiontypemodule::ourramp => null() |
Ramp function used for scaling of all general functions of time.