dune-fem  2.8-git
cornerpointset.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_CORNERPOINTSET_HH
2 #define DUNE_FEM_CORNERPOINTSET_HH
3 
4 #include <dune/geometry/referenceelements.hh>
5 
7 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
14  // Internal Forward Declarations
15  // -----------------------------
16 
17  template< class GridPart >
18  class CornerPointSet;
19 
20  template< class ct, Dune::GeometryType::Id geometryId >
21  class CornerPointList;
22 
23 
24 
25  // CornerPointSetTraits
26  // --------------------
27 
28  template< class GridPart >
30  {
31  template< class ct, int dim >
32  class PointListTraits;
33 
34  public:
38  };
39 
40 
41 
42  // CornerPointSetTraits::PointListTraits
43  // -------------------------------------
44 
45  template< class GridPart >
46  template< class ct, int dim >
47  class CornerPointSetTraits< GridPart >::PointListTraits
48  {
49  static const int pdim = (dim > 0 ? dim : 1);
50 
51  public:
53 
54  static constexpr Dune::GeometryType::Id simplexId = Dune::GeometryTypes::simplex(dim);
55  static constexpr Dune::GeometryType::Id cubeId = Dune::GeometryTypes::cube(dim);
56  static constexpr Dune::GeometryType::Id prismId = Dune::GeometryTypes::prism ;
57  static constexpr Dune::GeometryType::Id pyramidId = Dune::GeometryTypes::pyramid;
58 
59  typedef CornerPointList< ct, simplexId > SimplexQuadratureType;
60  typedef CornerPointList< ct, cubeId > CubeQuadratureType;
61  typedef CornerPointList< ct, prismId > PrismQuadratureType;
62  typedef CornerPointList< ct, pyramidId > PyramidQuadratureType;
63 
64  typedef SimplexQuadratureType PointQuadratureType;
65  typedef SimplexQuadratureType LineQuadratureType;
66 
67  typedef int QuadratureKeyType ;
68  };
69 
70 
71 
72  // CornerPointSet
73  // --------------
74 
75  template< class GridPart >
77  : public CachingPointList< GridPart, 0, CornerPointSetTraits< GridPart > >
78  {
80 
81  public:
82  CornerPointSet ( const GeometryType &type )
83  : BaseType( type, 1 )
84  {
85  // assert( ! type.isNone() );
86  }
87 
88  CornerPointSet ( const typename GridPart::template Codim< 0 >::EntityType &entity )
89  : CornerPointSet( entity.type() )
90  {
91  }
92  };
93 
94 
95 
96  // CornerPointList
97  // ---------------
98 
99  template< class ct, Dune::GeometryType::Id geometryId >
101  : public IntegrationPointListImp< ct, Dune::GeometryType(geometryId).dim() >
102  {
103  typedef IntegrationPointListImp< ct, Dune::GeometryType(geometryId).dim() > BaseType;
104 
105  public:
107 
108  explicit CornerPointList ( const size_t id );
109  CornerPointList ( const GeometryType &type, const int order, const size_t id );
110 
111  int order () const { return 1; }
112 
113  static unsigned int maxOrder () { return 1; }
114 
115  GeometryType geometryType () const { return GeometryType( geometryId ); }
116 
117  protected:
119 
120  private:
121  void initialize ();
122  };
123 
124 
125 
126  // Implementation of CornerPointList
127  // ---------------------------------
128 
129  template< class ct, Dune::GeometryType::Id geometryId >
131  : BaseType( id )
132  {
133  initialize();
134  }
135 
136 
137  template< class ct, Dune::GeometryType::Id geometryId >
139  ::CornerPointList ( const GeometryType &type, const int order, const size_t id )
140  : BaseType( id )
141  {
142  initialize();
143  }
144 
145 
146  template< class ct, Dune::GeometryType::Id geometryId >
148  {
149  static constexpr GeometryType gt( geometryId );
150  const auto &refElement = Dune::ReferenceElements< ct, gt.dim() >::general( gt );
151  const unsigned int size = refElement.size( gt.dim() );
152  for( unsigned int i = 0; i < size; ++i )
153  addIntegrationPoint( refElement.position( i, gt.dim() ) );
154  }
155 
156  } //namespace Fem
157 
158 } //namespace Dune
159 
160 #endif // #ifndef DUNE_FEM_CORNERPOINTSET_HH
Definition: bindguard.hh:11
integration point list supporting base function caching
Definition: cachingpointlist.hh:103
Definition: cornerpointset.hh:78
CornerPointSet(const typename GridPart::template Codim< 0 >::EntityType &entity)
Definition: cornerpointset.hh:88
CornerPointSet(const GeometryType &type)
Definition: cornerpointset.hh:82
Definition: cornerpointset.hh:102
int order() const
obtain order of the integration point list
Definition: cornerpointset.hh:111
GeometryType geometryType() const
obtain GeometryType for this integration point list
Definition: cornerpointset.hh:115
CornerPointList(const size_t id)
Definition: cornerpointset.hh:130
static unsigned int maxOrder()
Definition: cornerpointset.hh:113
BaseType::CoordinateType CoordinateType
Definition: cornerpointset.hh:106
Definition: cornerpointset.hh:30
IntegrationPointListType::CoordinateType CoordinateType
Definition: cornerpointset.hh:37
IntegrationPointList< typename GridPart::ctype, GridPart::dimension, PointListTraits > IntegrationPointListType
Definition: cornerpointset.hh:32
actual interface class for integration point lists
Definition: quadrature.hh:161
IntegrationPointListType ::CoordinateType CoordinateType
type of coordinate
Definition: quadrature.hh:180
Generic implementation of an IntegrationPointList.
Definition: quadratureimp.hh:33
void addIntegrationPoint(const CoordinateType &point)
Adds an integration point to the list.
Definition: quadratureimp.hh:169
FieldVector< FieldType, dim > CoordinateType
type of local coordinates
Definition: quadratureimp.hh:46