|
dune-grid 2.11
|
facility for writing and reading grids More...
#include <dune/grid/yaspgrid/backuprestore.hh>

Public Types | |
| typedef Dune::YaspGrid< dim, Coordinates > | Grid |
| typedef Grid::ctype | ctype |
| typedef Grid::Traits::Communication | Comm |
Static Public Member Functions | |
| static void | backup (const Grid &grid, const std::string &filename) |
| write a hierarchic grid to disk | |
| static void | backup (const Grid &grid, std::ostream &stream) |
| write a hierarchic grid to disk | |
| static Grid * | restore (const std::string &filename, Comm comm=Comm()) |
| read a hierarchic grid from disk | |
| static Grid * | restore (std::istream &stream, Comm comm=Comm()) |
| read a hierarchic grid from a stream | |
facility for writing and reading grids
The BackupRestoreFacility allows writing hierarchic grids to disk and reading them back into another program.
It is guaranteed that all index sets and id sets are preserved by the backup / restore process. The result of restore is undefined, if the number of processes in a parallel program differs from the number of processes used on backup.
There are two pairs of backup / restore methods:
These techniques may not be mixed, i.e., you cannot write the grid into files and read it back from a stream or vice versa. While operating on a std::stream might be convenient, a grid written in another language than C++ might need to emulate this method by writing through a temporary file.
| Grid | type of grid |
| typedef Grid::Traits::Communication Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::Comm |
| typedef Grid::ctype Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::ctype |
| typedef Dune::YaspGrid<dim, Coordinates> Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::Grid |
|
inlinestatic |
write a hierarchic grid to disk
| [in] | grid | grid to write |
| [in] | filename | filename of the file to create |
|
inlinestatic |
write a hierarchic grid to disk
| [in] | grid | grid to write |
| [in] | filename | filename of the file to create |
|
inlinestatic |
read a hierarchic grid from disk
| [in] | filename | filename of the file to read |
| comm | Communication object. |
|
inlinestatic |
read a hierarchic grid from a stream
| [in] | stream | std::stream to read the grid from |
| comm | Communication object. |