5#include <dune/localfunctions/utility/multiindex.hh>
6#include <dune/localfunctions/utility/polynomialbasis.hh>
20 template <
int deriv,
class BasisFactory,
class Pr
intField>
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::create(
Dune::GeometryType( basis.basis().topologyId(),dimension ),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;
47 std::vector< FieldVector<
48 FieldVector<Field,LFETensor<Field,dimension,deriv>::size>,
49 PrintBasis::dimRange> > y( size );
52 for(
int i = 0; i < dimension; ++i )
54 printBasis.template evaluateSingle<deriv>( x, y );
55 for (
unsigned int i=0; i<size; ++i)
57 out <<
"$\\varphi_" << i <<
"(a,b,c)$&$=$&$" << std::endl;
59 for (
unsigned int r=0; r<PrintBasis::dimRange; ++r)
60 out << y[i][r] << (r<PrintBasis::dimRange-1 ?
" , $ \\\\ && $" :
" )$ \\\\");
63 MIBasisFactory::release(miBasis);
66 template <
int deriv,
class BasisFactory,
class Pr
intField>
67 void basisPrint(std::ostream &out,
68 typename BasisFactory::Key &key)
70 typename BasisFactory::Object *basis = BasisFactory::create(key);
71 basisPrint<deriv,BasisFactory,PrintField>(out,*basis);
72 BasisFactory::release(basis);
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:277
Dune namespace.
Definition: alignedallocator.hh:10