dune-grid 2.9.0
Public Types | Public Member Functions | List of all members
Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily > Class Template Reference

#include <dune/grid/common/grid.hh>

Inheritance diagram for Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >:
Inheritance graph

Public Types

typedef GridFamily::Traits Traits
 The traits of this class. More...
 

Public Member Functions

Traits::LevelGridView levelGridView (int level) const
 View for a grid level for All_Partition. More...
 
Traits::LeafGridView leafGridView () const
 View for the leaf grid for All_Partition. More...
 
bool mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
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. More...
 
bool adapt ()
 Refine all positive marked leaf entities coarsen all negative marked entities if possible. More...
 
bool preAdapt ()
 returns true, if at least one entity is marked for adaption More...
 
void postAdapt ()
 clean up some markers More...
 
bool loadBalance ()
 default implementation of load balance does nothing and returns false More...
 
template<class DataHandle >
bool loadBalance (DataHandle &data)
 default implementation of load balance does nothing and returns false More...
 
Size methods
int maxLevel () const
 Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest level. More...
 
int size (int level, int codim) const
 Return number of grid entities of a given codim on a given level in this process. More...
 
int size (int codim) const
 Return number of leaf entities of a given codim in this process. More...
 
int size (int level, GeometryType type) const
 Return number of entities per level and geometry type in this process. More...
 
int size (GeometryType type) const
 Return number of leaf entities per geometry type in this process. More...
 
size_t numBoundarySegments () const
 returns the number of boundary segments within the macro grid More...
 
Access to index and id sets
const GlobalIdSetglobalIdSet () const
 return const reference to the grids global id set More...
 
const LocalIdSetlocalIdSet () const
 return const reference to the grids local id set More...
 
const LevelIndexSetlevelIndexSet (int level) const
 return const reference to the grids level index set for level level More...
 
const LeafIndexSetleafIndexSet () const
 return const reference to the grids leaf index set More...
 
Adaptivity and grid refinement
void globalRefine (int refCount)
 Refine the grid refCount times using the default refinement rule. More...
 
