6#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
7#define DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
11#include <dune/grid/io/file/vtk/basicwriter.hh>
13#include <dune/grid/io/file/vtk/functionwriter.hh>
14#include <dune/grid/io/file/vtk/volumeiterators.hh>
23 class ConformingVolumeWriter
24 :
public ConformingVolumeIteratorFactory<GV>,
25 public BasicWriter<ConformingVolumeIteratorFactory<GV> >
27 typedef ConformingVolumeIteratorFactory<GV> Factory;
28 typedef BasicWriter<Factory> Base;
34 typedef std::shared_ptr<VTKFunction> VTKFunctionPtr;
36 ConformingVolumeWriter(
const GV& gv_)
37 : Factory(gv_), Base(static_cast<const Factory&>(*this)), gv(gv_)
40 using Base::addPointData;
42 void addCellData(
const VTKFunctionPtr& p) {
43 Base::addCellData(std::shared_ptr<typename Base::FunctionWriter>
44 (
new VTKFunctionWriter<VTKFunction>(p)));
47 void addCellData(VTKFunction* p) {
48 addCellData(VTKFunctionPtr(p));
52 void addCellData(
const V &v,
const std::string &name,
int ncomps=1) {
53 addCellData(
new P0VTKFunction<GV, V>(gv, v, name, ncomps));
56 void addVertexData(
const VTKFunctionPtr& p) {
57 addPointData(std::shared_ptr<typename Base::FunctionWriter>
58 (
new VTKFunctionWriter<VTKFunction>(p)));
61 void addVertexData(VTKFunction* p) {
62 addVertexData(VTKFunctionPtr(p));
66 void addVertexData(
const V &v,
const std::string &name,
int ncomps=1) {
67 addVertexData(
new P1VTKFunction<GV, V>(gv, v, name, ncomps));
Functions for VTK output.
Dune namespace.
Definition: alignedallocator.hh:13