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/* config.h is generated by CMake at configure time and placed on the include
39 path. The old win32/nec2++/config.h branch is gone — CMake generates the
40 header for all platforms (Linux, macOS, Windows, WASM). */
41#include "config.h"
42
43#ifndef build_version
44 #define nec_version NECPP_VERSION " [" nec_build_date "]"
45#else
46 #define nec_version build_version " [" nec_build_date "]"
47#endif
48
49#define UNUSED(x) {(void)(x);}
50/*
51 These are some common constants that should be moved into more appropriate locations
52*/
53
54#define ACCS 1.E-12
55#define CONST2 4.771341188
56
57#define SMIN 1.e-3
58
59
68enum excitation_type
69{
70 EXCITATION_VOLTAGE = 0,
71 EXCITATION_LINEAR = 1,
72 EXCITATION_CIRC_RIGHT = 2,
73 EXCITATION_CIRC_LEFT = 3,
74 EXCITATION_CURRENT = 4,
75 EXCITATION_VOLTAGE_DISC = 5
76};