1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTION_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTION_HH
8#include <dune/grid/common/intersection.hh>
19 template<
class Filter,
class HostIntersection >
20 class FilteredGridPartIntersection
22 typedef FilteredGridPartIntersection< Filter, HostIntersection > ThisType;
25 typedef Filter FilterType;
26 typedef HostIntersection HostIntersectionType;
28 static const int dimensionworld = HostIntersectionType::dimensionworld;
29 static const int mydimension = HostIntersectionType::mydimension;
31 typedef typename HostIntersectionType::ctype ctype;
33 typedef typename HostIntersectionType::Entity Entity;
34 typedef typename HostIntersectionType::Geometry Geometry;
35 typedef typename HostIntersectionType::LocalGeometry LocalGeometry;
37 typedef typename HostIntersectionType::LocalCoordinate LocalCoordinate;
38 typedef typename HostIntersectionType::GlobalCoordinate GlobalCoordinate;
40 FilteredGridPartIntersection () =
default;
42 FilteredGridPartIntersection (
const FilterType &filter, HostIntersectionType hostIntersection )
43 : hostIntersection_(
std::move( hostIntersection ) ),
44 neighbor_( hostIntersection_.neighbor() ),
45 boundary_( !neighbor_ )
49 if( !filter.interiorIntersection( hostIntersection_ ) )
51 neighbor_ = filter.intersectionNeighbor( hostIntersection_ );
52 boundary_ = filter.intersectionBoundary( hostIntersection_ );
53 boundaryId_ = filter.intersectionBoundaryId( hostIntersection_ );
57 boundaryId_ = filter.intersectionBoundaryId( hostIntersection_ );
60 bool equals (
const ThisType &other )
const {
return (hostIntersection() == other.hostIntersection()); }
62 bool boundary ()
const {
return boundary_; }
63 bool neighbor ()
const {
return neighbor_; }
65 int boundaryId ()
const {
return boundaryId_; }
67 std::size_t boundarySegmentIndex ()
const
69 DUNE_THROW( NotImplemented,
"boundarySegmentIndex not implemented for FilteredGridPart, yet" );
72 Entity inside ()
const {
return hostIntersection().inside(); }
73 Entity outside ()
const {
return hostIntersection().outside(); }
75 bool conforming ()
const {
return hostIntersection().conforming(); }
77 LocalGeometry geometryInInside ()
const {
return hostIntersection().geometryInInside(); }
78 LocalGeometry geometryInOutside ()
const {
return hostIntersection().geometryInOutside(); }
80 Geometry geometry ()
const {
return hostIntersection().geometry(); }
81 GeometryType type ()
const {
return hostIntersection().type(); }
83 int indexInInside ()
const {
return hostIntersection().indexInInside(); }
84 int indexInOutside ()
const {
return hostIntersection().indexInOutside(); }
86 GlobalCoordinate outerNormal (
const LocalCoordinate & local )
const {
return hostIntersection().outerNormal( local ); }
87 GlobalCoordinate integrationOuterNormal (
const LocalCoordinate & local )
const {
return hostIntersection().integrationOuterNormal( local ); }
88 GlobalCoordinate unitOuterNormal (
const LocalCoordinate & local )
const {
return hostIntersection().unitOuterNormal( local ); }
89 GlobalCoordinate centerUnitOuterNormal ()
const {
return hostIntersection().centerUnitOuterNormal(); }
91 const HostIntersectionType &hostIntersection ()
const {
return hostIntersection_; }
94 HostIntersectionType hostIntersection_;
95 bool neighbor_ =
false;
96 bool boundary_ =
false;
A few common exception classes.
@ conforming
Output conforming data.
Definition: common.hh:73
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr auto equals
Function object for performing equality comparison.
Definition: hybridutilities.hh:572
Dune namespace.
Definition: alignedallocator.hh:13