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

SPARK::TProblem::TState Class Reference

Interface class defining the methods used to save and restore the state of the problem using the TProblem::Save() and TProblem::Restore() methods. More...

#include <problem.h>

List of all members.

Public Member Functions

Structors
 TState ()
 Default consrtuctor.

 TState (const TState &)
 Copy constructor: deep copy of values and class states.

 ~TState () throw ()
 Destructor.

Access functions for trajectory
const char * GetContext () const
 Returns the character string that dscribes the context at the time the problem state was saved.

double GetTime (unsigned idx) const
 Returns the value of the global time variable for the past value idx.

double GetTimeStep (unsigned idx) const
 Returns the value of the global time step variable for the past value idx.

unsigned GetNumVariables () const
 Returns the number of variables stored in Trajectory.

unsigned GetNumPastValues () const
 Returns the number of past values stored in Trajectory for each variable.

value_container & GetPastValues (unsigned idx)
 Returns container with desired past values corresponding to index idx.

const value_container & GetPastValues (unsigned idx) const
 Returns container with desired past values corresponding to index idx.

Main operations
void Save (const std::string &context, const SPARK::TTrajectory &trajectory, const TTopology &topology)
 Loads the problem state at the current time (values and class data).

void Restore (TTrajectory &trajectory, TTopology &topology) const
 Restores the problem state.


Detailed Description

Interface class defining the methods used to save and restore the state of the problem using the TProblem::Save() and TProblem::Restore() methods.

The class defines methods used to save the values of all variables at the current global time. Then an instance of this class can be used to restore the problem state by invoking TProblem::Restore() in order to restart a simulation.

Warning:
These methods do not try to store or load the private data associated with each inverse and/or object in the problem under study. This can potentially cause problems when restarting the simulation with saved solution values because the private data might be in a different state. A later version of SPARK will provide support for full serialization of the problem state, i.e., including class private data, through the addition of dedicated callbacks.


Constructor & Destructor Documentation

SPARK::TProblem::TState::TState  ) 
 

Default consrtuctor.

SPARK::TProblem::TState::TState const TState  ) 
 

Copy constructor: deep copy of values and class states.

SPARK::TProblem::TState::~TState  )  throw ()
 

Destructor.


Member Function Documentation

const char* SPARK::TProblem::TState::GetContext  )  const
 

Returns the character string that dscribes the context at the time the problem state was saved.

double SPARK::TProblem::TState::GetTime unsigned  idx  )  const
 

Returns the value of the global time variable for the past value idx.

Exceptions:
Throws SPARK::Xinitialization if operation failed

double SPARK::TProblem::TState::GetTimeStep unsigned  idx  )  const
 

Returns the value of the global time step variable for the past value idx.

Exceptions:
Throws SPARK::Xinitialization if operation failed

unsigned SPARK::TProblem::TState::GetNumVariables  )  const
 

Returns the number of variables stored in Trajectory.

Returns:
Number of values defining the trajectory, including the values of the global time and the global time step.

unsigned SPARK::TProblem::TState::GetNumPastValues  )  const
 

Returns the number of past values stored in Trajectory for each variable.

Returns:
Number of past values

value_container& SPARK::TProblem::TState::GetPastValues unsigned  idx  ) 
 

Returns container with desired past values corresponding to index idx.

Returns:
Reference to container of values

const value_container& SPARK::TProblem::TState::GetPastValues unsigned  idx  )  const
 

Returns container with desired past values corresponding to index idx.

Returns:
Const reference to container of values

void SPARK::TProblem::TState::Save const std::string &  context,
const SPARK::TTrajectory &  trajectory,
const TTopology &  topology
 

Loads the problem state at the current time (values and class data).

If necessary, frees previously allocated memory.

Parameters:
context Description of the problem context
trajectory Trajectory tracker for the current problem
topology Problem topology to save

void SPARK::TProblem::TState::Restore TTrajectory &  trajectory,
TTopology &  topology
const
 

Restores the problem state.

Parameters:
trajectory Trajectory tracker for the current problem
topology Problem topology to restore


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

Generated on 5 Nov 2003 for VisualSPARK 2.01