OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
inf_gap.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 "types.hpp"
23
24
25namespace bem::rwg
26{
27
29{
31
32 for (Index rhs = 0; rhs < num_excitations(); ++rhs)
33 {
34 for (Index seg = 0; seg < segments_[rhs].cols() - 1; ++seg)
35 {
37 segments_[rhs].col(seg),
38 segments_[rhs].col((seg + 1))
39 );
40
41 for (uint8_t ii = 0; ii < 3; ++ii)
42 {
43 if (
44 line_segment.point_on_edge(obs_tri.v(ii), tol_) &&
45 line_segment.point_on_edge(obs_tri.v((ii + 1) % 3), tol_)
46 )
47 {
48 EigColVecN<Float, 3> edge_vec = obs_tri.v((ii + 1) % 3) - obs_tri.v(ii);
49 Float sign = (edge_vec).dot(line_segment.v(1) - line_segment.v(0));
50 sign /= std::abs(sign);
51 result(ii, rhs) = sign * obs_tri.edge_polarities(ii) * amp_[rhs] / two;
52 }
53 }
54 }
55 }
56
57 return result;
58};
59
60}
61
Index num_excitations() const override
Returns the number of excitations (right-hand sides) to be generated.
Definition inf_gap.hpp:97
EigMatNX< Complex, 3 > compute(const Complex k, const Triangle< 3 > &obs_tri) override
Computes the gap excitation coefficients.
Definition inf_gap.cpp:28
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
Eigen::Matrix< T, N, Eigen::Dynamic > EigMatNX
Fixed-height matrix with N rows containing type T.
Definition types.hpp:78
std::size_t Index
Unsigned integer type for indices and container sizes.
Definition types.hpp:54
Namespace for RWG-based BEM functionality.