OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
constants.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 CONSTANTS_H
19#define CONSTANTS_H
20
21#include <cmath>
22#include <limits>
23
24#include "types.hpp"
25
26#ifndef M_PI
27#define M_PI 3.1415926535897932384626
28#endif
29
30namespace bem
31{
32
40const Complex J = Complex(0.0, 1.0);
41
42const Float zero = 0.0;
43const Float one = 1.0;
44const Float two = 2.0;
45const Float four = 4.0;
46const Float half = 0.5;
47
48const Float pi = M_PI;
49const Float two_pi = (Float)(2.0 * M_PI);
50const Float four_pi = (Float)(4.0 * M_PI);
51const Float half_pi = (Float)(0.5 * M_PI);
52const Float quarter_pi = (Float)(M_PI / 4.0);
53
55const Float eps0 = 8.854187817e-12;
56
58const Float mu0 = four_pi * 1.0e-7;
59
61const Float c0 = 1.0 / std::sqrt(eps0 * mu0);
62
64const Float eta0 = std::sqrt(mu0 / eps0);
65
67const Float inf = std::numeric_limits<Float>::infinity();
68
70const Float float_eps = std::numeric_limits<Float>::epsilon();
71
76}
77
78#endif
const Complex J
Imaginary unit.
Definition constants.hpp:40
const Float float_eps
Numerical infinitesimal.
Definition constants.hpp:70
const Float mu0
Vacuum permeability.
Definition constants.hpp:58
const Float c0
Vacuum wave speed.
Definition constants.hpp:61
const Float inf
Numerical infinity.
Definition constants.hpp:67
const Float eps0
Vacuum permittivity.
Definition constants.hpp:55
const Float eta0
Vacuum wave impedance.
Definition constants.hpp:64
double Float
Floating point number.
Definition types.hpp:47
std::complex< Float > Complex
Complex floating point number.
Definition types.hpp:51
Primary namespace for the OpenBEM library.
Definition constants.hpp:31