Bembel
QuadratureVector.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_QUADRATUREVECTOR_HPP_
13 #define BEMBEL_SRC_QUADRATURE_QUADRATUREVECTOR_HPP_
14 
15 namespace Bembel {
16 
23 template <template <unsigned int qrOrder> class QuadratureRule,
24  unsigned int Order>
27  QuadratureRule<Order + 1> QR;
28  Q_.xi_ = Eigen::Map<Eigen::VectorXd>(QR.xi_.data(), QR.xi_.size());
29  Q_.w_ = Eigen::Map<Eigen::VectorXd>(QR.w_.data(), QR.w_.size());
30  }
31  QuadratureVector<QuadratureRule, Order - 1> remainingQuadratures_;
32  const Quadrature<1> &operator[](unsigned int i) const {
33  return (i == Order) ? Q_ : remainingQuadratures_[i];
34  }
35 
36  Quadrature<1> Q_;
37 };
38 
47 template <template <unsigned int qrOrder> class QuadratureRule>
48 struct QuadratureVector<QuadratureRule, 0> {
50  QuadratureRule<1> QR;
51  Q_.xi_ = Eigen::Map<Eigen::VectorXd>(QR.xi_.data(), QR.xi_.size());
52  Q_.w_ = Eigen::Map<Eigen::VectorXd>(QR.w_.data(), QR.w_.size());
53  }
54  Quadrature<1> Q_;
55  const Quadrature<1> &operator[](unsigned int i) const { return Q_; }
56 };
57 } // namespace Bembel
58 #endif // BEMBEL_SRC_QUADRATURE_QUADRATUREVECTOR_HPP_
Routines for the evalutation of pointwise errors.
Definition: AnsatzSpace.hpp:14
this struct wraps all the defined quadrature Rules in a nice structure overloading the [] operator su...