Bembel
farFieldQuadratureNodes.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 
12 #ifndef BEMBEL_SRC_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
13 #define BEMBEL_SRC_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
14 
15 namespace Bembel {
16 namespace DuffyTrick {
22 template <class T>
23 std::vector<ElementSurfacePoints> computeFfieldQnodes(const T &super_space,
24  const Cubature &Q) {
25  std::vector<ElementSurfacePoints> ffield_qnodes;
26  int next = 0;
27  // assume isotropic mesh width h!
28  double h = (super_space.get_mesh().get_element_tree().cpbegin())->get_h();
29  auto nE = super_space.get_mesh().get_number_of_elements();
30  auto pbegin = super_space.get_mesh().get_element_tree().cpbegin();
31  auto pend = super_space.get_mesh().get_element_tree().cpend();
32  ffield_qnodes.reserve(nE);
33  SurfacePoint surfpt;
34 
35  for (auto it = pbegin; it != pend; ++it) {
36  ffield_qnodes.emplace_back(Q.xi_.cols());
37  for (auto k = 0; k < Q.xi_.cols(); ++k) {
38  // the quadrature weight is scaled by mesh width
39  // this corresponds to a scaling of the basis functions
40  // with respect to the L^2 norm!
41  super_space.map2surface(*it, Q.xi_.col(k), h * Q.w_(k),
42  &ffield_qnodes[it->id_][k]);
43  }
44  }
45  return ffield_qnodes;
46 }
47 } // namespace DuffyTrick
48 } // namespace Bembel
49 #endif // BEMBEL_SRC_DUFFYTRICK_FARFIELDQUADRATURENODES_HPP_
std::vector< ElementSurfacePoints > computeFfieldQnodes(const T &super_space, const Cubature &Q)
evaluates a given quadrature on all surface panels storage format is qNodes.col(k) = [xi,...
Eigen::Matrix< double, 12, 1 > SurfacePoint
typedef of SurfacePoint
Routines for the evalutation of pointwise errors.
Definition: AnsatzSpace.hpp:14