3 #ifndef DUNE_RANNACHER_TUREK_3D_LOCALBASIS_HH 4 #define DUNE_RANNACHER_TUREK_3D_LOCALBASIS_HH 8 #include <dune/common/fvector.hh> 9 #include <dune/common/fmatrix.hh> 16 template<
class D,
class R >
19 static const int coefficients[ 6 ][ 6 ];
23 R, 1, FieldVector< R, 1 >,
34 std::vector< typename Traits::RangeType > &out )
const 37 RangeFieldType y[ 6 ] = { 1, in[ 0 ], in[ 1 ], in[ 2 ],
38 in[ 0 ]*in[ 0 ] - in[ 1 ]*in[ 1 ],
39 in[ 1 ]*in[ 1 ] - in[ 2 ]*in[ 2 ] };
41 for(
unsigned int i = 0; i <
size(); ++i )
43 out[ i ] = RangeFieldType( 0 );
44 for(
unsigned int j = 0; j < 6; ++j )
45 out[ i ] += coefficients[ i ][ j ]*y[ j ];
46 out[ i ] /= RangeFieldType( 3 );
52 std::vector< typename Traits::JacobianType > &out )
const 55 RangeFieldType y0[ 5 ] = { 1, 0, 0, 2*in[ 0 ], 0 };
56 RangeFieldType y1[ 5 ] = { 0, 1, 0, -2*in[ 1 ], 2*in[ 1 ] };
57 RangeFieldType y2[ 5 ] = { 0, 0, 1, 0, -2*in[ 2 ] };
60 for(
unsigned int i = 0; i <
size(); ++i )
62 out[ i ] = RangeFieldType( 0 );
63 for(
unsigned int j = 0; j < 5; ++j )
65 out[ i ][ 0 ][ 0 ] += coefficients[ i ][ j+1 ]*y0[ j ];
66 out[ i ][ 0 ][ 1 ] += coefficients[ i ][ j+1 ]*y1[ j ];
67 out[ i ][ 0 ][ 2 ] += coefficients[ i ][ j+1 ]*y2[ j ];
69 out[ i ] /= RangeFieldType( 3 );
85 template<
class D,
class R >
87 ::coefficients[ 6 ][ 6 ] = {{ 2, -7, 2, 2, 4, 2 },
88 { -1, -1, 2, 2, 4, 2 },
89 { 2, 2, -7, 2, -2, 2 },
90 { -1, 2, -1, 2, -2, 2 },
91 { 2, 2, 2, -7, -2, -4 },
92 { -1, 2, 2, -1, -2, -4 }};
96 #endif // #ifndef DUNE_RANNACHER_TUREK_3D_LOCALBASIS_HH Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:37
RF RangeFieldType
Export type for range field.
Definition: localbasis.hh:52
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
evaluate all shape functions
Definition: rannacherturek3dlocalbasis.hh:33
unsigned int size() const
number of shape functions
Definition: rannacherturek3dlocalbasis.hh:27
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:14
LocalBasisTraits< D, 3, FieldVector< D, 3 >, R, 1, FieldVector< R, 1 >, FieldMatrix< R, 1, 3 > > Traits
Definition: rannacherturek3dlocalbasis.hh:24
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
evaluate jacobian of all shape functions
Definition: rannacherturek3dlocalbasis.hh:51
D DomainType
domain type
Definition: localbasis.hh:49
unsigned int order() const
polynomial order of the shape functions
Definition: rannacherturek3dlocalbasis.hh:74
Definition: rannacherturek3dlocalbasis.hh:17