opm-grid
Loading...
Searching...
No Matches
Dune::cpgrid::Entity< codim > Class Template Reference

#include <Entity.hpp>

Inheritance diagram for Dune::cpgrid::Entity< codim >:
Dune::cpgrid::EntityRep< codim >

Classes

struct  Codim
 Export supported entity types. More...

Public Types

typedef Entity EntitySeed
typedef cpgrid::Geometry< 3-codim, 3 > Geometry
typedef Geometry LocalGeometry
typedef cpgrid::IntersectionIterator LeafIntersectionIterator
typedef cpgrid::IntersectionIterator LevelIntersectionIterator
typedef cpgrid::HierarchicIterator HierarchicIterator
typedef double ctype
Public Types inherited from Dune::cpgrid::EntityRep< codim >
enum  { codimension =codim }
enum  { InvalidIndex = INT_MAX }

Public Member Functions

 Entity ()
 Constructor taking a grid and an integer entity representation.
 Entity (const CpGridData &grid, EntityRep< codim > entityrep)
 Constructor taking a grid and an entity representation.
 Entity (const CpGridData &grid, int index_arg, bool orientation_arg)
 Constructor taking a grid, entity index, and orientation.
 Entity (int index_arg, bool orientation_arg)
 Constructor taking a entity index, and orientation.
bool operator== (const Entity &other) const
 Equality.
bool operator!= (const Entity &other) const
 Inequality.
EntitySeed seed () const
 Return an entity seed (light-weight entity).
const Geometry & geometry () const
 Return the geometry of the entity (does not depend on its orientation).
int level () const
 Return the level of the entity in the grid hierarchy. Level = 0 represents the coarsest grid.
bool isLeaf () const
 Check if the entity is in the leafview.
bool isRegular () const
 Refinement is not defined for CpGrid.
PartitionType partitionType () const
 In serial run, the only partitionType() is InteriorEntity.
GeometryType type () const
 Return marker object (GeometryType object) representing the reference element of the entity.
unsigned int subEntities (const unsigned int cc) const
 Return the number of all subentities of the entity of a given codimension cc.
template<int cc>
Codim< cc >::Entity subEntity (int i) const
 Obtain subentity.
LevelIntersectionIterator ilevelbegin () const
 Start level-iterator for the cell-cell intersections of this entity.
LevelIntersectionIterator ilevelend () const
 End level-iterator for the cell-cell intersections of this entity.
LeafIntersectionIterator ileafbegin () const
 Start leaf-iterator for the cell-cell intersections of this entity.
LeafIntersectionIterator ileafend () const
 End leaf-iterator for the cell-cell intersections of this entity.
HierarchicIterator hbegin (int) const
 Iterator begin over the children. [If requested, also over descendants more than one generation away.].
HierarchicIterator hend (int) const
 Iterator end over the children/beyond last child iterator.
bool isNew () const
 Returns true, if the entity has been created during the last call to adapt().
bool mightVanish () const
 Indicates whether the entity may be removed in the next call to adapt().
bool hasFather () const
 ONLY FOR CELLS (Entity<0>) Check if the entity comes from an LGR, i.e., it has been created via refinement from coarser level.
Entity< 0 > father () const
 ONLY FOR CELLS (Entity<0>).
Dune::cpgrid::Geometry< 3, 3 > geometryInFather () const
 Return LocalGeometry representing the embedding of the entity into its father (when hasFather() is true).
bool hasBoundaryIntersections () const
 Returns true if any of my intersections are on the boundary.
const Entityimpl () const
 Access the actual implementation class behind Entity interface class.
Entityimpl ()
bool isValid () const
 isValid method for EntitySeed
Entity< 0 > getOrigin () const
 Returns (1) oldest ancestor, i.e., oldest parent entity in the level-grid 0, if the entity was born in any refined level grid with level>0.
Entity< 0 > getLevelElem () const
 Get equivalent element on the level grid where the entity was born, if grid = leaf-grid-view. Otherwise, return itself.
int getLevelCartesianIdx () const
 Get Cartesian Index in the level grid view where the Entity was born.
int getIdxInParentCell () const
template<int cc>
Entity< codim >::template Codim< cc >::Entity subEntity (int i) const
Public Member Functions inherited from Dune::cpgrid::EntityRep< codim >
 EntityRep ()
 Default constructor.
 EntityRep (int index_arg, bool orientation_arg)
 Constructor taking an entity index and an orientation.
void setValue (int index_arg, bool orientation_arg)
 Set entity value.
int index () const
 The (positive) index of an entity.
int signedIndex () const
 The signed index that also tells us the orientation.
bool orientation () const
 Returns true if the entity has positive orientation.
EntityRep opposite () const
 Returns an EntityRep with opposite orientation.
void increment ()
 Increments the entityrep's index() by one.
bool operator< (const EntityRep &other) const
 Ordering relation used for maps etc.
bool operator== (const EntityRep &other) const
 Equality operator.
bool operator!= (const EntityRep &other) const
 Inequality operator.

Static Public Attributes

static constexpr int codimension = codim
static constexpr int dimension = 3
static constexpr int mydimension = dimension - codimension
static constexpr int dimensionworld = 3

Protected Attributes

const CpGridData * pgrid_

Friends

class LevelGlobalIdSet
class GlobalIdSet
class HierarchicIterator
class CpGridData
friend void::refinePatch_and_check (Dune::CpGrid &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::string > &)

