CG
Version 25
|
#include <Controller.h>
Public Member Functions | |
Controller (Parameters ¶meters) | |
Contoller constructor. | |
virtual | ~Controller () |
Contoller destructor. | |
Controller (const Controller &X) | |
Copy constructor. | |
int | createControlSequence (const aString &sequenceName, const std::vector< aString > componentNames) |
Create a control sequence (to be saved in the show file). | |
int | get (const GenericDataBase &dir, const aString &name) |
Get from a data base file. | |
int | getControl (const real t, real &uControl, real &uControlDot) const |
Compute the control variable (single output) | |
int | put (GenericDataBase &dir, const aString &name) const |
Put to a data base file. | |
int | saveControlSequenceData (const aString &sequenceName, const real t, const std::vector< real > values) |
Save control information that will be saved in a sequence in the show file. | |
virtual int | saveToShowFile () const |
Save control information to the show file. | |
virtual int | update (CompositeGrid &cg, GenericGraphicsInterface &gi) |
Define the control properties interactively. | |
int | updateControl (realCompositeGridFunction &v, const real t, const real dt) |
Update the control function based on the current solution v. | |
Protected Attributes | |
Parameters & | parameters |
Controller::Controller | ( | Parameters & | parameters | ) |
Contoller constructor.
|
virtual |
Contoller destructor.
Controller::Controller | ( | const Controller & | X | ) |
Copy constructor.
int Controller::createControlSequence | ( | const aString & | sequenceName, |
const std::vector< aString > | componentNames | ||
) |
Create a control sequence (to be saved in the show file).
A control sequence can consist of multiple components.
sequenceName | (input) : name of the sequence. |
componentNames | (input) : names of the components of the sequence. |
References Parameters::dbase, and parameters.
Referenced by updateControl().
int Controller::get | ( | const GenericDataBase & | dir, |
const aString & | name | ||
) |
Get from a data base file.
References OV_ABORT().
int Controller::getControl | ( | const real | t, |
real & | uControl, | ||
real & | uControlDot | ||
) | const |
Compute the control variable (single output)
t | (input) : evaluate the control function at this time. |
uControl | : control value |
uControlDot | : time derivative of the control value |
References Parameters::dbase, OV_ABORT(), parameters, and printF().
Referenced by DomainSolver::userDefinedBoundaryValues().
int Controller::put | ( | GenericDataBase & | dir, |
const aString & | name | ||
) | const |
Put to a data base file.
References OV_ABORT().
int Controller::saveControlSequenceData | ( | const aString & | sequenceName, |
const real | t, | ||
const std::vector< real > | values | ||
) |
Save control information that will be saved in a sequence in the show file.
sequenceName | (input) : name of the sequence (createControlSequence must already have been called with this name. |
t | (input) : current time. |
values | (input) : values of the components, |
References c, Parameters::dbase, and parameters.
Referenced by updateControl().
|
virtual |
Save control information to the show file.
References all, c, Parameters::dbase, N(), OV_ABORT(), parameters, and printF().
Referenced by DomainSolver::advance(), and DomainSolver::saveShow().
|
virtual |
Define the control properties interactively.
This routine is used to define controls. Type of controls include:
References assert(), Parameters::dbase, parameters, and printF().
Referenced by DomainSolver::setParametersInteractively().
int Controller::updateControl | ( | realCompositeGridFunction & | v, |
const real | t, | ||
const real | dt | ||
) |
Update the control function based on the current solution v.
This function is called to update the current state for the control function. Use the function getControl to return the values of the control function. In normal usage, updateControl is called once (per solution time-step or solution predictor-corrector stage) and getControl is called multiple times to assign the control to each boundary where it is used.
v,t,dt | (input) : current solution, time and time step |
References assert(), createControlSequence(), Parameters::dbase, OV_ABORT(), parameters, printF(), and saveControlSequenceData().
Referenced by DomainSolver::computeBodyForcing().
|
protected |
Referenced by createControlSequence(), getControl(), saveControlSequenceData(), saveToShowFile(), update(), and updateControl().