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_OBS_STRATEGIC_I
19#define BEM_RWG_OPINT_OBS_STRATEGIC_I
20
21#include "types.hpp"
22#include "constants.hpp"
25
26
27namespace bem::rwg
28{
29
30template <typename ObsTriangleQuadratureType, typename SrcTriangleQuadratureType, typename LineQuadratureType>
32 const Complex k,
33 const Triangle<3>& obs_tri,
34 const Triangle<2>& src_tri
35 )
36{
37
38 Float dist = (obs_tri.centroid() - src_tri.to_3d().centroid()).norm();
39 Float dist_wvl = dist * std::real(k) / two_pi;
40 Float longest_edge_wvl = src_tri.longest_edge_length() * std::real(k) / two_pi;
41
43 Float skin_depth = -one / std::imag(k);
44 if (std::isfinite(skin_depth) && settings_.threshold_skin_depths > float_eps)
45 if (dist > std::max(settings_.threshold_skin_depths * skin_depth, 2 * src_tri.longest_edge_length()))
46 return ObsResult();
47
48 Float threshold_wvl = std::max(
49 settings_.threshold_wvl_singularity,
50 (Float)0.1
51 );
52 Float threshold_dist = std::max(
53 settings_.threshold_dist_singularity,
54 src_tri.longest_edge_length() * 5
55 );
56 Float threshold_line_int = std::min(
57 settings_.threshold_length_line_int,
58 one
59 );
60
62
67 );
68
69 bool singularity_separation = false;
70
72 {
73 line_.set_compute_terms(base::compute_g_term_, base::compute_rs_g_terms_, base::compute_grad_g_terms_, base::compute_rot_grad_g_terms_);
74 return line_.integrate(k, obs_tri, src_tri);
75 }
77 {
78 sthgf_.set_compute_terms(base::compute_g_term_, base::compute_rs_g_terms_, base::compute_grad_g_terms_, base::compute_rot_grad_g_terms_);
79 return sthgf_.integrate(k, obs_tri, src_tri);
80 }
82 {
83 shgf_.set_compute_terms(base::compute_g_term_, base::compute_rs_g_terms_, base::compute_grad_g_terms_, base::compute_rot_grad_g_terms_);
84 return shgf_.integrate(k, obs_tri, src_tri);
85 }
86 else
87 {
88 hgf_.set_compute_terms(base::compute_g_term_, base::compute_rs_g_terms_, base::compute_grad_g_terms_, base::compute_rot_grad_g_terms_);
89 return hgf_.integrate(k, obs_tri, src_tri);
90 }
91
92};
93
94}
95
96#endif
static uint8_t common_vertices(const Triangle< dim > &triangle1, const Triangle< dim > &triangle2, const Float tol=GEOMETRY_DEFAULT_TOL)
Returns the number of vertices common or coinciding between two Triangle objects.
ObsResult integrate(const Complex k, const Triangle< 3 > &obs_tri, const Triangle< 2 > &src_tri) override
Computes the integral over the source triangle.
Definition strategic.tpp:31
const Float float_eps
Numerical infinitesimal.
Definition constants.hpp:70
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 observation triangle.
Definition base.hpp:37