nec2++ 2.1.1
nec_context.h
Go to the documentation of this file.
1#pragma once
2
3/*
4 Copyright (C) 2004-2008,2015 Timothy C.A. Molteno
5 tim@molteno.net
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 <memory>
23
24#include "common.h"
25#include "c_ggrid.h"
26#include "math_util.h"
27#include "matrix_algebra.h"
28#include "electromag.h"
29#include "nec_radiation_pattern.h"
30#include "nec_results.h"
31#include "nec_structure_currents.h"
32#include "nec_output.h"
33#include "nec_ground.h"
34#include "c_plot_card.h"
35
36class c_geometry;
37
38enum excitation_return {
39 FREQ_PRINT_NORMALIZATION = 0,
40 FREQ_LOOP_CONTINUE = 1,
41 FREQ_LOOP_CARD_CONTINUE = 2,
42 FREQ_INNER_LOOP_CONTINUE = 3,
43 FREQ_PHASE_COMPLETE = 4
44};
45
55 PROCESSING_MEMORY_ALLOC = 1,
56 PROCESSING_STRUCTURE_LOADING = 2,
57 PROCESSING_EXCITATION_SETUP = 3,
58 PROCESSING_EXCITATION_LOOP = 4,
59 PROCESSING_NEAR_FIELD = 5,
60 PROCESSING_FAR_FIELD = 6
61};
62
80{
81public:
83 virtual ~nec_context();
84
85 // Called after construction...
86 void initialize();
87
88
89 void calc_prepare();
90
91 void reset_processing_to_structure_loading() {
92 switch (processing_state) {
93 /* If we havent allocated memory, then leave state there. Otherwise set to
94 * structure loading
95 * */
96 case PROCESSING_MEMORY_ALLOC:
97 processing_state = PROCESSING_MEMORY_ALLOC;
98 break;
99 default:
100 processing_state = PROCESSING_STRUCTURE_LOADING;
101 }
102 }
103
104 void reset_processing_to_excitation_setup() {
105 switch (processing_state) {
106 /* If we havent allocated memory, then leave state there. Otherwise set to
107 * structure loading
108 * */
109 case PROCESSING_MEMORY_ALLOC:
110 processing_state = PROCESSING_MEMORY_ALLOC;
111 break;
112 case PROCESSING_STRUCTURE_LOADING:
113 processing_state = PROCESSING_STRUCTURE_LOADING;
114 break;
115 default:
116 processing_state = PROCESSING_EXCITATION_SETUP;
117 }
118 }
119
120 inline c_geometry* get_geometry() {
121 return m_geometry.get();
122 }
123
130 double get_gain(int freq_index, int theta_index, int phi_index) {
132 if (NULL == rp) return -999.0;
133 return rp->get_power_gain(theta_index, phi_index);
134 }
135
136 double get_gain_max(int freq_index = 0) {
138 if (NULL == rp) return -999.0;
139 return rp->get_gain_max();
140 }
141
142 double get_gain_min(int freq_index = 0) {
144 if (NULL == rp) return -999.0;
145 return rp->get_gain_min();
146 }
147
148 double get_gain_mean(int freq_index = 0) {
150 if (NULL == rp) return -999.0;
151 return rp->get_gain_mean();
152 }
153
154 double get_gain_sd(int freq_index = 0) {
156 if (NULL == rp) return -999.0;
157 return rp->get_gain_sd();
158 }
159
160 /********************** RHCP ********************************/
161 double get_gain_rhcp_max(int freq_index = 0) {
163 if (NULL == rp) return -999.0;
164 return rp->get_gain_rhcp_max();
165 }
166
167 double get_gain_rhcp_min(int freq_index = 0) {
169 if (NULL == rp) return -999.0;
170 return rp->get_gain_rhcp_min();
171 }
172
173 double get_gain_rhcp_mean(int freq_index = 0) {
175 if (NULL == rp) return -999.0;
176 return rp->get_gain_rhcp_mean();
177 }
178
179 double get_gain_rhcp_sd(int freq_index = 0) {
181 if (NULL == rp) return -999.0;
182 return rp->get_gain_rhcp_sd();
183 }
184
185 /********************** LHCP ********************************/
186 double get_gain_lhcp_max(int freq_index = 0) {
188 if (NULL == rp) return -999.0;
189 return rp->get_gain_lhcp_max();
190 }
191
192 double get_gain_lhcp_min(int freq_index = 0) {
194 if (NULL == rp) return -999.0;
195 return rp->get_gain_lhcp_min();
196 }
197
198 double get_gain_lhcp_mean(int freq_index = 0) {
200 if (NULL == rp) return -999.0;
201 return rp->get_gain_lhcp_mean();
202 }
203
204 double get_gain_lhcp_sd(int freq_index = 0) {
206 if (NULL == rp) return -999.0;
207 return rp->get_gain_lhcp_sd();
208 }
209
210 /****************** IMPEDANCE CHARACTERISTICS *********************/
211
242 double get_impedance_real(int freq_index = 0, int feed_index = 0) {
243 nec_antenna_input* ipt = get_input_parameters(freq_index);
244 if (NULL == ipt) return -999.0;
245 vector<nec_complex>& imp(ipt->get_impedance());
246 if (feed_index < 0 || (size_t)feed_index >= imp.size()) return -999.0;
247 return imp[feed_index].real();
248 }
254 double get_impedance_imag(int freq_index = 0, int feed_index = 0) {
255 nec_antenna_input* ipt = get_input_parameters(freq_index);
256 if (NULL == ipt) return -999.0;
257 vector<nec_complex>& imp(ipt->get_impedance());
258 if (feed_index < 0 || (size_t)feed_index >= imp.size()) return -999.0;
259 return imp[feed_index].imag();
260 }
261
270 return m_results.get_antenna_input(index);
271 }
272
279 return m_results.get_norm_rx_pattern(index);
280 }
281
288 return m_results.get_radiation_pattern(index);
289 }
290
299
308
317
318 /* added for the python wrapping : some access functions */
319
320 void set_isave(int in_isave)
321 {
322 isave = in_isave;
323 }
324
325 int get_inc()
326 {
327 return inc;
328 }
329
330 nec_float get_xpr1()
331 {
332 return xpr1;
333 }
334
335 nec_float get_xpr2()
336 {
337 return xpr2;
338 }
339
340 /* end of functions added for the python wrapping */
341
342 inline void set_output(nec_output_file in_output, nec_output_flags in_output_flags)
343 {
344 m_output = in_output;
345 m_output_flags = in_output_flags;
346
347 m_output_fp = m_output.get_fp();
348 }
349
350 inline void set_results_format(enum RESULT_FORMAT result_format)
351 {
352 m_results.m_result_format = result_format;
353 }
354
355 inline void set_gain_only(bool flag)
356 {
357 m_output_flags.set_gain_only(flag);
358 }
359
360
362 static nec_float benchmark();
363
368 void geometry_complete(int gpflag);
369
370
378 void medium_parameters(nec_float permittivity, nec_float permeability) {
379 em::constants::permittivity = permittivity;
380 em::constants::permeability = permeability;
381 }
382
383
400 void wire(int tag_id, int segment_count,
401 nec_float xw1, nec_float yw1, nec_float zw1,
402 nec_float xw2, nec_float yw2, nec_float zw2,
403 nec_float rad, nec_float rdel, nec_float rrad);
404
405 void sp_card(int ns,
406 nec_float x1, nec_float y1, nec_float z1,
407 nec_float x2, nec_float y2, nec_float z2);
408
409 void sc_card( int i2,
410 nec_float x3, nec_float y3, nec_float z3,
411 nec_float x4, nec_float y4, nec_float z4);
412
413 void gx_card(int i1, int i2);
414
415 void move( nec_float rox, nec_float roy, nec_float roz, nec_float xs,
416 nec_float ys, nec_float zs, int its, int nrpt, int itgi );
417
429 void arc( int tag_id, int segment_count, nec_float rada,
430 nec_float ang1, nec_float ang2, nec_float rad );
431
432
449 void helix(int tag_id, int segment_count, nec_float s, nec_float hl, nec_float a1, nec_float b1,
450 nec_float a2, nec_float b2, nec_float rad);
451
452
459 void fr_card(int ifrq, int nfrq, nec_float freq_mhz, nec_float del_freq);
460
479 void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3);
480
506 void gn_card(int ground_type, int rad_wire_count, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
507
508
526 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3,
527 nec_float tmp4, nec_float tmp5, nec_float tmp6);
528
529
530
585 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, int itmp5,
586 nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
587 {
588 int itmp45 = 10*itmp4 + itmp5;
589 return this->ex_card( itmp1, itmp2, itmp3, itmp45, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
590 }
591
592
593
613 void tl_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
614
630 void nt_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
631
643 void xq_card(int itmp1);
644
646 void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4);
647
714 void rp_card(int calc_mode,
715 int n_theta, int n_phi,
716 int output_format, int normalization, int D, int A,
717 nec_float theta0, nec_float phi0, nec_float delta_theta, nec_float delta_phi,
718 nec_float radial_distance, nec_float gain_norm);
719
721 void pt_card(int itmp1, int itmp2, int itmp3, int itmp4);
722
723
725 void pq_card(int itmp1, int itmp2, int itmp3, int itmp4);
726
727
728
730 void kh_card(nec_float tmp1);
731
732
738 void ne_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
739
745 void nh_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
746
748 void set_extended_thin_wire_kernel(bool ekflag);
749
750
752 void cp_card(int itmp1, int itmp2, int itmp3, int itmp4);
753
754
758 void pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4);
759
760
761 /*!****************************************************
762 *** normal exit of nec2++ when all jobs complete ok ***
763 ******************************************************/
765 {
766 }
767
768 void write_results(ostream& os)
769 {
770 m_results.write(os);
771 }
772
773
774
786 void simulate(bool far_field_flag = false);
787
790 nec_ground ground;
791 std::unique_ptr<c_geometry> m_geometry;
792 c_plot_card plot_card;
793
794 c_ground_wave ground_wave;
795
796
799 int iptaq, iptaqf, iptaqt;
800
801
804 int iptag, iptagf, iptagt;
805
806
807 int iflow;
808 int ifrq, nfrq;
809 nec_float delfrq;
810
811 // strcture loading
812 int_array ldtyp, ldtag, ldtagf, ldtagt;
813 real_array zlr, zli, zlc;
814
815 // normalized receiving pattern
816 real_matrix fnorm;
817
818 int nthi, nphi;
819 nec_float thetis, phiss;
820
821
825
826
829
830
831 nec_float _wavelength;
832
833 /* common /cmb/ */
834 complex_array cm; // primary interaction matrix
835
836 /* common /matpar/ */
837 int icase, npblk;
838 int64_t nlast;
839 int nbbx, npbx, nlbx, nbbl, npbl, nlbl;
840
841 /* common /save/ */
842 int_array ip;
843 nec_float freq_mhz;
844
845 /* common /crnt/ */
846 real_array air, aii;
850
851 int ifar;
852
853 /* common /zload/ */
854 int nload;
855 complex_array zarray;
856
857 /* common /yparm/ */
858 int ncoup, icoup;
859 int_array nctag, ncseg;
860 complex_array y11a, y12a;
861
862 /* common /vsorc/ */
863 int_array ivqd, source_segment_array, iqds;
864 int nvqd, voltage_source_count, nqds;
865 complex_array vqd, vqds, source_voltage_array;
866
867 /* common /netcx/ */
868 int masym, neq2, network_count, ntsol, nprint;
869 int64_t neq, npeq;
870 int_array iseg1, iseg2, ntyp;
871 real_array x11r, x11i, x12r;
872 real_array x12i, x22r, x22i;
873 nec_float input_power, network_power_loss;
874 nec_complex zped;
875
876 /* common /fpat/ */
877 enum excitation_type m_excitation_type;
878
879 int m_rp_output_format;
880 int m_rp_normalization;
881
882 int m_near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp;
883 nec_float thets, phis, dth, dph, rfld, gnor;
884 nec_float xpr6, structure_power_loss, xnr, ynr, znr, dxnr, dynr, dznr;
885
886
887 /* common /dataj/ */
888 int ind1, indd1, ind2, indd2;
889 bool m_use_exk; /* Was iexk */
890
891 nec_float m_s, m_b, xj, yj, zj, cabj, sabj, salpj;
892 nec_float rkh; /* matrix integration limit */
893 nec_float t1xj, t1yj, t1zj, t2xj, t2yj, t2zj;
894 nec_complex exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc;
895
896 /* common /smat/ */
897 int nop; /* My addition */
898 complex_array symmetry_array;
899
900 /* common /incom/ */
901 int isnor;
902 nec_float xo, yo, zo, sn, xsn, ysn;
903
904 /* common /tmi/ */
905 int ija; /* changed to ija to avoid conflict */
906 nec_float zpk, rkb2;
907
908 /*common /tmh/ */
909 nec_float zpka, rhks;
910
911
912 // some auxiliary functions to be made private once
913 // the radiation pattern calculation is done entirely
914 // inside this class...
915 void gfld(nec_float rho, nec_float phi, nec_float rz,
916 nec_complex *eth, nec_complex *epi,
917 nec_complex *erd, bool space_only, nec_float in_wavelength );
918
919 void ffld(nec_float thet, nec_float phi,
920 nec_complex *eth, nec_complex *eph, nec_float in_wavelength );
921
922
923private:
924
928 bool step_warning_issued;
929
932 void ne_nh_card(int in_nfeh, int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6);
933
934
935 void print_freq_int_krnl(
936 nec_float f,
937 nec_float lambda,
938 nec_float int_dist,
939 bool using_extended_kernel);
940
941 void antenna_env(void);
942
943 /*no more used */
944 void print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq,
945 int iptaqf, int iptaqt);
946
949 void calculate_network_data(void);
950 void print_network_data(void);
951 void print_norm_rx_pattern();
952 void print_input_impedance();
953 void print_power_budget(void);
954 nec_float compute_structure_power_loss(void) const;
955 void structure_segment_loading();
956
957
958 enum excitation_return
959 excitation_loop(enum processing_state in_freq_loop_state, int mhz);
960
961 excitation_return excitation_process_inner(int mhz);
962 excitation_return excitation_compute_near_field(int mhz);
963 void excitation_compute_far_field();
964
965 void setup_excitation();
966
967 /* pointers to output files */
968 FILE *m_output_fp;
969
970 int inc, isave;
972 int nthic, nphic;
973 int iped;
974
975 nec_float impedance_norm_factor; // was zpnorm
976
977 nec_float xpr1, xpr2, xpr3, xpr4, xpr5, xpr7;
978
979 nec_structure_currents* structure_currents;
980
981 void load();
982
983 void cmset(int64_t nrow, complex_array& in_cm, nec_float rkhx);
984 void compute_matrix_ss(int j1, int j2, int im1, int im2,
985 complex_array& in_cm, int64_t nrow, int itrp);
986 void cmsw(int j1, int j2, int i1, int i2, complex_array& in_cm,
987 complex_array& cw, int64_t ncw, int64_t nrow, int itrp);
988 void cmws( int j, int i1, int i2, complex_array& in_cm,
989 int64_t nr, complex_array& cw, int64_t nw, int itrp );
990
991 void cmww(int j, int i1, int i2, complex_array& in_cm, int64_t nr,
992 complex_array& cw, int64_t nw, int itrp);
993 void couple(complex_array& cur, nec_float wlam);
994
995 void efld(nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool not_on_source_segment);
996 nec_float efld_compute(nec_float xij, nec_float yij, nec_float ai, nec_float salpr,
997 nec_float zij, bool ijx, complex_array& egnd);
998 void eksc(nec_float s, nec_float z, nec_float rh, nec_float xk, int ij,
999 nec_complex *ezs, nec_complex *ers, nec_complex *ezc,
1000 nec_complex *erc, nec_complex *ezk, nec_complex *erk);
1001 void ekscx(nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk,
1002 int ij, int inx1, int inx2, nec_complex *ezs,
1003 nec_complex *ers, nec_complex *ezc, nec_complex *erc,
1004 nec_complex *ezk, nec_complex *erk);
1005 void etmns(nec_float p1, nec_float p2, nec_float p3, nec_float p4, nec_float p5,
1006 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
1007
1008 void etmns_voltage_source(complex_array& e);
1009 void etmns_linear_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
1010 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
1011 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
1012 nec_float incident_amplitude, complex_array& e);
1013 void etmns_circular_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
1014 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
1015 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
1016 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
1017 void etmns_current_source(nec_float p1, nec_float p2, nec_float p3, nec_float p4,
1018 nec_float p5, nec_float p6, complex_array& e);
1019 int etmns_patch_base(int patch_index) const;
1020 void etmns_zero_element(complex_array& e, int i);
1021
1022 void fblock( int nrow, int ncol, int64_t imax, int ipsym );
1023
1024 void gf(nec_float zk, nec_float *co, nec_float *si);
1025 void gh(nec_float zk, nec_float *hr, nec_float *hi);
1026 void gx(nec_float zz, nec_float rh, nec_float xk,
1027 nec_complex *gz, nec_complex *gzp);
1028 void gxx(nec_float zz, nec_float rh, nec_float a, nec_float a2, nec_float xk,
1029 int ira, nec_complex *g1, nec_complex *g1p, nec_complex *g2,
1030 nec_complex *g2p, nec_complex *g3, nec_complex *gzp);
1031 void hfk(nec_float el1, nec_float el2, nec_float rhk,
1032 nec_float zpkx, nec_float *sgr, nec_float *sgi);
1033 void hintg(nec_float xi, nec_float yi, nec_float zi);
1034 void hsfld(nec_float xi, nec_float yi, nec_float zi, nec_float ai);
1035 void hsflx(nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk,
1036 nec_complex *hps, nec_complex *hpc);
1037
1038 void intx(nec_float el1, nec_float el2, nec_float b, int ij,
1039 nec_float *sgr, nec_float *sgi);
1040
1041 void nefld(nec_float xob, nec_float yob, nec_float zob, nec_complex *ex,
1042 nec_complex *ey, nec_complex *ez);
1043 struct netwk_state {
1044 int_array ipnt, nteqa, ntsca;
1045 complex_array vsrc, rhs, cmn, rhnt, rhnx;
1046 int nteq = 0;
1047 int ntsc = 0;
1048 int ndimn = 0;
1049 int neqz2 = 0;
1050 int neqt = 0;
1051 };
1052 void netwk(complex_array& in_cm, int_array& in_ip, complex_array& einc);
1053 void netwk_build_matrix(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1054 void netwk_solve_and_check(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1055 void netwk_compute_currents(complex_array& in_cm, int_array& in_ip, complex_array& einc, netwk_state& st);
1056 void netwk_compute_inputs(complex_array& einc, netwk_state& st);
1057 void nfpat(void);
1058 void nhfld(nec_float xob, nec_float yob, nec_float zob, nec_complex *hx,
1059 nec_complex *hy, nec_complex *hz);
1060 void pcint(nec_float xi, nec_float yi, nec_float zi, nec_float cabi,
1061 nec_float sabi, nec_float salpi, complex_array& e);
1062 void impedance_print(int in1, int in2, int in3, nec_float fl1, nec_float fl2,
1063 nec_float fl3, nec_float fl4, nec_float fl5, nec_float fl6, const char *ia);
1064 void qdsrc(int is, nec_complex v, complex_array& e);
1065
1066
1067 void rom2(nec_float a, nec_float b, complex_array& sum, nec_float dmin);
1068 void sflds(const nec_float t, complex_array& e);
1069 void solgf(nec_complex *a, nec_complex *b, nec_complex *c,
1070 nec_complex *d, nec_complex *xy, int *ip, int np, int n1,
1071 int n, int mp, int m1, int m, int n1c, int n2c, int n2cz);
1072 void unere(nec_float xob, nec_float yob, nec_float zob, bool ground_reflection);
1073 nec_complex zint(nec_float sigl, nec_float rolam);
1074
1075 void init_voltage_sources();
1076
1077}; /* nec_context */
1078
Definition c_geometry.h:65
Definition c_ggrid.h:77
Definition c_plot_card.h:45
Definition nec_results.h:494
Container for an nec2++ simulation.
Definition nec_context.h:80
double get_impedance_real(int freq_index=0, int feed_index=0)
Real part of the feed-point impedance.
Definition nec_context.h:242
void calc_prepare()
After the geometry has been specified, this function prepares for calculations.
Definition nec_context.cpp:123
nec_antenna_input * get_input_parameters(int index)
Get Antenna Input Parameter Results.
Definition nec_context.h:269
void xq_card(int itmp1)
"xq" execute card - calc. including radiated fields
Definition nec_context.cpp:741
void pq_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:883
void gn_card(int ground_type, int rad_wire_count, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Ground parameters under the antenna.
Definition nec_context.cpp:491
void set_extended_thin_wire_kernel(bool ekflag)
Definition nec_context.cpp:965
void ne_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Definition nec_context.cpp:896
void arc(int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad)
Definition nec_context.cpp:364
nec_results m_results
The results object that holds all the specific results.
Definition nec_context.h:824
nec_output_file m_output
an object to pipe output through...
Definition nec_context.h:789
double get_impedance_imag(int freq_index=0, int feed_index=0)
Imaginary part of the feed-point impedance.
Definition nec_context.h:254
void tl_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
"tl" card, transmission line parameters
Definition nec_context.cpp:630
void rp_card(int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, nec_float theta0, nec_float phi0, nec_float delta_theta, nec_float delta_phi, nec_float radial_distance, nec_float gain_norm)
Standard radiation pattern parameters.
Definition nec_context.cpp:828
int ifar
the current vector
Definition nec_context.h:851
nec_output_flags m_output_flags
an object to pipe output through...
Definition nec_context.h:828
void simulate(bool far_field_flag=false)
Start a simulation.
Definition nec_context.cpp:1031
void pt_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:879
void wire(int tag_id, int segment_count, nec_float xw1, nec_float yw1, nec_float zw1, nec_float xw2, nec_float yw2, nec_float zw2, nec_float rad, nec_float rdel, nec_float rrad)
Definition nec_context.cpp:316
void helix(int tag_id, int segment_count, nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad)
Add an helix to the geometry,.
Definition nec_context.cpp:386
nec_norm_rx_pattern * get_norm_rx_pattern(int index)
Get Normalized Receiving Pattern Results.
Definition nec_context.h:278
nec_structure_currents * get_structure_currents(int index)
Get structure currents results.
Definition nec_context.h:314
static nec_float benchmark()
Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800.
Definition nec_context.cpp:168
void fr_card(int ifrq, int nfrq, nec_float freq_mhz, nec_float del_freq)
"fr" card, frequency parameters
Definition nec_context.cpp:406
real_array cir
coefficients of the sine terms in the current interpolation functions
Definition nec_context.h:848
void cp_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:974
void initialize()
Initialize everything, called after construction so that we can tell the geometry object what nec_con...
Definition nec_context.cpp:84
complex_array current_vector
coefficients of the cosine terms in the current interpolation functions
Definition nec_context.h:849
int iptflg
pt card flags...
Definition nec_context.h:803
void pl_card(const char *ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:1013
void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3)
"ld" card, loading parameters
Definition nec_context.cpp:424
int iptflq
pq card flags
Definition nec_context.h:798
void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4)
Definition nec_context.cpp:782
void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, int itmp5, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Specifies the excitation for the structure. The excitation can be voltage sources on the structure,...
Definition nec_context.h:585
real_array bir
coefficients of the constant terms in the current interpolation functions for the current vector
Definition nec_context.h:847
int nload
input integer flag (from RP card) specifies type of field computation, or type of ground system for f...
Definition nec_context.h:854
void gfld(nec_float rho, nec_float phi, nec_float rz, nec_complex *eth, nec_complex *epi, nec_complex *erd, bool space_only, nec_float in_wavelength)
gfld computes the radiated field including ground wave.
Definition nec_context.cpp:6531
void geometry_complete(int gpflag)
Signal the end of a geometry description.
Definition nec_context.cpp:294
void medium_parameters(nec_float permittivity, nec_float permeability)
Definition nec_context.h:378
void kh_card(nec_float tmp1)
Definition nec_context.cpp:890
void nt_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Definition nec_context.cpp:690
void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Definition nec_context.cpp:519
void nh_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
Definition nec_context.cpp:912
double get_gain(int freq_index, int theta_index, int phi_index)
Get the maximum gain in dB.
Definition nec_context.h:130
nec_near_field_pattern * get_near_field_pattern(int index)
Get near field pattern results.
Definition nec_context.h:305
nec_radiation_pattern * get_radiation_pattern(int index)
Get Radiation Pattern results.
Definition nec_context.h:287
nec_structure_excitation * get_structure_excitation(int index)
Get structure excitation results.
Definition nec_context.h:296
void all_jobs_completed()
Definition nec_context.h:764
Definition nec_ground.h:63
Definition nec_results.h:564
Definition nec_results.h:253
Definition nec_output.h:53
Definition nec_output.h:27
Definition nec_radiation_pattern.h:49
nec_float get_power_gain(int theta_index, int phi_index) const
Get a total power gain from the radiation pattern.
Definition nec_radiation_pattern.h:365
Definition nec_results.h:674
nec_structure_excitation * get_structure_excitation(const long index)
Get structure excitation results.
Definition nec_results.h:756
nec_norm_rx_pattern * get_norm_rx_pattern(const long index)
Get normalized receiving pattern results.
Definition nec_results.h:729
nec_antenna_input * get_antenna_input(const long index)
Get antenna input parameter results.
Definition nec_results.h:747
nec_structure_currents * get_structure_currents(const long index)
Get structure currents results.
Definition nec_results.h:774
nec_near_field_pattern * get_near_field_pattern(const long index)
Get near field pattern results.
Definition nec_results.h:765
nec_radiation_pattern * get_radiation_pattern(const long index)
Get radiation pattern results.
Definition nec_results.h:738
Definition nec_structure_currents.h:30
Holds structure excitation data at network connection points.
Definition nec_results.h:412
processing_state
Definition nec_context.h:54