DUNE-FEM (unstable)

intersectionquadrature.hh
1#ifndef DUNE_FEM_INTERSECTIONQUADRATURE_HH
2#define DUNE_FEM_INTERSECTIONQUADRATURE_HH
3
4//- Dune includes
5#include <dune/common/math.hh>
6
7//- Local includes
8#include "elementquadrature.hh"
9#include "caching/twistutility.hh"
10#include "caching/pointmapper.hh"
11#include "caching/cacheprovider.hh"
12
13#include "elementquadrature.hh"
14#include "cachingquadrature.hh"
15
16namespace Dune
17{
18
19 namespace Fem
20 {
21
24 template< typename FaceQuadrature, bool conforming >
26 {
27 template < typename FaceQuadratureImp, bool isConforming >
28 struct QuadSelector
29 {
30 // use given quadrature
31 typedef FaceQuadratureImp FaceQuadratureType;
32 };
33
34 template < typename FaceQuadratureImp >
35 struct QuadSelector<FaceQuadratureImp, false>
36 {
37 // in this case non conforming type is used
38 typedef typename FaceQuadratureImp ::
39 NonConformingQuadratureType FaceQuadratureType;
40 };
41
42 public:
44 typedef typename FaceQuadrature :: GridPartType GridPartType;
45
48 typedef typename IntersectionIteratorType::Intersection IntersectionType;
49
51 enum { codimension = FaceQuadrature :: codimension };
52
54 typedef typename QuadSelector<FaceQuadrature, conforming> :: FaceQuadratureType FaceQuadratureType;
55
57 enum { dimension = FaceQuadratureType ::dimension };
58
60 typedef typename FaceQuadratureType :: RealType RealType;
62 typedef typename FaceQuadratureType :: CoordinateType CoordinateType;
63
64 typedef typename FaceQuadratureType::LocalCoordinateType LocalCoordinateType;
65
66 // for compatibility
67 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
68
78 const IntersectionType &intersection,
79 const int order)
80 : inside_ ( gridPart, intersection, order, FaceQuadratureType::INSIDE ),
81 outside_( gridPart, intersection, order, intersection.neighbor() ? FaceQuadratureType::OUTSIDE : FaceQuadratureType::INSIDE )
82 {}
83
95 const IntersectionType &intersection,
96 const int order,
97 const bool noNeighborCheck )
98 : inside_ ( gridPart, intersection, order, FaceQuadratureType::INSIDE ),
99 outside_( gridPart, intersection, order, FaceQuadratureType::OUTSIDE )
100 {
101 // make sure neighbor is true
102 assert( intersection.neighbor() );
103 }
104
106 const FaceQuadratureType& inside() const { return inside_; }
107
109 const FaceQuadratureType& outside() const { return outside_; }
110
111 size_t nop () const
112 {
113 assert( inside().nop() == outside().nop() );
114 return inside().nop();
115 }
116
117 const LocalCoordinateType &localPoint ( const int qp ) const
118 {
119 assert( inside().localPoint( qp ) == outside().localPoint( qp ) );
120 return inside().localPoint( qp );
121 }
122
123 auto weight ( const int qp ) const
124 {
125 assert( inside().weight( qp ) == outside().weight( qp ) );
126 return inside().weight( qp );
127 }
128
130
131 protected:
132 const FaceQuadratureType inside_;
133 const FaceQuadratureType outside_;
134 };
135
136 } // namespace Fem
137
138} // namespace Dune
139
140#endif // #ifndef DUNE_FEM_INTERSECTIONQUADRATURE_HH
Traits::IntersectionIteratorType IntersectionIteratorType
type of intersection iterator
Definition: adaptiveleafgridpart.hh:92
IntersectionQuadrature is a helper class for creating the appropriate face quadratures for integratin...
Definition: intersectionquadrature.hh:26
const FaceQuadratureType & inside() const
return reference to inside face quadrature
Definition: intersectionquadrature.hh:106
FaceQuadrature::GridPartType GridPartType
type of grid partition
Definition: intersectionquadrature.hh:44
FaceQuadratureType::CoordinateType CoordinateType
The type of the coordinates in the codim-0 reference element.
Definition: intersectionquadrature.hh:62
QuadSelector< FaceQuadrature, conforming >::FaceQuadratureType FaceQuadratureType
type of intersection quadrature implementation
Definition: intersectionquadrature.hh:54
GridPartType::IntersectionIteratorType IntersectionIteratorType
Type of the intersection iterator.
Definition: intersectionquadrature.hh:47
FaceQuadratureType::RealType RealType
Just another name for double...
Definition: intersectionquadrature.hh:60
const FaceQuadratureType & outside() const
return reference to outside face quadrature
Definition: intersectionquadrature.hh:109
IntersectionQuadrature(const GridPartType &gridPart, const IntersectionType &intersection, const int order, const bool noNeighborCheck)
Constructor creating an inside and an outside face quadrature for integrating over an intersection.
Definition: intersectionquadrature.hh:94
IntersectionQuadrature(const GridPartType &gridPart, const IntersectionType &intersection, const int order)
Constructor creating an inside and an outside face quadrature for integrating over an intersection.
Definition: intersectionquadrature.hh:77
Some useful basic math stuff.
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)