Bembel
integrate3.hpp
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_DUFFYTRICK_INTEGRATE3_HPP_
12 #define BEMBEL_SRC_DUFFYTRICK_INTEGRATE3_HPP_
13 
14 namespace Bembel {
15 namespace DuffyTrick {
27 template <typename Derived, class T>
28 void integrate3(const LinearOperatorBase<Derived> &LinOp, const T &super_space,
29  const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2,
30  int rot2, const ElementSurfacePoints &ffield_qnodes1,
31  const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q,
32  Eigen::Matrix<typename LinearOperatorTraits<Derived>::Scalar,
33  Eigen::Dynamic, Eigen::Dynamic> *intval) {
34  intval->setZero();
35  double h = e1.get_h();
36  double t1 = 0;
37  double t2 = 0;
38  double t3 = 0;
39  double t4 = 0;
40  SurfacePoint qp1, qp2;
41  // llc of the element wrt [0,1]^2
42  for (auto i = 0; i < Q.w_.size(); ++i) {
43  auto xi = Q.xi_.col(i);
44  double w = h * h * Q.w_(i) * xi(1) * xi(1);
45  t1 = xi(0) * (1 - xi(1));
46  t2 = (1 - xi(0)) * (1 - xi(1));
47  for (auto j = 0; j < Q.w_.size(); ++j) {
48  auto eta = xi(1) * Q.xi_.col(j);
49  t3 = xi(0) * (1 - eta(0));
50  t4 = (1 - xi(0)) * (1 - eta(0));
51  super_space.map2surface(e1, tau(t1, eta(0), rot1), w, &qp1);
52  super_space.map2surface(e2, tau(t2, eta(1), rot2), Q.w_(j) * (1 - xi(1)),
53  &qp2);
54  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
55  super_space.map2surface(e1, tau(1 - t1, eta(0), rot1), w, &qp1);
56  super_space.map2surface(e2, tau(1 - t2, eta(1), rot2),
57  Q.w_(j) * (1 - xi(1)), &qp2);
58  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
59  super_space.map2surface(e1, tau(t3, xi(1), rot1), w, &qp1);
60  super_space.map2surface(e2, tau(t4, eta(1), rot2), Q.w_(j) * (1 - eta(0)),
61  &qp2);
62  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
63  super_space.map2surface(e1, tau(1 - t3, xi(1), rot1), w, &qp1);
64  super_space.map2surface(e2, tau(1 - t4, eta(1), rot2),
65  Q.w_(j) * (1 - eta(0)), &qp2);
66  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
67  super_space.map2surface(e1, tau(t4, eta(1), rot1), w, &qp1);
68  super_space.map2surface(e2, tau(t3, xi(1), rot2), Q.w_(j) * (1 - eta(0)),
69  &qp2);
70  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
71  super_space.map2surface(e1, tau(1 - t4, eta(1), rot1), w, &qp1);
72  super_space.map2surface(e2, tau(1 - t3, xi(1), rot2),
73  Q.w_(j) * (1 - eta(0)), &qp2);
74  LinOp.evaluateIntegrand(super_space, qp1, qp2, intval);
75  }
76  }
77  BEMBEL_UNUSED_(ffield_qnodes1);
78  BEMBEL_UNUSED_(ffield_qnodes2);
79  return;
80 }
81 } // namespace DuffyTrick
82 } // namespace Bembel
83 
84 #endif // BEMBEL_SRC_DUFFYTRICK_INTEGRATE3_HPP_
The ElementTreeNode corresponds to an element in the element tree.
double get_h() const
getter
void integrate3(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
quadrature routine for the common edge case
Definition: integrate3.hpp:28
Eigen::Vector2d tau(double x, double y, int thecase)
computes rotations for the DuffyTrick.
Definition: tau.hpp:26
Eigen::Matrix< double, 12, 1 > SurfacePoint
typedef of SurfacePoint
std::vector< SurfacePoint, Eigen::aligned_allocator< SurfacePoint > > ElementSurfacePoints
typedef std::vector<SurfacePoint> with aligned allocator of Eigen for compatibility with older compil...
Routines for the evalutation of pointwise errors.
Definition: AnsatzSpace.hpp:14
linear operator base class. this serves as a common interface for existing linear operators.
struct containing specifications on the linear operator has to be specialized or derived for any part...