nec2++ 2.1.1
c_ggrid.h
1/*
2 Copyright (C) 2004-2015 Timothy C.A. Molteno
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18#pragma once
19
20#include "math_util.h"
21#include "common.h"
22#include "misc.h"
23#include "c_evlcom.h"
24
25using namespace std;
26
27
34{
35public:
36 static int m_nxa[3], m_nya[3];
37 static nec_float m_dxa[3], m_dya[3];
38 static nec_float m_xsa[3], m_ysa[3];
39
40 nec_complex m_epscf;
41 complex_array m_ar1, m_ar2, m_ar3;
42
43 c_evlcom m_evlcom;
44
45 void initialize() {
46 m_ar1.resize(11*10*4);
47 m_ar2.resize(17*5*4);
48 m_ar3.resize(9*8*4);
49
50 // initialize interpolation cache
51 m_ip_ixs = -10;
52 m_ip_iys = -10;
53 m_ip_igrs = -10;
54 m_ip_ixeg = 0;
55 m_ip_iyeg = 0;
56 m_ip_dx = 1.0;
57 m_ip_dy = 1.0;
58 m_ip_xs = 0.0;
59 m_ip_ys = 0.0;
60 }
61
62 void interpolate( nec_float x, nec_float y,
63 nec_complex *f1, nec_complex *f2,
64 nec_complex *f3, nec_complex *f4 );
65
66 void sommerfeld( nec_float epr, nec_float sig, nec_float wavelength );
67
68private:
69 // interpolation cache (per-instance, thread-safe)
70 int m_ip_ix, m_ip_iy, m_ip_ixs, m_ip_iys, m_ip_igrs, m_ip_ixeg, m_ip_iyeg;
71 int m_ip_nxm2, m_ip_nym2, m_ip_nxms, m_ip_nyms, m_ip_nd, m_ip_ndp;
72 nec_float m_ip_dx, m_ip_dy, m_ip_xs, m_ip_ys, m_ip_xz, m_ip_yz;
73 nec_complex m_ip_a[4][4], m_ip_b[4][4], m_ip_c[4][4], m_ip_d[4][4];
74};
75
77{
78public:
79 /* common /gwav/ */
80 nec_float r1, r2, zmh, zph;
81 nec_complex u, u2, xx1, xx2;
82
83 void set_u(nec_complex in_u) {
84 u = in_u;
85 u2 = u * u;
86 }
87};
88
89void gwave( nec_complex& erv, nec_complex& ezv,
90 nec_complex& erh, nec_complex& ezh, nec_complex& eph,
91 c_ground_wave& ground_wave);
Definition c_evlcom.h:26
Definition c_ggrid.h:34
void sommerfeld(nec_float epr, nec_float sig, nec_float wavelength)
Definition c_ggrid.cpp:164
void interpolate(nec_float x, nec_float y, nec_complex *f1, nec_complex *f2, nec_complex *f3, nec_complex *f4)
interpolate (was intrp) uses bivariate cubic interpolation to obtain the values of 4 functions at the...
Definition c_ggrid.cpp:38
Definition c_ggrid.h:77