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