dune-grid
2.2.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
grid
io
file
vtk
volumewriter.hh
Go to the documentation of this file.
1
// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=8 sw=2 sts=2:
3
4
#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
5
#define DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
6
7
#include <dune/common/shared_ptr.hh>
8
9
#include <
dune/grid/io/file/vtk/basicwriter.hh
>
10
#include <
dune/grid/io/file/vtk/function.hh
>
11
#include <
dune/grid/io/file/vtk/functionwriter.hh
>
12
#include <
dune/grid/io/file/vtk/volumeiterators.hh
>
13
14
namespace
Dune {
17
18
namespace
VTK {
19
20
template
<
typename
GV>
21
class
ConformingVolumeWriter
22
:
public
ConformingVolumeIteratorFactory
<GV>,
23
public
BasicWriter
<ConformingVolumeIteratorFactory<GV> >
24
{
25
typedef
ConformingVolumeIteratorFactory<GV>
Factory
;
26
typedef
BasicWriter<Factory>
Base
;
27
28
const
GV& gv;
29
30
public
:
31
typedef
Dune::VTKFunction< GV >
VTKFunction
;
32
typedef
shared_ptr<VTKFunction>
VTKFunctionPtr
;
33
34
ConformingVolumeWriter
(
const
GV& gv_)
35
:
Factory
(gv_),
Base
(static_cast<const
Factory
&>(*this)), gv(gv_)
36
{ }
37
38
using
Base::addCellData
;
39
using
Base::addPointData
;
40
41
void
addCellData
(
const
VTKFunctionPtr
& p) {
42
addCellData
(shared_ptr<typename Base::FunctionWriter>
43
(
new
VTKFunctionWriter<VTKFunction>
(p)));
44
}
45
46
void
addCellData
(
VTKFunction
* p) {
47
addCellData
(
VTKFunctionPtr
(p));
48
}
49
50
template
<
typename
V>
51
void
addCellData
(
const
V &v,
const
std::string &name,
int
ncomps=1) {
52
addCellData
(
new
P0VTKFunction<GV, V>
(gv, v, name, ncomps));
53
}
54
55
void
addVertexData
(
const
VTKFunctionPtr
& p) {
56
addPointData
(shared_ptr<typename Base::FunctionWriter>
57
(
new
VTKFunctionWriter<VTKFunction>
(p)));
58
}
59
60
void
addVertexData
(
VTKFunction
* p) {
61
addVertexData
(
VTKFunctionPtr
(p));
62
}
63
64
template
<
typename
V>
65
void
addVertexData
(
const
V &v,
const
std::string &name,
int
ncomps=1) {
66
addVertexData
(
new
P1VTKFunction<GV, V>
(gv, v, name, ncomps));
67
}
68
69
};
70
71
}
// namespace VTK
72
74
75
}
// namespace Dune
76
77
#endif // DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
Generated on Mon May 20 2013 01:15:35 for dune-grid by
1.8.3.1