DUNE-FEM (unstable)

elementpointlist.hh
1 #ifndef DUNE_FEM_ELEMENTPOINTLIST_HH
2 #define DUNE_FEM_ELEMENTPOINTLIST_HH
3 
4 #include <dune/fem/quadrature/elementpointlistbase.hh>
5 #include <dune/fem/quadrature/caching/twistutility.hh>
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:
63  typedef typename Base::CoordinateType CoordinateType;
64 
66  typedef typename Base::QuadratureKeyType QuadratureKeyType;
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 
88  ElementIntegrationPointList( const IntegrationPointListType& ipList )
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 
124  typedef typename Base::CoordinateType CoordinateType;
125 
127  typedef typename Base::QuadratureKeyType QuadratureKeyType;
128 
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  side_(side),
168  intersection_(intersection),
169  referenceGeometry_( side == Base::INSIDE ? intersection.geometryInInside() : intersection.geometryInOutside())
170  {}
171 
172  const QuadraturePointWrapperType operator[] ( size_t i ) const
173  {
174  return QuadraturePointWrapperType( *this, i );
175  }
176 
177  IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
178  IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
179  typename Base :: Side side() const { return side_; }
180  bool isInside() const { return side_ == Base::INSIDE; }
181 
184  const CoordinateType &point ( size_t i ) const
185  {
186  dummy_ = referenceGeometry_.global( localPoint( i ) );
187  return dummy_;
188  }
189 
190  using Base::localFaceIndex;
191 
192  const IntersectionType &intersection() const
193  {
194  return intersection_;
195  }
196 
197  protected:
198  Base getPointList ( const IntersectionType &intersection, const int order,
199  const typename Base :: Side side )
200  {
201  switch( side )
202  {
203  case Base :: INSIDE:
204  return Base( TwistUtilityType::elementGeometry( intersection, true ),
205  intersection.type(), intersection.indexInInside(), order );
206 
207  case Base ::OUTSIDE:
208  return Base( TwistUtilityType::elementGeometry( intersection, false ),
209  intersection.type(), intersection.indexInOutside(), order );
210 
211  default:
212  DUNE_THROW( InvalidStateException, "ElementIntegrationPointList: side must either be INSIDE or OUTSIDE." );
213  }
214  }
215 
216  private:
217  typedef typename IntersectionIteratorType::Intersection::LocalGeometry ReferenceGeometry;
218 
219  const typename Base :: Side side_;
220  const IntersectionType &intersection_;
221  ReferenceGeometry referenceGeometry_;
222  mutable CoordinateType dummy_;
223  };
224 
225  } // namespace Fem
226 
227 } // namespace Dune
228 
229 #endif // #ifndef DUNE_FEM_ELEMENTPOINTLIST_HH
QuadraturePointIterator< This > IteratorType
type of iterator
Definition: elementpointlist.hh:71
ElementIntegrationPointList(const GeometryType &geometry, const QuadratureKeyType &quadKey)
constructor
Definition: elementpointlist.hh:84
Base::CoordinateType CoordinateType
type for coordinates in the codim-0 reference element
Definition: elementpointlist.hh:63
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
const CoordinateType & point(size_t i) const
obtain coordinates of i-th integration point
Definition: elementpointlist.hh:184
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
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
integration point list on the codim-0 reference element
Definition: elementpointlist.hh:49
ElementPointListBase.
Definition: elementpointlistbase.hh:189
Traits::TwistUtilityType TwistUtilityType
Twist utility type.
Definition: gridpart.hh:102
Traits::IntersectionIteratorType IntersectionIteratorType
type of IntersectionIterator
Definition: gridpart.hh:111
iterator over quadrature points
Definition: quadrature.hh:103
wrapper for a (Quadrature,int) pair
Definition: quadrature.hh:42
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:281
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
concept Intersection
Model of an intersection.
Definition: intersection.hh:23
concept IntersectionIterator
Model of an intersection iterator.
Definition: intersectioniterator.hh:21
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 16, 22:29, 2024)