Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

SPARK::TRuntimeControls Class Reference

Wrapper class for all the runtime control information required to initialize a TProblem object in order to make a simulation run. More...

#include <ctrls.h>

List of all members.

Public Types

typedef std::vector< std::string > TInputFiles
 Type used to describe the list of input files specified in the *.run file with the key InputFiles.


Public Member Functions

Structors
 TRuntimeControls (const char *name)
 Loads default controls.

 TRuntimeControls (const char *name, const char *runFileName) throw (SPARK::XInitialization)
 Loads controls from file "runFileName".

 ~TRuntimeControls () throw ()
 Trivial destructor.

Access methods
const char * GetName () const
 Returns name of runtime controls as const char*.

const char * GetRunFileName () const
 Returns name of the *.run file as const char*.

const char * GetInitialSnapshotFileName () const
 Returns the name of the initial snapshot file as const char*.

void SetInitialSnapshotFileName (const char *str)
 Sets the name of the initial snapshot file to str.

const char * GetFinalSnapshotFileName () const
 Returns the name of the final snapshot file as const char*.

void SetFinalSnapshotFileName (const char *str)
 Sets the name of the final snapshot file to str.

TInputFilesGetInputFiles ()
 Returns a reference to the TInputFiles object that contains the list of the input files specified in the *.run file.

const TInputFilesGetInputFiles () const
 Returns a const reference to the TInputFiles object that contains the list of the input files specified in the *.run file.

const char * GetOutputFileName () const
 Returns the name of the output file as const char* where the variables tagged with the REPORT keyword are reported.

void SetOutputFileName (const char *filename)
 Sets the name of the output file to filename where the variables tagged with the REPORT keyword will be reported.

const char * GetInitialWallClock () const
 Returns the string describing the initial wall clock as const char*.

void SetInitialWallClock (const char *str)
 Sets the string describing the initial wall clock to str.

const char * GetTimeUnit () const
 Returns the string describing the time unit used in the physical model as const char*.

void SetTimeUnit (const char *str)
 Sets the string describing the time unit used in the physical model to str.

unsigned GetNumPastValues () const
 Returns the number of successive past values that the problem simulator keeps track of as unsigned.

void SetNumPastValues (unsigned numPastValues)
 Sets the number of successive past values that the problem simulator keeps track of to numPastValues.

unsigned GetDiagnosticLevel () const
 Returns the diagnostic level as unsigned.

void SetDiagnosticLevel (unsigned level)
 Sets the diagnostic level to level.

double GetInitialTime () const
 Returns the initial time value as double.

void SetInitialTime (double initialTime)
 Sets the initial time value to initialTime.

double GetFinalTime () const
 Returns the final time value as double.

void SetFinalTime (double finalTime)
 Sets the final time value to finalTime.

void SetInfiniteFinalTime ()
 Sets the final time value to infinity.

double GetInitialTimeStep () const
 Returns the value of the intial time step as double.

void SetInitialTimeStep (double initialTimeStep)
 Sets the value of the initial time step to initialTimeStep.

double GetMinTimeStep () const
 Returns the value for the minimum time step allowed as double.

void SetMinTimeStep (double minTimeStep)
 Sets the value for the minimum time step allowed to minTimeStep.

double GetMaxTimeStep () const
 Returns the value for the maximum time step allowed as double.

void SetMaxTimeStep (double maxTimeStep)
 Sets the value for the maximum time step allowed to maxTimeStep.

double GetFirstReport () const
 Returns the time for the first report to be generated as double.

void SetFirstReport (double firstReport)
 Sets the time of the first report to firstReport.

double GetReportCycle () const
 Returns the time step used to generate the reports as double.

void SetReportCycle (double reportCycle)
 Sets the time step used to generate the reports to reportCycle.

unsigned GetVariableTimeStep () const
 Returns the flag that controls whether variable time stepping operation is on or off as unsigned.

void SetVariableTimeStep (unsigned flag)
 Sets the flag taht controls whether variable time stepping operation is on or off to flag.

unsigned GetConsistentInitialCalculation () const
 Returns the flag that controls whether or not to perform an initial consistent calculation for the first step of the simulation as unsigned.

void SetConsistentInitialCalculation (unsigned flag)
I/O Operations
void Write (std::ostream &os, const std::string &before) const
 Writes the runtime controls to os.

Misc operation
unsigned ValidateControls (std::ostream &os) const
 Checks specified controls and returns the number of invalid controls.

void Reset ()
 Resets all controls to the default values.


Detailed Description

Wrapper class for all the runtime control information required to initialize a TProblem object in order to make a simulation run.
Examples:

