dune-localfunctions  2.2.1
lagrangecoefficients.hh
Go to the documentation of this file.
1 #ifndef DUNE_LAGRANGECOEFFICIENTS_HH
2 #define DUNE_LAGRANGECOEFFICIENTS_HH
3 
4 #include <vector>
5 
6 #include <dune/common/fvector.hh>
7 #include <dune/common/forloop.hh>
8 
9 #include <dune/geometry/topologyfactory.hh>
10 #include <dune/geometry/genericgeometry/topologytypes.hh>
11 #include <dune/geometry/genericgeometry/subtopologies.hh>
12 
15 
16 namespace Dune
17 {
18 
19  template< template <class,unsigned int> class LP, unsigned int dim, class F >
21 
22  template< template <class,unsigned int> class LP,
23  unsigned int dim, class F>
25  {
26  static const unsigned int dimension = dim;
27  const typedef LP<F,dim> Object;
28  typedef unsigned int Key;
30  };
31 
32  template< template <class,unsigned int> class LP,
33  unsigned int dim, class F>
35  public TopologyFactory< LagrangeCoefficientsFactoryTraits< LP,dim,F> >
36  {
38  static const unsigned int dimension = dim;
39  typedef typename Traits::Object Object;
40  typedef typename Traits::Key Key;
41 
42  template< class T >
43  static Object *createObject ( const Key &order )
44  {
45  if (order == 0 || !Object::template supports<T>(order))
46  return 0;
47  typedef typename remove_const<Object>::type LagrangeCoefficients;
48  LagrangeCoefficients *object = new LagrangeCoefficients(order);
49  if ( !object->template build<T>() )
50  {
51  delete object;
52  object = 0;
53  }
54  return object;
55  }
56  };
57 
58 }
59 
60 #endif // DUNE_LAGRANGECOEFFICIENTS_HH