DUNE-FEM (unstable)
Classes | |
class | Dune::Fem::CheckPointer< GridImp > |
Implementation of the IOInterface. This class manages checkpointing. More... | |
class | Dune::Fem::PersistentObject |
base class for persistent objects More... | |
class | Dune::Fem::PersistenceManager |
class with singleton instance managing all persistent objects More... | |
class | Dune::Fem::AutoPersistentObject |
base class for auto persistent objects More... | |
Detailed Description
The Dune::Fem::PersistenceManager manages a list of persistent object the state should be recovered during a restart process. The singleton instance is available using persistenceManager.
Variables of any type can be added to the manager using operator<< and removed through operator>>. For general types the state is written to an ascii file persistentobjects
through the call to PersistenceManager::backup(path).
Finer control is available for user defined classes by deriving these from the Dune::PersistentObject class and implementing the virtual functions backup
and restore
. Values can then either be written to the ascii file persistentobjects
using the method Dune::Fem::PersistenceManager::backupValue giving a token and the value to store (a structure simular to the Dune::Parameter files is used). If data is to be written to a different stream a unique filename can be obtained from the Dune::PersistenceManager using the uniqueFileName
method.
If a class is derived from Dune::AutoPersistenceObject then instances of this class are automatically added to the PersistenceManager on construction and removed on destruction; again the virtual methods backup/restore must be provided.
The restart process is activated through the method restore
. Note that care must be taken to add the objects in exactly the same order when using the PersistenceManager for creating the backup file as when used to restore the saved states.
The Dune::Fem::Parameter class is automatically backuped and restored. For the restore process the saved parameter file is read first and existing values for parameters are replaced by these values. Therefore it is possible to reread the state of a variable orignally defined through a run time parameter using the Parameter class: