3#ifndef DUNE_ALU3DGRIDGRID_HH
4#define DUNE_ALU3DGRIDGRID_HH
10#include <dune/grid/utility/grapedataioformattypes.hh>
16#include <dune/geometry/referenceelements.hh>
23#include <dune/grid/common/defaultgridview.hh>
26#include <dune/grid/common/boundaryprojection.hh>
27#include <dune/grid/alugrid/common/bndprojection.hh>
28#include <dune/grid/alugrid/common/objectfactory.hh>
29#include <dune/grid/alugrid/common/backuprestore.hh>
32#include "alu3dinclude.hh"
34#include "indexsets.hh"
35#include "datahandle.hh"
37#include <dune/grid/alugrid/3d/lbdatahandle.hh>
51 template<
int cd,
int dim,
class Gr
idImp>
52 class ALU3dGridEntity;
53 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
54 class ALU3dGridLevelIterator;
55 template<
int cd,
class Gr
idImp >
56 class ALU3dGridEntityPointerBase;
57 template<
int cd,
class Gr
idImp >
58 class ALU3dGridEntitySeed;
59 template<
int cd,
class Gr
idImp >
60 class ALU3dGridEntityPointer;
61 template<
int mydim,
int coorddim,
class Gr
idImp>
62 class ALU3dGridGeometry;
63 template<
class Gr
idImp>
64 class ALU3dGridHierarchicIterator;
65 template<
class Gr
idImp>
66 class ALU3dGridIntersectionIterator;
67 template<
class Gr
idImp>
68 class ALU3dGridLevelIntersectionIterator;
69 template<
int codim, PartitionIteratorType pitype,
class Gr
idImp>
70 class ALU3dGridLeafIterator;
71 template <
int mydim,
int coorddim,
class Gr
idImp>
72 class ALU3dGridMakeableEntity;
73 template <
class Gr
idImp>
74 class ALU3dGridFaceGeometryInfo;
75 template< ALU3dGr
idElementType,
class >
76 class ALU3dGridGlobalIdSet;
77 template< ALU3dGr
idElementType,
class >
78 class ALU3dGridLocalIdSet;
79 template< ALU3dGr
idElementType,
class >
80 class ALU3dGridHierarchicIndexSet;
81 template <
class EntityImp>
82 class ALUMemoryProvider;
84 class ALU3dGridFactory;
85 template <
class Gr
idImp,
class GeometryImp,
int nChild>
86 class ALULocalGeometryStorage;
87 template< ALU3dGr
idElementType elType,
class Comm >
88 struct ALU3dGridCommHelper;
96 template< ALU3dGr
idElementType elType,
class Comm = MPI_Comm >
99 template< ALU3dGr
idElementType elType,
class Comm = No_Comm >
103 template <
class Comm >
104 struct ALUGridBaseGrid< 3, 3, cube, Comm >
106 typedef ALU3dGrid< hexa, Comm > BaseGrid ;
109 template <
class Comm>
110 struct ALUGridBaseGrid< 3, 3, simplex, Comm >
112 typedef ALU3dGrid< tetra, Comm > BaseGrid ;
119 struct ALU3dGridCommunicationsBase
121 template <
class GitterImpl >
122 void checkForConformingRefinement( GitterImpl* grid,
123 const bool conformingRefinement )
125#ifdef ALUGRID_3D_CONFORMING_REFINEMENT
126 if( grid && conformingRefinement )
128 grid->enableConformingClosure();
129 grid->disableGhostCells();
136 template< ALU3dGr
idElementType elType,
class Comm >
137 struct ALU3dGridCommunications;
139 template< ALU3dGr
idElementType elType >
140 struct ALU3dGridCommunications< elType, No_Comm > :
public ALU3dGridCommunicationsBase
142 using ALU3dGridCommunicationsBase :: checkForConformingRefinement ;
144 typedef ALU3dGridLocalIdSet< elType, No_Comm > GlobalIdSet;
145 typedef int GlobalId;
147 typedef ALU3DSPACE GitterDuneImpl GitterImplType;
151 explicit ALU3dGridCommunications ( No_Comm comm ) {}
153 int nlinks ()
const {
return 0; }
155 GitterImplType *createALUGrid (
const std::string ¯oName, ALU3DSPACE ProjectVertex *projection,
156 const bool conformingRefinement )
158 GitterImplType* grid = ( macroName.empty() ) ?
159 new GitterImplType() :
new GitterImplType ( macroName.c_str(), projection );
161 checkForConformingRefinement( grid, conformingRefinement );
165 GitterImplType *createALUGrid ( std::istream& stream, ALU3DSPACE ProjectVertex *projection,
166 const bool conformingRefinement )
168#ifdef ALUGRID_CONSTRUCTION_WITH_STREAMS
169 GitterImplType* grid =
new GitterImplType ( stream, projection );
171 checkForConformingRefinement( grid, conformingRefinement );
178 static No_Comm defaultComm () {
return No_Comm(); }
180 static int getRank ( No_Comm comm ) {
return 0; }
182 static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
184 ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
185 dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF*
>( &grid.container() );
187 DUNE_THROW(InvalidStateException,
"dynamic_cast of ALUGrid builder failed");
191 static void duneNotifyMacroGridChanges ( GitterImplType &grid ) {}
193 CollectiveCommunication ccobj_;
196#if ALU3DGRID_PARALLEL
197 template< ALU3dGr
idElementType elType >
198 struct ALU3dGridCommunications< elType, MPI_Comm > :
public ALU3dGridCommunicationsBase
200 using ALU3dGridCommunicationsBase :: checkForConformingRefinement ;
202 typedef ALU3dGridGlobalIdSet< elType, MPI_Comm > GlobalIdSet;
203 typedef ALUGridId< ALUMacroKey > GlobalId;
205 typedef ALU3DSPACE GitterDunePll GitterImplType;
209 explicit ALU3dGridCommunications ( MPI_Comm comm )
210 : ccobj_( comm ), mpAccess_( comm )
213 int nlinks ()
const {
return mpAccess_.nlinks(); }
215 GitterImplType *createALUGrid (
const std::string ¯oName, ALU3DSPACE ProjectVertex *projection,
216 const bool conformingRefinement )
218 GitterImplType* grid =
new GitterImplType( macroName.c_str(), mpAccess_, projection );
220 checkForConformingRefinement( grid, conformingRefinement );
224 GitterImplType *createALUGrid ( std::istream& stream, ALU3DSPACE ProjectVertex *projection,
225 const bool conformingRefinement )
227#ifdef ALUGRID_CONSTRUCTION_WITH_STREAMS
228 GitterImplType* grid =
new GitterImplType ( stream, mpAccess_, projection );
230 checkForConformingRefinement( grid, conformingRefinement );
237 static MPI_Comm defaultComm () {
return MPI_COMM_WORLD; }
239 static int getRank ( MPI_Comm comm )
242 MPI_Comm_rank( comm, &rank );
246 static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
248 ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
249 dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF*
>( &grid.containerPll() );
251 DUNE_THROW(InvalidStateException,
"dynamic_cast of ALUGrid builder failed");
255 static void duneNotifyMacroGridChanges ( GitterImplType &grid )
257 grid.duneNotifyMacroGridChanges();
260 CollectiveCommunication ccobj_;
261 ALU3DSPACE MpAccessMPI mpAccess_;
270 template< ALU3dGr
idElementType elType,
class Comm >
271 struct ALU3dGridFamily
273 typedef ALU3dGrid< elType, Comm > GridImp;
274 typedef ALU3dGridFamily< elType, Comm > GridFamily;
276 static const int dim = 3;
277 static const int dimworld = 3;
280 typedef ALU3dGridLocalIdSet< elType, Comm > LocalIdSetImp;
283 typedef typename ALU3dGridCommunications< elType, Comm >::GlobalIdSet GlobalIdSetImp;
286 typedef typename ALU3dGridCommunications< elType, Comm >::GlobalId GlobalIdType;
289 typedef int LocalIdType;
294 typedef typename GridFamily::LocalIdType LocalIdType;
297 typedef typename GridFamily::GlobalIdType GlobalIdType;
299 typedef typename GridFamily::GridImp Grid;
311 typedef DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType;
312 typedef std::vector< const DuneBoundaryProjectionType * > DuneBoundaryProjectionVector;
318 typedef ALU3dGridGeometry< dim-cd, dimworld,
const Grid > GeometryImpl;
319 typedef ALU3dGridGeometry< dim-cd, dim,
const Grid > LocalGeometryImpl;
320 typedef Dune::Geometry< dim-cd, dimworld,
const Grid, ALU3dGridGeometry > Geometry;
321 typedef Dune::Geometry< dim-cd, dim,
const Grid, ALU3dGridGeometry > LocalGeometry;
326 typedef ALU3dGridEntitySeed< cd , const Grid> EntitySeed ;
328 typedef ALU3dGridEntityPointer< cd, const Grid > EntityPointerImpl;
331 template< PartitionIteratorType pitype >
338 typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
339 typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
342 template< PartitionIteratorType pitype >
350 typedef DefaultIndexSet< GridImp, typename Codim< 0 > :: LevelIterator > LevelIndexSetImp;
353 typedef DefaultIndexSet< GridImp, typename Codim< 0 > :: LeafIterator > LeafIndexSetImp;
355 typedef IndexSet< Grid, LevelIndexSetImp > LevelIndexSet;
356 typedef IndexSet< Grid, LeafIndexSetImp > LeafIndexSet;
357 typedef IdSet< Grid, LocalIdSetImp, LocalIdType > LocalIdSet;
358 typedef IdSet< Grid, GlobalIdSetImp, GlobalIdType > GlobalIdSet;
364 typedef typename Traits :: LevelIndexSetImp LevelIndexSetImp;
367 typedef typename Traits :: LeafIndexSetImp LeafIndexSetImp;
400 template< ALU3dGr
idElementType elType,
class Comm >
403 ALU3dGridFamily< elType, Comm > >,
426 friend class ALU3dGridEntityPointer< 0, const
ThisType >;
427 friend class ALU3dGridEntityPointer< 1, const
ThisType >;
428 friend class ALU3dGridEntityPointer< 2, const
ThisType >;
429 friend class ALU3dGridEntityPointer< 3, const
ThisType >;
432 friend class ALU3dGridHierarchicIterator< const
ThisType >;
435 friend class ALU3dGridGlobalIdSet< elType, Comm >;
436 friend class ALU3dGridLocalIdSet< elType, Comm >;
444 friend struct ALU3dGridCommHelper< elType, Comm >;
452 typedef ALU3dGridLevelIntersectionIterator<const ThisType>
453 LevelIntersectionIteratorImp;
464 enum { refineStepsForHalf = 1 };
466 static const ALU3dGridElementType elementType = elType;
467 typedef typename ALU3DSPACE GatherScatterType::ObjectStreamType ObjectStreamType;
468 typedef ObjectStreamType InStreamType ;
469 typedef ObjectStreamType OutStreamType ;
471 typedef ALU3dGridFamily< elType, Comm > GridFamily;
472 typedef typename GridFamily::Traits Traits;
510 typedef ALUGridObjectFactory< ThisType > GridObjectFactoryType;
520 typedef typename GridFamily::GlobalIdSetImp GlobalIdSetImp;
531 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIteratorType;
532 typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
534 typedef ALU3dGridHierarchicIterator< const ThisType > HierarchicIteratorImp;
536 typedef typename ALU3dImplTraits< elType, Comm >::GitterImplType GitterImplType;
559 typedef Comm MPICommunicatorType;
561 typedef ALU3dGridCommunications< elType, Comm > Communications;
569 ALU3dGrid (
const std::string ¯oTriangFilename,
570 const MPICommunicatorType mpiComm,
580 static inline std::string
name ();
588 template<
int cd, PartitionIteratorType pitype>
589 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
593 template<
int cd, PartitionIteratorType pitype>
594 typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
595 lend (
int level)
const;
599 typename Traits::template Codim<cd>::
600 template Partition<All_Partition>::LevelIterator
605 typename Traits::template Codim<cd>::
606 template Partition<All_Partition>::LevelIterator
607 lend (
int level)
const;
611 template <
int codim, PartitionIteratorType pitype>
612 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
613 leafbegin(
int level)
const;
616 template <
int codim, PartitionIteratorType pitype>
617 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
618 leafend(
int level)
const;
622 typename Traits::template Codim<codim>::LeafIterator
623 leafbegin(
int level)
const;
627 typename Traits::template Codim<codim>::LeafIterator
628 leafend(
int level)
const;
631 LeafIteratorType leafbegin (
int level)
const;
634 LeafIteratorType leafend (
int level)
const;
637 LeafIteratorType leafbegin ()
const;
640 LeafIteratorType leafend ()
const;
644 template <
int codim, PartitionIteratorType pitype>
645 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
649 template <
int codim, PartitionIteratorType pitype>
650 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
655 typename Traits::template Codim<codim>::LeafIterator
660 typename Traits::template Codim<codim>::LeafIterator
665 template <
int codim, PartitionIteratorType pitype>
666 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
667 createLeafIteratorBegin (
int level)
const;
670 template <
int codim, PartitionIteratorType pitype>
671 typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
672 createLeafIteratorEnd(
int level)
const;
676 int size (
int level,
int cd)
const;
694 int hierSetSize (
int cd)
const;
700 globalIdSet_ =
new GlobalIdSetImp( *
this );
701 return *globalIdSet_;
745 template <
class DataHandle>
748 template<
class DataHandleImpl,
class Data >
751 typedef ALUGridLoadBalanceDataHandle< ThisType, DataHandleImpl, Data > LBHandle;
752 LBHandle lbHandle( *
this, dataHandle );
769 template<
class DataHandleImp,
class DataTypeImp>
776 template<
class DataHandleImp,
class DataTypeImp>
781 typedef ALU3DSPACE GatherScatter GatherScatterType;
800 template<
class Gr
idImp,
class DataHandle >
801 bool adapt ( AdaptDataHandleInterface< GridImp, DataHandle > &handle );
806 template<
class Gr
idImp,
class DataHandle >
807 void globalRefine (
int refCount, AdaptDataHandleInterface< GridImp, DataHandle > &handle );
814 template <GrapeIOFileFormatType ftype>
815 bool writeGrid(
const std::string filename, alu3d_ctype time )
const ;
817 bool writeGrid_Xdr(
const std::string filename, alu3d_ctype time )
const ;
819 bool writeGrid_Ascii(
const std::string filename, alu3d_ctype time,
bool scientific =
false )
const ;
823 bool writeMacroGrid(
const std::string path,
const std::string filename )
const ;
827 template <GrapeIOFileFormatType ftype>
828 bool readGrid(
const std::string filename, alu3d_ctype & time );
841 void setMaxLevel (
int mxl);
844 void updateStatus ();
847 bool mark(
int refCount ,
const typename Traits::template Codim<0>::Entity & e);
850 int getMark(
const typename Traits::template Codim<0>::Entity & e)
const;
853 static MPICommunicatorType defaultCommunicator ()
855 return Communications::defaultComm();
860 template<
class IntersectionType >
861 static const typename BaseType
862 :: template ReturnImplementationType< IntersectionType >
863 :: ImplementationType &
864 getRealIntersection (
const IntersectionType &intersection )
870 const std::vector<GeometryType>&
geomTypes (
int codim)
const {
return geomTypes_[codim]; }
875 GitterImplType &myGrid ()
const;
877 virtual GitterImplType *createALUGrid (
const std::string ¯oName )
879 assert( communications_ );
880 return communications_->createALUGrid( macroName, vertexProjection(), conformingRefinement() );
883 virtual GitterImplType *createALUGrid ( std::istream& stream )
885 assert( communications_ );
886 return communications_->createALUGrid( stream, vertexProjection(), conformingRefinement() );
892 virtual typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ()
const
894 return Communications::getBuilder( myGrid() );
898 virtual void duneNotifyMacroGridChanges ()
900 Communications::duneNotifyMacroGridChanges( myGrid() );
906 template <
class EntitySeed >
907 typename Traits :: template Codim< EntitySeed :: codimension > :: EntityPointer
910 enum { codim = EntitySeed :: codimension };
911 typedef ALU3dGridEntityPointer < codim, const ThisType > ALUPointer ;
912 return ALUPointer( factory(), seed ) ;
916 int nlinks ()
const {
return communications().nlinks(); }
918 LeafVertexListType & getLeafVertexList()
const
920 if( !leafVertexList_.up2Date() ) leafVertexList_.setupVxList(*
this);
921 return leafVertexList_;
924 int getLevelOfLeafVertex (
const typename ALU3dImplTraits< elType, Comm >::VertexType &vertex )
const
926 assert( leafVertexList_.up2Date() );
927 return leafVertexList_.getLevel(vertex);
930 VertexListType & getVertexList(
int level)
const
932 assert( level >= 0 );
934 VertexListType & vxList = vertexList_[level];
935 if(!vxList.up2Date()) vxList.setupVxList(*
this,level);
939 ALU3dGridItemListType & getGhostLeafList(
int codim)
const
941 assert( codim >= 1 );
942 assert( codim <= 3 );
943 return ghostLeafList_[codim-1];
946 ALU3dGridItemListType & getGhostLevelList(
int codim,
int level)
const
948 assert( codim >= 1 );
949 assert( codim <= 3 );
951 assert( level >= 0 );
953 return ghostLevelList_[codim-1][level];
956 ALU3dGridItemListType & getEdgeList(
int level)
const
958 assert( level >= 0 );
960 return levelEdgeList_[level];
996 assert( segmentIndex < (
int) bndVec_->size() );
997 return (*bndVec_)[ segmentIndex ];
1001 const Communications &communications ()
const
1003 assert( communications_ );
1004 return *communications_;
1007 const GridObjectFactoryType& factory()
const {
1008#ifdef USE_SMP_PARALLEL
1009 assert( (
int) factoryVec_.size() > GridObjectFactoryType :: threadNumber() );
1010 return factoryVec_[ GridObjectFactoryType :: threadNumber() ];
1018 bool conformingRefinement()
const
1020 return (refinementType_ == conforming) ;
1024 bool ghostCellsEnabled ()
const
1026#ifdef ALUGRID_3D_CONFORMING_REFINEMENT
1027 return myGrid().ghostCellsEnabled();
1040 mutable GitterImplType *mygrid_;
1046 mutable int coarsenMarked_;
1047 mutable int refineMarked_;
1050 enum { numberOfGeomTypes = 1 };
1051 std::vector< std::vector<GeometryType> > geomTypes_;
1057 mutable GlobalIdSetImp *globalIdSet_;
1063 mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
1071 mutable VertexListType vertexList_[
MAXL];
1073 mutable ALU3dGridItemListType ghostLeafList_[ dimension ];
1074 mutable ALU3dGridItemListType ghostLevelList_[ dimension ][
MAXL];
1076 mutable ALU3dGridItemListType levelEdgeList_[
MAXL];
1078 mutable LeafVertexListType leafVertexList_;
1081 typedef SizeCache<MyType> SizeCacheType;
1082 SizeCacheType * sizeCache_;
1084#ifdef USE_SMP_PARALLEL
1085 std::vector< GridObjectFactoryType > factoryVec_;
1087 GridObjectFactoryType factory_;
1091 bool lockPostAdapt_;
1100 ALUGridBoundaryProjectionType* vertexProjection_ ;
1103 Communications *communications_;
1110 bool checkMacroGrid ( ALU3dGridElementType elType ,
1111 const std::string filename );
1112 const char* elType2Name( ALU3dGridElementType elType );
1114 namespace Capabilities
1117 template< ALU3dGr
idElementType elType,
class Comm,
int cdim >
1118 struct hasEntity<
Dune::ALU3dGrid< elType, Comm >, cdim >
1120 static const bool v =
true;
1123 template< ALU3dGr
idElementType elType,
class Comm >
1124 struct isParallel< ALU3dGrid< elType, Comm > >
1126 static const bool v =
true;
1129 template< ALU3dGr
idElementType elType,
class Comm >
1130 struct isLevelwiseConforming< ALU3dGrid< elType, Comm > >
1132 static const bool v =
true;
1135 template< ALU3dGr
idElementType elType,
class Comm >
1136 struct hasBackupRestoreFacilities< ALU3dGrid< elType, Comm > >
1138 static const bool v =
true;
1145#include "grid_inline.hh"
1146#if COMPILE_ALUGRID_INLINE
1147 #include "grid_imp.cc"
Portable very large unsigned integers.
Definition: entity.hh:464
hierarchic index set of ALU3dGrid
Definition: indexsets.hh:44
Definition: iterator.hh:57
Leaf iterator.
Definition: iterator.hh:591
[ provides Dune::Grid ]
Definition: grid.hh:406
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...
int size(int codim) const
number of leaf entities per codim in this process
int size(int level, GeometryType type) const
number of entities per level and geometry type in this process
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:299
Traits::template Codim< codim >::LeafIterator leafbegin() const
General definiton for a leaf iterator.
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
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...
Traits::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
boundary projection type
Definition: grid.hh:496
void checkMacroGridFile(const std::string filename)
check whether macro grid format is of our type
ALU3dGrid(const ThisType &)
Copy constructor should not be used.
bool writeGrid(const std::string filename, alu3d_ctype time) const
write Grid to file in specified FileFormatType
bool readGrid(const std::string filename, alu3d_ctype &time)
read Grid from file filename and store time of mesh in time
int overlapSize(int codim) const
overlapSize is zero for this grid
Definition: grid.hh:766
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
@ MAXL
maximal number of levels is 32
Definition: grid.hh:541
bool loadBalance()
Calculates load of each process and repartition the grid if neccessary. For parameters of the load ba...
Definition: grid_inline.hh:654
const LocalIdSet & localIdSet() const
get global id set of grid
Definition: grid.hh:705
int global_size(int cd) const
number of grid entities on all levels for given codim
Definition: grid_inline.hh:82
const ThisType & operator=(const ThisType &)
assignment operator should not be used
ALU3dGrid(const std::string ¯oTriangFilename, const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndPrj, const DuneBoundaryProjectionVector *bndVec, const ALUGridRefinementType refinementType)
Definition: grid_inline.hh:21
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: grid_inline.hh:314
GridFamily::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set, needed by data handle.
Definition: grid.hh:488
int overlapSize(int level, int codim) const
overlapSize is zero for this grid
Definition: grid.hh:760
void calcExtras()
reset size and global size, update Level- and LeafIndexSet, if they exist
void backup(std::ostream &) const
backup to ostream
const Traits::LeafIndexSet & leafIndexSet() const
get leaf index set of the grid
static std::string name()
for grid identification
Definition: grid_inline.hh:693
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
bool preAdapt()
returns if a least one entity was marked for coarsening
virtual ~ALU3dGrid()
Desctructor.
int ghostSize(int codim) const
ghostSize is one for codim 0 and zero otherwise for this grid
void calcMaxLevel()
calculate maxlevel
const Traits::LevelIndexSet & levelIndexSet(int level) const
get level index set of the grid
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: grid.hh:870
const GlobalIdSet & globalIdSet() const
get global id set of grid
Definition: grid.hh:697
void restore(std::istream &)
restore from istream
int size(GeometryType type) const
number of leaf entities per geometry type in this process
ALU3DSPACE ProjectVertex ALUGridVertexProjectionType
type of ALUGrid Vertex Projection Interface
Definition: grid.hh:499
const CollectiveCommunication & comm() const
return const reference to a collective communication object. The return type is a model of Dune::Coll...
Definition: grid.hh:785
Traits::template Codim< codim >::LeafIterator leafend() const
General definition for an end iterator on leaf level.
Traits::CollectiveCommunication CollectiveCommunication
type of collective communication object
Definition: grid.hh:502
void postAdapt()
clear all entity new markers
int ghostSize(int level, int codim) const
ghostSize is one for codim 0 and zero otherwise for this grid
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:547
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Definition: grid_inline.hh:133
GridFamily::LocalIdSetImp LocalIdSetImp
Type of the local id set.
Definition: grid.hh:518
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:119
ReferenceElement< alu3d_ctype, dimension > ReferenceElementType
reference element type
Definition: grid.hh:491
Traits::LocalIdSet LocalIdSet
Type of the local id set.
Definition: grid.hh:527
const DuneBoundaryProjectionType * boundaryProjection(const int segmentIndex) const
return boudanry projection for given segment Id
Definition: grid.hh:986
void checkMacroGrid()
check whether macro grid has the right element type
bool writeGrid_Ascii(const std::string filename, alu3d_ctype time, bool scientific=false) const
write leaf grid in macro grid format to ascii file
bool writeMacroGrid(const std::string path, const std::string filename) const
write macro grid in ALUGrid macro format to path/filename.rank
const ReferenceElementType & referenceElement() const
return reference to Dune reference element according to elType
Definition: grid.hh:904
Traits::GlobalIdSet GlobalIdSet
Type of the global id set.
Definition: grid.hh:524
ALU3dGridHierarchicIndexSet< elType, Comm > HierarchicIndexSet
Type of the hierarchic index set.
Definition: grid.hh:483
GridFamily::LevelIndexSetImp LevelIndexSetImp
Type of the level index set, needed by data handle.
Definition: grid.hh:486
int size(int level, int cd) const
number of grid entities per level and codim
void recalcGlobalSize()
make grid walkthrough and calc global size
size_t numBoundarySegments() const
number of boundary segments
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered maxLevel with 0 the coarsest level.
Definition: grid_inline.hh:100
Traits::DuneBoundaryProjectionType DuneBoundaryProjectionType
boundary projection type
Definition: grid.hh:494
@ refineEstimate_
if one element is refined then it causes apporximately not more than this number of new elements
Definition: grid.hh:555
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:15
Specialization of CollectiveCommunication for MPI.
Definition: mpicollectivecommunication.hh:146
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
Store a reference to an entity with a minimal memory footprint.
Definition: entityseed.hh:24
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
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
@ dimension
The dimension of the grid.
Definition: grid.hh:400
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:406
Id Set Interface.
Definition: indexidset.hh:403
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:19
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
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:239
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:334
This class provides access to geometric and topological properties of a reference element....
Definition: referenceelements.hh:58
A set of traits classes to store static information about grid implementation.
Different resources needed by all grid implementations.
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.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:244
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
ALUGridRefinementType
available refinement types for ALUGrid
Definition: declaration.hh:20
Implements an utility class that provides collective communication methods for sequential programs.
Implements an utility class that provides MPI's collective communication methods.
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.
Definition: alu3dinclude.hh:330
Definition: alu3dinclude.hh:297
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