dune-grid
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
grid
albertagrid
albertagrid/backuprestore.hh
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4
// vi: set et ts=4 sw=2 sts=2:
5
#ifndef DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
6
#define DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
7
8
#include <
dune/grid/common/backuprestore.hh
>
9
10
namespace
Dune
11
{
12
13
// External Forward Declarations
14
// -----------------------------
15
16
template
<
int
,
int
>
17
class
AlbertaGrid
;
18
19
20
21
// BackupRestoreFacility for AlbertaGrid
22
// -------------------------------------
23
24
template
<
int
dim,
int
dimworld >
25
struct
BackupRestoreFacility
<
AlbertaGrid
< dim, dimworld > >
26
{
27
typedef
AlbertaGrid< dim, dimworld >
Grid
;
28
30
static
void
backup
(
const
Grid
&grid,
const
std::string &filename )
31
{
32
grid.
writeGrid
( filename, 0.0 );
33
}
34
39
static
void
backup
(
const
Grid
&
/*grid*/
, std::ostream &
/*stream*/
)
40
{
41
DUNE_THROW( NotImplemented,
"backup / restore using streams not implemented."
);
42
}
43
45
static
Grid
*
restore
(
const
std::string &filename )
46
{
47
Grid
*grid =
new
Grid
;
48
double
time;
// ignore time
49
grid->
readGrid
( filename, time );
50
return
grid;
51
}
52
57
static
Grid
*
restore
( std::istream &
/*stream*/
)
58
{
59
DUNE_THROW( NotImplemented,
"backup / restore using streams not implemented."
);
60
}
61
};
62
63
}
// namespace Dune
64
65
#endif
// #ifndef DUNE_GRID_ALBERTAGRID_BACKUPRESTORE_HH
Dune
Include standard header files.
Definition
agrid.hh:60
Dune::AlbertaGrid
[ provides Dune::Grid ]
Definition
agrid.hh:109
Dune::AlbertaGrid::readGrid
bool readGrid(const std::string &filename, ctype &time)
read Grid from file filename and store time of mesh in time
Definition
albertagrid.cc:585
Dune::AlbertaGrid::writeGrid
bool writeGrid(const std::string &filename, ctype time) const
write Grid to file in Xdr
Definition
albertagrid.cc:575
Dune::BackupRestoreFacility< AlbertaGrid< dim, dimworld > >::restore
static Grid * restore(const std::string &filename)
read a hierarchic grid from disk
Definition
albertagrid/backuprestore.hh:45
Dune::BackupRestoreFacility< AlbertaGrid< dim, dimworld > >::Grid
AlbertaGrid< dim, dimworld > Grid
Definition
albertagrid/backuprestore.hh:27
Dune::BackupRestoreFacility< AlbertaGrid< dim, dimworld > >::backup
static void backup(const Grid &grid, const std::string &filename)
write a hierarchic grid to disk
Definition
albertagrid/backuprestore.hh:30
Dune::BackupRestoreFacility< AlbertaGrid< dim, dimworld > >::restore
static Grid * restore(std::istream &)
read a hierarchic grid from disk
Definition
albertagrid/backuprestore.hh:57
Dune::BackupRestoreFacility< AlbertaGrid< dim, dimworld > >::backup
static void backup(const Grid &, std::ostream &)
write a hierarchic grid to disk
Definition
albertagrid/backuprestore.hh:39
Dune::BackupRestoreFacility
facility for writing and reading grids
Definition
common/backuprestore.hh:43
backuprestore.hh
Generated by
1.17.0