dune-fem  2.4.1-rc
lagrange/dofmappercode.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_LAGRANGE_DOFMAPPER_HH
2 #define DUNE_FEM_SPACE_LAGRANGE_DOFMAPPER_HH
3 
4 // dune-geometry includes
5 #include <dune/geometry/referenceelements.hh>
6 #include <dune/geometry/type.hh>
7 #include <dune/geometry/typeindex.hh>
8 
9 // dune-fem includes
12 
13 
14 namespace Dune
15 {
16 
17  namespace Fem
18  {
19 
20  // LagrangeDofMapperCodeFactory
21  // ----------------------------
22 
23  template< class LagrangePointSetContainer >
25  {
26  explicit LagrangeDofMapperCodeFactory ( const LagrangePointSetContainer &lagrangePointSets )
27  : lagrangePointSets_( lagrangePointSets )
28  {}
29 
30  template< class Field, int dim >
31  DofMapperCode operator() ( const ReferenceElement< Field, dim > &refElement ) const
32  {
33  const GeometryType type = refElement.type();
34  if( lagrangePointSets_.exists( type ) )
35  return compile( refElement, lagrangePointSets_[ type ] );
36  else
37  return DofMapperCode();
38  }
39 
40  private:
41  const LagrangePointSetContainer &lagrangePointSets_;
42  };
43 
44  } // namespace Fem
45 
46 } // namespace Dune
47 
48 #endif // #ifndef DUNE_FEM_SPACE_LAGRANGE_DOFMAPPER_HH
Definition: lagrange/dofmappercode.hh:24
DofMapperCode compile(const Dune::ReferenceElement< Field, dim > &refElement, const LocalCoefficients &localCoefficients)
Definition: compile.hh:44
DofMapperCode operator()(const ReferenceElement< Field, dim > &refElement) const
Definition: lagrange/dofmappercode.hh:31
Definition: coordinate.hh:4
Definition: code.hh:17
LagrangeDofMapperCodeFactory(const LagrangePointSetContainer &lagrangePointSets)
Definition: lagrange/dofmappercode.hh:26