1#ifndef DUNE_FEM_GRIDPART_GEOGRIDPART_INTERSECTIONITERATOR_HH
2#define DUNE_FEM_GRIDPART_GEOGRIDPART_INTERSECTIONITERATOR_HH
8#include <dune/grid/common/intersectioniterator.hh>
10#include <dune/fem/gridpart/geogridpart/intersection.hh>
21 template<
class Gr
idFamily >
22 class GeoIntersectionIterator
24 typedef GeoIntersectionIterator< GridFamily > ThisType;
26 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
28 typedef typename Traits::CoordFunctionType CoordFunctionType;
29 typedef typename Traits::template Codim< 0 >::Geometry ElementGeometryType;
30 typedef typename Traits::HostGridPartType::IntersectionIteratorType HostIntersectionIteratorType;
32 typedef GeoIntersection< const GridFamily > IntersectionImplType;
37 template<
class Entity >
38 GeoIntersectionIterator (
const Entity &inside,
39 HostIntersectionIteratorType hostIterator )
40 : coordFunction_( &inside.impl().coordFunction() ),
41 insideGeo_( inside.geometry() ),
42 hostIterator_(
std::move( hostIterator ) )
45 GeoIntersectionIterator (
const GeoIntersectionIterator& other )
46 : coordFunction_( &other.coordFunction() ),
47 insideGeo_( other.insideGeo_ ),
48 hostIterator_( other.hostIterator_ )
51 GeoIntersectionIterator ( )
52 : coordFunction_( nullptr ),
56 GeoIntersectionIterator& operator= (
const GeoIntersectionIterator& other )
58 coordFunction_ = other.coordFunction_;
60 insideGeo_.emplace( *other.insideGeo_ );
61 hostIterator_ = other.hostIterator_ ;
65 bool equals (
const ThisType &other )
const
67 return hostIterator_ == other.hostIterator_;
75 Intersection dereference ()
const
78 return IntersectionImplType( coordFunction(), *insideGeo_, *hostIterator_ );
81 const CoordFunctionType &coordFunction ()
const
83 assert( coordFunction_ );
84 return *coordFunction_;
88 const CoordFunctionType *coordFunction_ =
nullptr;
89 std::optional< ElementGeometryType > insideGeo_;
90 HostIntersectionIteratorType hostIterator_;
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:587
Dune namespace.
Definition: alignedallocator.hh:13