Dune Core Modules (2.4.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>
15
17#include <dune/grid/alugrid/common/declaration.hh>
20#include <dune/grid/common/defaultgridview.hh>
22
24
25// bnd projection stuff
26#include <dune/grid/common/boundaryprojection.hh>
27#include <dune/grid/alugrid/2d/bndprojection.hh>
28
29//- Local includes
30#include "indexsets.hh"
31#include <dune/grid/alugrid/common/objectfactory.hh>
32#include "datahandle.hh"
33
34namespace Dune {
35
36 // Forward declarations
37 template<int cd, int dim, class GridImp>
38 class ALU2dGridEntity;
39 template<int cd, PartitionIteratorType pitype, class GridImp >
40 class ALU2dGridLevelIterator;
41 template<int cd, class GridImp >
42 class ALU2dGridEntityPointer;
43 template<int cd, class GridImp >
44 class ALU2dGridEntitySeed;
45 template<int mydim, int coorddim, class GridImp>
46 class ALU2dGridMakeableGeometry;
47 template<int mydim, int cdim, class GridImp>
48 class ALU2dGridGeometry;
49 template<class GridImp>
50 class ALU2dGridHierarchicIterator;
51 template<class GridImp>
52 class ALU2dGridIntersectionBase;
53 template<class GridImp>
54 class ALU2dGridLevelIntersectionIterator;
55 template<class GridImp>
56 class ALU2dGridLeafIntersectionIterator;
57 template<int codim, PartitionIteratorType pitype, class GridImp>
58 class ALU2dGridLeafIterator;
59 template <int mydim, int coorddim, class GridImp>
60 class ALU2dGridMakeableEntity;
61 template <class GridImp>
62 class ALU2dGridFaceGeometryInfo;
63 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
64 class ALU2dGridLocalIdSet;
65 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
66 class ALU2dGridHierarchicIndexSet;
67 template <class EntityImp>
68 class ALUMemoryProvider;
69 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
70 class ALU2dGrid;
71 template <class GridImp, class GeometryImp, int nChild>
72 class ALULocalGeometryStorage;
73
74 class ALU2dObjectStream;
75
76 // Internal Forward Declarations
77 // -----------------------------
78
79 template < int dimw, class Comm >
80 struct ALUGridBaseGrid< 2, dimw, cube, Comm >
81 {
82 typedef ALU2dGrid< 2, dimw, ALU2DSPACE quadrilateral > BaseGrid ;
83 };
84
85 template < int dimw, class Comm >
86 struct ALUGridBaseGrid< 2, dimw, simplex, Comm >
87 {
88 typedef ALU2dGrid< 2, dimw, ALU2DSPACE triangle > BaseGrid ;
89 };
90
91
92 //
93 // --ALU2dGrid
94 // --Grid
95 //
96 //**********************************************************************
97 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
98 struct ALU2dGridFamily
99 {
100 typedef ALU2dGrid< dim, dimworld, eltype > GridImp;
101
103 typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> GlobalIdSetImp;
104
106 typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> LocalIdSetImp;
107
108 typedef int GlobalIdType;
109 typedef int LocalIdType;
110
111 struct Traits
112 {
113 typedef GridImp Grid;
114
117
118 typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper< const GridImp >, LeafIntersectionWrapper< const GridImp > > IntersectionIterator;
119 typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper< const GridImp >, LeafIntersectionWrapper< const GridImp > > LeafIntersectionIterator;
120 typedef Dune::IntersectionIterator<const GridImp, LevelIntersectionIteratorWrapper< const GridImp >, LevelIntersectionWrapper< const GridImp > > LevelIntersectionIterator;
121
123
124 typedef DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType;
125 typedef std::vector< const DuneBoundaryProjectionType *> DuneBoundaryProjectionVector;
126
127 template <int cd>
128 struct Codim
129 {
130 // IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
131 typedef ALU2dGridGeometry< dim-cd, dimworld, const GridImp > GeometryImpl;
132 typedef ALU2dGridGeometry< dim-cd, dim, const GridImp > LocalGeometryImpl;
133 typedef Dune::Geometry< dim-cd, dimworld, const GridImp, ALU2dGridGeometry > Geometry;
134 typedef Dune::Geometry< dim-cd, dim, const GridImp, ALU2dGridGeometry > LocalGeometry;
135
136 // we could - if needed - introduce an other struct for dimglobal of Geometry
138
139 typedef ALU2dGridEntityPointer< cd, const GridImp > EntityPointerImpl;
141
142 // minimal information to generate entities
143 typedef ALU2dGridEntitySeed< cd , const GridImp > EntitySeed ;
144
145 template <PartitionIteratorType pitype>
146 struct Partition
147 {
150 };
151
152 typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
153 typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
154
155 };
156
157 template <PartitionIteratorType pitype>
158 struct Partition
159 {
161 LevelGridView;
163 LeafGridView;
164 };
165
167 typedef DefaultIndexSet< GridImp, typename Codim<0>::LevelIterator > LevelIndexSetImp;
169 typedef DefaultIndexSet< GridImp, typename Codim<0>::LeafIterator > LeafIndexSetImp;
170
171 typedef IndexSet<GridImp,LevelIndexSetImp> LevelIndexSet;
172 typedef LeafIndexSetImp LeafIndexSet;
173 typedef IdSet<GridImp,GlobalIdSetImp,GlobalIdType> GlobalIdSet;
174 typedef IdSet<GridImp,LocalIdSetImp,LocalIdType> LocalIdSet;
175
176#if ALU2DGRID_PARALLEL
177 typedef Dune :: CollectiveCommunication< MPI_Comm >
178 CollectiveCommunication;
179#else
180 typedef Dune :: CollectiveCommunication< GridImp >
181 CollectiveCommunication;
182#endif
183 };
184
186 typedef typename Traits :: LevelIndexSetImp LevelIndexSetImp;
187
189 typedef typename Traits :: LeafIndexSetImp LeafIndexSetImp;
190 }; // end of ALU2dGridFamily
191
192
207 template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
209 : public GridDefaultImplementation< dim, dimworld, alu2d_ctype, ALU2dGridFamily< dim, dimworld, eltype > >,
210 public HasObjectStream,
212 {
215
216 static_assert( dim == 2, "ALU2dGrid only implemented for grid dim 2." );
217 static_assert( dimworld == 2 || dimworld == 3, "ALU2dGrid only implemented for world dim 2 or 3." );
218
219 public:
220 static const ALU2DSPACE ElementType elementType = eltype;
221
222 typedef typename ALU2dGridFamily< dim, dimworld, elementType >::Traits Traits;
223
224 // new intersection iterator is a wrapper which get itersectioniteratoimp as pointers
225 typedef ALU2dGridLeafIntersectionIterator <const ThisType> LeafIntersectionIteratorImp;
226 typedef ALU2dGridLevelIntersectionIterator<const ThisType> LevelIntersectionIteratorImp;
227
228 typedef ALUGridObjectFactory< ThisType > GridObjectFactoryType;
229
230 private:
231
232 typedef typename ALU2dImplTraits<dimworld, elementType >::HmeshType HmeshType ;
233 typedef typename ALU2dImplTraits<dimworld, elementType >::HElementType HElementType ;
234 typedef typename ALU2dImplTraits<dimworld, elementType >::ElementType ElementType ;
235
236 template< class > friend struct DGFBaseFactory;
237
238 template< int, int, class > friend class ALU2dGridEntity;
239
240 friend class ALU2dGridGeometry<0,dimworld,const ThisType>;
241 friend class ALU2dGridGeometry<1,dimworld,const ThisType>;
242 friend class ALU2dGridGeometry<dim,dimworld,const ThisType>;
243 template< class, class, int > friend class ALULocalGeometryStorage;
244
245 friend class ALU2dGridEntityPointer<0,const ThisType>;
246 friend class ALU2dGridEntityPointer<1,const ThisType>;
247 friend class ALU2dGridEntityPointer<dim,const ThisType>;
248
249 friend class ALU2dGridHierarchicIndexSet<dim,dimworld,elementType>;
250
251 friend class ALU2dGridIntersectionBase < const ThisType > ;
252 friend class ALU2dGridLevelIntersectionIterator< const ThisType > ;
253 friend class ALU2dGridLeafIntersectionIterator< const ThisType > ;
254
255 //**********************************************************
256 // The Interface Methods
257 //**********************************************************
258 protected:
259 typedef MakeableInterfaceObject<typename Traits::template
261 friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 4 >;
262 friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 2 >;
263
264 public:
265
267 typedef ALU2dGridObjectStream ObjectStreamType;
268 typedef ObjectStreamType InStreamType ;
269 typedef ObjectStreamType OutStreamType ;
270
272 typedef ALU2dGridFamily < dim, dimworld, eltype > GridFamily;
273
276
280
282 typedef typename Traits :: GlobalIdSet GlobalIdSet;
283
285 typedef typename Traits :: LocalIdSet LocalIdSet;
286
287
289 typedef typename GridFamily :: LevelIndexSetImp LevelIndexSetImp;
291 typedef typename GridFamily :: LeafIndexSetImp LeafIndexSetImp;
292
294 typedef ALU2dGridLeafIterator<0, All_Partition, const ThisType> LeafIteratorImp;
295 typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
296 typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
297
299 typedef ALU2dGridLevelIterator<0, All_Partition, const ThisType> LevelIteratorImp;
300 typedef typename Traits::template Codim<0>::LevelIterator LevelIteratorType;
301 typedef typename Traits::template Codim<0>::LevelIterator LevelIterator;
302
304
305 typedef typename Traits::CollectiveCommunication CollectiveCommunicationType;
306
307
309 enum {
311 MAXL = 64
312 };
313
315 enum {
318 };
319
321 enum {
325 refineEstimate_ = 40
326 };
327
329 typedef typename Traits :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
331 typedef typename Traits :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
332
333#ifdef ALUGRID_VERTEX_PROJECTION
335 typedef ALUGridSpace :: VertexProjection< dimworld > ALUGridVertexProjectionType;
336#endif
337
338
339 protected:
340
341 friend class ALUGridBoundaryProjection< ThisType >;
342 friend class ALU2dGridBoundaryProjection< ThisType >;
343 // type of ALUGrid boundary projection wrapper
344 typedef ALU2dGridBoundaryProjection< ThisType > ALUGridBoundaryProjectionType;
345
348 //- --constructor
349 ALU2dGrid(const std::string macroTriangFilename,
350 const int nrOfHangingNodes,
353 std::istream* macroFile = 0) DUNE_DEPRECATED_MSG("ALUGrid is deprecated, please use the new module DUNE-ALUGrid.");
354
355 // method creating mesh object
356 HmeshType* createGrid(const std::string&,
357 const int,
358 std::istream* );
359
361 explicit ALU2dGrid( int );
362
363 public:
366
369 int maxLevel() const;
370
373 template<int cd, PartitionIteratorType pitype>
374 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
375 lbegin (int level) const;
376
378 template<int cd, PartitionIteratorType pitype>
379 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
380 lend (int level) const;
381
383 template<int cd>
384 typename Traits::template Codim<cd>::
385 template Partition<All_Partition>::LevelIterator
386 lbegin (int level) const;
387
389 template<int cd>
390 typename Traits::template Codim<cd>::
391 template Partition<All_Partition>::LevelIterator
392 lend (int level) const;
393
395 LevelIteratorType lbegin (int level) const;
396
398 LevelIteratorType lend (int level) const;
399
401 template <int codim, PartitionIteratorType pitype>
402 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
403 leafbegin() const;
404
406 template <int codim, PartitionIteratorType pitype>
407 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
408 leafend() const;
409
411 template <int codim>
412 typename Traits::template Codim<codim>::LeafIterator
413 leafbegin() const;
414
416 template <int codim>
417 typename Traits::template Codim<codim>::LeafIterator
418 leafend() const;
419
420 private:
422 LeafIteratorType leafbegin () const;
423
425 LeafIteratorType leafend () const;
426
427 public:
429 int size (int level, int cd) const;
430
432 int size (int codim) const;
433
435 int size (int level, GeometryType type) const;
436
438 int size (GeometryType type) const;
439
441 const std::vector<GeometryType>& geomTypes (int codim) const { return geomTypes_[codim]; }
442
443 //****************************************************************
444 // index and id sets
445 //****************************************************************
446
448 const GlobalIdSet & globalIdSet () const;
449
451 const LocalIdSet & localIdSet () const;
452
454 int hierSetSize (int cd) const;
455
458
460 const typename Traits :: LeafIndexSet & leafIndexSet () const;
461
463 const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
464
465
466 //**********************************************************
467 // End of Interface Methods
468 //**********************************************************
469
470 // return reference to org ALU2dGrid
471 // private method, but otherwise we have to friend class all possible
472 // types of LevelIterator ==> later
473 HmeshType & myGrid();
474 HmeshType & myGrid() const;
475
477 void globalRefine ( int refCount );
478
479 template< class GridImp, class DataHandle >
481
483 bool preAdapt ( );
484
486 void postAdapt ( );
487
491 bool adapt ();
492
493 template< class GridImp, class DataHandle >
495
496 // refine grid
497 bool refineGrid();
498
500 int getMark(const typename Traits::template Codim<0>::Entity & e) const;
501
503 bool mark( int refCount , const typename Traits::template Codim<0>::Entity & e);
504
506 const CollectiveCommunicationType & comm() const;
507 private:
508 CollectiveCommunicationType comm_;
509
510 void updateStatus();
511
512 void calcMaxlevel();
513
514 void calcExtras();
515
516 // clear refinement marker of element and all children
517 void hierarchicClear( HElementType *el );
518 public:
522
523 protected:
524 // create GeomTypes
525 void makeGeomTypes ();
526
527 friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
528 friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
529
530 friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
531 friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
532
533 private:
535 ALU2dGrid( const ThisType & g );
536
538 ThisType & operator = (const ThisType & g);
539
540 protected:
541 // check macro file and return const char * to filename
542 const char * checkMacroGridFile(const std::string & filename);
543
545 mutable HmeshType* mygrid_;
546
547 // return reference to grid
548 HmeshType& mesh() const {
549 assert(mygrid_);
550 return *mygrid_;
551 }
552
553#ifdef USE_SMP_PARALLEL
554 std::vector< GridObjectFactoryType > factoryVec_;
555#else
556 GridObjectFactoryType factory_;
557#endif
558
561
564
566 mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
567
568 // at the moment the number of different geom types is 1
569 enum { numberOfGeomTypes = 1 };
570 std::vector< std::vector<GeometryType> > geomTypes_;
571
574
575 int maxLevel_;
576 int refineMarked_ , coarsenMarked_;
577 const int nrOfHangingNodes_;
578
581 SizeCacheType * sizeCache_;
582
583 // flag to make sure postAdapt is called after adapt
584 bool lockPostAdapt_;
585
586 // pointer to Dune boundary projection
587 const DuneBoundaryProjectionType* bndPrj_;
588
589 // pointer to Dune boundary projection
590 const DuneBoundaryProjectionVector* bndVec_;
591
592 // boundary projection for vertices
593 ALUGridBoundaryProjectionType* vertexProjection_ ;
594
595 const DuneBoundaryProjectionType *globalProjection () const
596 {
597 return bndPrj_;
598 }
599
601 const DuneBoundaryProjectionType* boundaryProjection(const int segmentIndex) const
602 {
603 if( bndPrj_ )
604 {
605 return bndPrj_;
606 }
607 else
608 {
609 // note pointer can be zero (identity mapping)
610 assert( bndVec_ );
611 assert( segmentIndex < (int) bndVec_->size() );
612 return (*bndVec_)[ segmentIndex ];
613 }
614 }
615
616 public:
618 size_t numBoundarySegments () const
619 {
620#ifdef ALUGRID_VERTEX_PROJECTION
621 return myGrid().numMacroBndSegments();
622#else
623 derr << "Method available in any version of ALUGrid > 1.14 \n";
624 return 0;
625#endif
626 }
627
630 {
631 return (vertexProjection_ != 0);
632 }
633
634 using BaseType :: getRealImplementation ;
635
636 public:
637 template< class IntersectionType >
638 const typename BaseType
639 :: template ReturnImplementationType< IntersectionType>
640 :: ImplementationType &
641 getRealIntersection ( const IntersectionType &intersection ) const
642 {
643 return this->getRealImplementation( intersection );
644 }
645
646 const GridObjectFactoryType& factory() const {
647#ifdef USE_SMP_PARALLEL
648 assert( (int) factoryVec_.size() > GridObjectFactoryType :: threadNumber() );
649 return factoryVec_[ GridObjectFactoryType :: threadNumber() ];
650#else
651 return factory_;
652#endif
653 }
654
655 protected:
656 // max level of grid
657 int maxlevel_;
658 friend class IntersectionIteratorWrapper < const ThisType, LeafIntersectionIteratorImp > ;
659 friend class IntersectionIteratorWrapper < const ThisType, LevelIntersectionIteratorImp > ;
660 friend class LeafIntersectionIteratorWrapper < const ThisType > ;
661 friend class LevelIntersectionIteratorWrapper< const ThisType > ;
662
663 mutable ALU2dGridMarkerVector marker_[MAXL];
664 public:
665 typedef ALU2dGridLeafMarkerVector ALU2dGridLeafMarkerVectorType;
666 private:
667 // always update this marker!!!
668 mutable ALU2dGridLeafMarkerVectorType leafMarker_;
669
670 public:
671 template < class EntitySeed >
672 typename Traits :: template Codim< EntitySeed :: codimension > :: EntityPointer
673 entityPointer( const EntitySeed& seed ) const
674 {
675 enum { codim = EntitySeed :: codimension };
676 typedef ALU2dGridEntityPointer < codim, const ThisType > ALUPointer ;
677 return ALUPointer( factory(), seed ) ;
678 }
679
682 ALU2dGridMarkerVector & getMarkerVector(int level) const
683 {
684 assert( level >= 0);
685 assert( level <= MAXL);
686 return marker_[level];
687 }
688
691 ALU2dGridLeafMarkerVectorType & getLeafMarker() const
692 {
693 return leafMarker_;
694 }
695
698 template <GrapeIOFileFormatType ftype>
699 bool writeGrid( const std::string filename, alu2d_ctype time ) const ;
700
701 bool writeGrid_Xdr( const std::string filename, alu2d_ctype time ) const ;
702 bool writeGrid_Ascii( const std::string filename, alu2d_ctype time ) const ;
703
706 template <GrapeIOFileFormatType ftype>
707 bool readGrid( const std::string filename, alu2d_ctype & time );
708
710 void backup( std::ostream& ) const ;
711
713 void restore( std::istream& ) ;
714
717 {
718 return ! nonConform ();
719 }
720
721 protected:
724 bool nonConform () const
725 {
726 return (nrOfHangingNodes_ > 0);
727 }
728
729#if ALU2DGRID_PARALLEL
730 typedef RankManager<ThisType> RankManagerType;
731 RankManagerType rankManager_;
732 public:
733 const RankManagerType& rankManager() const
734 {
735 return rankManager_;
736 }
737#endif
738
739 public:
741 template<class DataHandleImp,class DataTypeImp>
743 InterfaceType iftype, CommunicationDirection dir, int level) const;
744
748 template<class DataHandleImp,class DataTypeImp>
750 InterfaceType iftype, CommunicationDirection dir) const;
751
752 int ghostSize ( int level, int codim ) const
753 {
754 return ghostSize( codim );
755 }
756
757 int ghostSize ( int codim ) const
758 {
759#if ALU2DGRID_PARALLEL
760 return 1;
761#else
762 return 0;
763#endif
764 }
765
767 bool loadBalance() ;
768
770 template<class DataHandle>
771 bool loadBalance(DataHandle& data) ;
772
773 void checkManager() {
774#if ALU2DGRID_PARALLEL
775 rankManager_.notifyMarking () ;
776#endif
777 }
778
779 }; // end class ALU2dGrid
780
781 namespace Capabilities
782 {
783 template<int dim, int dimw, ALU2DSPACE ElementType eltype, int cdim>
784 struct hasEntity<ALU2dGrid<dim,dimw,eltype>, cdim >
785 {
786 static const bool v = true;
787 };
788
789 template<int dim, int dimw, ALU2DSPACE ElementType eltype>
790 struct isLevelwiseConforming< ALU2dGrid<dim,dimw,eltype> >
791 {
792 static const bool v = false;
793 };
794
795 } // end namespace Capabilities
796
797} // end namespace Dune
798
799#include "entity.hh"
800#include "geometry.hh"
801#include <dune/grid/alugrid/2d/intersection.hh>
802#include <dune/grid/alugrid/2d/iterator.hh>
803
804#include "grid_imp.cc"
805
806#endif
Definition: entity.hh:549
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
[ provides Dune::Grid ]
Definition: grid.hh:212
HierarchicIndexSet hIndexSet_
the hierarchic index set
Definition: grid.hh:560
bool conformingRefinement() const
return true if grid uses conforming refinement
Definition: grid.hh:716
GridFamily::LevelIndexSetImp LevelIndexSetImp
Type of the level index set.
Definition: grid.hh:289
ALU2dGridFamily< dim, dimworld, eltype > GridFamily
my Traits class
Definition: grid.hh:272
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,.
ALU2dGridLeafIterator< 0, All_Partition, const ThisType > LeafIteratorImp
a standard leaf iterator
Definition: grid.hh:294
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
@ MAXL
maximal number of levels is 64
Definition: grid.hh:311
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:629
@ refineEstimate_
if one element is refined then it causes apporximately not more than this number of new elements
Definition: grid.hh:325
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:563
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:618
ALU2dGridObjectStream ObjectStreamType
dummy object stream
Definition: grid.hh:267
ALU2dGridHierarchicIndexSet< dim, dimworld, elementType > HierarchicIndexSet
Type of the hierarchic index set.
Definition: grid.hh:275
GridFamily::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set.
Definition: grid.hh:291
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: grid.hh:441
const GlobalIdSet & globalIdSet() const
get global id set of grid
std::vector< LevelIndexSetImp * > levelIndexVec_
the level index set ( default type )
Definition: grid.hh:566
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
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:299
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...
ALU2dGrid(const std::string macroTriangFilename, const int nrOfHangingNodes, const DuneBoundaryProjectionType *, const DuneBoundaryProjectionVector *, std::istream *macroFile=0) DUNE_DEPRECATED_MSG("ALUGrid is deprecated
const Traits::LeafIndexSet & leafIndexSet() const
get leaf index set of the grid
SizeCache< ThisType > SizeCacheType
the type of our size cache
Definition: grid.hh:580
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const
General definiton for a leaf iterator.
@ newElementsChunk_
normal default number of new elements for new adapt method
Definition: grid.hh:317
ALU2dGridLeafMarkerVectorType & getLeafMarker() const
Definition: grid.hh:691
bool nonConform() const
Definition: grid.hh:724
Traits::GlobalIdSet GlobalIdSet
Type of the global id set.
Definition: grid.hh:282
const DuneBoundaryProjectionType * boundaryProjection(const int segmentIndex) const
return boudanry projection for given segment Id
Definition: grid.hh:601
LeafIndexSetImp * leafIndexSet_
the leaf index set
Definition: grid.hh:573
HmeshType * mygrid_
the real grid
Definition: grid.hh:545
Traits::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
boundary projection type
Definition: grid.hh:331
Traits::DuneBoundaryProjectionType DuneBoundaryProjectionType
boundary projection type
Definition: grid.hh:329
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
int maxLevel() const
Traits::LocalIdSet LocalIdSet
Type of the local id set.
Definition: grid.hh:285
ALU2dGridMarkerVector & getMarkerVector(int level) const
Definition: grid.hh:682
ALU2dGridLocalIdSet< dim, dimworld, elementType > LocalIdSetImp
Type of the local id set.
Definition: grid.hh:278
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:15
[ provides Dune::Grid ]
Definition: declaration.hh:63
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:31
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:73
Checks wether a type is convertible to another.
Definition: typetraits.hh:177
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:113
Wrapper class for entities.
Definition: entity.hh:62
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Wrapper class for geometries.
Definition: geometry.hh:66
Definition: grid.hh:1030
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition: grid.hh:1305
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
Iterator to first entity of given codim on level for PartitionType All_Partition.
Definition: grid.hh:1043
Grid view abstract base class.
Definition: gridview.hh:59
Id Set Interface.
Definition: indexidset.hh:414
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:84
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.
PartitionIteratorType
Parameter to be used for the parallel level- and leaf iterators.
Definition: gridenums.hh:134
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
@ All_Partition
all entities
Definition: gridenums.hh:139
DErrType derr(std::cerr)
Stream for error messages.
Definition: stdstreams.hh:193
Provides proxy classes for IntersectionsIterators.
Helpers for dealing with MPI.
Dune namespace.
Definition: alignment.hh:10
STL namespace.
Provides size cache classes to implement the grids size method efficiently.
Static tag representing a codimension.
Definition: dimension.hh:22
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:1467
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)