Line |
Branch |
Exec |
Source |
1 |
|
|
// This file is part of Bembel, the higher order C++ boundary element library. |
2 |
|
|
// |
3 |
|
|
// Copyright (C) 2022 see <http://www.bembel.eu> |
4 |
|
|
// |
5 |
|
|
// It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz, |
6 |
|
|
// M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt, |
7 |
|
|
// Universitaet Basel, and Universita della Svizzera italiana, Lugano. This |
8 |
|
|
// source code is subject to the GNU General Public License version 3 and |
9 |
|
|
// provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further |
10 |
|
|
// information. |
11 |
|
|
#ifndef BEMBEL_SRC_LINEAROPERATOR_DIFFERENTIALFORMENUM_HPP_ |
12 |
|
|
#define BEMBEL_SRC_LINEAROPERATOR_DIFFERENTIALFORMENUM_HPP_ |
13 |
|
|
|
14 |
|
|
namespace Bembel { |
15 |
|
|
/** |
16 |
|
|
* \ingroup LinearOperator |
17 |
|
|
* \brief Provides information about the discrete space required for the |
18 |
|
|
* discretisation of a specific operator. |
19 |
|
|
**/ |
20 |
|
|
struct DifferentialForm { |
21 |
|
|
enum { Continuous = 0, DivConforming = 1, Discontinuous = 2 }; |
22 |
|
|
}; |
23 |
|
|
|
24 |
|
|
/** |
25 |
|
|
* \ingroup LinearOperator |
26 |
|
|
* \brief struct containing specifications on DifferentialForms, i.e., the |
27 |
|
|
* function spaces. |
28 |
|
|
**/ |
29 |
|
|
template <unsigned int DifferentialForm, typename Scalar> |
30 |
|
|
struct DifferentialFormTraits { |
31 |
|
|
// empty, only to be used in its specialization |
32 |
|
|
}; |
33 |
|
|
/** |
34 |
|
|
* \brief Specification of the DifferentialFormTraits for the continuous case. |
35 |
|
|
*/ |
36 |
|
|
template <typename Scalar> |
37 |
|
|
struct DifferentialFormTraits<DifferentialForm::Continuous, Scalar> { |
38 |
|
|
enum { FunctionSpaceVectorDimension = 1, FunctionSpaceOutputDimension = 1 }; |
39 |
|
|
|
40 |
|
|
typedef Scalar FunctionSpaceValue; |
41 |
|
|
}; |
42 |
|
|
/** |
43 |
|
|
* \brief Specification of the DifferentialFormTraits for the div conforming |
44 |
|
|
* case. |
45 |
|
|
*/ |
46 |
|
|
template <typename Scalar> |
47 |
|
|
struct DifferentialFormTraits<DifferentialForm::DivConforming, Scalar> { |
48 |
|
|
enum { FunctionSpaceVectorDimension = 2, FunctionSpaceOutputDimension = 3 }; |
49 |
|
|
|
50 |
|
|
typedef Eigen::Matrix<Scalar, 3, 1> FunctionSpaceValue; |
51 |
|
|
}; |
52 |
|
|
/** |
53 |
|
|
* \brief Specification of the DifferentialFormTraits for the discontinuous |
54 |
|
|
* case. |
55 |
|
|
*/ |
56 |
|
|
template <typename Scalar> |
57 |
|
|
struct DifferentialFormTraits<DifferentialForm::Discontinuous, Scalar> { |
58 |
|
|
enum { FunctionSpaceVectorDimension = 1, FunctionSpaceOutputDimension = 1 }; |
59 |
|
|
|
60 |
|
|
typedef Scalar FunctionSpaceValue; |
61 |
|
|
}; |
62 |
|
|
|
63 |
|
|
/** |
64 |
|
|
* \deprecated Use DifferentialFormTraits instead. |
65 |
|
|
*/ |
66 |
|
|
template <unsigned int DF> |
67 |
|
1090164 |
constexpr int getFunctionSpaceVectorDimension() { |
68 |
|
1090164 |
return DifferentialFormTraits<DF, double>::FunctionSpaceVectorDimension; |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
/** |
72 |
|
|
* \deprecated Use DifferentialFormTraits instead. |
73 |
|
|
*/ |
74 |
|
|
template <unsigned int DF> |
75 |
|
|
constexpr int getFunctionSpaceOutputDimension() { |
76 |
|
|
return DifferentialFormTraits<DF, double>::FunctionSpaceOutputDimension; |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
} // namespace Bembel |
80 |
|
|
|
81 |
|
|
#endif // BEMBEL_SRC_LINEAROPERATOR_DIFFERENTIALFORMENUM_HPP_ |
82 |
|
|
|