4#ifndef DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
5#define DUNE_GRID_IO_FILE_VTK_VOLUMEWRITER_HH
9#include <dune/grid/io/file/vtk/basicwriter.hh>
11#include <dune/grid/io/file/vtk/functionwriter.hh>
12#include <dune/grid/io/file/vtk/volumeiterators.hh>
21 class ConformingVolumeWriter
22 :
public ConformingVolumeIteratorFactory<GV>,
23 public BasicWriter<ConformingVolumeIteratorFactory<GV> >
25 typedef ConformingVolumeIteratorFactory<GV> Factory;
26 typedef BasicWriter<Factory> Base;
32 typedef shared_ptr<VTKFunction> VTKFunctionPtr;
34 ConformingVolumeWriter(
const GV& gv_)
35 : Factory(gv_), Base(static_cast<const Factory&>(*this)), gv(gv_)
38 using Base::addPointData;
40 void addCellData(
const VTKFunctionPtr& p) {
41 Base::addCellData(shared_ptr<typename Base::FunctionWriter>
42 (
new VTKFunctionWriter<VTKFunction>(p)));
45 void addCellData(VTKFunction* p) {
46 addCellData(VTKFunctionPtr(p));
50 void addCellData(
const V &v,
const std::string &name,
int ncomps=1) {
51 addCellData(
new P0VTKFunction<GV, V>(gv, v, name, ncomps));
54 void addVertexData(
const VTKFunctionPtr& p) {
55 addPointData(shared_ptr<typename Base::FunctionWriter>
56 (
new VTKFunctionWriter<VTKFunction>(p)));
59 void addVertexData(VTKFunction* p) {
60 addVertexData(VTKFunctionPtr(p));
64 void addVertexData(
const V &v,
const std::string &name,
int ncomps=1) {
65 addVertexData(
new P1VTKFunction<GV, V>(gv, v, name, ncomps));
Functions for VTK output.
Dune namespace.
Definition: alignment.hh:10
This file implements the class shared_ptr (a reference counting pointer), for those systems that don'...