OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
generic.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_GENERIC_I
19#define BEM_RWG_OPS_GENERIC_I
20
21#include <stdexcept>
22
23#include "types.hpp"
24#include "constants.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
39 switch (op_name_)
40 {
41
42 case OperatorName::VECTOR_SINGLE_LAYER:
43 {
44 return vector_single_layer_.compute(k, obs_tri, src_tri);
45 }
46
47 case OperatorName::ROT_VECTOR_SINGLE_LAYER:
48 {
49 return rot_vector_single_layer_.compute(k, obs_tri, src_tri);
50 }
51
52 case OperatorName::VECTOR_DOUBLE_LAYER_PV:
53 {
54 return vector_double_layer_pv_.compute(k, obs_tri, src_tri);
55 }
56
57 case OperatorName::ROT_VECTOR_DOUBLE_LAYER_PV:
58 {
59 return rot_vector_double_layer_pv_.compute(k, obs_tri, src_tri);
60 }
61
62 case OperatorName::VECTOR_HYPERSINGULAR:
63 {
64 return vector_hypersingular_.compute(k, obs_tri, src_tri);
65 }
66
67 case OperatorName::ROT_VECTOR_HYPERSINGULAR:
68 {
69 return rot_vector_hypersingular_.compute(k, obs_tri, src_tri);
70 }
71
72 case OperatorName::RWG_RWG:
73 {
74 return rwg_rwg_.compute(k, obs_tri, src_tri);
75 }
76
77 case OperatorName::ROT_RWG_RWG:
78 {
79 return rot_rwg_rwg_.compute(k, obs_tri, src_tri);
80 }
81
82 default:
83 throw std::logic_error(
84 "GenericRwg: `OperatorName` is invalid or not implemented."
85 );
86 }
87
88};
89
90
91template <typename ObsIntegratorType>
93 const Complex k,
94 const Triangle<3>& obs_tri,
95 const Triangle<3>& src_tri
96 )
97{
98
99 switch (op_name_)
100 {
101
102 case OperatorName::SCALAR_SINGLE_LAYER:
103 {
104 return scalar_single_layer_.compute(k, obs_tri, src_tri);
105 }
106
107 default:
108 throw std::invalid_argument(
109 "GenericPulse: `OperatorName` is invalid or not implemented."
110 );
111 }
112
113};
114
115}
116
117#endif
EigMatMN< Complex, 1, 1 > compute(const Complex k, const Triangle< 3 > &obs_tri, const Triangle< 3 > &src_tri) override
Computes the operator value for the given observation and source triangles.
Definition generic.tpp:92
EigMatMN< Complex, 3, 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.
Definition generic.tpp:32
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.