OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
strategic.tpp
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_OPINT_SRC_STRATEGIC_I
19#define BEM_RWG_OPINT_SRC_STRATEGIC_I
20
21#include "types.hpp"
22#include "constants.hpp"
24
25
26namespace bem::rwg
27{
28
29template <typename TriangleQuadratureType, typename LineQuadratureType>
31 const Complex k,
32 const Triangle<2>& src_tri,
34 )
35{
36
38 src_tri_centroid.topRows(2) = src_tri.centroid();
40
41 Float min_dist = r_obs_dist.minCoeff();
42 Float min_dist_wvl = min_dist * std::real(k) / two_pi;
43 Float longest_edge_wvl = src_tri.longest_edge_length() * std::real(k) / two_pi;
44
45 Float skin_depth = -one / std::imag(k);
46 if (std::isfinite(skin_depth) && settings_.threshold_skin_depths > float_eps)
47 if (min_dist > std::max(settings_.threshold_skin_depths * skin_depth, 2 * src_tri.longest_edge_length()))
48 return src_hgf_.zeros(k, src_tri, r_obs);
49
50 Float threshold_wvl = std::max(
51 settings_.threshold_wvl_singularity,
52 (Float)0.1
53 );
54 Float threshold_dist = std::max(
55 settings_.threshold_dist_singularity,
56 src_tri.longest_edge_length() * 5
57 );
58 Float threshold_line_int = std::min(
59 settings_.threshold_length_line_int,
60 one
61 );
62
65 bool singularity_separation = false;
66
68 {
69 src_line_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
70 return src_line_.integrate(k, src_tri, r_obs);
71 }
73 {
74 src_sthgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
75 return src_sthgf_.integrate(k, src_tri, r_obs);
76 }
78 {
79 src_shgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
80 return src_shgf_.integrate(k, src_tri, r_obs);
81 }
82 else
83 {
84 src_hgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
85 return src_hgf_.integrate(k, src_tri, r_obs);
86 }
87
88};
89
90}
91
92#endif
SrcResult integrate(const Complex k, const Triangle< 2 > &src_tri, ConstEigRef< EigMatNX< Float, 3 > > r_obs) override
Computes the integral over the source triangle.
Definition strategic.tpp:30
const Float float_eps
Numerical infinitesimal.
Definition constants.hpp:70
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
Namespace for RWG-based BEM functionality.
Data structure to hold the results of integration over the source triangle.
Definition base.hpp:37