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 };
72 enum { mydimension = 2 };
79 typedef FieldVector<ctype, 2> LocalCoordinate;
80 typedef FieldVector<ctype, 3> GlobalCoordinate;
91 is_on_boundary_(false)
105 return subindex_ == other.subindex_ && index_ == other.index_ && pgrid_ == other.pgrid_;
123 return is_on_boundary_;
138 return !
boundary() && nbcell_!=std::numeric_limits<int>::max();
166 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInInside().");
177 OPM_THROW(std::runtime_error,
"Cannot access geometryInOutside(), intersection is at a boundary.");
179 OPM_THROW(std::runtime_error,
"This intersection class does not support geometryInOutside().");
204 if (in_inside == -1) {
208 return in_inside + ((in_inside % 2) ? -1 : 1);
215 FieldVector<ctype, 3>
outerNormal(
const FieldVector<ctype, 2>&)
const;
227 FieldVector<ctype, 3>
unitOuterNormal(
const FieldVector<ctype, 2>&)
const;
242 const CpGridData* pgrid_;
247 bool is_on_boundary_;
255 subindex_ = faces_of_cell_.size();
260 return subindex_ == faces_of_cell_.size();
265 if (is_on_boundary_) {
266 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at boundary.");
268 if(nbcell_==std::numeric_limits<int>::max())
269 OPM_THROW(std::runtime_error,
"There is no outside cell, intersection is at processor boundary.");
278 class IntersectionIterator :
public Intersection
283 IntersectionIterator()
292 Intersection::setAtEnd();
294 Intersection::update();
298 IntersectionIterator& operator++()
300 Intersection::increment();
304 IntersectionIterator operator++(
int)
306 IntersectionIterator tmp(*
this);
311 const Intersection* operator->()
const
313 assert(!Intersection::isAtEnd());
317 const Intersection& operator*()
const
319 assert(!Intersection::isAtEnd());
335 struct iterator_traits<
Dune::cpgrid::IntersectionIterator >
338 typedef ptrdiff_t difference_type;
339 typedef typename Iterator::Intersection value_type;
340 typedef value_type* pointer;
341 typedef value_type& reference;
342 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: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:76
Definition Intersection.hpp:279
Definition Intersection.hpp:66
GeometryType type() const
Definition Intersection.hpp:190
const LocalGeometry & geometryInInside() const
Definition Intersection.hpp:164
int boundaryId() const
Returns the boundary id of this intersection.
Definition Intersection.cpp:47
bool neighbor() const
Definition Intersection.hpp:136
FieldVector< ctype, 3 > unitOuterNormal(const FieldVector< ctype, 2 > &) const
Definition Intersection.cpp:166
cpgrid::Entity< 0 > Entity
Definition Intersection.hpp:75
bool operator!=(const Intersection &other) const
Definition Intersection.hpp:112
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:103
const LocalGeometry & geometryInOutside() const
Definition Intersection.hpp:174
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:154
Intersection()
Definition Intersection.hpp:85
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in.
Definition Intersection.hpp:201
Geometry geometry() const
Definition Intersection.cpp:186
bool boundary() const
Definition Intersection.hpp:121
Entity outside() const
Definition Intersection.cpp:181
iterator_range< typename std::vector< EntityRep< codim_to > >::const_iterator > row_type
Definition SparseTable.hpp:164
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.