Dune::PolyhedralGrid< dim, dimworld > Class Template Reference

identical grid wrapper More...

#include <grid.hh>

Classes

struct  Codim
 traits structure containing types for a codimension More...
 
struct  Partition
 Types for GridView. More...
 

Public Types

typedef Traits ::ExtraData ExtraData
 

Public Member Functions

template<int codim>
Codim< codim >::LeafIterator leafbegin () const
 
template<int codim>
Codim< codim >::LeafIterator leafend () const
 
template<int codim, PartitionIteratorType pitype>
Codim< codim >::template Partition< pitype >::LeafIterator leafbegin () const
 
template<int codim, PartitionIteratorType pitype>
Codim< codim >::template Partition< pitype >::LeafIterator leafend () const
 
template<int codim>
Codim< codim >::LevelIterator lbegin (const int) const
 
template<int codim>
Codim< codim >::LevelIterator lend (const int) const
 
template<int codim, PartitionIteratorType pitype>
Codim< codim >::template Partition< pitype >::LevelIterator lbegin (const int) const
 
template<int codim, PartitionIteratorType pitype>
Codim< codim >::template Partition< pitype >::LevelIterator lend (const int) const
 
const GlobalIdSetglobalIdSet () const
 
const LocalIdSetlocalIdSet () const
 
const LevelIndexSetlevelIndexSet (int) const
 
const LeafIndexSetleafIndexSet () const
 
void globalRefine (int)
 
bool mark (int, const typename Codim< 0 >::Entity &)
 
int getMark (const typename Codim< 0 >::Entity &) const
 
bool preAdapt ()
 
More...
 
bool adapt ()
 
More...
 
template<class DataHandle >
bool adapt (DataHandle &)
 
void postAdapt ()
 
More...
 
const std::array< int, 3 > & logicalCartesianSize () const
 
const int * globalCell () const
 
void getIJK (const int c, std::array< int, 3 > &ijk) const
 
ExtraData extraData () const
 
template<class EntitySeed >
int corners (const EntitySeed &seed) const
 
template<class EntitySeed >
GlobalCoordinate corner (const EntitySeed &seed, const int i) const
 
template<class EntitySeed >
int subEntities (const EntitySeed &seed, const int codim) const
 
template<int codim, class EntitySeedArg >
Codim< codim >::EntitySeed subEntitySeed (const EntitySeedArg &baseSeed, const int i) const
 
const std::vector< GeometryType > & geomTypes (const unsigned int codim) const
 
int indexInInside (const typename Codim< 0 >::EntitySeed &seed, const int i) const
 
int cartesianIndexInInside (const typename Codim< 0 >::EntitySeed &seed, const int i) const
 
Codim< 0 >::EntitySeed neighbor (const typename Codim< 0 >::EntitySeed &seed, const int i) const
 
int indexInOutside (const typename Codim< 0 >::EntitySeed &seed, const int i) const
 
template<class EntitySeed >
GlobalCoordinate outerNormal (const EntitySeed &seed, const int i) const
 
template<class EntitySeed >
GlobalCoordinate unitOuterNormal (const EntitySeed &seed, const int i) const
 
template<class EntitySeed >
GlobalCoordinate centroids (const EntitySeed &seed) const
 
GlobalCoordinate copyToGlobalCoordinate (const double *coords) const
 
template<class EntitySeed >
double volumes (const EntitySeed &seed) const
 
void init ()
 

Protected Attributes

std::unique_ptr< UnstructuredGridType, UnstructuredGridDeleter > gridPtr_
 
const UnstructuredGridTypegrid_
 
CollectiveCommunication comm_
 
std::array< int, 3 > cartDims_
 
std::vector< std::vector< GeometryType > > geomTypes_
 
std::vector< std::vector< int > > cellVertices_
 
std::vector< GlobalCoordinate > unitOuterNormals_
 
LeafIndexSet leafIndexSet_
 
GlobalIdSet globalIdSet_
 
LocalIdSet localIdSet_
 

Traits

typedef GridFamily::Traits Traits
 type of the grid traits
 

Iterator Types

typedef Traits::HierarchicIterator HierarchicIterator
 iterator over the grid hierarchy
 
typedef Traits::LeafIntersectionIterator LeafIntersectionIterator
 iterator over intersections with other entities on the leaf level
 
typedef Traits::LevelIntersectionIterator LevelIntersectionIterator
 iterator over intersections with other entities on the same level
 

