dune-localfunctions 2.10
Loading...
Searching...
No Matches
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// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_LAGRANGECOEFFICIENTS_HH
6#define DUNE_LAGRANGECOEFFICIENTS_HH
7
8#include <vector>
9
10#include <dune/common/fvector.hh>
11
12#include <dune/geometry/type.hh>
13
16
17namespace Dune
18{
19
20 template< template <class,unsigned int> class LP,
21 unsigned int dim, class F>
23 {
24 static const unsigned int dimension = dim;
25 const typedef LP<F,dim> Object;
26 typedef std::size_t Key;
27
28 template< GeometryType::Id geometryId >
29 static Object *create ( const Key &order )
30 {
31 if (order == 0 || !Object::template supports<geometryId>(order))
32 return 0;
33 typedef typename std::remove_const<Object>::type LagrangeCoefficients;
34 LagrangeCoefficients *object = new LagrangeCoefficients(order);
35 if ( !object->template build<geometryId>() )
36 {
37 delete object;
38 object = nullptr;
39 }
40 return object;
41 }
42 static void release( Object *object ) { delete object; }
43 };
44
45}
46
47#endif // DUNE_LAGRANGECOEFFICIENTS_HH
Definition bdfmcube.hh:18
Definition lagrangecoefficients.hh:23
static const unsigned int dimension
Definition lagrangecoefficients.hh:24
static void release(Object *object)
Definition lagrangecoefficients.hh:42
const typedef LP< F, dim > Object
Definition lagrangecoefficients.hh:25
static Object * create(const Key &order)
Definition lagrangecoefficients.hh:29
std::size_t Key
Definition lagrangecoefficients.hh:26