5#include <dune/localfunctions/utility/multiindex.hh>
6#include <dune/localfunctions/utility/polynomialbasis.hh>
20 template <
int deriv,
class BasisFactory,
class Pr
intField,GeometryType::Id geometryId>
21 void basisPrint(std::ostream &out,
22 typename BasisFactory::Object &basis)
24 typedef typename BasisFactory::Object Basis;
25 const int dimension = Basis::dimension;
27 typedef MultiIndex< dimension, PrintField > Field;
28 typedef typename BasisFactory::template EvaluationBasisFactory<dimension,Field>::Type
30 typedef typename MIBasisFactory::Object MIBasis;
31 typedef typename Basis::CoefficientMatrix CMatrix;
32 typedef PolynomialBasis<StandardEvaluator<MIBasis>, CMatrix > PrintBasis;
34 MIBasis *miBasis = MIBasisFactory::template create<geometryId>( basis.basis().order());
35 PrintBasis printBasis(*miBasis,basis.matrix(),basis.size());
37 unsigned int size = printBasis.size();
39 out <<
"% Number of base functions: " << size << std::endl;
40 out <<
"% Derivative order: " << deriv << std::endl;
42 std::vector< FieldVector<
43 FieldVector<Field,LFETensor<Field,dimension,deriv>::size>,
44 PrintBasis::dimRange> > y( size );
47 for(
int i = 0; i < dimension; ++i )
49 printBasis.template evaluateSingle<deriv>( x, y );
50 for (
unsigned int i=0; i<size; ++i)
52 out <<
"$\\varphi_" << i <<
"(a,b,c)$&$=$&$" << std::endl;
54 for (
unsigned int r=0; r<PrintBasis::dimRange; ++r)
55 out << y[i][r] << (r<PrintBasis::dimRange-1 ?
" , $ \\\\ && $" :
" )$ \\\\");
58 MIBasisFactory::release(miBasis);
61 template <
int deriv,
class BasisFactory,
class Pr
intField=
typename BasisFactory::StorageField>
62 void basisPrint(std::ostream &out,
63 typename BasisFactory::Key &key)
65 typename BasisFactory::Object *basis = BasisFactory::create(key);
66 basisPrint<deriv,BasisFactory,PrintField>(out,*basis);
67 BasisFactory::release(basis);
Dune namespace.
Definition: alignedallocator.hh:11