dune-grid
2.3beta2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
grid
albertagrid
albertagrid/backuprestore.hh
Go to the documentation of this file.
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
8
namespace
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
{
25
typedef
AlbertaGrid< dim, dimworld >
Grid
;
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
Generated on Mon Feb 10 2014 21:12:26 for dune-grid by
1.8.1.2