Grid View Types

typedef Partition< All_Partition >::LevelGridView LevelGridView
 View types for All_Partition.
 
typedef Partition< All_Partition >::LeafGridView LeafGridView
 

Index and Id Set Types

typedef Traits::LeafIndexSet LeafIndexSet
 type of leaf index set More...
 
typedef Traits::LevelIndexSet LevelIndexSet
 type of level index set More...
 
typedef Traits::GlobalIdSet GlobalIdSet
 type of global id set More...
 
typedef Traits::LocalIdSet LocalIdSet
 type of local id set More...
 

Miscellaneous Types

typedef Traits::ctype ctype
 type of vector coordinates (e.g., double)
 
typedef Traits::CollectiveCommunication CollectiveCommunication
 communicator with all other processes having some part of the grid
 
typedef Traits ::GlobalCoordinate GlobalCoordinate
 

Construction and Destruction

 PolyhedralGrid (const UnstructuredGridType &grid)
 constructor More...
 

Casting operators

 operator const UnstructuredGridType & () const
 

Size Methods

int maxLevel () const
 obtain maximal grid level More...
 
int size (int, int codim) const
 obtain number of entites on a level More...
 
int size (int codim) const
 obtain number of leaf entities More...
 
int size (int, GeometryType type) const
 obtain number of entites on a level More...
 
int size (GeometryType type) const
 returns the number of boundary segments within the macro grid More...
 
size_t numBoundarySegments () const
 obtain number of leaf entities More...
 

Parallel Data Distribution and Communication Methods

int overlapSize (int) const
 obtain size of overlap region for the leaf grid More...
 
int ghostSize (int codim) const
 obtain size of ghost region for the leaf grid More...
 
int overlapSize (int, int) const
 obtain size of overlap region for a grid level More...
 
int ghostSize (int, int codim) const
 obtain size of ghost region for a grid level More...
 
template<class DataHandle , class Data >
void communicate (CommDataHandleIF< DataHandle, Data > &, InterfaceType, CommunicationDirection, int) const
 communicate information on a grid level More...
 
template<class DataHandle , class Data >
void communicate (CommDataHandleIF< DataHandle, Data > &, InterfaceType, CommunicationDirection) const
 communicate information on leaf entities More...
 
const CollectiveCommunicationcomm () const
 obtain CollectiveCommunication object More...
 
bool loadBalance ()
 rebalance the load each process has to handle More...
 
template<class DataHandle , class Data >
bool loadBalance (CommDataHandleIF< DataHandle, Data > &)
 rebalance the load each process has to handle More...
 
template<class DofManager >
bool loadBalance (DofManager &)
 rebalance the load each process has to handle More...
 
template<PartitionIteratorType pitype>
Partition< pitype >::LevelGridView levelGridView (int) const
 View for a grid level.
 
template<PartitionIteratorType pitype>
Partition< pitype >::LeafGridView leafGridView () const
 View for the leaf grid.
 
LevelGridView levelGridView (int) const
 View for a grid level for All_Partition.
 
LeafGridView leafGridView () const
 View for the leaf grid for All_Partition.
 
template<class EntitySeed >
Traits::template Codim< EntitySeed::codimension >::EntityPointer entityPointer (const EntitySeed &seed) const
 obtain EntityPointer from EntitySeed. More...
 
template<class EntitySeed >
Traits::template Codim< EntitySeed::codimension >::Entity entity (const EntitySeed &seed) const
 obtain EntityPointer from EntitySeed. More...
 

Miscellaneous Methods

void update ()
 update grid caches More...
 

Detailed Description

template<int dim, int dimworld>
class Dune::PolyhedralGrid< dim, dimworld >

identical grid wrapper

Template Parameters
HostGridDUNE grid to be wrapped (called host grid)

Member Typedef Documentation

◆ GlobalIdSet

template<int dim, int dimworld>
typedef Traits::GlobalIdSet Dune::PolyhedralGrid< dim, dimworld >::GlobalIdSet

type of global id set

The id set assigns a unique identifier to each entity within the grid. This identifier is unique over all processes sharing this grid.

Note
Id's are neither consecutive nor necessarily of an integral type.

The global id set is a model of Dune::IdSet.

◆ LeafIndexSet

template<int dim, int dimworld>
typedef Traits::LeafIndexSet Dune::PolyhedralGrid< dim, dimworld >::LeafIndexSet

