dune-pdelab 2.7-git
Loading...
Searching...
No Matches
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
24namespace 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>
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>
84
85 template<typename, typename>
86 friend struct OutputCollector;
87
89 typedef LFSIndexCache<LFS> LFSCache;
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)
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
132 LFSCache _lfs_cache;
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 FESwitch::basis(_lfs.finiteElement()).evaluateFunction(x,_basis);
209 for (std::size_t i = 0; i < _lfs.size(); ++i)
210 y.axpy(_data->_x_local(_lfs,i),_basis[i]);
211 }
212
214 const typename Traits::GridViewType& gridView() const
215 {
216 return _lfs.gridFunctionSpace().gridView();
217 }
218
219 const LFS& localFunctionSpace() const
220 {
221 return _lfs;
222 }
223
224 private:
225
226 const LFS& _lfs;
227 const std::shared_ptr<Data> _data;
228 mutable std::vector<typename Traits::RangeType> _basis;
229
230 };
231
232
233
234 template<typename LFS, typename Data>
236 : public GridFunctionBase<GridFunctionTraits<
237 typename LFS::Traits::GridView,
238 typename BasisInterfaceSwitch<
239 typename FiniteElementInterfaceSwitch<
240 typename LFS::ChildType::Traits::FiniteElement
241 >::Basis
242 >::RangeField,
243 TypeTree::StaticDegree<LFS>::value,
244 Dune::FieldVector<
245 typename BasisInterfaceSwitch<
246 typename FiniteElementInterfaceSwitch<
247 typename LFS::ChildType::Traits::FiniteElement
248 >::Basis
249 >::RangeField,
250 TypeTree::StaticDegree<LFS>::value
251 >
252 >,
253 DGFTreeVectorFunction<LFS,Data>
254 >
255 {
256
257 typedef BasisInterfaceSwitch<
258 typename FiniteElementInterfaceSwitch<
259 typename LFS::ChildType::Traits::FiniteElement
260 >::Basis
261 > BasisSwitch;
262
263 static_assert(BasisSwitch::dimRange == 1,
264 "Automatic conversion to vector-valued function only supported for scalar components");
265
266 typedef GridFunctionBase<
268 typename LFS::Traits::GridView,
269 typename BasisSwitch::RangeField,
270 TypeTree::StaticDegree<LFS>::value,
271 Dune::FieldVector<
272 typename BasisSwitch::RangeField,
273 TypeTree::StaticDegree<LFS>::value
274 >
275 >,
277 > BaseT;
278
279 public:
280
281 typedef typename BaseT::Traits Traits;
282 typedef typename LFS::ChildType ChildLFS;
283 typedef typename ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType RF;
284 typedef typename ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeType RT;
285
286 DGFTreeVectorFunction (const LFS& lfs, const std::shared_ptr<Data>& data)
287 : BaseT(lfs.gridFunctionSpace().dataSetType())
288 , _lfs(lfs)
289 , _data(data)
290 , _basis(lfs.maxSize())
291 {}
292
293 void evaluate (const typename Traits::ElementType& e,
294 const typename Traits::DomainType& x,
295 typename Traits::RangeType& y) const
296 {
297 _data->bind(e);
298
299 typedef FiniteElementInterfaceSwitch<
300 typename ChildLFS::Traits::FiniteElement
301 > FESwitch;
302
303 y = 0;
304
305 for (std::size_t k = 0; k < TypeTree::degree(_lfs); ++k)
306 {
307 const ChildLFS& child_lfs = _lfs.child(k);
308 FESwitch::basis(child_lfs.finiteElement()).evaluateFunction(x,_basis);
309
310 for (std::size_t i = 0; i < child_lfs.size(); ++i)
311 y[k] += _data->_x_local(child_lfs,i) * _basis[i];
312 }
313 }
314
316 const typename Traits::GridViewType& gridView() const
317 {
318 return _lfs.gridFunctionSpace().gridView();
319 }
320
321 const LFS& localFunctionSpace() const
322 {
323 return _lfs;
324 }
325
326 private:
327
328 const LFS& _lfs;
329 const std::shared_ptr<Data> _data;
330 mutable std::vector<typename BasisSwitch::Range> _basis;
331
332 };
333
334
336 {
337
338 public:
339
340 template<typename TreePath>
341 std::string operator()(std::string component_name, TreePath tp) const
342 {
343 if (component_name.empty())
344 {
345
346 if (_prefix.empty() && _suffix.empty())
347 {
348 DUNE_THROW(IOError,
349 "You need to either name all GridFunctionSpaces "
350 "written to the VTK file or provide a prefix / suffix.");
351 }
352
353 std::stringstream name_stream;
354
355 if (!_prefix.empty())
356 name_stream << _prefix << _separator;
357
358 // Build a simple name based on the component's TreePath (e.g. 0_2_3)
359 for (std::size_t i = 0; i < tp.size(); ++i)
360 name_stream << (i > 0 ? _separator : "") << tp.element(i);
361
362 if (!_suffix.empty())
363 name_stream << _separator << _suffix;
364 return name_stream.str();
365 }
366 else
367 {
368 // construct name from prefix, component name and suffix
369 return _prefix + component_name + _suffix;
370 }
371 }
372
374 {
375 _prefix = prefix;
376 return *this;
377 }
378
380 {
381 _suffix = suffix;
382 return *this;
383 }
384
386 {
387 _separator = separator;
388 return *this;
389 }
390
392 std::string suffix = "",
393 std::string separator = "_")
394 : _prefix(prefix)
395 , _suffix(suffix)
396 , _separator(separator)
397 {}
398
399 private:
400
401 std::string _prefix;
402 std::string _suffix;
403 std::string _separator;
404
405 };
406
411
412
413 template<typename VTKWriter, typename Data, typename NameGenerator>
415 : public TypeTree::DefaultVisitor
416 , public TypeTree::DynamicTraversal
417 {
418
419
420 template<typename LFS, typename Child, typename TreePath>
422 {
423
424 static const bool value =
425 // Do not descend into children of VectorGridFunctionSpace
426 !std::is_convertible<
427 TypeTree::ImplementationTag<typename LFS::Traits::GridFunctionSpace>,
429 >::value;
430
431 };
432
435 template<typename DGF, typename TreePath>
436 void add_to_vtk_writer(const std::shared_ptr<DGF>& dgf, TreePath tp)
437 {
438 std::string name = name_generator(dgf->localFunctionSpace().gridFunctionSpace().name(),tp);
439 switch (dgf->dataSetType())
440 {
441 case DGF::Output::vertexData:
442 vtk_writer.addVertexData(std::make_shared<VTKGridFunctionAdapter<DGF> >(dgf,name.c_str()));
443 break;
444 case DGF::Output::cellData:
445 vtk_writer.addCellData(std::make_shared<VTKGridFunctionAdapter<DGF> >(dgf,name.c_str()));
446 break;
447 default:
448 DUNE_THROW(NotImplemented,"Unsupported data set type");
449 }
450 }
451
453
456 template<typename LFS, typename TreePath>
457 void add_vector_solution(const LFS& lfs, TreePath tp, VectorGridFunctionSpaceTag tag)
458 {
459 add_to_vtk_writer(std::make_shared<DGFTreeVectorFunction<LFS,Data> >(lfs,data),tp);
460 }
461
463
466 template<typename LFS, typename TreePath>
467 void add_vector_solution(const LFS& lfs, TreePath tp, GridFunctionSpaceTag tag)
468 {
469 // do nothing here - not a vector space
470 }
471
472 // **********************************************************************
473 // Visitor functions for adding DiscreteGridFunctions to VTKWriter
474 //
475 // The visitor functions contain a switch that will make them ignore
476 // function spaces with a different underlying GridView type than
477 // the VTKWriter.
478 // This cannot happen in vanilla PDELab, but is required for MultiDomain
479 // support
480 // **********************************************************************
481
482 // don't do anything if GridView types differ
483 template<typename LFS, typename TreePath>
484 typename std::enable_if<
485 !std::is_same<
486 typename LFS::Traits::GridFunctionSpace::Traits::GridView,
487 typename vtk_writer_traits<VTKWriter>::GridView
488 >::value
489 >::type
490 post(const LFS& lfs, TreePath tp)
491 {
492 }
493
494 // don't do anything if GridView types differ
495 template<typename LFS, typename TreePath>
496 typename std::enable_if<
497 !std::is_same<
498 typename LFS::Traits::GridFunctionSpace::Traits::GridView,
499 typename vtk_writer_traits<VTKWriter>::GridView
500 >::value
501 >::type
502 leaf(const LFS& lfs, TreePath tp)
503 {
504 }
505
507 template<typename LFS, typename TreePath>
508 typename std::enable_if<
509 std::is_same<
510 typename LFS::Traits::GridFunctionSpace::Traits::GridView,
511 typename vtk_writer_traits<VTKWriter>::GridView
512 >::value
513 >::type
514 post(const LFS& lfs, TreePath tp)
515 {
516 if (predicate(lfs, tp))
517 add_vector_solution(lfs,tp,TypeTree::ImplementationTag<typename LFS::Traits::GridFunctionSpace>());
518 }
519
521 template<typename LFS, typename TreePath>
522 typename std::enable_if<
523 std::is_same<
524 typename LFS::Traits::GridFunctionSpace::Traits::GridView,
525 typename vtk_writer_traits<VTKWriter>::GridView
526 >::value
527 >::type
528 leaf(const LFS& lfs, TreePath tp)
529 {
530 if (predicate(lfs, tp))
531 add_to_vtk_writer(std::make_shared<DGFTreeLeafFunction<LFS,Data> >(lfs,data),tp);
532 }
533
534
535 add_solution_to_vtk_writer_visitor(VTKWriter& vtk_writer_, std::shared_ptr<Data> data_, const NameGenerator& name_generator_, const typename Data::Predicate& predicate_)
536 : vtk_writer(vtk_writer_)
537 , data(data_)
538 , name_generator(name_generator_)
539 , predicate(predicate_)
540 {}
541
543 std::shared_ptr<Data> data;
544 const NameGenerator& name_generator;
545 typename Data::Predicate predicate;
546
547 };
548
550 {
551 template<typename LFS, typename TP>
552 bool operator()(const LFS& lfs, TP tp) const
553 {
554 return true;
555 }
556 };
557
558 template<typename VTKWriter, typename Data_>
560 {
561
563 typedef Data_ Data;
564
565 typedef typename Data::GridFunctionSpace GFS;
566 typedef typename Data::Vector Vector;
567 typedef typename Data::Predicate Predicate;
568
569 template<typename NameGenerator>
570 OutputCollector& addSolution(const NameGenerator& name_generator)
571 {
572
574 TypeTree::applyToTree(_data->_lfs,visitor);
575 return *this;
576 }
577
578 template<typename Factory, typename TreePath>
579 OutputCollector& addCellFunction(Factory factory, TreePath tp, std::string name)
580 {
581 typedef typename std::remove_reference<decltype(*factory.create(_data->_lfs.child(tp),_data))>::type DGF;
582 _vtk_writer.addCellData(std::make_shared<VTKGridFunctionAdapter<DGF> >(factory.create(_data->_lfs.child(tp),_data),name));
583 return *this;
584 }
585
586 template<template<typename...> class Function, typename TreePath, typename... Params>
587 OutputCollector& addCellFunction(TreePath tp, std::string name, Params&&... params)
588 {
589 using LFS = TypeTree::ChildForTreePath<typename Data::LFS,TreePath>;
590 typedef Function<LFS,Data,Params...> DGF;
591 _vtk_writer.addCellData(
592 std::make_shared<VTKGridFunctionAdapter<DGF> >(
593 std::make_shared<DGF>(
594 TypeTree::child(_data->_lfs,tp)
595 ),
596 _data,
597 std::forward<Params>(params)...
598 ),
599 name
600 );
601 return *this;
602 }
603
604 template<typename Factory, typename TreePath>
605 OutputCollector& addVertexFunction(Factory factory, TreePath tp, std::string name)
606 {
607 typedef typename std::remove_reference<decltype(*factory.create(_data->_lfs.child(tp),_data))>::type DGF;
608 _vtk_writer.addVertexData(std::make_shared<VTKGridFunctionAdapter<DGF> >(factory.create(_data->_lfs.child(tp),_data),name));
609 return *this;
610 }
611
612 template<template<typename...> class Function, typename TreePath, typename... Params>
613 OutputCollector& addVertexFunction(TreePath tp, std::string name, Params&&... params)
614 {
615 using LFS = TypeTree::ChildForTreePath<typename Data::LFS,TreePath>;
616 typedef Function<LFS,Data,Params...> DGF;
617 _vtk_writer.addVertexData(
618 std::make_shared<VTKGridFunctionAdapter<DGF> >(
619 std::make_shared<DGF>(
620 TypeTree::child(_data->_lfs,tp)
621 ),
622 _data,
623 std::forward<Params>(params)...
624 ),
625 name
626 );
627 return *this;
628 }
629
630 OutputCollector(VTKWriter& vtk_writer, const std::shared_ptr<Data>& data, const Predicate& predicate = Predicate())
631 : _vtk_writer(vtk_writer)
632 , _data(data)
633 , _predicate(predicate)
634 {}
635
637 std::shared_ptr<Data> _data;
639
640 };
641
642 } // namespace vtk
643
644 template<typename VTKWriter,
645 typename GFS,
646 typename X,
647 typename NameGenerator = vtk::DefaultFunctionNameGenerator,
648 typename Predicate = vtk::DefaultPredicate>
650 VTKWriter,
652 >
654 const GFS& gfs,
655 const X& x,
656 const NameGenerator& name_generator = vtk::defaultNameScheme(),
657 const Predicate& predicate = Predicate())
658 {
660 auto data = std::make_shared<Data>(Dune::stackobject_to_shared_ptr(gfs), Dune::stackobject_to_shared_ptr(x));
661 vtk::OutputCollector<VTKWriter,Data> collector(vtk_writer, data, predicate);
662 collector.addSolution(name_generator);
663 return collector;
664 }
665
666
667 template<typename VTKWriter,
668 typename GFS,
669 typename X,
670 typename NameGenerator = vtk::DefaultFunctionNameGenerator,
671 typename Predicate = vtk::DefaultPredicate>
672 vtk::OutputCollector<
673 VTKWriter,
674 vtk::DGFTreeCommonData<GFS,X,Predicate>
675 >
677 std::shared_ptr<GFS> gfs,
678 std::shared_ptr<X> x,
679 const NameGenerator& name_generator = vtk::defaultNameScheme(),
680 const Predicate& predicate = Predicate())
681 {
683 vtk::OutputCollector<VTKWriter,Data> collector(vtk_writer, std::make_shared<Data>(gfs,x),predicate);
684 collector.addSolution(name_generator);
685 return collector;
686 }
687
688 } // namespace PDELab
689} // namespace Dune
690
691#endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_VTK_HH
static const int dim
Definition adaptivity.hh:84
STL namespace.
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:653
DefaultFunctionNameGenerator defaultNameScheme()
Definition vtk.hh:407
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
Definition lfsindexcache.hh:979
Create a local function space from a global function space.
Definition localfunctionspace.hh:717
A container for storing data associated with the degrees of freedom of a LocalFunctionSpace.
Definition localvector.hh:184
Definition gridfunctionspace/tags.hh:24
Definition gridfunctionspace/tags.hh:28
Definition vtk.hh:27
Definition vtk.hh:30
Definition vtk.hh:33
BaseT::Traits Traits
Definition vtk.hh:186
const LFS & localFunctionSpace() const
Definition vtk.hh:219
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:214
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition vtk.hh:293
ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType RF
Definition vtk.hh:283
DGFTreeVectorFunction(const LFS &lfs, const std::shared_ptr< Data > &data)
Definition vtk.hh:286
const Traits::GridViewType & gridView() const
get a reference to the GridView
Definition vtk.hh:316
ChildLFS::Traits::FiniteElement::Traits::LocalBasisType::Traits::RangeType RT
Definition vtk.hh:284
const LFS & localFunctionSpace() const
Definition vtk.hh:321
BaseT::Traits Traits
Definition vtk.hh:281
LFS::ChildType ChildLFS
Definition vtk.hh:282
OutputCollector & addCellFunction(Factory factory, TreePath tp, std::string name)
Definition vtk.hh:579
OutputCollector & addVertexFunction(TreePath tp, std::string name, Params &&... params)
Definition vtk.hh:613
VTKWriter & _vtk_writer
Definition vtk.hh:636
Predicate _predicate
Definition vtk.hh:638
Data::Predicate Predicate
Definition vtk.hh:567
Data::GridFunctionSpace GFS
Definition vtk.hh:565
OutputCollector & addCellFunction(TreePath tp, std::string name, Params &&... params)
Definition vtk.hh:587
OutputCollector & addSolution(const NameGenerator &name_generator)
Definition vtk.hh:570
std::shared_ptr< Data > _data
Definition vtk.hh:637
Data_ Data
Common data container (hierarchic LFS, global solution data etc.)
Definition vtk.hh:563
OutputCollector(VTKWriter &vtk_writer, const std::shared_ptr< Data > &data, const Predicate &predicate=Predicate())
Definition vtk.hh:630
OutputCollector & addVertexFunction(Factory factory, TreePath tp, std::string name)
Definition vtk.hh:605
Data::Vector Vector
Definition vtk.hh:566
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
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(std::string prefix="", std::string suffix="", std::string separator="_")
Definition vtk.hh:391
DefaultFunctionNameGenerator & separator(std::string separator)
Definition vtk.hh:385
DefaultFunctionNameGenerator & prefix(std::string prefix)
Definition vtk.hh:373
DefaultFunctionNameGenerator & suffix(std::string suffix)
Definition vtk.hh:379
std::string operator()(std::string component_name, TreePath tp) const
Definition vtk.hh:341
std::enable_if< std::is_same< typenameLFS::Traits::GridFunctionSpace::Traits::GridView, typenamevtk_writer_traits< VTKWriter >::GridView >::value >::type leaf(const LFS &lfs, TreePath tp)
Create a standard leaf function for leaf GridFunctionSpaces.
Definition vtk.hh:528
std::shared_ptr< Data > data
Definition vtk.hh:543
std::enable_if<!std::is_same< typenameLFS::Traits::GridFunctionSpace::Traits::GridView, typenamevtk_writer_traits< VTKWriter >::GridView >::value >::type leaf(const LFS &lfs, TreePath tp)
Definition vtk.hh:502
Data::Predicate predicate
Definition vtk.hh:545
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:457
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:535
std::enable_if<!std::is_same< typenameLFS::Traits::GridFunctionSpace::Traits::GridView, typenamevtk_writer_traits< VTKWriter >::GridView >::value >::type post(const LFS &lfs, TreePath tp)
Definition vtk.hh:490
const NameGenerator & name_generator
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:467
void add_to_vtk_writer(const std::shared_ptr< DGF > &dgf, TreePath tp)
Definition vtk.hh:436
std::enable_if< std::is_same< typenameLFS::Traits::GridFunctionSpace::Traits::GridView, typenamevtk_writer_traits< VTKWriter >::GridView >::value >::type post(const LFS &lfs, TreePath tp)
Handle VectorGridFunctionSpace components in here.
Definition vtk.hh:514
bool operator()(const LFS &lfs, TP tp) const
Definition vtk.hh:552
static const unsigned int value
Definition gridfunctionspace/tags.hh:139