dune-grid  2.4.1
alugrid/3d/grid.hh
Go to the documentation of this file.
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_ALU3DGRIDGRID_HH
4 #define DUNE_ALU3DGRIDGRID_HH
5 
6 //- System includes
7 #include <vector>
8 
9 //- Dune includes
13 #include <dune/common/bigunsignedint.hh>
14 #include <dune/common/deprecated.hh>
15 
16 #include <dune/geometry/referenceelements.hh>
17 
18 #include <dune/grid/common/grid.hh>
24 
25 // bnd projection stuff
30 
31 //- Local includes
32 #include "alu3dinclude.hh"
33 #include "topology.hh"
34 #include "indexsets.hh"
35 #include "datahandle.hh"
36 
38 
39 #include <dune/common/parallel/mpihelper.hh>
40 
41 #if ALU3DGRID_PARALLEL
42 #include <dune/common/parallel/mpicollectivecommunication.hh>
43 #else
44 #include <dune/common/parallel/collectivecommunication.hh>
45 #endif
46 
47 namespace Dune
48 {
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>
69  template<int codim, PartitionIteratorType pitype, class GridImp>
71  template <int mydim, int coorddim, class GridImp>
73  template <class GridImp>
75  template< ALU3dGridElementType, class >
77  template< ALU3dGridElementType, class >
79  template< ALU3dGridElementType, class >
81  template <class EntityImp>
82  class ALUMemoryProvider;
83  template< class >
85  template <class GridImp, class GeometryImp, int nChild>
87  template< ALU3dGridElementType elType, class Comm >
89 
90 
91 
92  // Internal Forward Declarations
93  // -----------------------------
94 
95 #if ALU3DGRID_PARALLEL
96  template< ALU3dGridElementType elType, class Comm = MPI_Comm >
97  class ALU3dGrid;
98 #else // #if ALU3DGRID_PARALLEL
99  template< ALU3dGridElementType elType, class Comm = No_Comm >
100  class ALU3dGrid;
101 #endif // #else // #if ALU3DGRID_PARALLEL
102 
103  template < class Comm >
104  struct ALUGridBaseGrid< 3, 3, cube, Comm >
105  {
107  };
108 
109  template < class Comm>
110  struct ALUGridBaseGrid< 3, 3, simplex, Comm >
111  {
113  };
114 
115 
116 
117  // ALU3dGridCommunications
118  // -----------------------
120  {
121  template < class GitterImpl >
122  void checkForConformingRefinement( GitterImpl* grid,
123  const bool conformingRefinement )
124  {
125 #ifdef ALUGRID_3D_CONFORMING_REFINEMENT
126  if( grid && conformingRefinement )
127  {
128  grid->enableConformingClosure();
129  grid->disableGhostCells();
130  }
131 #endif
132  }
133  };
134 
135 
136  template< ALU3dGridElementType elType, class Comm >
138 
139  template< ALU3dGridElementType elType >
140  struct ALU3dGridCommunications< elType, No_Comm > : public ALU3dGridCommunicationsBase
141  {
143 
145  typedef int GlobalId;
146 
147  typedef ALU3DSPACE GitterDuneImpl GitterImplType;
148 
149  typedef Dune::CollectiveCommunication< No_Comm > CollectiveCommunication;
150 
151  explicit ALU3dGridCommunications ( No_Comm comm ) {}
152 
153  int nlinks () const { return 0; }
154 
155  GitterImplType *createALUGrid ( const std::string &macroName, ALU3DSPACE ProjectVertex *projection,
156  const bool conformingRefinement )
157  {
158  GitterImplType* grid = ( macroName.empty() ) ?
159  new GitterImplType() : new GitterImplType ( macroName.c_str(), projection );
160  // check whether conforming refinement should be enabled
161  checkForConformingRefinement( grid, conformingRefinement );
162  return grid ;
163  }
164 
165  GitterImplType *createALUGrid ( std::istream& stream, ALU3DSPACE ProjectVertex *projection,
166  const bool conformingRefinement )
167  {
168 #ifdef ALUGRID_CONSTRUCTION_WITH_STREAMS
169  GitterImplType* grid = new GitterImplType ( stream, projection );
170  // check whether conforming refinement should be enabled
171  checkForConformingRefinement( grid, conformingRefinement );
172  return grid ;
173 #else
174  return 0;
175 #endif
176  }
177 
178  static No_Comm defaultComm () { return No_Comm(); }
179 
180  static int getRank ( No_Comm comm ) { return 0; }
181 
182  static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
183  {
184  ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
185  dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF* >( &grid.container() );
186  if( ! builder )
187  DUNE_THROW(InvalidStateException,"dynamic_cast of ALUGrid builder failed");
188  return *builder;
189  }
190 
191  static void duneNotifyMacroGridChanges ( GitterImplType &grid ) {}
192 
193  CollectiveCommunication ccobj_;
194  };
195 
196 #if ALU3DGRID_PARALLEL
197  template< ALU3dGridElementType elType >
198  struct ALU3dGridCommunications< elType, MPI_Comm > : public ALU3dGridCommunicationsBase
199  {
201 
202  typedef ALU3dGridGlobalIdSet< elType, MPI_Comm > GlobalIdSet;
203  typedef ALUGridId< ALUMacroKey > GlobalId;
204 
205  typedef ALU3DSPACE GitterDunePll GitterImplType;
206 
207  typedef Dune::CollectiveCommunication< MPI_Comm > CollectiveCommunication;
208 
209  explicit ALU3dGridCommunications ( MPI_Comm comm )
210  : ccobj_( comm ), mpAccess_( comm )
211  {}
212 
213  int nlinks () const { return mpAccess_.nlinks(); }
214 
215  GitterImplType *createALUGrid ( const std::string &macroName, ALU3DSPACE ProjectVertex *projection,
216  const bool conformingRefinement )
217  {
218  GitterImplType* grid = new GitterImplType( macroName.c_str(), mpAccess_, projection );
219  // check whether conforming refinement should be enabled
220  checkForConformingRefinement( grid, conformingRefinement );
221  return grid;
222  }
223 
224  GitterImplType *createALUGrid ( std::istream& stream, ALU3DSPACE ProjectVertex *projection,
225  const bool conformingRefinement )
226  {
227 #ifdef ALUGRID_CONSTRUCTION_WITH_STREAMS
228  GitterImplType* grid = new GitterImplType ( stream, mpAccess_, projection );
229  // check whether conforming refinement should be enabled
230  checkForConformingRefinement( grid, conformingRefinement );
231  return grid ;
232 #else
233  return 0;
234 #endif
235  }
236 
237  static MPI_Comm defaultComm () { return MPI_COMM_WORLD; }
238 
239  static int getRank ( MPI_Comm comm )
240  {
241  int rank = 0;
242  MPI_Comm_rank( comm, &rank );
243  return rank;
244  }
245 
246  static typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder ( GitterImplType &grid )
247  {
248  ALU3DSPACE Gitter::Geometric::BuilderIF* builder =
249  dynamic_cast< ALU3DSPACE Gitter::Geometric::BuilderIF* >( &grid.containerPll() );
250  if( ! builder )
251  DUNE_THROW(InvalidStateException,"dynamic_cast of ALUGrid builder failed");
252  return *builder;
253  }
254 
255  static void duneNotifyMacroGridChanges ( GitterImplType &grid )
256  {
257  grid.duneNotifyMacroGridChanges();
258  }
259 
260  CollectiveCommunication ccobj_;
261  ALU3DSPACE MpAccessMPI mpAccess_;
262  };
263 #endif // #if ALU3DGRID_PARALLEL
264 
265 
266 
267  // ALU3dGridFamily
268  // ---------------
269 
270  template< ALU3dGridElementType elType, class Comm >
272  {
275 
276  static const int dim = 3;
277  static const int dimworld = 3;
278 
281 
284 
287 
289  typedef int LocalIdType;
290 
291  struct Traits
292  {
295 
298 
299  typedef typename GridFamily::GridImp Grid;
300 
303 
305 
306  typedef Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorWrapper< const Grid >, LeafIntersectionWrapper< const Grid > > LeafIntersectionIterator;
308 
310 
312  typedef std::vector< const DuneBoundaryProjectionType * > DuneBoundaryProjectionVector;
313 
314  template< int cd >
315  struct Codim
316  {
317  // IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
318  typedef ALU3dGridGeometry< dim-cd, dimworld, const Grid > GeometryImpl;
319  typedef ALU3dGridGeometry< dim-cd, dim, const Grid > LocalGeometryImpl;
322 
324 
325  // minimal information to generate entities
327 
330 
331  template< PartitionIteratorType pitype >
332  struct Partition
333  {
336  }; // struct Partition
337 
340  }; // struct Codim
341 
342  template< PartitionIteratorType pitype >
343  struct Partition
344  {
347  }; // struct Partition
348 
351 
354 
359 
360  typedef Dune::CollectiveCommunication< Comm > CollectiveCommunication;
361  }; // struct Traits
362 
365 
368 
369  }; // struct ALU3dGridFamily
370 
371 
372 
373  //**********************************************************************
374  //
375  // --ALU3dGrid
376  // --Grid
377  //
378  //**********************************************************************
379 
400  template< ALU3dGridElementType elType, class Comm >
401  class ALU3dGrid
402  : public GridDefaultImplementation< 3, 3, alu3d_ctype,
403  ALU3dGridFamily< elType, Comm > >,
404  public HasObjectStream,
405  public HasHierarchicIndexSet
406  {
407  typedef ALU3dGrid< elType, Comm > ThisType;
409 
410  // for compatibility: MyType := ThisType
411  typedef ThisType MyType;
412 
413  // friend declarations
414  friend class ALU3dGridEntity< 0, 3, const ThisType>;
415  friend class ALU3dGridEntity< 1, 3, const ThisType>;
416  friend class ALU3dGridEntity< 2, 3, const ThisType>;
417  friend class ALU3dGridEntity< 3, 3, const ThisType>;
418 
419  friend class ALU3dGridIntersectionIterator< ThisType >;
420 
421  friend class ALU3dGridEntityPointerBase< 0, const ThisType >;
422  friend class ALU3dGridEntityPointerBase< 1, const ThisType >;
423  friend class ALU3dGridEntityPointerBase< 2, const ThisType >;
424  friend class ALU3dGridEntityPointerBase< 3, const ThisType >;
425 
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 >;
430 
431  friend class ALU3dGridIntersectionIterator< const ThisType >;
432  friend class ALU3dGridHierarchicIterator< const ThisType >;
433 
434  friend class ALU3dGridHierarchicIndexSet< elType, Comm >;
435  friend class ALU3dGridGlobalIdSet< elType, Comm >;
436  friend class ALU3dGridLocalIdSet< elType, Comm >;
437 
438  friend class Conversion< ThisType, HasObjectStream >;
439  friend class Conversion< const ThisType, HasObjectStream >;
440 
441  friend class Conversion< ThisType, HasHierarchicIndexSet >;
442  friend class Conversion< const ThisType, HasHierarchicIndexSet >;
443 
444  friend struct ALU3dGridCommHelper< elType, Comm >;
445 
446  // new intersection iterator is a wrapper which get itersectioniteratoimp as pointers
447  public:
454 
455  friend class IntersectionIteratorWrapper < const ThisType, LeafIntersectionIteratorImp > ;
457  friend class LeafIntersectionIteratorWrapper < const ThisType > ;
458  friend class LevelIntersectionIteratorWrapper< const ThisType > ;
459 
460  //**********************************************************
461  // The Interface Methods
462  //**********************************************************
463  public:
464  enum { refineStepsForHalf = 1 };
465 
466  static const ALU3dGridElementType elementType = elType;
467  typedef typename ALU3DSPACE GatherScatterType::ObjectStreamType ObjectStreamType;
468  typedef ObjectStreamType InStreamType ;
469  typedef ObjectStreamType OutStreamType ;
470 
472  typedef typename GridFamily::Traits Traits;
473 
474  static const int dimension = BaseType::dimension;
476 
477  protected:
479  friend class ALULocalGeometryStorage< const ThisType, GeometryObject, 8 >;
480 
481  public:
484 
489 
491  typedef ReferenceElement< alu3d_ctype, dimension > ReferenceElementType;
492 
497 
500 
503 
504  public:
509 
511 
512  protected:
513  friend class ALUGridBoundaryProjection< ThisType, alu3d_ctype >;
514  // type of ALUGrid boundary projection wrapper
516 
519 
521 
522  public:
525 
527  typedef typename Traits::LocalIdSet LocalIdSet;
528 
529  protected:
531  typedef typename Traits::template Codim< 0 >::LeafIterator LeafIteratorType;
532  typedef typename Traits::template Codim< 0 >::LeafIterator LeafIterator;
533 
535 
537 
539  enum {
541  MAXL = 32
542  };
543 
545  enum {
548  };
549 
551  enum {
556  };
557 
558  public:
559  typedef Comm MPICommunicatorType;
560 
562 
563  protected:
566 
569  ALU3dGrid ( const std::string &macroTriangFilename,
570  const MPICommunicatorType mpiComm,
571  const DuneBoundaryProjectionType *bndPrj,
572  const DuneBoundaryProjectionVector *bndVec,
573  const ALUGridRefinementType refinementType ) DUNE_DEPRECATED_MSG("ALUGrid is deprecated, please use the new module DUNE-ALUGrid.");
574 
575  public:
577  virtual ~ALU3dGrid();
578 
580  static inline std::string name ();
581 
585  int maxLevel() const;
586 
588  template<int cd, PartitionIteratorType pitype>
589  typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
590  lbegin (int level) const;
591 
593  template<int cd, PartitionIteratorType pitype>
594  typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
595  lend (int level) const;
596 
598  template<int cd>
599  typename Traits::template Codim<cd>::
601  lbegin (int level) const;
602 
604  template<int cd>
605  typename Traits::template Codim<cd>::
607  lend (int level) const;
608 
609  private:
611  template <int codim, PartitionIteratorType pitype>
613  leafbegin(int level) const;
614 
616  template <int codim, PartitionIteratorType pitype>
618  leafend(int level) const;
619 
621  template <int codim>
622  typename Traits::template Codim<codim>::LeafIterator
623  leafbegin(int level) const;
624 
626  template <int codim>
627  typename Traits::template Codim<codim>::LeafIterator
628  leafend(int level) const;
629 
631  LeafIteratorType leafbegin (int level) const;
632 
634  LeafIteratorType leafend (int level) const;
635 
637  LeafIteratorType leafbegin () const;
638 
640  LeafIteratorType leafend () const;
641 
642  public:
644  template <int codim, PartitionIteratorType pitype>
646  leafbegin() const;
647 
649  template <int codim, PartitionIteratorType pitype>
651  leafend() const;
652 
654  template <int codim>
655  typename Traits::template Codim<codim>::LeafIterator
656  leafbegin() const;
657 
659  template <int codim>
660  typename Traits::template Codim<codim>::LeafIterator
661  leafend() const;
662 
663  private:
665  template <int codim, PartitionIteratorType pitype>
667  createLeafIteratorBegin (int level) const;
668 
670  template <int codim, PartitionIteratorType pitype>
672  createLeafIteratorEnd(int level) const;
673 
674  public:
676  int size (int level, int cd) const;
677 
679  int size (int codim) const;
680 
682  int size (int level, GeometryType type) const;
683 
685  size_t numBoundarySegments() const;
686 
688  int size (GeometryType type) const;
689 
691  int global_size (int cd) const ;
692 
693  // (no interface method) number of grid entities in the entire grid for given codim
694  int hierSetSize (int cd) const;
695 
697  const GlobalIdSet &globalIdSet () const
698  {
699  if( !globalIdSet_ )
700  globalIdSet_ = new GlobalIdSetImp( *this );
701  return *globalIdSet_;
702  }
703 
705  const LocalIdSet & localIdSet () const { return localIdSet_; }
706 
708  const typename Traits :: LeafIndexSet & leafIndexSet () const;
709 
711  const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;
712 
717  bool loadBalance ();
718 
745  template <class DataHandle>
746  bool loadBalance (DataHandle & data);
747 
748  template< class DataHandleImpl, class Data >
750  {
752  LBHandle lbHandle( *this, dataHandle );
753  return loadBalance( lbHandle );
754  }
755 
757  int ghostSize (int level, int codim) const;
758 
760  int overlapSize (int level, int codim) const { return 0; }
761 
763  int ghostSize (int codim) const;
764 
766  int overlapSize (int codim) const { return 0; }
767 
769  template<class DataHandleImp,class DataTypeImp>
771  InterfaceType iftype, CommunicationDirection dir, int level) const;
772 
776  template<class DataHandleImp,class DataTypeImp>
778  InterfaceType iftype, CommunicationDirection dir) const;
779 
780  private:
781  typedef ALU3DSPACE GatherScatter GatherScatterType;
782 
783  public:
785  const CollectiveCommunication &comm () const { return communications().ccobj_; }
786 
788  bool preAdapt ( );
789 
791  void postAdapt ( );
792 
794  bool adapt ();
795 
800  template< class GridImp, class DataHandle >
802 
804  void globalRefine ( int refCount );
805 
806  template< class GridImp, class DataHandle >
807  void globalRefine ( int refCount, AdaptDataHandleInterface< GridImp, DataHandle > &handle );
808 
809  //**********************************************************
810  // End of Interface Methods
811  //**********************************************************
814  template <GrapeIOFileFormatType ftype>
815  bool writeGrid( const std::string filename, alu3d_ctype time ) const ;
816 
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 ;
820 
823  bool writeMacroGrid( const std::string path, const std::string filename ) const ;
824 
827  template <GrapeIOFileFormatType ftype>
828  bool readGrid( const std::string filename, alu3d_ctype & time );
829 
831  void backup( std::ostream& ) const ;
832 
834  void restore( std::istream& ) ;
835 
836  // (no interface method) get hierarchic index set of the grid
837  const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; }
838 
839  // set max of given mxl and actual maxLevel
840  // for loadBalance
841  void setMaxLevel (int mxl);
842 
843  // no interface method, but has to be public
844  void updateStatus ();
845 
847  bool mark( int refCount , const typename Traits::template Codim<0>::Entity & e);
848 
850  int getMark( const typename Traits::template Codim<0>::Entity & e) const;
851 
852  public:
853  static MPICommunicatorType defaultCommunicator ()
854  {
855  return Communications::defaultComm();
856  }
857 
859 
860  template< class IntersectionType >
861  static const typename BaseType
862  :: template ReturnImplementationType< IntersectionType >
863  :: ImplementationType &
864  getRealIntersection ( const IntersectionType &intersection )
865  {
866  return getRealImplementation( intersection );
867  }
868 
870  const std::vector<GeometryType>& geomTypes (int codim) const { return geomTypes_[codim]; }
871 
872  // return reference to org ALU3dGrid
873  // private method, but otherwise we have to friend class all possible
874  // types of LevelIterator ==> later
875  GitterImplType &myGrid () const;
876 
877  virtual GitterImplType *createALUGrid ( const std::string &macroName )
878  {
879  assert( communications_ );
880  return communications_->createALUGrid( macroName, vertexProjection(), conformingRefinement() );
881  }
882 
883  virtual GitterImplType *createALUGrid ( std::istream& stream )
884  {
885  assert( communications_ );
886  return communications_->createALUGrid( stream, vertexProjection(), conformingRefinement() );
887  }
888 
889  ALUGridVertexProjectionType* vertexProjection() { return (ALUGridVertexProjectionType *) vertexProjection_; }
890 
891  // return appropriate ALUGrid builder
892  virtual typename ALU3DSPACE Gitter::Geometric::BuilderIF &getBuilder () const
893  {
894  return Communications::getBuilder( myGrid() );
895  }
896 
897  // helper function for factory
899  {
900  Communications::duneNotifyMacroGridChanges( myGrid() );
901  }
902 
904  const ReferenceElementType & referenceElement() const { return referenceElement_; }
905 
906  template < class EntitySeed >
907  typename Traits :: template Codim< EntitySeed :: codimension > :: EntityPointer
908  entityPointer( const EntitySeed& seed ) const
909  {
910  enum { codim = EntitySeed :: codimension };
912  return ALUPointer( factory(), seed ) ;
913  }
914 
915  // number of links to other processors, for internal use only
916  int nlinks () const { return communications().nlinks(); }
917 
918  LeafVertexListType & getLeafVertexList() const
919  {
921  return leafVertexList_;
922  }
923 
925  {
926  assert( leafVertexList_.up2Date() );
927  return leafVertexList_.getLevel(vertex);
928  }
929 
930  VertexListType & getVertexList(int level) const
931  {
932  assert( level >= 0 );
933  assert( level <= maxLevel() );
934  VertexListType & vxList = vertexList_[level];
935  if(!vxList.up2Date()) vxList.setupVxList(*this,level);
936  return vxList;
937  }
938 
940  {
941  assert( codim >= 1 );
942  assert( codim <= 3 );
943  return ghostLeafList_[codim-1];
944  }
945 
946  ALU3dGridItemListType & getGhostLevelList(int codim, int level) const
947  {
948  assert( codim >= 1 );
949  assert( codim <= 3 );
950 
951  assert( level >= 0 );
952  assert( level <= maxLevel() );
953  return ghostLevelList_[codim-1][level];
954  }
955 
957  {
958  assert( level >= 0 );
959  assert( level <= maxLevel() );
960  return levelEdgeList_[level];
961  }
962 
963  protected:
965  ALU3dGrid( const ThisType & );
966 
968  const ThisType &operator= ( const ThisType & );
969 
971  void calcExtras();
972 
974  void calcMaxLevel();
975 
977  void recalcGlobalSize();
978 
980  void checkMacroGridFile (const std::string filename);
981 
983  void checkMacroGrid ();
984 
986  const DuneBoundaryProjectionType* boundaryProjection(const int segmentIndex) const
987  {
988  if( bndPrj_ )
989  {
990  return bndPrj_;
991  }
992  else
993  {
994  // pointer can be zero (which is emulates the identity mapping then)
995  assert( bndVec_ );
996  assert( segmentIndex < (int) bndVec_->size() );
997  return (*bndVec_)[ segmentIndex ];
998  }
999  }
1000 
1001  const Communications &communications () const
1002  {
1003  assert( communications_ );
1004  return *communications_;
1005  }
1006 
1007  const GridObjectFactoryType& factory() const {
1008 #ifdef USE_SMP_PARALLEL
1009  assert( (int) factoryVec_.size() > GridObjectFactoryType :: threadNumber() );
1010  return factoryVec_[ GridObjectFactoryType :: threadNumber() ];
1011 #else
1012  return factory_;
1013 #endif
1014  }
1015 
1016  public:
1017  // return true if conforming refinement is enabled
1019  {
1020  return (refinementType_ == conforming) ;
1021  }
1022 
1023  // return true if ghost cells are available
1024  bool ghostCellsEnabled () const
1025  {
1026 #ifdef ALUGRID_3D_CONFORMING_REFINEMENT
1027  return myGrid().ghostCellsEnabled();
1028 #else
1029  return true ;
1030 #endif
1031  }
1032  protected:
1034  //
1035  // Internal variables
1036  //
1038 
1039  // the real ALU grid
1040  mutable GitterImplType *mygrid_;
1041 
1042  // max level of grid
1044 
1045  // count how much elements where marked
1046  mutable int coarsenMarked_;
1047  mutable int refineMarked_;
1048 
1049  // at the moment the number of different geom types is 1
1050  enum { numberOfGeomTypes = 1 };
1051  std::vector< std::vector<GeometryType> > geomTypes_;
1052 
1053  // our hierarchic index set
1054  HierarchicIndexSet hIndexSet_;
1055 
1056  // out global id set
1057  mutable GlobalIdSetImp *globalIdSet_;
1058 
1059  // out global id set
1060  LocalIdSetImp localIdSet_;
1061 
1062  // the level index set ( default type )
1063  mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
1064 
1065  // the leaf index set
1066  mutable LeafIndexSetImp * leafIndexSet_;
1067 
1068  // the reference element
1069  const ReferenceElementType& referenceElement_;
1070 
1071  mutable VertexListType vertexList_[MAXL];
1072 
1075 
1077 
1078  mutable LeafVertexListType leafVertexList_;
1079 
1080  // the type of our size cache
1082  SizeCacheType * sizeCache_;
1083 
1084 #ifdef USE_SMP_PARALLEL
1085  std::vector< GridObjectFactoryType > factoryVec_;
1086 #else
1087  GridObjectFactoryType factory_;
1088 #endif
1089 
1090  // variable to ensure that postAdapt ist called after adapt
1092 
1093  // pointer to Dune boundary projection
1094  const DuneBoundaryProjectionType* bndPrj_;
1095 
1096  // pointer to Dune boundary projection
1097  const DuneBoundaryProjectionVector* bndVec_;
1098 
1099  // boundary projection for vertices
1100  ALUGridBoundaryProjectionType* vertexProjection_ ;
1101 
1102  // pointer to communications object
1103  Communications *communications_;
1104 
1105  // refinement type (nonconforming or conforming)
1107  }; // end class ALU3dGrid
1108 
1109 
1110  bool checkMacroGrid ( ALU3dGridElementType elType ,
1111  const std::string filename );
1112  const char* elType2Name( ALU3dGridElementType elType );
1113 
1114  namespace Capabilities
1115  {
1116 
1117  template< ALU3dGridElementType elType, class Comm, int cdim >
1118  struct hasEntity< Dune::ALU3dGrid< elType, Comm >, cdim >
1119  {
1120  static const bool v = true;
1121  };
1122 
1123  template< ALU3dGridElementType elType, class Comm >
1124  struct DUNE_DEPRECATED_MSG("Capabilities::isParallel will be removed after dune-grid-2.4.") isParallel< ALU3dGrid< elType, Comm > >
1125  {
1126  static const bool DUNE_DEPRECATED_MSG("Capabilities::isParallel will be removed after dune-grid-2.4.") v = true;
1127  };
1128 
1129  template< ALU3dGridElementType elType, class Comm >
1130  struct isLevelwiseConforming< ALU3dGrid< elType, Comm > >
1131  {
1132  static const bool v = true;
1133  };
1134 
1135  template< ALU3dGridElementType elType, class Comm >
1136  struct hasBackupRestoreFacilities< ALU3dGrid< elType, Comm > >
1137  {
1138  static const bool v = true;
1139  };
1140 
1141  } // end namespace Capabilities
1142 
1143 } // end namespace Dune
1144 
1145 #include "grid_inline.hh"
1146 #if COMPILE_ALUGRID_INLINE
1147  #include "grid_imp.cc"
1148 #endif
1149 #endif
void globalRefine(int refCount)
uses the interface, mark on entity and refineLocal
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: albertagrid/dgfparser.hh:26
Traits::CollectiveCommunication CollectiveCommunication
type of collective communication object
Definition: alugrid/3d/grid.hh:502
int nlinks() const
Definition: alugrid/3d/grid.hh:916
Definition: alu3dinclude.hh:329
void postAdapt()
clear all entity new markers
ALU3dGridFamily< elType, Comm > GridFamily
Definition: alugrid/3d/grid.hh:274
bool writeMacroGrid(const std::string path, const std::string filename) const
write macro grid in ALUGrid macro format to path/filename.rank
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
Definition: alugrid/common/declaration.hh:18
bool lockPostAdapt_
Definition: alugrid/3d/grid.hh:1091
Index Set Interface base class.
Definition: common/grid.hh:361
Definition: common/entityseed.hh:28
GridObjectFactoryType factory_
Definition: alugrid/3d/grid.hh:1087
The dimension of the world the grid lives in.
Definition: common/grid.hh:408
int overlapSize(int level, int codim) const
overlapSize is zero for this grid
Definition: alugrid/3d/grid.hh:760
static const int dimension
Definition: alugrid/3d/grid.hh:474
LeafVertexListType & getLeafVertexList() const
Definition: alugrid/3d/grid.hh:918
ALU3dGridIntersectionIterator< const ThisType > IntersectionIteratorImp
Definition: alugrid/3d/grid.hh:449
MakeableInterfaceObject< typename Traits::template Codim< 2 >::Entity > EdgeObject
Definition: alugrid/3d/grid.hh:507
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
Provides size cache classes to implement the grids size method efficiently.
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:23
Traits::GlobalIdSet GlobalIdSet
Type of the global id set.
Definition: alugrid/3d/grid.hh:524
Definition: alu3dinclude.hh:201
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...
ALU3dGridFamily< elType, Comm > GridFamily
Definition: alugrid/3d/grid.hh:471
bool up2Date() const
Definition: alu3dinclude.hh:343
int GlobalId
Definition: alugrid/3d/grid.hh:145
int global_size(int cd) const
number of grid entities on all levels for given codim
Definition: grid_inline.hh:82
ObjectStreamType OutStreamType
Definition: alugrid/3d/grid.hh:469
MakeableInterfaceObject< typename Traits::template Codim< 0 >::Entity > EntityObject
Definition: alugrid/3d/grid.hh:505
organizes the caching of sizes for one grid and one GeometryType
Definition: sizecache.hh:29
Definition: alugrid/3d/entity.hh:30
ALUGridVertexProjectionType * vertexProjection()
Definition: alugrid/3d/grid.hh:889
Definition: alugrid/3d/grid.hh:315
Definition: alugrid/3d/grid.hh:74
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:18
ALU3dGridElementType
Definition: topology.hh:13
ALU3dGridItemListType & getGhostLeafList(int codim) const
Definition: alugrid/3d/grid.hh:939
Types for GridView.
Definition: common/grid.hh:420
ALU3dGridItemListType & getGhostLevelList(int codim, int level) const
Definition: alugrid/3d/grid.hh:946
Tagging interface to indicate that Grid has HierarchicIndexSet.
Definition: interfaces.hh:51
static const ALU3dGridElementType elementType
Definition: alugrid/3d/grid.hh:466
Wrapper class for entities.
Definition: common/entity.hh:61
Specialize with 'true' if implementation supports parallelism. (default=false)
Definition: common/capabilities.hh:68
const Traits::LeafIndexSet & leafIndexSet() const
get leaf index set of the grid
const DuneBoundaryProjectionType * bndPrj_
Definition: alugrid/3d/grid.hh:1094
bool preAdapt()
returns if a least one entity was marked for coarsening
Dune::CollectiveCommunication< Comm > CollectiveCommunication
Definition: alugrid/3d/grid.hh:360
Specialize with 'true' if implementation guarantees conforming level grids. (default=false) ...
Definition: common/capabilities.hh:98
int ghostSize(int level, int codim) const
ghostSize is one for codim 0 and zero otherwise for this grid
organize the memory management for entitys used by the NeighborIterator
Definition: alugrid/2d/grid.hh:68
virtual ALU3DSPACE Gitter::Geometric::BuilderIF & getBuilder() const
Definition: alugrid/3d/grid.hh:892
Definition: alugrid/3d/grid.hh:464
IndexSet< Grid, LevelIndexSetImp > LevelIndexSet
Definition: alugrid/3d/grid.hh:355
Dune::IntersectionIterator< const Grid, LevelIntersectionIteratorWrapper< const Grid >, LevelIntersectionWrapper< const Grid > > LevelIntersectionIterator
Definition: alugrid/3d/grid.hh:307
ALUGridRefinementType
available refinement types for ALUGrid
Definition: alugrid/common/declaration.hh:20
ALUGridBoundaryProjection< ThisType, alu3d_ctype > ALUGridBoundaryProjectionType
Definition: alugrid/3d/grid.hh:515
Grid view abstract base class.
Definition: common/gridview.hh:58
LeafVertexListType leafVertexList_
Definition: alugrid/3d/grid.hh:1078
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: common/bndprojection.hh:11
const LocalIdSet & localIdSet() const
get global id set of grid
Definition: alugrid/3d/grid.hh:705
Definition: alugrid/common/declaration.hh:20
ALU3DSPACE ProjectVertex ALUGridVertexProjectionType
type of ALUGrid Vertex Projection Interface
Definition: alugrid/3d/grid.hh:499
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
static std::conditional< std::is_reference< InterfaceType >::value, typename std::add_lvalue_reference< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type, typename std::remove_const< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition: common/grid.hh:1305
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: grid_inline.hh:314
Traits::DuneBoundaryProjectionType DuneBoundaryProjectionType
boundary projection type
Definition: alugrid/3d/grid.hh:494
const Traits::LevelIndexSet & levelIndexSet(int level) const
get level index set of the grid
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:112
Dune::Geometry< dim-cd, dim, const Grid, ALU3dGridGeometry > LocalGeometry
Definition: alugrid/3d/grid.hh:321
static const int dimensionworld
Definition: alugrid/3d/grid.hh:475
std::vector< std::vector< GeometryType > > geomTypes_
Definition: alugrid/3d/grid.hh:1051
VertexListType vertexList_[MAXL]
Definition: alugrid/3d/grid.hh:1071
Specialize with 'true' if implementation provides backup and restore facilities. (default=false) ...
Definition: common/capabilities.hh:116
int nlinks() const
Definition: alugrid/3d/grid.hh:153
ALU3dGridHierarchicIndexSet< elType, Comm > HierarchicIndexSet
Type of the hierarchic index set.
Definition: alugrid/3d/grid.hh:483
Definition: alugrid/3d/grid.hh:291
ALUGridObjectFactory< ThisType > GridObjectFactoryType
Definition: alugrid/3d/grid.hh:510
bool loadBalance()
Calculates load of each process and repartition the grid if neccessary. For parameters of the load ba...
Definition: grid_inline.hh:639
Leaf iterator.
Definition: alugrid/3d/entity.hh:34
Id Set Interface.
Definition: common/grid.hh:362
ALU3dGridHierarchicIterator< const ThisType > HierarchicIteratorImp
Definition: alugrid/3d/grid.hh:534
const Communications & communications() const
Definition: alugrid/3d/grid.hh:1001
ALU3dGridItemListType levelEdgeList_[MAXL]
Definition: alugrid/3d/grid.hh:1076
const GlobalIdSet & globalIdSet() const
get global id set of grid
Definition: alugrid/3d/grid.hh:697
Dune::Entity< cd, dim, const Grid, ALU3dGridEntity > Entity
Definition: alugrid/3d/grid.hh:323
Definition: alugrid/3d/entity.hh:468
Definition: alugrid/3d/grid.hh:84
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:306
virtual ~ALU3dGrid()
Desctructor.
int size(int level, int cd) const
number of grid entities per level and codim
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible...
LeafIndexSetImp * leafIndexSet_
Definition: alugrid/3d/grid.hh:1066
Definition: intersectioniteratorwrapper.hh:210
std::vector< LevelIndexSetImp * > levelIndexVec_
Definition: alugrid/3d/grid.hh:1063
bool writeGrid(const std::string filename, alu3d_ctype time) const
write Grid to file in specified FileFormatType
ReferenceElement< alu3d_ctype, dimension > ReferenceElementType
reference element type
Definition: alugrid/3d/grid.hh:491
void restore(std::istream &)
restore from istream
ALU3dGrid< elType, Comm > GridImp
Definition: alugrid/3d/grid.hh:273
ALU3dGridItemListType ghostLevelList_[dimension][MAXL]
Definition: alugrid/3d/grid.hh:1074
GatherScatter GatherScatterType
Definition: alu3dinclude.hh:49
Traits::LevelIndexSetImp LevelIndexSetImp
Type of the level index set implementation.
Definition: alugrid/3d/grid.hh:364
Dune::GridView< DefaultLeafGridViewTraits< const Grid, pitype > > LeafGridView
Definition: alugrid/3d/grid.hh:346
const CollectiveCommunication & comm() const
return const reference to a collective communication object. The return type is a model of Dune::Coll...
Definition: alugrid/3d/grid.hh:785
SizeCacheType * sizeCache_
Definition: alugrid/3d/grid.hh:1082
void setMaxLevel(int mxl)
static std::string name()
for grid identification
Definition: grid_inline.hh:678
void checkMacroGrid()
check whether macro grid has the right element type
const char * elType2Name(ALU3dGridElementType elType)
GridFamily::GlobalIdType GlobalIdType
type of ALU3dGrids global id
Definition: alugrid/3d/grid.hh:297
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
int LocalIdType
type of ALU3dGrids local id
Definition: alugrid/3d/grid.hh:289
Comm MPICommunicatorType
Definition: alugrid/3d/grid.hh:559
Definition: alu3dinclude.hh:296
Definition: alugrid/3d/grid.hh:88
ALU3dGridCommunications< elType, Comm >::GlobalId GlobalIdType
type of ALU3dGrids global id
Definition: alugrid/3d/grid.hh:286
Specialize with 'true' for all codims that a grid implements entities for. (default=false) ...
Definition: common/capabilities.hh:57
DefaultIndexSet creates an index set by using the grids persistent container an a given pair of itera...
Definition: defaultindexsets.hh:66
virtual GitterImplType * createALUGrid(std::istream &stream)
Definition: alugrid/3d/grid.hh:883
Provides default index set implementations for Level- and LeafIndexsets used by ALUGrid.
Provides proxy classes for IntersectionsIterators.
VertexListType & getVertexList(int level) const
Definition: alugrid/3d/grid.hh:930
Dune::Intersection< const Grid, LeafIntersectionWrapper< const Grid > > LeafIntersection
Definition: alugrid/3d/grid.hh:301
Different resources needed by all grid implementations.
Dune::CollectiveCommunication< No_Comm > CollectiveCommunication
Definition: alugrid/3d/grid.hh:149
static int getRank(No_Comm comm)
Definition: alugrid/3d/grid.hh:180
hierarchic index set of ALU3dGrid
Definition: alugrid/3d/grid.hh:80
Traits::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set implementation.
Definition: alugrid/3d/grid.hh:367
void setupVxList(const GridType &grid)
Traits::template Codim< EntitySeed::codimension >::EntityPointer entityPointer(const EntitySeed &seed) const
Definition: alugrid/3d/grid.hh:908
static const BaseType::template ReturnImplementationType< IntersectionType >::ImplementationType & getRealIntersection(const IntersectionType &intersection)
Definition: alugrid/3d/grid.hh:864
Definition: alugrid/3d/entity.hh:22
Definition: alugrid/3d/entity.hh:28
void calcMaxLevel()
calculate maxlevel
void setupVxList(const GridType &grid, int level)
bool loadBalance(CommDataHandleIF< DataHandleImpl, Data > &dataHandle)
Definition: alugrid/3d/grid.hh:749
Wrapper class for geometries.
Definition: common/geometry.hh:65
HierarchicIndexSet hIndexSet_
Definition: alugrid/3d/grid.hh:1054
Definition: alugrid/3d/entityseed.hh:10
Tagging interface to indicate that Grid provides typedef ObjectStreamType.
Definition: interfaces.hh:16
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Dune::GridView< DefaultLevelGridViewTraits< const Grid, pitype > > LevelGridView
Definition: alugrid/3d/grid.hh:345
static const bool v
Definition: common/capabilities.hh:59
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
const ThisType & operator=(const ThisType &)
assignment operator should not be used
ALU3dGridLevelIntersectionIterator< const ThisType > LevelIntersectionIteratorImp
Definition: alugrid/3d/grid.hh:453
ALUGridBoundaryProjectionType * vertexProjection_
Definition: alugrid/3d/grid.hh:1100
Definition: alu3dinclude.hh:373
int getLevel(const VertexType &vertex) const
Definition: alu3dinclude.hh:355
LocalIdSetImp localIdSet_
Definition: alugrid/3d/grid.hh:1060
Definition: alugrid/common/declaration.hh:18
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
ALU3dImplTraits< elType, Comm >::GitterImplType GitterImplType
Definition: alugrid/3d/grid.hh:536
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Definition: alugrid/3d/grid.hh:78
ALU3dGridLeafVertexList< Comm > LeafVertexListType
Definition: alugrid/3d/grid.hh:565
const DuneBoundaryProjectionVector * bndVec_
Definition: alugrid/3d/grid.hh:1097
IdSet< Grid, LocalIdSetImp, LocalIdType > LocalIdSet
Definition: alugrid/3d/grid.hh:357
ALU3dGridVertexList< Comm > VertexListType
Definition: alugrid/3d/grid.hh:564
int refineMarked_
Definition: alugrid/3d/grid.hh:1047
Definition: objectfactory.hh:23
virtual void duneNotifyMacroGridChanges()
Definition: alugrid/3d/grid.hh:898
Partition< All_Partition >::LevelIterator LevelIterator
Definition: alugrid/3d/grid.hh:338
int maxlevel_
Definition: alugrid/3d/grid.hh:1043
interface class for an iterator over grid entitiesAn entity iterator is an iterator over a subset of ...
Definition: entityiterator.hh:35
Definition: common/geometry.hh:24
DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType
Definition: alugrid/3d/grid.hh:311
Traits::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
boundary projection type
Definition: alugrid/3d/grid.hh:496
static MPICommunicatorType defaultCommunicator()
Definition: alugrid/3d/grid.hh:853
Definition: alugrid/3d/grid.hh:68
ALU3dGrid< tetra, Comm > BaseGrid
Definition: alugrid/3d/grid.hh:112
ALU3dGridLocalIdSet< elType, Comm > LocalIdSetImp
Type of the local id set.
Definition: alugrid/3d/grid.hh:280
GridFamily::LocalIdSetImp LocalIdSetImp
Type of the local id set.
Definition: alugrid/3d/grid.hh:518
#define ALU3DSPACE
Definition: alu3dinclude.hh:26
Dune::Geometry< dim-cd, dimworld, const Grid, ALU3dGridGeometry > Geometry
Definition: alugrid/3d/grid.hh:320
bool writeGrid_Ascii(const std::string filename, alu3d_ctype time, bool scientific=false) const
write leaf grid in macro grid format to ascii file
Dune::EntityPointer< const Grid, EntityPointerImpl > EntityPointer
Definition: alugrid/3d/grid.hh:329
Definition: alugrid/3d/indexsets.hh:171
Definition: alugrid/3d/grid.hh:76
double alu3d_ctype
Definition: alu3dinclude.hh:59
bool checkMacroGrid(ALU3dGridElementType elType, const std::string filename)
ALU3dGridLeafIterator< 0, All_Partition, const ThisType > LeafIteratorImp
Definition: alugrid/3d/grid.hh:530
IdSet< Grid, GlobalIdSetImp, GlobalIdType > GlobalIdSet
Definition: alugrid/3d/grid.hh:358
Definition: common.hh:179
const DuneBoundaryProjectionType * boundaryProjection(const int segmentIndex) const
return boudanry projection for given segment Id
Definition: alugrid/3d/grid.hh:986
MakeableInterfaceObject< typename Traits::template Codim< 0 >::Geometry > GeometryObject
Definition: alugrid/3d/grid.hh:478
Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorWrapper< const Grid >, LeafIntersectionWrapper< const Grid > > IntersectionIterator
Definition: alugrid/3d/grid.hh:304
Provides a Interfaces for detection of specific behavior.
GitterImplType & myGrid() const
Definition: grid_inline.hh:108
ALU3dGridItemListType ghostLeafList_[dimension]
Definition: alugrid/3d/grid.hh:1073
int coarsenMarked_
Definition: alugrid/3d/grid.hh:1046
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:360
GitterImplType * createALUGrid(std::istream &stream, ALU3DSPACE ProjectVertex *projection, const bool conformingRefinement)
Definition: alugrid/3d/grid.hh:165
const ALUGridRefinementType refinementType_
Definition: alugrid/3d/grid.hh:1106
SizeCache< MyType > SizeCacheType
Definition: alugrid/3d/grid.hh:1081
ALU3dGridCommunications< elType, Comm >::GlobalIdSet GlobalIdSetImp
Type of the global id set.
Definition: alugrid/3d/grid.hh:283
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
ALU3DSPACE GatherScatterType::ObjectStreamType ObjectStreamType
Definition: alugrid/3d/grid.hh:467
Partition< All_Partition >::LeafIterator LeafIterator
Definition: alugrid/3d/grid.hh:339
Traits::template Codim< 0 >::LeafIterator LeafIteratorType
Definition: alugrid/3d/grid.hh:531
bool ghostCellsEnabled() const
Definition: alugrid/3d/grid.hh:1024
int overlapSize(int codim) const
overlapSize is zero for this grid
Definition: alugrid/3d/grid.hh:766
ALU3DSPACE GitterDuneImpl GitterImplType
Definition: alugrid/3d/grid.hh:147
GridFamily::GridImp Grid
Definition: alugrid/3d/grid.hh:299
void calcExtras()
reset size and global size, update Level- and LeafIndexSet, if they exist
ALU3dGrid< hexa, Comm > BaseGrid
Definition: alugrid/3d/grid.hh:106
std::vector< const DuneBoundaryProjectionType * > DuneBoundaryProjectionVector
Definition: alugrid/3d/grid.hh:312
Dune::EntityIterator< cd, const Grid, ALU3dGridLevelIterator< cd, pitype, const Grid > > LevelIterator
Definition: alugrid/3d/grid.hh:334
Definition: alugrid/common/declaration.hh:67
const ReferenceElementType & referenceElement_
Definition: alugrid/3d/grid.hh:1069
maximal number of levels is 32
Definition: alugrid/3d/grid.hh:541
static int threadNumber()
Definition: objectfactory.hh:196
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: alugrid/3d/grid.hh:870
Definition: alugrid/3d/grid.hh:72
GridFamily::GlobalIdSetImp GlobalIdSetImp
Definition: alugrid/3d/grid.hh:520
ALU3dGridEntityPointer< cd, const Grid > EntityPointerImpl
Definition: alugrid/3d/grid.hh:328
GridFamily::Traits Traits
Definition: alugrid/3d/grid.hh:472
CollectiveCommunication ccobj_
Definition: alugrid/3d/grid.hh:193
Dune::EntityIterator< cd, const Grid, ALU3dGridLeafIterator< cd, pitype, const Grid > > LeafIterator
Definition: alugrid/3d/grid.hh:335
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered maxLevel with 0 the coarsest level...
Definition: grid_inline.hh:100
static ALU3DSPACE Gitter::Geometric::BuilderIF & getBuilder(GitterImplType &grid)
Definition: alugrid/3d/grid.hh:182
DefaultIndexSet< GridImp, typename Codim< 0 >::LeafIterator > LeafIndexSetImp
Type of the leaf index set.
Definition: alugrid/3d/grid.hh:353
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
Definition: alugrid/2d/grid.hh:72
static No_Comm defaultComm()
Definition: alugrid/3d/grid.hh:178
GitterImplType * createALUGrid(const std::string &macroName, ALU3DSPACE ProjectVertex *projection, const bool conformingRefinement)
Definition: alugrid/3d/grid.hh:155
ALU3dGridLocalIdSet< elType, No_Comm > GlobalIdSet
Definition: alugrid/3d/grid.hh:144
static void duneNotifyMacroGridChanges(GitterImplType &grid)
Definition: alugrid/3d/grid.hh:191
[ provides Dune::Grid ]
Definition: alugrid/3d/entity.hh:36
The dimension of the grid.
Definition: common/grid.hh:402
ALU3dGridItemListType & getEdgeList(int level) const
Definition: alugrid/3d/grid.hh:956
GridFamily::LocalIdType LocalIdType
type of ALU3dGrids local id
Definition: alugrid/3d/grid.hh:294
bool up2Date() const
Definition: alu3dinclude.hh:309
const ReferenceElementType & referenceElement() const
return reference to Dune reference element according to elType
Definition: alugrid/3d/grid.hh:904
Definition: alugrid/3d/grid.hh:343
Definition: alugrid/3d/grid.hh:119
void backup(std::ostream &) const
backup to ostream
bool writeGrid_Xdr(const std::string filename, alu3d_ctype time) const
ALU3dGridGeometry< dim-cd, dim, const Grid > LocalGeometryImpl
Definition: alugrid/3d/grid.hh:319
Definition: alugrid/3d/grid.hh:137
const GridObjectFactoryType & factory() const
Definition: alugrid/3d/grid.hh:1007
bool readGrid(const std::string filename, alu3d_ctype &time)
read Grid from file filename and store time of mesh in time
Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorWrapper< const Grid >, LeafIntersectionWrapper< const Grid > > LeafIntersectionIterator
Definition: alugrid/3d/grid.hh:306
int hierSetSize(int cd) const
Definition: grid_inline.hh:92
ALU3dGrid(const std::string &macroTriangFilename, const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndPrj, const DuneBoundaryProjectionVector *bndVec, const ALUGridRefinementType refinementType)
Definition: grid_inline.hh:21
Definition: lbdatahandle.hh:14
Definition: alugrid/3d/grid.hh:332
ObjectStreamType InStreamType
Definition: alugrid/3d/grid.hh:468
Include standard header files.
Definition: agrid.hh:59
GridFamily::LeafIndexSetImp LeafIndexSetImp
Type of the leaf index set, needed by data handle.
Definition: alugrid/3d/grid.hh:488
MakeableInterfaceObject< typename Traits::template Codim< 3 >::Entity > VertexObject
Definition: alugrid/3d/grid.hh:508
ALU3dGridGeometry< dim-cd, dimworld, const Grid > GeometryImpl
Definition: alugrid/3d/grid.hh:318
static const int dimworld
Definition: alugrid/3d/grid.hh:277
A Traits struct that collects all associated types of one implementation.
Definition: common/grid.hh:437
Definition: alugrid/3d/entity.hh:32
GridFamily::LevelIndexSetImp LevelIndexSetImp
Type of the level index set, needed by data handle.
Definition: alugrid/3d/grid.hh:486
GlobalIdSetImp * globalIdSet_
Definition: alugrid/3d/grid.hh:1057
Definition: alugrid/3d/entity.hh:26
if one element is refined then it causes apporximately not more than this number of new elements ...
Definition: alugrid/3d/grid.hh:555
ALU3dGridIntersectionIterator< const ThisType > LeafIntersectionIteratorImp
Definition: alugrid/3d/grid.hh:451
virtual GitterImplType * createALUGrid(const std::string &macroName)
Definition: alugrid/3d/grid.hh:877
Dune::Intersection< const Grid, LevelIntersectionWrapper< const Grid > > LevelIntersection
Definition: alugrid/3d/grid.hh:302
ALU3dGridCommunications< elType, Comm > Communications
Definition: alugrid/3d/grid.hh:561
bool conformingRefinement() const
Definition: alugrid/3d/grid.hh:1018
const HierarchicIndexSet & hierarchicIndexSet() const
Definition: alugrid/3d/grid.hh:837
MakeableInterfaceObject< typename Traits::template Codim< 1 >::Entity > FaceObject
Definition: alugrid/3d/grid.hh:506
DefaultIndexSet< GridImp, typename Codim< 0 >::LevelIterator > LevelIndexSetImp
Type of the level index set.
Definition: alugrid/3d/grid.hh:350
normal default number of new elements for new adapt method
Definition: alugrid/3d/grid.hh:547
GitterImplType * mygrid_
Definition: alugrid/3d/grid.hh:1040
IndexSet< Grid, LeafIndexSetImp > LeafIndexSet
Definition: alugrid/3d/grid.hh:356
int getLevelOfLeafVertex(const typename ALU3dImplTraits< elType, Comm >::VertexType &vertex) const
Definition: alugrid/3d/grid.hh:924
A set of traits classes to store static information about grid implementation.
void recalcGlobalSize()
make grid walkthrough and calc global size
static const int dim
Definition: alugrid/3d/grid.hh:276
Definition: alugrid/3d/grid.hh:1050
Traits::template Codim< 0 >::LeafIterator LeafIterator
Definition: alugrid/3d/grid.hh:532
void checkForConformingRefinement(GitterImpl *grid, const bool conformingRefinement)
Definition: alugrid/3d/grid.hh:122
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
ALU3dGridCommunications(No_Comm comm)
Definition: alugrid/3d/grid.hh:151
Traits::LocalIdSet LocalIdSet
Type of the local id set.
Definition: alugrid/3d/grid.hh:527
ALU3dGridEntitySeed< cd, const Grid > EntitySeed
Definition: alugrid/3d/grid.hh:326
Dune::EntityIterator< 0, const Grid, ALU3dGridHierarchicIterator< const Grid > > HierarchicIterator
Definition: alugrid/3d/grid.hh:309
Interface class for the Grid's adapt method where the parameter is a AdaptDataHandleInterface.
Definition: adaptcallback.hh:30
size_t numBoundarySegments() const
number of boundary segments
Communications * communications_
Definition: alugrid/3d/grid.hh:1103
void checkMacroGridFile(const std::string filename)
check whether macro grid format is of our type
Definition: alugrid/3d/grid.hh:271