dune-pdelab  2.7-git
partitionviewentityset.hh
Go to the documentation of this file.
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 
12 #include <dune/common/version.hh>
13 #include <dune/common/iteratorrange.hh>
14 #include <dune/geometry/referenceelements.hh>
15 #include <dune/geometry/typeindex.hh>
16 #include <dune/grid/common/capabilities.hh>
17 #include <dune/grid/common/partitionset.hh>
18 #include <dune/grid/common/rangegenerators.hh>
19 
20 namespace 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>
41  {
42 
43  using Partitions = typename std::decay<P>::type;
44 
45  using Grid = typename GV::Traits::Grid;
46  using GridView = GV;
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 CollectiveCommunication = typename GV::Traits::CollectiveCommunication;
58 
59  using size_type = std::size_t;
60  using dim_type = int;
61 
62  using Index = typename BaseIndexSet::IndexType;
63 
64  using Types = IteratorRange<std::vector<GeometryType>::const_iterator>;
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 
98 
99  };
100 
101  };
102 
103  };
104 
105 
106  template<typename GV, typename P>
108  {
109 
110  public:
111 
113 
114  using Partitions = typename Traits::Partitions;
115  using Grid = typename Traits::Grid;
116  using GridView = typename Traits::GridView;
117  using IndexSet = typename Traits::IndexSet;
119  using Element = typename Traits::Element;
123  using CodimMask = typename Traits::CodimMask;
125  using size_type = typename Traits::size_type;
126  using dim_type = typename Traits::dim_type;
127 
129 
130  static const bool conforming = Traits::conforming;
133 
134  template<dim_type codim>
135  using Codim = typename Traits::template Codim<codim>;
136 
137  constexpr static Partitions partitions()
138  {
139  return {};
140  }
141 
142  constexpr static CodimMask allCodims()
143  {
144  return {~0ull};
145  }
146 
147  const Grid& grid() const
148  {
149  return gridView().grid();
150  }
151 
153  const IndexSet& indexSet() const
154  {
155  return *_index_set;
156  }
157 
159  const BaseIndexSet& baseIndexSet() const
160  {
161  return indexSet().baseIndexSet();
162  }
163 
164  template<dim_type codim>
165  typename Codim<codim>::Iterator
166  begin() const
167  {
168  return gridView().template begin<codim,Partitions::partitionIterator()>();
169  }
170 
171  template<dim_type codim>
172  typename Codim<codim>::Iterator
173  end() const
174  {
175  return gridView().template end<codim,Partitions::partitionIterator()>();
176  }
177 
178  template<dim_type codim, PartitionIteratorType pitype>
179  typename GV::template Codim<codim>::template Partition<pitype>::Iterator
180  begin() const
181  {
182  return gridView().template begin<codim,pitype>();
183  }
184 
185  template<dim_type codim, PartitionIteratorType pitype>
186  typename GV::template Codim<codim>::template Partition<pitype>::Iterator
187  end() const
188  {
189  return gridView().template end<codim,pitype>();
190  }
191 
192  size_type size(dim_type codim) const
193  {
194  return indexSet().size(codim);
195  }
196 
197  size_type size(const GeometryType& gt) const
198  {
199  return indexSet().size(gt);
200  }
201 
202  template<typename Entity>
203  bool contains(const Entity& e) const
204  {
205  return indexSet().contains(e);
206  }
207 
208  bool contains(dim_type codim) const
209  {
210  return indexSet().contains(codim);
211  }
212 
213  bool contains(const GeometryType& gt) const
214  {
215  return indexSet().contains(gt);
216  }
217 
218  IntersectionIterator ibegin(const typename Codim<0>::Entity& entity) const
219  {
220  return gridView().ibegin(entity);
221  }
222 
223  IntersectionIterator iend(const typename Codim<0>::Entity& entity) const
224  {
225  return gridView().iend(entity);
226  }
227 
229  {
230  return gridView().comm();
231  }
232 
235  {
236  return Partitions::contains(Dune::Partitions::overlap) ? gridView().overlapSize(codim) : 0;
237  }
238 
241  {
242  return Partitions::contains(Dune::Partitions::ghost) ? gridView().ghostSize(codim) : 0;
243  }
244 
245  template<typename DataHandle>
246  void communicate(DataHandle& data, InterfaceType iftype, CommunicationDirection dir) const
247  {
248  gridView().communicate(data,iftype,dir);
249  }
250 
252  const GridView& gridView() const
253  {
254  return indexSet().gridView();
255  }
256 
257  PartitionViewEntitySet(const GridView& gv, CodimMask supported_codims)
258  : _index_set(std::make_shared<IndexSet>(gv,supported_codims,true))
259  {}
260 
261  explicit PartitionViewEntitySet(const GridView& gv, bool initialize = true)
262  : _index_set(std::make_shared<IndexSet>(gv,CodimMask(initialize ? ~0ull : 0ull),initialize))
263  {}
264 
266  void reset()
267  {
268  _index_set->reset();
269  }
270 
272  void addCodim(dim_type codim)
273  {
274  _index_set->addCodim(codim);
275  }
276 
278  void removeCodim(dim_type codim)
279  {
280  _index_set->removeCodim(codim);
281  }
282 
284  bool needsUpdate() const
285  {
286  return _index_set->needsUpdate();
287  }
288 
290 
298  bool update(bool force = false)
299  {
300  return _index_set->update(force);
301  }
302 
303  private:
304 
305  std::shared_ptr<IndexSet> _index_set;
306 
307  };
308 
309  template<typename GV, typename P>
311  {
312 
313  template<typename,typename>
315 
316  public:
317 
319 
320  using Partitions = typename Traits::Partitions;
321  using Grid = typename Traits::Grid;
322  using GridView = typename Traits::GridView;
324  using size_type = typename Traits::size_type;
325  using dim_type = typename Traits::dim_type;
326  using Index = typename Traits::Index;
327  using Types = typename Traits::Types;
328  using CodimMask = typename Traits::CodimMask;
329 
330  using IndexType = Index;
331 
332  constexpr static Index invalidIndex()
333  {
334  return Traits::invalidIndex();
335  }
336 
337  template<dim_type codim>
338  using Codim = typename Traits::template Codim<codim>;
339 
342 
343 
344  protected:
345 
346  bool update(bool force)
347  {
348  if (!(_needs_update || force))
349  return false;
350  std::fill(_gt_offsets.begin(),_gt_offsets.end(),0);
351  std::fill(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),0);
352  _active_geometry_types.reset();
353  _geometry_types.resize(0);
354  for (dim_type codim = 0; codim <= GV::dimension; ++codim)
355  {
356  if (!_wanted_codims.test(codim))
357  continue;
358  for (const auto& gt : baseIndexSet().types(codim))
359  {
360  auto gt_index = GlobalGeometryTypeIndex::index(gt);
361  _gt_offsets[gt_index + 1] = baseIndexSet().size(gt);
362  _geometry_types.push_back(gt);
363  _active_geometry_types.set(gt_index);
364  }
365  }
366  for (dim_type codim = 0; codim <= GV::dimension; ++codim)
367  {
368  auto range = std::equal_range(
369  _geometry_types.begin(),
370  _geometry_types.end(),
371  GeometryTypes::none(GV::dimension - codim),
372  [](const GeometryType& x, const GeometryType& y)
373  {
374  // reverse order because we store in ascending order with regard to the codim, not the dim
375  return y.dim() < x.dim();
376  });
377  _per_codim_geometry_types[codim] = {range.first,range.second};
378  }
379 
380  std::partial_sum(_gt_offsets.begin(),_gt_offsets.end(),_gt_offsets.begin());
382  _needs_update = false;
383  return true;
384  }
385 
386  public:
387 
388  size_type size(GeometryType gt) const
389  {
390  assert(!needsUpdate());
391  auto gt_index = GlobalGeometryTypeIndex::index(gt);
392  return _mapped_gt_offsets[gt_index + 1] - _mapped_gt_offsets[gt_index];
393  }
394 
395  size_type size(dim_type codim) const
396  {
397  assert(!needsUpdate());
398  auto dim = GV::dimension;
401  }
402 
403  template<typename Entity>
404  bool contains(const Entity& e) const
405  {
406  return Partitions::contains(e.partitionType()) ? baseIndexSet().contains(e) : false;
407  }
408 
409  bool contains(dim_type codim) const
410  {
411  return _active_codims.test(codim);
412  }
413 
414  bool contains(const GeometryType& gt) const
415  {
417  }
418 
419  const BaseIndexSet& baseIndexSet() const
420  {
421  return _gv.indexSet();
422  }
423 
424  Types types(dim_type codim) const
425  {
426  assert(!needsUpdate());
427  return _per_codim_geometry_types[codim];
428  }
429 
430  Types types() const
431  {
432  assert(!needsUpdate());
433  return {_geometry_types.begin(),_geometry_types.end()};
434  }
435 
436  PartitionViewEntitySetIndexSetBase(const GV& gv, CodimMask wanted_codims)
437  : _gv(gv)
438  , _needs_update(true)
439  , _wanted_codims(wanted_codims)
440  {}
441 
442  const GridView& gridView() const
443  {
444  return _gv;
445  }
446 
447  bool needsUpdate() const
448  {
449  return _needs_update;
450  }
451 
452  protected:
453 
454  void reset()
455  {
456  _needs_update = true;
457  _wanted_codims.reset();
458  }
459 
460  void addCodim(dim_type codim)
461  {
462  _wanted_codims.set(codim);
464  }
465 
466  void removeCodim(dim_type codim)
467  {
468  _wanted_codims.reset(codim);
470  }
471 
472  GV _gv;
475  std::bitset<GlobalGeometryTypeIndex::size(GV::dimension)> _active_geometry_types;
477  std::array<size_type,GlobalGeometryTypeIndex::size(GV::dimension) + 1> _gt_offsets;
478  std::array<size_type,GlobalGeometryTypeIndex::size(GV::dimension) + 1> _mapped_gt_offsets;
479 
480  private:
481 
482  std::vector<GeometryType> _geometry_types;
483  std::array<Types,GV::dimension + 1> _per_codim_geometry_types;
484 
485  };
486 
487  template<typename GV, typename P>
490  {
491 
493 
494  template<typename,typename>
496 
497  public:
498 
499  using typename Base::Index;
500  using typename Base::Partitions;
501  using typename Base::size_type;
502  using typename Base::dim_type;
503 
504  using typename Base::Grid;
505 
506  using Base::gridView;
507  using Base::baseIndexSet;
508  using Base::invalidIndex;
509  using Base::contains;
510  using typename Base::CodimMask;
511  using Base::needsUpdate;
512 
513  private:
514 
515  static constexpr bool hasAllEntities(Dune::Dim<Grid::dimension + 1>)
516  {
517  return true;
518  }
519 
520  template<dim_type dim = 0>
521  static constexpr bool hasAllEntities(Dune::Dim<dim> = {})
522  {
523  return Capabilities::hasEntity<Grid,dim>::v && hasAllEntities(Dune::Dim<dim+1>{});
524  }
525 
526  bool update(bool force)
527  {
528  if (!Base::update(force))
529  return false;
530  _indices.assign(_gt_offsets.back(),invalidIndex());
531  _mapped_gt_offsets[0] = 0;
532  update_codims(std::integral_constant<bool,hasAllEntities()>{});
533  std::partial_sum(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),_mapped_gt_offsets.begin());
534  return true;
535  }
536 
537  void update_codims(std::true_type)
538  {
539  update_codim(Dune::Codim<0>{});
540  }
541 
542  void update_codim(Dune::Codim<GV::dimension+1>)
543  {}
544 
545  template<dim_type cd>
546  void update_codim(Dune::Codim<cd> codim)
547  {
548  if (_active_codims.test(codim))
549  for (const auto& e : entities(gridView(),codim,Dune::Partitions::all))
550  {
551  auto gt = e.type();
552  auto gt_index = GlobalGeometryTypeIndex::index(gt);
553  if (Partitions::contains(e.partitionType()))
554  _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)] = _mapped_gt_offsets[gt_index + 1]++;
555  }
556  update_codim(Dune::Codim<cd+1>{});
557  }
558 
559 
560  void update_codims(std::false_type)
561  {
562  std::fill(_indices.begin(),_indices.end(),invalidIndex());
563 
564  auto& index_set = baseIndexSet();
565 
566  for (const auto& e : elements(gridView(),Dune::Partitions::all))
567  {
568  if (!Partitions::contains(e.partitionType()))
569  continue;
570 
571  auto ref_el = ReferenceElements<typename Base::Traits::CoordinateField,GV::dimension>::general(e.type());
572  for (dim_type codim = 0; codim <= Grid::dimension; ++codim)
573  {
574  if (!_active_codims.test(codim))
575  continue;
576 
577  size_type sub_entity_count = ref_el.size(codim);
578 
579  for(size_type i = 0; i < sub_entity_count; ++i)
580  {
581  auto gt = ref_el.type(i,codim);
582  auto gt_index = GlobalGeometryTypeIndex::index(gt);
583  auto index = index_set.subIndex(e,i,codim);
584  if (_indices[_gt_offsets[gt_index] + index] == invalidIndex())
585  _indices[_gt_offsets[gt_index] + index] = _mapped_gt_offsets[gt_index + 1]++;
586  }
587  }
588  }
589  }
590 
591 
592  public:
593 
594  template<typename E>
595  Index index(const E& e) const
596  {
597  assert(!needsUpdate());
598  assert(Partitions::contains(e.partitionType()));
599  assert(contains(e.type()));
600  auto gt_index = GlobalGeometryTypeIndex::index(e.type());
601  return _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)];
602  }
603 
604  template<typename E>
605  Index subIndex(const E& e, size_type i, dim_type codim) const
606  {
607  assert(!needsUpdate());
608  assert(Partitions::contains(e.partitionType()));
609  auto gt = ReferenceElements<typename Base::Traits::CoordinateField,GV::dimension>::general(e.type()).type(i,codim);
610  assert(contains(gt));
611  auto gt_index = GlobalGeometryTypeIndex::index(gt);
612  return _indices[_gt_offsets[gt_index] + baseIndexSet().subIndex(e,i,codim)];
613  }
614 
615 
616  template<typename E>
617  Index uniqueIndex(const E& e) const
618  {
619  assert(!needsUpdate());
620  assert(Partitions::contains(e.partitionType()));
621  assert(contains(e.type()));
622  auto gt_index = GlobalGeometryTypeIndex::index(e.type());
623  return _indices[_gt_offsets[gt_index] + baseIndexSet().index(e)] + _mapped_gt_offsets[gt_index];
624  }
625 
626  template<typename E>
627  Index uniqueSubIndex(const E& e, size_type i, dim_type codim) const
628  {
629  assert(!needsUpdate());
630  assert(Partitions::contains(e.partitionType()));
631  auto gt = ReferenceElements<typename Base::Traits::CoordinateField,GV::dimension>::general(e.type()).type(i,codim);
632  assert(contains(gt));
633  auto gt_index = GlobalGeometryTypeIndex::index(gt);
634  return _indices[_gt_offsets[gt_index] + baseIndexSet().subIndex(e,i,codim)] + _mapped_gt_offsets[gt_index];
635  }
636 
637 
638  PartitionViewEntitySetIndexSet(const GV& gv, CodimMask wanted_codims, bool initialize)
639  : Base(gv,wanted_codims)
640  {
641  if (initialize)
642  update(true);
643  }
644 
645  private:
646 
647  using Base::_active_codims;
648  using Base::_gt_offsets;
650 
651  std::vector<Index> _indices;
652 
653  };
654 
655  template<typename GV>
657  : public PartitionViewEntitySetIndexSetBase<GV,Partitions::All>
658  {
659 
661 
662  template<typename,typename>
664 
665  public:
666 
667  using typename Base::Index;
668  using typename Base::Partitions;
669  using typename Base::size_type;
670  using typename Base::dim_type;
671  using typename Base::CodimMask;
672 
673  using Base::baseIndexSet;
674  using Base::contains;
675 
676  private:
677 
678  bool update(bool force)
679  {
680  if (!Base::update(force))
681  return false;
682  _mapped_gt_offsets[0] = 0;
683  for (const auto& gt : Base::types())
684  _mapped_gt_offsets[GlobalGeometryTypeIndex::index(gt) + 1] = baseIndexSet().size(gt);
685  std::partial_sum(_mapped_gt_offsets.begin(),_mapped_gt_offsets.end(),_mapped_gt_offsets.begin());
686  return true;
687  }
688 
689  public:
690 
691  template<typename E>
692  Index index(const E& e) const
693  {
694  assert(contains(e.type()));
695  return baseIndexSet().index(e);
696  }
697 
698  template<typename E>
699  Index uniqueIndex(const E& e) const
700  {
701  assert(contains(e.type()));
702  return baseIndexSet().index(e) + _mapped_gt_offsets[Dune::GlobalGeometryTypeIndex::index(e.type())];
703  }
704 
705  template<typename E>
706  Index subIndex(const E& e, size_type i, dim_type codim) const
707  {
708 #ifndef NDEBUG
709  auto gt = ReferenceElements<typename Base::Traits::CoordinateField,GV::dimension>::general(e.type()).type(i,codim);
710  assert(contains(gt));
711 #endif
712  return baseIndexSet().subIndex(e,i,codim);
713  }
714 
715  template<typename E>
716  Index uniqueSubIndex(const E& e, size_type i, dim_type codim) const
717  {
718  auto gt = ReferenceElements<typename Base::Traits::CoordinateField,GV::dimension>::general(e.type()).type(i,codim);
719  assert(contains(gt));
720  return baseIndexSet().subIndex(e,i,codim) + _mapped_gt_offsets[Dune::GlobalGeometryTypeIndex::index(gt)];
721  }
722 
723  PartitionViewEntitySetIndexSet(const GV& gv, CodimMask wanted_codims, bool initialize = true)
724  : Base(gv,wanted_codims)
725  {
726  if (initialize)
727  update(true);
728  }
729 
730  private:
731 
733 
734  };
735 
736  template<typename GV>
738 
739  template<typename GV>
741 
742  template<typename GV>
744 
745 #ifndef DOXYGEN
746 
747  namespace impl {
748 
749  template<typename T>
750  struct _isEntitySet
751  {
752  using type = std::false_type;
753  };
754 
755  template<typename GV,typename P>
756  struct _isEntitySet<PartitionViewEntitySet<GV,P>>
757  {
758  using type = std::true_type;
759  };
760 
761  }
762 
763 #endif // DOXYGEN
764 
766  template<typename T>
767  using isEntitySet = typename impl::_isEntitySet<T>::type;
768 
769  } // namespace PDELab
770 } // namespace Dune
771 
772 
773 #endif // DUNE_PDELAB_COMMON_PARTITIONVIEWENTITYSET_HH
static const int dim
Definition: adaptivity.hh:84
std::size_t index
Definition: interpolate.hh:97
const Entity & e
Definition: localfunctionspace.hh:121
const std::size_t offset
Definition: localfunctionspace.hh:75
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
@ conforming
Definition: pdelab/boilerplate/pdelab.hh:435
typename impl::_isEntitySet< T >::type isEntitySet
Type Trait to determine whether T is an EntitySet.
Definition: partitionviewentityset.hh:767
Definition: partitionviewentityset.hh:108
PartitionViewEntitySet(const GridView &gv, CodimMask supported_codims)
Definition: partitionviewentityset.hh:257
static const dim_type dimension
Definition: partitionviewentityset.hh:131
void reset()
Reset this EntitySet, which removes all entities from it.
Definition: partitionviewentityset.hh:266
CoordinateField ctype
Definition: partitionviewentityset.hh:128
static const dim_type dimensionworld
Definition: partitionviewentityset.hh:132
bool contains(const GeometryType &gt) const
Definition: partitionviewentityset.hh:213
const IndexSet & indexSet() const
Returns the IndexSet of this EntitySet.
Definition: partitionviewentityset.hh:153
const Grid & grid() const
Definition: partitionviewentityset.hh:147
bool update(bool force=false)
Update the internal state of this EntitySet.
Definition: partitionviewentityset.hh:298
constexpr static CodimMask allCodims()
Definition: partitionviewentityset.hh:142
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
Definition: partitionviewentityset.hh:223
typename Traits::CodimMask CodimMask
Definition: partitionviewentityset.hh:123
typename Traits::IntersectionIterator IntersectionIterator
Definition: partitionviewentityset.hh:121
Codim< codim >::Iterator end() const
Definition: partitionviewentityset.hh:173
typename Traits::CollectiveCommunication CollectiveCommunication
Definition: partitionviewentityset.hh:122
typename Traits::GridView GridView
Definition: partitionviewentityset.hh:116
size_type size(dim_type codim) const
Definition: partitionviewentityset.hh:192
constexpr static Partitions partitions()
Definition: partitionviewentityset.hh:137
size_type size(const GeometryType &gt) const
Definition: partitionviewentityset.hh:197
bool contains(const Entity &e) const
Definition: partitionviewentityset.hh:203
typename Traits::Grid Grid
Definition: partitionviewentityset.hh:115
void removeCodim(dim_type codim)
Remove all entities of the given codim from this EntitySet.
Definition: partitionviewentityset.hh:278
bool contains(dim_type codim) const
Definition: partitionviewentityset.hh:208
typename Traits::IndexSet IndexSet
Definition: partitionviewentityset.hh:117
PartitionViewEntitySet(const GridView &gv, bool initialize=true)
Definition: partitionviewentityset.hh:261
typename Traits::Partitions Partitions
Definition: partitionviewentityset.hh:114
size_type overlapSize(dim_type codim) const
Returns the overlap size of this EntitySet, which depends on its PartitionSet.
Definition: partitionviewentityset.hh:234
Codim< codim >::Iterator begin() const
Definition: partitionviewentityset.hh:166
static const bool conforming
Definition: partitionviewentityset.hh:130
bool needsUpdate() const
Returns true if you need to call update on this EntitySet before using it.
Definition: partitionviewentityset.hh:284
GV::template Codim< codim >::template Partition< pitype >::Iterator end() const
Definition: partitionviewentityset.hh:187
const GridView & gridView() const
Returns the underlying GridView.
Definition: partitionviewentityset.hh:252
typename Traits::CoordinateField CoordinateField
Definition: partitionviewentityset.hh:124
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: partitionviewentityset.hh:246
typename Traits::Intersection Intersection
Definition: partitionviewentityset.hh:120
const CollectiveCommunication & comm() const
Definition: partitionviewentityset.hh:228
void addCodim(dim_type codim)
Add all entities of the given codim to this EntitySet.
Definition: partitionviewentityset.hh:272
typename Traits::Element Element
Definition: partitionviewentityset.hh:119
GV::template Codim< codim >::template Partition< pitype >::Iterator begin() const
Definition: partitionviewentityset.hh:180
typename Traits::BaseIndexSet BaseIndexSet
Definition: partitionviewentityset.hh:118
typename Traits::template Codim< codim > Codim
Definition: partitionviewentityset.hh:135
const BaseIndexSet & baseIndexSet() const
Returns the IndexSet of the underlying GridView.
Definition: partitionviewentityset.hh:159
typename Traits::size_type size_type
Definition: partitionviewentityset.hh:125
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
Definition: partitionviewentityset.hh:218
typename Traits::dim_type dim_type
Definition: partitionviewentityset.hh:126
size_type ghostSize(dim_type codim) const
Returns the ghost size of this EntitySet, which depends on its PartitionSet.
Definition: partitionviewentityset.hh:240
Definition: partitionviewentityset.hh:490
Index index(const E &e) const
Definition: partitionviewentityset.hh:595
typename Traits::dim_type dim_type
Definition: partitionviewentityset.hh:325
const GridView & gridView() const
Definition: partitionviewentityset.hh:442
constexpr static Index invalidIndex()
Definition: partitionviewentityset.hh:332
typename Traits::size_type size_type
Definition: partitionviewentityset.hh:324
Index uniqueSubIndex(const E &e, size_type i, dim_type codim) const
Definition: partitionviewentityset.hh:627
bool needsUpdate() const
Definition: partitionviewentityset.hh:447
const BaseIndexSet & baseIndexSet() const
Definition: partitionviewentityset.hh:419
PartitionViewEntitySetIndexSet(const GV &gv, CodimMask wanted_codims, bool initialize)
Definition: partitionviewentityset.hh:638
Index subIndex(const E &e, size_type i, dim_type codim) const
Definition: partitionviewentityset.hh:605
Index uniqueIndex(const E &e) const
Definition: partitionviewentityset.hh:617
bool contains(dim_type codim) const
Definition: partitionviewentityset.hh:409
Definition: partitionviewentityset.hh:41
typename BaseIndexSet::IndexType Index
Definition: partitionviewentityset.hh:62
typename GV::Traits::Grid Grid
Definition: partitionviewentityset.hh:45
typename GV::template Codim< 0 >::Entity Element
Definition: partitionviewentityset.hh:51
int dim_type
Definition: partitionviewentityset.hh:60
PartitionViewEntitySetIndexSet< GV, Partitions > IndexSet
Definition: partitionviewentityset.hh:48
typename GV::Traits::IntersectionIterator IntersectionIterator
Definition: partitionviewentityset.hh:55
static const dim_type dimensionworld
Definition: partitionviewentityset.hh:79
IteratorRange< std::vector< GeometryType >::const_iterator > Types
Definition: partitionviewentityset.hh:64
GV GridView
Definition: partitionviewentityset.hh:46
static const bool conforming
Definition: partitionviewentityset.hh:75
std::size_t size_type
Definition: partitionviewentityset.hh:59
typename GV::Traits::Intersection Intersection
Definition: partitionviewentityset.hh:53
typename GV::Traits::CollectiveCommunication CollectiveCommunication
Definition: partitionviewentityset.hh:57
constexpr static Index invalidIndex()
Definition: partitionviewentityset.hh:70
typename std::decay< P >::type Partitions
Definition: partitionviewentityset.hh:43
static const dim_type dimension
Definition: partitionviewentityset.hh:77
std::bitset< GV::dimension+1 > CodimMask
Definition: partitionviewentityset.hh:66
typename GV::Traits::IndexSet BaseIndexSet
Definition: partitionviewentityset.hh:49
typename Grid::ctype CoordinateField
Definition: partitionviewentityset.hh:68
Definition: partitionviewentityset.hh:83
typename GV::template Codim< codim >::Entity Entity
Definition: partitionviewentityset.hh:87
typename GV::template Codim< codim >::Geometry Geometry
Definition: partitionviewentityset.hh:89
typename GV::template Codim< codim >::template Partition< Partitions::partitionIterator()>::Iterator Iterator
Definition: partitionviewentityset.hh:85
typename GV::template Codim< codim >::LocalGeometry LocalGeometry
Definition: partitionviewentityset.hh:91
Definition: partitionviewentityset.hh:95
typename GV::template Codim< codim >::template Partition< pitype >::Iterator Iterator
Definition: partitionviewentityset.hh:97
Definition: partitionviewentityset.hh:311
size_type size(GeometryType gt) const
Definition: partitionviewentityset.hh:388
bool contains(const GeometryType &gt) const
Definition: partitionviewentityset.hh:414
CodimMask _wanted_codims
Definition: partitionviewentityset.hh:474
GV _gv
Definition: partitionviewentityset.hh:472
typename Traits::dim_type dim_type
Definition: partitionviewentityset.hh:325
const GridView & gridView() const
Definition: partitionviewentityset.hh:442
constexpr static Index invalidIndex()
Definition: partitionviewentityset.hh:332
typename Traits::size_type size_type
Definition: partitionviewentityset.hh:324
typename Traits::Partitions Partitions
Definition: partitionviewentityset.hh:320
bool needsUpdate() const
Definition: partitionviewentityset.hh:447
Types types() const
Definition: partitionviewentityset.hh:430
typename Traits::CodimMask CodimMask
Definition: partitionviewentityset.hh:328
bool _needs_update
Definition: partitionviewentityset.hh:473
size_type size(dim_type codim) const
Definition: partitionviewentityset.hh:395
PartitionViewEntitySetIndexSetBase(const PartitionViewEntitySetIndexSetBase &)=delete
typename Traits::BaseIndexSet BaseIndexSet
Definition: partitionviewentityset.hh:323
void removeCodim(dim_type codim)
Definition: partitionviewentityset.hh:466
void reset()
Definition: partitionviewentityset.hh:454
std::array< size_type, GlobalGeometryTypeIndex::size(GV::dimension)+1 > _mapped_gt_offsets
Definition: partitionviewentityset.hh:478
const BaseIndexSet & baseIndexSet() const
Definition: partitionviewentityset.hh:419
PartitionViewEntitySetIndexSetBase & operator=(const PartitionViewEntitySetIndexSetBase &)=delete
void addCodim(dim_type codim)
Definition: partitionviewentityset.hh:460
CodimMask _active_codims
Definition: partitionviewentityset.hh:476
bool update(bool force)
Definition: partitionviewentityset.hh:346
std::bitset< GlobalGeometryTypeIndex::size(GV::dimension)> _active_geometry_types
Definition: partitionviewentityset.hh:475
PartitionViewEntitySetIndexSetBase(const GV &gv, CodimMask wanted_codims)
Definition: partitionviewentityset.hh:436
typename Traits::GridView GridView
Definition: partitionviewentityset.hh:322
typename Traits::Index Index
Definition: partitionviewentityset.hh:326
typename Traits::Types Types
Definition: partitionviewentityset.hh:327
typename Traits::Grid Grid
Definition: partitionviewentityset.hh:321
typename Traits::template Codim< codim > Codim
Definition: partitionviewentityset.hh:338
Types types(dim_type codim) const
Definition: partitionviewentityset.hh:424
bool contains(const Entity &e) const
Definition: partitionviewentityset.hh:404
std::array< size_type, GlobalGeometryTypeIndex::size(GV::dimension)+1 > _gt_offsets
Definition: partitionviewentityset.hh:477
bool contains(dim_type codim) const
Definition: partitionviewentityset.hh:409
Index IndexType
Definition: partitionviewentityset.hh:330
typename Traits::dim_type dim_type
Definition: partitionviewentityset.hh:325
typename Traits::size_type size_type
Definition: partitionviewentityset.hh:324
typename Traits::Partitions Partitions
Definition: partitionviewentityset.hh:320
PartitionViewEntitySetIndexSet(const GV &gv, CodimMask wanted_codims, bool initialize=true)
Definition: partitionviewentityset.hh:723
typename Traits::CodimMask CodimMask
Definition: partitionviewentityset.hh:328
Index uniqueSubIndex(const E &e, size_type i, dim_type codim) const
Definition: partitionviewentityset.hh:716
Index subIndex(const E &e, size_type i, dim_type codim) const
Definition: partitionviewentityset.hh:706
typename Traits::Index Index
Definition: partitionviewentityset.hh:326
Index uniqueIndex(const E &e) const
Definition: partitionviewentityset.hh:699
Index index(const E &e) const
Definition: partitionviewentityset.hh:692