Loading...
Searching...
No Matches
Dune::PolyhedralGrid< dim, dimworld, coord_t > Class Template Reference

identical grid wrapper More...

`#include <grid.hh>`

## Classes

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

## Public Types

typedef UnstructuredGrid | UnstructuredGridType
typedef std::unique_ptr< UnstructuredGridType, UnstructuredGridDeleter > | UnstructuredGridPtr

## 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 GlobalIdSet & | globalIdSet () const
const LocalIdSet & | localIdSet () const
const LevelIndexSet & | levelIndexSet (int) const
const LeafIndexSet & | leafIndexSet () const
void | globalRefine (int)
bool | mark (int, const typename Codim< 0 >::Entity &)
int | getMark (const typename Codim< 0 >::Entity &) const
bool | preAdapt ()
bool | adapt ()
template<class DataHandle>
bool | adapt (DataHandle &)
void | postAdapt ()
const std::array< int, 3 > & | logicalCartesianSize () const
const int * | globalCell () const
const int * | globalCellPtr () const
void | getIJK (const int c, std::array< int, 3 > &ijk) const

## Static Public Member Functions

static UnstructuredGridPtr | allocateGrid (std::size_t nCells, std::size_t nFaces, std::size_t nFaceNodes, std::size_t nCellFaces, std::size_t nNodes)
static void | computeGeometry (UnstructuredGridPtr &ug)

## 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
typedef Traits::LevelIndexSet | LevelIndexSet
| type of level index set
typedef Traits::GlobalIdSet | GlobalIdSet
| type of global id set
typedef Traits::LocalIdSet | LocalIdSet
| type of local id set

## Miscellaneous Types

typedef Traits::ctype | ctype
| type of vector coordinates (e.g., double)
using | Communication = typename Traits::Communication
| communicator with all other processes having some part of the grid
using | CommunicationType = Communication
typedef Traits::GlobalCoordinate | GlobalCoordinate

## Parallel grid extensions.

Methods extending the DUNE's parallel grid interface. These are basically for scattering/gathering data to/from distributed views.
typedef Traits::ExtraData | ExtraData
UnstructuredGridPtr | gridPtr_
const UnstructuredGridType & | grid_
CommunicationType | 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_
size_t | nBndSegments_
template<class DataHandle>
void | scatterData (DataHandle &handle) const
| Moves data from the global (all data on process) view to the distributed view.
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
template<int codim>
Codim< codim >::EntitySeed | subEntitySeed (const typename Codim< 1 >::EntitySeed &faceSeed, const int i) const
bool | hasBoundaryIntersections (const typename Codim< 0 >::EntitySeed &seed) const
bool | isBoundaryFace (const int face) const
bool | isBoundaryFace (const typename Codim< 1 >::EntitySeed &faceSeed) const
int | boundarySegmentIndex (const typename Codim< 0 >::EntitySeed &seed, const int face) const
const std::vector< GeometryType > & | geomTypes (const unsigned int codim) const
template<class Seed>
GeometryType | geometryType (const Seed &seed) 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
UnstructuredGridType * | createGrid (const std::vector< int > &n, const std::vector< double > &dx) const
void | init ()
void | print (std::ostream &out, const UnstructuredGridType &grid) const

## Construction and Destruction

| PolyhedralGrid (const std::vector< int > &n, const std::vector< double > &dx)
| constructor
| PolyhedralGrid (UnstructuredGridPtr &&gridPtr)
| constructor
| PolyhedralGrid (const UnstructuredGridType &grid)
| constructor

## Casting operators

| operator const UnstructuredGridType & () const

## Size Methods

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

## Parallel Data Distribution and Communication Methods