bool mark (int refCount, const typename Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
int getMark (const typename Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity More...
 

Static Public Attributes

Exported constants
static constexpr int dimension = dim
 The dimension of the grid. More...
 
static constexpr int dimensionworld = dimworld
 The dimension of the world the grid lives in. More...
 

Exported types

typedef GridFamily::Traits::LeafGridView LeafGridView
 type of view for leaf grid More...
 
typedef GridFamily::Traits::LevelGridView LevelGridView
 type of view for level grid More...
 
typedef GridFamily::Traits::LeafIntersection LeafIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view. More...
 
typedef GridFamily::Traits::LevelIntersection LevelIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view. More...
 
typedef GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements. More...
 
typedef GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level. More...
 
typedef GridFamily::Traits::HierarchicIterator HierarchicIterator
 A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0. More...
 
typedef 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. More...
 
typedef 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. More...
 
typedef GridFamily::Traits::GlobalIdSet GlobalIdSet
 A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is unique over all processes over which the grid is partitioned. The numbering is not necessarily consecutive. More...
 
typedef GridFamily::Traits::LocalIdSet LocalIdSet
 A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is only unique in a single process and it is not necessarily consecutive. More...
 
using Communication = detected_or_fallback_t< DeprecatedCollectiveCommunication_t, Communication_t, typename GridFamily::Traits >
 A type that is a model of Dune::Communication. It provides a portable way for communication on the set of processes used by the grid. More...
 
using CollectiveCommunication = Communication
 
typedef ct ctype
 Define type used for coordinates in grid module. More...
 
template<class T >
using Communication_t = typename T::Communication
 
template<class T >
using DeprecatedCollectiveCommunication_t = typename T::CollectiveCommunication
 

Parallel data distribution and communication

const Communicationcomm () const
 return const reference to a communication object. The return type is a model of Dune::Communication. More...
 
template<class EntitySeed >
Codim< EntitySeed::codimension >::Entity entity (const EntitySeed &seed) const
 obtain Entity from EntitySeed. More...
 
GridImp & asImp ()
 Barton-Nackman trick. More...
 
const GridImp & asImp () const
 Barton-Nackman trick. More...
 

Detailed Description

template<int dim, int dimworld, class ct, class GridFamily>
class Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >

A Grid is a container of grid entities. Given a dimension dim these entities have a codimension codim with 0 <= codim <= dim.

The Grid is assumed to be hierachically refined and nested. It enables iteration over entities of a given level and codimension.

The grid can be non-matching.

All information is provided to allocate degrees of freedom in appropriate vector data structures (which are not part of this module).

Template class Grid defines a "base class" for all grids.

Classes implementing the Grid Interface

Member Typedef Documentation

◆ CollectiveCommunication

template<int dim, int dimworld, class ct , class GridFamily >
using Dune::Grid< dim, dimworld, ct, GridFamily >::CollectiveCommunication = Communication
inherited
Deprecated:
Use Communication instead! Will be removed at some point in the future.

◆ Communication

template<int dim, int dimworld, class ct , class GridFamily >
using Dune::Grid< dim, dimworld, ct, GridFamily >::Communication = detected_or_fallback_t< DeprecatedCollectiveCommunication_t, Communication_t, typename GridFamily::Traits>
inherited

A type that is a model of Dune::Communication. It provides a portable way for communication on the set of processes used by the grid.

◆ Communication_t

template<int dim, int dimworld, class ct , class GridFamily >
template<class T >
using Dune::Grid< dim, dimworld, ct, GridFamily >::Communication_t = typename T::Communication
protectedinherited

◆ ctype

template<int dim, int dimworld, class ct , class GridFamily >
typedef ct Dune::Grid< dim, dimworld, ct, GridFamily >::ctype
inherited

Define type used for coordinates in grid module.

◆ DeprecatedCollectiveCommunication_t

template<int dim, int dimworld, class ct , class GridFamily >
template<class T >
using Dune::Grid< dim, dimworld, ct, GridFamily >::DeprecatedCollectiveCommunication_t = typename T::CollectiveCommunication
protectedinherited

◆ GlobalIdSet

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::GlobalIdSet Dune::Grid< dim, dimworld, ct, GridFamily >::GlobalIdSet
inherited

A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is unique over all processes over which the grid is partitioned. The numbering is not necessarily consecutive.

◆ HierarchicIterator

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::HierarchicIterator Dune::Grid< dim, dimworld, ct, GridFamily >::HierarchicIterator
inherited

A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0.

◆ LeafGridView

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LeafGridView Dune::Grid< dim, dimworld, ct, GridFamily >::LeafGridView
inherited

type of view for leaf grid

◆ LeafIndexSet

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LeafIndexSet Dune::Grid< dim, dimworld, ct, GridFamily >::LeafIndexSet
inherited

A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid.

◆ LeafIntersection

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LeafIntersection Dune::Grid< dim, dimworld, ct, GridFamily >::LeafIntersection
inherited

A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view.

◆ LeafIntersectionIterator

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LeafIntersectionIterator Dune::Grid< dim, dimworld, ct, GridFamily >::LeafIntersectionIterator
inherited

A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements.

◆ LevelGridView

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LevelGridView Dune::Grid< dim, dimworld, ct, GridFamily >::LevelGridView
inherited

type of view for level grid

◆ LevelIndexSet

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LevelIndexSet Dune::Grid< dim, dimworld, ct, GridFamily >::LevelIndexSet
inherited

A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level.

◆ LevelIntersection

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LevelIntersection Dune::Grid< dim, dimworld, ct, GridFamily >::LevelIntersection
inherited

A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view.

◆ LevelIntersectionIterator

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LevelIntersectionIterator Dune::Grid< dim, dimworld, ct, GridFamily >::LevelIntersectionIterator
inherited

A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level.

◆ LocalIdSet

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits::LocalIdSet Dune::Grid< dim, dimworld, ct, GridFamily >::LocalIdSet
inherited

A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is only unique in a single process and it is not necessarily consecutive.

◆ Traits

template<int dim, int dimworld, class ct , class GridFamily >
typedef GridFamily::Traits Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::Traits

The traits of this class.

Presents the typedefs as described in GridTraits.

Member Function Documentation

◆ adapt()

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::adapt ( )
inline

Refine all positive marked leaf entities coarsen all negative marked entities if possible.

Returns
true if a least one entity was refined
Note
this default implementation always returns false so grid with no adaptation doesn't need to implement these methods

◆ asImp() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
GridImp & Dune::Grid< dim, dimworld, ct, GridFamily >::asImp ( )
inlineprotectedinherited

Barton-Nackman trick.

◆ asImp() [2/2]

template<int dim, int dimworld, class ct , class GridFamily >
const GridImp & Dune::Grid< dim, dimworld, ct, GridFamily >::asImp ( ) const
inlineprotectedinherited

Barton-Nackman trick.

◆ comm()

template<int dim, int dimworld, class ct , class GridFamily >
const Communication & Dune::Grid< dim, dimworld, ct, GridFamily >::comm ( ) const
inlineinherited

return const reference to a communication object. The return type is a model of Dune::Communication.

◆ entity()

template<int dim, int dimworld, class ct , class GridFamily >
template<class EntitySeed >
Codim< EntitySeed::codimension >::Entity Dune::Grid< dim, dimworld, ct, GridFamily >::entity ( const EntitySeed seed) const
inlineinherited

obtain Entity from EntitySeed.

◆ getMark() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark ( const typename Codim< 0 >::Entity &  e) const
inlineinherited

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

◆ getMark() [2/2]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getMark ( const typename Traits::template Codim< 0 >::Entity &  e) const
inline

returns adaptation mark for given entity, i.e. here the default implementation returns 0.

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark, here the default value 0 is returned

◆ globalIdSet()

template<int dim, int dimworld, class ct , class GridFamily >
const GlobalIdSet & Dune::Grid< dim, dimworld, ct, GridFamily >::globalIdSet ( ) const
inlineinherited

return const reference to the grids global id set

◆ globalRefine()

template<int dim, int dimworld, class ct , class GridFamily >
void Dune::Grid< dim, dimworld, ct, GridFamily >::globalRefine ( int  refCount)
inlineinherited

Refine the grid refCount times using the default refinement rule.

This behaves like marking all elements for refinement and then calling preAdapt, adapt and postAdapt. The state after globalRefine is comparable to the state after postAdapt.

◆ leafGridView()

template<int dim, int dimworld, class ct , class GridFamily >
Traits::LeafGridView Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::leafGridView ( ) const
inline

View for the leaf grid for All_Partition.

◆ leafIndexSet()

template<int dim, int dimworld, class ct , class GridFamily >
const LeafIndexSet & Dune::Grid< dim, dimworld, ct, GridFamily >::leafIndexSet ( ) const
inlineinherited

return const reference to the grids leaf index set

◆ levelGridView()

template<int dim, int dimworld, class ct , class GridFamily >
Traits::LevelGridView Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::levelGridView ( int  level) const
inline

View for a grid level for All_Partition.

◆ levelIndexSet()

template<int dim, int dimworld, class ct , class GridFamily >
const LevelIndexSet & Dune::Grid< dim, dimworld, ct, GridFamily >::levelIndexSet ( int  level) const
inlineinherited

return const reference to the grids level index set for level level

◆ loadBalance() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::loadBalance ( )
inline

default implementation of load balance does nothing and returns false

◆ loadBalance() [2/2]

template<int dim, int dimworld, class ct , class GridFamily >
template<class DataHandle >
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::loadBalance ( DataHandle &  data)
inline

default implementation of load balance does nothing and returns false

◆ localIdSet()

template<int dim, int dimworld, class ct , class GridFamily >
const LocalIdSet & Dune::Grid< dim, dimworld, ct, GridFamily >::localIdSet ( ) const
inlineinherited

return const reference to the grids local id set

◆ mark() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Codim< 0 >::Entity &  e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

◆ mark() [2/2]

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Traits ::template Codim< 0 >::Entity &  e 
)
inline

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity to Entity that should be refined
Returns
true if Entity was marked, false otherwise.
Note
  • default implementation is: return false; for grids with no adaptation.
  • for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as
    bool mark( int refCount,
    typename Traits::template Codim<0>::Entity & e ).
    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:915
    A Traits struct that collects all associated types of one implementation.
    Definition: common/grid.hh:411
    This template method will vanish due to the inheritance rules.

◆ maxLevel()

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::maxLevel ( ) const
inlineinherited

Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest level.

◆ numBoundarySegments()

template<int dim, int dimworld, class ct , class GridFamily >
size_t Dune::Grid< dim, dimworld, ct, GridFamily >::numBoundarySegments ( ) const
inlineinherited

returns the number of boundary segments within the macro grid

Returns
number of boundary segments within the macro grid

◆ postAdapt()

template<int dim, int dimworld, class ct , class GridFamily >
void Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::postAdapt ( )
inline

clean up some markers

◆ preAdapt()

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::preAdapt ( )
inline

returns true, if at least one entity is marked for adaption

◆ size() [1/4]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::size ( GeometryType  type) const
inlineinherited

Return number of leaf entities per geometry type in this process.

◆ size() [2/4]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::size ( int  codim) const
inlineinherited

Return number of leaf entities of a given codim in this process.

◆ size() [3/4]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::size ( int  level,
GeometryType  type 
) const
inlineinherited

Return number of entities per level and geometry type in this process.

◆ size() [4/4]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::size ( int  level,
int  codim 
) const
inlineinherited

Return number of grid entities of a given codim on a given level in this process.

Member Data Documentation

◆ dimension

template<int dim, int dimworld, class ct , class GridFamily >
constexpr int Dune::Grid< dim, dimworld, ct, GridFamily >::dimension = dim
staticconstexprinherited

The dimension of the grid.

◆ dimensionworld

template<int dim, int dimworld, class ct , class GridFamily >
constexpr int Dune::Grid< dim, dimworld, ct, GridFamily >::dimensionworld = dimworld
staticconstexprinherited

The dimension of the world the grid lives in.


The documentation for this class was generated from the following files: