3 #ifndef DUNE_POLYHEDRALGRID_INTERSECTION_HH 4 #define DUNE_POLYHEDRALGRID_INTERSECTION_HH 7 #include <dune/common/version.hh> 10 #include <dune/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_( intersectionIdx )
60 : data_( other.data_ ),
62 intersectionIdx_( other.intersectionIdx_ )
65 #if DUNE_VERSION_NEWER(DUNE_GRID,2,4) 66 Entity inside ()
const 68 return Entity( EntityImpl( data(), seed_ ) );
71 Entity outside ()
const 73 return Entity( EntityImpl(data(),
74 data()->neighbor(seed_, intersectionIdx_)) );
77 EntityPointer inside ()
const 79 return EntityPointer( EntityPointerImpl( EntityImpl( data(), seed_ ) ) );
82 EntityPointer outside ()
const 84 return EntityPointer( EntityPointerImpl( EntityImpl(data(),
85 data()->neighbor(seed_, intersectionIdx_)) ) );
89 bool operator == (
const This& other )
const 91 return (seed_ == other.seed_) &&
92 (intersectionIdx_ == other.intersectionIdx_);
95 bool boundary ()
const {
return !neighbor(); }
97 bool conforming ()
const {
return false; }
99 bool neighbor ()
const {
return data()->neighbor(seed_, intersectionIdx_).isValid(); }
101 int boundaryId ()
const {
return 1; }
103 size_t boundarySegmentIndex ()
const 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 {
return GeometryType(GeometryType::cube, dimension); }
126 int indexInInside ()
const 128 return data()->indexInInside(seed_, intersectionIdx_);
131 int indexInOutside ()
const 133 return data()->indexInOutside(seed_, intersectionIdx_);
137 integrationOuterNormal (
const FieldVector< ctype, dimension-1 > &local )
const 139 return outerNormal( local );
143 outerNormal (
const FieldVector< ctype, dimension-1 > & )
const 144 {
return outerNormal(); }
146 GlobalCoordinate outerNormal ()
const 147 {
return data()->outerNormal(seed_, intersectionIdx_); }
150 unitOuterNormal (
const FieldVector< ctype, dimension-1 > & )
const 152 return centerUnitOuterNormal();
156 centerUnitOuterNormal ()
const 157 {
return data()->unitOuterNormal(seed_, intersectionIdx_); }
159 ExtraData data()
const {
return data_; }
161 bool equals(
const This& other)
const 163 return seed_.equals(other.seed_) && intersectionIdx_ == other.intersectionIdx_;
170 return data()->template subEntitySeed<1>( seed_, intersectionIdx_).index();
177 int intersectionIdx_;
182 #endif // #ifndef DUNE_POLYHEDRALGRID_INTERSECTION_HH Definition: intersection.hh:19
Holds the implementation of the CpGrid as a pimple.
Definition: OpmParserIncludes.hpp:42