dune-localfunctions  2.2.1
orthonormalbasis.hh
Go to the documentation of this file.
1 #ifndef DUNE_ORTHONORMALBASIS_HH
2 #define DUNE_ORTHONORMALBASIS_HH
3 
4 #include <sstream>
5 
6 #include <dune/geometry/topologyfactory.hh>
7 
10 
11 namespace Dune
12 {
13 
14  // OrthonormalBasisFactory
15  // -----------------------
16  template< int dim, class SF, class CF = typename ComputeField< SF, 512 >::Type >
18  template< int dim, class SF, class CF >
20  {
22  typedef typename MonomialBasisProviderType::Object MonomialBasisType;
26 
27  static const unsigned int dimension = dim;
28  typedef unsigned int Key;
29  typedef const Basis Object;
31  };
32 
33  template< int dim, class SF, class CF >
35  public TopologyFactory< OrthonormalBasisFactoryTraits<dim,SF,CF> >
36  {
37  static const unsigned int dimension = dim;
38  typedef SF StorageField;
39  typedef CF ComputeField;
41 
42  typedef typename Traits::Key Key;
43  typedef typename Traits::Object Object;
44 
45  template <unsigned int dd, class FF>
47  {
49  };
50 
51  typedef typename EvaluationBasisFactory< dimension, StorageField >::Type MonomialBasisProviderType;
52  typedef typename MonomialBasisProviderType::Object MonomialBasisType;
53 
57 
58  typedef typename GenericGeometry::SimplexTopology< dim >::type SimplexTopology;
59 
60  template< class Topology >
61  static Object *createObject ( const unsigned int order )
62  {
63  const typename Traits::MonomialBasisType &monomialBasis = *Traits::MonomialBasisProviderType::template create< SimplexTopology >( order );
64 
65  static typename Traits::CoefficientMatrix _coeffs;
66  if( _coeffs.size() <= monomialBasis.size() )
67  {
69  _coeffs.fill( matrix );
70  }
71 
72  return new Basis( monomialBasis, _coeffs, monomialBasis.size() );
73  }
74  };
75 
76 }
77 
78 #endif // #ifndef DUNE_ORTHONORMALBASIS_HH
79