36#ifndef OPM_INTERSECTION_HEADER
37#define OPM_INTERSECTION_HEADER
42#include <dune/grid/common/gridenums.hh>
44#include <opm/common/ErrorMacros.hpp>
52#include "Geometry.hpp"
53#include "OrientedEntityTable.hpp"
70 enum { dimension = 3 };
71 enum { dimensionworld = 3 };
78 typedef FieldVector<ctype, 2> LocalCoordinate;
79 typedef FieldVector<ctype, 3> GlobalCoordinate;
90 is_on_boundary_(false)
104 return subindex_ == other.subindex_ && index_ == other.index_ && pgrid_ == other.pgrid_;
122 return is_on_boundary_;
137 return !
boundary() && nbcell_!=std::numeric_limits<int>::max();
165 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInInside().");
176 OPM_THROW(std::runtime_error,
"Cannot access geometryInOutside(), intersection is at a boundary.");
178 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInOutside().");
203 if (in_inside == -1) {
207 return in_inside + ((in_inside % 2) ? -1 : 1);
214 FieldVector<ctype, 3>
outerNormal(
const FieldVector<ctype, 2>&)
const;
226 FieldVector<ctype, 3>
unitOuterNormal(
const FieldVector<ctype, 2>&)
const;
241 const CpGridData* pgrid_;
244 OrientedEntityTable<0,1>::row_type faces_of_cell_;
246 bool is_on_boundary_;
254 subindex_ = faces_of_cell_.size();
259 return subindex_ == faces_of_cell_.size();
264 if (is_on_boundary_) {
265 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at boundary.");
267 if(nbcell_==std::numeric_limits<int>::max())
268 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at processor boundary.");
291 Intersection::setAtEnd();
293 Intersection::update();
299 Intersection::increment();
305 assert(!Intersection::isAtEnd());
311 assert(!Intersection::isAtEnd());
Struct that hods all the data needed to represent a Cpgrid.
Definition CpGridData.hpp:135
Represents an entity of a given codim, with positive or negative orientation.
Definition EntityRep.hpp:99
int index() const
The (positive) index of an entity.
Definition EntityRep.hpp:126
This class encapsulates geometry for vertices, intersections, and cells.
Definition Geometry.hpp:75
Definition Intersection.hpp:278
Definition Intersection.hpp:66
GeometryType type() const
Definition Intersection.hpp:189
const LocalGeometry & geometryInInside() const
Definition Intersection.hpp:163
int boundaryId() const
Returns the boundary id of this intersection.
Definition Intersection.cpp:47
bool neighbor() const
Definition Intersection.hpp:135
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition Intersection.cpp:166
cpgrid::Entity< 0 > Entity
Definition Intersection.hpp:74
bool operator!=(const Intersection &other) const
Definition Intersection.hpp:111
int boundarySegmentIndex() const
Returns the boundary segment index of this intersection.
Definition Intersection.cpp:85
FieldVector< ctype, 3 > outerNormal(const FieldVector< ctype, 2 > &) const
Definition Intersection.cpp:155
Entity inside() const
Definition Intersection.cpp:176
bool operator==(const Intersection &other) const
Definition Intersection.hpp:102
const LocalGeometry & geometryInOutside() const
Definition Intersection.hpp:173
FieldVector< ctype, 3 > integrationOuterNormal(const FieldVector< ctype, 2 > &unused) const
Definition Intersection.cpp:160
FieldVector< ctype, 3 > centerUnitOuterNormal() const
Definition Intersection.cpp:171
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in.
Definition Intersection.cpp:128
bool conforming() const
Definition Intersection.hpp:153
Intersection()
Definition Intersection.hpp:84
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in.
Definition Intersection.hpp:200
Geometry geometry() const
Definition Intersection.cpp:186
bool boundary() const
Definition Intersection.hpp:120
Entity outside() const
Definition Intersection.cpp:181
Copyright 2019 Equinor AS.
Definition CartesianIndexMapper.hpp:10
Low-level corner-point processing routines and supporting data structures.