1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_LOCALFUNCTIONS_COMMON_LOCALBASIS_HH
4 #define DUNE_LOCALFUNCTIONS_COMMON_LOCALBASIS_HH
5 
6 namespace Dune
7 {
8 
9   /**@ingroup LocalBasisInterface
10          \brief Type traits for LocalBasisVirtualInterface
11 
12          A shape function is a function
13          \f[ \hat\phi : \mbox{IR}^n \to \mbox{IR}^m. \f]
14          This traits class holds information how the signature of this
15          function is represented in C++ types.
16 
17          This is just a convenience class for supplying traits to the
18          LocalBasisVirtualInterface and its implementations.
19 
20          \tparam DF Type to represent the field in the domain.
21          \tparam n  Dimension of the domain.
22          \tparam D  Type to represent the domain, allows random access.
23          \tparam RF Type to represent the field in the range.
24          \tparam m  Dimension of the range.
25          \tparam R  Type to represent the range, allows random access.
26          \tparam J  Type to represent the Jacobian, allows random access.
27 
28          \nosubgrouping
29    */
30   template<class DF, int n, class D, class RF, int m, class R, class J>
31   struct LocalBasisTraits
32   {
33     //! \brief Export type for domain field
34     typedef DF DomainFieldType;
35 
36     //! \brief Enum for domain dimension
37     enum {
38       //! \brief dimension of the domain
39       dimDomain = n
40     };
41 
42     //! \brief domain type
43     typedef D DomainType;
44 
45     //! \brief Export type for range field
46     typedef RF RangeFieldType;
47 
48     //! \brief Enum for range dimension
49     enum {
50       //! \brief dimension of the range
51       dimRange = m
52     };
53 
54     //! \brief range type
55     typedef R RangeType;
56 
57     /** \brief Type to represent derivative
58 
59             When \f$ \hat\phi : \mbox{IR}^n \to \mbox{IR}^m \f$ then JacobianType
60             is an 2D-array of m x n components where entry J[i][j] contains
61             the derivative  \f$\partial_j \hat\phi_i \f$.
62      */
63     typedef J JacobianType;
64   };
65 
66 }
67 #endif
68