|
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 a control system object. More... | |
| subroutine, public | deallocatectrl (ctrl, staticData) |
| Deallocates a control system object. More... | |
| subroutine, public | copyctrl (ctrlIn, ctrlCopy, ierr) |
| Makes a copy of a control system object. More... | |
| subroutine, public | readcontrolsystem (infp, engines, 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, 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... | |
| type(sensortype) function, pointer, public | getsensor (input) |
| Returns sensor measuring structural response for an input element. 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::copyctrl | ( | type(controltype), intent(in) | ctrlIn, |
| type(controltype), pointer | ctrlCopy, | ||
| integer, intent(out), optional | ierr | ||
| ) |
Makes a copy of a control system object.
| [in] | ctrlIn | The controltypemodule::controltype object to copy from |
| ctrlCopy | Pointer to the copied controltypemodule::controltype object | |
| [out] | ierr | Error flag |
If the ctrlCopy pointer is NULL on input, the object is allocated to match the dimension of the ctrlIn object. Otherwise, it is assumed that the data members have the correct sizes. Only the dynamic data members are copied physically. The static members, which not are supposed to change after data input, are shared.

| subroutine, public controltypemodule::deallocatectrl | ( | type(controltype), intent(inout) | ctrl, |
| logical, intent(in), optional | staticData | ||
| ) |
Deallocates a control system object.
| ctrl | The controltypemodule::controltype object to deallocate | |
| [in] | staticData | If .true., also deallocate the static data members |

| type(sensortype) function, pointer, public controltypemodule::getsensor | ( | type(ctrlprm), intent(in) | input | ) |
Returns sensor measuring structural response for an input element.
| [in] | input | The controltypemodule::ctrlprm object to get sensor for |
If the sensor is measuring an engine, the argument sensor of that engine is returned instead. If the engine has multiple arguments, the first argument which neither is of type engine nor time is returned.

| 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 a control system object.
| [out] | ctrl | The controltypemodule::controltype object to initialize |
| [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 |
| [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(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 |
| [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().
