3#ifndef DUNE_ORTHONORMALBASIS_HH
4#define DUNE_ORTHONORMALBASIS_HH
8#include <dune/geometry/topologyfactory.hh>
10#include <dune/localfunctions/utility/polynomialbasis.hh>
11#include <dune/localfunctions/orthonormal/orthonormalcompute.hh>
18 template< int dim, class SF, class CF = typename ComputeField< SF, 512 >::Type >
19 struct OrthonormalBasisFactory;
20 template<
int dim,
class SF,
class CF >
21 struct OrthonormalBasisFactoryTraits
23 typedef Dune::MonomialBasisProvider< dim, SF > MonomialBasisProviderType;
24 typedef typename MonomialBasisProviderType::Object MonomialBasisType;
25 typedef SparseCoeffMatrix< SF, 1 > CoefficientMatrix;
26 typedef StandardEvaluator< MonomialBasisType > Evaluator;
27 typedef PolynomialBasis< Evaluator, CoefficientMatrix > Basis;
29 static const unsigned int dimension = dim;
30 typedef unsigned int Key;
31 typedef const Basis Object;
32 typedef OrthonormalBasisFactory<dim,SF,CF> Factory;
35 template<
int dim,
class SF,
class CF >
36 struct OrthonormalBasisFactory :
37 public TopologyFactory< OrthonormalBasisFactoryTraits<dim,SF,CF> >
39 static const unsigned int dimension = dim;
40 typedef SF StorageField;
41 typedef CF ComputeField;
42 typedef OrthonormalBasisFactoryTraits<dim,SF,CF> Traits;
44 typedef typename Traits::Key Key;
45 typedef typename Traits::Object Object;
47 template <
unsigned int dd,
class FF>
48 struct EvaluationBasisFactory
50 typedef MonomialBasisProvider<dd,FF> Type;
53 typedef typename EvaluationBasisFactory< dimension, StorageField >::Type MonomialBasisProviderType;
54 typedef typename MonomialBasisProviderType::Object MonomialBasisType;
56 typedef SparseCoeffMatrix< StorageField, 1 > CoefficientMatrix;
57 typedef StandardEvaluator< MonomialBasisType > Evaluator;
58 typedef PolynomialBasis< Evaluator, CoefficientMatrix > Basis;
60 typedef typename Impl::SimplexTopology< dim >::type SimplexTopology;
62 template<
class Topology >
63 static Object *createObject (
const unsigned int order )
65 const typename Traits::MonomialBasisType &monomialBasis = *Traits::MonomialBasisProviderType::template create< SimplexTopology >( order );
67 static typename Traits::CoefficientMatrix _coeffs;
68 if( _coeffs.size() <= monomialBasis.size() )
70 ONBCompute::ONBMatrix< Topology, ComputeField > matrix( order );
71 _coeffs.fill( matrix );
74 return new Basis( monomialBasis, _coeffs, monomialBasis.size() );
Dune namespace.
Definition: alignedallocator.hh:10