dune-grid  2.2.0
boundarywriter.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_BOUNDARYWRITER_HH
5 #define DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH
6 
7 #include <string>
8 
9 #include <dune/common/shared_ptr.hh>
10 
14 
15 namespace Dune {
18 
19  namespace VTK {
20 
21  template<typename GV>
24  public BasicWriter<NonConformingBoundaryIteratorFactory<GV> >
25  {
27  typedef BasicWriter<Factory> Base;
28 
29  const GV& gv;
30 
31  public:
33  : Factory(gv_), Base(static_cast<const Factory&>(*this)), gv(gv_)
34  { }
35 
36  using Base::addCellData;
37 
38  template<typename Func>
39  void addCellData(const shared_ptr<Func>& p, const std::string& name) {
40  addCellData(shared_ptr<typename Base::FunctionWriter>
41  (new SkeletonFunctionWriter<Func>(p, name)));
42  }
43 
44  template<typename Func>
45  void addCellData(Func* p, const std::string& name) {
46  addCellData(shared_ptr<Func>(p), name);
47  }
48 
49  using Base::addPointData;
50 
51  template<typename Func>
52  void addPointData(const shared_ptr<Func>& p, const std::string& name) {
53  addPointData(shared_ptr<typename Base::FunctionWriter>
54  (new SkeletonFunctionWriter<Func>(p, name)));
55  }
56 
57  template<typename Func>
58  void addPointData(Func* p, const std::string& name) {
59  addPointData(shared_ptr<Func>(p), name);
60  }
61 
62  };
63 
64  } // namespace VTK
65 
67 
68 } // namespace Dune
69 
70 #endif // DUNE_GRID_IO_FILE_VTK_BOUNDARYWRITER_HH