FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with subroutines/functions for evaluation of general functions. More...
Functions/Subroutines | |
subroutine | setpointersforsensors (eArr, tArr, sArr, dArr) |
Initialization of private pointers. More... | |
subroutine | preevaluate (engines, ierr) |
Pre-evaluation of general functions. More... | |
real(dp) function | evaluate (engine, E1, E0, ierr, xArg) |
Evaluates a general function with optional scaling and offset. More... | |
recursive real(dp) function | enginevalue (engine, ierr, xArg) |
Evaluates a general function. More... | |
recursive real(dp) function | enginerate (engine, ierr, tArg) |
Evaluates the time-derivative of a general function. More... | |
recursive real(dp) function, private | sensorrate (sensor, ierr) |
Evaluates the time-derivative of a sensor value. More... | |
recursive subroutine, private | evalargs (args, nArg, iDer, xArg, x, rVal, ierr) |
Evaluates the argument(s) of a general function. More... | |
recursive subroutine | updatesensor (sensor, ierr) |
Updates a sensor value depending on the sensor type. More... | |
recursive subroutine | updatespringbase (spr, ierr) |
Updates the spring variables. More... | |
recursive subroutine | updatedamperbase (dmp, ierr) |
Updates the damper variables. More... | |
subroutine | updateenginesforsave (engines, eFlag, ierr) |
Update all engines and store the values for saving. More... | |
subroutine | printfuncvalues (istep, time, engines, lpu) |
Updates and prints out the current value of all general functions. More... | |
Variables | |
type(environmenttype), pointer, save, public | ourenvir => null() |
Public pointer to the environmental data member in the mechanismtypemodule::mechanismtype object. More... | |
type(enginetype), dimension(:), pointer, save, private | engines => null() |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object. More... | |
type(triadtype), dimension(:), pointer, save, private | triads => null() |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object. More... | |
type(springbasetype), dimension(:), pointer, save, private | springs => null() |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object. More... | |
type(damperbasetype), dimension(:), pointer, save, private | dampers => null() |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object. More... | |
logical, save | ispredictorstep = .false. |
Flag used for consistent right-hand-side calculation in the predictor step. More... | |
Module with subroutines/functions for evaluation of general functions.
This module contains functions and subroutines for evaluating general functions, which are represented by functiontypemodule::enginetype objects in the model.
recursive real(dp) function engineroutinesmodule::enginerate | ( | type(enginetype), intent(inout) | engine, |
integer, intent(inout) | ierr, | ||
real(dp), intent(in), optional | tArg | ||
) |
Evaluates the time-derivative of a general function.
engine | The general function to evaluate | |
ierr | Error flag | |
[in] | tArg | Optional function argument value |
recursive real(dp) function engineroutinesmodule::enginevalue | ( | type(enginetype), intent(inout) | engine, |
integer, intent(inout) | ierr, | ||
real(dp), intent(in), optional | xArg | ||
) |
Evaluates a general function.
engine | The general function to evaluate | |
ierr | Error flag | |
[in] | xArg | Optional function argument value |
x may either be the input xArg or sensor-defined.
|
private |
Evaluates the argument(s) of a general function.
args | The function arguments to evaluate | |
[in] | nArg | Length of array args |
[in] | iDer | Derivative order of ramp function (0, 1, or -1 for no ramp) |
[in] | xArg | Optional value of (first) function argument |
[out] | x | The evaluated argument value(s) |
[out] | rVal | Ramp function value or derivative (equals 1.0 if no ramp) |
ierr | Error flag |
The output value x may either be the input argument xArg or a sensor-defined value. If a ramp function is defined and the argument type is TIME, the argument value x is instead set to the end time of the ramp function, and the ramp function value is returned through rVal.
real(dp) function engineroutinesmodule::evaluate | ( | type(enginetype), pointer | engine, |
real(dp), intent(in) | E1, | ||
real(dp), intent(in) | E0, | ||
integer, intent(inout) | ierr, | ||
real(dp), intent(in), optional | xArg | ||
) |
Evaluates a general function with optional scaling and offset.
engine | Points to the general function to evaluate | |
[in] | E1 | Scaling factor |
[in] | E0 | Offset value |
ierr | Error flag | |
[in] | xArg | Optional function argument value |
x may either be the input xArg or sensor-defined.
subroutine engineroutinesmodule::preevaluate | ( | type(enginetype), dimension(:), intent(inout) | engines, |
integer, intent(inout) | ierr | ||
) |
Pre-evaluation of general functions.
engines | All general functions in the model |
ierr | Error flag |
This subroutine pre-evaluates all functiontypemodule::enginetype objects that have been flagged for it. It is used in the case that the order of evaluation matters, in particular for user-defined functions.
subroutine engineroutinesmodule::printfuncvalues | ( | integer, intent(in) | istep, |
real(dp), intent(in) | time, | ||
type(enginetype), dimension(:), intent(inout) | engines, | ||
integer, intent(in) | lpu | ||
) |
Updates and prints out the current value of all general functions.
[in] | istep | Time increment counter |
[in] | time | Current time |
engines | All general functions in the model | |
[in] | lpu | File unit number for res-file output |
|
private |
Evaluates the time-derivative of a sensor value.
sensor | The sensor object to evaluate the derivative for |
ierr | Error flag |
subroutine engineroutinesmodule::setpointersforsensors | ( | type(enginetype), dimension(:), intent(in), target | eArr, |
type(triadtype), dimension(:), intent(in), target | tArr, | ||
type(springbasetype), dimension(:), intent(in), target | sArr, | ||
type(damperbasetype), dimension(:), intent(in), target | dArr | ||
) |
Initialization of private pointers.
[in] | eArr | All functiontypemodule::enginetype objects in the model |
[in] | tArr | All triadtypemodule::triadtype objects in the model |
[in] | sArr | All springtypemodule::springbasetype objects in the model |
[in] | dArr | All dampertypemodule::damperbasetype objects in the model |
This subroutine sets the private pointers of this module to point to the arrays provided as arguments (which should be those within the mechanismtypemodule::mechanismtype object). This is to avoid the necessity to transport these arrays through the enginevalue() and evalargs() calls, since they are needed by the subroutine updatesensor() which is invoked from evalargs().
recursive subroutine engineroutinesmodule::updatedamperbase | ( | type(damperbasetype), intent(inout) | dmp, |
integer, intent(inout) | ierr | ||
) |
Updates the damper variables.
dmp | The damper object to update the variables for |
ierr | Error flag |
subroutine engineroutinesmodule::updateenginesforsave | ( | type(enginetype), dimension(:), intent(inout) | engines, |
integer, intent(in) | eFlag, | ||
integer, intent(out) | ierr | ||
) |
Update all engines and store the values for saving.
engines | All general functions in the model | |
[in] | eFlag | Update the functions whose saveVar equals this value |
[out] | ierr | Error flag |
recursive subroutine engineroutinesmodule::updatesensor | ( | type(sensortype), intent(inout) | sensor, |
integer, intent(inout) | ierr | ||
) |
Updates a sensor value depending on the sensor type.
sensor | The sensor object to update the value for |
ierr | Error flag |
For many sensor types the actual sensor value is a pointer directly into the object it is evaluating, and this subroutine does nothing for such sensors.
recursive subroutine engineroutinesmodule::updatespringbase | ( | type(springbasetype), intent(inout) | spr, |
integer, intent(inout) | ierr | ||
) |
Updates the spring variables.
spr | The spring object to update the variables for |
ierr | Error flag |
|
private |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object.
|
private |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object.
logical, save engineroutinesmodule::ispredictorstep = .false. |
Flag used for consistent right-hand-side calculation in the predictor step.
Equals .true. in first iteration
type(environmenttype), pointer, save, public engineroutinesmodule::ourenvir => null() |
Public pointer to the environmental data member in the mechanismtypemodule::mechanismtype object.
|
private |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object.
|
private |
Private pointer to the corresponding member array in the mechanismtypemodule::mechanismtype object.