CG  Version 25
Public Member Functions | Protected Attributes | List of all members
Controller Class Reference

#include <Controller.h>

Collaboration diagram for Controller:
Collaboration graph
[legend]

Public Member Functions

 Controller (Parameters &parameters)
 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

Parametersparameters
 

Constructor & Destructor Documentation

Controller::Controller ( Parameters parameters)

Contoller constructor.

Controller::~Controller ( )
virtual

Contoller destructor.

Controller::Controller ( const Controller X)

Copy constructor.

Member Function Documentation

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.

Parameters
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)

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

Parameters
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().

int Controller::saveToShowFile ( ) const
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().

int Controller::update ( CompositeGrid &  cg,
GenericGraphicsInterface &  gi 
)
virtual

Define the control properties interactively.

This routine is used to define controls. Type of controls include:

  • boundary controls : define inflow boundary conditions for control.
  • sensor regions : define regions where sensors should be located.

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.

Parameters
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().

Member Data Documentation

Parameters& Controller::parameters
protected

The documentation for this class was generated from the following files: