dune-fem  2.6-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, class Topology >
21  class CornerPointList;
22 
23 
24 
25  // CornerPointSetTraits
26  // --------------------
27 
28  template< class GridPart >
30  {
31  template< class ct, int dim >
32  struct 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 
58 
59  typedef SimplexQuadratureType PointQuadratureType;
60  typedef SimplexQuadratureType LineQuadratureType;
61  };
62 
63 
64 
65  // CornerPointSet
66  // --------------
67 
68  template< class GridPart >
70  : public CachingPointList< GridPart, 0, CornerPointSetTraits< GridPart > >
71  {
73 
74  public:
75  CornerPointSet ( const GeometryType &type )
76  : BaseType( type, 1 )
77  {}
78 
79  CornerPointSet ( const typename GridPart::template Codim< 0 >::EntityType &entity )
80  : BaseType( entity.type(), 1 )
81  {}
82  };
83 
84 
85 
86  // CornerPointList
87  // ---------------
88 
89  template< class ct, class Topology >
91  : public IntegrationPointListImp< ct, Topology::dimension >
92  {
94 
95  public:
97 
98  explicit CornerPointList ( const size_t id );
99  CornerPointList ( const GeometryType &type, const int order, const size_t id );
100 
101  int order () const { return 1; }
102 
103  static unsigned int maxOrder () { return 1; }
104 
105  GeometryType geometryType () const { return GeometryType( Topology() ); }
106 
107  protected:
109 
110  private:
111  void initialize ();
112  };
113 
114 
115 
116  // Implementation of CornerPointList
117  // ---------------------------------
118 
119  template< class ct, class Topology >
121  : BaseType( id )
122  {
123  initialize();
124  }
125 
126 
127  template< class ct, class Topology >
129  ::CornerPointList ( const GeometryType &type, const int order, const size_t id )
130  : BaseType( id )
131  {
132  initialize();
133  }
134 
135 
136  template< class ct, class Topology >
138  {
139  GeometryType gt( Topology::id, Topology::dimension );
140  const auto &refElement = Dune::ReferenceElements< ct, Topology::dimension >::general( gt );
141  const unsigned int size = refElement.size( Topology::dimension );
142  for( unsigned int i = 0; i < size; ++i )
143  addIntegrationPoint( refElement.position( i, Topology::dimension ) );
144  }
145 
146  } //namespace Fem
147 
148 } //namespace Dune
149 
150 #endif // #ifndef DUNE_FEM_CORNERPOINTSET_HH
Definition: bindguard.hh:11
integration point list supporting base function caching
Definition: cachingpointlist.hh:74
Definition: cornerpointset.hh:71
CornerPointSet(const typename GridPart::template Codim< 0 >::EntityType &entity)
Definition: cornerpointset.hh:79
CornerPointSet(const GeometryType &type)
Definition: cornerpointset.hh:75
Definition: cornerpointset.hh:92
GeometryType geometryType() const
obtain GeometryType for this integration point list
Definition: cornerpointset.hh:105
BaseType::CoordinateType CoordinateType
Definition: cornerpointset.hh:96
int order() const
obtain order of the integration point list
Definition: cornerpointset.hh:101
static unsigned int maxOrder()
Definition: cornerpointset.hh:103
CornerPointList(const size_t id)
Definition: cornerpointset.hh:120
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/quadrature.hh:163
IntegrationPointListType ::CoordinateType CoordinateType
type of coordinate
Definition: quadrature/quadrature.hh:182
void addIntegrationPoint(const CoordinateType &point)
Adds an integration point to the list.
Definition: quadratureimp.hh:152
FieldVector< FieldType, dim > CoordinateType
type of local coordinates
Definition: quadratureimp.hh:43