3 #ifndef DUNE_ORTHONORMALCOMPUTE_HH
4 #define DUNE_ORTHONORMALCOMPUTE_HH
12 #include <dune/common/fmatrix.hh>
14 #include <dune/geometry/genericgeometry/topologytypes.hh>
24 template<
class scalar_t >
28 for(
int j = start; j <= end; ++j )
38 template<
class Topology >
41 template<
class Base >
44 template<
int dim,
class scalar_t >
46 scalar_t &p, scalar_t &q )
48 const int dimension = Base::dimension+1;
49 int i = alpha.
z( Base::dimension );
51 p *= factorial< scalar_t >( 1, i );
52 q *= factorial< scalar_t >( dimension + ord, dimension + ord + i );
57 template<
class Base >
60 template<
int dim,
class scalar_t >
62 scalar_t &p, scalar_t &q )
64 int i = alpha.
z( Base::dimension );
76 template<
int dim,
class scalar_t >
78 scalar_t &p, scalar_t &q )
91 template<
class Topology,
class scalar_t >
99 typedef std::vector< scalar_t >
vec_t;
105 const unsigned int dim = Topology::dimension;
108 const std::size_t size = basis.
size();
109 std::vector< Dune::FieldVector< MI, 1 > > y( size );
110 Dune::FieldVector< MI, dim > x;
111 for(
unsigned int i = 0; i < dim; ++i )
122 for( std::size_t i = 0; i < size; ++i )
124 for( std::size_t j = 0; j < size; ++j )
136 template<
class Vector >
137 void row (
unsigned int row, Vector &vec )
const
141 for( std::size_t i = 0; i <
Base::rows(); ++i )
146 void sprod (
int col1,
int col2, scalar_t &ret )
149 for(
int k = 0; k <= col1; ++k )
151 for(
int l = 0; l <=col2; ++l )
152 ret += Base::operator()( l, col2 ) * S( l, k ) *
Base::operator()( k, col1 );
156 void vmul ( std::size_t col, std::size_t rowEnd,
const scalar_t &s )
158 for( std::size_t i = 0; i <= rowEnd; ++i )
159 Base::operator()( i, col ) *= s;
162 void vsub ( std::size_t coldest, std::size_t colsrc, std::size_t rowEnd,
const scalar_t &s )
164 for( std::size_t i = 0; i <= rowEnd; ++i )
165 Base::operator()( i, coldest ) -= s * Base::operator()( i, colsrc );
172 for( std::size_t i = 0; i < N; ++i )
174 for( std::size_t j = 0; j < N; ++j )
175 Base::operator()( i, j ) = scalar_t( i == j ? 1 : 0 );
181 vmul( 0, 0, scalar_t( 1 ) / sqrt( s ) );
182 for( std::size_t i = 1; i < N; ++i )
184 for( std::size_t k = 0; k < i; ++k )
190 vmul( i, i, scalar_t( 1 ) / sqrt( s ) );
200 #endif // #ifndef DUNE_ORTHONORMALCOMPUTE_HH
Dune::LFEMatrix< scalar_t > mat_t
Definition: orthonormalcompute.hh:100
void resize(const unsigned int rows, const unsigned int cols)
Definition: lfematrix.hh:78
void evaluate(const unsigned int deriv, const DomainVector &x, Field *const values) const
Definition: monomialbasis.hh:689
Definition: orthonormalcompute.hh:39
int z(int i) const
Definition: multiindex.hh:89
Definition: lfematrix.hh:15
unsigned int rows() const
Definition: lfematrix.hh:56
const unsigned int size() const
Definition: monomialbasis.hh:666
Definition: monomialbasis.hh:760
unsigned int cols() const
Definition: lfematrix.hh:61
const Field & operator()(const unsigned int row, const unsigned int col) const
Definition: lfematrix.hh:42
void field_cast(const F1 &f1, F2 &f2)
a helper class to cast from one field to another
Definition: field.hh:157
Definition: multiindex.hh:23
scalar_t factorial(int start, int end)
Definition: orthonormalcompute.hh:25
std::vector< scalar_t > vec_t
Definition: orthonormalcompute.hh:99
static int compute(const Dune::MultiIndex< dim, scalar_t > &alpha, scalar_t &p, scalar_t &q)
Definition: orthonormalcompute.hh:45
Definition: orthonormalcompute.hh:21
void row(unsigned int row, Vector &vec) const
Definition: orthonormalcompute.hh:137
Definition: orthonormalcompute.hh:92
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:14
ONBMatrix(unsigned int order)
Definition: orthonormalcompute.hh:102
static int compute(const Dune::MultiIndex< dim, scalar_t > &alpha, scalar_t &p, scalar_t &q)
Definition: orthonormalcompute.hh:61
static int compute(const Dune::MultiIndex< dim, scalar_t > &alpha, scalar_t &p, scalar_t &q)
Definition: orthonormalcompute.hh:77