type of leaf index set

The index set assigns consecutive indices to the entities of the leaf grid. The indices are of integral type and can be used to access arrays.

The leaf index set is a model of Dune::IndexSet.

◆ LevelIndexSet

template<int dim, int dimworld>
typedef Traits::LevelIndexSet Dune::PolyhedralGrid< dim, dimworld >::LevelIndexSet

type of level index set

The index set assigns consecutive indices to the entities of a grid level. The indices are of integral type and can be used to access arrays.

The level index set is a model of Dune::IndexSet.

◆ LocalIdSet

template<int dim, int dimworld>
typedef Traits::LocalIdSet Dune::PolyhedralGrid< dim, dimworld >::LocalIdSet

type of local id set

The id set assigns a unique identifier to each entity within the grid. This identifier needs only to be unique over this process.

Though the local id set may be identical to the global id set, it is often implemented more efficiently.

Note
Ids are neither consecutive nor necessarily of an integral type.
Local ids need not be compatible with global ids. Also, no mapping from local ids to global ones needs to exist.

The global id set is a model of Dune::IdSet.

Constructor & Destructor Documentation

◆ PolyhedralGrid()

template<int dim, int dimworld>
Dune::PolyhedralGrid< dim, dimworld >::PolyhedralGrid ( const UnstructuredGridType grid)
inlineexplicit

constructor

The references to ug are stored in the grid. Therefore, they must remain valid until the grid is destroyed.

Parameters
[in]ugUnstructuredGrid reference

Member Function Documentation

◆ adapt() [1/2]

template<int dim, int dimworld>
bool Dune::PolyhedralGrid< dim, dimworld >::adapt ( )
inline


◆ adapt() [2/2]

template<int dim, int dimworld>
template<class DataHandle >
bool Dune::PolyhedralGrid< dim, dimworld >::adapt ( DataHandle &  )
inline

Parameters
handlehandler for restriction and prolongation operations which is a Model of the AdaptDataHandleInterface class.

◆ comm()

template<int dim, int dimworld>
const CollectiveCommunication& Dune::PolyhedralGrid< dim, dimworld >::comm ( ) const
inline

obtain CollectiveCommunication object

The CollectiveCommunication object should be used to globally communicate information between all processes sharing this grid.

Note
The CollectiveCommunication object returned is identical to the one returned by the host grid.

◆ communicate() [1/2]

template<int dim, int dimworld>
template<class DataHandle , class Data >
void Dune::PolyhedralGrid< dim, dimworld >::communicate ( CommDataHandleIF< DataHandle, Data > &  ,
InterfaceType  ,
CommunicationDirection  ,
int   
) const
inline

communicate information on a grid level

Parameters
dataHandlecommunication data handle (user defined)
[in]interfacecommunication interface (one of InteriorBorder_InteriorBorder_Interface, InteriorBorder_All_Interface, Overlap_OverlapFront_Interface, Overlap_All_Interface, All_All_Interface)
[in]directioncommunication direction (one of ForwardCommunication or BackwardCommunication)
[in]levelgrid level to communicate

◆ communicate() [2/2]

template<int dim, int dimworld>
template<class DataHandle , class Data >
void Dune::PolyhedralGrid< dim, dimworld >::communicate ( CommDataHandleIF< DataHandle, Data > &  ,
InterfaceType  ,
CommunicationDirection   
) const
inline

communicate information on leaf entities

Parameters
dataHandlecommunication data handle (user defined)
[in]interfacecommunication interface (one of InteriorBorder_InteriorBorder_Interface, InteriorBorder_All_Interface, Overlap_OverlapFront_Interface, Overlap_All_Interface, All_All_Interface)
[in]directioncommunication direction (one of ForwardCommunication, BackwardCommunication)

◆ entity()

template<int dim, int dimworld>
template<class EntitySeed >
Traits::template Codim< EntitySeed::codimension >::Entity Dune::PolyhedralGrid< dim, dimworld >::entity ( const EntitySeed &  seed) const
inline

obtain EntityPointer from EntitySeed.

◆ entityPointer()

template<int dim, int dimworld>
template<class EntitySeed >
Traits::template Codim< EntitySeed::codimension >::EntityPointer Dune::PolyhedralGrid< dim, dimworld >::entityPointer ( const EntitySeed &  seed) const
inline

obtain EntityPointer from EntitySeed.

