Dune Core Modules (2.6.0)

backuprestore.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
4#define DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
5
6#include <dune/grid/common/backuprestore.hh>
7
8namespace Dune
9{
10
11 // External Forward Declarations
12 // -----------------------------
13
14 template< int, int >
15 class AlbertaGrid;
16
17
18
19 // BackupRestoreFacility for AlbertaGrid
20 // -------------------------------------
21
22 template< int dim, int dimworld >
23 struct BackupRestoreFacility< AlbertaGrid< dim, dimworld > >
24 {
26
28 static void backup ( const Grid &grid, const std::string &filename )
29 {
30 grid.writeGridXdr( filename, 0.0 );
31 }
32
37 static void backup ( const Grid &grid, std::ostream &stream )
38 {
39 DUNE_THROW( NotImplemented, "backup / restore using streams not implemented." );
40 }
41
43 static Grid *restore ( const std::string &filename )
44 {
45 Grid *grid = new Grid;
46 double time; // ignore time
47 grid->readGridXdr( filename, time );
48 return grid;
49 }
50
55 static Grid *restore ( std::istream &stream )
56 {
57 DUNE_THROW( NotImplemented, "backup / restore using streams not implemented." );
58 }
59 };
60
61} // namespace Dune
62
63#endif // #ifndef DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Dune namespace.
Definition: alignedallocator.hh:10
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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)