FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with data types representing control system object of a model. More...
Data Types | |
type | ctrlprm |
Data type representing a control input parameter. More... | |
type | controltype |
Data type representing the control system of a model. More... | |
interface | writeobject |
Standard routine for writing an object to file. More... | |
Functions/Subroutines | |
subroutine, public | nullifyctrl (ctrl, deallocating) |
Initializes the ControlType object. More... | |
subroutine, public | deallocatectrl (ctrl) |
Deallocates the ControlType object. More... | |
subroutine, public | readcontrolsystem (infp, engines, sensors, ctrl, ierr) |
Initializes the ControlType object with data from the input file. More... | |
subroutine, public | initiatecontrol (mpar, ctrl) |
Initializes the SAM control array MPAR with control system data. More... | |
subroutine | readcontrolinput (infp, engines, sensors, input, mstat, ierr) |
Reads data for the control inputs from the solver input file. More... | |
subroutine | readcontrolelements (infp, nCEl, nDelay, mpmtop, mprpar, mmtop, rpar, iprint, lpu, ierr) |
Reads data for the control elements from the solver input file. More... | |
subroutine | readcontrolvariables (infp, mstat, vreg, vregId, mvar, iprint, lpu, ierr) |
Reads status codes and initial conditions for the control variables. More... | |
subroutine | writecontroltype (ctrl, io, complexity) |
Standard routine for writing an object to io. More... | |
logical function, public | hascontrolelements (ctrl) |
Checks if control elements are present in the model. More... | |
subroutine, public | writectrlsysheader (ctrl, mechId, rdb) |
Writes results database headers for the control system. More... | |
subroutine, public | writectrlsysdb (rdb, ctrl, nStep, time, ierr) |
Writes control system data to the results database. More... | |
Module with data types representing control system object of a model.
The module also contains subroutines for initializing the control system from the input file, as well as general subroutines and functions for for accessing the control system data.
subroutine, public controltypemodule::deallocatectrl | ( | type(controltype), intent(inout) | ctrl | ) |
Deallocates the ControlType object.
ctrl | Control system data |
logical function, public controltypemodule::hascontrolelements | ( | type(controltype), intent(in) | ctrl | ) |
Checks if control elements are present in the model.
subroutine, public controltypemodule::initiatecontrol | ( | integer, dimension(:), intent(inout) | mpar, |
type(controltype), intent(in) | ctrl | ||
) |
Initializes the SAM control array MPAR with control system data.
mpar | Matrix of parameters | |
[in] | ctrl | Control system data |
subroutine, public controltypemodule::nullifyctrl | ( | type(controltype), intent(out) | ctrl, |
logical, intent(in), optional | deallocating | ||
) |
Initializes the ControlType object.
[out] | ctrl | Control system data |
[in] | deallocating | If .true., the pointers are nullified |
subroutine controltypemodule::readcontrolelements | ( | integer, intent(in) | infp, |
integer, intent(in) | nCEl, | ||
integer, intent(out) | nDelay, | ||
integer, dimension(:), intent(out) | mpmtop, | ||
integer, dimension(:), intent(out) | mprpar, | ||
integer, dimension(:), intent(out) | mmtop, | ||
real(dp), dimension(:), intent(out) | rpar, | ||
integer, intent(in) | iprint, | ||
integer, intent(in) | lpu, | ||
integer, intent(out) | ierr | ||
) |
Reads data for the control elements from the solver input file.
[in] | infp | File unit number for the solver input file |
[in] | nCEl | Total number of control elements in the model |
[out] | nDelay | Number of delay elements in the model |
[out] | mpmtop | Matrix of pointers to topology vectors |
[out] | mprpar | Matrix of pointers to real data for the control elements |
[out] | mmtop | Topology vectors for the control elements |
[out] | rpar | Real data for the control elements |
[in] | iprint | Print switch; the higher value the more print is produced |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
|
private |
Reads data for the control inputs from the solver input file.
[in] | infp | File unit number for the solver input file |
[in] | engines | All general functions in the model |
[in] | sensors | All sensors (function argument objects) in the model |
[out] | input | Control input parameters |
[out] | mstat | Status flags for the control variables |
[out] | ierr | Error flag |
subroutine, public controltypemodule::readcontrolsystem | ( | integer, intent(in) | infp, |
type(enginetype), dimension(:), intent(in) | engines, | ||
type(sensortype), dimension(:), intent(in) | sensors, | ||
type(controltype), intent(out) | ctrl, | ||
integer, intent(out) | ierr | ||
) |
Initializes the ControlType object with data from the input file.
[in] | infp | File unit number for the solver input file |
[in] | engines | All general functions in the model |
[in] | sensors | All sensors (function argument objects) in the model |
[out] | ctrl | Control system data of the model |
[out] | ierr | Error flag |
subroutine controltypemodule::readcontrolvariables | ( | integer, intent(in) | infp, |
integer, dimension(:), intent(out) | mstat, | ||
real(dp), dimension(:), intent(out) | vreg, | ||
type(idtype), dimension(:), intent(out) | vregId, | ||
integer, dimension(:), intent(out) | mvar, | ||
integer, intent(in) | iprint, | ||
integer, intent(in) | lpu, | ||
integer, intent(out) | ierr | ||
) |
Reads status codes and initial conditions for the control variables.
[in] | infp | File unit number for the solver input file |
[out] | mstat | Status flags for the control variables |
[out] | vreg | The control state variables |
[out] | vregId | Id for the control line variables |
[out] | mvar | Control variables for extra control lines |
[in] | iprint | Print switch; the higher value the more print is produced |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
This subroutine reads status codes and initial conditions for all control variables in the model from the solver input file. It also reads the Id of other control lines referring to each variable. This is needed such that the control variable value can be written to the results database for all control lines that refer to it (Bugfix #323).
subroutine controltypemodule::writecontroltype | ( | type(controltype), intent(in) | ctrl, |
integer, intent(in) | io, | ||
integer, intent(in), optional | complexity | ||
) |
Standard routine for writing an object to io.
[in] | ctrl | Control system data |
[in] | io | File unit number to write to |
[in] | complexity | If present, the value indicates the amount of print |
subroutine, public controltypemodule::writectrlsysdb | ( | type(rdbtype), intent(inout) | rdb, |
type(controltype), intent(in) | ctrl, | ||
integer(i8), intent(in) | nStep, | ||
real(dp), intent(in) | time, | ||
integer, intent(out) | ierr | ||
) |
Writes control system data to the results database.
rdb | Results database file for control system data | |
[in] | ctrl | Control system data |
[in] | nStep | Time step number |
[in] | time | Current time |
[out] | ierr | Error flag |
Only the arrays that need to be restored in a restart are saved.
subroutine, public controltypemodule::writectrlsysheader | ( | type(controltype), intent(in) | ctrl, |
type(idtype), intent(in) | mechId, | ||
type(rdbtype), intent(inout) | rdb | ||
) |
Writes results database headers for the control system.
[in] | ctrl | Control system data |
[in] | mechId | Id of the mechanism object |
rdb | Results database file for control system data |
This subroutine saves only those arrays that need to be restored in a restart. The list of arrays stored must match that in controltypemodule::writectrlsysdb(), and should at least contain the arrays referred in restartmodule::readcontroldata().