OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
gauss.cpp
Go to the documentation of this file.
1// OpenBEM - Copyright (C) 2026 Shashwat Sharma
2
3// This file is part of OpenBEM.
4
5// OpenBEM is free software: you can redistribute it and/or modify it under the terms of the
6// GNU General Public License as published by the Free Software Foundation, either version 3
7// of the License, or (at your option) any later version.
8
9// You should have received a copy of the GNU General Public License along with OpenBEM.
10// If not, see <https://www.gnu.org/licenses/>.
11
12
19
20#include <functional>
21
22#include "types.hpp"
23
24
25namespace bem
26{
27
28template <uint8_t dim>
30{
31 if (order > LINE_MAX_ORDER)
32 throw std::domain_error(
33 "GaussLineQuadrature::set_order(): order must be less than or equal to "
34 + std::to_string(LINE_MAX_ORDER) + "."
35 );
36
37 base::order_ = order;
38 base::points_.resize(dim, rules_[order - 1].num_nodes);
39 base::weights_.resize(1, rules_[order - 1].num_nodes);
40 base::points_weights_computed_ = false;
41
42 return;
43};
44
45
46template <uint8_t dim>
51 )
52{
54 Float p_len = p.norm();
55
56 base::points_.noalias() = (p * ref_points()).colwise() + p1;
57 base::weights_.noalias() = ref_weights() * p_len;
58 base::points_weights_computed_ = true;
59
60 return;
61};
62
63
64template class GaussLineQuadrature<1>;
65template class GaussLineQuadrature<2>;
66template class GaussLineQuadrature<3>;
67
68}
void compute_points_weights(ConstEigRef< EigColVecN< Float, dim > > p1, ConstEigRef< EigColVecN< Float, dim > > p2, std::function< EigRowVec< Complex >(ConstEigRef< EigMatNX< Float, dim > >)> eval={}) override
Computes and stores the points on which to evaluate the integrand, and the corresponding weights.
Definition gauss.cpp:47
void set_order(const uint8_t order) override
Sets the quadrature order.
Definition gauss.cpp:29
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
Definition types.hpp:98
double Float
Floating point number.
Definition types.hpp:47
Eigen::Matrix< T, N, 1 > EigColVecN
Fixed-size column vector of size N containing type T.
Definition types.hpp:86
Primary namespace for the OpenBEM library.
Definition constants.hpp:31