dune-grid  2.11
common/grid.hh
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 // vi: set et ts=4 sw=2 sts=2:
5 #ifndef DUNE_GRID_COMMON_GRID_HH
6 #define DUNE_GRID_COMMON_GRID_HH
7 
11 // system includes
12 #include <iostream>
13 #include <string>
14 #include <vector>
15 
16 // dune-common includes
17 #include <dune/common/fvector.hh>
18 #include <dune/common/typetraits.hh>
19 #include <dune/common/typeutilities.hh>
20 
21 // dune-geometry includes
22 #include <dune/geometry/type.hh>
23 
24 // local includes
32 
33 // include this file after all other, because other files might undef the
34 // macros that are defined in that file
35 #include <dune/common/bartonnackmanifcheck.hh>
36 
37 namespace Dune {
38 
335  // Forward Declarations
336  // --------------------
337 
338  template<int mydim, int cdim, class GridImp,template<int,int,class> class GeometryImp> class Geometry;
339  template< int mydim, int cdim, class GridImp > class GlobalGeometryReference;
340  template< int mydim, int cdim, class GridImp > class LocalGeometryReference;
341  // dim is necessary because Entity will be specialized for codim==0 _and_ codim==dim
342  // EntityImp gets GridImp as 3rd template parameter to distinguish between const and mutable grid
343  template<int codim, int dim, class GridImp,template<int,int,class> class EntityImp> class Entity;
344  template< int codim, class Grid, class IteratorImp > class EntityIterator;
345  template<class GridImp, class EntitySeedImp> class EntitySeed;
346  template< class GridImp, class IntersectionImp > class Intersection;
347  template< class GridImp, class IntersectionIteratorImp, class IntersectionImp > class IntersectionIterator;
348  template< class GridImp, class IndexSetImp, class IndexTypeImp = unsigned int, class TypesImp = std::vector< GeometryType > > class IndexSet;
349  template<class GridImp, class IdSetImp, class IdTypeImp> class IdSet;
350 
351 
352  //************************************************************************
353  // G R I D
354  //************************************************************************
355 
374  template< int dim, int dimworld, class ct, class GridFamily>
375  class Grid {
376  typedef typename GridFamily::Traits::Grid GridImp;
378  public:
379 
380  //===========================================================
384  //===========================================================
385 
387  constexpr static int dimension = dim;
388 
390  constexpr static int dimensionworld = dimworld;
392 
393  //===========================================================
397  //===========================================================
398 
400  typedef typename GridFamily::Traits::LeafGridView LeafGridView;
402  typedef typename GridFamily::Traits::LevelGridView LevelGridView;
403 
404 
409  template <int cd>
410  struct Codim
411  {
413  typedef typename GridFamily::Traits::template Codim<cd>::Geometry Geometry;
414 
416  typedef typename GridFamily::Traits::template Codim<cd>::LocalGeometry LocalGeometry;
417 
419  typedef typename GridFamily::Traits::template Codim<cd>::Entity Entity;
420 
422  typedef typename GridFamily::Traits::template Codim<cd>::EntitySeed EntitySeed;
423 
425  template <PartitionIteratorType pitype>
426  struct Partition
427  {
434  typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LevelIterator LevelIterator;
441  typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LeafIterator LeafIterator;
442  };
443 
446  typedef typename GridFamily::Traits::template Codim<cd>::LevelIterator LevelIterator;
447 
450  typedef typename GridFamily::Traits::template Codim<cd>::LeafIterator LeafIterator;
451  };
452 
456  typedef typename GridFamily::Traits::LeafIntersection LeafIntersection;
457 
461  typedef typename GridFamily::Traits::LevelIntersection LevelIntersection;
462 
468  typedef typename GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator;
469 
475  typedef typename GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator;
476 
482  typedef typename GridFamily::Traits::HierarchicIterator HierarchicIterator;
483 
488  typedef typename GridFamily::Traits::LevelIndexSet LevelIndexSet;
489 
494  typedef typename GridFamily::Traits::LeafIndexSet LeafIndexSet;
495 
502  typedef typename GridFamily::Traits::GlobalIdSet GlobalIdSet;
503 
509  typedef typename GridFamily::Traits::LocalIdSet LocalIdSet;
510 
515  using Communication = typename GridFamily::Traits::Communication;
516 
518  typedef ct ctype;
520 
521 
522  //===========================================================
526  //===========================================================
527 
531  int maxLevel() const
532  {
533  CHECK_INTERFACE_IMPLEMENTATION(asImp().maxLevel());
534  return asImp().maxLevel();
535  }
536 
538  int size (int level, int codim) const
539  {
540  CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,codim));
541  return asImp().size(level,codim);
542  }
543 
545  int size (int codim) const
546  {
547  CHECK_INTERFACE_IMPLEMENTATION(asImp().size(codim));
548  return asImp().size(codim);
549  }
550 
552  int size (int level, GeometryType type) const
553  {
554  CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,type));
555  return asImp().size(level,type);
556  }
557 
559  int size (GeometryType type) const
560  {
561  CHECK_INTERFACE_IMPLEMENTATION(asImp().size(type));
562  return asImp().size(type);
563  }
565 
566 
571  size_t numBoundarySegments () const
572  {
573  CHECK_INTERFACE_IMPLEMENTATION( asImp().numBoundarySegments());
574  return asImp().numBoundarySegments();
575  }
576 
577  //===========================================================
581  //===========================================================
582 
584  LevelGridView levelGridView(int level) const {
585  CHECK_INTERFACE_IMPLEMENTATION((asImp().levelGridView(level)));
586  return asImp().levelGridView(level);
587  }
588 
591  CHECK_INTERFACE_IMPLEMENTATION((asImp().leafGridView()));
592  return asImp().leafGridView();
593  }
594 
596 
597 
598  //===========================================================
602  //===========================================================
603 
605  const GlobalIdSet &globalIdSet () const
606  {
607  CHECK_INTERFACE_IMPLEMENTATION(asImp().globalIdSet());
608  return asImp().globalIdSet();
609  }
610 
612  const LocalIdSet &localIdSet () const
613  {
614  CHECK_INTERFACE_IMPLEMENTATION(asImp().localIdSet());
615  return asImp().localIdSet();
616  }
617 
619  const LevelIndexSet &levelIndexSet ( int level ) const
620  {
621  CHECK_INTERFACE_IMPLEMENTATION(asImp().levelIndexSet(level));
622  return asImp().levelIndexSet(level);
623  }
624 
626  const LeafIndexSet &leafIndexSet () const
627  {
628  CHECK_INTERFACE_IMPLEMENTATION(asImp().leafIndexSet());
629  return asImp().leafIndexSet();
630  }
632 
633 
634  //===========================================================
638  //===========================================================
639 
645  void globalRefine (int refCount)
646  {
647  CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(asImp().globalRefine(refCount));
648  return;
649  }
650 
658  bool mark( int refCount, const typename Codim<0>::Entity & e )
659  {
660  return asImp().mark(refCount,e);
661  }
662 
669  int getMark(const typename Codim<0>::Entity & e) const
670  {
671  return asImp().getMark(e);
672  }
673 
680  bool preAdapt ()
681  {
682  return asImp().preAdapt();
683  }
684 
699  bool adapt ()
700  {
701  return asImp().adapt();
702  }
703 
708  void postAdapt()
709  {
710  return asImp().postAdapt();
711  }
713 
714 
715  //===========================================================
719  //===========================================================
720 
722  const Communication &comm () const
723  {
724  CHECK_INTERFACE_IMPLEMENTATION(asImp().comm());
725  return asImp().comm();
726  }
728 
732  bool loadBalance()
733  {
734  CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance());
735  return asImp().loadBalance();
736  }
737 
745  template<class DataHandle>
746  bool loadBalance (DataHandle& data)
747  {
748  CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance(data));
749  return asImp().loadBalance(data);
750  }
751 
753  template < class EntitySeed >
754  typename Codim< EntitySeed :: codimension > :: Entity
755  entity( const EntitySeed& seed ) const
756  {
757  //CHECK_INTERFACE_IMPLEMENTATION( asImp().entity( seed ) );
758  return asImp().entity( seed );
759  }
760  protected:
762  GridImp& asImp () {return static_cast<GridImp &> (*this);}
764  const GridImp& asImp () const {return static_cast<const GridImp &>(*this);}
765  };
766 
767 #undef CHECK_INTERFACE_IMPLEMENTATION
768 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
769 
786  template<int dim, int dimworld, class ct, class GridFamily>
789  {
790  return grid.levelGridView(level);
791  }
792 
803  template<int dim, int dimworld, class ct, class GridFamily>
806  {
807  return grid.leafGridView();
808  }
809 
843  template<int dim,
844  int dimworld,
845  class ct,
846  class GridFamily>
847  class GridDefaultImplementation : public Grid <dim,dimworld,ct,GridFamily>
848  {
849  typedef typename GridFamily::Traits::Grid GridImp;
850 
851  public:
857  typedef typename GridFamily::Traits Traits;
858 
860  typename Traits::LevelGridView levelGridView(int level) const
861  {
862  typedef typename Traits::LevelGridView View;
863  typedef typename View::GridViewImp ViewImp;
864  return View(ViewImp(asImp(),level));
865  }
866 
868  typename Traits::LeafGridView leafGridView() const
869  {
870  typedef typename Traits::LeafGridView View;
871  typedef typename View::GridViewImp ViewImp;
872  return View(ViewImp(asImp()));
873  }
874 
876  typename Traits::LeafIntersectionIterator
877  ileafbegin ( const typename Traits::template Codim<0>::Entity &entity ) const
878  {
879  return entity.impl().ileafbegin();
880  }
881 
883  typename Traits::LeafIntersectionIterator
884  ileafend ( const typename Traits::template Codim<0>::Entity &entity ) const
885  {
886  return entity.impl().ileafend();
887  }
888 
890  typename Traits::LevelIntersectionIterator
891  ilevelbegin ( const typename Traits::template Codim<0>::Entity &entity ) const
892  {
893  return entity.impl().ilevelbegin();
894  }
895 
897  typename Traits::LevelIntersectionIterator
898  ilevelend ( const typename Traits::template Codim<0>::Entity &entity ) const
899  {
900  return entity.impl().ilevelend();
901  }
902 
903  //***************************************************************
904  // Interface for Adaptation
905  //***************************************************************
906 
929  bool mark( int /*refCount*/, const typename Traits :: template Codim<0>::Entity & /*e*/ )
930  {
931  return false;
932  }
933 
941  int getMark ( const typename Traits::template Codim< 0 >::Entity& /*e*/ ) const
942  {
943  return 0;
944  }
945 
953  bool adapt () { return false; }
954 
956  bool preAdapt () { return false; }
957 
959  void postAdapt() {}
960 
962  bool loadBalance()
963  {
964  return false;
965  }
966 
968  template<class DataHandle>
969  bool loadBalance ([[maybe_unused]] DataHandle& data)
970  {
971  return false;
972  }
973 
974  protected:
976  };
977 
991  template <int dim, int dimw, class GridImp,
992  template<int,int,class> class GeometryImp,
993  template<int,int,class> class EntityImp,
994  template<int,PartitionIteratorType,class> class LevelIteratorImp,
995  template<class> class LeafIntersectionImp,
996  template<class> class LevelIntersectionImp,
997  template<class> class LeafIntersectionIteratorImp,
998  template<class> class LevelIntersectionIteratorImp,
999  template<class> class HierarchicIteratorImp,
1000  template<int,PartitionIteratorType,class> class LeafIteratorImp,
1001  class LevelIndexSetImp, class LeafIndexSetImp,
1002  class GlobalIdSetImp, class GIDType, class LocalIdSetImp, class LIDType, class CCType,
1003  template<class> class LevelGridViewTraits,
1004  template<class> class LeafGridViewTraits,
1005  template<int,class> class EntitySeedImp,
1006  template<int,int,class> class LocalGeometryImp = GeometryImp,
1007  class LevelIndexType = unsigned int,
1008  class LevelGeometryTypes = std::vector<GeometryType>,
1009  class LeafIndexType = LevelIndexType,
1010  class LeafGeometryTypes = LevelGeometryTypes
1011  >
1012  struct GridTraits
1013  {
1015  typedef GridImp Grid;
1016 
1025 
1028 
1033  template <int cd>
1034  struct Codim
1035  {
1036  public:
1037  typedef GeometryImp<dim-cd, dimw, const GridImp> GeometryImpl;
1038  typedef LocalGeometryImp<dim-cd, dim, const GridImp> LocalGeometryImpl;
1040 
1041  typedef Dune::Geometry<dim-cd, dimw, const GridImp, GeometryImp> Geometry;
1043  typedef Dune::Geometry<dim-cd, dim, const GridImp, LocalGeometryImp> LocalGeometry;
1045  // we could - if needed - introduce another struct for dimglobal of Geometry
1047 
1050 
1055  template <PartitionIteratorType pitype>
1056  struct Partition
1057  {
1062  };
1063 
1066 
1069 
1070  private:
1071  friend class Dune::Entity<cd, dim, const GridImp, EntityImp>;
1072  };
1073 
1078 
1087 
1089  typedef CCType Communication;
1090  };
1091 
1092  // Definition of capabilities for the interface class
1093  namespace Capabilities
1094  {
1095 
1096  // capabilities for the interface class depend on the implementation
1097  template< int dim, int dimworld, typename ct, class GridFamily , int codim >
1098  struct hasEntity< Grid< dim, dimworld, ct, GridFamily >, codim >
1099  {
1101  };
1102 
1103  // capabilities for the interface class depend on the implementation
1104  template< int dim, int dimworld, typename ct, class GridFamily , int cdim >
1105  struct hasEntity< GridDefaultImplementation<dim,dimworld,ct,GridFamily>, cdim >
1106  {
1109  static const bool v = hasEntity<GridImp,cdim>::v;
1110  };
1111 
1112  } // end namespace Capabilities
1113 
1119  template <class InterfaceType>
1121  {
1122  typedef typename InterfaceType::Implementation ImplementationType;
1124  explicit MakeableInterfaceObject ( const ImplementationType &realImp )
1125  : InterfaceType( realImp )
1126  {}
1127  };
1128 }
1129 
1130 #include "geometry.hh"
1131 #include "entity.hh"
1132 #include "intersection.hh"
1133 #include "intersectioniterator.hh"
1134 #include "entityiterator.hh"
1135 #include "indexidset.hh"
1136 
1137 #endif // #ifndef DUNE_GRID_COMMON_GRID_HH
Wrapper class for geometries.
Definition: common/geometry.hh:70
const LevelIndexSet & levelIndexSet(int level) const
return const reference to the grids level index set for level level
Definition: common/grid.hh:619
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:25
int size(int level, GeometryType type) const
Return number of entities per level and geometry type in this process.
Definition: common/grid.hh:552
Traits::LevelIntersectionIterator ilevelend(const typename Traits::template Codim< 0 >::Entity &entity) const
obtain end intersection iterator on the entity level
Definition: common/grid.hh:898
GridFamily::Traits::LevelGridView LevelGridView
type of view for level grid
Definition: common/grid.hh:402
GridFamily::Traits::GlobalIdSet GlobalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition: common/grid.hh:502
Dune::Intersection< const GridImp, LevelIntersectionImp< const GridImp > > LevelIntersection
The type of the intersection at the levels of the grid.
Definition: common/grid.hh:1020
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: common/grid.hh:390
GridFamily::Traits::template Codim< cd >::LevelIterator LevelIterator
A type that is a model of Dune::LevelIterator with partition type All_Partition.
Definition: common/grid.hh:446
LocalGeometryImp< dim-cd, dim, const GridImp > LocalGeometryImpl
Definition: common/grid.hh:1038
A Traits struct that collects all associated types of one implementation.
Definition: common/grid.hh:410
typename GridFamily::Traits::Communication Communication
A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
Definition: common/grid.hh:515
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest lev...
Definition: common/grid.hh:531
bool preAdapt()
To be called after entities have been marked and before adapt() is called.
Definition: common/grid.hh:680
Index Set Interface base class.
Definition: common/grid.hh:348
Dune::EntityIterator< cd, const GridImp, LevelIteratorImp< cd, pitype, const GridImp > > LevelIterator
The type of the iterator over the level entities of this codim on this partition. ...
Definition: common/grid.hh:1059
void globalRefine(int refCount)
Refine the grid refCount times using the default refinement rule.
Definition: common/grid.hh:645
GridImp & asImp()
Barton-Nackman trick.
Definition: common/grid.hh:762
Implementation & impl()
access to the underlying implementation
Definition: common/entity.hh:80
GridFamily::Traits::template Codim< cd >::LocalGeometry LocalGeometry
A type that is a model of Dune::Geometry<dim-cd,dim>.
Definition: common/grid.hh:416
bool loadBalance()
default implementation of load balance does nothing and returns false
Definition: common/grid.hh:962
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine...
Definition: common/grid.hh:482
int getMark(const typename Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: common/grid.hh:669
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: common/grid.hh:456
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:375
Dune::GridView< LeafGridViewTraits< const GridImp > > LeafGridView
type of view for leaf grid
Definition: common/grid.hh:1075
IndexSet< const GridImp, LeafIndexSetImp, LeafIndexType, LeafGeometryTypes > LeafIndexSet
The type of the leaf index set.
Definition: common/grid.hh:1082
Traits::LeafIntersectionIterator ileafend(const typename Traits::template Codim< 0 >::Entity &entity) const
obtain end intersection iterator on the leaf level
Definition: common/grid.hh:884
IndexSet< const GridImp, LevelIndexSetImp, LevelIndexType, LevelGeometryTypes > LevelIndexSet
The type of the level index set.
Definition: common/grid.hh:1080
GridFamily::Traits::template Codim< cd >::EntitySeed EntitySeed
A type that is a model (not yet) of Dune::EntitySeed<cd,dim,...>.
Definition: common/grid.hh:422
GeometryImp< dim-cd, dimw, const GridImp > GeometryImpl
Definition: common/grid.hh:1037
int size(int level, int codim) const
Return number of grid entities of a given codim on a given level in this process. ...
Definition: common/grid.hh:538
void postAdapt()
clean up some markers
Definition: common/grid.hh:959
const LeafIndexSet & leafIndexSet() const
return const reference to the grids leaf index set
Definition: common/grid.hh:626
const GridImp & asImp() const
Barton-Nackman trick.
Definition: common/grid.hh:764
Specialize with &#39;true&#39; for all codims that a grid implements entities for. (default=false) ...
Definition: common/capabilities.hh:57
GridFamily::Traits::template Codim< cd >::LeafIterator LeafIterator
A type that is a model of Dune::LeafIterator with partition type All_Partition.
Definition: common/grid.hh:450
A struct collecting all types depending on the partition iterator type.
Definition: common/grid.hh:426
concept Geometry
Model of a geometry object.
Definition: concepts/geometry.hh:29
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible...
Definition: common/grid.hh:699
Traits::LevelIntersectionIterator ilevelbegin(const typename Traits::template Codim< 0 >::Entity &entity) const
obtain begin intersection iterator on the entity level
Definition: common/grid.hh:891
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: common/grid.hh:868
GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine...
Definition: common/grid.hh:475
int size(int codim) const
Return number of leaf entities of a given codim in this process.
Definition: common/grid.hh:545
Traits::LeafIntersectionIterator ileafbegin(const typename Traits::template Codim< 0 >::Entity &entity) const
obtain begin intersection iterator on the leaf level
Definition: common/grid.hh:877
bool loadBalance()
Re-balances the load each process has to handle for a parallel grid,.
Definition: common/grid.hh:732
IdSet< const GridImp, LocalIdSetImp, LIDType > LocalIdSet
The type of the local id set.
Definition: common/grid.hh:1086
bool loadBalance([[maybe_unused]] DataHandle &data)
default implementation of load balance does nothing and returns false
Definition: common/grid.hh:969
GridFamily::Traits::LocalIdSet LocalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition: common/grid.hh:509
Codim< EntitySeed ::codimension >::Entity entity(const EntitySeed &seed) const
obtain Entity from EntitySeed.
Definition: common/grid.hh:755
void postAdapt()
To be called after grid has been adapted and information left over by the adaptation has been process...
Definition: common/grid.hh:708
Dune::IntersectionIterator< const GridImp, LevelIntersectionIteratorImp< const GridImp >, LevelIntersectionImp< const GridImp > > LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition: common/grid.hh:1024
IdSet< const GridImp, GlobalIdSetImp, GIDType > GlobalIdSet
The type of the global id set.
Definition: common/grid.hh:1084
Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
level grid view for the given grid and level.
Definition: common/grid.hh:788
Interface class EntitySeed.
Grid view abstract base class.
Definition: common/gridview.hh:65
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition: common/grid.hh:805
Partition< All_Partition >::LeafIterator LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: common/grid.hh:1065
GridFamily::Traits::template Codim< cd >::Geometry Geometry
A type that is a model of Dune::Geometry<dim-cd,dimworld>.
Definition: common/grid.hh:413
const Communication & comm() const
return const reference to a communication object. The return type is a model of Dune::Communication.
Definition: common/grid.hh:722
int getMark(const typename Traits::template Codim< 0 >::Entity &) const
returns adaptation mark for given entity, i.e. here the default implementation returns 0...
Definition: common/grid.hh:941
GridFamily::Traits::LevelIndexSet LevelIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level.
Definition: common/grid.hh:488
Dune::IntersectionIterator< const GridImp, LeafIntersectionIteratorImp< const GridImp >, LeafIntersectionImp< const GridImp > > LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition: common/grid.hh:1022
CCType Communication
The type of the communication.
Definition: common/grid.hh:1089
Dune::EntitySeed< const GridImp, EntitySeedImp< cd, const GridImp > > EntitySeed
The type of the entity seed of this codim.
Definition: common/grid.hh:1049
MakeableInterfaceObject(const ImplementationType &realImp)
create interface object by calling the constructor of the base class
Definition: common/grid.hh:1124
Traits associated with a specific codim.
Definition: common/grid.hh:1034
GridFamily::Traits::LeafIndexSet LeafIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid.
Definition: common/grid.hh:494
Definition: common/geometry.hh:28
Include standard header files.
Definition: agrid.hh:59
Dune::Intersection< const GridImp, LeafIntersectionImp< const GridImp > > LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: common/grid.hh:1018
Dune::GridView< LevelGridViewTraits< const GridImp > > LevelGridView
type of view for level grid
Definition: common/grid.hh:1077
GridFamily::Traits::LevelIntersection LevelIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: common/grid.hh:461
GridFamily::Traits::template Codim< cd >::template Partition< pitype >::LeafIterator LeafIterator
A type that is a model of Dune::LeafIterator<cd,pitype,...> which is a type of iterator that may be u...
Definition: common/grid.hh:441
bool adapt()
Refine all positive marked leaf entities coarsen all negative marked entities if possible.
Definition: common/grid.hh:953
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
concept Grid
Requirements for implementations of the Dune::Grid interface.The Grid concept defines interface requi...
Definition: concepts/grid.hh:109
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:347
Definition: geometryreference.hh:137
Partition< All_Partition >::LevelIterator LevelIterator
The type of the entity pointer for entities of this codim.
Definition: common/grid.hh:1068
A traits struct that collects all associated types of one grid model.
Definition: common/grid.hh:1012
Dune::Geometry< dim-cd, dimw, const GridImp, GeometryImp > Geometry
IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
Definition: common/grid.hh:1041
bool loadBalance(DataHandle &data)
Re-balances the load each process has to handle for a parallel grid and moves the data...
Definition: common/grid.hh:746
const GlobalIdSet & globalIdSet() const
return const reference to the grids global id set
Definition: common/grid.hh:605
static constexpr int dimension
The dimension of the grid.
Definition: common/grid.hh:387
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1122
static const bool v
Definition: common/capabilities.hh:59
bool mark(int refCount, const typename Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: common/grid.hh:658
GridFamily::Traits Traits
The traits of this class.
Definition: common/grid.hh:857
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: albertagrid/dgfparser.hh:28
GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine...
Definition: common/grid.hh:468
Provides base classes for index and id sets.
Describes the parallel communication interface class for MessageBuffers and DataHandles.
GridDefaultImplementation< dim, dimworld, ct, GridFamily > GridType
Definition: common/grid.hh:1107
LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: common/grid.hh:590
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:518
int size(GeometryType type) const
Return number of leaf entities per geometry type in this process.
Definition: common/grid.hh:559
Definition: common/grid.hh:1120
Wrapper class for entities.
Definition: common/entity.hh:65
Traits associated with a specific grid partition type.
Definition: common/grid.hh:1056
Wrapper and interface classes for element geometries.
GeometryType
Type representing VTK&#39;s entity geometry types.
Definition: common.hh:132
Traits::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: common/grid.hh:860
GridImp Grid
The type that implements the grid.
Definition: common/grid.hh:1015
LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: common/grid.hh:584
Dune::Entity< cd, dim, const GridImp, EntityImp > Entity
The type of the entity.
Definition: common/grid.hh:1046
Dune::Geometry< dim-cd, dim, const GridImp, LocalGeometryImp > LocalGeometry
The type of the local geometry associated with the entity.
Definition: common/grid.hh:1043
A set of traits classes to store static information about grid implementation.
interface class for an iterator over grid entities
Definition: common/entityiterator.hh:31
Dune::EntityIterator< cd, const GridImp, LeafIteratorImp< cd, pitype, const GridImp > > LeafIterator
The type of the iterator over the leaf entities of this codim on this partition.
Definition: common/grid.hh:1061
GridFamily::Traits::template Codim< cd >::Entity Entity
A type that is a model of a Dune::Entity<cd,dim,...>.
Definition: common/grid.hh:419
const LocalIdSet & localIdSet() const
return const reference to the grids local id set
Definition: common/grid.hh:612
bool preAdapt()
returns true, if at least one entity is marked for adaption
Definition: common/grid.hh:956
size_t numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition: common/grid.hh:571
bool mark(int, const typename Traits ::template Codim< 0 >::Entity &)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: common/grid.hh:929
Dune::EntityIterator< 0, const GridImp, HierarchicIteratorImp< const GridImp > > HierarchicIterator
The type of the hierarchic iterator.
Definition: common/grid.hh:1027
Id Set Interface.
Definition: common/grid.hh:349
GridFamily::Traits::LeafGridView LeafGridView
type of view for leaf grid
Definition: common/grid.hh:400
Definition: common/grid.hh:339
GridFamily::Traits::template Codim< cd >::template Partition< pitype >::LevelIterator LevelIterator
A type that is a model of Dune::LevelIterator<cd,pitype,...> which is s type of iterator that may be ...
Definition: common/grid.hh:434