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.");
275 class IntersectionIterator :
public Intersection
280 IntersectionIterator()
289 Intersection::setAtEnd();
291 Intersection::update();
295 IntersectionIterator& operator++()
297 Intersection::increment();
301 IntersectionIterator operator++(
int)
303 IntersectionIterator tmp(*
this);
308 const Intersection* operator->()
const
310 assert(!Intersection::isAtEnd());
314 const Intersection& operator*()
const
316 assert(!Intersection::isAtEnd());
332 struct iterator_traits<
Dune::cpgrid::IntersectionIterator >
335 typedef ptrdiff_t difference_type;
336 typedef typename Iterator::Intersection value_type;
337 typedef value_type* pointer;
338 typedef value_type& reference;
339 typedef forward_iterator_tag iterator_category;
Struct that hods all the data needed to represent a Cpgrid.
Definition CpGridData.hpp:118
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:107
This class encapsulates geometry for vertices, intersections, and cells.
Definition Geometry.hpp:76
Definition Intersection.hpp:276
Definition Intersection.hpp:63
GeometryType type() const
Definition Intersection.hpp:187
const LocalGeometry & geometryInInside() const
Definition Intersection.hpp:161
int boundaryId() const
Returns the boundary id of this intersection.
Definition Intersection.cpp:47
bool neighbor() const
Definition Intersection.hpp:133
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition Intersection.cpp:166
cpgrid::Entity< 0 > Entity
Definition Intersection.hpp:72
bool operator!=(const Intersection &other) const
Definition Intersection.hpp:109
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:100
const LocalGeometry & geometryInOutside() const
Definition Intersection.hpp:171
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:151
Intersection()
Definition Intersection.hpp:82
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in.
Definition Intersection.hpp:198
Geometry geometry() const
Definition Intersection.cpp:186
bool boundary() const
Definition Intersection.hpp:118
Entity outside() const
Definition Intersection.cpp:181
Copyright 2019 Equinor AS.
Definition GridPartitioning.cpp:673
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10
Low-level corner-point processing routines and supporting data structures.