Loading [MathJax]/extensions/tex2jax.js

DUNE MultiDomainGrid (2.8)

subdomaingrid.hh
1#ifndef DUNE_MULTIDOMAINGRID_SUBDOMAINGRID_HH
2#define DUNE_MULTIDOMAINGRID_SUBDOMAINGRID_HH
3
4#include <memory>
5#include <string>
6
7#include <dune/common/exceptions.hh>
8
9#include <dune/grid/multidomaingrid/hostgridaccessor.hh>
10#include <dune/grid/multidomaingrid/subdomainset.hh>
11
12#include <dune/grid/multidomaingrid/subdomaingrid/geometry.hh>
13#include <dune/grid/multidomaingrid/subdomaingrid/localgeometry.hh>
14#include <dune/grid/multidomaingrid/subdomaingrid/entity.hh>
15#include <dune/grid/multidomaingrid/subdomaingrid/iterator.hh>
16#include <dune/grid/multidomaingrid/subdomaingrid/hierarchiciterator.hh>
17#include <dune/grid/multidomaingrid/subdomaingrid/intersection.hh>
18#include <dune/grid/multidomaingrid/subdomaingrid/intersectioniterator.hh>
19#include <dune/grid/multidomaingrid/subdomaingrid/idsets.hh>
20#include <dune/grid/multidomaingrid/subdomaingrid/indexsets.hh>
21#include <dune/grid/multidomaingrid/subdomaingrid/gridview.hh>
22
23
24namespace Dune {
25
26namespace mdgrid {
27
28
29// forward declaration in correct namespace
30template<typename,typename>
31class MultiDomainGrid;
32
33namespace subdomain {
34
35template<typename MDGrid>
36class SubDomainGrid;
37
38template<typename MDGrid>
39struct SubDomainGridFamily {
40
41private:
42
43 static const int dim = MDGrid::dimension;
44 static const int dimw = MDGrid::dimensionworld;
45
46public:
47
48 struct Traits
49 {
51 using Grid = SubDomainGrid<MDGrid>;
52
53
54 using LeafIntersection = Dune::Intersection<
55 const Grid,
56 IntersectionWrapper<
57 const Grid,
58 IndexSetWrapper<
59 const Grid,
60 typename MDGrid::LeafIndexSetImp
61 >,
62 typename MDGrid::LeafGridView::Intersection
63 >
64 >;
65
66 using LevelIntersection = Dune::Intersection<
67 const Grid,
68 IntersectionWrapper<
69 const Grid,
70 IndexSetWrapper<
71 const Grid,
72 typename MDGrid::LevelIndexSetImp
73 >,
74 typename MDGrid::LevelGridView::Intersection
75 >
76 >;
77
78 using LeafIntersectionIterator = Dune::IntersectionIterator<
79 const Grid,
80 IntersectionIteratorWrapper<
81 const Grid,
82 IndexSetWrapper<
83 const Grid,
84 typename MDGrid::LeafIndexSetImp
85 >,
86 typename MDGrid::LeafGridView::IntersectionIterator
87 >,
88 IntersectionWrapper<
89 const Grid,
90 IndexSetWrapper<
91 const Grid,
92 typename MDGrid::LeafIndexSetImp
93 >,
94 typename MDGrid::LeafGridView::Intersection
95 >
96 >;
97
98 using LevelIntersectionIterator = Dune::IntersectionIterator<
99 const Grid,
100 IntersectionIteratorWrapper<
101 const Grid,
102 IndexSetWrapper<
103 const Grid,
104 typename MDGrid::LevelIndexSetImp
105 >,
106 typename MDGrid::LevelGridView::IntersectionIterator
107 >,
108 IntersectionWrapper<
109 const Grid,
110 IndexSetWrapper<
111 const Grid,
112 typename MDGrid::LevelIndexSetImp
113 >,
114 typename MDGrid::LevelGridView::Intersection
115 >
116 >;
117
118 using HierarchicIterator = Dune::EntityIterator< 0, const Grid, HierarchicIteratorWrapper< const Grid > >;
119
120 using LevelGridView = Dune::GridView<LevelGridViewTraits<const Grid>>;
121 using LeafGridView = Dune::GridView<LeafGridViewTraits<const Grid>>;
122
123 template <int cd>
124 struct Codim
125 {
126
127 using Geometry = Dune::Geometry<dim-cd, dimw, const Grid, GeometryWrapper>;
128 using LocalGeometry = Dune::Geometry<dim-cd, dim, const Grid, LocalGeometryWrapper>;
129
130 using Entity = Dune::Entity<cd, dim, const Grid, EntityWrapper>;
131
132 using EntitySeed = EntitySeedWrapper<typename MDGrid::HostGrid::template Codim<cd>::EntitySeed>;
133
134 template <PartitionIteratorType pitype>
135 struct Partition
136 {
137
138 using LevelIterator = Dune::EntityIterator<
139 cd,
140 const Grid,
141 IteratorWrapper<
142 typename Traits::LevelGridView,
143 typename MDGrid::LevelGridView::template Codim<cd>::template Partition<pitype>::Iterator,
144 cd,
145 pitype,
146 const Grid
147 >
148 >;
149
150 using LeafIterator = Dune::EntityIterator<
151 cd,
152 const Grid,
153 IteratorWrapper<
154 typename Traits::LeafGridView,
155 typename MDGrid::LeafGridView::template Codim<cd>::template Partition<pitype>::Iterator,
156 cd,
157 pitype,
158 const Grid
159 >
160 >;
161 };
162
163 using LeafIterator = typename Partition< All_Partition >::LeafIterator;
164 using LevelIterator = typename Partition< All_Partition >::LevelIterator;
165
166 private:
167 friend class Dune::Entity<cd, dim, const Grid, EntityWrapper>;
168
169 };
170
171 using LevelIndexSet = IndexSetWrapper<const Grid, typename MDGrid::LevelIndexSetImp>;
172 using LeafIndexSet = IndexSetWrapper<const Grid, typename MDGrid::LeafIndexSetImp>;
173
174 using GlobalIdSet = IdSet<
175 const Grid,
176 IdSetWrapper<
177 const Grid,
178 typename MDGrid::HostGrid::Traits::GlobalIdSet
179 >,
180 typename MDGrid::HostGrid::Traits::GlobalIdSet::IdType
181 >;
182
183 using LocalIdSet = IdSet<
184 const Grid,
185 IdSetWrapper<
186 const Grid,
187 typename MDGrid::HostGrid::Traits::LocalIdSet
188 >,
189 typename MDGrid::HostGrid::Traits::LocalIdSet::IdType
190 >;
191
192 using CollectiveCommunication = typename MDGrid::CollectiveCommunication;
193 };
194
195};
196
197
198template<typename MDGrid>
199class SubDomainGrid :
200 public GridDefaultImplementation<MDGrid::dimension,
201 MDGrid::dimensionworld,
202 typename MDGrid::ctype,
203 SubDomainGridFamily<MDGrid> > {
204
205 template<typename,typename>
206 friend class ::Dune::mdgrid::MultiDomainGrid;
207
208 template<int codim, int dim, typename GridImp>
209 friend class EntityWrapperBase;
210
211 template<int codim, int dim, typename GridImp>
212 friend class EntityWrapper;
213
214 template<typename, typename, int codim, PartitionIteratorType pitype, typename GridImp>
215 friend class IteratorWrapper;
216
217 template<typename GridImp>
218 friend class HierarchicIteratorWrapper;
219
220 template<int mydim, int coorddim, typename GridImp>
221 friend class GeometryWrapper;
222
223 template<int mydim, int coorddim, typename GridImp>
224 friend class LocalGeometryWrapper;
225
226 template<typename GridImp, typename WrappedIndexSet>
227 friend class IndexSetWrapper;
228
229 template<typename GridImp, typename WrappedIdSet>
230 friend class IdSetWrapper;
231
232 template<typename GridImp>
233 friend struct ::Dune::mdgrid::detail::HostGridAccessor;
234
235 template<typename,typename,typename>
236 friend class IntersectionIteratorWrapper;
237
238 template<typename,typename,typename>
239 friend class IntersectionWrapper;
240
241 template<typename>
242 friend class LevelGridView;
243
244 template<typename>
245 friend class LeafGridView;
246
247 typedef GridDefaultImplementation<MDGrid::dimension,
248 MDGrid::dimensionworld,
249 typename MDGrid::ctype,
250 SubDomainGridFamily<MDGrid>
251 > BaseT;
252
253 using GridImp = SubDomainGrid<MDGrid>;
254
255public:
256
257 using MultiDomainGrid = MDGrid;
258
259 using HostGrid = typename MDGrid::HostGrid;
260
261private:
262
263 typedef IndexSetWrapper<const SubDomainGrid<MDGrid>, typename MDGrid::LevelIndexSetImp> LevelIndexSetImp;
264
265 typedef IndexSetWrapper<const SubDomainGrid<MDGrid>, typename MDGrid::LeafIndexSetImp> LeafIndexSetImp;
266
267 typedef IdSetWrapper<const SubDomainGrid<MDGrid>, typename HostGrid::Traits::GlobalIdSet> GlobalIdSetImp;
268
269 typedef IdSetWrapper<const SubDomainGrid<MDGrid>, typename HostGrid::Traits::LocalIdSet> LocalIdSetImp;
270
271public:
272
273 typedef SubDomainGridFamily<MDGrid> GridFamily;
274 typedef typename GridFamily::Traits Traits;
275
277 typedef typename MDGrid::ctype ctype;
278
280 typedef typename MDGrid::SubDomainIndex SubDomainIndex;
281
282 enum IntersectionType { neighbor, foreign, boundary, processor };
283
284 using BaseT::dimension;
285 using BaseT::dimensionworld;
286
289
290 template<typename EntitySeed>
291 typename Traits::template Codim<EntitySeed::codimension>::Entity
292 entity(const EntitySeed& entitySeed) const
293 {
294 return
295 EntityWrapper<EntitySeed::codimension,dimension,const GridImp>(
296 this,
297 typename MDGrid::template Codim<EntitySeed::codimension>::Entity(
298 _grid.entity(entitySeed)
299 )
300 );
301 }
302
303 int maxLevel() const {
304 return _grid.maxLevel();
305 }
306
307 template<int codim>
308 typename Traits::template Codim<codim>::LevelIterator lbegin(int level) const {
309 return IteratorWrapper<
310 typename Traits::LevelGridView,
311 typename MultiDomainGrid::LevelGridView::template Codim<codim>::template Partition<All_Partition>::Iterator,
312 codim,
313 All_Partition,
314 const GridImp>(
315 this,
316 &this->levelGridView(level).indexSet(),
317 _grid.levelGridView(level).template begin<codim>(),
318 _grid.levelGridView(level).template end<codim>()
319 );
320 }
321
322 template<int codim>
323 typename Traits::template Codim<codim>::LevelIterator lend(int level) const {
324 return IteratorWrapper<
325 typename Traits::LevelGridView,
326 typename MultiDomainGrid::LevelGridView::template Codim<codim>::template Partition<All_Partition>::Iterator,
327 codim,
328 All_Partition,
329 const GridImp>(
330 this,
331 &this->levelGridView(level).indexSet(),
332 _grid.levelGridView(level).template end<codim>(),
333 _grid.levelGridView(level).template end<codim>()
334 );
335 }
336
337 template<int codim, PartitionIteratorType pitype>
338 typename Traits::template Codim<codim>::template Partition<pitype>::LevelIterator lbegin(int level) const {
339 return IteratorWrapper<
340 typename Traits::LevelGridView,
341 typename MultiDomainGrid::LevelGridView::template Codim<codim>::template Partition<pitype>::Iterator,
342 codim,
343 pitype,
344 const GridImp>(
345 this,
346 &this->levelGridView(level).indexSet(),
347 _grid.levelGridView(level).template begin<codim,pitype>(),
348 _grid.levelGridView(level).template end<codim,pitype>()
349 );
350 }
351
352 template<int codim, PartitionIteratorType pitype>
353 typename Traits::template Codim<codim>::template Partition<pitype>::LevelIterator lend(int level) const {
354 return IteratorWrapper<
355 typename Traits::LevelGridView,
356 typename MultiDomainGrid::LevelGridView::template Codim<codim>::template Partition<pitype>::Iterator,
357 codim,
358 pitype,
359 const GridImp>(
360 this,
361 &this->levelGridView(level).indexSet(),
362 _grid.levelGridView(level).template end<codim,pitype>(),
363 _grid.levelGridView(level).template end<codim,pitype>()
364 );
365 }
366
367 template<int codim>
368 typename Traits::template Codim<codim>::LeafIterator leafbegin() const {
369 return IteratorWrapper<
370 typename Traits::LeafGridView,
371 typename MultiDomainGrid::LeafGridView::template Codim<codim>::template Partition<All_Partition>::Iterator,
372 codim,
373 All_Partition,
374 const GridImp>(
375 this,
376 &this->leafGridView().indexSet(),
377 _grid.leafGridView().template begin<codim>(),
378 _grid.leafGridView().template end<codim>()
379 );
380 }
381
382 template<int codim>
383 typename Traits::template Codim<codim>::LeafIterator leafend() const {
384 return IteratorWrapper<
385 typename Traits::LeafGridView,
386 typename MultiDomainGrid::LeafGridView::template Codim<codim>::template Partition<All_Partition>::Iterator,
387 codim,
388 All_Partition,
389 const GridImp>(
390 this,
391 &this->leafGridView().indexSet(),
392 _grid.leafGridView().template end<codim>(),
393 _grid.leafGridView().template end<codim>()
394 );
395 }
396
397 template<int codim, PartitionIteratorType pitype>
398 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator leafbegin() const {
399 return IteratorWrapper<
400 typename Traits::LeafGridView,
401 typename MultiDomainGrid::LeafGridView::template Codim<codim>::template Partition<pitype>::Iterator,
402 codim,
403 pitype,
404 const GridImp>(
405 this,
406 &this->leafGridView().indexSet(),
407 _grid.leafGridView().template begin<codim,pitype>(),
408 _grid.leafGridView().template end<codim,pitype>()
409 );
410 }
411
412 template<int codim, PartitionIteratorType pitype>
413 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator leafend() const {
414 return IteratorWrapper<
415 typename Traits::LeafGridView,
416 typename MultiDomainGrid::LeafGridView::template Codim<codim>::template Partition<pitype>::Iterator,
417 codim,
418 pitype,
419 const GridImp>(
420 this,
421 &this->leafGridView().indexSet(),
422 _grid.leafGridView().template end<codim,pitype>(),
423 _grid.leafGridView().template end<codim,pitype>()
424 );
425 }
426
427 int size(int level, int codim) const {
428 assert(level <= maxLevel());
429 return _levelIndexSets[level]->size(codim);
430 }
431
432 int size(int codim) const {
433 return _leafIndexSet.size(codim);
434 }
435
436 int size(int level, GeometryType type) const {
437 assert(level <= maxLevel());
438 return _levelIndexSets[level]->size(type);
439 }
440
441 int size(GeometryType type) const {
442 // TODO: check this (perhaps return sum over levelindexsets?)
443 return _leafIndexSet.size(type);
444 }
445
446 const typename Traits::GlobalIdSet& globalIdSet() const {
447 return _globalIdSet;
448 }
449
450 const typename Traits::LocalIdSet& localIdSet() const {
451 return _localIdSet;
452 }
453
454 const typename Traits::LevelIndexSet& levelIndexSet(int level) const {
455 if (!_grid.supportLevelIndexSets()) {
456 DUNE_THROW(GridError,"level index set support not enabled for this grid");
457 }
458 assert(level <= maxLevel());
459 assert(_levelIndexSets[level]);
460 return *_levelIndexSets[level];
461 }
462
463 const typename Traits::LeafIndexSet& leafIndexSet() const {
464 return _leafIndexSet;
465 }
466
468
474 void globalRefine(int refCount) {
475 DUNE_THROW(NotImplemented,"grid modification only allowed on the MultiDomainGrid");
476 }
477
479
489 bool mark(int refCount, const typename Traits::template Codim<0>::Entity& e) {
490 return _grid.mark(refCount,multiDomainEntity(e));
491 }
492
494
501 int getMark(const typename Traits::template Codim<0>::Entity& e) {
502 return _grid.getMark(multiDomainEntity(e));
503 }
504
506
512 bool preAdapt() {
513 DUNE_THROW(NotImplemented,"grid modification only allowed on the MultiDomainGrid");
514 }
515
517
523 bool adapt() {
524 DUNE_THROW(NotImplemented,"grid modification only allowed on the MultiDomainGrid");
525 }
526
528
534 void postAdapt() {
535 DUNE_THROW(NotImplemented,"grid modification only allowed on the MultiDomainGrid");
536 }
537
538 int overlapSize(int level, int codim) const {
539 return _grid.overlapSize(level,codim);
540 }
541
542 int overlapSize(int codim) const {
543 return _grid.overlapSize(codim);
544 }
545
546 int ghostSize(int level, int codim) const {
547 return _grid.ghostSize(level,codim);
548 }
549
550 int ghostSize(int codim) const {
551 return _grid.ghostSize(codim);
552 }
553
554 const typename Traits::CollectiveCommunication& comm() const {
555 return _grid.comm();
556 }
557
558 template<typename DataHandleImp, typename DataTypeImp>
559 void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> &data,
560 InterfaceType iftype,
561 CommunicationDirection dir,
562 int level) const
563 {
564 DataHandleWrapper<CommDataHandleIF<DataHandleImp,DataTypeImp> > datahandle(data,*this);
565 _grid._hostGrid.levelGridView(level).communicate(datahandle,iftype,dir);
566 }
567
568 template<typename DataHandleImp, typename DataTypeImp>
569 void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> &data,
570 InterfaceType iftype,
571 CommunicationDirection dir) const
572 {
573 DataHandleWrapper<CommDataHandleIF<DataHandleImp,DataTypeImp> > datahandle(data,*this);
574 _grid._hostGrid.leafGridView().communicate(datahandle,iftype,dir);
575 }
576
577 size_t numBoundarySegments() const
578 {
579 return _grid.numBoundarySegments();
580 }
581
585 const MDGrid& multiDomainGrid() const {
586 return _grid;
587 }
588
590 SubDomainIndex domain() const {
591 return _subDomain;
592 }
593
594 void update() {
595 if (_grid.supportLevelIndexSets()) {
596 while (_levelIndexSets.size() <= static_cast<std::size_t>(maxLevel())) {
597 _levelIndexSets.push_back(std::make_shared<LevelIndexSetImp>(*this,_grid.levelIndexSet(_levelIndexSets.size())));
598 }
599 }
600 }
601
602 bool operator==(const SubDomainGrid& rhs) const {
603 return (&_grid == &rhs._grid && _subDomain == rhs._subDomain);
604 }
605
608
609 template<typename EntityType>
610 typename Traits::template Codim<EntityType::codimension>::Entity subDomainEntity(const EntityType& mdEntity) const {
611 return EntityWrapper<EntityType::codimension,dimension,const GridImp>(this,mdEntity);
612 }
613
615 template <
616 class EntityType,
617 std::enable_if_t<std::is_same_v<typename MDGrid::Traits::template Codim<EntityType::codimension>::Entity,EntityType>, int> = 0>
618 static const EntityType&
619 multiDomainEntity(const EntityType &e) {
620 return e;
621 }
622
623 template <
624 class EntityType,
625 std::enable_if_t<!std::is_same_v<typename MDGrid::Traits::template Codim<EntityType::codimension>::Entity,EntityType>,int> = 0>
626 static const typename MDGrid::Traits::template Codim<EntityType::codimension>::Entity &
627 multiDomainEntity(const EntityType &e) {
628 return e.impl().multiDomainEntity();
629 }
630
631 template<typename EntityType>
632 static const typename MDGrid::template HostEntity<EntityType>::type& hostEntity(const EntityType& e) {
633 return e.impl().hostEntity();
634 }
635
636 static const auto& multiDomainIntersection(const typename Traits::LeafIntersection& is) {
637 return is.impl().multiDomainIntersection();
638 }
639
640 static const auto& multiDomainIntersection(const typename Traits::LevelIntersection& is) {
641 return is.impl().multiDomainIntersection();
642 }
643
646 typename Traits::LeafIntersectionIterator subDomainIntersectionIterator(const typename MDGrid::LeafSubDomainInterfaceIterator it) const {
647 assert(_subDomain == it->subDomain1() || _subDomain == it->subDomain2());
648 if (_subDomain == it->subDomain1())
649 return IntersectionIteratorWrapper<
650 const GridImp,
651 typename GridImp::LeafGridView::IndexSet,
652 typename MDGrid::LeafGridView::IntersectionIterator
653 >(
654 &this->leafGridView().indexSet(),
655 it->firstMultiDomainIntersectionIterator()
656 );
657 else
658 return IntersectionIteratorWrapper<
659 const GridImp,
660 typename GridImp::LeafGridView::IndexSet,
661 typename MDGrid::LeafGridView::IntersectionIterator
662 >(
663 &this->leafGridView().indexSet(),
664 it->secondMultiDomainIntersectionIterator()
665 );
666 }
667
668 typename Traits::LevelIntersectionIterator subDomainIntersectionIterator(const typename MDGrid::LevelSubDomainInterfaceIterator it) const {
669 assert(_subDomain == it->subDomain1() || _subDomain == it->subDomain2());
670 if (_subDomain == it->subDomain1())
671 return IntersectionIteratorWrapper<
672 const GridImp,
673 typename GridImp::LevelGridView::IndexSet,
674 typename MDGrid::LevelGridView::IntersectionIterator
675 >(
676 &this->levelGridView(it->firstMultiDomainIntersectionIterator()->inside().level()).indexSet(),
677 it->firstMultiDomainIntersectionIterator()
678 );
679 else
680 return IntersectionIteratorWrapper<
681 const GridImp,
682 typename GridImp::LevelGridView::IndexSet,
683 typename MDGrid::LevelGridView::IntersectionIterator
684 >(
685 &this->levelGridView(it->secondMultiDomainIntersectionIterator()->inside().level()).indexSet(),
686 it->secondMultiDomainIntersectionIterator()
687 );
688 }
689
690 template<typename Intersection>
691 IntersectionType intersectionType(const Intersection& intersection) const {
692 return intersection.impl().intersectionType();
693 }
694
695private:
696
697 MDGrid& _grid;
698 SubDomainIndex _subDomain;
699 GlobalIdSetImp _globalIdSet;
700 LocalIdSetImp _localIdSet;
701 LeafIndexSetImp _leafIndexSet;
702 std::vector<std::shared_ptr<LevelIndexSetImp> > _levelIndexSets;
703
704 SubDomainGrid(MDGrid& grid, SubDomainIndex subDomain) :
705 _grid(grid),
706 _subDomain(subDomain),
707 _globalIdSet(*this,grid._hostGrid.globalIdSet()),
708 _localIdSet(*this,grid._hostGrid.localIdSet()),
709 _leafIndexSet(*this,grid.leafIndexSet())
710 {
711 update();
712 }
713
714 template<typename EntityType>
715 bool containsMultiDomainEntity(const EntityType& e) const {
716 if (_grid.supportLevelIndexSets())
717 return levelIndexSet(e.level()).containsMultiDomainEntity(e);
718 else
719 return leafIndexSet().containsMultiDomainEntity(e);
720 }
721
722 template<typename EntityType>
723 bool containsHostEntity(const EntityType& e) const {
724 if (_grid.supportLevelIndexSets())
725 return levelIndexSet(e.level()).containsHostEntity(e);
726 else
727 return leafIndexSet().containsHostEntity(e);
728 }
729
730 SubDomainGrid(const SubDomainGrid& rv);
731 SubDomainGrid& operator=(const SubDomainGrid& rv);
732
733
734 template<typename Impl>
735 struct DataHandleWrapper
736 : public Dune::CommDataHandleIF<DataHandleWrapper<Impl>,
737 typename Impl::DataType
738 >
739 {
740
741 bool contains(int dim, int codim) const
742 {
743 return _impl.contains(dim,codim); // TODO: check if codim supported
744 }
745
746 bool fixedSize(int dim, int codim) const
747 {
748 //_impl.fixedSize(dim,codim); // TODO: warning if true?
749 return false;
750 }
751
752 template<typename Entity>
753 std::size_t size(const Entity& e) const
754 {
755 if (_grid.containsHostEntity(e))
756 return _impl.size(_grid.subDomainEntity(_grid._grid.wrapHostEntity(e)));
757 else
758 return 0;
759 }
760
761 template<typename MessageBufferImp, typename Entity>
762 void gather(MessageBufferImp& buf, const Entity& e) const
763 {
764 if (_grid.containsHostEntity(e))
765 _impl.gather(buf,_grid.subDomainEntity(_grid._grid.wrapHostEntity(e)));
766 }
767
768 template<typename MessageBufferImp, typename Entity>
769 void scatter(MessageBufferImp& buf, const Entity& e, std::size_t n)
770 {
771 if (_grid.containsHostEntity(e))
772 _impl.scatter(buf,_grid.subDomainEntity(_grid._grid.wrapHostEntity(e)),n);
773 }
774
775 DataHandleWrapper(Impl& impl, const SubDomainGrid<MDGrid>& grid)
776 : _impl(impl)
777 , _grid(grid)
778 {}
779
780 Impl& _impl;
781 const SubDomainGrid<MDGrid>& _grid;
782
783 };
784
785};
786
787} // namespace subdomain
788
789} // namespace mdgrid
790
791} // namespace Dune
792
793#endif // DUNE_MULTIDOMAINGRID_MULTIDOMAINGRID_HH
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 10, 22:40, 2025)