36 #ifndef OPM_INTERSECTION_HEADER 37 #define OPM_INTERSECTION_HEADER 39 #include <dune/grid/common/gridenums.hh> 40 #include <opm/grid/utility/ErrorMacros.hpp> 48 #include "Geometry.hpp" 49 #include "OrientedEntityTable.hpp" 67 enum { dimension = 3 };
68 enum { dimensionworld = 3 };
69 enum { mydimension = 2 };
76 typedef FieldVector<ctype, 2> LocalCoordinate;
77 typedef FieldVector<ctype, 3> GlobalCoordinate;
88 is_on_boundary_(false)
102 return subindex_ == other.subindex_ && index_ == other.index_ && pgrid_ == other.pgrid_;
120 return is_on_boundary_;
135 return !
boundary() && nbcell_!=std::numeric_limits<int>::max();
163 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInInside().");
174 OPM_THROW(std::runtime_error,
"Cannot access geometryInOutside(), intersection is at a boundary.");
176 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInOutside().");
201 if (in_inside == -1) {
205 return in_inside + ((in_inside % 2) ? -1 : 1);
212 FieldVector<ctype, 3>
outerNormal(
const FieldVector<ctype, 2>&)
const;
224 FieldVector<ctype, 3>
unitOuterNormal(
const FieldVector<ctype, 2>&)
const;
239 const CpGridData* pgrid_;
242 OrientedEntityTable<0,1>::row_type faces_of_cell_;
244 bool is_on_boundary_;
252 subindex_ = faces_of_cell_.size();
257 return subindex_ == faces_of_cell_.size();
262 if (is_on_boundary_) {
263 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at boundary.");
265 if(nbcell_==std::numeric_limits<int>::max())
266 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at processor boundary.");
289 Intersection::setAtEnd();
291 Intersection::update();
297 Intersection::increment();
310 assert(!Intersection::isAtEnd());
316 assert(!Intersection::isAtEnd());
332 struct iterator_traits<
Dune::cpgrid::IntersectionIterator >
335 typedef ptrdiff_t difference_type;
339 typedef forward_iterator_tag iterator_category;
344 #endif // OPM_INTERSECTION_HEADER const LocalGeometry & geometryInOutside() const
Definition: Intersection.hpp:171
int index() const
The (positive) index of an entity.
Definition: EntityRep.hpp:125
bool conforming() const
Definition: Intersection.hpp:151
Intersection()
Definition: Intersection.hpp:82
Entity outside() const
Definition: Intersection.cpp:181
bool operator==(const Intersection &other) const
Definition: Intersection.hpp:100
The namespace Dune is the main namespace for all Dune code.
Definition: CartesianIndexMapper.hpp:9
const LocalGeometry & geometryInInside() const
Definition: Intersection.hpp:161
Definition: Intersection.hpp:329
Definition: Intersection.hpp:62
FieldVector< ctype, 3 > centerUnitOuterNormal() const
Definition: Intersection.cpp:171
This class encapsulates geometry for vertices, intersections, and cells.
Definition: CpGridData.hpp:94
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:117
cpgrid::Entity< 0 > Entity
Definition: Intersection.hpp:72
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in...
Definition: Intersection.cpp:128
FieldVector< ctype, 3 > integrationOuterNormal(const FieldVector< ctype, 2 > &unused) const
Definition: Intersection.cpp:160
Geometry geometry() const
Definition: Intersection.cpp:186
int boundaryId() const
Returns the boundary id of this intersection.
Definition: Intersection.cpp:47
bool neighbor() const
Definition: Intersection.hpp:133
FieldVector< ctype, 3 > outerNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:155
GeometryType type() const
Definition: Intersection.hpp:187
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:166
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in...
Definition: Intersection.hpp:198
bool operator!=(const Intersection &other) const
Definition: Intersection.hpp:109
Entity inside() const
Definition: Intersection.cpp:176
int boundarySegmentIndex() const
Returns the boundary segment index of this intersection.
Definition: Intersection.cpp:85
Low-level corner-point processing routines and supporting data structures.
Represents an entity of a given codim, with positive or negative orientation.
Definition: CpGridData.hpp:96
Definition: Intersection.hpp:275
bool boundary() const
Definition: Intersection.hpp:118