3#ifndef DUNE_POLYHEDRALGRID_INTERSECTION_HH
4#define DUNE_POLYHEDRALGRID_INTERSECTION_HH
7#include <dune/common/version.hh>
10#include <opm/grid/polyhedralgrid/declaration.hh>
18 template<
class Gr
id >
23 typedef typename Grid :: Traits Traits;
25 typedef typename Traits :: ExtraData ExtraData ;
28 typedef typename Traits::ctype ctype;
29 typedef typename Traits::GlobalCoordinate GlobalCoordinate;
31 static const int dimension = Traits::dimension;
32 static const int dimensionworld = Traits::dimensionworld;
34 typedef typename Traits::template Codim< 0 >::Entity Entity;
35 typedef typename Traits::template Codim< 0 >::EntityPointer EntityPointer;
36 typedef typename Traits::template Codim< 0 >::EntitySeed EntitySeed;
37 typedef typename Traits::template Codim< 1 >::Geometry Geometry;
38 typedef typename Traits::template Codim< 1 >::LocalGeometry LocalGeometry;
41 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
42 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
43 typedef typename Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
44 typedef typename Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
50 intersectionIdx_( -1 )
56 intersectionIdx_( -1 )
62 intersectionIdx_( intersectionIdx )
66 : data_( other.data_ ),
68 intersectionIdx_( other.intersectionIdx_ )
71 Entity inside ()
const
73 return Entity( EntityImpl( data(), seed_ ) );
76 Entity outside ()
const
78 return Entity( EntityImpl(data(),
79 data()->neighbor(seed_, intersectionIdx_)) );
86 intersectionIdx_ = other.intersectionIdx_;
90 bool operator == (
const This& other )
const
92 return (seed_ == other.seed_) &&
93 (intersectionIdx_ == other.intersectionIdx_);
96 bool boundary ()
const {
return !neighbor(); }
98 bool conforming ()
const {
return false; }
100 bool neighbor ()
const {
return data()->neighbor(seed_, intersectionIdx_).isValid(); }
102 int boundaryId ()
const {
return 1; }
104 size_t boundarySegmentIndex ()
const
106 return data()->boundarySegmentIndex( seed_, intersectionIdx_);
109 LocalGeometry geometryInInside ()
const
111 return LocalGeometry( LocalGeometryImpl( data() ) );
114 LocalGeometry geometryInOutside ()
const
116 return LocalGeometry( LocalGeometryImpl( data() ) );
119 Geometry geometry ()
const
121 return Geometry( GeometryImpl(data(), data()->
template subEntitySeed<1>(seed_, intersectionIdx_)));
124 GeometryType type ()
const
126 return Dune::GeometryTypes::cube(dimension);
129 int indexInInside ()
const
131 return data()->indexInInside(seed_, intersectionIdx_);
134 int indexInOutside ()
const
136 return data()->indexInOutside(seed_, intersectionIdx_);
140 integrationOuterNormal (
const FieldVector< ctype, dimension-1 > &local )
const
142 return outerNormal( local );
146 outerNormal (
const FieldVector< ctype, dimension-1 > & )
const
147 {
return outerNormal(); }
149 GlobalCoordinate outerNormal ()
const
150 {
return data()->outerNormal(seed_, intersectionIdx_); }
153 unitOuterNormal (
const FieldVector< ctype, dimension-1 > & )
const
155 return centerUnitOuterNormal();
159 centerUnitOuterNormal ()
const
160 {
return data()->unitOuterNormal(seed_, intersectionIdx_); }
162 ExtraData data()
const {
return data_; }
164 bool equals(
const This& other)
const
166 return seed_.equals(other.seed_) && intersectionIdx_ == other.intersectionIdx_;
173 return data()->template subEntitySeed<1>( seed_, intersectionIdx_).index();
180 int intersectionIdx_;
Definition: intersection.hh:20
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10