int | overlapSize (int) const
| obtain size of overlap region for the leaf grid
int | ghostSize (int codim) const
| obtain size of ghost region for the leaf grid
int | overlapSize (int, int) const
| obtain size of overlap region for a grid level
int | ghostSize (int, int codim) const
| obtain size of ghost region for a grid level
template<class DataHandle>
void | communicate (DataHandle &, InterfaceType, CommunicationDirection, int) const
| communicate information on a grid level
template<class DataHandle>
void | communicate (DataHandle &, InterfaceType, CommunicationDirection) const
| communicate information on leaf entities
void | switchToGlobalView ()
| Switch to the global view.
void | switchToDistributedView ()
| Switch to the distributed view.
const CommunicationType & | comm () const
| obtain CollectiveCommunication object
bool | loadBalance ()
| rebalance the load each process has to handle
template<class DataHandle, class Data>
bool | loadBalance (CommDataHandleIF< DataHandle, Data > &)
| rebalance the load each process has to handle
template<class DofManager>
bool | loadBalance (DofManager &)
| rebalance the load each process has to handle
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.
template<class EntitySeed>
Traits::template Codim< EntitySeed::codimension >::Entity | entity (const EntitySeed &seed) const
| obtain EntityPointer from EntitySeed.

## Miscellaneous Methods

void | update ()
| update grid caches

## Detailed Description

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

identical grid wrapper

Template Parameters

  HostGrid | DUNE grid to be wrapped (called host grid)

## Member Typedef Documentation

## GlobalIdSet

template<int dim, int dimworld, typename coord_t>

typedef Traits::GlobalIdSet Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>

typedef Traits::LeafIndexSet Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>

typedef Traits::LevelIndexSet Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>

typedef Traits::LocalIdSet Dune::PolyhedralGrid< dim, dimworld, coord_t >::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() [1/3]

template<int dim, int dimworld, typename coord_t>

Dune::PolyhedralGrid< dim, dimworld, coord_t >::PolyhedralGrid | ( | const std::vector< int > & | n,
|  | const std::vector< double > & | dx )

inline explicit

constructor

Parameters

  [in] | n | Number of cells in each direction
  [in] | dx | Size of cells in each direction

## PolyhedralGrid() [2/3]

template<int dim, int dimworld, typename coord_t>

Dune::PolyhedralGrid< dim, dimworld, coord_t >::PolyhedralGrid | ( | UnstructuredGridPtr && | gridPtr | ) |

inline explicit

constructor

Note
  The grid will take ownership of the supplied grid pointer.

Parameters

  [in] | gridPtr | pointer to UnstructuredGrid

## PolyhedralGrid() [3/3]

template<int dim, int dimworld, typename coord_t>

Dune::PolyhedralGrid< dim, dimworld, coord_t >::PolyhedralGrid | ( | const UnstructuredGridType & | grid | ) |

inline explicit

constructor

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

Parameters

  [in] | grid | UnstructuredGrid reference

## Member Function Documentation

## adapt() [1/2]

template<int dim, int dimworld, typename coord_t>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::adapt | ( |  | ) |

inline

## adapt() [2/2]

template<int dim, int dimworld, typename coord_t>
template<class DataHandle>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::adapt | ( | DataHandle & |  | ) |

inline

Parameters

  handle | handler for restriction and prolongation operations which is a Model of the AdaptDataHandleInterface class.

## comm()

template<int dim, int dimworld, typename coord_t>

const CommunicationType & Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>
template<class DataHandle>

void Dune::PolyhedralGrid< dim, dimworld, coord_t >::communicate | ( | DataHandle & | ,
|  | InterfaceType | ,
|  | CommunicationDirection | ) const

inline

communicate information on leaf entities

Parameters

  | dataHandle | communication data handle (user defined)
  [in] | interface | communication interface (one of InteriorBorder_InteriorBorder_Interface, InteriorBorder_All_Interface, Overlap_OverlapFront_Interface, Overlap_All_Interface, All_All_Interface)
  [in] | direction | communication direction (one of ForwardCommunication, BackwardCommunication)

## communicate() [2/2]

template<int dim, int dimworld, typename coord_t>
template<class DataHandle>

void Dune::PolyhedralGrid< dim, dimworld, coord_t >::communicate | ( | DataHandle & | ,
|  | InterfaceType | ,
|  | CommunicationDirection | ,
|  | int | ) const

inline

communicate information on a grid level

