Dune Core Modules (2.4.2)

Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily > Class Template Reference

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

Classes

class  ReturnImplementationType
 Helper class to choose correct implementation return type for getRealImplementation. More...
 

Public Types

typedef GridFamily::Traits Traits
 The traits of this class. More...
 
Exported constants
enum  { dimension =dim }
 A constant that exports the template parameter dim. More...
 
enum  { dimensionworld =dimworld }
 A constant that exports the template parameter dimworld. More...
 
Exported types
typedef Partition< All_Partition >::LevelGridView LevelGridView
 View types for All_Partition.
 
typedef Partition< All_Partition >::LeafGridView LeafGridView
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
typedef GridFamily::Traits::CollectiveCommunication CollectiveCommunication
 A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective communication on the set of processes used by the grid.
 
typedef ct ctype
 Define type used for coordinates in grid module.
 

Public Member Functions

template<int codim>
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
 Iterator to first entity of given codim on level for PartitionType All_Partition.
 
template<int codim>
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const
 one past the end on this level for PartitionType All_Partition
 
template<int codim, PartitionIteratorType pitype>
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
 Iterator to first entity of given codim on level.
 
template<int codim, PartitionIteratorType pitype>
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const
 one past the end on this level
 
template<int codim>
Traits::template Codim< codim >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const
 Iterator to first entity of given codim on leaf grid for PartitionType All_Partition.
 
template<int codim>
Traits::template Codim< codim >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const
 one past the end on the leaf grid for PartitionType All_Partition
 
template<int codim, PartitionIteratorType pitype>
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const
 Iterator to first entity of given codim on leaf grid.
 
template<int codim, PartitionIteratorType pitype>
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const
 one past the end on the leaf level grid
 
template<PartitionIteratorType pitype>
Traits::template Partition< pitype >::LevelGridView levelGridView (int level) const
 View for a grid level.
 
template<PartitionIteratorType pitype>
Traits::template Partition< pitype >::LeafGridView leafGridView () const
 View for the leaf grid.
 
Traits::template Partition< All_Partition >::LevelGridView levelGridView (int level) const
 View for a grid level for All_Partition.
 
Traits::template Partition< All_Partition >::LeafGridView leafGridView () const
 View for the leaf grid for All_Partition.
 
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
 
void postAdapt ()
 clean up some markers
 
int ghostSize (int level, int codim) const
 ghostSize is zero by default
 
int overlapSize (int level, int codim) const
 overlapSize is zero by default
 
int ghostSize (int codim) const
 ghostSize is zero by default
 
int overlapSize (int codim) const
 overlapSize is zero by default
 
template<class DataHandleImp , class DataTypeImp >
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
 
template<class DataHandleImp , class DataTypeImp >
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
 
bool loadBalance ()
 default implementation of load balance does nothing and returns false
 
template<class DataHandle >
bool loadBalance (DataHandle &data)
 default implementation of load balance does nothing and returns false
 
Size methods
int maxLevel () const
 Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest level.
 
int size (int level, int codim) const
 Return number of grid entities of a given codim on a given level in this process.
 
int size (int codim) const
 Return number of leaf entities of a given codim in this process.
 
int size (int level, GeometryType type) const
 Return number of entities per level and geometry type in this process.
 
int size (GeometryType type) const
 Return number of leaf entities per geometry type in this process.
 
size_t numBoundarySegments () const
 returns the number of boundary segments within the macro grid More...
 
Iterators
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin and will be removed after Dune 2.4.") lbegin(int level) const
 Iterator to first entity of given codim on level.
 
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end and will be removed after Dune 2.4.") lend(int level) const
 one past the end on this level
 
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin and will be removed after Dune 2.4.") leafbegin() const
 Iterator to first entity of given codim on leaf grid.
 
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end and will be removed after Dune 2.4.") leafend() const
 one past the end on the leaf level grid
 
Parallel data distribution and communication
template<class EntitySeed >
 DUNE_DEPRECATED_MSG ("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Codim< EntitySeed
 obtain EntityPointer from EntitySeed. More...
 
const CollectiveCommunicationcomm () const
 return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication.
 
const GridImp & asImp () const
 Barton-Nackman trick.
 
Access to index and id sets
const GlobalIdSetglobalIdSet () const
 return const reference to the grids global id set
 
const LocalIdSetlocalIdSet () const
 return const reference to the grids local id set
 
const LevelIndexSetlevelIndexSet (int level) const
 return const reference to the grids level index set for level level
 
const LeafIndexSetleafIndexSet () const
 return const reference to the grids leaf index set
 
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 Protected Member Functions

template<class InterfaceType >
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation (InterfaceType &&i)
 return real implementation of interface class
 

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
For installation instructions for external grid managers see http://www.dune-project.org/external_libraries/index.html .

Member Typedef Documentation

◆ 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 Enumeration Documentation

◆ anonymous enum

template<int dim, int dimworld, class ct , class GridFamily >
anonymous enum
inherited

A constant that exports the template parameter dim.

Enumerator
dimension 

The dimension of the grid.

◆ anonymous enum

template<int dim, int dimworld, class ct , class GridFamily >
anonymous enum
inherited

A constant that exports the template parameter dimworld.

Enumerator
dimensionworld 

The dimension of the world the grid lives in.

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

◆ communicate() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
template<class DataHandleImp , class DataTypeImp >
void Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir 
) const
inline

dummy communicate, doing nothing

◆ communicate() [2/2]

template<int dim, int dimworld, class ct , class GridFamily >
template<class DataHandleImp , class DataTypeImp >
void Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inline

dummy communicate, doing nothing

◆ DUNE_DEPRECATED_MSG()

template<int dim, int dimworld, class ct , class GridFamily >
template<class EntitySeed >
Dune::Grid< dim, dimworld, ct, GridFamily >::DUNE_DEPRECATED_MSG ( "entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object."  )
inlineinherited

obtain EntityPointer from EntitySeed.

Deprecated:
This method is deprecated and will be removed after the release of dune-grid 2.4. Please use entity() instead, which will directly return an Entity object that you can then store for later use. The EntityPointer concept in general is deprecated and will not be available after dune-grid 2.4 has been released.

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

References Dune::Grid< dim, dimworld, ct, GridFamily >::asImp().

◆ 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

◆ 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.

References Dune::Grid< dim, dimworld, ct, GridFamily >::asImp(), CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Grid< dim, dimworld, ct, GridFamily >::globalRefine().

Referenced by Dune::Grid< dim, dimworld, ct, GridFamily >::globalRefine().

◆ 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.

References Dune::Grid< dim, dimworld, ct, GridFamily >::asImp().

◆ 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: grid.hh:1163
    A Traits struct that collects all associated types of one implementation.
    Definition: grid.hh:438
    This template method will vanish due to the inheritance rules.

◆ 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

The documentation for this class was generated from the following files:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 20, 23:31, 2024)