DUNE-FEM (unstable)

common.hh
1#ifndef DUNE_FEM_FUNCTION_COMMON_COMMON_HH
2#define DUNE_FEM_FUNCTION_COMMON_COMMON_HH
3
4#include <dune/fem/function/common/function.hh>
5#include <dune/fem/space/common/functionspace.hh>
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 {
23 typedef Function< FunctionSpace< ct, ct, dimworld, dimworld >, Identity< FunctionSpace< ct, ct, dimworld, dimworld > > > BaseType;
24
25 public:
26 typedef typename BaseType::DomainType DomainType;
27 typedef typename BaseType::RangeType RangeType;
28 typedef typename BaseType::JacobianRangeType JacobianRangeType;
29 typedef typename BaseType::HessianRangeType HessianRangeType;
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
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)