dune-grid 2.10
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Dune::OneDGrid Class Reference

One-dimensional adaptive grid. More...

#include <dune/grid/onedgrid.hh>

Inheritance diagram for Dune::OneDGrid:
Inheritance graph

Public Types

enum  RefinementType { LOCAL , COPY }
 The different forms of grid refinement supported by OneDGrid. More...
 
typedef OneDGridGeometry< 0, 1, OneDGrid >::ctype ctype
 The type used to store coordinates.
 
typedef OneDGridFamily GridFamily
 GridFamily of OneDGrid.
 
typedef OneDGridFamily::Traits Traits
 
Exported types
typedef GridFamily::Traits::LeafGridView LeafGridView
 type of view for leaf grid
 
typedef GridFamily::Traits::LevelGridView LevelGridView
 type of view for level grid
 
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.
 
using Communication = typename GridFamily::Traits::Communication
 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.
 

Public Member Functions

 OneDGrid (const std::vector< ctype > &coords)
 Constructor with an explicit set of coordinates.
 
 OneDGrid (int numElements, const ctype &leftBoundary, const ctype &rightBoundary)
 Constructor for a uniform grid.
 
 ~OneDGrid ()
 Destructor.
 
int maxLevel () const
 Return maximum level defined in this grid.
 
int size (int level, int codim) const
 Number of grid entities per level and codim.
 
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 and geometry type in this process
 
int size (GeometryType type) const
 number of leaf entities per geometry type in this process
 
size_t numBoundarySegments () const
 Return the number of coarse grid boundary segments.
 
const Traits::GlobalIdSetglobalIdSet () const
 Get the set of global ids.
 
const Traits::LocalIdSetlocalIdSet () const
 Get the set of local ids.
 
const Traits::LevelIndexSetlevelIndexSet (int level) const
 Get an index set for the given level.
 
const Traits::LeafIndexSetleafIndexSet () const
 Get an index set for the leaf level.
 
bool mark (int refCount, const Traits::Codim< 0 >::Entity &e)
 Mark entity for refinement.
 
int getMark (const Traits::Codim< 0 >::Entity &e) const
 return current adaptation marker of given entity
 
bool preAdapt ()
 Does nothing except return true if some element has been marked for refinement.
 
bool adapt ()
 Triggers the grid refinement process.
 
void postAdapt ()
 Adaptation post-processing: Reset all adaptation state flags.
 
void setRefinementType (RefinementType type)
 Sets the type of grid refinement.
 
void globalRefine (int refCount)
 Does one uniform refinement step.
 
const Communicationcomm () const
 
template<class DataHandle >
void communicate (DataHandle &, InterfaceType, CommunicationDirection, int) const
 Communicate data of level gridView.
 
template<class DataHandle >
void communicate (DataHandle &, InterfaceType, CommunicationDirection) const
 Communicate data of leaf gridView.
 
Traits::LevelGridView levelGridView (int level) const
 View for a grid level for All_Partition.
 
Traits::LeafGridView leafGridView () const
 View for the leaf grid for All_Partition.
 
Traits::LeafIntersectionIterator ileafbegin (const typename Traits::template Codim< 0 >::Entity &entity) const
 obtain begin intersection iterator on the leaf level
 
Traits::LeafIntersectionIterator ileafend (const typename Traits::template Codim< 0 >::Entity &entity) const
 obtain end intersection iterator on the leaf level
 
Traits::LevelIntersectionIterator ilevelbegin (const typename Traits::template Codim< 0 >::Entity &entity) const
 obtain begin intersection iterator on the entity level
 
Traits::LevelIntersectionIterator ilevelend (const typename Traits::template Codim< 0 >::Entity &entity) const
 obtain end intersection iterator on the entity level
 
bool mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt.
 
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.
 
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
 
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.
 
