Dune Core Modules (2.3.1)

grid.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_ALU2DGRIDGRID_HH
4#define DUNE_ALU2DGRIDGRID_HH
5
6//- System includes
7#include "alu2dinclude.hh"
8#include <iostream>
9#include <vector>
10
11//- Dune includes
12#include <dune/grid/utility/grapedataioformattypes.hh>
16
18#include <dune/grid/alugrid/common/declaration.hh>
21#include <dune/grid/common/defaultgridview.hh>
23
25
26// bnd projection stuff
27#include <dune/grid/common/boundaryprojection.hh>
28#include <dune/grid/alugrid/2d/bndprojection.hh>
29
30//- Local includes
31#include "indexsets.hh"
32#include <dune/grid/alugrid/common/objectfactory.hh>
33#include "datahandle.hh"
34
35namespace Dune {
36
37 // Forward declarations
38 template<int cd, int dim, class GridImp>
39 class ALU2dGridEntity;
40 template<int cd, PartitionIteratorType pitype, class GridImp >
41 class ALU2dGridLevelIterator;
42 template<int cd, class GridImp >
43 class ALU2dGridEntityPointer;
44 template<int cd, class GridImp >
45 class ALU2dGridEntitySeed;
46 template<int mydim, int coorddim, class GridImp>
47 class ALU2dGridMakeableGeometry;
48 template<int mydim, int cdim, class GridImp>
49 class ALU2dGridGeometry;
50 template<class GridImp>
51 class ALU2dGridHierarchicIterator;
52 template<class GridImp>
53 class ALU2dGridIntersectionBase;
54 template<class GridImp>
55 class ALU2dGridLevelIntersectionIterator;
56 template<class GridImp>
57 class ALU2dGridLeafIntersectionIterator;
58 template<int codim, PartitionIteratorType pitype, class GridImp>
59 class ALU2dGridLeafIterator;
60 template <int mydim, int coorddim, class GridImp>
61 class ALU2dGridMakeableEntity;
62 template <class GridImp>
63 class ALU2dGridFaceGeometryInfo;
64 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
65 class ALU2dGridLocalIdSet;
66 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
67 class ALU2dGridHierarchicIndexSet;
68 template <class EntityImp>
69 class ALUMemoryProvider;
70 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
71 class ALU2dGrid;
72 template <class GridImp, class GeometryImp, int nChild>
73 class ALULocalGeometryStorage;
74
75 class ALU2dObjectStream;
76
77 // Internal Forward Declarations
78 // -----------------------------
79
80 template < int dimw, class Comm >
81 struct ALUGridBaseGrid< 2, dimw, cube, Comm >
82 {
84 };
85
86 template < int dimw, class Comm >
87 struct ALUGridBaseGrid< 2, dimw, simplex, Comm >
88 {
90 };
91
92
93 //
94 // --ALU2dGrid
95 // --Grid
96 //
97 //**********************************************************************
98 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
99 struct ALU2dGridFamily
100 {
101 typedef ALU2dGrid< dim, dimworld, eltype > GridImp;
102
104 typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> GlobalIdSetImp;
105
107 typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> LocalIdSetImp;
108
109 typedef int GlobalIdType;
110 typedef int LocalIdType;
111
112 struct Traits
113 {
114 typedef GridImp Grid;
115
118
119 typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper< const GridImp >, LeafIntersectionWrapper< const GridImp > > IntersectionIterator;
120 typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper< const GridImp >, LeafIntersectionWrapper< const GridImp > > LeafIntersectionIterator;
121 typedef Dune::IntersectionIterator<const GridImp, LevelIntersectionIteratorWrapper< const GridImp >, LevelIntersectionWrapper< const GridImp > > LevelIntersectionIterator;
122
124
125 typedef DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType;
126 typedef std::vector< const DuneBoundaryProjectionType *> DuneBoundaryProjectionVector;
127
128 template <int cd>
129 struct Codim
130 {
131 // IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
132 typedef ALU2dGridGeometry< dim-cd, dimworld, const GridImp > GeometryImpl;
133 typedef ALU2dGridGeometry< dim-cd, dim, const GridImp > LocalGeometryImpl;
134 typedef Dune::Geometry< dim-cd, dimworld, const GridImp, ALU2dGridGeometry > Geometry;
135 typedef Dune::Geometry< dim-cd, dim, const GridImp, ALU2dGridGeometry > LocalGeometry;
136
137 // we could - if needed - introduce an other struct for dimglobal of Geometry
139
140 typedef ALU2dGridEntityPointer< cd, const GridImp > EntityPointerImpl;
142
143 // minimal information to generate entities
144 typedef ALU2dGridEntitySeed< cd , const GridImp > EntitySeed ;
145
146 template <PartitionIteratorType pitype>
147 struct Partition
148 {
151 };
152
153 typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
154 typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
155
156 };
157
158 template <PartitionIteratorType pitype>
159 struct Partition
160 {
162 LevelGridView;
164 LeafGridView;
165 };
166
168 typedef DefaultIndexSet< GridImp, typename Codim<0>::LevelIterator > LevelIndexSetImp;
170 typedef DefaultIndexSet< GridImp, typename Codim<0>::LeafIterator > LeafIndexSetImp;
171
172 typedef IndexSet<GridImp,LevelIndexSetImp> LevelIndexSet;
173 typedef LeafIndexSetImp LeafIndexSet;
174 typedef IdSet<GridImp,GlobalIdSetImp,GlobalIdType> GlobalIdSet;
175 typedef IdSet<GridImp,LocalIdSetImp,LocalIdType> LocalIdSet;
176
177#if ALU2DGRID_PARALLEL
178 typedef Dune :: CollectiveCommunication< MPI_Comm >
179 CollectiveCommunication;
180#else
181 typedef Dune :: CollectiveCommunication< GridImp >
182 CollectiveCommunication;
183#endif
184 };
185
187 typedef typename Traits :: LevelIndexSetImp LevelIndexSetImp;
188
190 typedef typename Traits :: LeafIndexSetImp LeafIndexSetImp;
191 }; // end of ALU2dGridFamily
192
193
208 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
210 : public GridDefaultImplementation< dim, dimworld, alu2d_ctype, ALU2dGridFamily< dim, dimworld, eltype > >,
211 public HasObjectStream,
213 {
216
217 dune_static_assert( dim == 2, "ALU2dGrid only implemented for grid dim 2." );
218 dune_static_assert( dimworld == 2 || dimworld == 3, "ALU2dGrid only implemented for world dim 2 or 3." );
219
220 public:
221 static const ALU2DSPACE ElementType elementType = eltype;
222
223 typedef typename ALU2dGridFamily< dim, dimworld, elementType >::Traits Traits;
224
225 // new intersection iterator is a wrapper which get itersectioniteratoimp as pointers
226 typedef ALU2dGridLeafIntersectionIterator <const ThisType> LeafIntersectionIteratorImp;
227 typedef ALU2dGridLevelIntersectionIterator<const ThisType> LevelIntersectionIteratorImp;
228
229 typedef ALUGridObjectFactory< ThisType > GridObjectFactoryType;
230
231 private:
232
233 typedef typename ALU2dImplTraits<dimworld, elementType >::HmeshType HmeshType ;
234 typedef typename ALU2dImplTraits<dimworld, elementType >::HElementType HElementType ;
235 typedef typename ALU2dImplTraits<dimworld, elementType >::ElementType ElementType ;
236
237 template< class > friend struct DGFBaseFactory;
238
239 template< int, int, class > friend class ALU2dGridEntity;
240
241 friend class ALU2dGridGeometry<0,dimworld,const ThisType>;
242 friend class ALU2dGridGeometry<1,dimworld,const ThisType>;
243 friend class ALU2dGridGeometry<dim,dimworld,const ThisType>;
244 template< class, class, int > friend class ALULocalGeometryStorage;
245
246 friend class ALU2dGridEntityPointer<0,const ThisType>;
247 friend class ALU2dGridEntityPointer<1,const ThisType>;
248 friend class ALU2dGridEntityPointer<dim,const ThisType>;
249
250 friend class ALU2dGridHierarchicIndexSet<dim,dimworld,elementType>;
251
252 friend class ALU2dGridIntersectionBase < const ThisType > ;
253 friend class ALU2dGridLevelIntersectionIterator< const ThisType > ;
254 friend class ALU2dGridLeafIntersectionIterator< const ThisType > ;
255
256 //**********************************************************
257 // The Interface Methods
258 //**********************************************************
259 protected:
260 typedef MakeableInterfaceObject<typename Traits::template
261 Codim<0>::Geometry> GeometryObject;
262 friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 4 >;
263 friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 2 >;
264
265 public:
266
268 typedef ALU2dGridObjectStream ObjectStreamType;
269 typedef ObjectStreamType InStreamType ;
270 typedef ObjectStreamType OutStreamType ;
271
273 typedef ALU2dGridFamily < dim, dimworld, eltype > GridFamily;
274
277
281
283 typedef typename Traits :: GlobalIdSet GlobalIdSet;
284
286 typedef typename Traits :: LocalIdSet LocalIdSet;
287
288
290 typedef typename GridFamily :: LevelIndexSetImp LevelIndexSetImp;
292 typedef typename GridFamily :: LeafIndexSetImp LeafIndexSetImp;
293
295 typedef ALU2dGridLeafIterator<0, All_Partition, const ThisType> LeafIteratorImp;
296 typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
297 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
298
300 typedef ALU2dGridLevelIterator<0, All_Partition, const ThisType> LevelIteratorImp;
301 typedef typename Traits::template Codim<0>::LevelIterator LevelIteratorType;
302 typedef typename Traits::template Codim<0>::LevelIterator LevelIterator;
303
305
306 typedef typename Traits::CollectiveCommunication CollectiveCommunicationType;
307
308
310 enum {
312 MAXL = 64
313 };
314
316 enum {
319 };
320
322 enum {
326 refineEstimate_ = 40
327 };
328
330 typedef typename Traits :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
332 typedef typename Traits :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
333
334#ifdef ALUGRID_VERTEX_PROJECTION
336 typedef ALUGridSpace :: VertexProjection< dimworld > ALUGridVertexProjectionType;
337#endif
338
339
340 protected:
341
342 friend class ALUGridBoundaryProjection< ThisType >;
343 friend class ALU2dGridBoundaryProjection< ThisType >;
344 // type of ALUGrid boundary projection wrapper
345 typedef ALU2dGridBoundaryProjection< ThisType > ALUGridBoundaryProjectionType;
346
349 //- --constructor
350 ALU2dGrid(const std::string macroTriangFilename,
351 const int nrOfHangingNodes,
354 std::istream* macroFile = 0);
355
356 // method creating mesh object
357 HmeshType* createGrid(const std::string&,
358 const int,
359 std::istream* );
360
362 explicit ALU2dGrid( int );
363
364 public:
367
370 int maxLevel() const;
371
374 template<int cd, PartitionIteratorType pitype>
375 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
376 lbegin (int level) const;
377
379 template<int cd, PartitionIteratorType pitype>
380 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
381 lend (int level) const;
382
384 template<int cd>
385 typename Traits::template Codim<cd>::
386 template Partition<All_Partition>::LevelIterator
387 lbegin (int level) const;
388
390 template<int cd>
391 typename Traits::template Codim<cd>::
392 template Partition<All_Partition>::LevelIterator
393 lend (int level) const;
394
396 LevelIteratorType lbegin (int level) const;
397
399 LevelIteratorType lend (int level) const;
400
402 template <int codim, PartitionIteratorType pitype>
403 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
404 leafbegin() const;
405
407 template <int codim, PartitionIteratorType pitype>
408 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
409 leafend() const;
410
412 template <int codim>
413 typename Traits::template Codim<codim>::LeafIterator
414 leafbegin() const;
415
417 template <int codim>
418 typename Traits::template Codim<codim>::LeafIterator
419 leafend() const;
420
421 private:
423 LeafIteratorType leafbegin () const;
424
426 LeafIteratorType leafend () const;
427
428 public:
430 int size (int level, int cd) const;
431
433 int size (int codim) const;
434
436 int size (int level, GeometryType type) const;
437
439 int size (GeometryType type) const;
440
442 const std::vector<GeometryType>& geomTypes (int codim) const { return geomTypes_[codim]; }
443
444 //****************************************************************
445 // index and id sets
446 //****************************************************************
447
449 const GlobalIdSet & globalIdSet () const;
450
452 const LocalIdSet & localIdSet () const;
453
455 int hierSetSize (int cd) const;
456
459
461 const typename Traits :: LeafIndexSet & leafIndexSet () const;
462
464 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
465
466
467 //**********************************************************
468 // End of Interface Methods
469 //**********************************************************
470
471 // return reference to org ALU2dGrid
472 // private method, but otherwise we have to friend class all possible
473 // types of LevelIterator ==> later
474 HmeshType & myGrid();
475 HmeshType & myGrid() const;
476
478 void globalRefine ( int refCount );
479
480 template< class GridImp, class DataHandle >
481 void globalRefine ( int refCount, AdaptDataHandleInterface< GridImp, DataHandle > &hamdle );
482
484 bool preAdapt ( );
485
487 void postAdapt ( );
488
492 bool adapt ();
493
494 template< class GridImp, class DataHandle >
495 bool adapt ( AdaptDataHandleInterface< GridImp, DataHandle > &handle );
496
497 // refine grid
498 bool refineGrid();
499
501 int getMark(const typename Traits::template Codim<0>::Entity & e) const;
502
504 bool mark( int refCount , const typename Traits::template Codim<0>::Entity & e);
505
507 const CollectiveCommunicationType & comm() const;
508 private:
509 CollectiveCommunicationType comm_;
510
511 void updateStatus();
512
513 void calcMaxlevel();
514
515 void calcExtras();
516
517 // clear refinement marker of element and all children
518 void hierarchicClear( HElementType *el );
519 public:
523
524 protected:
525 // create GeomTypes
526 void makeGeomTypes ();
527
528 friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
529 friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
530
531 friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
532 friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
533
534 private:
536 ALU2dGrid( const ThisType & g );
537
539 ThisType & operator = (const ThisType & g);
540
541 protected:
542 // check macro file and return const char * to filename
543 const char * checkMacroGridFile(const std::string & filename);
544
546 mutable HmeshType* mygrid_;
547
548 // return reference to grid
549 HmeshType& mesh() const {
550 assert(mygrid_);
551 return *mygrid_;
552 }
553
554#ifdef USE_SMP_PARALLEL
555 std::vector< GridObjectFactoryType > factoryVec_;
556#else
557 GridObjectFactoryType factory_;
558#endif
559
562
565
567 mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
568
569 // at the moment the number of different geom types is 1
570 enum { numberOfGeomTypes = 1 };
571 std::vector< std::vector<GeometryType> > geomTypes_;
572
575
576 int maxLevel_;
577 int refineMarked_ , coarsenMarked_;
578 const int nrOfHangingNodes_;
579
582 SizeCacheType * sizeCache_;
583
584 // flag to make sure postAdapt is called after adapt
585 bool lockPostAdapt_;
586
587 // pointer to Dune boundary projection
588 const DuneBoundaryProjectionType* bndPrj_;
589
590 // pointer to Dune boundary projection
591 const DuneBoundaryProjectionVector* bndVec_;
592
593 // boundary projection for vertices
594 ALUGridBoundaryProjectionType* vertexProjection_ ;
595
596 const DuneBoundaryProjectionType *globalProjection () const
597 {
598 return bndPrj_;
599 }
600
602 const DuneBoundaryProjectionType* boundaryProjection(const int segmentIndex) const
603 {
604 if( bndPrj_ )
605 {
606 return bndPrj_;
607 }
608 else
609 {
610 // note pointer can be zero (identity mapping)
611 assert( bndVec_ );
612 assert( segmentIndex < (int) bndVec_->size() );
613 return (*bndVec_)[ segmentIndex ];
614 }
615 }
616
617 public:
619 size_t numBoundarySegments () const
620 {
621#ifdef ALUGRID_VERTEX_PROJECTION
622 return myGrid().numMacroBndSegments();
623#else
624 derr << "Method available in any version of ALUGrid > 1.14 \n";
625 return 0;
626#endif
627 }
628
631 {
632 return (vertexProjection_ != 0);
633 }
634
635 using BaseType :: getRealImplementation ;
636
637 public:
638 template< class IntersectionType >
639 const typename BaseType
640 :: template ReturnImplementationType< IntersectionType>
641 :: ImplementationType &
642 getRealIntersection ( const IntersectionType &intersection ) const
643 {
644 return this->getRealImplementation( intersection );
645 }
646
647 const GridObjectFactoryType& factory() const {
648#ifdef USE_SMP_PARALLEL
649 assert( (int) factoryVec_.size() > GridObjectFactoryType :: threadNumber() );
650 return factoryVec_[ GridObjectFactoryType :: threadNumber() ];
651#else
652 return factory_;
653#endif
654 }
655
656 protected:
657 // max level of grid
658 int maxlevel_;
659 friend class IntersectionIteratorWrapper < const ThisType, LeafIntersectionIteratorImp > ;
660 friend class IntersectionIteratorWrapper < const ThisType, LevelIntersectionIteratorImp > ;
661 friend class LeafIntersectionIteratorWrapper < const ThisType > ;
662 friend class LevelIntersectionIteratorWrapper< const ThisType > ;
663
664 mutable ALU2dGridMarkerVector marker_[MAXL];
665 public:
666 typedef ALU2dGridLeafMarkerVector ALU2dGridLeafMarkerVectorType;
667 private:
668 // always update this marker!!!
669 mutable ALU2dGridLeafMarkerVectorType leafMarker_;
670
671 public:
672 template < class EntitySeed >
673 typename Traits :: template Codim< EntitySeed :: codimension > :: EntityPointer
674 entityPointer( const EntitySeed& seed ) const
675 {
676 enum { codim = EntitySeed :: codimension };
677 typedef ALU2dGridEntityPointer < codim, const ThisType > ALUPointer ;
678 return ALUPointer( factory(), seed ) ;
679 }
680
683 ALU2dGridMarkerVector & getMarkerVector(int level) const
684 {
685 assert( level >= 0);
686 assert( level <= MAXL);
687 return marker_[level];
688 }
689
692 ALU2dGridLeafMarkerVectorType & getLeafMarker() const
693 {
694 return leafMarker_;
695 }
696
699 template <GrapeIOFileFormatType ftype>
700 bool writeGrid( const std::string filename, alu2d_ctype time ) const ;
701
702 bool writeGrid_Xdr( const std::string filename, alu2d_ctype time ) const ;
703 bool writeGrid_Ascii( const std::string filename, alu2d_ctype time ) const ;
704
707 template <GrapeIOFileFormatType ftype>
708 bool readGrid( const std::string filename, alu2d_ctype & time );
709
711 void backup( std::ostream& ) const ;
712
714 void restore( std::istream& ) ;
715
718 {
719 return ! nonConform ();
720 }
721
722 protected:
725 bool nonConform () const
726 {
727 return (nrOfHangingNodes_ > 0);
728 }
729
730#if ALU2DGRID_PARALLEL
731 typedef RankManager<ThisType> RankManagerType;
732 RankManagerType rankManager_;
733 public:
734 const RankManagerType& rankManager() const
735 {
736 return rankManager_;
737 }
738#endif
739
740 public:
742 template<class DataHandleImp,class DataTypeImp>
744 InterfaceType iftype, CommunicationDirection dir, int level) const;
745
749 template<class DataHandleImp,class DataTypeImp>
751 InterfaceType iftype, CommunicationDirection dir) const;
752
753 int ghostSize ( int level, int codim ) const
754 {
755 return ghostSize( codim );
756 }
757
758 int ghostSize ( int codim ) const
759 {
760#if ALU2DGRID_PARALLEL
761 return 1;
762#else
763 return 0;
764#endif
765 }
766
768 bool loadBalance() ;
769
771 template<class DataHandle>
772 bool loadBalance(DataHandle& data) ;
773
774 void checkManager() {
775#if ALU2DGRID_PARALLEL
776 rankManager_.notifyMarking () ;
777#endif
778 }
779
780 }; // end class ALU2dGrid
781
782 namespace Capabilities
783 {
784 template<int dim, int dimw, ALU2DSPACE ElementType eltype, int cdim>
785 struct hasEntity<ALU2dGrid<dim,dimw,eltype>, cdim >
786 {
787 static const bool v = true;
788 };
789
790 template<int dim, int dimw, ALU2DSPACE ElementType eltype>
791 struct isLevelwiseConforming< ALU2dGrid<dim,dimw,eltype> >
792 {
793 static const bool v = false;
794 };
795
796 } // end namespace Capabilities
797
798} // end namespace Dune
799
800#include "entity.hh"
801#include "geometry.hh"
802#include <dune/grid/alugrid/2d/intersection.hh>
803#include <dune/grid/alugrid/2d/iterator.hh>
804
805#include "grid_imp.cc"
806
807#endif
Definition: entity.hh:540
Definition: entity.hh:55
Definition: geometry.hh:631
hierarchic index set of ALU2dGrid
Definition: indexsets.hh:42
Hierarchic Iterator of ALU2dGrid.
Definition: iterator.hh:416
Definition: intersection.hh:102
HierarchicIndexSet hIndexSet_
the hierarchic index set
Definition: grid.hh:561
bool conformingRefinement() const
return true if grid uses conforming refinement
Definition: grid.hh:717
LevelIteratorType lend(int level) const
last entity of codim 0 on level
GridFamily::LevelIndexSetImp LevelIndexSetImp
Type of the level index set.
Definition: grid.hh:290
ALU2dGridFamily< dim, dimworld, eltype > GridFamily
my Traits class
Definition: grid.hh:273
ALU2dGrid(const std::string macroTriangFilename, const int nrOfHangingNodes, const DuneBoundaryProjectionType *, const DuneBoundaryProjectionVector *, std::istream *macroFile=0)
int size(int level, int cd) const
number of grid entities per level and codim
bool loadBalance()
Re-balances the load each process has to handle for a parallel grid,.
Traits::template Codim< codim >::LeafIterator leafbegin() const
General definiton for a leaf iterator.
ALU2dGridLeafIterator< 0, All_Partition, const ThisType > LeafIteratorImp
a standard leaf iterator
Definition: grid.hh:295
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
bool hasBoundaryProjection() const
return true if boudanry projection is set
Definition: grid.hh:630
const CollectiveCommunicationType & comm() const
return dummy communication
bool preAdapt()
returns if a least one entity was marked for coarsening
bool writeGrid(const std::string filename, alu2d_ctype time) const
write Grid to file in specified FileFormatType
bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
void postAdapt()
clear all entity new markers
LocalIdSetImp localIdSet_
out global id set
Definition: grid.hh:564
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
Communicate information on distributed entities on the leaf grid. Template parameter is a model of Du...
const HierarchicIndexSet & hierarchicIndexSet() const
get hierarchic index set of the grid
size_t numBoundarySegments() const
return number of macro boundary segments
Definition: grid.hh:619
ALU2dGridObjectStream ObjectStreamType
dummy object stream
Definition: grid.hh:268
ALU2dGridHierarchicIndexSet< dim, dimworld, elementType > HierarchicIndexSet
Type of the hierarchic index set.
Definition: grid.hh:276
LevelIteratorType lbegin(int level) const
Iterator to first entity of codim 0 on level.
GridFamily::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set.
Definition: grid.hh:292
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: grid.hh:442
const GlobalIdSet & globalIdSet() const
get global id set of grid
ALU2dGrid(int)
Constructor which constructs an empty ALU2dGrid.
std::vector< LevelIndexSetImp * > levelIndexVec_
the level index set ( default type )
Definition: grid.hh:567
int size(int level, GeometryType type) const
number of entities per level, codim and geometry type in this process
int hierSetSize(int cd) const
number of grid entities in the entire grid for given codim
bool readGrid(const std::string filename, alu2d_ctype &time)
read Grid from file filename and store time of mesh in time
Traits::template Codim< codim >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
bool loadBalance(DataHandle &data)
Re-balances the load each process has to handle for a parallel grid,.
void backup(std::ostream &) const
backup to ostream
void restore(std::istream &)
restore from istream
void globalRefine(int refCount)
refine grid refCount times
ALU2dGridLevelIterator< 0, All_Partition, const ThisType > LevelIteratorImp
a standard leaf iterator
Definition: grid.hh:300
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lend(int level) const
one past the end on this level
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Communicate information on distributed entities on a given level Template parameter is a model of Dun...
const Traits::LeafIndexSet & leafIndexSet() const
get leaf index set of the grid
SizeCache< ThisType > SizeCacheType
the type of our size cache
Definition: grid.hh:581
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
General definiton for a leaf iterator.
@ refineEstimate_
if one element is refined then it causes apporximately not more than this number of new elements
Definition: grid.hh:326
@ MAXL
maximal number of levels is 64
Definition: grid.hh:312
int size(int codim) const
number of leaf entities per codim in this process
~ALU2dGrid()
Desctructor.
ALU2dGridLeafMarkerVectorType & getLeafMarker() const
Definition: grid.hh:692
bool nonConform() const
Definition: grid.hh:725
Traits::GlobalIdSet GlobalIdSet
Type of the global id set.
Definition: grid.hh:283
const DuneBoundaryProjectionType * boundaryProjection(const int segmentIndex) const
return boudanry projection for given segment Id
Definition: grid.hh:602
LeafIndexSetImp * leafIndexSet_
the leaf index set
Definition: grid.hh:574
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
HmeshType * mygrid_
the real grid
Definition: grid.hh:546
Traits::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
boundary projection type
Definition: grid.hh:332
Traits::DuneBoundaryProjectionType DuneBoundaryProjectionType
boundary projection type
Definition: grid.hh:330
const Traits::LevelIndexSet & levelIndexSet(int level) const
get level index set of the grid
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
const LocalIdSet & localIdSet() const
get global id set of grid
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
@ newElementsChunk_
normal default number of new elements for new adapt method
Definition: grid.hh:318
int maxLevel() const
Traits::LocalIdSet LocalIdSet
Type of the local id set.
Definition: grid.hh:286
ALU2dGridMarkerVector & getMarkerVector(int level) const
Definition: grid.hh:683
ALU2dGridLocalIdSet< dim, dimworld, elementType > LocalIdSetImp
Type of the local id set.
Definition: grid.hh:279
int size(GeometryType type) const
number of leaf entities per codim and geometry type in this process
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:15
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:75
Checks wether a type is convertible to another.
Definition: typetraits.hh:213
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:37
Wrapper class for pointers to entities.
Definition: entitypointer.hh:92
Wrapper class for entities.
Definition: entity.hh:57
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Wrapper class for geometries.
Definition: geometry.hh:102
Definition: grid.hh:1017
static ReturnImplementationType< InterfaceType >::ImplementationType & getRealImplementation(InterfaceType &i)
return real implementation of interface class
Definition: grid.hh:1223
Grid view abstract base class.
Definition: gridview.hh:57
Id Set Interface.
Definition: indexidset.hh:403
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: intersection.hh:161
organizes the caching of sizes for one grid and one GeometryType
Definition: sizecache.hh:30
A set of traits classes to store static information about grid implementation.
Different resources needed by all grid implementations.
Provides default index set implementations for Level- and LeafIndexsets used by ALUGrid.
Provides a Interfaces for detection of specific behavior.
DErrType derr(std::cerr)
Stream for error messages.
Definition: stdstreams.hh:194
Provides proxy classes for IntersectionsIterators.
Dune namespace.
Definition: alignment.hh:14
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:164
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:80
Helpers for dealing with MPI.
Provides size cache classes to implement the grids size method efficiently.
Fallback implementation of the C++0x static_assert feature.
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:24
Tagging interface to indicate that Grid has HierarchicIndexSet.
Definition: interfaces.hh:51
Tagging interface to indicate that Grid provides typedef ObjectStreamType.
Definition: interfaces.hh:16
Definition: grid.hh:1376
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)