multiproblem_example1.cpp, and sparksolver.cpp.


Member Typedef Documentation

typedef std::vector<std::string> SPARK::TRuntimeControls::TInputFiles
 

Type used to describe the list of input files specified in the *.run file with the key InputFiles.


Constructor & Destructor Documentation

SPARK::TRuntimeControls::TRuntimeControls const char *  name  ) 
 

Loads default controls.

SPARK::TRuntimeControls::TRuntimeControls const char *  name,
const char *  runFileName
throw (SPARK::XInitialization)
 

Loads controls from file "runFileName".

Exceptions:
SPARK::XInitialization Thrown if the runtime controls could not be validated.

SPARK::TRuntimeControls::~TRuntimeControls  )  throw ()
 

Trivial destructor.


Member Function Documentation

const char* SPARK::TRuntimeControls::GetName  )  const [inline]
 

Returns name of runtime controls as const char*.

const char* SPARK::TRuntimeControls::GetRunFileName  )  const [inline]
 

Returns name of the *.run file as const char*.

const char* SPARK::TRuntimeControls::GetInitialSnapshotFileName  )  const [inline]
 

Returns the name of the initial snapshot file as const char*.

Note:
By default, no initial snapshot file will be generated.

void SPARK::TRuntimeControls::SetInitialSnapshotFileName const char *  str  )  [inline]
 

Sets the name of the initial snapshot file to str.

const char* SPARK::TRuntimeControls::GetFinalSnapshotFileName  )  const [inline]
 

Returns the name of the final snapshot file as const char*.

Note:
By default, no final snapshot file will be generated.

void SPARK::TRuntimeControls::SetFinalSnapshotFileName const char *  str  )  [inline]
 

Sets the name of the final snapshot file to str.

TInputFiles& SPARK::TRuntimeControls::GetInputFiles  )  [inline]
 

Returns a reference to the TInputFiles object that contains the list of the input files specified in the *.run file.

const TInputFiles& SPARK::TRuntimeControls::GetInputFiles  )  const [inline]
 

Returns a const reference to the TInputFiles object that contains the list of the input files specified in the *.run file.

const char* SPARK::TRuntimeControls::GetOutputFileName  )  const [inline]
 

Returns the name of the output file as const char* where the variables tagged with the REPORT keyword are reported.

void SPARK::TRuntimeControls::SetOutputFileName const char *  filename  )  [inline]
 

Sets the name of the output file to filename where the variables tagged with the REPORT keyword will be reported.

const char* SPARK::TRuntimeControls::GetInitialWallClock  )  const [inline]
 

Returns the string describing the initial wall clock as const char*.

The format of the initial wall clock string follows: "mm/dd/yyyy hh:mm:ss"

Note:
The initial wall clock string is parsed by the URL engine and is used for synchronization with various weather files.

void SPARK::TRuntimeControls::SetInitialWallClock const char *  str  )  [inline]
 

Sets the string describing the initial wall clock to str.

const char* SPARK::TRuntimeControls::GetTimeUnit  )  const [inline]
 

Returns the string describing the time unit used in the physical model as const char*.

  • The time unit is used by the URL engine to initialize the weather file readers with the proper time unit used in the simulation model.
  • Also, this time unit will be used to override the unit strings in the global time and global time step variables in the physical model for consistency reasons.
Note:
It should be a unit string reecognized by the URL engine.

void SPARK::TRuntimeControls::SetTimeUnit const char *  str  )  [inline]
 

Sets the string describing the time unit used in the physical model to str.

unsigned SPARK::TRuntimeControls::GetNumPastValues  )  const [inline]
 

Returns the number of successive past values that the problem simulator keeps track of as unsigned.

void SPARK::TRuntimeControls::SetNumPastValues unsigned  numPastValues  )  [inline]
 

Sets the number of successive past values that the problem simulator keeps track of to numPastValues.

unsigned SPARK::TRuntimeControls::GetDiagnosticLevel  )  const [inline]
 

Returns the diagnostic level as unsigned.

The possible values for the diagnostic level are defined in TProblem::DiagnosticTypes

Note:
The value 0 indicates that no diagnostic will be generated at runtime.

void SPARK::TRuntimeControls::SetDiagnosticLevel unsigned  level  )  [inline]
 

Sets the diagnostic level to level.

double SPARK::TRuntimeControls::GetInitialTime  )  const [inline]
 

Returns the initial time value as double.

void SPARK::TRuntimeControls::SetInitialTime double  initialTime  )  [inline]
 

Sets the initial time value to initialTime.

