5#ifndef DUNE_DEFAULTBASISFACTORY_HH
6#define DUNE_DEFAULTBASISFACTORY_HH
11#include <dune/localfunctions/utility/basismatrix.hh>
18 static T apply(
const T &t )
32 template<
class PreBFactory,
33 class InterpolFactory,
34 unsigned int dim,
unsigned int dimR,
36 class PreBasisKeyExtractor = Identity >
37 struct DefaultBasisFactory
39 static const unsigned int dimension = dim;
40 static const unsigned int dimRange = dimR;
41 typedef SF StorageField;
42 typedef CF ComputeField;
43 typedef PreBFactory PreBasisFactory;
44 typedef typename PreBasisFactory::Object PreBasis;
45 typedef InterpolFactory InterpolationFactory;
46 typedef typename InterpolationFactory::Object Interpolation;
47 typedef typename PreBasisFactory::template EvaluationBasisFactory<dim,SF>::Type MonomialBasisFactory;
48 typedef typename MonomialBasisFactory::Object MonomialBasis;
49 typedef StandardEvaluator< MonomialBasis > Evaluator;
50 typedef PolynomialBasisWithMatrix< Evaluator, SparseCoeffMatrix< SF, dimRange > > Basis;
52 typedef const Basis Object;
53 typedef typename InterpolationFactory::Key Key;
54 template <
unsigned int dd,
class FF>
55 struct EvaluationBasisFactory
57 typedef typename PreBasisFactory::template EvaluationBasisFactory<dd,FF>::Type
61 template< GeometryType::Id geometryId >
62 static Object *create (
const Key &key )
64 const typename PreBasisFactory::Key preBasisKey = PreBasisKeyExtractor::apply(key);
65 const PreBasis *preBasis = PreBasisFactory::template create<geometryId>( preBasisKey );
66 const Interpolation *interpol = InterpolationFactory::template create<geometryId>( key );
67 BasisMatrix< PreBasis, Interpolation, ComputeField > matrix( *preBasis, *interpol );
69 const MonomialBasis *monomialBasis = MonomialBasisFactory::template create< geometryId >( preBasis->order() );
71 Basis *basis =
new Basis( *monomialBasis );
73 basis->fill( matrix );
75 InterpolationFactory::release(interpol);
76 PreBasisFactory::release(preBasis);
81 static void release( Object *
object)
83 const MonomialBasis *monomialBasis = &(
object->basis());
85 MonomialBasisFactory::release( monomialBasis );
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:13