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
213 double get_impedance_real(int freq_index = 0) {
214 nec_antenna_input* ipt = get_input_parameters(freq_index);
215 if (NULL == ipt) return -999.0;
216 vector<nec_complex>& imp(ipt->get_impedance());
217 return imp.back().real();
218 }
220 double get_impedance_imag(int freq_index = 0) {
221 nec_antenna_input* ipt = get_input_parameters(freq_index);
222 if (NULL == ipt) return -999.0;
223 vector<nec_complex>& imp(ipt->get_impedance());
224 return imp.back().imag();
225 }
226
233 return m_results.get_antenna_input(index);
234 }
235
242 return m_results.get_norm_rx_pattern(index);
243 }
244
251 return m_results.get_radiation_pattern(index);
252 }
253
262
271
280
281 /* added for the python wrapping : some access functions */
282
283 void set_isave(int in_isave)
284 {
285 isave = in_isave;
286 }
287
288 int get_inc()
289 {
290 return inc;
291 }
292
293 nec_float get_xpr1()
294 {
295 return xpr1;
296 }
297
298 nec_float get_xpr2()
299 {
300 return xpr2;
301 }
302
303 /* end of functions added for the python wrapping */
304
305 inline void set_output(nec_output_file in_output, nec_output_flags in_output_flags)
306 {
307 m_output = in_output;
308 m_output_flags = in_output_flags;
309
310 m_output_fp = m_output.get_fp();
311 }
312
313 inline void set_results_format(enum RESULT_FORMAT result_format)
314 {
315 m_results.m_result_format = result_format;
316 }
317
318 inline void set_gain_only(bool flag)
319 {
320 m_output_flags.set_gain_only(flag);
321 }
322
323
325 static nec_float benchmark();
326
331 void geometry_complete(int gpflag);
332
333
341 void medium_parameters(nec_float permittivity, nec_float permeability) {
342 em::constants::permittivity = permittivity;
343 em::constants::permeability = permeability;
344 }
345
346
363 void wire(int tag_id, int segment_count,
364 nec_float xw1, nec_float yw1, nec_float zw1,
365 nec_float xw2, nec_float yw2, nec_float zw2,
366 nec_float rad, nec_float rdel, nec_float rrad);
367
368 void sp_card(int ns,
369 nec_float x1, nec_float y1, nec_float z1,
370 nec_float x2, nec_float y2, nec_float z2);
371
372 void sc_card( int i2,
373 nec_float x3, nec_float y3, nec_float z3,
374 nec_float x4, nec_float y4, nec_float z4);
375
376 void gx_card(int i1, int i2);
377
378 void move( nec_float rox, nec_float roy, nec_float roz, nec_float xs,
379 nec_float ys, nec_float zs, int its, int nrpt, int itgi );
380
392 void arc( int tag_id, int segment_count, nec_float rada,
393 nec_float ang1, nec_float ang2, nec_float rad );
394
395
412 void helix(int tag_id, int segment_count, nec_float s, nec_float hl, nec_float a1, nec_float b1,
413 nec_float a2, nec_float b2, nec_float rad);
414
415
422 void fr_card(int ifrq, int nfrq, nec_float freq_mhz, nec_float del_freq);
423
442 void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3);
443
469 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);
470
471
489 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3,
490 nec_float tmp4, nec_float tmp5, nec_float tmp6);
491
492
493
548 void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, int itmp5,
549 nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6)
550 {
551 int itmp45 = 10*itmp4 + itmp5;
552 return this->ex_card( itmp1, itmp2, itmp3, itmp45, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
553 }
554
555
556
576 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);
577
593 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);
594
606 void xq_card(int itmp1);
607
609 void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4);
610
677 void rp_card(int calc_mode,
678 int n_theta, int n_phi,
679 int output_format, int normalization, int D, int A,
680 nec_float theta0, nec_float phi0, nec_float delta_theta, nec_float delta_phi,
681 nec_float radial_distance, nec_float gain_norm);
682
684 void pt_card(int itmp1, int itmp2, int itmp3, int itmp4);
685
686
688 void pq_card(int itmp1, int itmp2, int itmp3, int itmp4);
689
690
691
693 void kh_card(nec_float tmp1);
694
695
701 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);
702
708 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);
709
711 void set_extended_thin_wire_kernel(bool ekflag);
712
713
715 void cp_card(int itmp1, int itmp2, int itmp3, int itmp4);
716
717
721 void pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4);
722
723
724 /*!****************************************************
725 *** normal exit of nec2++ when all jobs complete ok ***
726 ******************************************************/
728 {
729 }
730
731 void write_results(ostream& os)
732 {
733 m_results.write(os);
734 }
735
736
737
749 void simulate(bool far_field_flag = false);
750
753 nec_ground ground;
754 std::unique_ptr<c_geometry> m_geometry;
755 c_plot_card plot_card;
756
757 c_ground_wave ground_wave;
758
759
762 int iptaq, iptaqf, iptaqt;
763
764
767 int iptag, iptagf, iptagt;
768
769
770 int iflow;
771 int ifrq, nfrq;
772 nec_float delfrq;
773
774 // strcture loading
775 int_array ldtyp, ldtag, ldtagf, ldtagt;
776 real_array zlr, zli, zlc;
777
778 // normalized receiving pattern
779 real_matrix fnorm;
780
781 int nthi, nphi;
782 nec_float thetis, phiss;
783
784
788
789
792
793
794 nec_float _wavelength;
795
796 /* common /cmb/ */
797 complex_array cm; // primary interaction matrix
798
799 /* common /matpar/ */
800 int icase, npblk;
801 int64_t nlast;
802 int nbbx, npbx, nlbx, nbbl, npbl, nlbl;
803
804 /* common /save/ */
805 int_array ip;
806 nec_float freq_mhz;
807
808 /* common /crnt/ */
809 real_array air, aii;
813
814 int ifar;
815
816 /* common /zload/ */
817 int nload;
818 complex_array zarray;
819
820 /* common /yparm/ */
821 int ncoup, icoup;
822 int_array nctag, ncseg;
823 complex_array y11a, y12a;
824
825 /* common /vsorc/ */
826 int_array ivqd, source_segment_array, iqds;
827 int nvqd, voltage_source_count, nqds;
828 complex_array vqd, vqds, source_voltage_array;
829
830 /* common /netcx/ */
831 int masym, neq, npeq, neq2, network_count, ntsol, nprint;
832 int_array iseg1, iseg2, ntyp;
833 real_array x11r, x11i, x12r;
834 real_array x12i, x22r, x22i;
835 nec_float input_power, network_power_loss;
836 nec_complex zped;
837
838 /* common /fpat/ */
839 enum excitation_type m_excitation_type;
840
841 int m_rp_output_format;
842 int m_rp_normalization;
843
844 int m_near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp;
845 nec_float thets, phis, dth, dph, rfld, gnor;
846 nec_float xpr6, structure_power_loss, xnr, ynr, znr, dxnr, dynr, dznr;
847
848
849 /* common /dataj/ */
850 int ind1, indd1, ind2, indd2;
851 bool m_use_exk; /* Was iexk */
852
853 nec_float m_s, m_b, xj, yj, zj, cabj, sabj, salpj;
854 nec_float rkh; /* matrix integration limit */
855 nec_float t1xj, t1yj, t1zj, t2xj, t2yj, t2zj;
856 nec_complex exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc;
857
858 /* common /smat/ */
859 int nop; /* My addition */
860 complex_array symmetry_array;
861
862 /* common /incom/ */
863 int isnor;
864 nec_float xo, yo, zo, sn, xsn, ysn;
865
866 /* common /tmi/ */
867 int ija; /* changed to ija to avoid conflict */
868 nec_float zpk, rkb2;
869
870 /*common /tmh/ */
871 nec_float zpka, rhks;
872
873
874 // some auxiliary functions to be made private once
875 // the radiation pattern calculation is done entirely
876 // inside this class...
877 void gfld(nec_float rho, nec_float phi, nec_float rz,
878 nec_complex *eth, nec_complex *epi,
879 nec_complex *erd, bool space_only, nec_float in_wavelength );
880
881 void ffld(nec_float thet, nec_float phi,
882 nec_complex *eth, nec_complex *eph, nec_float in_wavelength );
883
884
885private:
886
889 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);
890
891
892 void print_freq_int_krnl(
893 nec_float f,
894 nec_float lambda,
895 nec_float int_dist,
896 bool using_extended_kernel);
897
898 void antenna_env(void);
899
900 /*no more used */
901 void print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq,
902 int iptaqf, int iptaqt);
903
906 void calculate_network_data(void);
907 void print_network_data(void);
908 void print_norm_rx_pattern();
909 void print_input_impedance();
910 void print_power_budget(void);
911 nec_float compute_structure_power_loss(void) const;
912 void structure_segment_loading();
913
914
915 enum excitation_return
916 excitation_loop(enum processing_state in_freq_loop_state, int mhz);
917
918 excitation_return excitation_process_inner(int mhz);
919 excitation_return excitation_compute_near_field(int mhz);
920 void excitation_compute_far_field();
921
922 void setup_excitation();
923
924 /* pointers to output files */
925 FILE *m_output_fp;
926
927 int inc, isave;
929 int nthic, nphic;
930 int iped;
931
932 nec_float impedance_norm_factor; // was zpnorm
933
934 nec_float xpr1, xpr2, xpr3, xpr4, xpr5, xpr7;
935
936 nec_structure_currents* structure_currents;
937
938 void load();
939
940 void cmset(int64_t nrow, complex_array& in_cm, nec_float rkhx);
941 void compute_matrix_ss(int j1, int j2, int im1, int im2,
942 complex_array& in_cm, int64_t nrow, int itrp);
943 void cmsw(int j1, int j2, int i1, int i2, complex_array& in_cm,
944 complex_array& cw, int64_t ncw, int64_t nrow, int itrp);
945 void cmws( int j, int i1, int i2, complex_array& in_cm,
946 int64_t nr, complex_array& cw, int64_t nw, int itrp );
947
948 void cmww(int j, int i1, int i2, complex_array& in_cm, int64_t nr,
949 complex_array& cw, int64_t nw, int itrp);
950 void couple(complex_array& cur, nec_float wlam);
951
952 void efld(nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool not_on_source_segment);
953 nec_float efld_compute(nec_float xij, nec_float yij, nec_float ai, nec_float salpr,
954 nec_float zij, bool ijx, complex_array& egnd);
955 void eksc(nec_float s, nec_float z, nec_float rh, nec_float xk, int ij,
956 nec_complex *ezs, nec_complex *ers, nec_complex *ezc,
957 nec_complex *erc, nec_complex *ezk, nec_complex *erk);
958 void ekscx(nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk,
959 int ij, int inx1, int inx2, nec_complex *ezs,
960 nec_complex *ers, nec_complex *ezc, nec_complex *erc,
961 nec_complex *ezk, nec_complex *erk);
962 void etmns(nec_float p1, nec_float p2, nec_float p3, nec_float p4, nec_float p5,
963 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
964
965 void etmns_voltage_source(complex_array& e);
966 void etmns_linear_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
967 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
968 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
969 nec_float incident_amplitude, complex_array& e);
970 void etmns_circular_wave(nec_float cth, nec_float sth, nec_float cph, nec_float sph,
971 nec_float pxl, nec_float pyl, nec_float pzl, nec_float wx, nec_float wy, nec_float wz,
972 nec_float qx, nec_float qy, nec_float qz, nec_complex rrv, nec_complex rrh,
973 nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e);
974 void etmns_current_source(nec_float p1, nec_float p2, nec_float p3, nec_float p4,
975 nec_float p5, nec_float p6, complex_array& e);
976
977 void fblock( int nrow, int ncol, int64_t imax, int ipsym );
978
979 void gf(nec_float zk, nec_float *co, nec_float *si);
980 void gh(nec_float zk, nec_float *hr, nec_float *hi);
981 void gx(nec_float zz, nec_float rh, nec_float xk,
982 nec_complex *gz, nec_complex *gzp);
983 void gxx(nec_float zz, nec_float rh, nec_float a, nec_float a2, nec_float xk,
984 int ira, nec_complex *g1, nec_complex *g1p, nec_complex *g2,
985 nec_complex *g2p, nec_complex *g3, nec_complex *gzp);
986 void hfk(nec_float el1, nec_float el2, nec_float rhk,
987 nec_float zpkx, nec_float *sgr, nec_float *sgi);
988 void hintg(nec_float xi, nec_float yi, nec_float zi);
989 void hsfld(nec_float xi, nec_float yi, nec_float zi, nec_float ai);
990 void hsflx(nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk,
991 nec_complex *hps, nec_complex *hpc);
992
993 void intx(nec_float el1, nec_float el2, nec_float b, int ij,
994 nec_float *sgr, nec_float *sgi);
995
996 void nefld(nec_float xob, nec_float yob, nec_float zob, nec_complex *ex,
997 nec_complex *ey, nec_complex *ez);
998 struct netwk_state {
999 int_array ipnt, nteqa, ntsca;
1000 complex_array vsrc, rhs, cmn, rhnt, rhnx;
1001 int nteq = 0;
1002 int ntsc = 0;
1003 int ndimn = 0;
1004 int neqz2 = 0;
1005 int neqt = 0;
1006 };
1007 void netwk(complex_array& in_cm, int_array& in_ip, complex_array& einc);
1008 void netwk_build_matrix(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1009 void netwk_solve_and_check(complex_array& in_cm, int_array& in_ip, netwk_state& st);
1010 void netwk_compute_currents(complex_array& in_cm, int_array& in_ip, complex_array& einc, netwk_state& st);
1011 void netwk_compute_inputs(complex_array& einc, netwk_state& st);
1012 void nfpat(void);
1013 void nhfld(nec_float xob, nec_float yob, nec_float zob, nec_complex *hx,
1014 nec_complex *hy, nec_complex *hz);
1015 void pcint(nec_float xi, nec_float yi, nec_float zi, nec_float cabi,
1016 nec_float sabi, nec_float salpi, complex_array& e);
1017 void impedance_print(int in1, int in2, int in3, nec_float fl1, nec_float fl2,
1018 nec_float fl3, nec_float fl4, nec_float fl5, nec_float fl6, const char *ia);
1019 void qdsrc(int is, nec_complex v, complex_array& e);
1020
1021
1022 void rom2(nec_float a, nec_float b, complex_array& sum, nec_float dmin);
1023 void sflds(const nec_float t, complex_array& e);
1024 void solgf(nec_complex *a, nec_complex *b, nec_complex *c,
1025 nec_complex *d, nec_complex *xy, int *ip, int np, int n1,
1026 int n, int mp, int m1, int m, int n1c, int n2c, int n2cz);
1027 void unere(nec_float xob, nec_float yob, nec_float zob, bool ground_reflection);
1028 nec_complex zint(nec_float sigl, nec_float rolam);
1029
1030 void init_voltage_sources();
1031
1032}; /* nec_context */
1033
Definition c_geometry.h:52
Definition c_ggrid.h:77
Definition c_plot_card.h:44
Definition nec_results.h:494
Container for an nec2++ simulation.
Definition nec_context.h:80
void calc_prepare()
After the geometry has been specified, this function prepares for calculations.
Definition nec_context.cpp:121
nec_antenna_input * get_input_parameters(int index)
Get Antenna Input Parameter Results.
Definition nec_context.h:232
void xq_card(int itmp1)
"xq" execute card - calc. including radiated fields
Definition nec_context.cpp:739
void pq_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:881
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:489
void set_extended_thin_wire_kernel(bool ekflag)
Definition nec_context.cpp:957
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:894
void arc(int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad)
Definition nec_context.cpp:362
nec_results m_results
The results object that holds all the specific results.
Definition nec_context.h:787
nec_output_file m_output
an object to pipe output through...
Definition nec_context.h:752
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:628
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:826
int ifar
the current vector
Definition nec_context.h:814
nec_output_flags m_output_flags
an object to pipe output through...
Definition nec_context.h:791
void simulate(bool far_field_flag=false)
Start a simulation.
Definition nec_context.cpp:1023
double get_impedance_imag(int freq_index=0)
Impedance: Imaginary Part.
Definition nec_context.h:220
void pt_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:877
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:314
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:384
nec_norm_rx_pattern * get_norm_rx_pattern(int index)
Get Normalized Receiving Pattern Results.
Definition nec_context.h:241
nec_structure_currents * get_structure_currents(int index)
Get structure currents results.
Definition nec_context.h:277
static nec_float benchmark()
Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800.
Definition nec_context.cpp:166
void fr_card(int ifrq, int nfrq, nec_float freq_mhz, nec_float del_freq)
"fr" card, frequency parameters
Definition nec_context.cpp:404
real_array cir
coefficients of the sine terms in the current interpolation functions
Definition nec_context.h:811
void cp_card(int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:966
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:812
int iptflg
pt card flags...
Definition nec_context.h:766
void pl_card(const char *ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4)
Definition nec_context.cpp:1005
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:422
int iptflq
pq card flags
Definition nec_context.h:761
void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4)
Definition nec_context.cpp:780
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:548
real_array bir
coefficients of the constant terms in the current interpolation functions for the current vector
Definition nec_context.h:810
int nload
input integer flag (from RP card) specifies type of field computation, or type of ground system for f...
Definition nec_context.h:817
double get_impedance_real(int freq_index=0)
Impedance: Real Part.
Definition nec_context.h:213
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:6462
void geometry_complete(int gpflag)
Signal the end of a geometry description.
Definition nec_context.cpp:292
void medium_parameters(nec_float permittivity, nec_float permeability)
Definition nec_context.h:341
void kh_card(nec_float tmp1)
Definition nec_context.cpp:888
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:688
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:517
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:910
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:268
nec_radiation_pattern * get_radiation_pattern(int index)
Get Radiation Pattern results.
Definition nec_context.h:250
nec_structure_excitation * get_structure_excitation(int index)
Get structure excitation results.
Definition nec_context.h:259
void all_jobs_completed()
Definition nec_context.h:727
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