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_LINEARFORM_LINEARFORM_HPP_ |
12 |
|
|
#define BEMBEL_SRC_LINEARFORM_LINEARFORM_HPP_ |
13 |
|
|
|
14 |
|
|
namespace Bembel { |
15 |
|
|
/** |
16 |
|
|
* \ingroup LinearForm |
17 |
|
|
* \brief This class needs to be specialized, such that key traits for user |
18 |
|
|
*defined LinearForms are available. |
19 |
|
|
* |
20 |
|
|
* LinearForm implements trace operators, i.e., routines to generate the right |
21 |
|
|
*hand side of the linear systems. Currently, only a Dirichlet trace, tangential |
22 |
|
|
*trace and a rotated tangential trace are provided. |
23 |
|
|
**/ |
24 |
|
|
template <typename Derived> |
25 |
|
|
struct LinearFormTraits { |
26 |
|
|
enum { YOU_DID_NOT_SPECIFY_LINEARFORM_TRAITS = 1 }; |
27 |
|
|
}; |
28 |
|
|
|
29 |
|
|
/** |
30 |
|
|
* \ingroup LinearForm |
31 |
|
|
* \brief This class provides a blueprint for the class that needs to be |
32 |
|
|
* specialized for assembly of the right hand side of the linear system. |
33 |
|
|
* |
34 |
|
|
* Take a look at the [Design Considerations](\ref CRTPLinearForm) for |
35 |
|
|
* details. |
36 |
|
|
*/ |
37 |
|
|
template <typename Derived, typename Scalar> |
38 |
|
|
struct LinearFormBase { |
39 |
|
|
// Constructors |
40 |
|
10 |
LinearFormBase() {} |
41 |
|
|
|
42 |
|
|
// the user has to provide the implementation of this function, which |
43 |
|
|
// tells |
44 |
|
|
// is able to evaluate the integrand of the Galerkin formulation in a |
45 |
|
|
// pair |
46 |
|
|
// of quadrature points represented as a |
47 |
|
|
// Surface point [xi; w; Chi(xi); dsChi(xi); dtChi(xi)] |
48 |
|
|
template <class T> |
49 |
|
|
void evaluateIntegrand( |
50 |
|
|
const T &super_space, const SurfacePoint &p, |
51 |
|
|
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> *intval) const { |
52 |
|
|
static_cast<const Derived *>(this)->evaluateLinearForm_impl(super_space, p, |
53 |
|
|
intval); |
54 |
|
|
return; |
55 |
|
|
} |
56 |
|
|
// pointer to the derived object |
57 |
|
|
Derived &derived() { return *static_cast<Derived *>(this); } |
58 |
|
|
// const pointer to the derived object |
59 |
|
|
const Derived &derived() const { return *static_cast<const Derived *>(this); } |
60 |
|
|
}; |
61 |
|
|
} // namespace Bembel |
62 |
|
|
#endif // BEMBEL_SRC_LINEARFORM_LINEARFORM_HPP_ |
63 |
|
|
|