dune-pdelab  2.0.0
geometrywrapper.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_GEOMETRYWRAPPER_HH
3 #define DUNE_PDELAB_GEOMETRYWRAPPER_HH
4 
5 #include <dune/common/fvector.hh>
6 
7 namespace Dune {
8  namespace PDELab {
9 
11 
14  template<typename E>
16  {
17  public:
19  typedef typename E::Geometry Geometry;
21  typedef E Entity;
22 
24  ElementGeometry (const E& e_)
25  : e(e_)
26  {}
27 
29  Geometry geometry () const
30  {
31  return e.geometry();
32  }
33 
35  const Entity& entity () const
36  {
37  return e;
38  }
39 
41  const Entity& hostEntity () const
42  {
43  return e;
44  }
45 
46  private:
47  const E& e;
48  };
49 
50 
52 
55  template<typename I>
57  {
58  public:
60  typedef typename I::Geometry Geometry;
62  typedef typename I::LocalGeometry LocalGeometry;
64  typedef typename I::Entity Entity;
66  typedef typename I::EntityPointer EntityPointer;
68  typedef typename Geometry::ctype ctype;
70  enum { dimension=Entity::dimension };
72  enum { dimensionworld=Geometry::dimensionworld };
73 
75  IntersectionGeometry (const I& i_, unsigned int index_)
76  : i(i_), index(index_)
77  {}
78 
80  int insideDomainIndex() const
81  {
82  return 0;
83  }
84 
86  int outsideDomainIndex() const
87  {
88  const bool is_boundary = i.boundary();
89  return 0 - int(is_boundary);
90  }
91 
93  bool boundary () const
94  {
95  return i.boundary();
96  }
97 
113  int boundaryId () const
114  {
115  return i.boundaryId();
116  }
117 
119  bool neighbor () const
120  {
121  return i.neighbor();
122  }
123 
132  {
133  return i.geometryInInside();
134  }
135 
144  {
145  return i.geometryInOutside();
146  }
147 
154  {
155  return i.geometry();
156  }
157 
159  int indexInInside () const
160  {
161  return i.indexInInside ();
162  }
163 
165  int indexInOutside () const
166  {
167  return i.indexInOutside ();
168  }
169 
174  Dune::FieldVector<ctype, dimensionworld> outerNormal (const Dune::FieldVector<ctype, dimension-1>& local) const
175  {
176  return i.outerNormal(local);
177  }
178 
185  Dune::FieldVector<ctype, dimensionworld> integrationOuterNormal (const Dune::FieldVector<ctype, dimension-1>& local) const
186  {
187  return i.integrationOuterNormal(local);
188  }
189 
195  Dune::FieldVector<ctype, dimensionworld> unitOuterNormal (const Dune::FieldVector<ctype, dimension-1>& local) const
196  {
197  return i.unitOuterNormal(local);
198  }
199 
205  Dune::FieldVector<ctype, dimensionworld> centerUnitOuterNormal () const
206  {
207  return i.centerUnitOuterNormal();
208  }
209 
214  {
215  return i.inside();
216  }
217 
222  {
223  DUNE_THROW(Dune::Exception,"This should never be called.");
224  return i.inside();
225  }
226 
234  {
235  return i.outside();
236  }
237 
239  const I& intersection () const
240  {
241  return i;
242  }
243 
244  unsigned int intersectionIndex() const
245  {
246  return index;
247  }
248 
249  private:
250  const I& i;
251  const unsigned int index;
252  };
253 
254  }
255 }
256 
257 #endif
int boundaryId() const
Identifier for boundary segment from macro grid.
Definition: geometrywrapper.hh:113
EntityPointer outside() const
return EntityPointer to the Entity on the outside of this intersection. That is the neighboring Entit...
Definition: geometrywrapper.hh:233
EntityPointer insideHostEntity() const
return EntityPointer to the Entity on the inside of this intersection. That is the Entity where we st...
Definition: geometrywrapper.hh:221
E Entity
Definition: geometrywrapper.hh:21
const Entity & hostEntity() const
Definition: geometrywrapper.hh:41
bool boundary() const
return true if intersection is with interior or exterior boundary (see the cases above) ...
Definition: geometrywrapper.hh:93
ElementGeometry(const E &e_)
Definition: geometrywrapper.hh:24
Definition: geometrywrapper.hh:70
unsigned int intersectionIndex() const
Definition: geometrywrapper.hh:244
const I & intersection() const
Definition: geometrywrapper.hh:239
Geometry geometry() const
Definition: geometrywrapper.hh:29
int insideDomainIndex() const
Definition: geometrywrapper.hh:80
Geometry::ctype ctype
Definition: geometrywrapper.hh:68
int indexInInside() const
Local number of codim 1 entity in the inside() Entity where intersection is contained in...
Definition: geometrywrapper.hh:159
const Entity & entity() const
Definition: geometrywrapper.hh:35
I::Geometry Geometry
Definition: geometrywrapper.hh:60
Geometry geometry() const
geometrical information about this intersection in global coordinates.
Definition: geometrywrapper.hh:153
I::Entity Entity
Definition: geometrywrapper.hh:64
int indexInOutside() const
Local number of codim 1 entity in outside() Entity where intersection is contained in...
Definition: geometrywrapper.hh:165
Dune::FieldVector< ctype, dimensionworld > integrationOuterNormal(const Dune::FieldVector< ctype, dimension-1 > &local) const
return outer normal scaled with the integration element
Definition: geometrywrapper.hh:185
LocalGeometry geometryInOutside() const
geometrical information about this intersection in local coordinates of the outside() entity...
Definition: geometrywrapper.hh:143
int outsideDomainIndex() const
Definition: geometrywrapper.hh:86
EntityPointer inside() const
return EntityPointer to the Entity on the inside of this intersection. That is the Entity where we st...
Definition: geometrywrapper.hh:213
IntersectionGeometry(const I &i_, unsigned int index_)
Definition: geometrywrapper.hh:75
LocalGeometry geometryInInside() const
geometrical information about this intersection in local coordinates of the inside() entity...
Definition: geometrywrapper.hh:131
Dune::FieldVector< ctype, dimensionworld > outerNormal(const Dune::FieldVector< ctype, dimension-1 > &local) const
Return an outer normal (length not necessarily 1)
Definition: geometrywrapper.hh:174
bool neighbor() const
return true if intersection is shared with another element.
Definition: geometrywrapper.hh:119
E::Geometry Geometry
Definition: geometrywrapper.hh:19
I::EntityPointer EntityPointer
Definition: geometrywrapper.hh:66
Dune::FieldVector< ctype, dimensionworld > centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: geometrywrapper.hh:205
Dune::FieldVector< ctype, dimensionworld > unitOuterNormal(const Dune::FieldVector< ctype, dimension-1 > &local) const
Return unit outer normal (length == 1)
Definition: geometrywrapper.hh:195
I::LocalGeometry LocalGeometry
Definition: geometrywrapper.hh:62
Wrap intersection.
Definition: geometrywrapper.hh:56
Wrap element.
Definition: geometrywrapper.hh:15