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