3#ifndef DUNE_GEOGRID_BACKUPRESTORE_HH
4#define DUNE_GEOGRID_BACKUPRESTORE_HH
6#include <dune/grid/common/backuprestore.hh>
8#include <dune/grid/geometrygrid/declaration.hh>
9#include <dune/grid/geometrygrid/capabilities.hh>
20 template<
class Gr
id,
bool hasBackupRestoreFacilities = Capabilities::hasBackupRestoreFacilities< Gr
id > ::v >
21 class BackupRestoreFacilities
24 template<
class Gr
id >
25 class BackupRestoreFacilities<
Grid, true >
27 typedef BackupRestoreFacilities< Grid, true > This;
30 BackupRestoreFacilities ()
34 BackupRestoreFacilities (
const This & );
35 This &operator= (
const This & );
38 const Grid &asImp ()
const
40 return static_cast< const Grid &
>( *this );
45 return static_cast< Grid &
>( *this );
56 template<
class HostGr
id,
class CoordFunction,
class Allocator >
62 static void backup (
const Grid &grid,
const std::string &path,
const std::string &fileprefix )
65 HostBackupRestoreFacility::backup( grid.hostGrid(), path, fileprefix );
68 static void backup (
const Grid &grid,
const std::ostream &stream )
71 HostBackupRestoreFacility::backup( grid.hostGrid(), stream );
74 static Grid *
restore (
const std::string &path,
const std::string &fileprefix )
77 HostGrid *hostGrid = HostBackupRestoreFacility::restore( path, fileprefix );
78 CoordFunction *coordFunction =
new CoordFunction();
79 return new Grid( hostGrid, coordFunction );
82 static Grid *
restore (
const std::istream &stream )
85 HostGrid *hostGrid = HostBackupRestoreFacility::restore( stream );
86 CoordFunction *coordFunction =
new CoordFunction();
87 return new Grid( hostGrid, coordFunction );
grid wrapper replacing the geometries
Definition: grid.hh:82
Grid abstract base class.
Definition: grid.hh:373
Dune namespace.
Definition: alignedallocator.hh:10
facility for writing and reading grids
Definition: backuprestore.hh:41
static Grid * restore(const std::string &filename)
read a hierarchic grid from disk
Definition: backuprestore.hh:76
static void backup(const Grid &grid, const std::string &filename)
write a hierarchic grid to disk
Definition: backuprestore.hh:49