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

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

Detailed Description

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.

Function/Subroutine Documentation

◆ deallocatectrl()

subroutine, public controltypemodule::deallocatectrl ( type(controltype), intent(inout)  ctrl)

Deallocates the ControlType object.

Parameters
ctrlControl system data
Author
Knut Morten Okstad
Date
23 Jan 2017
Here is the caller graph for this function:

◆ hascontrolelements()

logical function, public controltypemodule::hascontrolelements ( type(controltype), intent(in)  ctrl)

Checks if control elements are present in the model.

◆ initiatecontrol()

subroutine, public controltypemodule::initiatecontrol ( integer, dimension(:), intent(inout)  mpar,
type(controltype), intent(in)  ctrl 
)

Initializes the SAM control array MPAR with control system data.

Parameters
mparMatrix of parameters
[in]ctrlControl system data
Author
Knut Morten Okstad
Date
Apr 2003
Here is the caller graph for this function:

◆ nullifyctrl()

subroutine, public controltypemodule::nullifyctrl ( type(controltype), intent(out)  ctrl,
logical, intent(in), optional  deallocating 
)

Initializes the ControlType object.

Parameters
[out]ctrlControl system data
[in]deallocatingIf .true., the pointers are nullified
Author
Knut Morten Okstad
Date
4 Jul 2004
Here is the caller graph for this function:

◆ readcontrolelements()

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.

Parameters
[in]infpFile unit number for the solver input file
[in]nCElTotal number of control elements in the model
[out]nDelayNumber of delay elements in the model
[out]mpmtopMatrix of pointers to topology vectors
[out]mprparMatrix of pointers to real data for the control elements
[out]mmtopTopology vectors for the control elements
[out]rparReal data for the control elements
[in]iprintPrint switch; the higher value the more print is produced
[in]lpuFile unit number for res-file output
[out]ierrError flag
Author
Bjorn Haugen
Date
Aug 2000
Here is the caller graph for this function:

◆ readcontrolinput()

subroutine controltypemodule::readcontrolinput ( integer, intent(in)  infp,
type(enginetype), dimension(:), intent(in)  engines,
type(sensortype), dimension(:), intent(in)  sensors,
type(ctrlprm), dimension(:), intent(out)  input,
integer, dimension(:), intent(out)  mstat,
integer, intent(out)  ierr 
)
private

Reads data for the control inputs from the solver input file.

Parameters
[in]infpFile unit number for the solver input file
[in]enginesAll general functions in the model
[in]sensorsAll sensors (function argument objects) in the model
[out]inputControl input parameters
[out]mstatStatus flags for the control variables
[out]ierrError flag
Author
Bjorn Haugen
Date
Aug 2000
Here is the caller graph for this function:

◆ readcontrolsystem()

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.

Parameters
[in]infpFile unit number for the solver input file
[in]enginesAll general functions in the model
[in]sensorsAll sensors (function argument objects) in the model
[out]ctrlControl system data of the model
[out]ierrError flag
Author
Knut Morten Okstad
Date
Jul 2000
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readcontrolvariables()

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.

Parameters
[in]infpFile unit number for the solver input file
[out]mstatStatus flags for the control variables
[out]vregThe control state variables
[out]vregIdId for the control line variables
[out]mvarControl variables for extra control lines
[in]iprintPrint switch; the higher value the more print is produced
[in]lpuFile unit number for res-file output
[out]ierrError 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).

Author
Bjorn Haugen
Date
Aug 2000
Author
Knut Morten Okstad
Date
29 Apr 2017
Here is the caller graph for this function:

◆ writecontroltype()

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.

Parameters
[in]ctrlControl system data
[in]ioFile unit number to write to
[in]complexityIf present, the value indicates the amount of print
Author
Knut Morten Okstad
Date
27 Jul 2000

◆ writectrlsysdb()

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.

Parameters
rdbResults database file for control system data
[in]ctrlControl system data
[in]nStepTime step number
[in]timeCurrent time
[out]ierrError flag

Only the arrays that need to be restored in a restart are saved.

Author
Knut Morten Okstad
Date
25 Oct 2008
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writectrlsysheader()

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.

Parameters
[in]ctrlControl system data
[in]mechIdId of the mechanism object
rdbResults 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().

Author
Knut Morten Okstad
Date
25 Oct 2008
Here is the caller graph for this function: