dune-localfunctions  2.3.0
lagrangecoefficients.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_LAGRANGECOEFFICIENTS_HH
4 #define DUNE_LAGRANGECOEFFICIENTS_HH
5 
6 #include <vector>
7 
8 #include <dune/common/fvector.hh>
9 #include <dune/common/forloop.hh>
10 
11 #include <dune/geometry/topologyfactory.hh>
12 #include <dune/geometry/genericgeometry/topologytypes.hh>
13 #include <dune/geometry/genericgeometry/subtopologies.hh>
14 
17 
18 namespace Dune
19 {
20 
21  template< template <class,unsigned int> class LP, unsigned int dim, class F >
23 
24  template< template <class,unsigned int> class LP,
25  unsigned int dim, class F>
27  {
28  static const unsigned int dimension = dim;
29  const typedef LP<F,dim> Object;
30  typedef unsigned int Key;
32  };
33 
34  template< template <class,unsigned int> class LP,
35  unsigned int dim, class F>
37  public TopologyFactory< LagrangeCoefficientsFactoryTraits< LP,dim,F> >
38  {
40  static const unsigned int dimension = dim;
41  typedef typename Traits::Object Object;
42  typedef typename Traits::Key Key;
43 
44  template< class T >
45  static Object *createObject ( const Key &order )
46  {
47  if (order == 0 || !Object::template supports<T>(order))
48  return 0;
49  typedef typename remove_const<Object>::type LagrangeCoefficients;
50  LagrangeCoefficients *object = new LagrangeCoefficients(order);
51  if ( !object->template build<T>() )
52  {
53  delete object;
54  object = 0;
55  }
56  return object;
57  }
58  };
59 
60 }
61 
62 #endif // DUNE_LAGRANGECOEFFICIENTS_HH
Traits::Key Key
Definition: lagrangecoefficients.hh:42
LagrangeCoefficientsFactoryTraits< LP, dim, F > Traits
Definition: lagrangecoefficients.hh:39
LagrangeCoefficientsFactory< LP, dim, F > Factory
Definition: lagrangecoefficients.hh:31
Definition: lagrangecoefficients.hh:26
static const unsigned int dimension
Definition: lagrangecoefficients.hh:28
unsigned int Key
Definition: lagrangecoefficients.hh:30
Definition: lagrangecoefficients.hh:22
const typedef LP< F, dim > Object
Definition: lagrangecoefficients.hh:29
Traits::Object Object
Definition: lagrangecoefficients.hh:41
static const unsigned int dimension
Definition: lagrangecoefficients.hh:40
static Object * createObject(const Key &order)
Definition: lagrangecoefficients.hh:45