36 #ifndef OPM_INTERSECTION_HEADER
37 #define OPM_INTERSECTION_HEADER
42 #include <dune/grid/common/gridenums.hh>
44 #include <opm/grid/utility/ErrorMacros.hpp>
52 #include "Geometry.hpp"
53 #include "OrientedEntityTable.hpp"
72 enum { dimension = 3 };
73 enum { dimensionworld = 3 };
81 typedef FieldVector<ctype, 2> LocalCoordinate;
82 typedef FieldVector<ctype, 3> GlobalCoordinate;
95 is_on_boundary_(false)
109 return subindex_ == other.subindex_ && index_ == other.index_ && pgrid_ == other.pgrid_;
127 return is_on_boundary_;
142 return !
boundary() && nbcell_!=std::numeric_limits<int>::max();
170 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInInside().");
182 OPM_THROW(std::runtime_error,
"Cannot access geometryInOutside(), intersection is at a boundary.");
184 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInOutside().");
213 if (in_inside == -1) {
217 return in_inside + ((in_inside % 2) ? -1 : 1);
224 FieldVector<ctype, 3>
outerNormal(
const FieldVector<ctype, 2>&)
const;
236 FieldVector<ctype, 3>
unitOuterNormal(
const FieldVector<ctype, 2>&)
const;
251 const CpGridData* pgrid_;
254 OrientedEntityTable<0,1>::row_type faces_of_cell_;
255 Geometry global_geom_;
259 bool is_on_boundary_;
267 subindex_ = faces_of_cell_.size();
272 return subindex_ == faces_of_cell_.size();
277 if (is_on_boundary_) {
278 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at boundary.");
280 if(nbcell_==std::numeric_limits<int>::max())
281 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at processor boundary.");
304 Intersection::setAtEnd();
306 Intersection::update();
312 Intersection::increment();
318 assert(!Intersection::isAtEnd());
324 assert(!Intersection::isAtEnd());
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:123
Represents an entity of a given codim, with positive or negative orientation.
Definition: EntityRep.hpp:98
int index() const
The (positive) index of an entity.
Definition: EntityRep.hpp:125
Definition: Entity.hpp:70
Definition: Intersection.hpp:291
Definition: Intersection.hpp:68
GeometryType type() const
Definition: Intersection.hpp:199
const LocalGeometry & geometryInOutside() const
Definition: Intersection.hpp:179
EntityPointer inside() const
Definition: Intersection.cpp:165
int boundaryId() const
Returns the boundary id of this intersection.
Definition: Intersection.cpp:32
bool neighbor() const
Definition: Intersection.hpp:140
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:155
cpgrid::Entity< 0 > Entity
Definition: Intersection.hpp:76
const LocalGeometry & geometryInInside() const
Definition: Intersection.hpp:168
bool operator!=(const Intersection &other) const
Definition: Intersection.hpp:116
int boundarySegmentIndex() const
Returns the boundary segment index of this intersection.
Definition: Intersection.cpp:70
FieldVector< ctype, 3 > outerNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:144
EntityPointer outside() const
Definition: Intersection.cpp:170
bool operator==(const Intersection &other) const
Definition: Intersection.hpp:107
const Geometry & geometry() const
Definition: Intersection.hpp:191
FieldVector< ctype, 3 > integrationOuterNormal(const FieldVector< ctype, 2 > &unused) const
Definition: Intersection.cpp:149
FieldVector< ctype, 3 > centerUnitOuterNormal() const
Definition: Intersection.cpp:160
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in.
Definition: Intersection.cpp:118
bool conforming() const
Definition: Intersection.hpp:158
Intersection()
Definition: Intersection.hpp:87
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in.
Definition: Intersection.hpp:210
bool boundary() const
Definition: Intersection.hpp:125
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
Low-level corner-point processing routines and supporting data structures.