◆ ghostSize() [1/2]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::ghostSize ( int  codim) const
inline

obtain size of ghost region for the leaf grid

Parameters
[in]codimcodimension for with the information is desired

◆ ghostSize() [2/2]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::ghostSize ( int  ,
int  codim 
) const
inline

obtain size of ghost region for a grid level

Parameters
[in]levelgrid level (0, ..., maxLevel())
[in]codimcodimension (0, ..., dimension)

◆ loadBalance() [1/3]

template<int dim, int dimworld>
bool Dune::PolyhedralGrid< dim, dimworld >::loadBalance ( )
inline

rebalance the load each process has to handle

A parallel grid is redistributed such that each process has about the same load (e.g., the same number of leaf entites).

Note
DUNE does not specify, how the load is measured.
Returns
true, if the grid has changed.

◆ loadBalance() [2/3]

template<int dim, int dimworld>
template<class DataHandle , class Data >
bool Dune::PolyhedralGrid< dim, dimworld >::loadBalance ( CommDataHandleIF< DataHandle, Data > &  )
inline

rebalance the load each process has to handle

A parallel grid is redistributed such that each process has about the same load (e.g., the same number of leaf entites).

The data handle is used to communicate the data associated with entities that move from one process to another.

Note
DUNE does not specify, how the load is measured.
Parameters
datahandlecommunication data handle (user defined)
Returns
true, if the grid has changed.

◆ loadBalance() [3/3]

template<int dim, int dimworld>
template<class DofManager >
bool Dune::PolyhedralGrid< dim, dimworld >::loadBalance ( DofManager &  )
inline

rebalance the load each process has to handle

A parallel grid is redistributed such that each process has about the same load (e.g., the same number of leaf entites).

The data handle is used to communicate the data associated with entities that move from one process to another.

Note
DUNE does not specify, how the load is measured.
Parameters
dataHandledata handle following the ALUGrid interface
Returns
true, if the grid has changed.

◆ maxLevel()

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::maxLevel ( ) const
inline

obtain maximal grid level

Grid levels are numbered 0, ..., L, where L is the value returned by this method.

Returns
maximal grid level

◆ numBoundarySegments()

template<int dim, int dimworld>
size_t Dune::PolyhedralGrid< dim, dimworld >::numBoundarySegments ( ) const
inline

obtain number of leaf entities

Parameters
[in]typegeometry type to consider
Returns
number of leaf entities with a geometry of type type

◆ overlapSize() [1/2]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::overlapSize ( int  ) const
inline

obtain size of overlap region for the leaf grid

Parameters
[in]codimcodimension for with the information is desired

◆ overlapSize() [2/2]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::overlapSize ( int  ,
int   
) const
inline

obtain size of overlap region for a grid level

Parameters
[in]levelgrid level (0, ..., maxLevel())
[in]codimcodimension (0, ..., dimension)

◆ postAdapt()

template<int dim, int dimworld>
void Dune::PolyhedralGrid< dim, dimworld >::postAdapt ( )
inline


◆ preAdapt()

template<int dim, int dimworld>
bool Dune::PolyhedralGrid< dim, dimworld >::preAdapt ( )
inline


◆ size() [1/4]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::size ( int  ,
int  codim 
) const
inline

obtain number of entites on a level

Parameters
[in]levellevel to consider
[in]codimcodimension to consider
Returns
number of entities of codimension codim on grid level level.

◆ size() [2/4]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::size ( int  codim) const
inline

obtain number of leaf entities

Parameters
[in]codimcodimension to consider
Returns
number of leaf entities of codimension codim

◆ size() [3/4]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::size ( int  ,
GeometryType  type 
) const
inline

obtain number of entites on a level

Parameters
[in]levellevel to consider
[in]typegeometry type to consider
Returns
number of entities with a geometry of type type on grid level level.

◆ size() [4/4]

template<int dim, int dimworld>
int Dune::PolyhedralGrid< dim, dimworld >::size ( GeometryType  type) const
inline

returns the number of boundary segments within the macro grid

Returns
number of boundary segments within the macro grid

◆ update()

template<int dim, int dimworld>
void Dune::PolyhedralGrid< dim, dimworld >::update ( )
inline

update grid caches

This method has to be called whenever the underlying host grid changes.

Note
If you adapt the host grid through this geometry grid's adaptation or load balancing methods, update is automatically called.

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