dune-fem 2.8.0
Loading...
Searching...
No Matches
common.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_FUNCTION_COMMON_COMMON_HH
2#define DUNE_FEM_FUNCTION_COMMON_COMMON_HH
3
6
7namespace Dune
8{
9
10 namespace Fem
11 {
12
13 // Identity
14 // --------
15
16 template< class FunctionSpace >
17 class Identity;
18
19 template< class ct, int dimworld >
20 class Identity< FunctionSpace< ct, ct, dimworld, dimworld > >
21 : public Function< FunctionSpace< ct, ct, dimworld, dimworld >, Identity< FunctionSpace< ct, ct, dimworld, dimworld > > >
22 {
24
25 public:
30
31 void evaluate ( const DomainType &x, RangeType &value ) const
32 {
33 value = x;
34 }
35
36 void jacobian ( const DomainType &x, JacobianRangeType &jacobian ) const
37 {
38 jacobian = JacobianRangeType( ct( 0 ) );
39 for( int i = 0; i < dimworld; ++i )
40 jacobian[ i ][ i ] = 1;
41 }
42
43 void hessian ( const DomainType &x, HessianRangeType &hessian ) const
44 {
45 hessian = HessianRangeType( ct( 0 ) );
46 }
47 };
48
49
50 } // namespace Fem
51
52} // namespace Dune
53
54#endif // #ifndef DUNE_FEM_FUNCTION_COMMON_COMMON_HH
Definition: bindguard.hh:11
Definition: explicitfieldvector.hh:75
Definition: common.hh:17
BaseType::HessianRangeType HessianRangeType
Definition: common.hh:29
void hessian(const DomainType &x, HessianRangeType &hessian) const
Definition: common.hh:43
BaseType::DomainType DomainType
Definition: common.hh:26
BaseType::JacobianRangeType JacobianRangeType
Definition: common.hh:28
BaseType::RangeType RangeType
Definition: common.hh:27
void evaluate(const DomainType &x, RangeType &value) const
Definition: common.hh:31
void jacobian(const DomainType &x, JacobianRangeType &jacobian) const
Definition: common.hh:36
Abstract class representing a function.
Definition: common/function.hh:50
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian type
Definition: common/function.hh:70
A vector valued function space.
Definition: functionspace.hh:60