Dune Core Modules (2.4.1)

Provides a meta grid that is identical to its host. More...

#include <dune/grid/identitygrid.hh>

Public Types

typedef HostGrid HostGridType
 
typedef IdentityGridFamily< HostGrid::dimension, HostGrid > GridFamily
 type of the used GridFamily for this grid
 
typedef IdentityGridFamily< HostGrid::dimension, HostGrid >::Traits Traits
 the Traits
 
typedef HostGrid::ctype ctype
 The type used to store coordinates, inherited from the HostGrid.
 
Exported constants
enum  
 A constant that exports the template parameter dim.
 
enum  
 A constant that exports the template parameter dimworld.
 
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.
 

Public Member Functions

 IdentityGrid (HostGrid &hostgrid)
 Constructor. More...
 
 ~IdentityGrid ()
 Desctructor.
 
int maxLevel () const
 Return maximum level defined in this grid. More...
 
template<int codim>
Traits::template Codim< codim >::LevelIterator lbegin (int level) const
 Iterator to first entity of given codim on level.
 
template<int codim>
Traits::template Codim< codim >::LevelIterator lend (int level) const
 one past the end on this level
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator 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 lend (int level) const
 one past the end on this level
 
template<int codim>
Traits::template Codim< codim >::LeafIterator leafbegin () const
 Iterator to first leaf entity of given codim.
 
template<int codim>
Traits::template Codim< codim >::LeafIterator leafend () const
 one past the end of the sequence of leaf entities
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafbegin () const
 Iterator to first leaf entity of given codim.
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafend () const
 one past the end of the sequence of leaf entities
 
int size (int level, int codim) const
 Number of grid entities per level and codim.
 
size_t numBoundarySegments () const
 returns the number of boundary segments within the macro grid
 
int size (int codim) const
 number of leaf entities per codim in this process
 
int size (int level, GeometryType type) const
 number of entities per level, codim and geometry type in this process
 
int size (GeometryType type) const
 number of leaf entities per codim and geometry type in this process
 
const Traits::GlobalIdSetglobalIdSet () const
 Access to the GlobalIdSet.
 
const Traits::LocalIdSetlocalIdSet () const
 Access to the LocalIdSet.
 
const Traits::LevelIndexSetlevelIndexSet (int level) const
 Access to the LevelIndexSets.
 
const Traits::LeafIndexSetleafIndexSet () const
 Access to the LeafIndexSet.
 
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.
 
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
 
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.
 
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
 
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.
 
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
 
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.
 
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
 
Traits::template Partition< pitype >::LevelGridView levelGridView (int level) const
 View for a grid level.
 
Traits::template Partition< All_Partition >::LevelGridView levelGridView (int level) const
 View for a grid level for All_Partition.
 
Traits::template Partition< pitype >::LeafGridView leafGridView () const
 View for the leaf grid.
 
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...
 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
 
bool loadBalance ()
 default implementation of load balance does nothing and returns false
 
bool loadBalance (DataHandle &data)
 default implementation of load balance does nothing and returns false
 
Iterators
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.
 
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
 
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.
 
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
 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 GridImp & asImp () const
 Barton-Nackman trick.
 
Adaptivity and grid refinement
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...
 
void globalRefine (int refCount)
 Refine the grid refCount times using the default refinement rule. More...
 

Static Protected Member Functions

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
 

Grid Refinement Methods

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

Create Entity from EntitySeed

bool mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e)
 Mark entity for refinement. More...
 
int getMark (const typename Traits::template Codim< 0 >::Entity &e) const
 Return refinement mark for entity. More...
 
bool preAdapt ()
 returns true, if at least one entity is marked for adaption
 
bool adapt ()
 Triggers the grid refinement process.
 
void postAdapt ()
 Clean up refinement markers.
 
unsigned int overlapSize (int codim) const
 Size of the overlap on the leaf level.
 
unsigned int ghostSize (int codim) const
 Size of the ghost cell layer on the leaf level.
 
unsigned int overlapSize (int level, int codim) const
 Size of the overlap on a given level.
 
unsigned int ghostSize (int level, int codim) const
 Size of the ghost cell layer on a given level.
 
const CollectiveCommunication< IdentityGrid > & comm () const
 dummy collective communication
 
HostGridTypegetHostGrid () const
 Returns the hostgrid this IdentityGrid lives in.
 

Detailed Description

template<class HostGrid>
class Dune::IdentityGrid< HostGrid >

Provides a meta grid that is identical to its host.

Template Parameters
HostGridThe host grid type wrapped by the IdentityGrid

Member Typedef Documentation

◆ HostGridType

template<class HostGrid >
typedef HostGrid Dune::IdentityGrid< HostGrid >::HostGridType
Todo:
Should not be public

Constructor & Destructor Documentation

◆ IdentityGrid()

template<class HostGrid >
Dune::IdentityGrid< HostGrid >::IdentityGrid ( HostGrid &  hostgrid)
inlineexplicit

Constructor.

Parameters
hostgridThe host grid wrapped by the IdentityGrid

Member Function Documentation

◆ communicate() [1/2]

void Dune::GridDefaultImplementation< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir 
) const
inlineinherited

dummy communicate, doing nothing

◆ communicate() [2/2]

void Dune::GridDefaultImplementation< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inlineinherited

dummy communicate, doing nothing

◆ DUNE_DEPRECATED_MSG()

Dune::Grid< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::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]

int Dune::Grid< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::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<class HostGrid >
int Dune::IdentityGrid< HostGrid >::getMark ( const typename Traits::template Codim< 0 >::Entity &  e) const
inline

Return refinement mark for entity.

Returns
refinement mark (1,0,-1)

◆ globalRefine()

void Dune::Grid< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::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.

◆ mark() [1/3]

bool Dune::Grid< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::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/3]

bool Dune::GridDefaultImplementation< dim, dimworld, HostGrid::ctype , IdentityGridFamily< HostGrid::dimension, HostGrid > >::mark ( int  refCount,
const typename Traits ::template 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 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)
    Mark entity for refinement.
    Definition: identitygrid.hh:384
    Static tag representing a codimension.
    Definition: dimension.hh:22
    This template method will vanish due to the inheritance rules.

◆ mark() [3/3]

template<class HostGrid >
bool Dune::IdentityGrid< HostGrid >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity &  e 
)
inline

Mark entity for refinement.

This only works for entities of codim 0. The parameter is currently ignored

Returns
  • true, if marking was succesfull
  • false, if marking was not possible

◆ maxLevel()

template<class HostGrid >
int Dune::IdentityGrid< HostGrid >::maxLevel ( ) const
inline

Return maximum level defined in this grid.

Levels are numbered 0 ... maxlevel with 0 the coarsest level.

Referenced by Dune::IdentityGrid< HostGrid >::levelIndexSet().


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