nec2++ 2.1.1
common.h
1#pragma once
2/*
3 Various Definitions for nec2++
4
5 Copyright (C) 2004-2015 Timothy C.A. Molteno
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20*/
21
22#include "typesafe_stdint.h"
23
24#include <complex>
30typedef double nec_float;
31typedef std::complex<nec_float> nec_complex;
32
33/* Version information */
34#ifndef nec_build_date
35 #define nec_build_date NECPP_BUILD_DATE
36#endif
37
38#if defined(WIN32) || defined(_WIN32)
39#include "../win32/nec2++/config.h"
40#else
41#include "config.h"
42#endif
43
44#ifndef build_version
45 #define nec_version NECPP_VERSION " [" nec_build_date "]"
46#else
47 #define nec_version build_version " [" nec_build_date "]"
48#endif
49
50#define UNUSED(x) {(void)(x);}
51/*
52 These are some common constants that should be moved into more appropriate locations
53*/
54
55#define ACCS 1.E-12
56#define CONST2 4.771341188
57
58#define SMIN 1.e-3
59
60
69enum excitation_type
70{
71 EXCITATION_VOLTAGE = 0,
72 EXCITATION_LINEAR = 1,
73 EXCITATION_CIRC_RIGHT = 2,
74 EXCITATION_CIRC_LEFT = 3,
75 EXCITATION_CURRENT = 4,
76 EXCITATION_VOLTAGE_DISC = 5
77};