OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
utility.hpp
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
18#ifndef QUAD_UTILITY_H
19#define QUAD_UTILITY_H
20
21#include <vector>
22#include <string>
23
24#include "types.hpp"
25
26#ifndef BEM_LINKED
27#define BEM_INLINE inline
28#else
29#define BEM_INLINE
30#endif
31
32
33namespace bem
34{
35
54BEM_INLINE bool compare_with_tol(
55 const Complex val,
56 const Complex val_ref,
57 const Float tol = 1e-3,
58 const uint8_t mode = 1
59 );
60
61
66template <uint8_t dim>
68{
69 Index num_nodes;
71 EigRowVec<Float> weights;
72};
73
74
83template <uint8_t dim>
84std::vector<QuadratureRule<dim>> load_rules(
85 const std::string file,
87 );
88
93}
94
95#ifndef BEM_LINKED
97#endif
98
99#endif
100
std::vector< QuadratureRule< dim > > load_rules(const std::string file, ConstEigRef< EigColVec< Index > > orders)
Loads quadrature rules from the specified json file assumed to be located in the same directory as th...
Definition utility.cpp:84
bool compare_with_tol(const Complex val, const Complex val_ref, const Float tol, const uint8_t mode)
Compares two complex numbers within a given tolerance based on a given rule.
Definition utility.cpp:36
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
std::complex< Float > Complex
Complex floating point number.
Definition types.hpp:51
Eigen::Matrix< T, N, 1 > EigColVecN
Fixed-size column vector of size N containing type T.
Definition types.hpp:86
std::size_t Index
Unsigned integer type for indices and container sizes.
Definition types.hpp:54
Primary namespace for the OpenBEM library.
Definition constants.hpp:31
Data structure defining a quadrature rule.
Definition utility.hpp:68