DUNE-FEM (unstable)

intersection.hh
1#ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTION_HH
2#define DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTION_HH
3
4#include <type_traits>
5#include <utility>
6
7#include <dune/fem/gridpart/idgridpart/geometry.hh>
8
9namespace Dune
10{
11
12 namespace Fem
13 {
14
15 // IdIntersection
16 // --------------
17
18 template< class GridFamily >
19 class IdIntersection
20 {
21 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
22
23 typedef typename Traits::HostGridPartType HostGridPartType;
24
25 public:
26 typedef typename std::remove_const< GridFamily >::type::ctype ctype;
27
28 static const int dimension = std::remove_const< GridFamily >::type::dimension;
29 static const int dimensionworld = std::remove_const< GridFamily >::type::dimensionworld;
30
31 typedef typename Traits::template Codim< 0 >::Entity Entity;
32 typedef typename Traits::template Codim< 1 >::Geometry Geometry;
33 typedef typename Traits::template Codim< 1 >::LocalGeometry LocalGeometry;
34
35 typedef typename Traits::ExtraData ExtraData;
36
37 private:
38 typedef typename Entity::Implementation EntityImpl;
39
40 typedef typename HostGridPartType::IntersectionType HostIntersectionType;
41
42 public:
43 IdIntersection () = default;
44
45 IdIntersection ( ExtraData data, HostIntersectionType hostIntersection )
46 : data_( std::move( data ) ),
47 hostIntersection_( std::move( hostIntersection ) )
48 {}
49
50 Entity inside () const
51 {
52 return Entity( EntityImpl( data(), hostIntersection().inside() ) );
53 }
54
55 Entity outside () const
56 {
57 return Entity( EntityImpl( data(), hostIntersection().outside() ) );
58 }
59
60 bool boundary () const
61 {
62 return hostIntersection().boundary();
63 }
64
65 bool conforming () const
66 {
67 return hostIntersection().conforming();
68 }
69
70 int twistInSelf() const
71 {
72 return hostIntersection().impl().twistInSelf();
73 }
74
75 int twistInNeighbor() const
76 {
77 return hostIntersection().impl().twistInNeighbor();
78 }
79
80 bool neighbor () const
81 {
82 return hostIntersection().neighbor();
83 }
84
85 int boundaryId () const
86 {
87 return hostIntersection().boundaryId();
88 }
89
90 size_t boundarySegmentIndex () const
91 {
92 return hostIntersection().boundarySegmentIndex();
93 }
94
95 LocalGeometry geometryInInside () const
96 {
97 return LocalGeometry( hostIntersection().geometryInInside() );
98 }
99
100 LocalGeometry geometryInOutside () const
101 {
102 return LocalGeometry( hostIntersection().geometryInOutside() );
103 }
104
105 Geometry geometry () const
106 {
107 return Geometry( hostIntersection().geometry() );
108 }
109
110 GeometryType type () const
111 {
112 return hostIntersection().type();
113 }
114
115 int indexInInside () const
116 {
117 return hostIntersection().indexInInside();
118 }
119
120 int indexInOutside () const
121 {
122 return hostIntersection().indexInOutside();
123 }
124
125 FieldVector< ctype, dimensionworld >
126 integrationOuterNormal ( const FieldVector< ctype, dimension-1 > &local ) const
127 {
128 return hostIntersection().integrationOuterNormal( local );
129 }
130
131 FieldVector< ctype, dimensionworld >
132 outerNormal ( const FieldVector< ctype, dimension-1 > &local ) const
133 {
134 return hostIntersection().outerNormal( local );
135 }
136
137 FieldVector< ctype, dimensionworld >
138 unitOuterNormal ( const FieldVector< ctype, dimension-1 > &local ) const
139 {
140 return hostIntersection().unitOuterNormal( local );
141 }
142
143 FieldVector< ctype, dimensionworld > centerUnitOuterNormal () const
144 {
145 return hostIntersection().centerUnitOuterNormal();
146 }
147
148 const ExtraData &data () const { return data_; }
149
150 const HostIntersectionType &hostIntersection () const
151 {
152 return hostIntersection_;
153 }
154
155 protected:
156 ExtraData data_;
157 HostIntersectionType hostIntersection_;
158 };
159
160 } // namespace Fem
161
162} // namespace Dune
163
164#endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTION_HH
EntityImp< cd, dim, GridImp > Implementation
type of underlying implementation
Definition: entity.hh:73
@ conforming
Output conforming data.
Definition: common.hh:73
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Dune namespace.
Definition: alignedallocator.hh:13
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)