OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
inf_gap.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 BEM_RWG_EXC_INF_GAP_H
19#define BEM_RWG_EXC_INF_GAP_H
20
21#include <stdexcept>
22#include <vector>
23
24#include "types.hpp"
26
27
28namespace bem
29{
30// Forward declarations
31template <uint8_t dim> class Triangle;
32}
33
34
35namespace bem::rwg
36{
37
43
53{
54public:
55
75 const std::vector<EigMatNX<Float, 3>>& segments,
77 const Float tol = INF_GAP_DEFAULT_TOL
78 ):
79 segments_(segments),
80 amp_(amp),
81 tol_(tol)
82 {
83 if (segments_.size() != amp_.cols())
84 {
85 throw std::invalid_argument(
86 "InfinitesimalGap: `segments` and `amp` must have the same number of columns."
87 );
88 }
89 return;
90 };
91
92
97 Index num_excitations() const override { return amp_.cols(); };
98
99
115 EigMatNX<Complex, 3> compute(const Complex k, const Triangle<3>& obs_tri) override;
116
117
118private:
119
120 const std::vector<EigMatNX<Float, 3>> segments_;
121 const EigRowVec<Complex> amp_;
122 const Float tol_ = INF_GAP_DEFAULT_TOL;
123
124};
125
130}
131
132#ifndef BEM_LINKED
134#endif
135
136#endif
Base class for generating excitation coefficients for RWG-based BEM systems.
Definition base.hpp:45
Class for setting infinitesimal gap excitation coefficients for RWG-based BEM systems.
Definition inf_gap.hpp:53
Index num_excitations() const override
Returns the number of excitations (right-hand sides) to be generated.
Definition inf_gap.hpp:97
InfinitesimalGap(const std::vector< EigMatNX< Float, 3 > > &segments, ConstEigRef< EigRowVec< Complex > > amp, const Float tol=INF_GAP_DEFAULT_TOL)
Constructs an InfinitesimalGap object along a given set of line segments.
Definition inf_gap.hpp:74
EigMatNX< Complex, 3 > compute(const Complex k, const Triangle< 3 > &obs_tri) override
Computes the gap excitation coefficients.
Definition inf_gap.cpp:28
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
Namespace for RWG-based BEM functionality.
const Float INF_GAP_DEFAULT_TOL
Default tolerance used to identify mesh edges to associate with the infinitesimal gap coordinates.
Definition inf_gap.hpp:42
Primary namespace for the OpenBEM library.
Definition constants.hpp:31