36 #ifndef OPM_ENTITY_HEADER
37 #define OPM_ENTITY_HEADER
39 #include <dune/common/version.hh>
40 #include <dune/geometry/type.hh>
41 #include <dune/grid/common/gridenums.hh>
43 #include "PartitionTypeIndicator.hpp"
44 #include "EntityRep.hpp"
51 template <
int>
class EntityPointer;
52 template<
int,
int>
class Geometry;
53 template<
int,PartitionIteratorType>
class Iterator;
54 class IntersectionIterator;
55 class HierarchicIterator;
57 class LevelGlobalIdSet;
62 template <
int codim>
class EntityPointer;
77 enum { codimension = codim };
78 enum { dimension = 3 };
79 enum { mydimension = dimension - codimension };
80 enum { dimensionworld = 3 };
107 typedef double ctype;
126 :
EntityRep<codim>(entityrep), pgrid_(&grid)
132 :
EntityRep<codim>(index_arg, orientation_arg), pgrid_(&grid)
182 return Dune::GeometryTypes::cube(3 - codim);
186 unsigned int subEntities (
const unsigned int cc )
const;
254 const Entity& impl()
const
269 const CpGridData* pgrid_;
308 :
Entity(grid, index_arg, orientation_arg)
338 #include "Iterators.hpp"
339 #include "Entity.hpp"
340 #include "Intersection.hpp"
348 static_assert(codim == 0,
"");
355 static_assert(codim == 0,
"");
362 static_assert(codim == 0,
"");
369 static_assert(codim == 0,
"");
390 return pgrid_->partition_type_indicator_->getPartitionType(*
this);
395 #include <opm/grid/cpgrid/CpGridData.hpp>
396 #include <opm/grid/cpgrid/Intersection.hpp>
403 inline unsigned int numFaces(
const OrientedEntityTable<0, 1>& cell_to_face,
406 return cell_to_face[e].size();
410 unsigned int numFaces(
const OrientedEntityTable<0, 1>&,
const Entity<codim>&)
422 }
else if ( codim == 0 ){
424 return Detail::numFaces(pgrid_->cell_to_face_, *
this);
425 }
else if ( cc == 3 ) {
435 return pgrid_->geomVector<codim>()[*
this];
442 static_assert(codim == 0,
"");
447 }
else if (cc == 3) {
448 assert(i >= 0 && i < 8);
450 typename Codim<cc>::EntityPointer se(*pgrid_, corner_index,
true);
453 OPM_THROW(std::runtime_error,
"No subentity exists of codimension " << cc);
463 Iter end = ileafend();
464 for (Iter it = ileafbegin(); it != end; ++it) {
465 if (it->boundary())
return true;
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:123
Class representing a pointer to an entity.
Definition: Entity.hpp:283
EntityPointer(const CpGridData &grid, EntityRep< codim > entityrep)
Constructor taking a grid and an entity representation.
Definition: Entity.hpp:301
void compactify()
Minimizes memory usage.
Definition: Entity.hpp:329
const Entity & operator*() const
Const dereferencing operator.
Definition: Entity.hpp:320
EntityPointer(const Entity &e)
Construction from entity.
Definition: Entity.hpp:295
EntityPointer(const CpGridData &grid, int index_arg, bool orientation_arg)
Constructor taking a grid, entity index and orientation.
Definition: Entity.hpp:307
EntityPointer()
Construction empty entity pointer.
Definition: Entity.hpp:290
const Entity * operator->() const
Const member by pointer operator.
Definition: Entity.hpp:313
Represents an entity of a given codim, with positive or negative orientation.
Definition: EntityRep.hpp:98
bool operator==(const EntityRep &other) const
Equality operator.
Definition: EntityRep.hpp:178
int index() const
The (positive) index of an entity.
Definition: EntityRep.hpp:125
Definition: Entity.hpp:70
bool mightVanish() const
Returns true, if entity might disappear during the next call to adapt(). Dummy.
Definition: Entity.hpp:221
unsigned int subEntities(const unsigned int cc) const
The count of subentities of codimension cc.
Definition: Entity.hpp:417
LeafIntersectionIterator ileafend() const
End iterator for the cell-cell intersections of this entity.
Definition: Entity.hpp:367
LocalGeometry geometryInFather() const
Dummy, returning default geometry.
Definition: Entity.hpp:241
EntitySeed seed() const
Return an entity seed.
Definition: Entity.hpp:150
HierarchicIterator hend(int) const
Dummy beyond last child iterator.
Definition: Entity.hpp:382
EntityPointerType father() const
Dummy, returning this.
Definition: Entity.hpp:234
const Geometry & geometry() const
Returns the geometry of the entity (does not depend on its orientation).
Definition: Entity.hpp:433
Entity(const CpGridData &grid, int index_arg, bool orientation_arg)
Constructor taking a grid, entity index and orientation.
Definition: Entity.hpp:131
bool hasFather() const
No hierarchy in this grid.
Definition: Entity.hpp:227
bool isValid() const
isValid method for EntitySeed
Definition: Entity.hpp:471
bool operator==(const Entity &other) const
Equality.
Definition: Entity.hpp:137
bool isRegular() const
Refinement is not defined for CpGrid.
Definition: Entity.hpp:171
int count() const
The count of subentities of codimension cc.
Definition: Entity.hpp:190
Entity()
Constructor taking a grid and an integer entity representation.
Definition: Entity.hpp:119
HierarchicIterator hbegin(int) const
Dummy first child iterator.
Definition: Entity.hpp:375
Codim< cc >::EntityPointer subEntity(int i) const
Obtain subentity.
PartitionType partitionType() const
For now, the grid is serial and the only partitionType() is InteriorEntity.
Definition: Entity.hpp:388
LeafIntersectionIterator ileafbegin() const
Start iterator for the cell-cell intersections of this entity.
Definition: Entity.hpp:360
Entity(const CpGridData &grid, EntityRep< codim > entityrep)
Constructor taking a grid and an entity representation.
Definition: Entity.hpp:125
LevelIntersectionIterator ilevelend() const
End iterator for the cell-cell intersections of this entity.
Definition: Entity.hpp:353
bool isNew() const
Returns true, if the entity has been created during the last call to adapt(). Dummy.
Definition: Entity.hpp:215
LevelIntersectionIterator ilevelbegin() const
Start iterator for the cell-cell intersections of this entity.
Definition: Entity.hpp:346
GeometryType type() const
Using the cube type for all entities now (cells and vertices).
Definition: Entity.hpp:180
int level() const
We do not support refinement, so level() is always 0.
Definition: Entity.hpp:159
bool isLeaf() const
The entity is always on the leaf grid, since we have no refinement.
Definition: Entity.hpp:165
bool operator!=(const Entity &other) const
Inequality.
Definition: Entity.hpp:143
bool hasBoundaryIntersections() const
Returns true if any of my intersections are on the boundary.
Definition: Entity.hpp:458
This class encapsulates geometry for both vertices, intersections and cells.
Definition: Geometry.hpp:68
The global id set for Dune.
Definition: Indexsets.hpp:325
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:89
Definition: Intersection.hpp:291
Definition: Indexsets.hpp:257
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
Definition: Entity.hpp:94