dune-fem  2.8-git
idgridpart/intersection.hh
Go to the documentation of this file.
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 
8 
9 namespace Dune
10 {
11 
12  namespace Fem
13  {
14 
15  // IdIntersection
16  // --------------
17 
18  template< class GridFamily >
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 EntityImpl( data(), hostIntersection().inside() );
53  }
54 
55  Entity outside () const
56  {
57  return 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 
96  {
98  }
99 
101  {
103  }
104 
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:
157  HostIntersectionType hostIntersection_;
158  };
159 
160  } // namespace Fem
161 
162 } // namespace Dune
163 
164 #endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTION_HH
Definition: bindguard.hh:11
Definition: idgridpart/intersection.hh:20
FieldVector< ctype, dimensionworld > unitOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:138
size_t boundarySegmentIndex() const
Definition: idgridpart/intersection.hh:90
Traits::ExtraData ExtraData
Definition: idgridpart/intersection.hh:35
HostIntersectionType hostIntersection_
Definition: idgridpart/intersection.hh:157
int twistInNeighbor() const
Definition: idgridpart/intersection.hh:75
Traits::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: idgridpart/intersection.hh:33
FieldVector< ctype, dimensionworld > integrationOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:126
bool boundary() const
Definition: idgridpart/intersection.hh:60
Geometry geometry() const
Definition: idgridpart/intersection.hh:105
bool neighbor() const
Definition: idgridpart/intersection.hh:80
Traits::template Codim< 1 >::Geometry Geometry
Definition: idgridpart/intersection.hh:32
std::remove_const< GridFamily >::type::ctype ctype
Definition: idgridpart/intersection.hh:26
FieldVector< ctype, dimensionworld > outerNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:132
const ExtraData & data() const
Definition: idgridpart/intersection.hh:148
GeometryType type() const
Definition: idgridpart/intersection.hh:110
const HostIntersectionType & hostIntersection() const
Definition: idgridpart/intersection.hh:150
ExtraData data_
Definition: idgridpart/intersection.hh:156
bool conforming() const
Definition: idgridpart/intersection.hh:65
int indexInInside() const
Definition: idgridpart/intersection.hh:115
int twistInSelf() const
Definition: idgridpart/intersection.hh:70
IdIntersection(ExtraData data, HostIntersectionType hostIntersection)
Definition: idgridpart/intersection.hh:45
int indexInOutside() const
Definition: idgridpart/intersection.hh:120
Entity inside() const
Definition: idgridpart/intersection.hh:50
static const int dimension
Definition: idgridpart/intersection.hh:28
Entity outside() const
Definition: idgridpart/intersection.hh:55
FieldVector< ctype, dimensionworld > centerUnitOuterNormal() const
Definition: idgridpart/intersection.hh:143
static const int dimensionworld
Definition: idgridpart/intersection.hh:29
Traits::template Codim< 0 >::Entity Entity
Definition: idgridpart/intersection.hh:31
int boundaryId() const
Definition: idgridpart/intersection.hh:85
LocalGeometry geometryInInside() const
Definition: idgridpart/intersection.hh:95
LocalGeometry geometryInOutside() const
Definition: idgridpart/intersection.hh:100