TDMS
Time Domain Maxwell Solver
Toggle main menu visibility
Loading...
Searching...
No Matches
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
10
namespace
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
15
const
std::string VERSION = std::string(TDMS_VERSION);
16
#else
17
const
std::string VERSION =
"v1"
;
18
#endif
19
20
}
// namespace tdms
21
22
// ******************
23
// Type Definitions
24
// ******************
25
26
typedef
int
*IArray_1d;
27
typedef
IArray_1d *IArray_2d;
28
typedef
IArray_2d *IArray_3d;
29
30
typedef
double
*DArray_1d;
31
typedef
DArray_1d *DArray_2d;
32
typedef
DArray_2d *DArray_3d;
33
34
typedef
std::complex<double> *CArray_1d;
35
typedef
CArray_1d *CArray_2d;
36
typedef
CArray_2d *CArray_3d;
37
38
typedef
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;
47
}
PlanarInterface
;
48
49
typedef
struct
complex_vector
{
50
std::complex<double> X;
51
std::complex<double> Y;
52
std::complex<double> Z;
53
}
complex_vector
;
54
55
enum
AxialDirection { X =
'x'
, Y =
'y'
, Z =
'z'
};
56
57
/**
58
* Enum defining a mapping to integers used in the MATLAB initialisation
59
*/
60
enum
FieldComponents
{ Ex = 1, Ey, Ez, Hx, Hy, Hz };
61
62
// **********************
63
// Enumerated constants
64
// **********************
65
66
enum
ModeOfRun { Pass1, Pass2 };
67
enum
RCSType { parallel, perpendicular };
68
69
// **************************************
70
// Mathematical Constants
71
// **************************************
72
73
namespace
tdms_math_constants {
74
const
double
DCPI = 3.14159265358979323846;
// Pi
75
const
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
83
namespace
tdms_phys_constants {
84
const
double
EPSILON0 = 8.85400e-12;
// free space electric permitivity
85
const
double
MU0 = 4.0 * tdms_math_constants::DCPI *
86
1.0e-7;
// free space magnetic permeability
87
const
double
LIGHT_V = 1.0 / sqrt(EPSILON0 * MU0);
// free space light velocity
88
const
double
Z0 = 376.734;
// free space inpedance
89
}
// namespace tdms_phys_constants
FieldComponents
FieldComponents
Definition
globals.h:60
PlanarInterface
Definition
globals.h:40
complex_vector
Definition
globals.h:49
tdms
include
globals.h
Generated by
1.17.0