DUNE-FEM (unstable)
Implementation of the IOInterface. This class manages checkpointing. More...
#include <dune/fem/io/file/datawriter.hh>
Classes | |
struct | GridPersistentObject |
call appropriate backup and restore methods on the grid class More... | |
Public Member Functions | |
CheckPointer (const GridType &grid, const CheckPointerParameters ¶meter=CheckPointerParameters()) | |
Constructor generating a checkpointer. More... | |
CheckPointer (const GridType &grid, const TimeProviderBase &tp, const CheckPointerParameters ¶meter=CheckPointerParameters()) | |
Constructor generating a checkpointer. More... | |
virtual const char * | myClassName () const |
print class name | |
bool | willWrite (const TimeProviderBase &tp) const |
returns true if data will be written on next write call | |
virtual void | writeBinaryData (const double time) const |
write binary data | |
virtual bool | willWrite () const |
returns true if data will be written on next write call | |
void | write (const std::string &outstring) const |
write given data to disc, evaluates parameter savecount More... | |
void | write () const |
write given data to disc, evaluates parameter savecount | |
void | write (const TimeProviderBase &tp, const std::string &outstring) const |
write given data to disc, evaluates parameter savecount and savestep More... | |
void | write (const TimeProviderBase &tp) const |
write given data to disc, evaluates parameter savecount and savestep More... | |
void | writeData (double sequenceStamp, const std::string &outstring) const |
write data with a given sequence stamp and outstring More... | |
void | writeData (double sequenceStamp) const |
write data with a given sequence stamp More... | |
const std::string & | path () const |
return output path name | |
int | writeStep () const |
return write step | |
int | writeCalls () const |
return write calls | |
double | saveTime () const |
return save time | |
Static Public Member Functions | |
static GridType * | restoreGrid (const std::string checkFile, const int givenRank=-1, const CheckPointerParameters ¶meter=CheckPointerParameters()) |
restore grid from previous runs More... | |
static void | restoreData (const GridType &grid, const std::string checkFile, const int rank=-1) |
restores data, assumes that all objects have been created and inserted to PersistenceManager before this method is called More... | |
static std::string | defaultGridKey (int dimension, bool check=true) |
return FEM key for macro grid reading | |
static std::string | defaultGridKey (std::string base, int dimension, const ParameterReader ¶meter, bool check=true) |
return FEM key for macro grid reading | |
static void | createPath (const std::string &path) |
create given path in combination with rank | |
static std::string | createPathName (const std::string &pathPref, int rank) |
create given path in combination with rank | |
static std::string | readPath () |
template<class CommunicatorType > | |
static void | createGlobalPath (const CommunicatorType &comm, const std::string &path) |
create global path for data output | |
Protected Types | |
typedef GridImp | GridType |
used grid type | |
typedef DataWriter< GridImp, DataImp > | BaseType |
type of base class | |
typedef CheckPointer< GridImp > | ThisType |
type of this class | |
typedef DataImp | OutPutDataType |
used data tuple | |
Protected Member Functions | |
CheckPointer (const GridType &grid, const int myRank, const char *checkFile, const bool takeCareOfPersistenceManager=true, const int writeStep=0) | |
Constructor generating a checkpointer to restore data. More... | |
std::string | restorePersistentData () |
restores data, assumes that all objects have been created before this method is called | |
bool | readCheckPoint (const bool warn=true) |
read checkpoint file | |
virtual void | display () const |
display data with grape | |
void | grapeDisplay (OutputTupleType &data) const |
display data with grape | |
Protected Attributes | |
const GridType & | grid_ |
type of this class | |
Detailed Description
class Dune::Fem::CheckPointer< GridImp >
Implementation of the IOInterface. This class manages checkpointing.
All data that was registered to PersistenceManager will be stored in binary output format. The derivation from DataWriter is simply to use the writeStep method. The binary output of DataWriter is not used anymore and does not work for checkpointing.
Constructor & Destructor Documentation
◆ CheckPointer() [1/3]
|
inline |
Constructor generating a checkpointer.
- Parameters
-
grid corresponding grid parameter structure for tuning the behavior of the Dune::CheckPointer defaults to Dune::CheckPointerParameters
◆ CheckPointer() [2/3]
|
inline |
Constructor generating a checkpointer.
- Parameters
-
grid corresponding grid data Tuple containing discrete functions to write tp a time provider to set time (e.g. for restart) parameter structure for tuning the behavior of the Dune::CheckPointer defaults to Dune::CheckPointerParameters
◆ CheckPointer() [3/3]
|
inlineprotected |
Constructor generating a checkpointer to restore data.
- Parameters
-
grid corresponding grid myRank rank of process data Tuple containing discrete functions to write checkFile filename for restoring state of program from previous runs takeCareOfPersistenceManager flag whether to keep persistent values by PersistenceManager (default true) writeStep initial counter value, default 0
- Note
- In Addition to the parameters read by the DataWriter this class reads the following parameters:
write checkpoint every ‘CheckPointStep’ time step
fem.io.checkpointstep: 500
store checkpoint information to file ‘CheckPointFile’
fem.io.checkpointfile: checkpoint
References Dune::Fem::CheckPointerParameters::checkPointPrefix(), Dune::Fem::CheckPointer< GridImp >::readCheckPoint(), and Dune::Fem::DataOutput< GridImp, std::tuple<> >::writeStep().
Member Function Documentation
◆ readPath()
|
inlinestaticinherited |
standard path reading and creation method rank is added to output path
References Dune::Fem::Parameter::commonOutputPath().
Referenced by Dune::Fem::CheckPointer< GridImp >::restoreGrid().
◆ restoreData()
|
inlinestatic |
restores data, assumes that all objects have been created and inserted to PersistenceManager before this method is called
- Parameters
-
grid Grid the data belong to checkFile check point file
References DUNE_THROW, and Dune::Fem::CheckPointer< GridImp >::restoreData().
Referenced by Dune::Fem::CheckPointer< GridImp >::restoreData().
◆ restoreGrid()
|
inlinestatic |
restore grid from previous runs
- Parameters
-
[in] checkFile checkPoint filename [in] givenRank number of my process (defaults to MPIManager :: rank() ) [in] parameter Parameterclass which provides informations about the checkpoint
- Returns
- Pointer to restored grid instance
References Dune::Fem::CheckPointerParameters::checkPointPrefix(), DUNE_THROW, Dune::Fem::DataOutput< GridImp, std::tuple<> >::path(), Dune::Fem::IOInterface::readPath(), Dune::BackupRestoreFacility< Grid >::restore(), Dune::Fem::CheckPointerParameters::separateRankPath(), and Dune::Fem::Parameter::verbose().
◆ write() [1/3]
|
inlineinherited |
write given data to disc, evaluates parameter savecount
- Parameters
-
outstring pass additional string for naming
◆ write() [2/3]
|
inlinevirtualinherited |
write given data to disc, evaluates parameter savecount and savestep
- Parameters
-
tp time provider for time and step
Implements Dune::Fem::IOInterface.
◆ write() [3/3]
|
inlineinherited |
write given data to disc, evaluates parameter savecount and savestep
- Parameters
-
tp time provider for time and step outstring pass additional string for naming
◆ writeData() [1/2]
|
inlinevirtualinherited |
write data with a given sequence stamp
- Parameters
-
sequenceStamp stamp for the data set
Implements Dune::Fem::IOInterface.
◆ writeData() [2/2]
|
inlineinherited |
write data with a given sequence stamp and outstring
- Parameters
-
sequenceStamp stamp for the data set outstring pass additional string for naming
The documentation for this class was generated from the following file:
- dune/fem/io/file/datawriter.hh