Bembel
TensorProductQuadratureVector.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_QUADRATURE_TENSORPRODUCTQUADRATUREVECTOR_HPP_
13 #define BEMBEL_SRC_QUADRATURE_TENSORPRODUCTQUADRATUREVECTOR_HPP_
14 
15 namespace Bembel {
16 
21 template <template <unsigned int qrOrder> class QuadratureRule,
22  unsigned int Order>
25  QuadratureRule<Order + 1> GL;
26  Q_.xi_.resize(2, GL.xi_.size() * GL.xi_.size());
27  Q_.w_.resize(GL.w_.size() * GL.w_.size());
28  for (auto k = 0; k < Q_.xi_.cols(); ++k) {
29  Q_.xi_.col(k) << GL.xi_[k / GL.xi_.size()], GL.xi_[k % GL.xi_.size()];
30  Q_.w_(k) = GL.w_[k / GL.w_.size()] * GL.w_[k % GL.w_.size()];
31  }
32  }
33  Cubature Q_;
34  TensorProductQuadratureVector<QuadratureRule, Order - 1>
35  remainingQuadratures_;
36  const Cubature &operator[](unsigned int i) const {
37  return (i == Order) ? Q_ : remainingQuadratures_[i];
38  }
39 };
40 
45 template <template <unsigned int qrOrder> class QuadratureRule>
46 struct TensorProductQuadratureVector<QuadratureRule, 0> {
48  QuadratureRule<1> GL;
49  Q_.xi_.resize(2, GL.xi_.size() * GL.xi_.size());
50  Q_.w_.resize(GL.w_.size() * GL.w_.size());
51  for (auto k = 0; k < Q_.xi_.cols(); ++k) {
52  Q_.xi_.col(k) << GL.xi_[k / GL.xi_.size()], GL.xi_[k % GL.xi_.size()];
53  Q_.w_(k) = GL.w_[k / GL.w_.size()] * GL.w_[k % GL.w_.size()];
54  }
55  }
56  Cubature Q_;
57  const Cubature &operator[](unsigned int i) const { return Q_; }
58 };
59 
60 } // namespace Bembel
61 #endif // BEMBEL_SRC_QUADRATURE_TENSORPRODUCTQUADRATUREVECTOR_HPP_
Routines for the evalutation of pointwise errors.
Definition: AnsatzSpace.hpp:14