double SPARK::TRuntimeControls::GetFinalTime  )  const [inline]
 

Returns the final time value as double.

void SPARK::TRuntimeControls::SetFinalTime double  finalTime  )  [inline]
 

Sets the final time value to finalTime.

void SPARK::TRuntimeControls::SetInfiniteFinalTime  ) 
 

Sets the final time value to infinity.

The problem simulator will not stopped unless a stop request, abort request or a set stop time request is posted. This is equivalent to specifying FinalTime( * ()) in the *.run file.

double SPARK::TRuntimeControls::GetInitialTimeStep  )  const [inline]
 

Returns the value of the intial time step as double.

Note:
If the value is zero, then the clock will not be advanced and only one step will be calculated.

void SPARK::TRuntimeControls::SetInitialTimeStep double  initialTimeStep  )  [inline]
 

Sets the value of the initial time step to initialTimeStep.

double SPARK::TRuntimeControls::GetMinTimeStep  )  const [inline]
 

Returns the value for the minimum time step allowed as double.

void SPARK::TRuntimeControls::SetMinTimeStep double  minTimeStep  )  [inline]
 

Sets the value for the minimum time step allowed to minTimeStep.

double SPARK::TRuntimeControls::GetMaxTimeStep  )  const [inline]
 

Returns the value for the maximum time step allowed as double.

void SPARK::TRuntimeControls::SetMaxTimeStep double  maxTimeStep  )  [inline]
 

Sets the value for the maximum time step allowed to maxTimeStep.

double SPARK::TRuntimeControls::GetFirstReport  )  const [inline]
 

Returns the time for the first report to be generated as double.

void SPARK::TRuntimeControls::SetFirstReport double  firstReport  )  [inline]
 

Sets the time of the first report to firstReport.

double SPARK::TRuntimeControls::GetReportCycle  )  const [inline]
 

Returns the time step used to generate the reports as double.

This report time step is independent from the simulation time step. However, if the simulation supports variable time stepping, then the simultation time step will be adapted to synchronize with the i desired reporting times $t_{report}[i]$: $t_{report}[i] = FirstReport + i * ReportCycle$

Note:
If $ReportCycle==0$, then reports are generate at each simulation step.

void SPARK::TRuntimeControls::SetReportCycle double  reportCycle  )  [inline]
 

Sets the time step used to generate the reports to reportCycle.

unsigned SPARK::TRuntimeControls::GetVariableTimeStep  )  const [inline]
 

Returns the flag that controls whether variable time stepping operation is on or off as unsigned.

  • If VariableTimeStep==0 then the time step remains constant during the course of the simulation.
  • If VariableTimeStep==1 then the time step is adapted to satisfy the meeting points and the time step requests during the course of the simulation.

void SPARK::TRuntimeControls::SetVariableTimeStep unsigned  flag  )  [inline]
 

Sets the flag taht controls whether variable time stepping operation is on or off to flag.

unsigned SPARK::TRuntimeControls::GetConsistentInitialCalculation  )  const [inline]
 

Returns the flag that controls whether or not to perform an initial consistent calculation for the first step of the simulation as unsigned.

  • If ConsistentInitialCalculation == 0 then no initial calculation is performed.
  • If ConsistentInitialCalculation == 1 then an initial calculation is performed in order to ensure a consistent of initial values.
The initial consistent calculation consists in computing a static step to solve for the time-derivatives, the dynamic variables being set to their user-specified initial values.

Note:
It is highly recommended to perform an initial consistent calculation for dynamic problems to make sure that the integrator classes do rely on a consistent set of initial conditions. Otherwise, it is likely that the initial error will accumulate and is likely to produce an inaccurate dynamic solution.

void SPARK::TRuntimeControls::SetConsistentInitialCalculation unsigned  flag  )  [inline]
 

Sets the flag that controls whether or not to perform an initial consistent calculation for the first step of the simulation to flag

void SPARK::TRuntimeControls::Write std::ostream &  os,
const std::string &  before
const
 

Writes the runtime controls to os.

unsigned SPARK::TRuntimeControls::ValidateControls std::ostream &  os  )  const
 

Checks specified controls and returns the number of invalid controls.

Note:
This method is called in TRuntimeControls(const char* runFileName). If using the default constructor TRuntimeControls(), then you should call this method explicitly to make sure that the controls are valid.

void SPARK::TRuntimeControls::Reset  ) 
 

Resets all controls to the default values.

See namespace SPARK::DefaultRuntimeControls for the list of the default controls.


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

Generated on 5 Nov 2003 for VisualSPARK 2.01