Acoustic FDTD Solver
constant.hpp
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 #include <utility>
4 #include <set>
5 #include <complex>
6 #include <numeric>
7 #include <algorithm>
8 #include <iostream>
9 #include <fstream>
10 #include <iomanip>
11 #include <sstream>
12 #include <cmath>
13 #include <ctime>
14 #include <cstdlib>
15 #include <cassert>
16 #include <complex>
17 #include <limits>
18 
19 #define EPS_0 8.854187817620389e-12
20 #define MU_0 1.256637061435917e-6
21 #define ETA_0 3.767303134617707e+2
22 #define C_0 2.99792458e8
23 #define PI 3.141592653589793
24 #define ANGL 57.2957795131
26 #define SHAPE_CIRCLE 401
27 #define SHAPE_RECTANGLE 402
28 #define SHAPE_POINT 403
29 #define SHAPE_LINE 404
30 #define SHAPE_PIE 405
31 #define SHAPE_PARALLELO 406
32 #define SHAPE_CUBE 407
33 #define SHAPE_POLYGON 408
34 
35 #define SIGNAL_GM 430
36 #define SIGNAL_SIN 431
37 #define SIGNAL_GAU 432
38 #define SIGNAL_DGAU 433
39 #define SIGNAL_RIC 434
40 
41 #define CREATE_2D_ARRAY(type, data, NJ, NK) \
42  data = new type *[NJ]; \
43  data[0] = new type[NJ*NK]; \
44  for (unsigned i=1; i!=NJ; i++) { \
45  data[i] = data[0]+i*NK; \
46  }
47 
48 #define DELETE_2D_ARRAY(data) \
49  delete [] data[0]; \
50  delete [] data;
51 
52 #define CREATE_1D_ARRAY(type, data, NK) \
53  data = new type[NK]; \
54 
55 #define DELETE_1D_ARRAY(data) \
56  delete [] data;
57 
58 #define ASSIGN_2D_ARRAY(out, in, NJ, NK) \
59  for (unsigned j=0; j!=NJ; j++) \
60  for (unsigned k=0; k!=NK; k++) \
61  out[j][k]=in[j][k];
62 
63 #define PRINT_2D_ARRAY(data, NJ, NK) \
64  for (unsigned j=0; j!=NJ; j++) \
65  for (unsigned k=0; k!=NK; k++) \
66  std::cout << data[j][k] << '\t'; \
67  std::cout << std::endl;
68 /*************************************************************/
69 
70 #define SOURCE_EHS 11
71 #define SOURCE_TFSF 12
72 #define SOURCE_CUR 13
73 #define SOURCE_SAR 14
74 #define SOURCE_PHS 15
75 
76 #define BC_PEC 31
77 #define BC_PMC 32
78 #define BC_MUR 34
79 #define BC_RIGID 35
80 #define BC_PRESS 36
81 #define BC_SUL 38
82 #define BC_PERIODIC 39
83 
84 
85 #define TR 0 // Transient simulation
86 #define TH 1 // Time-harmonic simulation
87 #define SB 2 // Subband simulation
88 
89 #ifdef LOG4CXX
90 #include "log4cxx/logger.h"
91 #include "log4cxx/basicconfigurator.h"
92 #include <log4cxx/patternlayout.h>
93 #endif
94 
95 #ifdef LOG4CXX
96 static log4cxx::LoggerPtr logger;
97 #endif