OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
vector_ops.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_OPS_VECTOR_OPS_I
19#define BEM_RWG_OPS_VECTOR_OPS_I
20
21#include <stdexcept>
22
23#include "types.hpp"
26
27
28namespace bem::rwg
29{
30
31template <typename ObsIntegratorType>
33 const Complex k,
34 const Triangle<3>& obs_tri,
35 const Triangle<3>& src_tri
36 )
37{
38
41 transform_coordinates(obs_tri_local, src_tri_local, obs_tri, src_tri);
42
43 obs_integrator_.set_compute_terms(true, true, true, true);
44 const ObsResult obs_result = obs_integrator_.integrate(k, obs_tri_local, src_tri_local);
45
47
48 ops.middleRows(0, 3) = vector_single_layer_.assemble(k, obs_tri_local, src_tri_local.to_3d(), obs_result);
49 ops.middleRows(3, 3) = vector_double_layer_pv_.assemble(k, obs_tri_local, src_tri_local.to_3d(), obs_result);
50 ops.middleRows(6, 3) = rot_vector_single_layer_.assemble(k, obs_tri_local, src_tri_local.to_3d(), obs_result);
51 ops.middleRows(9, 3) = rot_vector_double_layer_pv_.assemble(k, obs_tri_local, src_tri_local.to_3d(), obs_result);
52
53 if (!helmholtz_kernel_)
54 {
55 Complex h = scalar_single_layer_.assemble(k, obs_tri_local, src_tri_local.to_3d(), obs_result)[0] / k / k;
56 ops.middleRows(0, 3) -= h * obs_tri.edge_polarities().transpose() * src_tri.edge_polarities();
57
58 EigMatMN<Complex, 3, 1> rot_h = rot_grad_scalar_single_layer_.assemble(
60 ) / k / k;
61 ops.middleRows(6, 3) += rot_h * src_tri.edge_polarities();
62 }
63
64 return ops;
65
66};
67
68}
69
70#endif
EigMatMN< Complex, 12, 3 > compute(const Complex k, const Triangle< 3 > &obs_tri, const Triangle< 3 > &src_tri) override
Computes the operator values for the given observation and source triangles.
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