Detailed Description

template<int codim>
class Dune::cpgrid::Entity< codim >
Todo
Doc me!
Template Parameters

Constructor & Destructor Documentation

◆ Entity()

template<int codim>
Dune::cpgrid::Entity< codim >::Entity ( )
inline

Constructor taking a grid and an integer entity representation.

This constructor should probably be removed, since it exposes details of the implementation of

See also
EntityRep, see comment in EntityRep<>::EntityRep(int). Constructor creating empty entity

Member Function Documentation

◆ father()

template<int codim>
Entity< 0 > Dune::cpgrid::Entity< codim >::father ( ) const

ONLY FOR CELLS (Entity<0>).

Get the father Entity (in the level-grid the father cell was born), in case entity.hasFather() is true.

Returns
father-entity

◆ geometryInFather()

template<int codim>
Dune::cpgrid::Geometry< 3, 3 > Dune::cpgrid::Entity< codim >::geometryInFather ( ) const

Return LocalGeometry representing the embedding of the entity into its father (when hasFather() is true).

Map from the entity's reference element into the reference element of its father. Currently, LGR is built via refinement of a block-shaped patch from the coarse grid. So the LocalGeometry of an entity coming from the LGR is one of the refined cells of the unit cube, with suitable amount of cells in each direction.

◆ getOrigin()

template<int codim>
Dune::cpgrid::Entity< 0 > Dune::cpgrid::Entity< codim >::getOrigin ( ) const

Returns (1) oldest ancestor, i.e., oldest parent entity in the level-grid 0, if the entity was born in any refined level grid with level>0.

(2) if the entity has no father, and is a leaf-grid-view entity, it returns the equivalent element on the level that it was born. Namely, for coarse cells on the leaf never involved in any refinement process, we get the equivalent entity in the GLOBAL grid (level 0). (3) Otherwise, returns itself, which means that its grid is the level 0 and the entity itself is already its "origin".

◆ hasBoundaryIntersections()

template<int codim>
bool Dune::cpgrid::Entity< codim >::hasBoundaryIntersections ( ) const

Returns true if any of my intersections are on the boundary.

Implementation note: This is a slow, computed, function. Could be speeded up by putting boundary info in the CpGrid class.

◆ hasFather()

template<int codim>
bool Dune::cpgrid::Entity< codim >::hasFather ( ) const

ONLY FOR CELLS (Entity<0>) Check if the entity comes from an LGR, i.e., it has been created via refinement from coarser level.

@TODO: When distributed_data_ is not empty, check whether the father element exists on the local process, which can be used to test whether it is safe to call father.

◆ hend()

template<int codim>
HierarchicIterator Dune::cpgrid::Entity< codim >::hend ( int maxLevel) const

Iterator end over the children/beyond last child iterator.

Dummy beyond last child iterator.

◆ isLeaf()

template<int codim>
bool Dune::cpgrid::Entity< codim >::isLeaf ( ) const

Check if the entity is in the leafview.

   @TODO: Modify the definition to cover serial and parallel cases.
   Serial: an element is a leaf <-> hbegin and hend return the same iterator
   Parallel: true <-> the element is a leaf entity of the global refinement hierarchy. 

◆ isNew()

template<int codim>
bool Dune::cpgrid::Entity< codim >::isNew ( ) const

Returns true, if the entity has been created during the last call to adapt().

Note: An element created during the last refinement step may still be refined further on a higher level (e.g., through nested refinement). The isNew flag is used to identify such newly created elements so that data interpolation is applied only to them.

◆ isValid()

template<int codim>
bool Dune::cpgrid::Entity< codim >::isValid ( ) const

isValid method for EntitySeed

Returns
return true if seed is pointing to a valid entity

◆ mightVanish()

template<int codim>
bool Dune::cpgrid::Entity< codim >::mightVanish ( ) const

Indicates whether the entity may be removed in the next call to adapt().

For CpGrid, this currently always returns false, since only refinement (and no coarsening) is supported. A return value of false guarantees that the entity will still exist after adaptation.

◆ partitionType()

template<int codim>
PartitionType Dune::cpgrid::Entity< codim >::partitionType ( ) const

In serial run, the only partitionType() is InteriorEntity.

Only needed when distributed_data_ is not empty. In parallel run, the entity each cell inherits the partition type of its origin (either parent cell or equivalent cell in level 0). Only needed when distributed_data_ is not empty.

◆ seed()

template<int codim>
EntitySeed Dune::cpgrid::Entity< codim >::seed ( ) const
inline

Return an entity seed (light-weight entity).

EntitySeed objects are used to obtain an Entity back when combined with the corresponding grid. For CpGrid, EntitySeed and EntityPtr are the same class.

◆ subEntity()

template<int codim>
template<int cc>
Codim< cc >::Entity Dune::cpgrid::Entity< codim >::subEntity ( int i) const

Obtain subentity.

Example: If cc = 3 and i = 5, it returns the 5th corner/vertex of the entity.

◆ type()

template<int codim>
GeometryType Dune::cpgrid::Entity< codim >::type ( ) const
inline

Return marker object (GeometryType object) representing the reference element of the entity.

Currently, cube type for all entities (cells and vertices).

Member Data Documentation

◆ codimension

template<int codim>
int Dune::cpgrid::Entity< codim >::codimension = codim
staticconstexpr
Todo
Doc me!

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