DUNE PDELab (git)

partitionviewentityset.hh
1#ifndef DUNE_PDELAB_COMMON_PARTITIONVIEWENTITYSET_HH
2#define DUNE_PDELAB_COMMON_PARTITIONVIEWENTITYSET_HH
3
4#include <cassert>
5#include <vector>
6#include <bitset>
7#include <memory>
8#include <algorithm>
9#include <numeric>
10#include <type_traits>
11
13#include <dune/common/iteratorrange.hh>
14#include <dune/geometry/referenceelements.hh>
17#include <dune/grid/common/partitionset.hh>
18#include <dune/grid/common/rangegenerators.hh>
19
20namespace Dune {
21
22 namespace PDELab {
23
24 // import range generators to make sure they work with PartitionViewEntitySet
25 using Dune::entities;
26 using Dune::elements;
27 using Dune::facets;
28 using Dune::edges;
29 using Dune::vertices;
30 using Dune::descendantElements;
31 using Dune::intersections;
32
33 template<typename GV, typename P>
34 class PartitionViewEntitySet;
35
36 template<typename GV, typename P>
37 class PartitionViewEntitySetIndexSet;
38
39 template<typename GV, typename P>
40 struct PartitionViewEntitySetTraits
41 {
42
43 using Partitions = typename std::decay<P>::type;
44
45 using Grid = typename GV::Traits::Grid;
46 using GridView = GV;
48 using IndexSet = PartitionViewEntitySetIndexSet<GV,Partitions>;
49 using BaseIndexSet = typename GV::Traits::IndexSet;
50
51 using Element = typename GV::template Codim<0>::Entity;
52
53 using Intersection = typename GV::Traits::Intersection;
54
55 using IntersectionIterator = typename GV::Traits::IntersectionIterator;
56
57 using Communication = typename GV::Traits::Communication;
58
59 using size_type = std::size_t;
60 using dim_type = int;
61
62 using Index = typename BaseIndexSet::IndexType;
63
65
66 using CodimMask = std::bitset<GV::dimension + 1>;
67
68 using CoordinateField = typename Grid::ctype;
69
70 constexpr static Index invalidIndex()
71 {
72 return ~static_cast<Index>(0ull);
73 }
74
75 static const bool conforming = GV::Traits::conforming;
76
77 static const dim_type dimension = GV::dimension;
78
79 static const dim_type dimensionworld = GV::dimensionworld;
80
81 template<dim_type codim>
82 struct Codim
83 {
84
85 using Iterator = typename GV::template Codim<codim>::template Partition<Partitions::partitionIterator()>::Iterator;
86
87 using Entity = typename GV::template Codim<codim>::Entity;
88
89 using Geometry = typename GV::template Codim<codim>::Geometry;
90
91 using LocalGeometry = typename GV::template Codim<codim>::LocalGeometry;
92
93 template<PartitionIteratorType pitype>
94 struct Partition
95 {
96
97 using Iterator = typename GV::template Codim<codim>::template Partition<pitype>::Iterator;
98
99 };
100
101 };
102
103 };
104
105
118 template<typename GV, typename P>
120 {
121
122 public:
123
124 using Traits = PartitionViewEntitySetTraits<GV,P>;
125
126 using Partitions = typename Traits::Partitions;
127 using Grid = typename Traits::Grid;
128 using GridView = typename Traits::GridView;
129 using IndexSet = typename Traits::IndexSet;
130 using BaseIndexSet = typename Traits::BaseIndexSet;
131 using Element = typename Traits::Element;
132 using Intersection = typename Traits::Intersection;
133 using IntersectionIterator = typename Traits::IntersectionIterator;
134 using Communication = typename Traits::Communication;
135 using CodimMask = typename Traits::CodimMask;
136 using CoordinateField = typename Traits::CoordinateField;
137 using size_type = typename Traits::size_type;
138 using dim_type = typename Traits::dim_type;
139
140 using ctype = CoordinateField;
141
142 static const bool conforming = Traits::conforming;
143 static const dim_type dimension = Traits::dimension;
144 static const dim_type dimensionworld = Traits::dimensionworld;
145
146 template<dim_type codim>
147 using Codim = typename Traits::template Codim<codim>;
148
149 constexpr static Partitions partitions()
150 {
151 return {};
152 }
153
154 constexpr static CodimMask allCodims()
155 {
156 return {~0ull};
157 }
158
159 const Grid& grid() const
160 {
161 return gridView().grid();
162 }
163
165 const IndexSet& indexSet() const
166 {
167 return *_index_set;
168 }
169
171 const BaseIndexSet& baseIndexSet() const
172 {
173 return indexSet().baseIndexSet();
174 }
175
176 template<dim_type codim>
178 begin() const
179 {
180 return gridView().template begin<codim,Partitions::partitionIterator()>();
181 }
182
183 template<dim_type codim>
185 end() const
186 {
187 return gridView().template end<codim,Partitions::partitionIterator()>();
188 }
189
190 template<dim_type codim, PartitionIteratorType pitype>
191 typename GV::template Codim<codim>::template Partition<pitype>::Iterator
192 begin() const
193 {
194 return gridView().template begin<codim,pitype>();
195 }
196
197 template<dim_type codim, PartitionIteratorType pitype>
198 typename GV::template Codim<codim>::template Partition<pitype>::Iterator
199 end() const
200 {
201 return gridView().template end<codim,pitype>();
202 }
203
204 size_type size(dim_type codim) const
205 {
206 return indexSet().size(codim);
207 }
208
209 size_type size(const GeometryType& gt) const
210 {
211 return indexSet().size(gt);
212 }
213
214 template<typename Entity>
215 bool contains(const Entity& e) const
216 {
217 return indexSet().contains(e);
218 }
219
220 bool contains(dim_type codim) const
221 {
222 return indexSet().contains(codim);
223 }
224
225 bool contains(const GeometryType& gt) const
226 {
227 return indexSet().contains(gt);
228 }
229
230 IntersectionIterator ibegin(const typename Codim<0>::Entity& entity) const
231 {
232 return gridView().ibegin(entity);
233 }
234
235 IntersectionIterator iend(const typename Codim<0>::Entity& entity) const
236 {
237 return gridView().iend(entity);
238 }
239
240 const Communication& comm() const
241 {
242 return gridView().comm();
243 }
244
246 size_type overlapSize(dim_type codim) const
247 {
248 return Partitions::contains(Dune::Partitions::overlap) ? gridView().overlapSize(codim) : 0;
249 }
250
252 size_type ghostSize(dim_type codim) const
253 {
254 return Partitions::contains(Dune::Partitions::ghost) ? gridView().ghostSize(codim) : 0;
255 }
256
257 template<typename DataHandle>
258 void communicate(DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
259 {
260 gridView().communicate(data,iftype,dir);
261 }
262
264 const GridView& gridView() const
265 {
266 return indexSet().gridView();
267 }
268
269 PartitionViewEntitySet(const GridView& gv, CodimMask supported_codims)
270 : _index_set(std::make_shared<IndexSet>(gv,supported_codims,true))
271 {}
272
273 explicit PartitionViewEntitySet(const GridView& gv, bool initialize = true)
274 : _index_set(std::make_shared<IndexSet>(gv,CodimMask(initialize ? ~0ull : 0ull),initialize))
275 {}
276
278 void reset()
279 {
280 _index_set->reset();
281 }
282
284 void addCodim(dim_type codim)
285 {
286 _index_set->addCodim(codim);
287 }
288
290 void removeCodim(dim_type codim)
291 {
292 _index_set->removeCodim(codim);
293 }
294
296 bool needsUpdate() const
297 {
298 return _index_set->needsUpdate();
299 }
300
302
310 bool update(bool force = false)
311 {
312 return _index_set->update(force);
313 }
314
323 bool operator==(const PartitionViewEntitySet& other) const {
324 return _index_set == other._index_set;
325 }
326
328 bool operator!=(const PartitionViewEntitySet& other) const {
329 return not (*this == other);
330 }
331
332 private:
333
334 std::shared_ptr<IndexSet> _index_set;
335
336 };
337
338 template<typename GV, typename P>
339 class PartitionViewEntitySetIndexSetBase
340 {
341
342 template<typename,typename>
343 friend class PartitionViewEntitySet;
344
345 public:
346
347 using Traits = PartitionViewEntitySetTraits<GV,P>;
348
349 using Partitions = typename Traits::Partitions;
350 using Grid = typename Traits::Grid;
351 using GridView = typename Traits::GridView;
352 using BaseIndexSet = typename Traits::BaseIndexSet;
353 using size_type = typename Traits::size_type;
354 using dim_type = typename Traits::dim_type;
355 using Index = typename Traits::Index;
356 using Types = typename Traits::Types;
357 using CodimMask = typename Traits::CodimMask;
358
359 using IndexType = Index;
360
361 static const dim_type dimension = Traits::dimension;
362
363 constexpr static Index invalidIndex()
364 {
365 return Traits::invalidIndex();
366 }
367
368 template<dim_type codim>
369 using Codim = typename Traits::template Codim<codim>;
370
371 PartitionViewEntitySetIndexSetBase(const PartitionViewEntitySetIndexSetBase&) = delete;
372 PartitionViewEntitySetIndexSetBase& operator=(const PartitionViewEntitySetIndexSetBase&) = delete;
373
374
375 protected:
376
377 bool update(bool force)
378 {
379 if (!(_needs_update || force))
380 return false;
381 std::fill(_gt_offsets.begin(),_gt_offsets.end(),0);
382 std::fill(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),0);
383 _active_geometry_types.reset();
384 _geometry_types.resize(0);
385 for (dim_type codim = 0; codim <= GV::dimension; ++codim)
386 {
387 if (!_wanted_codims.test(codim))
388 continue;
389 for (const auto& gt : baseIndexSet().types(codim))
390 {
391 auto gt_index = GlobalGeometryTypeIndex::index(gt);
392 _gt_offsets[gt_index + 1] = baseIndexSet().size(gt);
393 _geometry_types.push_back(gt);
394 _active_geometry_types.set(gt_index);
395 }
396 }
397 for (dim_type codim = 0; codim <= GV::dimension; ++codim)
398 {
399 auto range = std::equal_range(
400 _geometry_types.begin(),
401 _geometry_types.end(),
402 GeometryTypes::none(GV::dimension - codim),
403 [](const GeometryType& x, const GeometryType& y)
404 {
405 // reverse order because we store in ascending order with regard to the codim, not the dim
406 return y.dim() < x.dim();
407 });
408 _per_codim_geometry_types[codim] = {range.first,range.second};
409 }
410
411 std::partial_sum(_gt_offsets.begin(),_gt_offsets.end(),_gt_offsets.begin());
412 _active_codims = _wanted_codims;
413 _needs_update = false;
414 return true;
415 }
416
417 public:
418
419 size_type size(GeometryType gt) const
420 {
421 assert(!needsUpdate());
422 auto gt_index = GlobalGeometryTypeIndex::index(gt);
423 return _mapped_gt_offsets[gt_index + 1] - _mapped_gt_offsets[gt_index];
424 }
425
426 size_type size(dim_type codim) const
427 {
428 assert(!needsUpdate());
429 auto dim = GV::dimension;
430 return _mapped_gt_offsets[GlobalGeometryTypeIndex::offset(dim-codim+1)] -
431 _mapped_gt_offsets[GlobalGeometryTypeIndex::offset(dim-codim)];
432 }
433
434 template<typename Entity>
435 bool contains(const Entity& e) const
436 {
437 return Partitions::contains(e.partitionType()) ? baseIndexSet().contains(e) : false;
438 }
439
440 bool contains(dim_type codim) const
441 {
442 return _active_codims.test(codim);
443 }
444
445 bool contains(const GeometryType& gt) const
446 {
447 return _active_geometry_types.test(GlobalGeometryTypeIndex::index(gt));
448 }
449
450 const BaseIndexSet& baseIndexSet() const
451 {
452 return _gv.indexSet();
453 }
454
455 Types types(dim_type codim) const
456 {
457 assert(!needsUpdate());
458 return _per_codim_geometry_types[codim];
459 }
460
461 Types types() const
462 {
463 assert(!needsUpdate());
464 return {_geometry_types.begin(),_geometry_types.end()};
465 }
466
467 PartitionViewEntitySetIndexSetBase(const GV& gv, CodimMask wanted_codims)
468 : _gv(gv)
469 , _needs_update(true)
470 , _wanted_codims(wanted_codims)
471 {}
472
473 const GridView& gridView() const
474 {
475 return _gv;
476 }
477
478 bool needsUpdate() const
479 {
480 return _needs_update;
481 }
482
483 protected:
484
485 void reset()
486 {
487 _needs_update = true;
488 _wanted_codims.reset();
489 }
490
491 void addCodim(dim_type codim)
492 {
493 _wanted_codims.set(codim);
494 _needs_update = _wanted_codims != _active_codims || _wanted_codims.none();
495 }
496
497 void removeCodim(dim_type codim)
498 {
499 _wanted_codims.reset(codim);
500 _needs_update = _wanted_codims != _active_codims || _wanted_codims.none();
501 }
502
503 GV _gv;
504 bool _needs_update;
505 CodimMask _wanted_codims;
506 std::bitset<GlobalGeometryTypeIndex::size(GV::dimension)> _active_geometry_types;
507 CodimMask _active_codims;
508 std::array<size_type,GlobalGeometryTypeIndex::size(GV::dimension) + 1> _gt_offsets;
509 std::array<size_type,GlobalGeometryTypeIndex::size(GV::dimension) + 1> _mapped_gt_offsets;
510
511 private:
512
513 std::vector<GeometryType> _geometry_types;
514 std::array<Types,GV::dimension + 1> _per_codim_geometry_types;
515
516 };
517
518 template<typename GV, typename P>
519 class PartitionViewEntitySetIndexSet
520 : public PartitionViewEntitySetIndexSetBase<GV,P>
521 {
522
523 using Base = PartitionViewEntitySetIndexSetBase<GV,P>;
524
525 template<typename,typename>
526 friend class PartitionViewEntitySet;
527
528 public:
529
530 using typename Base::Traits;
531 using typename Base::Index;
532 using typename Base::Partitions;
533 using typename Base::size_type;
534 using typename Base::dim_type;
535
536 using typename Base::Grid;
537
538 using Base::gridView;
539 using Base::baseIndexSet;
540 using Base::invalidIndex;
541 using Base::contains;
542 using typename Base::CodimMask;
543 using Base::needsUpdate;
544
545 private:
546
547 static constexpr bool hasAllEntityIterators(Dune::Dim<Grid::dimension + 1>)
548 {
549 return true;
550 }
551
552 template<dim_type dim = 0>
553 static constexpr bool hasAllEntityIterators(Dune::Dim<dim> = {})
554 {
555 return Capabilities::hasEntityIterator<Grid,dim>::v && hasAllEntityIterators(Dune::Dim<dim+1>{});
556 }
557
558 bool update(bool force)
559 {
560 if (!Base::update(force))
561 return false;
562 _indices.assign(_gt_offsets.back(),invalidIndex());
563 _mapped_gt_offsets[0] = 0;
564 update_codims(std::integral_constant<bool,hasAllEntityIterators()>{});
565 std::partial_sum(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),_mapped_gt_offsets.begin());
566 return true;
567 }
568
569 void update_codims(std::true_type)
570 {
571 update_codim(Dune::Codim<0>{});
572 }
573
574 void update_codim(Dune::Codim<GV::dimension+1>)
575 {}
576
577 template<dim_type cd>
578 void update_codim(Dune::Codim<cd> codim)
579 {
580 if (_active_codims.test(codim))
581 for (const auto& e : entities(gridView(),codim,Dune::Partitions::all))
582 {
583 auto gt = e.type();
584 auto gt_index = GlobalGeometryTypeIndex::index(gt);
585 if (Partitions::contains(e.partitionType()))
586 _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)] = _mapped_gt_offsets[gt_index + 1]++;
587 }
588 update_codim(Dune::Codim<cd+1>{});
589 }
590
591
592 void update_codims(std::false_type)
593 {
594 std::fill(_indices.begin(),_indices.end(),invalidIndex());
595
596 auto& index_set = baseIndexSet();
597
598 for (const auto& e : elements(gridView(),Dune::Partitions::all))
599 {
600 if (!Partitions::contains(e.partitionType()))
601 continue;
602
604 for (dim_type codim = 0; codim <= Grid::dimension; ++codim)
605 {
606 if (!_active_codims.test(codim))
607 continue;
608
609 size_type sub_entity_count = ref_el.size(codim);
610
611 for(size_type i = 0; i < sub_entity_count; ++i)
612 {
613 auto gt = ref_el.type(i,codim);
614 auto gt_index = GlobalGeometryTypeIndex::index(gt);
615 auto index = index_set.subIndex(e,i,codim);
616 if (_indices[_gt_offsets[gt_index] + index] == invalidIndex())
617 _indices[_gt_offsets[gt_index] + index] = _mapped_gt_offsets[gt_index + 1]++;
618 }
619 }
620 }
621 }
622
623 template<class Entity>
624 Index indexImpl(const Entity& e) const
625 {
626 assert(!needsUpdate());
627 assert(Partitions::contains(e.partitionType()));
628 assert(contains(e.type()));
629 auto gt_index = GlobalGeometryTypeIndex::index(e.type());
630 return _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)];
631 }
632
633 template<typename E>
634 Index subIndexImpl(const E& e, size_type i, dim_type codim) const
635 {
636 assert(!needsUpdate());
637 assert(Partitions::contains(e.partitionType()));
639 assert(contains(gt));
640 auto gt_index = GlobalGeometryTypeIndex::index(gt);
641 return _indices[_gt_offsets[gt_index] + baseIndexSet().subIndex(e,i,codim)];
642 }
643
644 public:
645
646 template<int cc>
647 Index index(const typename Traits::template Codim<cc>::Entity& e) const {
648 return indexImpl(e);
649 }
650
651 template<class Entity>
652 Index index(const Entity& e) const {
653 return indexImpl(e);
654 }
655
656 template<int cc>
657 Index subIndex(const typename Traits::template Codim<cc>::Entity& e, size_type i, dim_type codim) const {
658 return subIndexImpl(e,i,codim);
659 }
660
661
662 template<typename E>
663 Index subIndex(const E& e, size_type i, dim_type codim) const {
664 return subIndexImpl(e,i,codim);
665 }
666
667 template<typename E>
668 Index uniqueIndex(const E& e) const
669 {
670 assert(!needsUpdate());
671 assert(Partitions::contains(e.partitionType()));
672 assert(contains(e.type()));
673 auto gt_index = GlobalGeometryTypeIndex::index(e.type());
674 return _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)] + _mapped_gt_offsets[gt_index];
675 }
676
677 template<typename E>
678 Index uniqueSubIndex(const E& e, size_type i, dim_type codim) const
679 {
680 assert(!needsUpdate());
681 assert(Partitions::contains(e.partitionType()));
683 assert(contains(gt));
684 auto gt_index = GlobalGeometryTypeIndex::index(gt);
685 return _indices[_gt_offsets[gt_index] + baseIndexSet().subIndex(e,i,codim)] + _mapped_gt_offsets[gt_index];
686 }
687
688
689 PartitionViewEntitySetIndexSet(const GV& gv, CodimMask wanted_codims, bool initialize)
690 : Base(gv,wanted_codims)
691 {
692 if (initialize)
693 update(true);
694 }
695
696 private:
697
698 using Base::_active_codims;
699 using Base::_gt_offsets;
700 using Base::_mapped_gt_offsets;
701
702 std::vector<Index> _indices;
703
704 };
705
706 template<typename GV>
707 class PartitionViewEntitySetIndexSet<GV,Partitions::All>
708 : public PartitionViewEntitySetIndexSetBase<GV,Partitions::All>
709 {
710
711 using Base = PartitionViewEntitySetIndexSetBase<GV,Dune::Partitions::All>;
712
713 template<typename,typename>
715
716 public:
717
718 using typename Base::Traits;
719 using typename Base::Index;
720 using typename Base::Partitions;
721 using typename Base::size_type;
722 using typename Base::dim_type;
723 using typename Base::CodimMask;
724
725 using Base::baseIndexSet;
726 using Base::contains;
727
728 private:
729
730 bool update(bool force)
731 {
732 if (!Base::update(force))
733 return false;
734 _mapped_gt_offsets[0] = 0;
735 for (const auto& gt : Base::types())
736 _mapped_gt_offsets[GlobalGeometryTypeIndex::index(gt) + 1] = baseIndexSet().size(gt);
737 std::partial_sum(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),_mapped_gt_offsets.begin());
738 return true;
739 }
740
741 template<typename E>
742 Index subIndexImpl(const E& e, size_type i, dim_type codim) const
743 {
744#ifndef NDEBUG
746 assert(contains(gt));
747#endif
748 return baseIndexSet().subIndex(e,i,codim);
749 }
750
751 public:
752
753 template<typename E>
754 Index index(const E& e) const
755 {
756 assert(contains(e.type()));
757 return baseIndexSet().index(e);
758 }
759
760 template<int cc>
761 Index index(const typename Traits::template Codim<cc>::Entity& e) const
762 {
763 assert(contains(e.type()));
764 return baseIndexSet().index(e);
765 }
766
767 template<typename E>
768 Index uniqueIndex(const E& e) const
769 {
770 assert(contains(e.type()));
771 return baseIndexSet().index(e) + _mapped_gt_offsets[Dune::GlobalGeometryTypeIndex::index(e.type())];
772 }
773
774
775 template<int cc>
776 Index subIndex(const typename Traits::template Codim<cc>::Entity& e, size_type i, dim_type codim) const {
777 return subIndexImpl(e,i,codim);
778 }
779
780 template<typename E>
781 Index subIndex(const E& e, size_type i, dim_type codim) const {
782 return subIndexImpl(e,i,codim);
783 }
784
785 template<typename E>
786 Index uniqueSubIndex(const E& e, size_type i, dim_type codim) const
787 {
789 assert(contains(gt));
790 return baseIndexSet().subIndex(e,i,codim) + _mapped_gt_offsets[Dune::GlobalGeometryTypeIndex::index(gt)];
791 }
792
793 PartitionViewEntitySetIndexSet(const GV& gv, CodimMask wanted_codims, bool initialize = true)
794 : Base(gv,wanted_codims)
795 {
796 if (initialize)
797 update(true);
798 }
799
800 private:
801
802 using Base::_mapped_gt_offsets;
803
804 };
805
806 template<typename GV>
807 using AllEntitySet = PartitionViewEntitySet<GV,Partitions::All>;
808
809 template<typename GV>
810 using OverlappingEntitySet = PartitionViewEntitySet<GV,Partitions::InteriorBorderOverlapFront>;
811
812 template<typename GV>
813 using NonOverlappingEntitySet = PartitionViewEntitySet<GV,Partitions::InteriorBorder>;
814
815#ifndef DOXYGEN
816
817 namespace impl {
818
819 template<typename T>
820 struct _isEntitySet
821 {
822 using type = std::false_type;
823 };
824
825 template<typename GV,typename P>
826 struct _isEntitySet<PartitionViewEntitySet<GV,P>>
827 {
828 using type = std::true_type;
829 };
830
831 }
832
833#endif // DOXYGEN
834
836 template<typename T>
837 using isEntitySet = typename impl::_isEntitySet<T>::type;
838
839 } // namespace PDELab
840} // namespace Dune
841
842
843#endif // DUNE_PDELAB_COMMON_PARTITIONVIEWENTITYSET_HH
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type over all dimensions.
Definition: typeindex.hh:138
static constexpr std::size_t offset(std::size_t dim)
Compute the starting index for a given dimension including irregular geometry types.
Definition: typeindex.hh:113
static constexpr std::size_t size(std::size_t maxdim)
Compute total number of geometry types up to and including the given dimension.
Definition: typeindex.hh:125
Grid view abstract base class.
Definition: gridview.hh:66
Grid abstract base class.
Definition: grid.hh:375
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:518
Index Set Interface base class.
Definition: indexidset.hh:78
Iterator const_iterator
The iterator belonging to this range.
Definition: iteratorrange.hh:33
Partition view (or entity set) of a grid view.
Definition: partitionviewentityset.hh:120
const IndexSet & indexSet() const
Returns the IndexSet of this EntitySet.
Definition: partitionviewentityset.hh:165
void reset()
Reset this EntitySet, which removes all entities from it.
Definition: partitionviewentityset.hh:278
bool operator==(const PartitionViewEntitySet &other) const
Compare to another partition view.
Definition: partitionviewentityset.hh:323
bool update(bool force=false)
Update the internal state of this EntitySet.
Definition: partitionviewentityset.hh:310
const GridView & gridView() const
Returns the underlying GridView.
Definition: partitionviewentityset.hh:264
bool operator!=(const PartitionViewEntitySet &other) const
Compare to another partition view.
Definition: partitionviewentityset.hh:328
void removeCodim(dim_type codim)
Remove all entities of the given codim from this EntitySet.
Definition: partitionviewentityset.hh:290
size_type overlapSize(dim_type codim) const
Returns the overlap size of this EntitySet, which depends on its PartitionSet.
Definition: partitionviewentityset.hh:246
const BaseIndexSet & baseIndexSet() const
Returns the IndexSet of the underlying GridView.
Definition: partitionviewentityset.hh:171
bool needsUpdate() const
Returns true if you need to call update on this EntitySet before using it.
Definition: partitionviewentityset.hh:296
void addCodim(dim_type codim)
Add all entities of the given codim to this EntitySet.
Definition: partitionviewentityset.hh:284
size_type ghostSize(dim_type codim) const
Returns the ghost size of this EntitySet, which depends on its PartitionSet.
Definition: partitionviewentityset.hh:252
A set of traits classes to store static information about grid implementation.
@ conforming
Output conforming data.
Definition: common.hh:73
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:158
static constexpr bool isEntitySet()
Check if F models the GridFunction concept with given signature and entity set.
Definition: functionconcepts.hh:231
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:170
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
constexpr GeometryType none(unsigned int dim)
Returns a GeometryType representing a singular of dimension dim.
Definition: type.hh:471
constexpr Overlap overlap
PartitionSet for the overlap partition.
Definition: partitionset.hh:277
PartitionSet<... > All
Type of PartitionSet for all partitions.
Definition: partitionset.hh:267
constexpr All all
PartitionSet for all partitions.
Definition: partitionset.hh:295
constexpr Ghost ghost
PartitionSet for the ghost partition.
Definition: partitionset.hh:283
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)
Checks whether or not a given sequence contains a value.
Definition: integersequence.hh:137
STL namespace.
Static tag representing a codimension.
Definition: dimension.hh:24
Static tag representing a dimension.
Definition: dimension.hh:16
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition: referenceelements.hh:156
Helper classes to provide indices for geometrytypes for use in a vector.
Various macros to work with Dune module version numbers.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)