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
46 Float skin_depth = -one / std::imag(k);
47 if (std::isfinite(skin_depth) && settings_.threshold_skin_depths > float_eps)
48 if (min_dist > std::max(settings_.threshold_skin_depths * skin_depth, 2 * src_tri.longest_edge_length()))
49 return src_hgf_.zeros(k, src_tri, r_obs);
50
51 Float threshold_wvl = std::max(
52 settings_.threshold_wvl_singularity,
53 (Float)0.1
54 );
55 Float threshold_dist = std::max(
56 settings_.threshold_dist_singularity,
57 src_tri.longest_edge_length() * 5
58 );
59 Float threshold_line_int = std::min(
60 settings_.threshold_length_line_int,
61 one
62 );
63
66 bool singularity_separation = false;
67
69 {
70 src_line_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
71 return src_line_.integrate(k, src_tri, r_obs);
72 }
74 {
75 src_sthgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
76 return src_sthgf_.integrate(k, src_tri, r_obs);
77 }
79 {
80 src_shgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
81 return src_shgf_.integrate(k, src_tri, r_obs);
82 }
83 else
84 {
85 src_hgf_.set_compute_terms(base::compute_g_terms_, base::compute_grad_g_terms_);
86 return src_hgf_.integrate(k, src_tri, r_obs);
87 }
88
89};
90
91}
92
93#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