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