3 #ifndef DUNE_GEOGRID_INTERSECTION_HH
4 #define DUNE_GEOGRID_INTERSECTION_HH
19 template<
class Gr
id,
class HostIntersection >
22 typedef typename HostIntersection::Geometry HostGeometry;
23 typedef typename HostIntersection::LocalGeometry HostLocalGeometry;
25 typedef typename remove_const< Grid >::type::Traits Traits;
28 typedef typename Traits::ctype
ctype;
33 typedef typename Traits::template Codim< 0 >::Entity
Entity;
34 typedef typename Traits::template Codim< 0 >::EntityPointer
EntityPointer;
35 typedef typename Traits::template Codim< 1 >::Geometry
Geometry;
36 typedef typename Traits::template Codim< 1 >::LocalGeometry
LocalGeometry;
43 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
45 typedef typename Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
46 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
50 : insideGeo_(
Grid::getRealImplementation( insideGeo ) ),
51 hostIntersection_( 0 ),
56 : insideGeo_( other.insideGeo_ ),
57 hostIntersection_( 0 ),
63 insideGeo_ = other.insideGeo_;
68 operator bool ()
const {
return bool( hostIntersection_ ); }
108 geo_ = GeometryImpl(
grid(),
type(), coords );
125 FieldVector< ctype, dimensionworld >
128 const ReferenceElement< ctype, dimension > &refElement
129 = ReferenceElements< ctype, dimension>::general( insideGeo_.type() );
132 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
133 const FieldVector< ctype, dimension > &refNormal = refElement.integrationOuterNormal(
indexInInside() );
135 FieldVector< ctype, dimensionworld > normal;
136 jit.mv( refNormal, normal );
137 normal *= jit.detInv();
142 FieldVector< ctype, dimensionworld >
143 outerNormal (
const FieldVector< ctype, dimension-1 > &local )
const
145 const ReferenceElement< ctype, dimension > &refElement
146 = ReferenceElements< ctype, dimension>::general( insideGeo_.type() );
149 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
150 const FieldVector< ctype, dimension > &refNormal = refElement.integrationOuterNormal(
indexInInside() );
152 FieldVector< ctype, dimensionworld > normal;
153 jit.mv( refNormal, normal );
157 FieldVector< ctype, dimensionworld >
160 FieldVector< ctype, dimensionworld > normal =
outerNormal( local );
161 normal *= (
ctype( 1 ) / normal.two_norm());
168 = ReferenceElements< ctype, dimension-1 >::general(
type() );
175 return *hostIntersection_;
178 const Grid &
grid ()
const {
return insideGeo_.grid(); }
182 hostIntersection_ = 0;
183 geo_ = GeometryImpl(
grid() );
193 ElementGeometryImpl insideGeo_;
194 const HostIntersection *hostIntersection_;
195 mutable GeometryImpl geo_;
202 #endif // #ifndef DUNE_GEOGRID_INTERSECTION_HH