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