15 #include <dune/common/fvector.hh> 16 #include <dune/common/typetraits.hh> 17 #include <dune/common/deprecated.hh> 20 #include <dune/geometry/type.hh> 33 #include <dune/common/bartonnackmanifcheck.hh> 336 template<
int mydim,
int cdim,
class Gr
idImp,
template<
int,
int,
class>
class GeometryImp>
class Geometry;
341 template<
int codim,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
class Entity;
342 template<
int codim,
class Gr
id,
class IteratorImp >
class EntityIterator;
343 template<
class Gr
idImp,
class EntitySeedImp>
class EntitySeed;
344 template<
class Gr
idImp,
class IntersectionImp >
class Intersection;
346 template<
class Gr
idImp,
class IndexSetImp,
class IndexTypeImp =
unsigned int,
class TypesImp = std::vector< GeometryType > >
class IndexSet;
347 template<
class Gr
idImp,
class IdSetImp,
class IdTypeImp>
class IdSet;
372 template<
int dim,
int dimworld,
class ct,
class Gr
idFamily>
374 typedef typename GridFamily::Traits::Grid GridImp;
429 template <PartitionIteratorType pitype>
538 return asImp().maxLevel();
542 int size (
int level,
int codim)
const 544 CHECK_INTERFACE_IMPLEMENTATION(
asImp().
size(level,codim));
545 return asImp().size(level,codim);
551 CHECK_INTERFACE_IMPLEMENTATION(
asImp().
size(codim));
552 return asImp().size(codim);
558 CHECK_INTERFACE_IMPLEMENTATION(
asImp().
size(level,type));
559 return asImp().size(level,type);
565 CHECK_INTERFACE_IMPLEMENTATION(
asImp().
size(type));
566 return asImp().size(type);
578 return asImp().numBoundarySegments();
590 return asImp().levelGridView(level);
596 return asImp().leafGridView();
612 return asImp().globalIdSet();
619 return asImp().localIdSet();
626 return asImp().levelIndexSet(level);
633 return asImp().leafIndexSet();
664 return asImp().mark(refCount,e);
675 return asImp().getMark(e);
686 return asImp().preAdapt();
705 return asImp().adapt();
714 return asImp().postAdapt();
726 DUNE_DEPRECATED_MSG(
"overlapSize() is deprecated. Use the method on the LevelGridView instead.")
733 DUNE_DEPRECATED_MSG(
"overlapSize() is deprecated. Use the method on the LeafGridView instead.")
740 DUNE_DEPRECATED_MSG(
"ghostSize() is deprecated. Use the method on the LevelGridView instead.")
747 DUNE_DEPRECATED_MSG(
"ghostSize() is deprecated. Use the method on the LeafGridView instead.")
764 template<
class DataHandleImp,
class DataTypeImp>
765 DUNE_DEPRECATED_MSG(
"communicate() is deprecated. Use the method on the LevelGridView instead.")
768 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((
asImp().
template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir,level)));
782 template<
class DataHandleImp,
class DataTypeImp>
783 DUNE_DEPRECATED_MSG(
"communicate() is deprecated. Use the method on the LeafGridView instead.")
786 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((
asImp().
template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir)));
793 CHECK_INTERFACE_IMPLEMENTATION(
asImp().
comm());
794 return asImp().comm();
804 return asImp().loadBalance();
814 template<
class DataHandle>
818 return asImp().loadBalance(data);
822 template <
class EntitySeed >
827 return asImp().entity( seed );
831 GridImp&
asImp () {
return static_cast<GridImp &
> (*this);}
833 const GridImp&
asImp ()
const {
return static_cast<const GridImp &
>(*this);}
836 #undef CHECK_INTERFACE_IMPLEMENTATION 837 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION 855 template<
int dim,
int dimworld,
class ct,
class Gr
idFamily>
872 template<
int dim,
int dimworld,
class ct,
class Gr
idFamily>
921 typedef typename GridFamily::Traits::Grid GridImp;
929 typedef typename GridFamily::Traits
Traits;
934 typedef typename Traits::LevelGridView View;
935 typedef typename View::GridViewImp ViewImp;
936 return View(ViewImp(
asImp(),level));
942 typedef typename Traits::LeafGridView View;
943 typedef typename View::GridViewImp ViewImp;
944 return View(ViewImp(
asImp()));
1018 template<
class DataHandleImp,
class DataTypeImp>
1024 template<
class DataHandleImp,
class DataTypeImp>
1036 template<
class DataHandle>
1095 template <
class InterfaceType>
1096 static typename std::conditional<
1100 typename std::add_lvalue_reference<
1102 typename std::remove_reference<
1107 typename std::remove_const<
1109 typename std::remove_reference<
1135 template <
int dim,
int dimw,
class GridImp,
1136 template<
int,
int,
class>
class GeometryImp,
1137 template<
int,
int,
class>
class EntityImp,
1138 template<
int,PartitionIteratorType,
class>
class LevelIteratorImp,
1139 template<
class>
class LeafIntersectionImp,
1140 template<
class>
class LevelIntersectionImp,
1141 template<
class>
class LeafIntersectionIteratorImp,
1142 template<
class>
class LevelIntersectionIteratorImp,
1143 template<
class>
class HierarchicIteratorImp,
1144 template<
int,PartitionIteratorType,
class>
class LeafIteratorImp,
1145 class LevelIndexSetImp,
class LeafIndexSetImp,
1146 class GlobalIdSetImp,
class GIDType,
class LocalIdSetImp,
class LIDType,
class CCType,
1147 template<
class>
class LevelGridViewTraits,
1148 template<
class>
class LeafGridViewTraits,
1149 template<
int,
class>
class EntitySeedImp,
1150 template<
int,
int,
class>
class LocalGeometryImp = GeometryImp
1195 template <PartitionIteratorType pitype>
1233 namespace Capabilities
1237 template<
int dim,
int dimworld,
typename ct,
class Gr
idFamily ,
int codim >
1244 template<
int dim,
int dimworld,
typename ct,
class Gr
idFamily ,
int cdim >
1259 template <
class InterfaceType>
1278 #endif // #ifndef DUNE_GRID_HH Interface class EntitySeed.
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:498
int getMark(const typename Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: common/grid.hh:673
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:472
A traits struct that collects all associated types of one grid model.
Definition: common/grid.hh:1152
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: common/grid.hh:766
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:522
GridImp & asImp()
Barton-Nackman trick.
Definition: common/grid.hh:831
Partition< All_Partition >::LevelIterator LevelIterator
The type of the entity pointer for entities of this codim.
Definition: common/grid.hh:1208
int overlapSize(int codim) const
overlapSize is zero by default
Definition: common/grid.hh:1015
GridFamily::Traits::template Codim< cd >::Entity Entity
A type that is a model of a Dune::Entity<cd,dim,...>.
Definition: common/grid.hh:423
Dune::EntityIterator< 0, const GridImp, HierarchicIteratorImp< const GridImp > > HierarchicIterator
The type of the hierarchic iterator.
Definition: common/grid.hh:1167
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: albertagrid/dgfparser.hh:26
bool loadBalance(DataHandle &data)
default implementation of load balance does nothing and returns false
Definition: common/grid.hh:1037
const T::Implementation ImplementationType
Definition: common/grid.hh:1066
IdSet< const GridImp, GlobalIdSetImp, GIDType > GlobalIdSet
The type of the global id set.
Definition: common/grid.hh:1224
Dune::Geometry< dim-cd, dimw, const GridImp, GeometryImp > Geometry
IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
Definition: common/grid.hh:1181
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible...
Definition: common/grid.hh:703
Definition: common/grid.hh:1260
Dune::GridView< LevelGridViewTraits< const GridImp > > LevelGridView
type of view for level grid
Definition: common/grid.hh:1217
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Partition< All_Partition >::LeafIterator LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: common/grid.hh:1205
Dune::GridView< LeafGridViewTraits< const GridImp > > LeafGridView
type of view for leaf grid
Definition: common/grid.hh:1215
bool preAdapt()
returns true, if at least one entity is marked for adaption
Definition: common/grid.hh:1000
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:479
int size(GeometryType type) const
Return number of leaf entities per geometry type in this process.
Definition: common/grid.hh:563
Wrapper and interface class for a static iterator (EntityPointer)
GridDefaultImplementation< dim, dimworld, ct, GridFamily > GridType
Definition: common/grid.hh:1247
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity, i.e. here the default implementation returns 0...
Definition: common/grid.hh:985
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:662
int ghostSize(int codim) const
ghostSize is zero by default
Definition: common/grid.hh:1012
LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: common/grid.hh:594
const LevelIndexSet & levelIndexSet(int level) const
return const reference to the grids level index set for level level
Definition: common/grid.hh:623
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:513
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
Codim< EntitySeed ::codimension >::Entity entity(const EntitySeed &seed) const
obtain Entity from EntitySeed.
Definition: common/grid.hh:824
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
GridType::Traits::Grid GridImp
Definition: common/grid.hh:1248
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: common/grid.hh:1025
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition: common/grid.hh:1019
GridFamily::Traits::LevelGridView LevelGridView
type of view for level grid
Definition: common/grid.hh:406
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:492
Definition: common/geometry.hh:24
bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: common/grid.hh:973
void globalRefine(int refCount)
Refine the grid refCount times using the default refinement rule.
Definition: common/grid.hh:649
int ghostSize(int level, int codim) const
Return size of ghost region for a given codim on a given level.
Definition: common/grid.hh:741
Dune::EntitySeed< const GridImp, EntitySeedImp< cd, const GridImp > > EntitySeed
The type of the entity seed of this codim.
Definition: common/grid.hh:1189
bool adapt()
Refine all positive marked leaf entities coarsen all negative marked entities if possible.
Definition: common/grid.hh:997
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest lev...
Definition: common/grid.hh:535
IndexSet< const GridImp, LevelIndexSetImp > LevelIndexSet
The type of the level index set.
Definition: common/grid.hh:1220
Dune::Entity< cd, dim, const GridImp, EntityImp > Entity
The type of the entity.
Definition: common/grid.hh:1186
Dune::Intersection< const GridImp, LevelIntersectionImp< const GridImp > > LevelIntersection
The type of the intersection at the levels of the grid.
Definition: common/grid.hh:1160
Dune::Intersection< const GridImp, LeafIntersectionImp< const GridImp > > LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: common/grid.hh:1158
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:345
GeometryImp< dim-cd, dimw, const GridImp > GeometryImpl
Definition: common/grid.hh:1177
GridFamily::Traits::template Codim< cd >::LocalGeometry LocalGeometry
A type that is a model of Dune::Geometry<dim-cd,dim>.
Definition: common/grid.hh:420
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1262
Provides base classes for index and id sets.
MakeableInterfaceObject(const ImplementationType &realImp)
create interface object by calling the contructor of the base class
Definition: common/grid.hh:1264
bool preAdapt()
To be called after entities have been marked and before adapt() is called.
Definition: common/grid.hh:684
GridImp Grid
The type that implements the grid.
Definition: common/grid.hh:1155
LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: common/grid.hh:588
A struct collecting all types depending on the partition iterator type.
Definition: common/grid.hh:430
int overlapSize(int level, int codim) const
overlapSize is zero by default
Definition: common/grid.hh:1009
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:815
Traits::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: common/grid.hh:932
T::Implementation ImplementationType
The correct type of the implementation to return.
Definition: common/grid.hh:1055
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:1199
GridFamily::Traits::template Codim< cd >::Geometry Geometry
A type that is a model of Dune::Geometry<dim-cd,dimworld>.
Definition: common/grid.hh:417
bool loadBalance()
Re-balances the load each process has to handle for a parallel grid,.
Definition: common/grid.hh:801
int size(int codim) const
Return number of leaf entities of a given codim in this process.
Definition: common/grid.hh:549
Traits associated with a specific grid partition type.
Definition: common/grid.hh:1196
GridFamily::Traits::CollectiveCommunication CollectiveCommunication
A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective co...
Definition: common/grid.hh:519
IdSet< const GridImp, LocalIdSetImp, LIDType > LocalIdSet
The type of the local id set.
Definition: common/grid.hh:1226
void postAdapt()
To be called after grid has been adapted and information left over by the adaptation has been process...
Definition: common/grid.hh:712
A set of traits classes to store static information about grid implementation.
GridFamily::Traits::LeafGridView LeafGridView
type of view for leaf grid
Definition: common/grid.hh:404
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:542
Include standard header files.
Definition: agrid.hh:59
Id Set Interface.
Definition: common/grid.hh:347
Definition: common/grid.hh:337
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:454
void postAdapt()
clean up some markers
Definition: common/grid.hh:1003
int ghostSize(int level, int codim) const
ghostSize is zero by default
Definition: common/grid.hh:1006
const GridImp & asImp() const
Barton-Nackman trick.
Definition: common/grid.hh:833
Wrapper class for geometries.
Definition: common/geometry.hh:65
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
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:1115
const CollectiveCommunication & comm() const
return const reference to a collective communication object. The return type is a model of Dune::Coll...
Definition: common/grid.hh:791
Wrapper and interface classes for element geometries.
Wrapper class for entities.
Definition: common/entity.hh:64
bool loadBalance()
default implementation of load balance does nothing and returns false
Definition: common/grid.hh:1030
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:1201
A Traits struct that collects all associated types of one implementation.
Definition: common/grid.hh:414
Specialize with 'true' for all codims that a grid implements entities for. (default=false) ...
Definition: common/capabilities.hh:55
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: common/grid.hh:940
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:486
Index Set Interface base class.
Definition: common/grid.hh:346
CCType CollectiveCommunication
The type of the collective communication.
Definition: common/grid.hh:1229
int size(int level, GeometryType type) const
Return number of entities per level and geometry type in this process.
Definition: common/grid.hh:556
int overlapSize(int level, int codim) const
Return size of overlap for a given codim on a given level.
Definition: common/grid.hh:727
GridFamily::Traits::template Codim< cd >::EntitySeed EntitySeed
A type that is a model (not yet) of Dune::EntitySeed<cd,dim,...>.
Definition: common/grid.hh:426
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:1162
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:460
IndexSet< const GridImp, LeafIndexSetImp > LeafIndexSet
The type of the leaf index set.
Definition: common/grid.hh:1222
interface class for an iterator over grid entitiesAn entity iterator is an iterator over a subset of ...
Definition: entityiterator.hh:35
Definition: geometryreference.hh:89
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:450
Traits associated with a specific codim.
Definition: common/grid.hh:1174
Dune::Geometry< dim-cd, dim, const GridImp, LocalGeometryImp > LocalGeometry
The type of the local geometry associated with the entity.
Definition: common/grid.hh:1183
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:438
const LeafIndexSet & leafIndexSet() const
return const reference to the grids leaf index set
Definition: common/grid.hh:630
Helper class to choose correct implementation return type for getRealImplementation.
Definition: common/grid.hh:1050
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:506
The dimension of the grid.
Definition: common/grid.hh:387
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:465
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:1164
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:445
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:373
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
Grid view abstract base class.
Definition: common/gridview.hh:59
const LocalIdSet & localIdSet() const
return const reference to the grids local id set
Definition: common/grid.hh:616
const GlobalIdSet & globalIdSet() const
return const reference to the grids global id set
Definition: common/grid.hh:609
LocalGeometryImp< dim-cd, dim, const GridImp > LocalGeometryImpl
Definition: common/grid.hh:1178
GridFamily::Traits Traits
The traits of this class.
Definition: common/grid.hh:929
size_t numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition: common/grid.hh:575
The dimension of the world the grid lives in.
Definition: common/grid.hh:393