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"
70 enum { dimension = 3 };
71 enum { dimensionworld = 3 };
78 typedef FieldVector<ctype, 2> LocalCoordinate;
79 typedef FieldVector<ctype, 3> GlobalCoordinate;
92 is_on_boundary_(false)
106 return subindex_ == other.subindex_ && index_ == other.index_ && pgrid_ == other.pgrid_;
124 return is_on_boundary_;
139 return !
boundary() && nbcell_!=std::numeric_limits<int>::max();
167 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInInside().");
179 OPM_THROW(std::runtime_error,
"Cannot access geometryInOutside(), intersection is at a boundary.");
181 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInOutside().");
210 if (in_inside == -1) {
214 return in_inside + ((in_inside % 2) ? -1 : 1);
221 FieldVector<ctype, 3>
outerNormal(
const FieldVector<ctype, 2>&)
const;
233 FieldVector<ctype, 3>
unitOuterNormal(
const FieldVector<ctype, 2>&)
const;
248 const CpGridData* pgrid_;
251 OrientedEntityTable<0,1>::row_type faces_of_cell_;
252 Geometry global_geom_;
256 bool is_on_boundary_;
264 subindex_ = faces_of_cell_.size();
269 return subindex_ == faces_of_cell_.size();
274 if (is_on_boundary_) {
275 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at boundary.");
277 if(nbcell_==std::numeric_limits<int>::max())
278 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at processor boundary.");
301 Intersection::setAtEnd();
303 Intersection::update();
309 Intersection::increment();
315 assert(!Intersection::isAtEnd());
321 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: Intersection.hpp:288
Definition: Intersection.hpp:66
GeometryType type() const
Definition: Intersection.hpp:196
const LocalGeometry & geometryInInside() const
Definition: Intersection.hpp:165
int boundaryId() const
Returns the boundary id of this intersection.
Definition: Intersection.cpp:51
bool neighbor() const
Definition: Intersection.hpp:137
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:174
cpgrid::Entity< 0 > Entity
Definition: Intersection.hpp:74
bool operator!=(const Intersection &other) const
Definition: Intersection.hpp:113
int boundarySegmentIndex() const
Returns the boundary segment index of this intersection.
Definition: Intersection.cpp:89
FieldVector< ctype, 3 > outerNormal(const FieldVector< ctype, 2 > &) const
Definition: Intersection.cpp:163
Entity inside() const
Definition: Intersection.cpp:184
bool operator==(const Intersection &other) const
Definition: Intersection.hpp:104
const LocalGeometry & geometryInOutside() const
Definition: Intersection.hpp:176
FieldVector< ctype, 3 > integrationOuterNormal(const FieldVector< ctype, 2 > &unused) const
Definition: Intersection.cpp:168
const Geometry & geometry() const
Definition: Intersection.hpp:188
FieldVector< ctype, 3 > centerUnitOuterNormal() const
Definition: Intersection.cpp:179
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in.
Definition: Intersection.cpp:137
bool conforming() const
Definition: Intersection.hpp:155
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:207
bool boundary() const
Definition: Intersection.hpp:122
Entity outside() const
Definition: Intersection.cpp:189
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
Low-level corner-point processing routines and supporting data structures.