DUNE-FEM (unstable)

intersection.hh
1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTION_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTION_HH
3
4#include <utility>
5
7
8#include <dune/grid/common/intersection.hh>
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // FilteredGridPartIntersection
17 // ----------------------------
18
19 template< class Filter, class HostIntersection >
20 class FilteredGridPartIntersection
21 {
22 typedef FilteredGridPartIntersection< Filter, HostIntersection > ThisType;
23
24 public:
25 typedef Filter FilterType;
26 typedef HostIntersection HostIntersectionType;
27
28 static const int dimensionworld = HostIntersectionType::dimensionworld;
29 static const int mydimension = HostIntersectionType::mydimension;
30
31 typedef typename HostIntersectionType::ctype ctype;
32
33 typedef typename HostIntersectionType::Entity Entity;
34 typedef typename HostIntersectionType::Geometry Geometry;
35 typedef typename HostIntersectionType::LocalGeometry LocalGeometry;
36
37 typedef typename HostIntersectionType::LocalCoordinate LocalCoordinate;
38 typedef typename HostIntersectionType::GlobalCoordinate GlobalCoordinate;
39
40 FilteredGridPartIntersection () = default;
41
42 FilteredGridPartIntersection ( const FilterType &filter, HostIntersectionType hostIntersection )
43 : hostIntersection_( std::move( hostIntersection ) ),
44 neighbor_( hostIntersection_.neighbor() ),
45 boundary_( !neighbor_ )
46 {
47 if( neighbor_ )
48 {
49 if( !filter.interiorIntersection( hostIntersection_ ) )
50 {
51 neighbor_ = filter.intersectionNeighbor( hostIntersection_ );
52 boundary_ = filter.intersectionBoundary( hostIntersection_ );
53 boundaryId_ = filter.intersectionBoundaryId( hostIntersection_ );
54 }
55 }
56 else
57 boundaryId_ = filter.intersectionBoundaryId( hostIntersection_ );
58 }
59
60 bool equals ( const ThisType &other ) const { return (hostIntersection() == other.hostIntersection()); }
61
62 bool boundary () const { return boundary_; }
63 bool neighbor () const { return neighbor_; }
64
65 int boundaryId () const { return boundaryId_; }
66
67 std::size_t boundarySegmentIndex () const
68 {
69 DUNE_THROW( NotImplemented, "boundarySegmentIndex not implemented for FilteredGridPart, yet" );
70 }
71
72 Entity inside () const { return hostIntersection().inside(); }
73 Entity outside () const { return hostIntersection().outside(); }
74
75 bool conforming () const { return hostIntersection().conforming(); }
76
77 LocalGeometry geometryInInside () const { return hostIntersection().geometryInInside(); }
78 LocalGeometry geometryInOutside () const { return hostIntersection().geometryInOutside(); }
79
80 Geometry geometry () const { return hostIntersection().geometry(); }
81 GeometryType type () const { return hostIntersection().type(); }
82
83 int indexInInside () const { return hostIntersection().indexInInside(); }
84 int indexInOutside () const { return hostIntersection().indexInOutside(); }
85
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(); }
90
91 const HostIntersectionType &hostIntersection () const { return hostIntersection_; }
92
93 private:
94 HostIntersectionType hostIntersection_;
95 bool neighbor_ = false;
96 bool boundary_ = false;
97 int boundaryId_ = 0;
98 };
99
100 } // namespace Fem
101
102} // namespace Dune
103
104#endif // #ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTION_HH
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
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)