dune-pdelab  2.5-dev
vtk.hh
Go to the documentation of this file.
1 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_VTK_HH
2 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_VTK_HH
3 
4 #include <vector>
5 #include <sstream>
6 
7 #include <dune/common/exceptions.hh>
8 
9 #include <dune/geometry/typeindex.hh>
10 
11 #include <dune/localfunctions/common/interfaceswitch.hh>
12 
13 #include <dune/typetree/visitor.hh>
14 #include <dune/typetree/traversal.hh>
15 
22 
23 namespace Dune {
24 
25  template<typename GV>
26  class VTKWriter;
27 
28  template<typename GV>
30 
31  template<typename GV>
33 
34  namespace PDELab {
35 
36  namespace vtk {
37 
38  namespace {
39 
40  template<typename VTKWriter>
41  struct vtk_writer_traits;
42 
43  template<typename GV>
44  struct vtk_writer_traits<Dune::VTKWriter<GV> >
45  {
46  typedef GV GridView;
47  };
48 
49  template<typename GV>
50  struct vtk_writer_traits<Dune::SubsamplingVTKWriter<GV> >
51  {
52  typedef GV GridView;
53  };
54 
55  template<typename GV>
56  struct vtk_writer_traits<Dune::VTKSequenceWriter<GV> >
57  {
58  typedef GV GridView;
59  };
60 
61  }
62 
63  template<typename LFS, typename Data>
65 
66  template<typename LFS, typename Data>
68 
69  template<typename VTKWriter, typename Data>
71 
72 
74  template<typename GFS, typename X, typename Pred>
76  {
77 
78  template<typename LFS, typename Data>
79  friend class DGFTreeLeafFunction;
80 
81  template<typename LFS, typename Data>
82  friend class DGFTreeVectorFunction;
83 
84  template<typename, typename>
85  friend struct OutputCollector;
86 
89  typedef typename X::template ConstLocalView<LFSCache> XView;
91  using EntitySet = typename GFS::Traits::EntitySet;
92  using Cell = typename EntitySet::Traits::Element;
93  using IndexSet = typename EntitySet::Traits::IndexSet;
94  typedef typename IndexSet::IndexType size_type;
95 
96  static const auto dim = EntitySet::dimension;
97 
98  public:
99 
100  typedef GFS GridFunctionSpace;
101  typedef X Vector;
102  typedef Pred Predicate;
103 
104  DGFTreeCommonData(const GFS& gfs, const X& x)
105  : _lfs(gfs)
106  , _lfs_cache(_lfs)
107  , _x_view(x)
108  , _x_local(_lfs.maxSize())
109  , _index_set(gfs.entitySet().indexSet())
110  , _current_cell_index(std::numeric_limits<size_type>::max())
111  {}
112 
113  public:
114 
115  void bind(const Cell& cell)
116  {
117  auto cell_index = _index_set.uniqueIndex(cell);
118  if (_current_cell_index == cell_index)
119  return;
120 
121  _lfs.bind(cell);
122  _lfs_cache.update();
123  _x_view.bind(_lfs_cache);
124  _x_view.read(_x_local);
125  _x_view.unbind();
126  _current_cell_index = cell_index;
127  }
128 
129  LFS _lfs;
130  LFSCache _lfs_cache;
131  XView _x_view;
132  XLocalVector _x_local;
133  const IndexSet& _index_set;
135 
136  };
137 
138 
139 
140  template<typename LFS, typename Data>
141  class DGFTreeLeafFunction
142  : public GridFunctionBase<GridFunctionTraits<
143  typename LFS::Traits::GridView,
144  typename BasisInterfaceSwitch<
145  typename FiniteElementInterfaceSwitch<
146  typename LFS::Traits::FiniteElement
147  >::Basis
148  >::RangeField,
149  BasisInterfaceSwitch<
150  typename FiniteElementInterfaceSwitch<
151  typename LFS::Traits::FiniteElement
152  >::Basis
153  >::dimRange,
154  typename BasisInterfaceSwitch<
155  typename FiniteElementInterfaceSwitch<
156  typename LFS::Traits::FiniteElement
157  >::Basis
158  >::Range
159  >,
160  DGFTreeLeafFunction<LFS,Data>
161  >
162  {
163 
164  typedef BasisInterfaceSwitch<
165  typename FiniteElementInterfaceSwitch<
166  typename LFS::Traits::FiniteElement
167  >::Basis
168  > BasisSwitch;
169 
170  typedef GridFunctionBase<
172  typename LFS::Traits::GridView,
173  typename BasisSwitch::RangeField,
174  BasisSwitch::dimRange,
175  typename BasisSwitch::Range
176  >,
178  > BaseT;
179 
180  public:
181  typedef typename BaseT::Traits Traits;
182 
183  DGFTreeLeafFunction (const LFS& lfs, const shared_ptr<Data>& data)
184  : BaseT(lfs.gridFunctionSpace().dataSetType())
185  , _lfs(lfs)
186  , _data(data)
187  , _basis(lfs.maxSize())
188  {}
189 
190  // Evaluate
191  void evaluate (const typename Traits::ElementType& e,
192  const typename Traits::DomainType& x,
193  typename Traits::RangeType& y) const
194  {
195  _data->bind(e);
196 
197  typedef FiniteElementInterfaceSwitch<
198  typename LFS::Traits::FiniteElement
199  > FESwitch;
200 
201  y = 0;
202 
203  FESwitch::basis(_lfs.finiteElement()).evaluateFunction(x,_basis);
204  for (std::size_t i = 0; i < _lfs.size(); ++i)
205  y.axpy(_data->_x_local(_lfs,i),_basis[i]);
206  }
207 
209  const typename Traits::GridViewType& gridView() const
210  {
211  return _lfs.gridFunctionSpace().gridView();
212  }
213 
214  const LFS& localFunctionSpace() const
215  {
216  return _lfs;
217  }
218 
219  private:
220 
221  const LFS& _lfs;
222  const shared_ptr<Data> _data;
223  mutable std::vector<typename Traits::RangeType> _basis;
224 
225  };
226 
227 
228 
229  template<typename LFS, typename Data>
231  : public GridFunctionBase<GridFunctionTraits<
232  typename LFS::Traits::GridView,
233  typename BasisInterfaceSwitch<
234  typename FiniteElementInterfaceSwitch<
235  typename LFS::ChildType::Traits::FiniteElement
236  >::Basis
237  >::RangeField,
238  TypeTree::StaticDegree<LFS>::value,
239  Dune::FieldVector<
240  typename BasisInterfaceSwitch<
241  typename FiniteElementInterfaceSwitch<
242  typename LFS::ChildType::Traits::FiniteElement
243  >::Basis
244  >::RangeField,
245  TypeTree::StaticDegree<LFS>::value
246  >
247  >,
248  DGFTreeVectorFunction<LFS,Data>
249  >
250  {
251 
252  typedef BasisInterfaceSwitch<
253  typename FiniteElementInterfaceSwitch<
254  typename LFS::ChildType::Traits::FiniteElement
255  >::Basis
256  > BasisSwitch;
257 
258  static_assert(BasisSwitch::dimRange == 1,
259  "Automatic conversion to vector-valued function only supported for scalar components");
260 
261  typedef GridFunctionBase<
263  typename LFS::Traits::GridView,
264  typename BasisSwitch::RangeField,
266  Dune::FieldVector<
267  typename BasisSwitch::RangeField,
268  TypeTree::StaticDegree<LFS>::value
269  >
270  >,
272  > BaseT;
273 
274  public:
275 
276  typedef typename BaseT::Traits Traits;
277  typedef typename LFS::ChildType ChildLFS;
278  typedef typename ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType RF;
279  typedef typename ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeType RT;
280 
281  DGFTreeVectorFunction (const LFS& lfs, const shared_ptr<Data>& data)
282  : BaseT(lfs.gridFunctionSpace().dataSetType())
283  , _lfs(lfs)
284  , _data(data)
285  , _basis(lfs.maxSize())
286  {}
287 
288  void evaluate (const typename Traits::ElementType& e,
289  const typename Traits::DomainType& x,
290  typename Traits::RangeType& y) const
291  {
292  _data->bind(e);
293 
294  typedef FiniteElementInterfaceSwitch<
295  typename ChildLFS::Traits::FiniteElement
296  > FESwitch;
297 
298  y = 0;
299 
300  for (std::size_t k = 0; k < TypeTree::degree(_lfs); ++k)
301  {
302  const ChildLFS& child_lfs = _lfs.child(k);
303  FESwitch::basis(child_lfs.finiteElement()).evaluateFunction(x,_basis);
304 
305  for (std::size_t i = 0; i < child_lfs.size(); ++i)
306  y[k] += _data->_x_local(child_lfs,i) * _basis[i];
307  }
308  }
309 
311  const typename Traits::GridViewType& gridView() const
312  {
313  return _lfs.gridFunctionSpace().gridView();
314  }
315 
316  const LFS& localFunctionSpace() const
317  {
318  return _lfs;
319  }
320 
321  private:
322 
323  const LFS& _lfs;
324  const shared_ptr<Data> _data;
325  mutable std::vector<typename BasisSwitch::Range> _basis;
326 
327  };
328 
329 
331  {
332 
333  public:
334 
335  template<typename TreePath>
336  std::string operator()(std::string component_name, TreePath tp) const
337  {
338  if (component_name.empty())
339  {
340 
341  if (_prefix.empty() && _suffix.empty())
342  {
343  DUNE_THROW(IOError,
344  "You need to either name all GridFunctionSpaces "
345  "written to the VTK file or provide a prefix / suffix.");
346  }
347 
348  std::stringstream name_stream;
349 
350  if (!_prefix.empty())
351  name_stream << _prefix << _separator;
352 
353  // Build a simple name based on the component's TreePath (e.g. 0_2_3)
354  for (std::size_t i = 0; i < tp.size(); ++i)
355  name_stream << (i > 0 ? _separator : "") << tp.element(i);
356 
357  if (!_suffix.empty())
358  name_stream << _separator << _suffix;
359  return name_stream.str();
360  }
361  else
362  {
363  // construct name from prefix, component name and suffix
364  return _prefix + component_name + _suffix;
365  }
366  }
367 
369  {
370  _prefix = prefix;
371  return *this;
372  }
373 
375  {
376  _suffix = suffix;
377  return *this;
378  }
379 
380  DefaultFunctionNameGenerator& separator(std::string separator)
381  {
382  _separator = separator;
383  return *this;
384  }
385 
386  DefaultFunctionNameGenerator(std::string prefix = "",
387  std::string suffix = "",
388  std::string separator = "_")
389  : _prefix(prefix)
390  , _suffix(suffix)
391  , _separator(separator)
392  {}
393 
394  private:
395 
396  std::string _prefix;
397  std::string _suffix;
398  std::string _separator;
399 
400  };
401 
403  {
405  }
406 
407 
408  template<typename VTKWriter, typename Data, typename NameGenerator>
410  : public TypeTree::DefaultVisitor
411  , public TypeTree::DynamicTraversal
412  {
413 
414 
415  template<typename LFS, typename Child, typename TreePath>
416  struct VisitChild
417  {
418 
419  static const bool value =
420  // Do not descend into children of VectorGridFunctionSpace
421  !std::is_convertible<
422  TypeTree::ImplementationTag<typename LFS::Traits::GridFunctionSpace>,
424  >::value;
425 
426  };
427 
430  template<typename DGF, typename TreePath>
431  void add_to_vtk_writer(const shared_ptr<DGF>& dgf, TreePath tp)
432  {
433  std::string name = name_generator(dgf->localFunctionSpace().gridFunctionSpace().name(),tp);
434  switch (dgf->dataSetType())
435  {
436  case DGF::Output::vertexData:
437  vtk_writer.addVertexData(std::make_shared<VTKGridFunctionAdapter<DGF> >(dgf,name.c_str()));
438  break;
439  case DGF::Output::cellData:
440  vtk_writer.addCellData(std::make_shared<VTKGridFunctionAdapter<DGF> >(dgf,name.c_str()));
441  break;
442  default:
443  DUNE_THROW(NotImplemented,"Unsupported data set type");
444  }
445  }
446 
448 
451  template<typename LFS, typename TreePath>
452  void add_vector_solution(const LFS& lfs, TreePath tp, VectorGridFunctionSpaceTag tag)
453  {
454  add_to_vtk_writer(std::make_shared<DGFTreeVectorFunction<LFS,Data> >(lfs,data),tp);
455  }
456 
458 
461  template<typename LFS, typename TreePath>
462  void add_vector_solution(const LFS& lfs, TreePath tp, GridFunctionSpaceTag tag)
463  {
464  // do nothing here - not a vector space
465  }
466 
467  // **********************************************************************
468  // Visitor functions for adding DiscreteGridFunctions to VTKWriter
469  //
470  // The visitor functions contain a switch that will make them ignore
471  // function spaces with a different underlying GridView type than
472  // the VTKWriter.
473  // This cannot happen in vanilla PDELab, but is required for MultiDomain
474  // support
475  // **********************************************************************
476 
477  // don't do anything if GridView types differ
478  template<typename LFS, typename TreePath>
479  typename std::enable_if<
480  !std::is_same<
481  typename LFS::Traits::GridFunctionSpace::Traits::GridView,
482  typename vtk_writer_traits<VTKWriter>::GridView
483  >::value
484  >::type
485  post(const LFS& lfs, TreePath tp)
486  {
487  }
488 
489  // don't do anything if GridView types differ
490  template<typename LFS, typename TreePath>
491  typename std::enable_if<
492  !std::is_same<
493  typename LFS::Traits::GridFunctionSpace::Traits::GridView,
494  typename vtk_writer_traits<VTKWriter>::GridView
495  >::value
496  >::type
497  leaf(const LFS& lfs, TreePath tp)
498  {
499  }
500 
502  template<typename LFS, typename TreePath>
503  typename std::enable_if<
504  std::is_same<
505  typename LFS::Traits::GridFunctionSpace::Traits::GridView,
506  typename vtk_writer_traits<VTKWriter>::GridView
507  >::value
508  >::type
509  post(const LFS& lfs, TreePath tp)
510  {
511  if (predicate(lfs, tp))
512  add_vector_solution(lfs,tp,TypeTree::ImplementationTag<typename LFS::Traits::GridFunctionSpace>());
513  }
514 
516  template<typename LFS, typename TreePath>
517  typename std::enable_if<
518  std::is_same<
519  typename LFS::Traits::GridFunctionSpace::Traits::GridView,
520  typename vtk_writer_traits<VTKWriter>::GridView
521  >::value
522  >::type
523  leaf(const LFS& lfs, TreePath tp)
524  {
525  if (predicate(lfs, tp))
526  add_to_vtk_writer(std::make_shared<DGFTreeLeafFunction<LFS,Data> >(lfs,data),tp);
527  }
528 
529 
530  add_solution_to_vtk_writer_visitor(VTKWriter& vtk_writer_, shared_ptr<Data> data_, const NameGenerator& name_generator_, const typename Data::Predicate& predicate_)
531  : vtk_writer(vtk_writer_)
532  , data(data_)
533  , name_generator(name_generator_)
534  , predicate(predicate_)
535  {}
536 
538  shared_ptr<Data> data;
539  const NameGenerator& name_generator;
540  typename Data::Predicate predicate;
541 
542  };
543 
545  {
546  template<typename LFS, typename TP>
547  bool operator()(const LFS& lfs, TP tp) const
548  {
549  return true;
550  }
551  };
552 
553  template<typename VTKWriter, typename Data_>
554  struct OutputCollector
555  {
556 
558  typedef Data_ Data;
559 
560  typedef typename Data::GridFunctionSpace GFS;
561  typedef typename Data::Vector Vector;
562  typedef typename Data::Predicate Predicate;
563 
564  template<typename NameGenerator>
565  OutputCollector& addSolution(const NameGenerator& name_generator)
566  {
567 
568  add_solution_to_vtk_writer_visitor<VTKWriter,Data,NameGenerator> visitor(_vtk_writer,_data,name_generator,_predicate);
569  TypeTree::applyToTree(_data->_lfs,visitor);
570  return *this;
571  }
572 
573  template<typename Factory, typename TreePath>
574  OutputCollector& addCellFunction(Factory factory, TreePath tp, std::string name)
575  {
576  typedef typename std::remove_reference<decltype(*factory.create(_data->_lfs.child(tp),_data))>::type DGF;
577  _vtk_writer.addCellData(std::make_shared<VTKGridFunctionAdapter<DGF> >(factory.create(_data->_lfs.child(tp),_data),name));
578  return *this;
579  }
580 
581  template<template<typename...> class Function, typename TreePath, typename... Params>
582  OutputCollector& addCellFunction(TreePath tp, std::string name, Params&&... params)
583  {
584  using LFS = TypeTree::ChildForTreePath<typename Data::LFS,TreePath>;
585  typedef Function<LFS,Data,Params...> DGF;
586  _vtk_writer.addCellData(
587  std::make_shared<VTKGridFunctionAdapter<DGF> >(
588  std::make_shared<DGF>(
589  TypeTree::child(_data->_lfs,tp)
590  ),
591  _data,
592  std::forward<Params>(params)...
593  ),
594  name
595  );
596  return *this;
597  }
598 
599  template<typename Factory, typename TreePath>
600  OutputCollector& addVertexFunction(Factory factory, TreePath tp, std::string name)
601  {
602  typedef typename std::remove_reference<decltype(*factory.create(_data->_lfs.child(tp),_data))>::type DGF;
603  _vtk_writer.addVertexData(std::make_shared<VTKGridFunctionAdapter<DGF> >(factory.create(_data->_lfs.child(tp),_data),name));
604  return *this;
605  }
606 
607  template<template<typename...> class Function, typename TreePath, typename... Params>
608  OutputCollector& addVertexFunction(TreePath tp, std::string name, Params&&... params)
609  {
610  using LFS = TypeTree::ChildForTreePath<typename Data::LFS,TreePath>;
611  typedef Function<LFS,Data,Params...> DGF;
612  _vtk_writer.addVertexData(
613  std::make_shared<VTKGridFunctionAdapter<DGF> >(
614  std::make_shared<DGF>(
615  TypeTree::child(_data->_lfs,tp)
616  ),
617  _data,
618  std::forward<Params>(params)...
619  ),
620  name
621  );
622  return *this;
623  }
624 
625  OutputCollector(VTKWriter& vtk_writer, const shared_ptr<Data>& data, const Predicate& predicate = Predicate())
626  : _vtk_writer(vtk_writer)
627  , _data(data)
628  , _predicate(predicate)
629  {}
630 
632  shared_ptr<Data> _data;
633  Predicate _predicate;
634 
635  };
636 
637  } // namespace vtk
638 
639  template<typename VTKWriter,
640  typename GFS,
641  typename X,
642  typename NameGenerator = vtk::DefaultFunctionNameGenerator,
643  typename Predicate = vtk::DefaultPredicate>
645  VTKWriter,
647  >
648  addSolutionToVTKWriter(VTKWriter& vtk_writer,
649  const GFS& gfs,
650  const X& x,
651  const NameGenerator& name_generator = vtk::defaultNameScheme(),
652  const Predicate& predicate = Predicate())
653  {
655  vtk::OutputCollector<VTKWriter,Data> collector(vtk_writer,std::make_shared<Data>(gfs,x),predicate);
656  collector.addSolution(name_generator);
657  return collector;
658  }
659 
660 
661  } // namespace PDELab
662 } // namespace Dune
663 
664 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_VTK_HH
DefaultFunctionNameGenerator & suffix(std::string suffix)
Definition: vtk.hh:374
const IndexSet & _index_set
Definition: vtk.hh:133
DefaultFunctionNameGenerator & separator(std::string separator)
Definition: vtk.hh:380
Predicate _predicate
Definition: vtk.hh:633
static const int dim
Definition: adaptivity.hh:84
const Entity & e
Definition: localfunctionspace.hh:120
leaf of a function tree
Definition: function.hh:298
Definition: gridfunctionspace/tags.hh:24
DefaultFunctionNameGenerator defaultNameScheme()
Definition: vtk.hh:402
DGFTreeCommonData(const GFS &gfs, const X &x)
Definition: vtk.hh:104
GFS GridFunctionSpace
Definition: vtk.hh:100
XLocalVector _x_local
Definition: vtk.hh:132
void add_to_vtk_writer(const shared_ptr< DGF > &dgf, TreePath tp)
Definition: vtk.hh:431
typename impl::BackendVectorSelector< GridFunctionSpace, FieldType >::Type Vector
alias of the return type of BackendVectorSelector
Definition: backend/interface.hh:106
shared_ptr< Data > _data
Definition: vtk.hh:632
Definition: vtk.hh:29
add_solution_to_vtk_writer_visitor(VTKWriter &vtk_writer_, shared_ptr< Data > data_, const NameGenerator &name_generator_, const typename Data::Predicate &predicate_)
Definition: vtk.hh:530
Definition: gridfunctionspace/tags.hh:28
const Traits::GridViewType & gridView() const
get a reference to the GridView
Definition: vtk.hh:311
OutputCollector & addCellFunction(TreePath tp, std::string name, Params &&... params)
Definition: vtk.hh:582
Pred Predicate
Definition: vtk.hh:102
std::enable_if< !std::is_same< typename LFS::Traits::GridFunctionSpace::Traits::GridView, typename vtk_writer_traits< VTKWriter >::GridView >::value >::type leaf(const LFS &lfs, TreePath tp)
Definition: vtk.hh:497
X Vector
Definition: vtk.hh:101
const LFS & localFunctionSpace() const
Definition: vtk.hh:214
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
OutputCollector & addVertexFunction(TreePath tp, std::string name, Params &&... params)
Definition: vtk.hh:608
std::enable_if< !std::is_same< typename LFS::Traits::GridFunctionSpace::Traits::GridView, typename vtk_writer_traits< VTKWriter >::GridView >::value >::type post(const LFS &lfs, TreePath tp)
Definition: vtk.hh:485
vtk::OutputCollector< VTKWriter, vtk::DGFTreeCommonData< GFS, X, Predicate > > addSolutionToVTKWriter(VTKWriter &vtk_writer, const GFS &gfs, const X &x, const NameGenerator &name_generator=vtk::defaultNameScheme(), const Predicate &predicate=Predicate())
Definition: vtk.hh:648
std::enable_if< std::is_same< typename LFS::Traits::GridFunctionSpace::Traits::GridView, typename vtk_writer_traits< VTKWriter >::GridView >::value >::type leaf(const LFS &lfs, TreePath tp)
Create a standard leaf function for leaf GridFunctionSpaces.
Definition: vtk.hh:523
traits class holding the function signature, same as in local function
Definition: function.hh:176
size_type _current_cell_index
Definition: vtk.hh:134
ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType RF
Definition: vtk.hh:278
shared_ptr< Data > data
Definition: vtk.hh:538
OutputCollector(VTKWriter &vtk_writer, const shared_ptr< Data > &data, const Predicate &predicate=Predicate())
Definition: vtk.hh:625
Data::Vector Vector
Definition: vtk.hh:561
VTKWriter & vtk_writer
Definition: vtk.hh:537
void add_vector_solution(const LFS &lfs, TreePath tp, GridFunctionSpaceTag tag)
Tag dispatch-based switch that creates a vector-valued function for a VectorGridFunctionSpace.
Definition: vtk.hh:462
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
LFS::ChildType ChildLFS
Definition: vtk.hh:277
void add_vector_solution(const LFS &lfs, TreePath tp, VectorGridFunctionSpaceTag tag)
Tag dispatch-based switch that creates a vector-valued function for a VectorGridFunctionSpace.
Definition: vtk.hh:452
LFS _lfs
Definition: vtk.hh:129
DGFTreeLeafFunction(const LFS &lfs, const shared_ptr< Data > &data)
Definition: vtk.hh:183
DefaultFunctionNameGenerator(std::string prefix="", std::string suffix="", std::string separator="_")
Definition: vtk.hh:386
Data::Predicate predicate
Definition: vtk.hh:540
XView _x_view
Definition: vtk.hh:131
VTKWriter & _vtk_writer
Definition: vtk.hh:631
bool operator()(const LFS &lfs, TP tp) const
Definition: vtk.hh:547
const NameGenerator & name_generator
Definition: vtk.hh:539
std::string operator()(std::string component_name, TreePath tp) const
Definition: vtk.hh:336
const Traits::GridViewType & gridView() const
get a reference to the GridView
Definition: vtk.hh:209
OutputCollector & addVertexFunction(Factory factory, TreePath tp, std::string name)
Definition: vtk.hh:600
BaseT::Traits Traits
Definition: vtk.hh:276
ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeType RT
Definition: vtk.hh:279
const LFS & localFunctionSpace() const
Definition: vtk.hh:316
wrap a GridFunction so it can be used with the VTKWriter from dune-grid.
Definition: vtkexport.hh:22
Definition: vtk.hh:26
Data::GridFunctionSpace GFS
Definition: vtk.hh:560
Data_ Data
Common data container (hierarchic LFS, global solution data etc.)
Definition: vtk.hh:558
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: vtk.hh:191
DefaultFunctionNameGenerator & prefix(std::string prefix)
Definition: vtk.hh:368
DGFTreeVectorFunction(const LFS &lfs, const shared_ptr< Data > &data)
Definition: vtk.hh:281
OutputCollector & addCellFunction(Factory factory, TreePath tp, std::string name)
Definition: vtk.hh:574
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: vtk.hh:288
LFSCache _lfs_cache
Definition: vtk.hh:130
STL namespace.
BaseT::Traits Traits
Definition: vtk.hh:181
Definition: vtk.hh:32
std::enable_if< std::is_same< typename LFS::Traits::GridFunctionSpace::Traits::GridView, typename vtk_writer_traits< VTKWriter >::GridView >::value >::type post(const LFS &lfs, TreePath tp)
Handle VectorGridFunctionSpace components in here.
Definition: vtk.hh:509
OutputCollector & addSolution(const NameGenerator &name_generator)
Definition: vtk.hh:565
T Traits
Export type traits.
Definition: function.hh:192
Helper class for common data of a DGFTree.
Definition: vtk.hh:75
Data::Predicate Predicate
Definition: vtk.hh:562
void bind(const Cell &cell)
Definition: vtk.hh:115