5 #ifndef DUNE_GEOGRID_INTERSECTION_HH 6 #define DUNE_GEOGRID_INTERSECTION_HH 20 template<
class Gr
id,
class HostIntersection >
24 typedef typename HostIntersection::LocalGeometry HostLocalGeometry;
26 typedef typename std::remove_const< Grid >::type::Traits Traits;
29 typedef typename Traits::ctype
ctype;
36 typedef typename Traits::template Codim< 1 >::LocalGeometry
LocalGeometry;
43 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
45 typedef typename Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
46 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
55 , insideGeo_ ( insideGeo )
61 , insideGeo_ ( insideGeo )
67 return hostIntersection_ == other.hostIntersection_;
70 explicit operator bool ()
const {
return bool( hostIntersection_ ); }
108 geo_ = GeometryImpl(
grid(),
type(), coords );
125 FieldVector< ctype, dimensionworld >
131 auto refElement = referenceElement< ctype, dimension >( insideGeo_.type() );
133 FieldVector< ctype, dimension > x( geoInInside.global( local ) );
134 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
135 FieldVector< ctype, dimension > refNormal = refElement.integrationOuterNormal( idxInInside );
137 FieldVector< ctype, dimensionworld > normal;
138 jit.mv( refNormal, normal );
140 normal *= geoInInside.volume() / refElement.template geometry< 1 >( idxInInside ).volume();
141 normal *= jit.detInv();
146 FieldVector< ctype, dimensionworld >
147 outerNormal (
const FieldVector< ctype, dimension-1 > &local )
const 149 auto refElement = referenceElement< ctype, dimension >( insideGeo_.type() );
152 const typename ElementGeometryImpl::JacobianInverseTransposed &jit = insideGeo_.jacobianInverseTransposed( x );
153 FieldVector< ctype, dimension > refNormal = refElement.integrationOuterNormal(
indexInInside() );
155 FieldVector< ctype, dimensionworld > normal;
156 jit.mv( refNormal, normal );
160 FieldVector< ctype, dimensionworld >
163 FieldVector< ctype, dimensionworld > normal =
outerNormal( local );
164 normal *= (
ctype( 1 ) / normal.two_norm());
176 return hostIntersection_;
179 const Grid &
grid ()
const {
return insideGeo_.grid(); }
182 HostIntersection hostIntersection_;
183 ElementGeometryImpl insideGeo_;
184 mutable GeometryImpl geo_;
191 #endif // #ifndef DUNE_GEOGRID_INTERSECTION_HH concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
Definition: geometrygrid/intersection.hh:21
Traits::ctype ctype
Definition: geometrygrid/intersection.hh:29
FieldVector< ctype, dimensionworld > outerNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:147
FieldVector< ctype, dimensionworld > integrationOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:126
bool neighbor() const
Definition: geometrygrid/intersection.hh:86
FieldVector< ctype, dimensionworld > unitOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: geometrygrid/intersection.hh:161
int indexInInside() const
Definition: geometrygrid/intersection.hh:115
LocalGeometry geometryInInside() const
Definition: geometrygrid/intersection.hh:93
Traits::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: geometrygrid/intersection.hh:36
bool boundary() const
Definition: geometrygrid/intersection.hh:82
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:375
GeometryType type() const
Definition: geometrygrid/intersection.hh:113
static const int dimensionworld
Definition: geometrygrid/intersection.hh:32
concept Geometry
Model of a geometry object.
Definition: concepts/geometry.hh:29
Entity inside() const
Definition: geometrygrid/intersection.hh:72
Entity outside() const
Definition: geometrygrid/intersection.hh:77
Intersection(HostIntersection &&hostIntersection, const ElementGeometryImpl &insideGeo)
Definition: geometrygrid/intersection.hh:59
const Grid & grid() const
Definition: geometrygrid/intersection.hh:179
Intersection()
Definition: geometrygrid/intersection.hh:50
bool conforming() const
Definition: geometrygrid/intersection.hh:84
auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
Definition: common/geometry.hh:558
LocalGeometry geometryInOutside() const
Definition: geometrygrid/intersection.hh:98
Include standard header files.
Definition: agrid.hh:59
int indexInOutside() const
Definition: geometrygrid/intersection.hh:120
size_t boundarySegmentIndex() const
Definition: geometrygrid/intersection.hh:88
FieldVector< ctype, dimensionworld > centerUnitOuterNormal() const
Definition: geometrygrid/intersection.hh:168
Definition: cornerstorage.hh:122
Geometry geometry() const
Definition: geometrygrid/intersection.hh:103
const HostIntersection & hostIntersection() const
Definition: geometrygrid/intersection.hh:174
Intersection(const HostIntersection &hostIntersection, const ElementGeometryImpl &insideGeo)
Definition: geometrygrid/intersection.hh:53
Traits::template Codim< 1 >::Geometry Geometry
Definition: geometrygrid/intersection.hh:35
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Traits::template Codim< 0 >::Geometry ElementGeometry
Definition: geometrygrid/intersection.hh:38
static const int dimension
Definition: geometrygrid/intersection.hh:31
bool equals(const Intersection &other) const
Definition: geometrygrid/intersection.hh:65
Traits::template Codim< 0 >::Entity Entity
Definition: geometrygrid/intersection.hh:34