| 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 | |||
| 12 | #ifndef BEMBEL_SRC_IDENTITY_IDENTITYOPERATORBASE_HPP_ | ||
| 13 | #define BEMBEL_SRC_IDENTITY_IDENTITYOPERATORBASE_HPP_ | ||
| 14 | |||
| 15 | namespace Bembel { | ||
| 16 | |||
| 17 | /** | ||
| 18 | * \ingroup LocalOperator | ||
| 19 | * \brief This class is the base for all mass matrices. | ||
| 20 | */ | ||
| 21 | template <typename Derived> | ||
| 22 | class IdentityOperatorBase : public LocalOperatorBase<Derived> { | ||
| 23 | // implementation of the kernel evaluation, which may be based on the | ||
| 24 | // information available from the superSpace | ||
| 25 | public: | ||
| 26 | 1 | IdentityOperatorBase() {} | |
| 27 | template <class T> | ||
| 28 | 54 | void evaluateIntegrand_impl(const T &super_space, const SurfacePoint &p1, | |
| 29 | const SurfacePoint &p2, | ||
| 30 | Eigen::MatrixXd *intval) const { | ||
| 31 | // get evaluation points on unit square | ||
| 32 |
1/2✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
|
54 | const auto s = p1.segment<2>(0); |
| 33 | |||
| 34 | // get quadrature weights | ||
| 35 |
1/2✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
|
54 | const auto ws = p1(2); |
| 36 | |||
| 37 | // get points on geometry and tangential derivatives | ||
| 38 |
1/2✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
|
54 | const auto &x_f = p1.segment<3>(3); |
| 39 |
1/2✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
|
54 | const auto &x_f_dx = p1.segment<3>(6); |
| 40 |
1/2✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
|
54 | const auto &x_f_dy = p1.segment<3>(9); |
| 41 | |||
| 42 | // compute surface measures from tangential derivatives | ||
| 43 |
2/4✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 54 times.
✗ Branch 5 not taken.
|
54 | const auto x_kappa = x_f_dx.cross(x_f_dy).norm(); |
| 44 | |||
| 45 | // integrand without basis functions | ||
| 46 | 54 | const auto integrand = x_kappa * ws; | |
| 47 | |||
| 48 |
3/6✓ Branch 1 taken 54 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 54 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 54 times.
✗ Branch 8 not taken.
|
54 | super_space.addScaledBasisInteraction(intval, integrand, s, s); |
| 49 | |||
| 50 | 108 | return; | |
| 51 | } | ||
| 52 | }; | ||
| 53 | |||
| 54 | } // namespace Bembel | ||
| 55 | #endif // BEMBEL_SRC_IDENTITY_IDENTITYOPERATORBASE_HPP_ | ||
| 56 |