int getMark (const typename Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity
 

Static Public Member Functions

template<typename Seed >
static Traits::template Codim< Seed::codimension >::Entity entity (const Seed &seed)
 Create an Entity from an EntitySeed.
 

Static Public Attributes

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

Parallel data distribution and communication

template<class EntitySeed >
Codim< EntitySeed::codimension >::Entity entity (const EntitySeed &seed) const
 obtain Entity from EntitySeed.
 
GridImp & asImp ()
 Barton-Nackman trick.
 
const GridImp & asImp () const
 Barton-Nackman trick.
 

Detailed Description

One-dimensional adaptive grid.

[ provides Dune::Grid ]

This implementation of the grid interface provides one-dimensional grids only. The OneDGrid can be nonuniform and provides local mesh refinement and coarsening.

Member Typedef Documentation

◆ Communication

template<int dim, int dimworld, class ct , class GridFamily >
using Dune::Grid< dim, dimworld, ct, GridFamily >::Communication = typename GridFamily::Traits::Communication
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.

◆ ctype

The type used to store coordinates.

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

◆ GridFamily

GridFamily of OneDGrid.

◆ 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

Member Enumeration Documentation

◆ RefinementType

The different forms of grid refinement supported by OneDGrid.

Enumerator
LOCAL 

New level consists only of the refined elements.

COPY 

New level consists of the refined elements and the unrefined ones, too.

Constructor & Destructor Documentation

◆ OneDGrid() [1/2]

Dune::OneDGrid::OneDGrid ( const std::vector< ctype > &  coords)

Constructor with an explicit set of coordinates.

◆ OneDGrid() [2/2]

Dune::OneDGrid::OneDGrid ( int  numElements,
const ctype leftBoundary,
const ctype rightBoundary 
)

Constructor for a uniform grid.

◆ ~OneDGrid()

Dune::OneDGrid::~OneDGrid ( )

Destructor.

Member Function Documentation

◆ adapt()

bool Dune::OneDGrid::adapt ( )

Triggers the grid refinement process.

◆ 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()

const Communication & Dune::OneDGrid::comm ( ) const
inline

◆ communicate() [1/2]

template<class DataHandle >
void Dune::OneDGrid::communicate ( DataHandle &  ,
InterfaceType  ,
CommunicationDirection   
) const
inline

Communicate data of leaf gridView.

◆ communicate() [2/2]

template<class DataHandle >
void Dune::OneDGrid::communicate ( DataHandle &  ,
InterfaceType  ,
CommunicationDirection  ,
int   
) const
inline

Communicate data of level gridView.

◆ entity() [1/2]

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.

◆ entity() [2/2]

template<typename Seed >
static Traits::template Codim< Seed::codimension >::Entity Dune::OneDGrid::entity ( const Seed &  seed)
inlinestatic

Create an Entity from an EntitySeed.

◆ getMark() [1/3]

int Dune::OneDGrid::getMark ( const Traits::Codim< 0 >::Entity e) const

return current adaptation marker of given entity

Parameters
eEntity to the entity you want to mark
Returns
int current adaptation marker of entity pointer e

◆ getMark() [2/3]

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() [3/3]

int Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::getMark ( const typename Traits::template Codim< 0 >::Entity &  e) const
inlineinherited

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()

const Traits::GlobalIdSet & Dune::OneDGrid::globalIdSet ( ) const
inline

Get the set of global ids.

◆ globalRefine()

void Dune::OneDGrid::globalRefine ( int  refCount)

Does one uniform refinement step.

Parameters
refCountI don't know what this is good for. It doesn't actually do anything.

◆ ileafbegin()

Traits::LeafIntersectionIterator Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::ileafbegin ( const typename Traits::template Codim< 0 >::Entity &  entity) const
inlineinherited

obtain begin intersection iterator on the leaf level

◆ ileafend()

Traits::LeafIntersectionIterator Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::ileafend ( const typename Traits::template Codim< 0 >::Entity &  entity) const
inlineinherited

obtain end intersection iterator on the leaf level

◆ ilevelbegin()

Traits::LevelIntersectionIterator Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::ilevelbegin ( const typename Traits::template Codim< 0 >::Entity &  entity) const
inlineinherited

obtain begin intersection iterator on the entity level

◆ ilevelend()

Traits::LevelIntersectionIterator Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::ilevelend ( const typename Traits::template Codim< 0 >::Entity &  entity) const
inlineinherited

obtain end intersection iterator on the entity level

◆ leafGridView()

Traits::LeafGridView Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::leafGridView ( ) const
inlineinherited

View for the leaf grid for All_Partition.

◆ leafIndexSet()

const Traits::LeafIndexSet & Dune::OneDGrid::leafIndexSet ( ) const
inline

Get an index set for the leaf level.

◆ levelGridView()

Traits::LevelGridView Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::levelGridView ( int  level) const
inlineinherited

View for a grid level for All_Partition.

◆ levelIndexSet()

const Traits::LevelIndexSet & Dune::OneDGrid::levelIndexSet ( int  level) const
inline

Get an index set for the given level.

◆ loadBalance() [1/2]

bool Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::loadBalance ( )
inlineinherited

default implementation of load balance does nothing and returns false

◆ loadBalance() [2/2]

bool Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::loadBalance ( DataHandle &  data)
inlineinherited

default implementation of load balance does nothing and returns false

◆ localIdSet()

const Traits::LocalIdSet & Dune::OneDGrid::localIdSet ( ) const
inline

Get the set of local ids.

◆ mark() [1/3]

bool Dune::OneDGrid::mark ( int  refCount,
const Traits::Codim< 0 >::Entity e 
)

Mark entity for refinement.

Parameters
refCountif >0 mark for refinement, if <0 mark for coarsening
eEntity to the entity you want to mark
Returns
True, if marking was successful

◆ mark() [2/3]

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() [3/3]

bool Dune::GridDefaultImplementation< dim, dimworld, OneDGridGeometry< 0, 1, OneDGrid >::ctype , OneDGridFamily >::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,
    A Traits struct that collects all associated types of one implementation.
    Definition common/grid.hh:411
    Traits associated with a specific codim.
    Definition common/grid.hh:1035
    bool mark(int refCount, const Traits::Codim< 0 >::Entity &e)
    Mark entity for refinement.
    This template method will vanish due to the inheritance rules.

◆ maxLevel()

int Dune::OneDGrid::maxLevel ( ) const
inline

Return maximum level defined in this grid.

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

◆ numBoundarySegments()

size_t Dune::OneDGrid::numBoundarySegments ( ) const
inline

Return the number of coarse grid boundary segments.

For this grid implementation, the return value is always 2, because only connected domains are supported, and then the coarse grid boundary consists of two points.

◆ postAdapt()

void Dune::OneDGrid::postAdapt ( )

Adaptation post-processing: Reset all adaptation state flags.

◆ preAdapt()

bool Dune::OneDGrid::preAdapt ( )

Does nothing except return true if some element has been marked for refinement.

◆ setRefinementType()

void Dune::OneDGrid::setRefinementType ( RefinementType  type)
inline

Sets the type of grid refinement.

◆ size() [1/4]

int Dune::OneDGrid::size ( GeometryType  type) const
inline

number of leaf entities per geometry type in this process

◆ size() [2/4]

int Dune::OneDGrid::size ( int  codim) const
inline

number of leaf entities per codim in this process

◆ size() [3/4]

int Dune::OneDGrid::size ( int  level,
GeometryType  type 
) const
inline

number of entities per level and geometry type in this process

◆ size() [4/4]

int Dune::OneDGrid::size ( int  level,
int  codim 
) const
inline

Number of grid entities per level and codim.

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 file: