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
374 void geometry_complete(int gpflag);
375
376
384 void medium_parameters(nec_float permittivity, nec_float permeability) {
385 em::constants::permittivity = permittivity;
386 em::constants::permeability = permeability;
387 }
388
389
406 void wire(int tag_id, int segment_count,
407 nec_float xw1, nec_float yw1, nec_float zw1,
408 nec_float xw2, nec_float yw2, nec_float zw2,
409 nec_float rad, nec_float rdel, nec_float rrad);
410
411 void sp_card(int ns,
412 nec_float x1, nec_float y1, nec_float z1,
413 nec_float x2, nec_float y2, nec_float z2);
414
415 void sc_card( int i2,
416 nec_float x3, nec_float y3, nec_float z3,
417 nec_float x4, nec_float y4, nec_float z4);
418
419 void gx_card(int i1, int i2);
420
421 void move( nec_float rox, nec_float roy, nec_float roz, nec_float xs,
422 nec_float ys, nec_float zs, int its, int nrpt, int itgi );
423
435 void arc( int tag_id, int segment_count, nec_float rada,
436 nec_float ang1, nec_float ang2, nec_float rad );
437
438
455 void helix(int tag_id, int segment_count, nec_float s, nec_float hl, nec_float a1, nec_float b1,
456 nec_float a2, nec_float b2, nec_float rad);
457
458
465 void fr_card(int ifrq, int nfrq, nec_float freq_mhz, nec_float del_freq);
466
485 void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3);
486
512 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);
513
514
532 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3,
533 nec_float tmp4, nec_float tmp5, nec_float tmp6);
534
535
536
591 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, int itmp5,
592 nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
593 {
594 int itmp45 = 10*itmp4 + itmp5;
595 return this->ex_card( itmp1, itmp2, itmp3, itmp45, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
596 }
597
598
599
619 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);
620
636 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);
637
649 void xq_card(int itmp1);
650
652 void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4);
653
720 void rp_card(int calc_mode,
721 int n_theta, int n_phi,
722 int output_format, int normalization, int D, int A,
723 nec_float theta0, nec_float phi0, nec_float delta_theta, nec_float delta_phi,
724 nec_float radial_distance, nec_float gain_norm);
725
727 void pt_card(int itmp1, int itmp2, int itmp3, int itmp4);
728
729
731 void pq_card(int itmp1, int itmp2, int itmp3, int itmp4);
732
733
734
736 void kh_card(nec_float tmp1);
737
738
744 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);
745
751 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);
752
754 void set_extended_thin_wire_kernel(bool ekflag);
755
756
758 void cp_card(int itmp1, int itmp2, int itmp3, int itmp4);
759
760
764 void pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4);
765
766
767 /*!****************************************************
768 *** normal exit of nec2++ when all jobs complete ok ***
769 ******************************************************/
771 {
772 }
773
774 void write_results(ostream& os)
775 {
776 m_results.write(os);
777 }
778
779
780
792 void simulate(bool far_field_flag = false);
793
796 nec_ground ground;
797 std::unique_ptr<c_geometry> m_geometry;
798 c_plot_card plot_card;
799
800 c_ground_wave ground_wave;
801
802
805 int iptaq, iptaqf, iptaqt;
806
807
810 int iptag, iptagf, iptagt;
811
812
813 int iflow;
814 int ifrq, nfrq;
815 nec_float delfrq;
816
817 // strcture loading
818 int_array ldtyp, ldtag, ldtagf, ldtagt;
819 real_array zlr, zli, zlc;
820
821 // normalized receiving pattern
822 real_matrix fnorm;
823
824 int nthi, nphi;
825 nec_float thetis, phiss;
826
827
831
832
835
836
837 nec_float _wavelength;
838
839 /* common /cmb/ */
840 complex_array cm; // primary interaction matrix
841
842 /* common /matpar/ */
843 int icase, npblk;
844 int64_t nlast;
845 int nbbx, npbx, nlbx, nbbl, npbl, nlbl;
846
847 /* common /save/ */
848 int_array ip;
849 nec_float freq_mhz;
850
851 /* common /crnt/ */
852 real_array air, aii;
856
857 int ifar;
858
859 /* common /zload/ */
860 int nload;
861 complex_array zarray;
862
863 /* common /yparm/ */
864 int ncoup, icoup;
865 int_array nctag, ncseg;
866 complex_array y11a, y12a;
867
868 /* common /vsorc/ */
869 int_array ivqd, source_segment_array, iqds;
870 int nvqd, voltage_source_count, nqds;
871 complex_array vqd, vqds, source_voltage_array;
872
873 /* common /netcx/ */
874 int masym, neq2, network_count, ntsol, nprint;
875 int64_t neq, npeq;
876 int_array iseg1, iseg2, ntyp;
877 real_array x11r, x11i, x12r;
878 real_array x12i, x22r, x22i;
879 nec_float input_power, network_power_loss;
880 nec_complex zped;
881
882 /* common /fpat/ */
883 enum excitation_type m_excitation_type;
884
885 int m_rp_output_format;
886 int m_rp_normalization;
887
888 int m_near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp;
889 nec_float thets, phis, dth, dph, rfld, gnor;
890 nec_float xpr6, structure_power_loss, xnr, ynr, znr, dxnr, dynr, dznr;
891
892
893 /* common /dataj/ */
894 int ind1, indd1, ind2, indd2;
895 bool m_use_exk; /* Was iexk */
896
897 nec_float m_s, m_b, xj, yj, zj, cabj, sabj, salpj;
898 nec_float rkh; /* matrix integration limit */
899 nec_float t1xj, t1yj, t1zj, t2xj, t2yj, t2zj;
900 nec_complex exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc;
901
902 /* common /smat/ */
903 int nop; /* My addition */
904 complex_array symmetry_array;
905
906 /* common /incom/ */
907 int isnor;
908 nec_float xo, yo, zo, sn, xsn, ysn;
909
910 /* common /tmi/ */
911 int ija; /* changed to ija to avoid conflict */
912 nec_float zpk, rkb2;
913
914 /*common /tmh/ */
915 nec_float zpka, rhks;
916
917
918 // some auxiliary functions to be made private once
919 // the radiation pattern calculation is done entirely
920 // inside this class...
921 void gfld(nec_float rho, nec_float phi, nec_float rz,
922 nec_complex *eth, nec_complex *epi,
923 nec_complex *erd, bool space_only, nec_float in_wavelength );
924
925 void ffld(nec_float thet, nec_float phi,
926 nec_complex *eth, nec_complex *eph, nec_float in_wavelength );
927
928
929private:
930
934 bool step_warning_issued;
935
938 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);
939
940
941 void print_freq_int_krnl(
942 nec_float f,
943 nec_float lambda,
944 nec_float int_dist,
945 bool using_extended_kernel);
946
947 void antenna_env(void);
948
949 /*no more used */
950 void print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq,
951 int iptaqf, int iptaqt);
952
955 void calculate_network_data(void);
956 void print_network_data(void);
957 void print_norm_rx_pattern();
958 void print_input_impedance();
959 void print_power_budget(void);
960 nec_float compute_structure_power_loss(void) const;
961 void structure_segment_loading();
962
963
964 enum excitation_return
965 excitation_loop(enum processing_state in_freq_loop_state, int mhz);
966
967 excitation_return excitation_process_inner(int mhz);
968 excitation_return excitation_compute_near_field(int mhz);
969 void excitation_compute_far_field();
970
971 void setup_excitation();
972
973 /* pointers to output files */
974 FILE *m_output_fp;
975
976 int inc, isave;
978 int nthic, nphic;
979 int iped;
980
981 nec_float impedance_norm_factor; // was zpnorm
982
983 nec_float xpr1, xpr2, xpr3, xpr4, xpr5, xpr7;
984
985 nec_structure_currents* structure_currents;
986
987 void load();
988
989 void cmset(int64_t nrow, complex_array& in_cm, nec_float rkhx);
990 void compute_matrix_ss(int j1, int j2, int im1, int im2,
991 complex_array& in_cm, int64_t nrow, int itrp);
992 void cmsw(int j1, int j2, int i1, int i2, complex_array& in_cm,
993 complex_array& cw, int64_t ncw, int64_t nrow, int itrp);
994 void cmws( int j, int i1, int i2, complex_array& in_cm,
995 int64_t nr, complex_array& cw, int64_t nw, int itrp );
996
997 void cmww(int j, int i1, int i2, complex_array& in_cm, int64_t nr,
998 complex_array& cw, int64_t nw, int itrp);
999 void couple(complex_array& cur, nec_float wlam);
1000
1001 void efld(nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool not_on_source_segment);
1002 nec_float efld_compute(nec_float xij, nec_float yij, nec_float ai, nec_float salpr,
1003 nec_float zij, bool ijx, nec_complex* egnd);
1004 void eksc(nec_float s, nec_float z, nec_float rh, nec_float xk, int ij,
1005 nec_complex *ezs, nec_complex *ers, nec_complex *ezc,
1006 nec_complex *erc, nec_complex *ezk, nec_complex *erk);
1007 void ekscx(nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk,
1008 int ij, int inx1, int inx2, nec_complex *ezs,
1009 nec_complex *ers, nec_complex *ezc, nec_complex *erc,
1010 nec_complex *ezk, nec_complex *erk);
1011 void etmns(nec_float p1, nec_float p2, nec_float p3, nec_float p4, nec_float p5,
1012 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
1013
1014 void etmns_voltage_source(complex_array& e);
1015 void etmns_linear_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
1016 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
1017 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
1018 nec_float incident_amplitude, complex_array& e);
1019 void etmns_circular_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
1020 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
1021 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
1022 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
1023 void etmns_current_source(nec_float p1, nec_float p2, nec_float p3, nec_float p4,
1024 nec_float p5, nec_float p6, complex_array& e);
1025 int etmns_patch_base(int patch_index) const;
1026 void etmns_zero_element(complex_array& e, int i);
1027
1028 void fblock( int nrow, int ncol, int64_t imax, int ipsym );
1029
1030 void gf(nec_float zk, nec_float *co, nec_float *si);
1031 void gh(nec_float zk, nec_float *hr, nec_float *hi);
1032 void gx(nec_float zz, nec_float rh, nec_float xk,
1033 nec_complex *gz, nec_complex *gzp);
1034 void gxx(nec_float zz, nec_float rh, nec_float a, nec_float a2, nec_float xk,
1035 int ira, nec_complex *g1, nec_complex *g1p, nec_complex *g2,
1036 nec_complex *g2p, nec_complex *g3, nec_complex *gzp);
1037 void hfk(nec_float el1, nec_float el2, nec_float rhk,
1038 nec_float zpkx, nec_float *sgr, nec_float *sgi);
1039 void hintg(nec_float xi, nec_float yi, nec_float zi);
1040 void hsfld(nec_float xi, nec_float yi, nec_float zi, nec_float ai);
1041 void hsflx(nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk,
1042 nec_complex *hps, nec_complex *hpc);
1043
1044 void intx(nec_float el1, nec_float el2, nec_float b, int ij,
1045 nec_float *sgr, nec_float *sgi);
1046
1047 void nefld(nec_float xob, nec_float yob, nec_float zob, nec_complex *ex,
1048 nec_complex *ey, nec_complex *ez);
1049 struct netwk_state {
1050 int_array ipnt, nteqa, ntsca;
1051 complex_array vsrc, rhs, cmn, rhnt, rhnx;
1052 int nteq = 0;
1053 int ntsc = 0;
1054 int ndimn = 0;
1055 int neqz2 = 0;
1056 int neqt = 0;
1057 };
1058 void netwk(complex_array& in_cm, int_array& in_ip, complex_array& einc);
1059 void netwk_build_matrix(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1060 void netwk_solve_and_check(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1061 void netwk_compute_currents(complex_array& in_cm, int_array& in_ip, complex_array& einc, netwk_state& st);
1062 void netwk_compute_inputs(complex_array& einc, netwk_state& st);
1063 void nfpat(void);
1064 void nhfld(nec_float xob, nec_float yob, nec_float zob, nec_complex *hx,
1065 nec_complex *hy, nec_complex *hz);
1066 void pcint(nec_float xi, nec_float yi, nec_float zi, nec_float cabi,
1067 nec_float sabi, nec_float salpi, nec_complex* e);
1068 void impedance_print(int in1, int in2, int in3, nec_float fl1, nec_float fl2,
1069 nec_float fl3, nec_float fl4, nec_float fl5, nec_float fl6, const char *ia);
1070 void qdsrc(int is, nec_complex v, complex_array& e);
1071
1072
1073 void rom2(nec_float a, nec_float b, nec_complex* sum, nec_float dmin);
1074 void sflds(const nec_float t, nec_complex* e);
1075 void solgf(nec_complex *a, nec_complex *b, nec_complex *c,
1076 nec_complex *d, nec_complex *xy, int *ip, int np, int n1,
1077 int n, int mp, int m1, int m, int n1c, int n2c, int n2cz);
1078 void unere(nec_float xob, nec_float yob, nec_float zob, bool ground_reflection);
1079 nec_complex zint(nec_float sigl, nec_float rolam);
1080
1081 void init_voltage_sources();
1082
1083}; /* nec_context */
1084
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:830
nec_output_file m_output
an object to pipe output through...
Definition nec_context.h:795
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:857
nec_output_flags m_output_flags
an object to pipe output through...
Definition nec_context.h:834
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:854
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:855
int iptflg
pt card flags...
Definition nec_context.h:809
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:804
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:591
real_array bir
coefficients of the constant terms in the current interpolation functions for the current vector
Definition nec_context.h:853
int nload
input integer flag (from RP card) specifies type of field computation, or type of ground system for f...
Definition nec_context.h:860
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:6541
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:384
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:770
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