OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
function_space.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_FUNCSP_H
19#define BEM_RWG_FUNCSP_H
20
21#include <functional>
22
23#include "types.hpp"
26
27
28namespace bem
29{
30// Forward declarations
31template <typename T> class MatrixBase;
32template <uint8_t dim> class TriangleMesh;
33}
34
35
36namespace bem::rwg
37{
38
49class Rwg
50{
51public:
52
59 { return tri.edge_polarities() / tri.area() / two; };
60
61
72 const Triangle<3>& tri,
75 const bool rotated = false
76 );
77
78
96 const Triangle<3>& tri,
99 const bool rotated = false
100 );
101
102
112 const TriangleMesh<3>& mesh,
115 const bool rotated = false
116 );
117
118};
119
120
124class Pulse
125{
126public:
127
134 { return one / tri.area(); };
135
136
145 {
146 return EigRowVec<Float>::Constant(1, points.cols(), normalization(tri));
147 }
148
149
165 static Complex test_field(
166 const Triangle<3>& tri,
169 );
170
171
180 const TriangleMesh<3>& mesh,
183 );
184
185};
186
191}
192
193#ifndef BEM_LINKED
194#include "rwg/function_space.cpp"
195#endif
196
197#endif
Class for operations associated with pulse functions.
static Float normalization(const Triangle< 3 > &tri)
Defines the normalization factor for the pulse function associated with a given triangle.
static EigRowVec< Complex > reconstruct_field(const TriangleMesh< 3 > &mesh, const MatrixBase< Complex > &coeffs, ConstEigRef< EigMatNX< Float, 3 > > points)
Reconstructs a scalar field expressed with pulse functions on a given triangle mesh.
static EigRowVec< Float > value(const Triangle< 3 > &tri, ConstEigRef< EigMatNX< Float, 3 > > points)
Evaluates the value of the pulse function associated with a given triangle at a given set of points i...
static Complex test_field(const Triangle< 3 > &tri, std::function< EigRowVec< Complex >(ConstEigRef< EigMatNX< Float, 3 > >)> field_eval, TriangleQuadratureBase< 3 > &tri_quad)
Tests a field on the pulse function associated with a given triangle.
Class for operations associated with RWG functions.
static EigMatNX< Complex, 3 > reconstruct_field(const TriangleMesh< 3 > &mesh, const MatrixBase< Complex > &coeffs, ConstEigRef< EigMatNX< Float, 3 > > points, const bool rotated=false)
Reconstructs a vector field expressed with RWG functions on a given triangle mesh.
static EigMatNX< Float, 3 > value(const Triangle< 3 > &tri, uint8_t edge, ConstEigRef< EigMatNX< Float, 3 > > points, const bool rotated=false)
Evaluates the value of the RWG function associated with a given edge of a given triangle at a given s...
static EigColVecN< Complex, 3 > test_field(const Triangle< 3 > &tri, std::function< EigMatNX< Complex, 3 >(ConstEigRef< EigMatNX< Float, 3 > >)> field_eval, TriangleQuadratureBase< 3 > &tri_quad, const bool rotated=false)
Tests a field on the RWG functions associated with the edges of a given triangle.
static EigRowVecN< Float, 3 > normalization(const Triangle< 3 > &tri)
Defines the normalization factor for each RWG function associated with a given triangle.
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
Definition types.hpp:98
Eigen::Matrix< T, 1, Eigen::Dynamic > EigRowVec
Dynamic-size row vector containing type T.
Definition types.hpp:90
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.
Primary namespace for the OpenBEM library.
Definition constants.hpp:31