dune-localfunctions 3.0-git
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
18namespace Dune
19{
20
21 template< template <class,unsigned int> class LP, unsigned int dim, class F >
22 struct LagrangeCoefficientsFactory;
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 std::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
Definition brezzidouglasmarini1cube2d.hh:14
Definition lagrangecoefficients.hh:38
Traits::Key Key
Definition lagrangecoefficients.hh:42
static Object * createObject(const Key &order)
Definition lagrangecoefficients.hh:45
static const unsigned int dimension
Definition lagrangecoefficients.hh:40
LagrangeCoefficientsFactoryTraits< LP, dim, F > Traits
Definition lagrangecoefficients.hh:39
Traits::Object Object
Definition lagrangecoefficients.hh:41
Definition lagrangecoefficients.hh:27
static const unsigned int dimension
Definition lagrangecoefficients.hh:28
LagrangeCoefficientsFactory< LP, dim, F > Factory
Definition lagrangecoefficients.hh:31
unsigned int Key
Definition lagrangecoefficients.hh:30
const typedef LP< F, dim > Object
Definition lagrangecoefficients.hh:29