dune-fem  2.8-git
elementpointlist.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_ELEMENTPOINTLIST_HH
2 #define DUNE_FEM_ELEMENTPOINTLIST_HH
3 
6 
7 namespace Dune
8 {
9 
10  namespace Fem
11  {
12 
48  template< class GridPartImp, int codim, class IntegrationTraits >
50 
51 
52 
54  template< class GridPartImp, class IntegrationTraits >
55  class ElementIntegrationPointList< GridPartImp, 0, IntegrationTraits >
56  : public ElementPointListBase< GridPartImp, 0, IntegrationTraits >
57  {
60 
61  public:
64 
67 
72 
73  typedef typename Base :: IntegrationPointListType IntegrationPointListType;
74 
75  public:
76  using Base::localPoint;
77  using Base::nop;
78 
84  ElementIntegrationPointList( const GeometryType &geometry, const QuadratureKeyType& quadKey )
85  : Base( geometry, quadKey )
86  {}
87 
89  : Base( ipList )
90  {}
91 
92  const QuadraturePointWrapperType operator[] ( const size_t i ) const
93  {
94  return QuadraturePointWrapperType( *this, i );
95  }
96 
97  IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
98  IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
99 
101  const CoordinateType &point ( const size_t i ) const
102  {
103  return localPoint( i );
104  }
105  };
106 
107 
108 
110  template< class GridPartImp, class IntegrationTraits >
111  class ElementIntegrationPointList< GridPartImp, 1, IntegrationTraits >
112  : public ElementPointListBase< GridPartImp, 1, IntegrationTraits >
113  {
116 
117  public:
119  typedef GridPartImp GridPartType;
120 
121  static const int dimension = Base::dimension;
122 
125 
128 
130  typedef typename GridPartType::IntersectionIteratorType IntersectionIteratorType;
131  typedef typename IntersectionIteratorType::Intersection IntersectionType;
132 
137 
140 
141 
142  // for compatibility
143  typedef typename GridPartType::TwistUtilityType TwistUtilityType;
145 
146 
147  using Base::localPoint;
148  using Base::elementGeometry;
149  using Base::nop;
150 
163  const IntersectionType &intersection,
164  const QuadratureKeyType& quadKey,
165  const typename Base :: Side side )
166  : Base( getPointList( intersection, quadKey, side ) ),
167  referenceGeometry_( side == Base::INSIDE ? intersection.geometryInInside() : intersection.geometryInOutside() )
168  {}
169 
170  const QuadraturePointWrapperType operator[] ( size_t i ) const
171  {
172  return QuadraturePointWrapperType( *this, i );
173  }
174 
175  IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
176  IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
177 
180  const CoordinateType &point ( size_t i ) const
181  {
182  dummy_ = referenceGeometry_.global( localPoint( i ) );
183  return dummy_;
184  }
185 
186  using Base::localFaceIndex;
187 
188  protected:
189  Base getPointList ( const IntersectionType &intersection, const int order,
190  const typename Base :: Side side )
191  {
192  switch( side )
193  {
194  case Base :: INSIDE:
195  return Base( TwistUtilityType::elementGeometry( intersection, true ),
196  intersection.type(), intersection.indexInInside(), order );
197 
198  case Base ::OUTSIDE:
199  return Base( TwistUtilityType::elementGeometry( intersection, false ),
200  intersection.type(), intersection.indexInOutside(), order );
201 
202  default:
203  DUNE_THROW( InvalidStateException, "ElementIntegrationPointList: side must either be INSIDE or OUTSIDE." );
204  }
205  }
206 
207  private:
208  typedef typename IntersectionIteratorType::Intersection::LocalGeometry ReferenceGeometry;
209 
210  ReferenceGeometry referenceGeometry_;
211  mutable CoordinateType dummy_;
212  };
213 
214  } // namespace Fem
215 
216 } // namespace Dune
217 
218 #endif // #ifndef DUNE_FEM_ELEMENTPOINTLIST_HH
Definition: bindguard.hh:11
integration point list on the codim-0 reference element
Definition: elementpointlist.hh:49
QuadraturePointIterator< This > IteratorType
type of iterator
Definition: elementpointlist.hh:71
ElementIntegrationPointList(const IntegrationPointListType &ipList)
Definition: elementpointlist.hh:88
ElementIntegrationPointList(const GeometryType &geometry, const QuadratureKeyType &quadKey)
constructor
Definition: elementpointlist.hh:84
IteratorType end() const noexcept
Definition: elementpointlist.hh:98
Base::CoordinateType CoordinateType
type for coordinates in the codim-0 reference element
Definition: elementpointlist.hh:63
Base ::IntegrationPointListType IntegrationPointListType
Definition: elementpointlist.hh:73
IteratorType begin() const noexcept
Definition: elementpointlist.hh:97
const CoordinateType & point(const size_t i) const
obtain coordinates of i-th integration point
Definition: elementpointlist.hh:101
QuadraturePointWrapper< This > QuadraturePointWrapperType
type of the quadrature point
Definition: elementpointlist.hh:69
Base::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: elementpointlist.hh:66
This NonConformingQuadratureType
type quadrature for use on non-conforming intersections
Definition: elementpointlist.hh:139
Base::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: elementpointlist.hh:127
IntersectionIteratorType::Intersection IntersectionType
Definition: elementpointlist.hh:131
IntersectionIteratorType IntersectionIterator
Definition: elementpointlist.hh:144
const CoordinateType & point(size_t i) const
obtain coordinates of i-th integration point
Definition: elementpointlist.hh:180
Base getPointList(const IntersectionType &intersection, const int order, const typename Base ::Side side)
Definition: elementpointlist.hh:189
QuadraturePointIterator< This > IteratorType
type of iterator
Definition: elementpointlist.hh:136
Base::CoordinateType CoordinateType
Type of coordinates in codim-0 reference element.
Definition: elementpointlist.hh:124
QuadraturePointWrapper< This > QuadraturePointWrapperType
type of the quadrature point
Definition: elementpointlist.hh:134
IteratorType begin() const noexcept
Definition: elementpointlist.hh:175
GridPartImp GridPartType
type of the grid partition
Definition: elementpointlist.hh:119
GridPartType::IntersectionIteratorType IntersectionIteratorType
Type of the intersection iterator.
Definition: elementpointlist.hh:130
ElementIntegrationPointList(const GridPartType &gridPart, const IntersectionType &intersection, const QuadratureKeyType &quadKey, const typename Base ::Side side)
constructor
Definition: elementpointlist.hh:162
GridPartType::TwistUtilityType TwistUtilityType
Definition: elementpointlist.hh:143
IteratorType end() const noexcept
Definition: elementpointlist.hh:176
ElementPointListBase.
Definition: elementpointlistbase.hh:189
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:211
IntegrationPointListType ::QuadratureKeyType QuadratureKeyType
Definition: elementpointlistbase.hh:214
IntegrationPointListType ::QuadratureKeyType QuadratureKeyType
Definition: elementpointlistbase.hh:48
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:45
wrapper for a (Quadrature,int) pair
Definition: quadrature.hh:43
iterator over quadrature points
Definition: quadrature.hh:106