📄 nec_context.h
字号:
\param n_phi The number of phi angles. \param output_format The output format: \arg \c 0 major axis, minor axis and total gain printed. \arg \c 1 vertical, horizontal ant total gain printed. \param normalization Controls the type of normalization of the radiation pattern \arg \c 0 no normalized gain. \arg \c 1 major axis gain normalized. \arg \c 2 minor axis gain normalized. \arg \c 3 vertical axis gain normalized. \arg \c 4 horizontal axis gain normalized. \arg \c 5 total gain normalized.\param D Selects either power gain or directive gain for both standard printing and normalization. If the structure excitation is an incident plane wave, the quantities printed under the heading "gain" will actually be the scattering cross section (a/lambda 2 ) and will not be affected by the value of d. The column heading for the output will still read "power" or "directive gain," however. \arg \c 0 power gain. \arg \c 1 directive gain.\param A - Requests calculation of average power gain over the region covered by field points. \arg \c 0 no averaging. \arg \c 1 average gain computed. \arg \c 2 average gain computed, printing of gain at the field points used for averaging is suppressed. If n_theta or NPH is equal to one, average gain will not be computed for any value of A since the area of the region covered by field points vanishes. \param theta0 - Initial theta angle in degrees (initial z coordinate in meters if calc_mode = 1). \param phi0 - Initial phi angle in degrees. \param delta_theta - Increment for theta in degrees (increment for z in meters if calc_mode = 1). \param delta_phi - Increment for phi in degrees. \param radial_distance - Radial distance (R) of field point from the origin in meters. radial_distance is optional. If it is zero, the radiated electric field will have the factor exp(-jkR)/R omitted. If a value of R is specified, it should represent a point in the far-field region since near components of the field cannot be obtained with an RP card. (If calc_mode = 1, then radial_distance represents the cylindrical coordinate phi in meters and is not optional. It must be greater than about one wavelength.) \param gain_norm - Determines the gain normalization factor if normalization has been requested in the normalization parameter. If gain_norm is zero, the gain will be normalized to its maximum value. If gain_norm is not zero, the gain wi11 be normalized to the value of gain_norm. \remark The field point is specified in spherical coordinates (R, sigma, theta), except when the surface wave is computed. For computing the surface wave field (calc_mode = l), cylindrical coordinates (phi, theta, z) are used to accurately define points near the ground plane at large radial distances. \remark The rp_card() function allows automatic stepping of the field point to compute the field over a region about the antenna at uniformly spaced points. \remark The integers n_theta and n_phi and floating point numbers theta0, phi0, delta_theta, delta_phi, radial_distance, and gain_norm control the field-point stepping. \li The rp_card() function will call simulate(), causing the interaction matrix to be computed and factored and the structure currents to be computed if these operations have not already been performed. Hence, all required input parameters must be set before the rp_card() function is called. \li At a single frequency, any number of rp_card() calls may occur in sequence so that different field-point spacings may be used over different regions of space. If automatic frequency stepping is being used (i.e., in_nfrq on the fr_card() function is greater than one), only one rp_card() function will act as data inside the loop. Subsequent calls to rp_card() will calculate patterns at the final frequency. \li When both n_theta and n_phi are greater than one, the angle theta (or Z) will be stepped faster than phi. \li When a ground plane has been specified, field points should not be requested below the ground (theta greater than 90 degrees or Z less than zero.) */ 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); /*! "pt" card, print control for current */ void pt_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! "pq" card, print control for charge */ void pq_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! "kh" card, matrix integration limit */ void kh_card(nec_float tmp1); /*! Near field calculation parameters \remark \li If the number of frequencies is not equal to one (as specified by the fr_card() function, then the ne_card() function will call simulate(), causing the interaction matrix to be computed and factored and the structure currents to be computed. */ 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); /*! Near field calculation parameters \remark \li If the number of frequencies is not equal to one (as specified by the fr_card() function, then the ne_card() function will call simulate(), causing the interaction matrix to be computed and factored and the structure currents to be computed. */ 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); /*! "ek" card, extended thin wire kernel option */ void set_extended_thin_wire_kernel(bool ekflag); /*! "cp" card, maximum coupling between antennas */ void cp_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! "pl" card, plot flags \exception int Throws int on error. */ void pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4); /*!**************************************************** *** normal exit of nec2++ when all jobs complete ok *** ******************************************************/ inline void all_jobs_completed() { // put in here for the moment... m_results.write_nec_file(); } /*! \brief Start a simulation This function will trigger a calculation. In the traditional NEC world, This signals the end of the main input section and the beginning of the frequency do loop. \param far_field_flag is true if last card was XQ or RP \warning far_field_flag is should never be specified as true because both the xq_card() and rp_card() functions will call this function automatically. */ void simulate(bool far_field_flag = false); //! an object to pipe output through... nec_output_file m_output; nec_ground ground; c_geometry* m_geometry; c_plot_card plot_card; c_ggrid ggrid; c_ground_wave ground_wave; //! pq card flags int iptflq; int iptaq, iptaqf, iptaqt; //! pt card flags... int iptflg; int iptag, iptagf, iptagt; int iflow; int ifrq, nfrq; nec_float delfrq; // strcture loading int_array ldtyp, ldtag, ldtagf, ldtagt; real_array zlr, zli, zlc; // normalized receiving pattern real_array fnorm; int nthi, nphi; nec_float thetis, phiss; /*!\brief The results object that holds all the specific results. */ nec_results m_results; //! an object to pipe output through... nec_output_flags m_output_flags; nec_float wavelength; /* common /cmb/ */ complex_array cm; // primary interaction matrix /* common /matpar/ */ int icase, npblk, nlast; int imat, nbbx, npbx, nlbx, nbbl, npbl, nlbl; /* common /save/ */ int_array ip; nec_float freq_mhz; /* common /crnt/ */ real_array air, aii; //! coefficients of the constant terms in the current interpolation functions for the current vector real_array bir, bii; //! coefficients of the sine terms in the current interpolation functions real_array cir, cii; //! coefficients of the cosine terms in the current interpolation functions complex_array current_vector; //! the current vector int ifar; //! input integer flag (from RP card) specifies type of field computation, or type of ground system for far fields /* common /zload/ */ int nload; complex_array zarray; /* common /yparm/ */ int ncoup, icoup; int_array nctag, ncseg; complex_array y11a, y12a; /* common /vsorc/ */ int_array ivqd, source_segment_array, iqds; int nvqd, voltage_source_count, nqds; complex_array vqd, vqds, source_voltage_array; /* common /netcx/ */ int masym, neq, npeq, neq2, network_count, ntsol, nprint; int_array iseg1, iseg2, ntyp; real_array x11r, x11i, x12r; real_array x12i, x22r, x22i; nec_float input_power, network_power_loss; nec_complex zped; /* common /fpat/ */ enum excitation_type m_excitation_type; int m_rp_output_format; int m_rp_normalization; int m_near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp; nec_float thets, phis, dth, dph, rfld, gnor; nec_float xpr6, structure_power_loss, xnr, ynr, znr, dxnr, dynr, dznr; /* common /dataj/ */ int ind1, indd1, ind2, indd2; bool m_use_exk; /* Was iexk */ nec_float m_s, m_b, xj, yj, zj, cabj, sabj, salpj; nec_float rkh; /* matrix integration limit */ nec_float t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; nec_complex exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* common /smat/ */ int nop; /* My addition */ complex_array symmetry_array; /* common /incom/ */ int isnor; nec_float xo, yo, zo, sn, xsn, ysn; /* common /tmi/ */ int ija; /* changed to ija to avoid conflict */ nec_float zpk, rkb2; /*common /tmh/ */ nec_float zpka, rhks; // some auxiliary functions to be made private once // the radiation pattern calculation is done entirely // inside this class... 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 _wavelength ); void ffld(nec_float thet, nec_float phi, nec_complex *eth, nec_complex *eph, nec_float _wavelength ); private: /*! \brief A private convenience function called by ne_card() and nh_card() */ 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); void print_freq_int_krnl( nec_float f, nec_float lambda, nec_float int_dist, bool using_extended_kernel); void antenna_env(void); void print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq, int iptaqf, int iptaqt); /*!\brief Calculate network data such as the lengths of transmission lines. */ void calculate_network_data(void); void print_network_data(void); void print_norm_rx_pattern(int iptflg, int nthi, int nphi, nec_float thetis, nec_float phiss); void print_input_impedance(int iped, int ifrq, int nfrq, nec_float delfrq); void print_power_budget(void); void structure_segment_loading(); enum excitation_return excitation_loop(int in_freq_loop_state, int mhz, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq, int iptaqf, int iptaqt, nec_float thetis, int nfrq, int iflow, int nthi, int nphi, int iped); void setup_excitation(int iptflg); /* pointers to output files */ FILE *m_output_fp; int inc, processing_state, isave; int nthic, nphic; int iped; nec_float impedance_norm_factor; // was zpnorm nec_float xpr1, xpr2, xpr3, xpr4, xpr5, xpr7; void load(); void cmset(int nrow, complex_array& in_cm, nec_float rkhx); void compute_matrix_ss(int j1, int j2, int im1, int im2, complex_array& in_cm, int nrow, int itrp); void cmsw(int j1, int j2, int i1, int i2, complex_array& in_cm, complex_array& cw, int ncw, int nrow, int itrp); void cmws(int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int itrp); void cmww(int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int nw, int itrp); void couple(complex_array& cur, nec_float wlam); void efld(nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool on_source_segment); void eksc(nec_float s, nec_float z, nec_float rh, nec_float xk, int ij, nec_complex *ezs, nec_complex *ers, nec_complex *ezc, nec_complex *erc, nec_complex *ezk, nec_complex *erk); void ekscx(nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk, int ij, int inx1, int inx2, nec_complex *ezs, nec_complex *ers, nec_complex *ezc, nec_complex *erc, nec_complex *ezk, nec_complex *erk); void etmns(nec_float p1, nec_float p2, nec_float p3, nec_float p4, nec_float p5, nec_float p6, nec_float incident_amplitude, enum excitation_type excite_type, complex_array& e); void fblock( int nrow, int ncol, int imax, int ipsym ); void gf(nec_float zk, nec_float *co, nec_float *si); void gh(nec_float zk, nec_float *hr, nec_float *hi); void gx(nec_float zz, nec_float rh, nec_float xk, nec_complex *gz, nec_complex *gzp); void gxx(nec_float zz, nec_float rh, nec_float a, nec_float a2, nec_float xk, int ira, nec_complex *g1, nec_complex *g1p, nec_complex *g2, nec_complex *g2p, nec_complex *g3, nec_complex *gzp); void hfk(nec_float el1, nec_float el2, nec_float rhk, nec_float zpkx, nec_float *sgr, nec_float *sgi); void hintg(nec_float xi, nec_float yi, nec_float zi); void hsfld(nec_float xi, nec_float yi, nec_float zi, nec_float ai); void hsflx(nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk, nec_complex *hps, nec_complex *hpc); void intx(nec_float el1, nec_float el2, nec_float b, int ij, nec_float *sgr, nec_float *sgi); void nefld(nec_float xob, nec_float yob, nec_float zob, nec_complex *ex, nec_complex *ey, nec_complex *ez); void netwk(complex_array& in_cm, int_array& in_ip, complex_array& einc); void nfpat(void); void nhfld(nec_float xob, nec_float yob, nec_float zob, nec_complex *hx, nec_complex *hy, nec_complex *hz); void pcint(nec_float xi, nec_float yi, nec_float zi, nec_float cabi, nec_float sabi, nec_float salpi, complex_array& e); void impedance_print(int in1, int in2, int in3, nec_float fl1, nec_float fl2, nec_float fl3, nec_float fl4, nec_float fl5, nec_float fl6, char *ia); void qdsrc(int is, nec_complex v, complex_array& e); void rom2(nec_float a, nec_float b, complex_array& sum, nec_float dmin); void sflds(nec_float t, complex_array& e); void solgf(nec_complex *a, nec_complex *b, nec_complex *c, nec_complex *d, nec_complex *xy, int *ip, int np, int n1, int n, int mp, int m1, int m, int n1c, int n2c, int n2cz); void unere(nec_float xob, nec_float yob, nec_float zob, bool ground_reflection); nec_complex zint(nec_float sigl, nec_float rolam); void init_voltage_sources();}; /* nec_context */#endif /* __nec_context__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -