FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines | Variables
functiontypemodule Module Reference

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

Detailed Description

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.

Function/Subroutine Documentation

◆ canintegrate()

logical function functiontypemodule::canintegrate ( type(functiontype), pointer  func,
integer, intent(in)  order 
)

Checks whether a function can be integrated explicitly.

Parameters
funcPointer to a function shape object
[in]orderIntegration order
Author
Bjorn Haugen
Date
6 Nov 1998
Here is the caller graph for this function:

◆ deallocateengine()

subroutine functiontypemodule::deallocateengine ( type(enginetype), intent(inout)  engine)

Deallocates a general function object.

Parameters
engineThe functiontypemodule::enginetype object to deallocate
Author
Knut Morten Okstad
Date
23 Jan 2017
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deallocateengines()

subroutine functiontypemodule::deallocateengines ( type(enginetype), dimension(:), pointer  engines)

Deallocates all general function objects.

Parameters
enginesArray of all functiontypemodule::enginetype objects
Author
Knut Morten Okstad
Date
23 Jan 2017
Here is the caller graph for this function:

◆ deallocatefuncs()

subroutine functiontypemodule::deallocatefuncs ( type(functiontype), dimension(:), pointer  funcs)

Deallocates all function shape objects.

Parameters
funcsArray of all functiontypemodule::functiontype objects
Author
Knut Morten Okstad
Date
23 Jan 2017

◆ deallocatefunction()

subroutine functiontypemodule::deallocatefunction ( type(functiontype), intent(inout)  func)

Deallocates a function shape object.

Parameters
funcThe functiontypemodule::functiontype object to deallocate
Author
Knut Morten Okstad
Date
23 Jan 2017
Here is the call graph for this function:
Here is the caller graph for this function:

◆ functionderivative1()

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

Parameters
funcPointer to the function shape to evaluate the derivative of
[in]xArgFunction argument value to evaluate the derivative at
[in]derOrderDerivative order (0, 1 or 2)
ierrError flag
[in]epsSize of argument interval for numerical derivatives
Author
Trond Arne Svidal
Date
Oct 2002
Here is the caller graph for this function:

◆ functionderivative2()

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

Parameters
funcPointer to the function shape to evaluate the derivative of
[in]xArgFunction argument values to evaluate the derivative at
[in]dVarWhich argument to calculate derivative with respect to
[in]derOrderDerivative order (0, 1 or 2)
ierrError flag
[in]epsSize of argument interval for numerical derivatives
Author
Trond Arne Svidal
Date
Oct 2002

◆ functionintegral()

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.

Parameters
funcPointer to the function shape to integrate
[in]x0Lower bound of integration domain
[in]x1Upper bound of integration domain
[in]intOrderIntegration order (0, 1 or 2)
ierrError flag
Author
Bjorn Haugen
Date
6 Nov 1998
Here is the call graph for this function:
Here is the caller graph for this function:

◆ functionvalue1()

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

Parameters
funcPointer to the function shape to evaluate
[in]xArgFunction argument value to evaluate the function at
ierrError flag
Author
Bjorn Haugen
Date
6 Nov 1998

◆ functionvalue2()

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

Parameters
funcPointer to the function shape to evaluate
[in]xArgFunction argument values to evaluate the function at
ierrError flag
Author
Bjorn Haugen
Date
6 Nov 1998

◆ getengineid()

character(len=lid_p) function functiontypemodule::getengineid ( type(enginetype), intent(in)  engine)

Returns the id of an engine object, including function type.

Parameters
[in]engineThe functiontypemodule::enginetype object to get id for
Author
Knut Morten Okstad
Date
12 Jun 2023
Here is the caller graph for this function:

◆ getptrtoidengine()

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.

Parameters
[in]arrayArray of functiontypemodule::enginetype objects to search within
[in]idBase ID of the object to search for
[in]usedByMechIf .true., flag the found object as used
[out]indexThe array index of the found object

If the general function is not found, NULL is returned.

Author
Bjorn Haugen
Date
1 Nov 1999

◆ getptrtoidfunction()

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.

Parameters
[in]arrayArray of functiontypemodule::functiontype objects to search within
[in]idBase ID of the object to search for

If the function shape is not found, NULL is returned.

Author
Bjorn Haugen
Date
1 Nov 1999

◆ getrampvalue()

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.

Parameters
tTime to evaluate ramp function at, set to end of ramp on exit
[in]derOrDerivative order (0 or 1)
[out]rValThe ramp function value
ierrError flag
Author
Knut Morten Okstad
Date
19 Aug 2022
Here is the caller graph for this function:

◆ initrampfunction()

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

Parameters
[in]TstartStart time of trajectory
[in]TendEnd time of function
[in]TlengthTotal trajectory time
[in]VmaxMaximum speed during trajectory
[out]ierrError flag
Author
Knut Morten Okstad
Date
19 Aug 2022
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isctrlsysused()

logical function functiontypemodule::isctrlsysused ( type(enginetype), dimension(:), intent(in)  engines)

Checks if any functions have a control system variable as argument.

Parameters
enginesAll general functions in the model
Author
Knut Morten Okstad
Date
27 Oct 2009
Here is the caller graph for this function:

◆ nullifyengine()

subroutine functiontypemodule::nullifyengine ( type(enginetype), intent(out)  engine)

Initializes a general function object.

Parameters
engineThe functiontypemodule::enginetype object to initialize
Author
Bjorn Haugen
Date
10 Sep 1998
Here is the caller graph for this function:

◆ nullifyfunction()

subroutine functiontypemodule::nullifyfunction ( type(functiontype), intent(out)  func)

Initializes a function shape object.

Parameters
funcThe functiontypemodule::functiontype object to initialize
Author
Bjorn Haugen
Date
10 Sep 1998
Here is the caller graph for this function:

◆ writeenginetype()

subroutine functiontypemodule::writeenginetype ( type(enginetype), intent(in)  engine,
integer, intent(in)  lpu 
)

Standard routine for writing an object to file.

Parameters
[in]engineThe functiontypemodule::enginetype object to write
[in]lpuFile unit number to write to
Author
Karl Erik Thoresen
Date
27 Sep 1998

◆ writefunctiontype()

subroutine functiontypemodule::writefunctiontype ( type(functiontype), intent(in)  func,
integer, intent(in)  lpu 
)

Standard routine for writing an object to file.

Parameters
[in]funcThe functiontypemodule::functiontype object to write
[in]lpuFile unit number to write to
Author
Bjorn Haugen
Date
8 Sep 1999

Variable Documentation

◆ ourramp

type(functiontype), pointer, save functiontypemodule::ourramp => null()

Ramp function used for scaling of all general functions of time.