Dune Core Modules (2.9.0)

grid.hh
1#ifndef DUNE_ALU3DGRIDGRID_HH
2#define DUNE_ALU3DGRIDGRID_HH
3
4//- System includes
5#include <memory>
6#include <vector>
7
8//- Dune includes
13
14#include <dune/geometry/referenceelements.hh>
15
21
22#include <dune/alugrid/common/typetraits.hh>
23
24// bnd projection stuff
25#include <dune/grid/common/boundaryprojection.hh>
26#include <dune/alugrid/common/bndprojection.hh>
27#include <dune/alugrid/common/backuprestore.hh>
28#include <dune/alugrid/common/macrogridview.hh>
29#include <dune/alugrid/common/twists.hh>
30
31//- Local includes
32#include "alu3dinclude.hh"
33#include "topology.hh"
34#include "indexsets.hh"
35#include "datahandle.hh"
36
37#include <dune/alugrid/3d/communication.hh>
38#include <dune/alugrid/3d/gridview.hh>
39
41
42#if ALU3DGRID_PARALLEL
44#else
46#endif
47
48namespace Dune
49{
50 // Forward declarations
51 template<int cd, int dim, class GridImp>
52 class ALU3dGridEntity;
53 template<int cd, PartitionIteratorType pitype, class GridImp >
54 class ALU3dGridLevelIterator;
55 template<int cd, class GridImp >
56 class ALU3dGridEntityPointerBase;
57 template<int cd, class GridImp >
58 class ALU3dGridEntitySeed;
59 template<int cd, class GridImp >
60 class ALU3dGridEntityPointer;
61 template<int mydim, int coorddim, class GridImp>
62 class ALU3dGridGeometry;
63 template<class GridImp>
64 class ALU3dGridHierarchicIterator;
65 template<class GridImp>
66 class ALU3dGridIntersectionIterator;
67 template<class GridImp>
68 class ALU3dGridLevelIntersectionIterator;
69 template<int codim, PartitionIteratorType pitype, class GridImp>
70 class ALU3dGridLeafIterator;
71 template <int mydim, int coorddim, class GridImp>
72 class ALU3dGridMakeableEntity;
73 template <class GridImp>
74 class ALU3dGridFaceGeometryInfo;
75 template< int, int, ALU3dGridElementType, class >
76 class ALU3dGridGlobalIdSet;
77 template< int, int, ALU3dGridElementType, class >
78 class ALU3dGridLocalIdSet;
79 template< int, int, ALU3dGridElementType, class >
80 class ALU3dGridHierarchicIndexSet;
81 template< class >
82 class ALU3dGridFactory;
83 template <class GridImp, class GeometryImp, int nChild>
84 class ALULocalGeometryStorage;
85
86
87
88 // Internal Forward Declarations
89 // -----------------------------
90
91#if ALU3DGRID_PARALLEL
92 template<int dim, int dimworld, ALU3dGridElementType elType, class Comm = ALUGridMPIComm >
93 class ALU3dGrid;
94#else // #if ALU3DGRID_PARALLEL
95 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm = ALUGridNoComm >
96 class ALU3dGrid;
97#endif // #else // #if ALU3DGRID_PARALLEL
98
99
100 // Internal Forward Declarations
101 // -----------------------------
102
103 template < int dim, int dimw, class Comm >
104 struct ALUGridBaseGrid< dim, dimw, cube, Comm >
105 {
106 typedef ALU3dGrid< dim, dimw, hexa, Comm > BaseGrid ;
107 };
108
109 template < int dim, int dimw, class Comm >
110 struct ALUGridBaseGrid< dim, dimw, simplex, Comm >
111 {
112 typedef ALU3dGrid< dim, dimw, tetra, Comm > BaseGrid ;
113 };
114
115
116 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm >
117 struct ALU3dGridCommunications;
118
119 template< int dim, int dimworld, ALU3dGridElementType elType >
120 struct ALU3dGridCommunications< dim, dimworld, elType, ALUGridNoComm >
121 {
122 typedef ALU3dGridLocalIdSet< dim, dimworld, elType, ALUGridNoComm > GlobalIdSet;
123 typedef int GlobalId;
124
125 typedef ALU3DSPACE GitterDuneImpl GitterImplType;
126
127 typedef Dune::Communication< No_Comm > Communication;
128 typedef Communication CollectiveCommunication;
129
130 explicit ALU3dGridCommunications ( ALUGridNoComm comm ) {}
131
132 int nlinks () const { return 0; }
133
134 GitterImplType *createALUGrid ( const std::string &macroName, const ALU3DSPACE ProjectVertexPtrPair& projections,
135 const bool conformingRefinement )
136 {
137 GitterImplType* grid = ( macroName.empty() ) ?
138 new GitterImplType( dim, conformingRefinement ) : new GitterImplType ( dim, conformingRefinement, macroName.c_str(), projections );
139 return grid ;
140 }
141
142 GitterImplType *createALUGrid ( std::istream& stream, const ALU3DSPACE ProjectVertexPtrPair& projection,
143 const bool conformingRefinement )
144 {
145 return new GitterImplType ( dim, conformingRefinement, stream, projection );
146 }
147
148 // ALUGridNoComm casts into No_Comm and MPI_Comm and here the default is MPI_COMM_SELF
149 static ALUGridNoComm defaultComm () { return ALUGridNoComm(); }
150
151 static int getRank ( ALUGridNoComm comm ) { return 0; }
152
153 static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
154 {
155 ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
156 dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF* >( &grid.container() );
157 if( ! builder )
158 DUNE_THROW(InvalidStateException,"dynamic_cast of ALUGrid builder failed");
159 return *builder;
160 }
161
162 static void completeGrid ( GitterImplType &grid ) {}
163
164 void print( std::ostream& out ) const
165 {}
166
167 Communication ccobj_;
168 };
169
170#if ALU3DGRID_PARALLEL
171 template< int dim, int dimworld, ALU3dGridElementType elType >
172 struct ALU3dGridCommunications< dim, dimworld, elType, ALUGridMPIComm >
173 {
174 typedef ALU3dGridGlobalIdSet< dim, dimworld, elType, ALUGridMPIComm > GlobalIdSet;
175 typedef ALUGridId< ALUMacroKey > GlobalId;
176
177 typedef ALU3DSPACE GitterDunePll GitterImplType;
178
179 typedef Dune::Communication< MPI_Comm > Communication;
180 typedef Communication CollectiveCommunication;
181
182 explicit ALU3dGridCommunications ( MPI_Comm comm )
183 : ccobj_( comm ), mpAccess_( comm )
184 {}
185
186 int nlinks () const { return mpAccess_.sendLinks(); }
187
188 GitterImplType *createALUGrid ( const std::string &macroName, const ALU3DSPACE ProjectVertexPtrPair& projections,
189 const bool conformingRefinement )
190 {
191 return new GitterImplType( dim, conformingRefinement, macroName.c_str(), mpAccess_, projections );
192 }
193
194 GitterImplType *createALUGrid ( std::istream& stream, const ALU3DSPACE ProjectVertexPtrPair& projections,
195 const bool conformingRefinement )
196 {
197 return new GitterImplType ( dim, conformingRefinement, stream, mpAccess_, projections );
198 }
199
200 // ALUGridMPIComm casts into MPI_Comm and the default is MPI_COMM_WORLD
201 static ALUGridMPIComm defaultComm () { return ALUGridMPIComm(); }
202
203 static int getRank ( MPI_Comm comm )
204 {
205 int rank = 0;
206 MPI_Comm_rank( comm, &rank );
207 return rank;
208 }
209
210 void print( std::ostream& out ) const
211 {
212 mpAccess_.printLinkage( out );
213 }
214
215 static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
216 {
217 ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
218 dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF* >( &grid.containerPll() );
219 if( ! builder )
220 DUNE_THROW(InvalidStateException,"dynamic_cast of ALUGrid builder failed");
221 return *builder;
222 }
223
224 static void completeGrid ( GitterImplType &grid )
225 {
226 // setup communication patterns
227 grid.notifyMacroGridChanges();
228 // rebuild ghost cells
229 grid.rebuildGhostCells();
230 }
231
232 Communication ccobj_;
233 ALU3DSPACE MpAccessMPI mpAccess_;
234 };
235#endif // #if ALU3DGRID_PARALLEL
236
237
238
239 // ALU3dGridTwist
240 // --------------
241
242 template< int dim, ALU3dGridElementType elType, int codim >
243 struct ALU3dGridTwists;
244
245 template<int dim>
246 struct ALU3dGridTwists< dim, tetra, 0 >
247 {
248 static const unsigned int topoId = GeometryTypes::simplex(dim).id();
249 typedef TrivialTwists< topoId, dim > Type;
250 };
251
252 template<int dim>
253 struct ALU3dGridTwists< dim, hexa, 0 >
254 {
255 static const unsigned int topoId = GeometryTypes::cube(dim).id();
256 typedef TrivialTwists< topoId, dim > Type;
257 };
258
259 template< int dim, ALU3dGridElementType elType >
260 struct ALU3dGridTwists< dim, elType, 1 >
261 {
262 typedef ALUTwists< dim == 2 ? 2 : ElementTopologyMapping< elType >::numVerticesPerFace, dim-1 > Type;
263 };
264
265 template< ALU3dGridElementType elType >
266 struct ALU3dGridTwists< 3, elType, 2 >
267 {
268 typedef ALUTwists< 2, 1 > Type;
269 };
270
271 template< ALU3dGridElementType elType >
272 struct ALU3dGridTwists< 2, elType, 2 >
273 {
274 typedef TrivialTwists< 0u, 0 > Type;
275 };
276
277 template< int dim, ALU3dGridElementType elType >
278 struct ALU3dGridTwists< dim, elType, 3 >
279 {
280 typedef TrivialTwists< 0u, 0 > Type;
281 };
282
283
284
285 // ALU3dGridFamily
286 // ---------------
287
288 template< int dimG, int dimW, ALU3dGridElementType elType, class Comm >
289 struct ALU3dGridFamily
290 {
291 static const int dim = dimG;
292 static const int dimworld = dimW;
293
294 typedef ALU3dGrid< dim, dimworld, elType, Comm > GridImp;
295 typedef ALU3dGridFamily< dim, dimworld, elType, Comm > GridFamily;
296
298 typedef ALU3dGridLocalIdSet< dim, dimworld, elType, Comm > LocalIdSetImp;
299
301 typedef typename ALU3dGridCommunications< dim, dimworld, elType, Comm >::GlobalIdSet GlobalIdSetImp;
302
304 typedef typename ALU3dGridCommunications< dim, dimworld, elType, Comm >::GlobalId GlobalIdType;
305
307 typedef int LocalIdType;
308
309 struct Traits
310 {
312 typedef typename GridFamily::LocalIdType LocalIdType;
313
315 typedef typename GridFamily::GlobalIdType GlobalIdType;
316
317 typedef typename GridFamily::GridImp Grid;
318
321
322 typedef Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorWrapper< const Grid >, LeafIntersectionWrapper< const Grid > > IntersectionIterator;
323
324 typedef Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorWrapper< const Grid >, LeafIntersectionWrapper< const Grid > > LeafIntersectionIterator;
325 typedef Dune::IntersectionIterator< const Grid, LevelIntersectionIteratorWrapper< const Grid >, LevelIntersectionWrapper< const Grid > > LevelIntersectionIterator;
326
328
329 typedef DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType;
330 typedef std::vector< const DuneBoundaryProjectionType * > DuneBoundaryProjectionVector;
331
332 template< int cd >
333 struct Codim
334 {
335 typedef typename ALU3dGridTwists< dim, elType, cd >::Type Twists;
336 typedef typename Twists::Twist Twist;
337
338 // IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
339 typedef ALU3dGridGeometry< dim-cd, dimworld, const Grid > GeometryImpl;
340 typedef ALU3dGridGeometry< dim-cd, dim, const Grid > LocalGeometryImpl;
341 typedef Dune::Geometry< dim-cd, dimworld, const Grid, ALU3dGridGeometry > Geometry;
342 typedef Dune::Geometry< dim-cd, dim, const Grid, ALU3dGridGeometry > LocalGeometry;
343
344 typedef ALU3dGridEntity< cd, dim, const Grid > EntityImp;
346
347 // minimal information to generate entities
348 typedef ALU3dGridEntitySeed< cd , const Grid> EntitySeed ;
349
350 template< PartitionIteratorType pitype >
351 struct Partition
352 {
355 }; // struct Partition
356
357 typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
358 typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
359 }; // struct Codim
360
361 template< PartitionIteratorType pitype >
362 struct Partition
363 {
366 typedef Dune::MacroGridView<const Grid, pitype> MacroGridView;
367 }; // struct Partition
368
369 typedef typename Partition< All_Partition > :: MacroGridView MacroGridView;
370 typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
371 typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
372
374 typedef DefaultIndexSet< Grid, typename Codim< 0 > :: LevelIterator > LevelIndexSetImp;
375
377 typedef DefaultIndexSet< Grid, typename Codim< 0 > :: LeafIterator > LeafIndexSetImp;
378
379 typedef IndexSet< Grid, LevelIndexSetImp > LevelIndexSet;
380 typedef IndexSet< Grid, LeafIndexSetImp > LeafIndexSet;
381 typedef IdSet< Grid, LocalIdSetImp, LocalIdType > LocalIdSet;
382 typedef IdSet< Grid, GlobalIdSetImp, GlobalIdType > GlobalIdSet;
383
385 typedef typename ALU3dGridCommunications< dim, dimworld, elType, Comm >::Communication Communication;
386
387 [[deprecated("Use Communication instead!")]]
388 typedef Communication CollectiveCommunication;
389 }; // struct Traits
390
392 typedef typename Traits :: LevelIndexSetImp LevelIndexSetImp;
393
395 typedef typename Traits :: LeafIndexSetImp LeafIndexSetImp;
396
397 }; // struct ALU3dGridFamily
398
399
400
401 //**********************************************************************
402 //
403 // --ALU3dGrid
404 // --Grid
405 //
406 //**********************************************************************
407
428 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm >
430 : public GridDefaultImplementation< dim, dimworld, alu3d_ctype,
431 ALU3dGridFamily< dim, dimworld, elType, Comm > >,
432 public HasObjectStream,
434 {
437
438 // for compatibility: MyType := ThisType
439 typedef ThisType MyType;
440
441 // friend declarations
442 friend class ALU3dGridEntity< 0, dim, const ThisType>;
443 friend class ALU3dGridEntity< 1, dim, const ThisType>;
444 friend class ALU3dGridEntity< 2, dim, const ThisType>;
445 friend class ALU3dGridEntity< dim, dim, const ThisType>;
446
448
449 friend class ALU3dGridEntityPointerBase< 0, const ThisType >;
450 friend class ALU3dGridEntityPointerBase< 1, const ThisType >;
451 friend class ALU3dGridEntityPointerBase< 2, const ThisType >;
452 friend class ALU3dGridEntityPointerBase< dim, const ThisType >;
453
454 friend class ALU3dGridEntityPointer< 0, const ThisType >;
455 friend class ALU3dGridEntityPointer< 1, const ThisType >;
456 friend class ALU3dGridEntityPointer< 2, const ThisType >;
457 friend class ALU3dGridEntityPointer< dim, const ThisType >;
458
459 friend class ALU3dGridIntersectionIterator< const ThisType >;
460 friend class ALU3dGridHierarchicIterator< const ThisType >;
461
462 friend class ALU3dGridHierarchicIndexSet< dim, dimworld, elType, Comm >;
463 friend class ALU3dGridGlobalIdSet< dim, dimworld, elType, Comm >;
464 friend class ALU3dGridLocalIdSet< dim, dimworld, elType, Comm >;
465
466 // new intersection iterator is a wrapper which get itersectioniteratoimp as pointers
467 public:
472 typedef ALU3dGridLevelIntersectionIterator<const ThisType>
473 LevelIntersectionIteratorImp;
474
476 friend class IntersectionIteratorWrapper < const ThisType, LevelIntersectionIteratorImp > ;
477 friend class LeafIntersectionIteratorWrapper < const ThisType > ;
478 friend class LevelIntersectionIteratorWrapper< const ThisType > ;
479
480 //**********************************************************
481 // The Interface Methods
482 //**********************************************************
483 public:
484 enum { refineStepsForHalf = 1 };
485
486 static const ALU3dGridElementType elementType = elType;
487
488 typedef typename ALU3DSPACE GatherScatterType::ObjectStreamType ObjectStreamType;
489 typedef ObjectStreamType InStreamType ;
490 typedef ObjectStreamType OutStreamType ;
491
492 typedef ALU3dGridFamily< dim, dimworld, elType, Comm > GridFamily;
493 typedef typename GridFamily::Traits Traits;
494
495 static const int dimension = BaseType::dimension;
496 static const int dimensionworld = BaseType::dimensionworld;
497
498 template< int codim >
499 struct Codim
500 : public BaseType::template Codim< codim >
501 {
502 typedef typename Traits::template Codim< codim >::EntityImp EntityImp;
503 typedef typename Traits::template Codim< codim >::Twists Twists;
504 typedef typename Twists::Twist Twist;
505 };
506
507 protected:
509 friend class ALULocalGeometryStorage< const ThisType, GeometryObject, 8 >;
510
511 public:
513 template <PartitionIteratorType pitype>
515 {
516 typedef typename GridFamily::Traits::template Partition<pitype>::LevelGridView
517 LevelGridView;
518 typedef typename GridFamily::Traits::template Partition<pitype>::LeafGridView
519 LeafGridView;
520 typedef typename GridFamily::Traits::template Partition<pitype>::MacroGridView
521 MacroGridView;
522 };
525 typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
526 typedef typename Partition< All_Partition > :: MacroGridView MacroGridView;
527
530
535
536 // type of container for reference elements
538 // type of container for reference faces
539 typedef ReferenceElements< alu3d_ctype, dim-1 > ReferenceFaceContainerType;
540
541 // type of reference element
542 typedef std::decay_t< decltype( ReferenceElementContainerType::general( std::declval< const Dune::GeometryType & >() ) ) > ReferenceElementType;
543 // type of reference face
544 typedef std::decay_t< decltype( ReferenceFaceContainerType::general( std::declval< const Dune::GeometryType & >() ) ) > ReferenceFaceType;
545
548
550 typedef ALU3DSPACE ProjectVertex ALUGridVertexProjectionType;
551
553 typedef ALU3DSPACE ProjectVertexPtr ALUGridVertexProjectionPointerType;
554 typedef ALU3DSPACE ProjectVertexPtrPair ALUGridVertexProjectionPairType;
555
557 typedef typename Traits::Communication Communication;
558
559 [[deprecated("Use Communication instead!")]]
560 typedef Communication CollectiveCommunication;
561
562 typedef ALULeafCommunication< dim, dimworld, elType, Comm > LeafCommunication;
563 typedef ALULevelCommunication< dim, dimworld, elType, Comm > LevelCommunication;
564
565 protected:
567 typedef typename GridFamily::LocalIdSetImp LocalIdSetImp;
568
569 typedef typename GridFamily::GlobalIdSetImp GlobalIdSetImp;
570
571 public:
574
577
578 protected:
580 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIteratorType;
581 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
582
583 typedef ALU3dGridHierarchicIterator< const ThisType > HierarchicIteratorImp;
584
585 typedef typename ALU3dImplTraits< elType, Comm >::GitterImplType GitterImplType;
586
588 enum {
591
593 enum {
598
599 public:
600 typedef Comm MPICommunicatorType;
601
602 typedef ALU3dGridCommunications< dim, dimworld, elType, Comm > Communications;
603
604 protected:
605 typedef ALU3dGridVertexList< Comm > VertexListType;
606 typedef ALU3dGridLeafVertexList< Comm > LeafVertexListType;
607
608 typedef DefaultBoundarySegmentIndexSet< ThisType > BoundarySegmentIndexSetType;
609
610 public:
613 ALU3dGrid ( const std::string &macroTriangFilename,
614 const MPICommunicatorType mpiComm,
615 const ALUGridVertexProjectionPairType& bndPrj,
616 const ALUGridRefinementType refinementType );
617
619 virtual ~ALU3dGrid() {}
620
622 static inline std::string name ();
623
627 int maxLevel() const;
628
630 template<int cd, PartitionIteratorType pitype>
631 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
632 lbegin (int level) const;
633
635 template<int cd, PartitionIteratorType pitype>
636 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
637 lend (int level) const;
638
640 template<int cd>
641 typename Traits::template Codim<cd>::
642 template Partition<All_Partition>::LevelIterator
643 lbegin (int level) const;
644
646 template<int cd>
647 typename Traits::template Codim<cd>::
648 template Partition<All_Partition>::LevelIterator
649 lend (int level) const;
650
651 typedef LeafIntersectionIteratorWrapper < const ThisType > LefInterItWrapperType;
652 typedef LevelIntersectionIteratorWrapper < const ThisType > LvlInterItWrapperType;
653
654 typename Traits::LeafIntersectionIterator
655 ileafbegin( const typename Traits::template Codim< 0 >::Entity& entity ) const
656 {
657 return LefInterItWrapperType( *this,
658 entity.impl(),
659 entity.level(), false );
660 }
661
662 typename Traits::LeafIntersectionIterator
663 ileafend( const typename Traits::template Codim< 0 >::Entity& entity ) const
664 {
665 return LefInterItWrapperType( *this,
666 entity.impl(),
667 entity.level(), true );
668 }
669
670 typename Traits::LevelIntersectionIterator
671 ilevelbegin( const typename Traits::template Codim< 0 >::Entity& entity ) const
672 {
673 return LvlInterItWrapperType( *this,
674 entity.impl(),
675 entity.level(), false );
676 }
677
678 typename Traits::LevelIntersectionIterator
679 ilevelend( const typename Traits::template Codim< 0 >::Entity& entity ) const
680 {
681 return LvlInterItWrapperType( *this,
682 entity.impl(),
683 entity.level(), true );
684 }
685
686 public:
688 template <int codim, PartitionIteratorType pitype>
689 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
690 leafbegin() const;
691
693 template <int codim, PartitionIteratorType pitype>
694 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
695 leafend() const;
696
698 template <int codim>
699 typename Traits::template Codim<codim>::LeafIterator
700 leafbegin() const;
701
703 template <int codim>
704 typename Traits::template Codim<codim>::LeafIterator
705 leafend() const;
706
707 public:
709 int size (int level, int cd) const;
710
712 int size (int codim) const;
713
715 int size (int level, GeometryType type) const;
716
718 size_t numBoundarySegments() const;
719
721 int size (GeometryType type) const;
722
724 int global_size (int cd) const ;
725
726 // (no interface method) number of grid entities in the entire grid for given codim
727 int hierSetSize (int cd) const;
728
730 const GlobalIdSet &globalIdSet () const
731 {
732 if( !globalIdSet_ )
733 {
734 globalIdSet_.reset( new GlobalIdSetImp( *this ) );
735 }
736 return *globalIdSet_;
737 }
738
740 template<PartitionIteratorType pitype>
741 typename Partition<pitype>::MacroGridView macroGridView() const
742 {
743 typedef typename Traits::template Partition<pitype>::MacroGridView View;
744 return View(*this);
745 }
746
748 MacroGridView macroGridView() const
749 {
750 typedef MacroGridView View;
751 return View(*this);
752 }
753
755 const LocalIdSet & localIdSet () const { return localIdSet_; }
756
758 const typename Traits :: LeafIndexSet & leafIndexSet () const;
759
761 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
762
767 std::shared_ptr< LevelIndexSetImp > accessLevelIndexSet ( int level ) const;
768
769 protected:
770 std::shared_ptr< LevelIndexSetImp > createLevelIndexSet ( int level ) const;
771
772 public:
773 template< int cd >
774 typename Codim< cd >::Twists twists ( GeometryType type ) const
775 {
776 assert( type.dim() == dimension - cd );
777 assert( elType == tetra ? type.isSimplex() : type.isCube() );
778 return typename Traits::template Codim< cd >::Twists();
779 }
780
781 protected:
782 typedef ALU3DSPACE GatherScatter GatherScatterType;
783
812 bool loadBalance ( GatherScatterType* lbData );
813
814 public:
852 static void setLoadBalanceMethod( const int mthd,
853 const double ldbUnder = 0.0,
854 const double ldbOver = 1.2 )
855 {
856 using DataBase = ALU3DSPACE LoadBalancer::DataBase ;
857 if( mthd < int( DataBase::NONE ) && mthd > DataBase::ZOLTAN_LB_PARMETIS )
858 {
859 DUNE_THROW(InvalidStateException,"ALUGrid::setLoadBalanceMethod: wrong method passed, check documentation for correect values");
860 }
861
862 ALU3DSPACE ALUGridExternalParameters::setLoadBalanceParameters( mthd, ldbUnder, ldbOver );
863 }
864
865
866
872 {
873 return loadBalance( (GatherScatterType* ) 0 );
874 }
875
882 template< class DataHandleImpl, class Data >
884 {
885 typedef ALU3DSPACE GatherScatterLoadBalanceDataHandle
886 < ThisType, GatherScatterType, DataHandleImpl, Data, false > DataHandleType;
887 DataHandleType dataHandle( *this, dataHandleIF );
888
889 // call the above loadBalance method with general GatherScatterType
890 return loadBalance( &dataHandle );
891 }
892
902 template< class LBWeights, class DataHandleImpl, class Data >
903 bool loadBalance ( LBWeights &weights,
905 {
906 typedef ALU3DSPACE GatherScatterLoadBalanceDataHandle
907 < ThisType, LBWeights, DataHandleImpl, Data, false > DataHandleType;
908 DataHandleType dataHandle( *this, dataHandleIF, weights );
909
910 // call the above loadBalance method with general GatherScatterType
911 return loadBalance( &dataHandle );
912 }
913
921 template< class LBWeights >
922 typename std::enable_if< !IsDataHandle< LBWeights >::value, bool >::type loadBalance ( LBWeights &weights )
923 {
924 typedef ALU3DSPACE GatherScatterLoadBalance < ThisType, LBWeights, false > LoadBalanceHandleType;
925 LoadBalanceHandleType loadBalanceHandle( *this, weights );
926 return loadBalance( &loadBalanceHandle );
927 }
928
937 template< class LBDestinations >
938 bool repartition ( LBDestinations &destinations )
939 {
940 typedef ALU3DSPACE GatherScatterLoadBalance< ThisType, LBDestinations, true > LoadBalanceHandleType ;
941 LoadBalanceHandleType loadBalanceHandle( *this, destinations );
942 return loadBalance( &loadBalanceHandle );
943 }
944
955 template< class LBDestinations, class DataHandleImpl, class Data >
956 bool repartition ( LBDestinations &destinations,
958 {
959 typedef ALU3DSPACE GatherScatterLoadBalanceDataHandle< ThisType, LBDestinations, DataHandleImpl, Data, true > DataHandleType;
960 DataHandleType dataHandle( *this, dataHandleIF, destinations );
961
962 // call the above loadBalance method with general GatherScatterType
963 return loadBalance( &dataHandle );
964 }
965
966
968 int ghostSize (int level, int codim) const;
969
971 int overlapSize (int level, int codim) const { return 0; }
972
974 int ghostSize (int codim) const;
975
977 int overlapSize (int codim) const { return 0; }
978
980 template< class DataHandle, class Data >
982 InterfaceType iftype,
984 int level ) const
985 {
986 return LevelCommunication( *this, data, iftype, dir, level );
987 }
988
992 template< class DataHandle, class Data >
994 InterfaceType iftype,
995 CommunicationDirection dir ) const
996 {
997 return LeafCommunication( *this, data, iftype, dir );
998 }
999
1000 protected:
1001 // load balance and compress memory if possible
1002 void finalizeGridCreation();
1003
1005 void clearIsNewMarkers( );
1006
1007 public:
1009 const Communication &comm () const { return communications().ccobj_; }
1010
1012 bool preAdapt ( );
1013
1015 void postAdapt ( );
1016
1018 bool adapt ();
1019
1024 template< class GridImp, class DataHandle >
1026
1028 void globalRefine ( int refCount );
1029
1030 template< class GridImp, class DataHandle >
1032
1033 //**********************************************************
1034 // End of Interface Methods
1035 //**********************************************************
1036
1038 bool writeMacroGrid( const std::string path, const std::string filename,
1039 const ALU3DSPACE MacroFileHeader::Format format = ALU3DSPACE MacroFileHeader::defaultFormat ) const ;
1040
1042 void backup( std::ostream&, const ALU3DSPACE MacroFileHeader::Format format ) const ;
1043
1045 void restore( std::istream& ) ;
1046
1047 // (no interface method) get hierarchic index set of the grid
1048 const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
1049
1050 // no interface method, but has to be public
1051 void updateStatus ();
1052
1054 bool mark( int refCount , const typename Traits::template Codim<0>::Entity & e);
1055
1057 int getMark( const typename Traits::template Codim<0>::Entity & e) const;
1058
1059 public:
1060 static MPICommunicatorType defaultCommunicator ()
1061 {
1062 return Communications::defaultComm();
1063 }
1064
1066 const std::vector<GeometryType>& geomTypes (int codim) const { return geomTypes_[codim]; }
1067
1068 // return reference to org ALU3dGrid
1069 // private method, but otherwise we have to friend class all possible
1070 // types of LevelIterator ==> later
1071 GitterImplType &myGrid () const;
1072
1073 virtual GitterImplType *createALUGrid ( const std::string &macroName )
1074 {
1075 alugrid_assert ( communications_ );
1076 return communications_->createALUGrid( macroName, vertexProjections(), conformingRefinement() );
1077 }
1078
1079 virtual GitterImplType *createALUGrid ( std::istream& stream )
1080 {
1081 alugrid_assert ( communications_ );
1082 return communications_->createALUGrid( stream, vertexProjections(), conformingRefinement() );
1083 }
1084
1085 ALUGridVertexProjectionPairType vertexProjections() const
1086 {
1087 return vertexProjections_ ;
1088 }
1089
1090 // return appropriate ALUGrid builder
1091 virtual typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder () const
1092 {
1093 return Communications::getBuilder( myGrid() );
1094 }
1095
1096 // helper function for factory
1097 virtual void completeGrid ()
1098 {
1099 Communications::completeGrid( myGrid() );
1101 // update macro boundary segment index
1102 macroBoundarySegmentIndexSet_.invalidate();
1103 }
1104
1106 static const ReferenceElementType& referenceElement()
1107 {
1108 static const auto& refElem = ( elType == tetra ) ?
1111 return refElem ;
1112 }
1113
1115 static const ReferenceFaceType& faceReferenceElement()
1116 {
1117 static const auto& refElem = ( elType == tetra ) ?
1120 return refElem ;
1121 }
1122
1123 template < class EntitySeed >
1124 typename Traits :: template Codim< EntitySeed :: codimension > :: EntityPointer
1125 entityPointer( const EntitySeed& seed ) const
1126 {
1127 enum { codim = EntitySeed :: codimension };
1128 return typename Traits :: template Codim< codim > :: EntityPointerImpl( seed );
1129 }
1130
1131 template < class EntitySeed >
1132 typename Traits :: template Codim< EntitySeed :: codimension > :: Entity
1133 entity( const EntitySeed& seed ) const
1134 {
1135 typedef typename Traits :: template Codim< EntitySeed :: codimension > :: Entity Entity;
1136 return Entity( typename Traits :: template Codim< EntitySeed :: codimension > :: EntityImp( seed ) );
1137 }
1138
1139 // number of links to other processors, for internal use only
1140 int nlinks () const { return communications().nlinks(); }
1141
1142 LeafVertexListType & getLeafVertexList() const
1143 {
1144 if( !leafVertexList_.up2Date() ) leafVertexList_.setupVxList(*this);
1145 return leafVertexList_;
1146 }
1147
1148 int getLevelOfLeafVertex ( const typename ALU3dImplTraits< elType, Comm >::VertexType &vertex ) const
1149 {
1150 alugrid_assert ( leafVertexList_.up2Date() );
1151 return leafVertexList_.getLevel(vertex);
1152 }
1153
1154 VertexListType & getVertexList(int level) const
1155 {
1156 alugrid_assert ( level >= 0 );
1157 alugrid_assert ( level <= maxLevel() );
1158 VertexListType & vxList = vertexList_[level];
1159 if(!vxList.up2Date()) vxList.setupVxList(*this,level);
1160 return vxList;
1161 }
1162
1163 ALU3dGridItemListType & getGhostLeafList(int codim) const
1164 {
1165 alugrid_assert ( codim >= 1 );
1166 alugrid_assert ( codim <= 3 );
1167 return ghostLeafList_[codim-1];
1168 }
1169
1170 ALU3dGridItemListType & getGhostLevelList(int codim, int level) const
1171 {
1172 alugrid_assert ( codim >= 1 );
1173 alugrid_assert ( codim <= 3 );
1174
1175 alugrid_assert ( level >= 0 );
1176 alugrid_assert ( level <= maxLevel() );
1177 alugrid_assert ( level < int(ghostLevelList_[codim-1].size()) );
1178 return ghostLevelList_[codim-1][level];
1179 }
1180
1181 ALU3dGridItemListType & getEdgeList(int level) const
1182 {
1183 alugrid_assert ( level >= 0 );
1184 alugrid_assert ( level <= maxLevel() );
1185 return levelEdgeList_[level];
1186 }
1187
1188 protected:
1191
1193 const ThisType &operator= ( const ThisType & );
1194
1196 void calcExtras();
1197
1199 void calcMaxLevel();
1200
1203
1205 void checkMacroGridFile (const std::string filename);
1206
1208 void checkMacroGrid ();
1209
1210 const Communications &communications () const
1211 {
1212 alugrid_assert ( communications_ );
1213 return *communications_;
1214 }
1215
1216 // initialize geometry types and return correct geometryInFather storage
1217 void makeGeometries();
1218
1219 public:
1220 // return true if conforming refinement is enabled
1221 bool conformingRefinement() const
1222 {
1223 return (refinementType_ == conforming) ;
1224 }
1225
1226 // return true if ghost cells are available
1227 bool ghostCellsEnabled () const
1228 {
1229 return comm().size() > 1 && myGrid().ghostCellsEnabled();
1230 }
1231
1232 const BoundarySegmentIndexSetType& macroBoundarySegmentIndexSet() const
1233 {
1234 if( ! macroBoundarySegmentIndexSet_.valid() )
1235 {
1236 macroBoundarySegmentIndexSet_.update( macroGridView() );
1237 }
1238 alugrid_assert( macroBoundarySegmentIndexSet_.valid() );
1239 return macroBoundarySegmentIndexSet_;
1240 }
1241
1242 protected:
1244 //
1245 // Internal variables
1246 //
1248
1249 // the real ALU grid
1250 mutable std::unique_ptr< GitterImplType > mygrid_;
1251
1252 // max level of grid
1253 int maxlevel_;
1254
1255 // count how much elements where marked
1256 mutable int coarsenMarked_;
1257 mutable int refineMarked_;
1258
1259 // at the moment the number of different geom types is 1
1260 enum { numberOfGeomTypes = 1 };
1261 std::vector< std::vector<GeometryType> > geomTypes_;
1262
1263 // our hierarchic index set
1264 HierarchicIndexSet hIndexSet_;
1265
1266 // out global id set
1267 mutable std::unique_ptr< GlobalIdSetImp > globalIdSet_;
1268
1269 // out global id set
1270 LocalIdSetImp localIdSet_;
1271
1272 // the level index set ( default type )
1273 mutable std::vector < std::shared_ptr< LevelIndexSetImp > > levelIndexVec_;
1274
1275 // the leaf index set
1276 mutable std::unique_ptr< LeafIndexSetImp > leafIndexSet_;
1277
1278 mutable std::vector< VertexListType > vertexList_;
1279
1280 //the ghostleaf list is used in alu3diterators, where we use the internal aluIterators
1281 // the vertex codim there is 3, so the list has to fulfill that
1282 mutable ALU3dGridItemListType ghostLeafList_[ 3 ];
1283 mutable std::vector< ALU3dGridItemListType > ghostLevelList_[ 3 ];
1284
1285 mutable std::vector< ALU3dGridItemListType > levelEdgeList_;
1286
1287 mutable LeafVertexListType leafVertexList_;
1288
1289 // the type of our size cache
1290 typedef SizeCache<MyType> SizeCacheType;
1291 std::unique_ptr< SizeCacheType > sizeCache_;
1292
1293 // macro boundary segment index
1294 mutable BoundarySegmentIndexSetType macroBoundarySegmentIndexSet_;
1295
1296 // variable to ensure that postAdapt ist called after adapt
1297 bool lockPostAdapt_;
1298
1299 // boundary projection for vertices
1300 // pair: first is globalProjection_ for boundaries
1301 // second is surfaceProjection_ for manifolds
1302 ALUGridVertexProjectionPairType vertexProjections_ ;
1303
1304 // pointer to communications object
1305 std::unique_ptr< Communications > communications_;
1306
1307 // refinement type (nonconforming or conforming)
1308 const ALUGridRefinementType refinementType_ ;
1309 }; // end class ALU3dGrid
1310
1311
1312 bool checkMacroGrid ( ALU3dGridElementType elType ,
1313 const std::string filename );
1314 const char* elType2Name( ALU3dGridElementType elType );
1315
1316 namespace Capabilities
1317 {
1318
1319 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm, int cdim >
1320 struct hasEntity< Dune::ALU3dGrid< dim, dimworld, elType, Comm >, cdim >
1321 {
1322 static const bool v = true;
1323 };
1324
1325 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm >
1326 struct isLevelwiseConforming< ALU3dGrid< dim, dimworld, elType, Comm > >
1327 {
1328 static const bool v = true;
1329 };
1330
1331 template< int dim, int dimworld, ALU3dGridElementType elType, class Comm >
1332 struct hasBackupRestoreFacilities< ALU3dGrid< dim, dimworld, elType, Comm > >
1333 {
1334 static const bool v = true;
1335 };
1336
1337 } // end namespace Capabilities
1338
1339} // end namespace Dune
1340
1341#include "grid_inline.hh"
1342#if COMPILE_ALUGRID_INLINE
1343 #include "grid_imp.cc"
1344#endif
1345#endif
Portable very large unsigned integers.
Definition: entity.hh:449
Definition: entity.hh:48
hierarchic index set of ALU3dGrid
Definition: indexsets.hh:39
Definition: iterator.hh:56
Leaf iterator.
Definition: iterator.hh:648
[ provides Dune::Grid ]
Definition: grid.hh:434
bool repartition(LBDestinations &destinations, CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF)
Distribute the grid based on a user defined partitioning.
Definition: grid.hh:956
static const ReferenceElementType & referenceElement()
return reference to Dune reference element according to elType
Definition: grid.hh:1106
ALU3dGrid(const std::string &macroTriangFilename, const MPICommunicatorType mpiComm, const ALUGridVertexProjectionPairType &bndPrj, const ALUGridRefinementType refinementType)
Definition: grid_inline.hh:24
const Traits::LeafIndexSet & leafIndexSet() const
get leaf index set of the grid
Definition: grid_inline.hh:431
bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: grid_inline.hh:190
LevelCommunication communicate(CommDataHandleIF< DataHandle, Data > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition: grid.hh:981
int overlapSize(int level, int codim) const
overlapSize is zero for this grid
Definition: grid.hh:971
bool loadBalance()
Calculates load of each process and repartition by using ALUGrid's default partitioning method....
Definition: grid.hh:871
static void setLoadBalanceMethod(const int mthd, const double ldbUnder=0.0, const double ldbOver=1.2)
Set load balancing method and lower and upper bound for decision on whether to load balance or not.
Definition: grid.hh:852
ALU3dGrid(const ThisType &)
Copy constructor should not be used.
static const ReferenceFaceType & faceReferenceElement()
return reference to Dune face reference element according to elType
Definition: grid.hh:1115
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered maxLevel with 0 the coarsest level.
Definition: grid_inline.hh:81
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
Definition: grid_inline.hh:171
Traits::DuneBoundaryProjectionType DuneBoundaryProjectionType
boundary projection type
Definition: grid.hh:547
const Traits::LevelIndexSet & levelIndexSet(int level) const
get level index set of the grid
Definition: grid_inline.hh:446
Traits::LocalIdSet LocalIdSet
Type of the local id set.
Definition: grid.hh:576
void checkMacroGridFile(const std::string filename)
check whether macro grid format is of our type
Definition: grid_imp.cc:304
bool loadBalance(LBWeights &weights, CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF)
Calculates load of each process and repartition by using ALUGrid's default partitioning method,...
Definition: grid.hh:903
const LocalIdSet & localIdSet() const
get global id set of grid
Definition: grid.hh:755
virtual ~ALU3dGrid()
Desctructor.
Definition: grid.hh:619
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
Definition: grid_inline.hh:488
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: grid.hh:1066
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition: grid_inline.hh:516
ALU3DSPACE ProjectVertex ALUGridVertexProjectionType
type of vertex projection
Definition: grid.hh:550
bool repartition(LBDestinations &destinations)
Distribute the grid based on a user defined partitioning.
Definition: grid.hh:938
Traits::Communication Communication
type of collective communication object
Definition: grid.hh:557
static std::string name()
for grid identification
Definition: grid_inline.hh:278
const ThisType & operator=(const ThisType &)
assignment operator should not be used
Definition: grid_imp.cc:205
std::shared_ptr< LevelIndexSetImp > accessLevelIndexSet(int level) const
return instance of level index set
Definition: grid_inline.hh:463
GridFamily::LevelIndexSetImp LevelIndexSetImp
Type of the level index set, needed by data handle.
Definition: grid.hh:532
GridFamily::LocalIdSetImp LocalIdSetImp
Type of the local id set.
Definition: grid.hh:567
ALU3DSPACE ProjectVertexPtr ALUGridVertexProjectionPointerType
type of ALUGrid Vertex Projection Interface (shared_ptr)
Definition: grid.hh:553
void recalcGlobalSize()
make grid walkthrough and calc global size
Partition< All_Partition >::LevelGridView LevelGridView
View types for All_Partition.
Definition: grid.hh:524
LeafCommunication communicate(CommDataHandleIF< DataHandle, Data > &data, InterfaceType iftype, CommunicationDirection dir) const
Communicate information on distributed entities on the leaf grid. Template parameter is a model of Du...
Definition: grid.hh:993
void backup(std::ostream &, const ALU3DSPACE MacroFileHeader::Format format) const
backup to ostream
Definition: grid_imp.cc:268
void clearIsNewMarkers()
clear all entity new markers
Definition: grid_imp.cc:444
@ refineEstimate_
if one element is refined then it causes apporximately not more than this number of new elements
Definition: grid.hh:597
void postAdapt()
clear all entity new markers if lockPostAdapt_ is set
Definition: grid_imp.cc:429
void restore(std::istream &)
restore from istream
Definition: grid_imp.cc:276
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: grid_inline.hh:99
void calcMaxLevel()
calculate maxlevel
Definition: grid_imp.cc:214
const GlobalIdSet & globalIdSet() const
get global id set of grid
Definition: grid.hh:730
bool preAdapt()
returns if a least one entity was marked for coarsening
Definition: grid_inline.hh:507
void calcExtras()
reset size and global size, update Level- and LeafIndexSet, if they exist
Definition: grid_inline.hh:371
GridFamily::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set, needed by data handle.
Definition: grid.hh:534
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: grid_inline.hh:205
std::enable_if<!IsDataHandle< LBWeights >::value, bool >::type loadBalance(LBWeights &weights)
Calculates load of each process and repartition by using ALUGrid's default partitioning method,...
Definition: grid.hh:922
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
General definiton for a leaf iterator.
Definition: grid_inline.hh:148
MacroGridView macroGridView() const
View for te macro grid with some alu specific methods (All_Partition)
Definition: grid.hh:748
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Definition: grid_inline.hh:113
@ newElementsChunk_
normal default number of new elements for new adapt method
Definition: grid.hh:590
bool loadBalance(CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF)
Calculates load of each process and repartition by using ALUGrid's default partitioning method....
Definition: grid.hh:883
int global_size(int cd) const
number of grid entities on all levels for given codim
Definition: grid_inline.hh:63
int ghostSize(int level, int codim) const
ghostSize is one for codim 0 and zero otherwise for this grid
Definition: grid_inline.hh:352
int size(int level, int cd) const
number of grid entities per level and codim
Definition: grid_inline.hh:289
size_t numBoundarySegments() const
number of boundary segments
Definition: grid_inline.hh:303
void checkMacroGrid()
check whether macro grid has the right element type
Definition: grid_imp.cc:343
bool writeMacroGrid(const std::string path, const std::string filename, const ALU3DSPACE MacroFileHeader::Format format=ALU3DSPACE MacroFileHeader::defaultFormat) const
write macro grid in ALUGrid macro format to path/filename.rank
Definition: grid_imp.cc:246
Traits::GlobalIdSet GlobalIdSet
Type of the global id set.
Definition: grid.hh:573
Partition< pitype >::MacroGridView macroGridView() const
View for te macro grid with some alu specific methods.
Definition: grid.hh:741
const Communication & comm() const
return const reference to a communication object. The return type is a model of Dune::Communication.
Definition: grid.hh:1009
ALU3dGridHierarchicIndexSet< dim, dimworld, elType, Comm > HierarchicIndexSet
Type of the hierarchic index set.
Definition: grid.hh:529
int overlapSize(int codim) const
overlapSize is zero for this grid
Definition: grid.hh:977
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:33
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:78
Specialization of Communication for MPI.
Definition: mpicommunication.hh:108
void update(const GridViewType &gridView)
Definition: defaultindexsets.hh:399
DefaultIndexSet creates an index set by using the grids persistent container an a given pair of itera...
Definition: defaultindexsets.hh:68
interface class for an iterator over grid entities
Definition: entityiterator.hh:32
Store a reference to an entity with a minimal memory footprint.
Definition: entityseed.hh:26
static constexpr int codimension
codimension of underlying entity
Definition: entityseed.hh:30
Wrapper class for entities.
Definition: entity.hh:66
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:125
constexpr unsigned int dim() const
Return dimension of the type.
Definition: type.hh:371
constexpr bool isCube() const
Return true if entity is a cube of any dimension.
Definition: type.hh:335
constexpr unsigned int id() const
Return the topology id of the type.
Definition: type.hh:376
constexpr bool isSimplex() const
Return true if entity is a simplex of any dimension.
Definition: type.hh:330
Wrapper class for geometries.
Definition: geometry.hh:71
Definition: grid.hh:862
Grid view abstract base class.
Definition: gridview.hh:66
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:390
Id Set Interface.
Definition: indexidset.hh:452
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:23
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:281
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:246
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:346
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Provides default index set implementations for Level- and LeafIndexsets used by ALUGrid.
Provides a Interfaces for detection of specific behavior.
Implements an utility class that provides collective communication methods for sequential programs.
A set of traits classes to store static information about grid implementation.
Different resources needed by all grid implementations.
topology of a Cartesian grid
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
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 cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:472
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:463
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:506
Provides proxy classes for IntersectionsIterators.
Implements an utility class that provides MPI's collective communication methods.
Helpers for dealing with MPI.
Dune namespace.
Definition: alignedallocator.hh:13
@ simplex
use only simplex elements (i.e., triangles or tetrahedra)
Definition: declaration.hh:18
@ cube
use only cube elements (i.e., quadrilaterals or hexahedra)
Definition: declaration.hh:19
Communication< T > CollectiveCommunication
Definition: communication.hh:541
ALUGridRefinementType
available refinement types for ALUGrid
Definition: declaration.hh:24
@ conforming
use only conforming bisection refinement
Definition: declaration.hh:25
Provides size cache classes to implement the grids size method efficiently.
Definition: alu3dinclude.hh:364
Definition: alu3dinclude.hh:328
Types for GridView.
Definition: grid.hh:515
Static tag representing a codimension.
Definition: dimension.hh:24
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:33
Class providing access to the singletons of the reference elements.
Definition: referenceelements.hh:170
static const ReferenceElement & cube()
get hypercube reference elements
Definition: referenceelements.hh:210
Tagging interface to indicate that Grid has HierarchicIndexSet.
Definition: interfaces.hh:49
Tagging interface to indicate that Grid provides typedef ObjectStreamType.
Definition: interfaces.hh:14
Definition: grid.hh:1107
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 (Dec 21, 23:30, 2024)