#include <problem.h>
Public Types | |
typedef std::bitset< DIAGNOSTICTYPES_L > | TDiagnosticLevel |
Bitset used to specify the diagnostic level with the different diagnostic types. | |
enum | DiagnosticTypes { DiagnosticType_CONVERGENCE, DiagnosticType_INPUTS, DiagnosticType_REPORTS, DiagnosticType_PREFERENCES, DiagnosticType_STATISTICS, DiagnosticType_REQUESTS, DIAGNOSTICTYPES_L } |
Level of more or less detailed diagnostic to the run log output stream. More... | |
enum | SimulationFlags { SimulationFlag_OK = 0, SimulationFlag_BAD_NUMERICS, SimulationFlag_NO_CONVERGENCE, SimulationFlag_SINGULAR_SYSTEM, SimulationFlag_TIMESTEP_TOO_SMALL, SimulationFlag_FAILED_STEP, SimulationFlag_IDLE, SIMULATIONFLAGS_L } |
Simulation flags. More... | |
Public Member Functions | |
Structors | |
TProblem (unsigned numInverses, SPARK::TInverse *inverses[], unsigned numVariables, SPARK::TVariable *variables[], unsigned numComponents, SPARK::TComponent *components[]) throw (SPARK::XMemory) | |
Constructs a TProblem object from the structure specified by the variable arrays and the solution sequence described by the component array. | |
~TProblem () throw () | |
Destructor that frees memory allocated for the various solvers. | |
Main methods invoked by driver function | |
void | Initialize (const SPARK::TRuntimeControls &controls) throw (SPARK::XMemory) |
Performs run-time initialization. | |
void | LoadPreferenceSettings (const SPARK::TPreferenceSettings &preferences) throw (SPARK::XMemory) |
Loads preference settings (default and for each component). | |
SimulationFlags | Simulate () throw (SPARK::XInitialization) |
Computes solution from InitialTime to FinalTime. | |
void | Terminate () |
Ends processing and writes statistics to run log file. | |
State management functions | |
These method let you save and restore the problem state in order to allow for a simulation restart from the saved state. | |
void | Save (SPARK::TProblem::TState &state) const throw (SPARK::XInitialization) |
Saves problem state at current time. | |
void | Restore (const SPARK::TProblem::TState &state) |
Restores problem state at the time specified in the state structure. | |
Access functions | |
const char * | GetName () const |
Returns the name of the problem as const char*. | |
void | SetName (const char *name) |
Sets the problem name from name. | |
unsigned long | GetStepCount () const |
Returns the number of simulation steps performed so far. | |
SPARK::TGlobalSettings * | GetGlobalSettings () |
Returns pointer to global settings object. | |
const SPARK::TGlobalSettings * | GetGlobalSettings () const |
Returns pointer to const global settings object. | |
Access operations for global problem variables | |
const SPARK::TVariable & | GetGlobalTime () const |
Returns a const reference to the TVariable object that describes the global time link. | |
const SPARK::TVariable & | GetGlobalTimeStep () const |
Returns a const reference to the TVariable object that describes the global time step link. | |
Access operations for the problem variables | |
SPARK::TVariable & | GetVariable (unsigned handle) throw (SPARK::XAssertion) |
const SPARK::TVariable & | GetVariable (unsigned handle) const throw (SPARK::XAssertion) |
SPARK::TVariable & | GetVariable (const char *name) throw (SPARK::XAssertion) |
const SPARK::TVariable & | GetVariable (const char *name) const throw (SPARK::XAssertion) |
Access operations for the problem inverses | |
SPARK::TInverse * | GetInverse (unsigned handle) |
Returns pointer to TInverse object by handle. | |
SPARK::TInverse * | GetInverse (const char *name) |
Returns pointer to TInverse object by name. | |
Access operations for the problem objects | |
SPARK::TObject * | GetObject (unsigned handle) |
Returns pointer to TObject object by handle. | |
SPARK::TObject * | GetObject (const char *name) |
Returns pointer to TObject object by name. | |
Predicate methods | |
bool | IsInitialTime () const |
Returns true if global time is equal to initial time. | |
bool | IsFinalTime () const |
Returns true if global time is equal to final time. | |
bool | Starting () const |
bool | IsStaticStep () const |
Returns true if current step is a static step. | |
bool | IsTimeStepVariable () const |
Returns true if key VariableTimeStep is set to 1 in runtime controls. | |
bool | IsReady () const |
Returns true if problem is ready for simulation. False otherwise. | |
bool | IsDiagnostic () const |
Returns true if any diagnostic is set. | |
bool | IsDiagnostic (DiagnosticTypes d) const |
Returns true if diagnostic d is set. | |
IO functions | |
bool | WriteStamp (std::ostream &os) const |
Writes current step stamp to output stream os. | |
void | ReportStatistics (std::ostream &os, const std::string &before) const |
Writes simulation statistics to output stream os. | |
void | GenerateSnapshot (const std::string &filename) const throw (SPARK::XInitialization) |
Generates the snapshot file named "filename". |
Class methods implement :
|
Bitset used to specify the diagnostic level with the different diagnostic types.
To make a run with convergence and preferences diagnostic, specifiy |
|
Level of more or less detailed diagnostic to the run log output stream.
|
|
|
Constructs a TProblem object from the structure specified by the variable arrays and the solution sequence described by the component array.
|
|
Destructor that frees memory allocated for the various solvers.
|
|
Performs run-time initialization.
|
|
Loads preference settings (default and for each component).
|
|
Computes solution from InitialTime to FinalTime.
|
|
Ends processing and writes statistics to run log file.
|
|
Saves problem state at current time. This method populates the state object with the state of the problem at the current time.
|
|
Restores problem state at the time specified in the state structure. The method initializes the variables with the trajectory values stored in the state object. For now there is no support for class data persistency.
|
|
Returns the name of the problem as const char*.
|
|
Sets the problem name from name.
|
|
Returns the number of simulation steps performed so far.
|
|
Returns pointer to global settings object.
|
|
Returns pointer to const global settings object.
|
|
Returns a const reference to the TVariable object that describes the global time link.
|
|
Returns a const reference to the TVariable object that describes the global time step link.
|
|
Returns TVariable& object by handle
|
|
Returns const TVariable& object by handle
|
|
Returns TVariable& object by name
|
|
Returns const TVariable& object by name
|
|
Returns pointer to TInverse object by handle.
|
|
Returns pointer to TInverse object by name.
|
|
Returns pointer to TObject object by handle.
|
|
Returns pointer to TObject object by name.
|
|
Returns true if global time is equal to initial time.
|
|
Returns true if global time is equal to final time.
|
|
Returns true if first step of simulation.
|
|
Returns true if current step is a static step.
|
|
Returns true if key VariableTimeStep is set to 1 in runtime controls.
|
|
Returns true if problem is ready for simulation. False otherwise.
|
|
Returns true if any diagnostic is set.
|
|
Returns true if diagnostic d is set.
|
|
Writes current step stamp to output stream os.
|
|
Writes simulation statistics to output stream os.
|
|
Generates the snapshot file named "filename".
|