TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
globals.h
Go to the documentation of this file.
1/**
2 * @file globals.h
3 * @brief Type definitions and global constants.
4 */
5#pragma once
6
7#include <complex>
8#include <string>
9
10namespace tdms {
11
12// TDMS_VERSION might have been defined in CMake from git tags or the git
13// branch, if not then we assume it's a development version
14#ifdef TDMS_VERSION
15const std::string VERSION = std::string(TDMS_VERSION);
16#else
17const std::string VERSION = "v1";
18#endif
19
20}// namespace tdms
21
22// ******************
23// Type Definitions
24// ******************
25
26typedef int *IArray_1d;
27typedef IArray_1d *IArray_2d;
28typedef IArray_2d *IArray_3d;
29
30typedef double *DArray_1d;
31typedef DArray_1d *DArray_2d;
32typedef DArray_2d *DArray_3d;
33
34typedef std::complex<double> *CArray_1d;
35typedef CArray_1d *CArray_2d;
36typedef CArray_2d *CArray_3d;
37
38typedef struct PlanarInterface// Structure definition for a planar six-face
39 // interface
40{
41 int I1;
42 int I2;
43 int J1;
44 int J2;
45 int K1;
46 int K2;
48
49typedef struct complex_vector {
50 std::complex<double> X;
51 std::complex<double> Y;
52 std::complex<double> Z;
54
55enum AxialDirection { X = 'x', Y = 'y', Z = 'z' };
56
57/**
58 * Enum defining a mapping to integers used in the MATLAB initialisation
59 */
60enum FieldComponents { Ex = 1, Ey, Ez, Hx, Hy, Hz };
61
62// **********************
63// Enumerated constants
64// **********************
65
66enum ModeOfRun { Pass1, Pass2 };
67enum RCSType { parallel, perpendicular };
68
69// **************************************
70// Mathematical Constants
71// **************************************
72
73namespace tdms_math_constants {
74const double DCPI = 3.14159265358979323846;// Pi
75const std::complex<double> IMAGINARY_UNIT =
76 std::complex<double>(0.0, 1.0);// Imaginary unit
77}// namespace tdms_math_constants
78
79// **************************************
80// Physical Constants
81// **************************************
82
83namespace tdms_phys_constants {
84const double EPSILON0 = 8.85400e-12;// free space electric permitivity
85const double MU0 = 4.0 * tdms_math_constants::DCPI *
86 1.0e-7;// free space magnetic permeability
87const double LIGHT_V = 1.0 / sqrt(EPSILON0 * MU0);// free space light velocity
88const double Z0 = 376.734; // free space inpedance
89}// namespace tdms_phys_constants
FieldComponents
Definition globals.h:60
Definition globals.h:40
Definition globals.h:49