dune-localfunctions 2.8.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
10#include <dune/geometry/type.hh>
11
14
15namespace Dune
16{
17
18 template< template <class,unsigned int> class LP,
19 unsigned int dim, class F>
21 {
22 static const unsigned int dimension = dim;
23 const typedef LP<F,dim> Object;
24 typedef std::size_t Key;
25
26 template< GeometryType::Id geometryId >
27 static Object *create ( const Key &order )
28 {
29 if (order == 0 || !Object::template supports<geometryId>(order))
30 return 0;
31 typedef typename std::remove_const<Object>::type LagrangeCoefficients;
32 LagrangeCoefficients *object = new LagrangeCoefficients(order);
33 if ( !object->template build<geometryId>() )
34 {
35 delete object;
36 object = nullptr;
37 }
38 return object;
39 }
40 static void release( Object *object ) { delete object; }
41 };
42
43}
44
45#endif // DUNE_LAGRANGECOEFFICIENTS_HH
Definition: bdfmcube.hh:16
Definition: lagrangecoefficients.hh:21
static const unsigned int dimension
Definition: lagrangecoefficients.hh:22
static void release(Object *object)
Definition: lagrangecoefficients.hh:40
const typedef LP< F, dim > Object
Definition: lagrangecoefficients.hh:23
static Object * create(const Key &order)
Definition: lagrangecoefficients.hh:27
std::size_t Key
Definition: lagrangecoefficients.hh:24