dune-fem 2.8.0
|
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 Types | |
enum | OutputFormat { vtk = 0 , vtkvtx = 1 , subvtk = 2 , binary = 3 , gnuplot = 4 , none = 5 } |
Public Member Functions | |
CheckPointer (const GridType &grid, const CheckPointerParameters ¶meter=CheckPointerParameters()) | |
Constructor generating a checkpointer. | |
CheckPointer (const GridType &grid, const TimeProviderBase &tp, const CheckPointerParameters ¶meter=CheckPointerParameters()) | |
Constructor generating a checkpointer. | |
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 | |
void | consistentSaveStep (const TimeProviderBase &tp) const |
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 | |
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 | |
void | write (const TimeProviderBase &tp) const |
write given data to disc, evaluates parameter savecount and savestep | |
void | writeData (double sequenceStamp, const std::string &outstring) const |
write data with a given sequence stamp and outstring | |
void | writeData (double sequenceStamp) const |
write data with a given sequence stamp | |
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 | |
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 | |
static void | writeSingleCheckPoint (const GridType &grid, const double time, const bool storePersistenceManager, const int writeStep=0) |
static std::string | defaultGridKey (int dimension, bool check=true) |
return FEM key for macro grid reading | |
static std::string | defaultGridKey (int dimension, const ParameterReader ¶meter, bool check=true) |
static std::string | defaultGridKey (std::string base, int dimension, bool check=true) |
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 | |
template<class CommunicatorType > | |
static std::string | createPath (const CommunicatorType &comm, const std::string &pathPrefix, const std::string &dataPrefix, const int step, const bool alsoCreateRankPath=true) |
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 | |
static std::string | copyPathToFilename (const std::string &path) |
static std::string | createRecoverPath (const std::string &pathPrefix, const int rank, const std::string &dataPrefix, const int step, const bool alsoUseRankPath=true) |
template<class GridImp > | |
static void | writeMacroGrid (const GridImp &grid, std::ostream &out, const std::string ¯oname, const std::string &path, const std::string &prefix, const bool writeSubFiles=false) |
if grid is structured grid, write macro file | |
template<class GridImp > | |
static void | copyMacroGrid (const GridImp &g, const std::string ¯oGrid, const std::string &orgPath, const std::string &destPath, const std::string &prefix) |
if grid is structured grid, write macro file | |
Protected Types | |
typedef GridImp | GridType |
used grid type | |
typedef DofManager< GridType > | DofManagerType |
typedef DataWriter< GridImp, DataImp > | BaseType |
type of base class | |
typedef CheckPointer< GridImp > | ThisType |
type of this class | |
typedef DataImp | OutPutDataType |
used data tuple | |
typedef GridPersistentObject | PersistentGridObjectType |
Protected Member Functions | |
void | initialize (const CheckPointerParameters ¶meter) |
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. | |
std::string | restorePersistentData () |
restores data, assumes that all objects have been created before this method is called | |
template<class InputTuple > | |
void | restoreUserData (InputTuple &data) |
void | restoreData () |
bool | readCheckPoint (const bool warn=true) |
read checkpoint file | |
void | writeCheckPoint (const std::string &path, const double time, const int savestep) const |
std::string | writeMyBinaryData (const double sequenceStamp, const int step, OutputTuple &data) const |
auto | getGridPart () const |
auto | getGridPart (std::integral_constant< bool, false >) const |
auto | getGridPart (std::integral_constant< bool, true >) const |
std::string | writeGnuPlotOutput () const |
virtual void | display () const |
display data with grape | |
template<class OutputTupleType > | |
void | grapeDisplay (OutputTupleType &data) const |
display data with grape | |
Static Protected Member Functions | |
static std::string | strRank (const int rank) |
create string containing rank | |
template<class GridImp > | |
static void | saveCartesianGrid (const GridImp &grid, std::ostream &out, dgf::IntervalBlock &intervalBlock, std::string filename, const bool writeSubFiles) |
write my partition as macro grid | |
template<int dimension> | |
static void | writeToStream (std::ostream &file, const FieldVector< double, dimension > &origin, const FieldVector< double, dimension > &lang, const FieldVector< int, dimension > &anz) |
template<int dimension> | |
static void | writeStructuredGrid (const std::string &filename, std::ostream &out, const FieldVector< double, dimension > &origin, const FieldVector< double, dimension > &lang, const FieldVector< int, dimension > &anz) |
write structured grid as DGF file | |
Protected Attributes | |
OutPutDataType | fakeData_ |
std::unique_ptr< PersistentGridObjectType > | persistentGridObject_ |
OutPutDataType * | dataPtr_ |
const int | checkPointStep_ |
const int | maxCheckPointNumber_ |
int | myRank_ |
std::string | checkPointFile_ |
bool | takeCareOfPersistenceManager_ |
std::stringstream | macroGrid_ |
const bool | separateRankPath_ |
const GridType & | grid_ |
type of this class | |
OutPutDataType | data_ |
std::string | path_ |
std::string | datapref_ |
bool | grapeDisplay_ |
int | writeStep_ |
int | writeCalls_ |
double | saveTime_ |
double | saveStep_ |
int | saveCount_ |
OutputFormat | outputFormat_ |
bool | conformingOutput_ |
std::unique_ptr< FileWriter > | sequence_ |
std::unique_ptr< PVDWriter > | pvd_ |
std::unique_ptr< const DataOutputParameters > | param_ |
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.
|
protected |
type of base class
|
protected |
|
protected |
used grid type
|
protected |
used data tuple
|
protected |
|
protected |
type of this class
|
inherited |
|
inline |
Constructor generating a checkpointer.
grid | corresponding grid |
parameter | structure for tuning the behavior of the Dune::CheckPointer defaults to Dune::CheckPointerParameters |
|
inline |
Constructor generating a checkpointer.
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 |
|
inlineprotected |
Constructor generating a checkpointer to restore data.
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 |
fem.io.checkpointstep: 500
fem.io.checkpointfile: checkpoint
|
inlineinherited |
|
inlinestaticinherited |
if grid is structured grid, write macro file
|
inlinestaticinherited |
|
inlinestaticinherited |
create global path for data output
|
inlinestaticinherited |
|
inlinestaticinherited |
create given path in combination with rank
|
inlinestaticinherited |
create given path in combination with rank
|
inlinestaticinherited |
|
inlinestaticinherited |
return FEM key for macro grid reading
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
return FEM key for macro grid reading
|
inlineprotectedvirtualinherited |
display data with grape
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
display data with grape
|
inlineprotected |
|
inlinevirtual |
print class name
Reimplemented from Dune::Fem::DataWriter< GridImp, std::tuple<> >.
|
inlineinherited |
return output path name
|
inlineprotected |
read checkpoint file
|
inlinestaticinherited |
standard path reading and creation method rank is added to output path
|
inlineprotected |
|
inlinestatic |
restores data, assumes that all objects have been created and inserted to PersistenceManager before this method is called
grid | Grid the data belong to |
checkFile | check point file |
|
inlinestatic |
restore grid from previous runs
[in] | checkFile | checkPoint filename |
[in] | givenRank | number of my process (defaults to MPIManager :: rank() ) |
[in] | parameter | Parameterclass which provides informations about the checkpoint |
|
inlineprotected |
restores data, assumes that all objects have been created before this method is called
|
inlineprotected |
|
inlinestaticprotectedinherited |
write my partition as macro grid
|
inlineinherited |
return save time
|
inlinestaticprotectedinherited |
create string containing rank
|
inlinevirtualinherited |
returns true if data will be written on next write call
|
inlinevirtual |
returns true if data will be written on next write call
Reimplemented from Dune::Fem::DataOutput< GridImp, DataImp >.
|
inlinevirtualinherited |
write given data to disc, evaluates parameter savecount
Implements Dune::Fem::IOInterface.
|
inlineinherited |
write given data to disc, evaluates parameter savecount
outstring | pass additional string for naming |
|
inlinevirtualinherited |
write given data to disc, evaluates parameter savecount and savestep
tp | time provider for time and step |
Implements Dune::Fem::IOInterface.
|
inlineinherited |
write given data to disc, evaluates parameter savecount and savestep
tp | time provider for time and step |
outstring | pass additional string for naming |
|
inlinevirtual |
write binary data
Reimplemented from Dune::Fem::DataWriter< GridImp, std::tuple<> >.
|
inlineinherited |
return write calls
|
inlineprotected |
|
inlinevirtualinherited |
write data with a given sequence stamp
sequenceStamp | stamp for the data set |
Implements Dune::Fem::IOInterface.
|
inlineinherited |
write data with a given sequence stamp and outstring
sequenceStamp | stamp for the data set |
outstring | pass additional string for naming |
|
inlineprotectedinherited |
|
inlinestaticinherited |
if grid is structured grid, write macro file
|
inlineprotectedinherited |
|
inlinestatic |
|
inlineinherited |
return write step
|
inlinestaticprotectedinherited |
write structured grid as DGF file
|
inlinestaticprotectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
type of this class
|
mutableprotectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
mutableprotectedinherited |
|
mutableprotectedinherited |