KASKADE 7 development version
|
#include <checkPoint.hh>
Definition at line 34 of file checkPoint.hh.
Public Member Functions | |
CheckPoint () | |
CheckPoint creates a new empty directory with current time stamp as name. Later writes will refer to this dirctory. More... | |
CheckPoint (std::string const &pathName) | |
CheckPoint. If the directory with pathName already exists later reads will refer to this directory. Otherwise a new directory will be created where current time stamp is appended to pathName. This can then be used for writing. More... | |
bool | readMode () const |
readMode returns true if this check point was created in read mode (i.e. with existing directory given). More... | |
std::string | timeStamp () const |
timeStamp gives the time stamp when directory was created (at construction of this CheckPoint instance), empty when directory already existed. More... | |
template<class Grid > | |
void | writeGrid (GridManager< Grid > const &gridManager, std::string const &gridName) const |
writes grid into file with name gridName. More... | |
template<class Grid > | |
void | writeGrid (Grid const &grid, std::string const &gridName) const |
writes grid into file with name gridName. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | readGrid (std::string const &gridName) const |
reads grid from file with name gridName. More... | |
template<class Index > | |
void | writeRefinementHistory (std::vector< std::vector< std::pair< int, Index > > > const &refHist, std::string const &gridName) const |
writes the refinement history of a grid. More... | |
template<class Index > | |
void | appendRefinementHistory (std::vector< std::pair< int, Index > > const &refStep, std::string const &gridName) const |
appends data of one refinement step of a grid to file. More... | |
template<class Index > | |
std::vector< std::vector< std::pair< int, Index > > > | readRefinementHistory (std::string const &gridName) const |
reads the refinement history of a grid. More... | |
template<template< class, int > class Array, class Scalar , int dim> | |
void | writeData (Dune::BlockVector< Array< Scalar, dim > > const &data, std::string const &dataName) const |
writes data into file with name dataName. Version for BlockVector. More... | |
template<class DataBlocks > | |
void | writeData (DataBlocks const &data, std::string const &dataName) const |
writes data into file with name dataName. Version for LinearProductSpace (of FE-functions or coefficient vectors). More... | |
template<class FeSpace , int m> | |
void | writeData (FunctionSpaceElement< FeSpace, m > const &data, std::string const &dataName) const |
writes data into file with name dataName. Version for FE-function. More... | |
template<template< class, int > class Array, class Scalar , int dim> | |
void | readData (Dune::BlockVector< Array< Scalar, dim > > &data, std::string const &dataName) const |
reads data from file with name dataName. Version for BlockVector. More... | |
template<class DataBlocks > | |
void | readData (DataBlocks &data, std::string const &dataName) const |
reads data from file with name dataName. Version for LinearProductSpace (of FE-functions or coefficient vectors). More... | |
template<class FeSpace , int m> | |
void | readData (FunctionSpaceElement< FeSpace, m > &data, std::string const &dataName) const |
reads data from file with name dataName. Version for FE-function. More... | |
Protected Member Functions | |
void | setTimeStamp () |
template<template< class, int > class Array, class Scalar , int dim> | |
std::ofstream | writeData (Dune::BlockVector< Array< Scalar, dim > > const &data, std::ofstream out) const |
template<class FeSpace , int m> | |
std::ofstream | writeData (FunctionSpaceElement< FeSpace, m > const &data, std::ofstream out) const |
template<template< class, int > class Array, class Scalar , int dim> | |
std::ifstream | readData (Dune::BlockVector< Array< Scalar, dim > > &data, std::ifstream in) const |
template<class FeSpace , int m> | |
std::ifstream | readData (FunctionSpaceElement< FeSpace, m > &data, std::ifstream in) const |
Protected Attributes | |
std::string | timeStamp_ |
boost::filesystem::path | directory |
Kaskade::CheckPoint::CheckPoint | ( | ) |
CheckPoint creates a new empty directory with current time stamp as name. Later writes will refer to this dirctory.
Kaskade::CheckPoint::CheckPoint | ( | std::string const & | pathName | ) |
CheckPoint. If the directory with pathName already exists later reads will refer to this directory. Otherwise a new directory will be created where current time stamp is appended to pathName. This can then be used for writing.
pathName | is the directory which is to be created (if not existing) or where is to be read from (if existing). |
|
inline |
appends data of one refinement step of a grid to file.
This is e.g. usefull for check pointing UGGrid, since writeGrid does not work for it. The advantage compared to writeRefinementsHistory is, that if you do a lot of check-pointing and refinement steps, you do not have write the whole history in each step again and again but only to append the update from the last step.
Definition at line 134 of file checkPoint.hh.
|
inline |
reads data from file with name dataName. Version for LinearProductSpace (of FE-functions or coefficient vectors).
DataBlocks | has to be something like LinearProductSpace, i.e. e.g. VariableSet or CoefficientVectorRepresentation. |
Definition at line 226 of file checkPoint.hh.
|
inlineprotected |
Definition at line 256 of file checkPoint.hh.
|
inline |
reads data from file with name dataName. Version for BlockVector.
Array | is template type, which behaves like an array, e.g. Dune::FieldVector |
Definition at line 216 of file checkPoint.hh.
Referenced by readData().
|
inlineprotected |
Definition at line 262 of file checkPoint.hh.
|
inline |
reads data from file with name dataName. Version for FE-function.
Definition at line 237 of file checkPoint.hh.
|
inline |
reads grid from file with name gridName.
Does not work for UGGrid.
Definition at line 98 of file checkPoint.hh.
|
inline |
readMode returns true if this check point was created in read mode (i.e. with existing directory given).
Definition at line 53 of file checkPoint.hh.
|
inline |
reads the refinement history of a grid.
This is e.g. usefull for check pointing UGGrid, since writeGrid does not work for it. After reading in, the initial grid can be refined step by step in the same manner.
refHist | is the refinement history. Suggestion for interpretation: Each entry refers to one refinement step. If an entry is an empty vector this means global refinement (once). Otherwise the vector for a refinement step containts pairs of refinement count and cell index (similiar to the usage in the mark() method of the Dune grid interface). |
Definition at line 157 of file checkPoint.hh.
|
protected |
|
inline |
timeStamp gives the time stamp when directory was created (at construction of this CheckPoint instance), empty when directory already existed.
Definition at line 61 of file checkPoint.hh.
|
inline |
writes data into file with name dataName. Version for LinearProductSpace (of FE-functions or coefficient vectors).
DataBlocks | has to be something like LinearProductSpace, i.e. e.g. VariableSet or CoefficientVectorRepresentation. |
Definition at line 191 of file checkPoint.hh.
|
inlineprotected |
Definition at line 245 of file checkPoint.hh.
|
inline |
writes data into file with name dataName. Version for BlockVector.
Array | is template type, which behaves like an array, e.g. Dune::FieldVector |
Definition at line 177 of file checkPoint.hh.
Referenced by writeData().
|
inlineprotected |
Definition at line 251 of file checkPoint.hh.
|
inline |
writes data into file with name dataName. Version for FE-function.
Definition at line 206 of file checkPoint.hh.
|
inline |
writes grid into file with name gridName.
Does not work for UGGrid.
Definition at line 81 of file checkPoint.hh.
|
inline |
writes grid into file with name gridName.
Does not work for UGGrid.
Definition at line 71 of file checkPoint.hh.
Referenced by writeGrid().
|
inline |
writes the refinement history of a grid.
This is e.g. usefull for check pointing UGGrid, since writeGrid does not work for it.
refHist | is the refinement history. Suggestion for interpretation: Each entry refers to one refinement step. If an entry is an empty vector this means global refinement (once). Otherwise the vector for a refinement step containts pairs of refinement count and cell index (similiar to the usage in the mark() method of the Dune grid interface). |
Definition at line 114 of file checkPoint.hh.
|
protected |
Definition at line 267 of file checkPoint.hh.
Referenced by appendRefinementHistory(), readData(), readGrid(), readRefinementHistory(), writeData(), writeGrid(), and writeRefinementHistory().
|
protected |
Definition at line 266 of file checkPoint.hh.
Referenced by readMode(), and timeStamp().