Parameters

  | dataHandle | communication data handle (user defined)
  [in] | interface | communication interface (one of InteriorBorder_InteriorBorder_Interface, InteriorBorder_All_Interface, Overlap_OverlapFront_Interface, Overlap_All_Interface, All_All_Interface)
  [in] | direction | communication direction (one of ForwardCommunication or BackwardCommunication)
  [in] | level | grid level to communicate

## ghostSize() [1/2]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::ghostSize | ( | int | codim | ) | const

inline

obtain size of ghost region for the leaf grid

Parameters

  [in] | codim | codimension for with the information is desired

## ghostSize() [2/2]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::ghostSize | ( | int | ,
|  | int | codim ) const

inline

obtain size of ghost region for a grid level

Parameters

  [in] | level | grid level (0, ..., maxLevel())
  [in] | codim | codimension (0, ..., dimension)

## loadBalance() [1/3]

template<int dim, int dimworld, typename coord_t>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>
template<class DataHandle, class Data>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::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

  datahandle | communication data handle (user defined)

Returns
  true, if the grid has changed.

## loadBalance() [3/3]

template<int dim, int dimworld, typename coord_t>
template<class DofManager>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::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

  dataHandle | data handle following the ALUGrid interface

Returns
  true, if the grid has changed.

## maxLevel()

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::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, typename coord_t>

size_t Dune::PolyhedralGrid< dim, dimworld, coord_t >::numBoundarySegments | ( |  | ) | const

inline

obtain number of leaf entities

Parameters

  [in] | type | geometry type to consider

Returns
  number of leaf entities with a geometry of type type

## overlapSize() [1/2]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::overlapSize | ( | int |  | ) | const

inline

obtain size of overlap region for the leaf grid

Parameters

  [in] | codim | codimension for with the information is desired

## overlapSize() [2/2]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::overlapSize | ( | int | ,
|  | int | ) const

inline

obtain size of overlap region for a grid level

Parameters

  [in] | level | grid level (0, ..., maxLevel())
  [in] | codim | codimension (0, ..., dimension)

## postAdapt()

template<int dim, int dimworld, typename coord_t>

void Dune::PolyhedralGrid< dim, dimworld, coord_t >::postAdapt | ( |  | ) |

inline

## preAdapt()

template<int dim, int dimworld, typename coord_t>

bool Dune::PolyhedralGrid< dim, dimworld, coord_t >::preAdapt | ( |  | ) |

inline

## scatterData()

template<int dim, int dimworld, typename coord_t>
template<class DataHandle>

void Dune::PolyhedralGrid< dim, dimworld, coord_t >::scatterData | ( | DataHandle & | handle | ) | const

inline

Moves data from the global (all data on process) view to the distributed view.

This method does not do communication but assumes that the global grid is present on every process and simply copies data to the distributed view.

Template Parameters

  DataHandle | The type of the data handle describing the data and responsible for gathering and scattering the data.

Parameters

  handle | The data handle describing the data and responsible for gathering and scattering the data.

## size() [1/4]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::size | ( | GeometryType | type | ) | const

inline

returns the number of boundary segments within the macro grid

Returns
  number of boundary segments within the macro grid

## size() [2/4]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::size | ( | int | codim | ) | const

inline

obtain number of leaf entities

Parameters

  [in] | codim | codimension to consider

Returns
  number of leaf entities of codimension codim

## size() [3/4]

template<int dim, int dimworld, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::size | ( | int | ,
|  | GeometryType | type ) const

inline

obtain number of entites on a level

Parameters

  [in] | level | level to consider
  [in] | type | geometry 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, typename coord_t>

int Dune::PolyhedralGrid< dim, dimworld, coord_t >::size | ( | int | ,
|  | int | codim ) const

inline

obtain number of entites on a level

Parameters

  [in] | level | level to consider
  [in] | codim | codimension to consider

Returns
  number of entities of codimension codim on grid level level.

## update()

template<int dim, int dimworld, typename coord_t>

void Dune::PolyhedralGrid< dim, dimworld, coord_t >::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:

- opm/grid/polyhedralgrid/declaration.hh
- opm/grid/polyhedralgrid/grid.hh