Dune Core Modules (2.8.0)

lagrangecoefficients.hh
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
9
10#include <dune/geometry/type.hh>
11
12#include <dune/localfunctions/utility/field.hh>
13#include <dune/localfunctions/common/localkey.hh>
14
15namespace Dune
16{
17
18 template< template <class,unsigned int> class LP,
19 unsigned int dim, class F>
20 struct LagrangeCoefficientsFactory
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
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:11
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 22, 23:33, 2024)