1 #ifndef DUNE_GEOGRID_BACKUPRESTORE_HH
2 #define DUNE_GEOGRID_BACKUPRESTORE_HH
19 template<
class Gr
id,
bool hasBackupRestoreFacilities = Capabilities::hasBackupRestoreFacilities< Gr
id > ::v >
23 template<
class Gr
id >
34 This &operator= (
const This & );
37 template< GrapeIOFileFormatType type >
38 bool writeGrid (
const std::string &filename,
double time )
const
40 return asImp().hostGrid().template writeGrid< type >( filename, time );
43 template< GrapeIOFileFormatType type >
44 bool readGrid (
const std::string &filename,
double &time )
47 = asImp().hostGrid().template readGrid< type >( filename, time );
55 return static_cast< const Grid &
>( *this );
60 return static_cast< Grid &
>( *this );
71 template<
class HostGr
id,
class CoordFunction,
class Allocator >
77 static void backup (
const Grid &grid,
const std::string &path,
const std::string &fileprefix )
80 HostBackupRestoreFacility::backup( grid.
hostGrid(), path, fileprefix );
83 static void backup (
const Grid &grid,
const std::ostream &stream )
86 HostBackupRestoreFacility::backup( grid.
hostGrid(), stream );
89 static Grid *
restore (
const std::string &path,
const std::string &fileprefix )
92 HostGrid *hostGrid = HostBackupRestoreFacility::restore( path, fileprefix );
93 CoordFunction *coordFunction =
new CoordFunction();
94 return new Grid( hostGrid, coordFunction );
100 HostGrid *hostGrid = HostBackupRestoreFacility::restore( stream );
101 CoordFunction *coordFunction =
new CoordFunction();
102 return new Grid( hostGrid, coordFunction );
108 #endif // #ifndef DUNE_GEOGRID_BACKUPRESTORE_HH