dune-fem  2.4.1-rc
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 
66 
67  public:
68  using Base::localPoint;
69 
75  ElementIntegrationPointList( const GeometryType &geometry, int order )
76  : Base( geometry, order )
77  {}
78 
79  const QuadraturePointWrapperType operator[] ( const size_t i ) const
80  {
81  return QuadraturePointWrapperType( *this, i );
82  }
83 
85  const CoordinateType &point ( const size_t i ) const
86  {
87  return localPoint( i );
88  }
89  };
90 
91 
92 
94  template< class GridPartImp, class IntegrationTraits >
95  class ElementIntegrationPointList< GridPartImp, 1, IntegrationTraits >
96  : public ElementPointListBase< GridPartImp, 1, IntegrationTraits >
97  {
100 
101  public:
103  typedef GridPartImp GridPartType;
104 
105  static const int dimension = Base::dimension;
106 
109 
111  typedef typename GridPartType::IntersectionIteratorType IntersectionIteratorType;
112  typedef typename IntersectionIteratorType::Intersection IntersectionType;
113 
115 
118 
119 
120  // for compatibility
121  typedef typename GridPartType::TwistUtilityType TwistUtilityType;
122  typedef IntersectionIteratorType IntersectionIterator;
123 
124 
125  using Base::localPoint;
126  using Base::elementGeometry;
127 
139  ElementIntegrationPointList ( const GridPartType &gridPart,
140  const IntersectionType &intersection,
141  const int order,
142  const typename Base :: Side side )
143  : Base( getPointList( intersection, order, side ) ),
144  referenceGeometry_( side == Base::INSIDE ? intersection.geometryInInside() : intersection.geometryInOutside() )
145  {}
146 
147  const QuadraturePointWrapperType operator[] ( size_t i ) const
148  {
149  return QuadraturePointWrapperType( *this, i );
150  }
151 
154  const CoordinateType &point ( size_t i ) const
155  {
156  dummy_ = referenceGeometry_.global( localPoint( i ) );
157  return dummy_;
158  }
159 
160  protected:
161  using Base::localFaceIndex;
162 
163  protected:
164  Base getPointList ( const IntersectionType &intersection, const int order,
165  const typename Base :: Side side )
166  {
167  switch( side )
168  {
169  case Base :: INSIDE:
170  return Base( TwistUtilityType::elementGeometry( intersection, true ),
171  intersection.type(), intersection.indexInInside(), order );
172 
173  case Base ::OUTSIDE:
174  return Base( TwistUtilityType::elementGeometry( intersection, false ),
175  intersection.type(), intersection.indexInOutside(), order );
176 
177  default:
178  DUNE_THROW( InvalidStateException, "ElementIntegrationPointList: side must either be INSIDE or OUTSIDE." );
179  }
180  }
181 
182  private:
183  typedef typename IntersectionIteratorType::Intersection::LocalGeometry ReferenceGeometry;
184 
185  ReferenceGeometry referenceGeometry_;
186  mutable CoordinateType dummy_;
187  };
188 
189  } // namespace Fem
190 
191 } // namespace Dune
192 
193 #endif // #ifndef DUNE_FEM_ELEMENTPOINTLIST_HH
ElementIntegrationPointList(const GridPartType &gridPart, const IntersectionType &intersection, const int order, const typename Base::Side side)
constructor
Definition: elementpointlist.hh:139
IntersectionIteratorType IntersectionIterator
Definition: elementpointlist.hh:122
Base::CoordinateType CoordinateType
Type of coordinates in codim-0 reference element.
Definition: elementpointlist.hh:108
Side
inside and outside flags
Definition: elementpointlistbase.hh:163
const CoordinateType & point(const size_t i) const
obtain coordinates of i-th integration point
Definition: elementpointlist.hh:85
GridPartImp GridPartType
type of the grid partition
Definition: elementpointlist.hh:103
wrapper for a (Quadrature,int) pair
Definition: quadrature.hh:40
ElementPointListBase.
Definition: elementpointlistbase.hh:16
QuadraturePointWrapper< This > QuadraturePointWrapperType
Definition: elementpointlist.hh:65
GridPartType::TwistUtilityType TwistUtilityType
Definition: elementpointlist.hh:121
ElementIntegrationPointList(const GeometryType &geometry, int order)
constructor
Definition: elementpointlist.hh:75
This NonConformingQuadratureType
type quadrature for use on non-conforming intersections
Definition: elementpointlist.hh:117
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:177
Definition: coordinate.hh:4
integration point list on the codim-0 reference element
Definition: elementpointlist.hh:49
GridPartType::IntersectionIteratorType IntersectionIteratorType
Type of the intersection iterator.
Definition: elementpointlist.hh:111
Base::CoordinateType CoordinateType
type for coordinates in the codim-0 reference element
Definition: elementpointlist.hh:63
QuadraturePointWrapper< This > QuadraturePointWrapperType
Definition: elementpointlist.hh:114
IntersectionIteratorType::Intersection IntersectionType
Definition: elementpointlist.hh:112
const CoordinateType & point(size_t i) const
obtain coordinates of i-th integration point
Definition: elementpointlist.hh:154
Base getPointList(const IntersectionType &intersection, const int order, const typename Base::Side side)
Definition: elementpointlist.hh:164
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:43