dune-fem  2.4.1-rc
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 
9 
10 namespace Dune
11 {
12 
13  namespace Fem
14  {
15 
16  // IdIntersection
17  // --------------
18 
19  template< class GridFamily >
21  {
22  typedef typename std::remove_const< GridFamily >::type::Traits Traits;
23 
24  typedef typename Traits::HostGridPartType HostGridPartType;
25 
26  public:
27  typedef typename std::remove_const< GridFamily >::type::ctype ctype;
28 
29  static const int dimension = std::remove_const< GridFamily >::type::dimension;
30  static const int dimensionworld = std::remove_const< GridFamily >::type::dimensionworld;
31 
32  typedef typename Traits::template Codim< 0 >::Entity Entity;
33  typedef typename Traits::template Codim< 1 >::Geometry Geometry;
34  typedef typename Traits::template Codim< 1 >::LocalGeometry LocalGeometry;
35 
36  typedef typename Traits::ExtraData ExtraData;
37 
38  private:
39  typedef typename Entity::Implementation EntityImpl;
40 
41  typedef typename HostGridPartType::IntersectionType HostIntersectionType;
42 
43  public:
44  IdIntersection () = default;
45 
46  IdIntersection ( ExtraData data, HostIntersectionType hostIntersection )
47  : data_( std::move( data ) ),
48  hostIntersection_( std::move( hostIntersection ) )
49  {}
50 
51  Entity inside () const
52  {
53  return EntityImpl( data(), make_entity( hostIntersection().inside() ) );
54  }
55 
56  Entity outside () const
57  {
58  return EntityImpl( data(), make_entity( hostIntersection().outside() ) );
59  }
60 
61  bool boundary () const
62  {
63  return hostIntersection().boundary();
64  }
65 
66  bool conforming () const
67  {
68  return hostIntersection().conforming();
69  }
70 
71  int twistInSelf() const
72  {
73  return hostIntersection().impl().twistInSelf();
74  }
75 
76  int twistInNeighbor() const
77  {
78  return hostIntersection().impl().twistInNeighbor();
79  }
80 
81  bool neighbor () const
82  {
83  return hostIntersection().neighbor();
84  }
85 
86  int boundaryId () const
87  {
88  return hostIntersection().boundaryId();
89  }
90 
91  size_t boundarySegmentIndex () const
92  {
93  return hostIntersection().boundarySegmentIndex();
94  }
95 
96  LocalGeometry geometryInInside () const
97  {
99  }
100 
101  LocalGeometry geometryInOutside () const
102  {
104  }
105 
106  Geometry geometry () const
107  {
108  return Geometry( hostIntersection().geometry() );
109  }
110 
111  GeometryType type () const
112  {
113  return hostIntersection().type();
114  }
115 
116  int indexInInside () const
117  {
118  return hostIntersection().indexInInside();
119  }
120 
121  int indexInOutside () const
122  {
123  return hostIntersection().indexInOutside();
124  }
125 
126  FieldVector< ctype, dimensionworld >
127  integrationOuterNormal ( const FieldVector< ctype, dimension-1 > &local ) const
128  {
129  return hostIntersection().integrationOuterNormal( local );
130  }
131 
132  FieldVector< ctype, dimensionworld >
133  outerNormal ( const FieldVector< ctype, dimension-1 > &local ) const
134  {
135  return hostIntersection().outerNormal( local );
136  }
137 
138  FieldVector< ctype, dimensionworld >
139  unitOuterNormal ( const FieldVector< ctype, dimension-1 > &local ) const
140  {
141  return hostIntersection().unitOuterNormal( local );
142  }
143 
144  FieldVector< ctype, dimensionworld > centerUnitOuterNormal () const
145  {
146  return hostIntersection().centerUnitOuterNormal();
147  }
148 
149  const ExtraData &data () const { return data_; }
150 
151  const HostIntersectionType &hostIntersection () const
152  {
153  return hostIntersection_;
154  }
155 
156  protected:
157  ExtraData data_;
158  HostIntersectionType hostIntersection_;
159  };
160 
161  } // namespace Fem
162 
163 } // namespace Dune
164 
165 #endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTION_HH
FieldVector< ctype, dimensionworld > outerNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:133
ExtraData data_
Definition: idgridpart/intersection.hh:157
Definition: idgridpart/intersection.hh:20
FieldVector< ctype, dimensionworld > centerUnitOuterNormal() const
Definition: idgridpart/intersection.hh:144
size_t boundarySegmentIndex() const
Definition: idgridpart/intersection.hh:91
IdIntersection(ExtraData data, HostIntersectionType hostIntersection)
Definition: idgridpart/intersection.hh:46
Entity inside() const
Definition: idgridpart/intersection.hh:51
int twistInSelf() const
Definition: idgridpart/intersection.hh:71
HostIntersectionType hostIntersection_
Definition: idgridpart/intersection.hh:158
static const int dimensionworld
Definition: idgridpart/intersection.hh:30
Dune::EntityPointer< Grid, Implementation >::Entity make_entity(const Dune::EntityPointer< Grid, Implementation > &entityPointer)
Definition: compatibility.hh:23
FieldVector< ctype, dimensionworld > unitOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:139
Definition: coordinate.hh:4
Traits::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: idgridpart/intersection.hh:34
FieldVector< ctype, dimensionworld > integrationOuterNormal(const FieldVector< ctype, dimension-1 > &local) const
Definition: idgridpart/intersection.hh:127
Entity outside() const
Definition: idgridpart/intersection.hh:56
int indexInInside() const
Definition: idgridpart/intersection.hh:116
STL namespace.
Traits::template Codim< 1 >::Geometry Geometry
Definition: idgridpart/intersection.hh:33
int indexInOutside() const
Definition: idgridpart/intersection.hh:121
Traits::ExtraData ExtraData
Definition: idgridpart/intersection.hh:36
static const int dimension
Definition: idgridpart/intersection.hh:29
Geometry geometry() const
Definition: idgridpart/intersection.hh:106
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
GeometryType type() const
Definition: idgridpart/intersection.hh:111
int boundaryId() const
Definition: idgridpart/intersection.hh:86
const ExtraData & data() const
Definition: idgridpart/intersection.hh:149
const HostIntersectionType & hostIntersection() const
Definition: idgridpart/intersection.hh:151
LocalGeometry geometryInInside() const
Definition: idgridpart/intersection.hh:96
Traits::template Codim< 0 >::Entity Entity
Definition: idgridpart/intersection.hh:32
bool conforming() const
Definition: idgridpart/intersection.hh:66
int twistInNeighbor() const
Definition: idgridpart/intersection.hh:76
LocalGeometry geometryInOutside() const
Definition: idgridpart/intersection.hh:101
bool boundary() const
Definition: idgridpart/intersection.hh:61
std::remove_const< GridFamily >::type::ctype ctype
Definition: idgridpart/intersection.hh:27
bool neighbor() const
Definition: idgridpart/intersection.hh:81