3#ifndef DUNE_POLYHEDRALGRID_INTERSECTION_HH
4#define DUNE_POLYHEDRALGRID_INTERSECTION_HH
7#include <dune/common/fvector.hh>
10#include <opm/grid/polyhedralgrid/declaration.hh>
20 template<
class Gr
id >
25 typedef typename Grid :: Traits Traits;
27 typedef typename Traits :: ExtraData ExtraData ;
30 typedef typename Traits::ctype ctype;
31 typedef typename Traits::GlobalCoordinate GlobalCoordinate;
33 static const int dimension = Traits::dimension;
34 static const int dimensionworld = Traits::dimensionworld;
36 typedef typename Traits::template Codim< 0 >::Entity Entity;
37 typedef typename Traits::template Codim< 0 >::EntityPointer EntityPointer;
38 typedef typename Traits::template Codim< 0 >::EntitySeed EntitySeed;
39 typedef typename Traits::template Codim< 1 >::Geometry Geometry;
40 typedef typename Traits::template Codim< 1 >::LocalGeometry LocalGeometry;
43 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
44 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
45 typedef typename Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
46 typedef typename Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
52 intersectionIdx_( -1 )
58 intersectionIdx_( -1 )
64 intersectionIdx_( intersectionIdx )
68 : data_( other.data_ ),
70 intersectionIdx_( other.intersectionIdx_ )
73 Entity inside ()
const
75 return Entity( EntityImpl( data(), seed_ ) );
78 Entity outside ()
const
80 return Entity( EntityImpl(data(),
81 data()->neighbor(seed_, intersectionIdx_)) );
88 intersectionIdx_ = other.intersectionIdx_;
92 bool operator == (
const This& other )
const
94 return (seed_ == other.seed_) &&
95 (intersectionIdx_ == other.intersectionIdx_);
98 bool boundary ()
const {
return !neighbor(); }
100 bool conforming ()
const {
return false; }
102 bool neighbor ()
const {
return data()->neighbor(seed_, intersectionIdx_).isValid(); }
104 int boundaryId ()
const {
return 1; }
106 size_t boundarySegmentIndex ()
const
108 return data()->boundarySegmentIndex( seed_, intersectionIdx_);
111 LocalGeometry geometryInInside ()
const
113 return LocalGeometry( LocalGeometryImpl( data() ) );
116 LocalGeometry geometryInOutside ()
const
118 return LocalGeometry( LocalGeometryImpl( data() ) );
121 Geometry geometry ()
const
123 return Geometry( GeometryImpl(data(), data()->
template subEntitySeed<1>(seed_, intersectionIdx_)));
126 GeometryType type ()
const
128 return Dune::GeometryTypes::cube(dimension);
131 int indexInInside ()
const
133 return data()->indexInInside(seed_, intersectionIdx_);
136 int indexInOutside ()
const
138 return data()->indexInOutside(seed_, intersectionIdx_);
142 integrationOuterNormal (
const FieldVector< ctype, dimension-1 > &local )
const
144 return outerNormal( local );
148 outerNormal (
const FieldVector< ctype, dimension-1 > & )
const
149 {
return outerNormal(); }
151 GlobalCoordinate outerNormal ()
const
152 {
return data()->outerNormal(seed_, intersectionIdx_); }
155 unitOuterNormal (
const FieldVector< ctype, dimension-1 > & )
const
157 return centerUnitOuterNormal();
161 centerUnitOuterNormal ()
const
162 {
return data()->unitOuterNormal(seed_, intersectionIdx_); }
164 ExtraData data()
const {
return data_; }
166 bool equals(
const This& other)
const
168 return seed_.equals(other.seed_) && intersectionIdx_ == other.intersectionIdx_;
175 return data()->template subEntitySeed<1>( seed_, intersectionIdx_).index();
182 int intersectionIdx_;
Definition: intersection.hh:22
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10