OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
base.hpp
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_BASE_H
19#define BEM_RWG_OPINT_SRC_BASE_H
20
21#include "types.hpp"
23
24
25namespace bem::rwg
26{
27
37{
41 // EigMatNX<Complex, 3> xs_grad_g, ys_grad_g;
42 void resize(Index n) {
43 g.resize(1, n); rs_g.resize(2, n); grad_g.resize(3, n);
44 g.setZero(); rs_g.setZero(); grad_g.setZero();
45 return;
46 };
47};
48
49
54{
55public:
56
65 const Complex k,
66 const Triangle<2>& src_tri,
68 ) = 0;
69
70
96 virtual void set_compute_terms(
97 bool compute_g_terms,
99 )
100 {
101 compute_g_terms_ = compute_g_terms;
102 compute_grad_g_terms_ = compute_grad_g_terms;
103 return;
104 };
105
106
115 const Complex k,
116 const Triangle<2>& src_tri,
118 ) { SrcResult result; result.resize(r_obs.cols()); return result; };
119
120
121protected:
122
123 bool compute_g_terms_ = true;
124 bool compute_grad_g_terms_ = true;
125
126};
127
132}
133
134#endif
Base class for integration over the source triangle for RWG-based BEM operators.
Definition base.hpp:54
virtual SrcResult integrate(const Complex k, const Triangle< 2 > &src_tri, ConstEigRef< EigMatNX< Float, 3 > > r_obs)=0
Computes the integral over the source triangle.
virtual void set_compute_terms(bool compute_g_terms, bool compute_grad_g_terms)
Sets flags defining which terms to compute during integration.
Definition base.hpp:96
virtual SrcResult zeros(const Complex k, const Triangle< 2 > &src_tri, ConstEigRef< EigMatNX< Float, 3 > > r_obs)
Returns a result of zeros of the appropriate size.
Definition base.hpp:114
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
Definition types.hpp:98
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
std::size_t Index
Unsigned integer type for indices and container sizes.
Definition types.hpp:54
Namespace for RWG-based BEM functionality.
Data structure to hold the results of integration over the source triangle.
Definition base.hpp:37