-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathezfdtd.h
110 lines (91 loc) · 2.54 KB
/
ezfdtd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* NOTE: This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Bugs can be reported to Yu Zhang <[email protected]>.
*
* File Name : ezfdtd.h
* Last Modified : Sat 06 Oct 2012 11:16:54 PM EDT
*/
#ifndef EZFDTD_H
#define EZFDTD_H
#ifndef DEBUG
#define DEBUG 1
#endif
#define POLE_MAX 99
#define TOLERANCE 6.6e-66
#define PI 3.1415926535897932384626434
#define OUTPUTPORTS_MAX 200
typedef struct _DomainData
{
unsigned int x_start;
unsigned int y_start;
unsigned int z_start;
unsigned int x_stop;
unsigned int y_stop;
unsigned int z_stop;
unsigned int boundary_type;
unsigned int thickness;
unsigned int size_x;
unsigned int size_y;
unsigned int size_z;
} DomainData;
/* dimension */
enum{dim_t, dim_x, dim_y, dim_z};
/* partition index */
enum{partition_main, partition_z0, partition_z1, partition_x0, partition_x1, partition_y0, partition_y1};
/* boundary types */
enum{boundary_air, boundary_pec, boundary_pmc, boundary_pml, boundary_mur};
/* mode */
extern unsigned int mode;
enum{mode_full, mode_tmx, mode_tmy, mode_tmz, mode_tex, mode_tey, mode_tez};
/* polarization */
enum{p_0, p_ex, p_ey, p_ez, p_hx, p_hy, p_hz};
/* pml types */
extern unsigned int pml_type;
enum{pml_pml, pml_cpml};
/* constants */
extern double MU0;
extern double C0;
extern double EPSILON0;
/* discretization */
extern double d_x;
extern double d_y;
extern double d_z;
extern double d_t;
/* simulation time */
extern unsigned int total_timesteps;
/* grid size */
extern unsigned int abc_size;
extern unsigned int total_x;
extern unsigned int total_y;
extern unsigned int total_z;
/* the fields */
extern double ***ex;
extern double ***ey;
extern double ***ez;
extern double ***hx;
extern double ***hy;
extern double ***hz;
extern double ***dx;
extern double ***dy;
extern double ***dz;
extern double ***bx;
extern double ***by;
extern double ***bz;
/* the excitation sources */
extern double ***dipole_ex;
extern double ***dipole_ey;
extern double ***dipole_ez;
extern double ***dipole_hx;
extern double ***dipole_hy;
extern double ***dipole_hz;
/* domain partition */
extern DomainData partition_data[7];
#endif