Go to the documentation of this file.
3 #ifndef DUNE_GEOGRID_INTERSECTION_HH
4 #define DUNE_GEOGRID_INTERSECTION_HH
18 template<
class Gr
id,
class HostIntersection >
21 typedef typename HostIntersection::Geometry HostGeometry;
22 typedef typename HostIntersection::LocalGeometry HostLocalGeometry;
24 typedef typename std::remove_const< Grid >::type::Traits Traits;
27 typedef typename Traits::ctype
ctype;
32 typedef typename Traits::template Codim< 0 >::Entity
Entity;
33 typedef typename Traits::template Codim< 1 >::Geometry
Geometry;
34 typedef typename Traits::template Codim< 1 >::LocalGeometry
LocalGeometry;
41 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
43 typedef typename Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
44 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
53 , insideGeo_ ( insideGeo )
59 , insideGeo_ ( insideGeo )
65 return hostIntersection_ == other.hostIntersection_;
68 explicit operator bool ()
const {
return bool( hostIntersection_ ); }
106 geo_ = GeometryImpl(
grid(),
type(), coords );
123 FieldVector< ctype, dimensionworld >
129 auto refElement = referenceElement< ctype, dimension >( insideGeo_.type() );
131 FieldVector< ctype, dimension > x( geoInInside.global( local ) );
132 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
133 FieldVector< ctype, dimension > refNormal = refElement.integrationOuterNormal( idxInInside );
135 FieldVector< ctype, dimensionworld > normal;
136 jit.mv( refNormal, normal );
138 normal *= geoInInside.volume() / refElement.template geometry< 1 >( idxInInside ).volume();
139 normal *= jit.detInv();
144 FieldVector< ctype, dimensionworld >
145 outerNormal (
const FieldVector< ctype, dimension-1 > &local )
const
147 auto refElement = referenceElement< ctype, dimension >( insideGeo_.type() );
150 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
151 FieldVector< ctype, dimension > refNormal = refElement.integrationOuterNormal(
indexInInside() );
153 FieldVector< ctype, dimensionworld > normal;
154 jit.mv( refNormal, normal );
158 FieldVector< ctype, dimensionworld >
161 FieldVector< ctype, dimensionworld > normal =
outerNormal( local );
162 normal *= (
ctype( 1 ) / normal.two_norm());
174 return hostIntersection_;
177 const Grid &
grid ()
const {
return insideGeo_.grid(); }
180 HostIntersection hostIntersection_;
181 ElementGeometryImpl insideGeo_;
182 mutable GeometryImpl geo_;
189 #endif // #ifndef DUNE_GEOGRID_INTERSECTION_HH
Traits::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: geometrygrid/intersection.hh:34
int indexInOutside() const
Definition: geometrygrid/intersection.hh:118
Entity outside() const
Definition: geometrygrid/intersection.hh:75
bool equals(const Intersection &other) const
Definition: geometrygrid/intersection.hh:63
FieldVector< ctype, dimensionworld > unitOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:159
bool conforming() const
Definition: geometrygrid/intersection.hh:82
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Intersection(const HostIntersection &hostIntersection, const ElementGeometryImpl &insideGeo)
Definition: geometrygrid/intersection.hh:51
const HostIntersection & hostIntersection() const
Definition: geometrygrid/intersection.hh:172
LocalGeometry geometryInInside() const
Definition: geometrygrid/intersection.hh:91
Grid abstract base class.
Definition: common/grid.hh:373
int indexInInside() const
Definition: geometrygrid/intersection.hh:113
FieldVector< ctype, dimensionworld > integrationOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:124
bool boundary() const
Definition: geometrygrid/intersection.hh:80
Traits::template Codim< 0 >::Entity Entity
Definition: geometrygrid/intersection.hh:32
Traits::template Codim< 1 >::Geometry Geometry
Definition: geometrygrid/intersection.hh:33
FieldVector< ctype, dimensionworld > outerNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:145
Intersection()
Definition: geometrygrid/intersection.hh:48
bool neighbor() const
Definition: geometrygrid/intersection.hh:84
Intersection(HostIntersection &&hostIntersection, const ElementGeometryImpl &insideGeo)
Definition: geometrygrid/intersection.hh:57
LocalGeometry geometryInOutside() const
Definition: geometrygrid/intersection.hh:96
FieldVector< ctype, dimensionworld > centerUnitOuterNormal() const
Definition: geometrygrid/intersection.hh:166
Entity inside() const
Definition: geometrygrid/intersection.hh:70
static const int dimension
Definition: geometrygrid/intersection.hh:29
size_t boundarySegmentIndex() const
Definition: geometrygrid/intersection.hh:86
const Grid & grid() const
Definition: geometrygrid/intersection.hh:177
auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
Definition: common/geometry.hh:411
Definition: cornerstorage.hh:120
Geometry geometry() const
Definition: geometrygrid/intersection.hh:101
GeometryType type() const
Definition: geometrygrid/intersection.hh:111
Include standard header files.
Definition: agrid.hh:58
Definition: geometrygrid/intersection.hh:19
Traits::ctype ctype
Definition: geometrygrid/intersection.hh:27
Traits::template Codim< 0 >::Geometry ElementGeometry
Definition: geometrygrid/intersection.hh:36
static const int dimensionworld
Definition: geometrygrid/intersection.hh:30