Dune Core Modules (2.6.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/topologyfactory.hh>
11#include <dune/geometry/type.hh>
12
13#include <dune/localfunctions/utility/field.hh>
14#include <dune/localfunctions/common/localkey.hh>
15
16namespace Dune
17{
18
19 template< template <class,unsigned int> class LP, unsigned int dim, class F >
20 struct LagrangeCoefficientsFactory;
21
22 template< template <class,unsigned int> class LP,
23 unsigned int dim, class F>
24 struct LagrangeCoefficientsFactoryTraits
25 {
26 static const unsigned int dimension = dim;
27 const typedef LP<F,dim> Object;
28 typedef unsigned int Key;
29 typedef LagrangeCoefficientsFactory< LP,dim,F > Factory;
30 };
31
32 template< template <class,unsigned int> class LP,
33 unsigned int dim, class F>
34 struct LagrangeCoefficientsFactory :
35 public TopologyFactory< LagrangeCoefficientsFactoryTraits< LP,dim,F> >
36 {
37 typedef LagrangeCoefficientsFactoryTraits<LP,dim,F> Traits;
38 static const unsigned int dimension = dim;
39 typedef typename Traits::Object Object;
40 typedef typename Traits::Key Key;
41
42 template< class T >
43 static Object *createObject ( const Key &order )
44 {
45 if (order == 0 || !Object::template supports<T>(order))
46 return 0;
47 typedef typename std::remove_const<Object>::type LagrangeCoefficients;
48 LagrangeCoefficients *object = new LagrangeCoefficients(order);
49 if ( !object->template build<T>() )
50 {
51 delete object;
52 object = nullptr;
53 }
54 return object;
55 }
56 };
57
58}
59
60#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:10
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 (Dec 27, 23:30, 2024)