7#include <dune/localfunctions/utility/multiindex.hh>
8#include <dune/localfunctions/utility/polynomialbasis.hh>
22 template <
int deriv,
class BasisFactory,
class Pr
intField,GeometryType::Id geometryId>
23 void basisPrint(std::ostream &out,
24 typename BasisFactory::Object &basis)
26 typedef typename BasisFactory::Object Basis;
27 const int dimension = Basis::dimension;
29 typedef MultiIndex< dimension, PrintField > Field;
30 typedef typename BasisFactory::template EvaluationBasisFactory<dimension,Field>::Type
32 typedef typename MIBasisFactory::Object MIBasis;
33 typedef typename Basis::CoefficientMatrix CMatrix;
34 typedef PolynomialBasis<StandardEvaluator<MIBasis>, CMatrix > PrintBasis;
36 MIBasis *miBasis = MIBasisFactory::template create<geometryId>( basis.basis().order());
37 PrintBasis printBasis(*miBasis,basis.matrix(),basis.size());
39 unsigned int size = printBasis.size();
41 out <<
"% Number of base functions: " <<
size << std::endl;
42 out <<
"% Derivative order: " << deriv << std::endl;
44 std::vector< FieldVector<
46 PrintBasis::dimRange> > y(
size );
49 for(
int i = 0; i < dimension; ++i )
51 printBasis.template evaluateSingle<deriv>( x, y );
52 for (
unsigned int i=0; i<
size; ++i)
54 out <<
"$\\varphi_" << i <<
"(a,b,c)$&$=$&$" << std::endl;
56 for (
unsigned int r=0; r<PrintBasis::dimRange; ++r)
57 out << y[i][r] << (r<PrintBasis::dimRange-1 ?
" , $ \\\\ && $" :
" )$ \\\\");
60 MIBasisFactory::release(miBasis);
63 template <
int deriv,
class BasisFactory,
class Pr
intField=
typename BasisFactory::StorageField>
64 void basisPrint(std::ostream &out,
65 typename BasisFactory::Key &key)
67 typename BasisFactory::Object *basis = BasisFactory::create(key);
68 basisPrint<deriv,BasisFactory,PrintField>(out,*basis);
69 BasisFactory::release(basis);
static constexpr size_type size() noexcept
Obtain the number of elements stored in the vector.
Definition: fvector.hh:193
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75