nec2++  1.7.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
nec_context Class Reference

Container for an nec2++ simulation. More...

#include <nec_context.h>

Public Member Functions

void initialize ()
 Initialize everything, called after construction so that we can tell the geometry object what nec_context object to point to.
 
void calc_prepare ()
 After the geometry has been specified, this function prepares for calculations.
 
c_geometryget_geometry ()
 
double get_gain (int freq_index, int theta_index, int phi_index)
 Get the maximum gain in dB. More...
 
double get_gain_max (int freq_index=0)
 
double get_gain_min (int freq_index=0)
 
double get_gain_mean (int freq_index=0)
 
double get_gain_sd (int freq_index=0)
 
double get_gain_rhcp_max (int freq_index=0)
 
double get_gain_rhcp_min (int freq_index=0)
 
double get_gain_rhcp_mean (int freq_index=0)
 
double get_gain_rhcp_sd (int freq_index=0)
 
double get_gain_lhcp_max (int freq_index=0)
 
double get_gain_lhcp_min (int freq_index=0)
 
double get_gain_lhcp_mean (int freq_index=0)
 
double get_gain_lhcp_sd (int freq_index=0)
 
double get_impedance_real (int freq_index=0)
 Impedance: Real Part.
 
double get_impedance_imag (int freq_index=0)
 Impedance: Imaginary Part.
 
nec_antenna_inputget_input_parameters (int index)
 Get Antenna Input Parameter Results. More...
 
nec_norm_rx_patternget_norm_rx_pattern (int index)
 Get Normalized Receiving Pattern Results. More...
 
nec_radiation_patternget_radiation_pattern (int index)
 Get Radiation Pattern results. More...
 
nec_structure_excitationget_structure_excitation (int index)
 Get structure excitation results. More...
 
nec_near_field_patternget_near_field_pattern (int index)
 Get near field pattern results. More...
 
nec_structure_currentsget_structure_currents (int index)
 Get structure currents results. More...
 
void set_isave (int in_isave)
 
int get_inc ()
 
nec_float get_xpr1 ()
 
nec_float get_xpr2 ()
 
void set_output (nec_output_file in_output, nec_output_flags in_output_flags)
 
void set_results_format (enum RESULT_FORMAT result_format)
 
void set_gain_only (bool flag)
 
void geometry_complete (int gpflag)
 Signal the end of a geometry description. More...
 
void medium_parameters (nec_float permittivity, nec_float permeability)
 
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)
 
void sp_card (int ns, nec_float x1, nec_float y1, nec_float z1, nec_float x2, nec_float y2, nec_float z2)
 
void sc_card (int i2, nec_float x3, nec_float y3, nec_float z3, nec_float x4, nec_float y4, nec_float z4)
 
void gx_card (int i1, int i2)
 
void move (nec_float rox, nec_float roy, nec_float roz, nec_float xs, nec_float ys, nec_float zs, int its, int nrpt, int itgi)
 
void arc (int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad)
 
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,. More...
 
void fr_card (int in_ifrq, int in_nfrq, nec_float in_freq_mhz, nec_float in_del_freq)
 
void ld_card (int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3)
 
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. More...
 
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)
 
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)
 
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)
 
void xq_card (int itmp1)
 
void gd_card (nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4)
 
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. More...
 
void pt_card (int itmp1, int itmp2, int itmp3, int itmp4)
 
void pq_card (int itmp1, int itmp2, int itmp3, int itmp4)
 
void kh_card (nec_float tmp1)
 
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)
 
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)
 
void set_extended_thin_wire_kernel (bool ekflag)
 
void cp_card (int itmp1, int itmp2, int itmp3, int itmp4)
 
void pl_card (const char *ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4)
 
void all_jobs_completed ()
 
void write_results (ostream &os)
 
void simulate (bool far_field_flag=false)
 Start a simulation. More...
 
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)
 gfld computes the radiated field including ground wave. More...
 
void ffld (nec_float thet, nec_float phi, nec_complex *eth, nec_complex *eph, nec_float _wavelength)
 

Static Public Member Functions

static nec_float benchmark ()
 Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. More...
 

Public Attributes

nec_output_file m_output
 an object to pipe output through...
 
nec_ground ground
 
c_geometrym_geometry
 
c_plot_card plot_card
 
c_ggrid ggrid
 
c_ground_wave ground_wave
 
int iptflq
 pq card flags
 
int iptaq
 
int iptaqf
 
int iptaqt
 
int iptflg
 pt card flags...
 
int iptag
 
int iptagf
 
int iptagt
 
int iflow
 
int ifrq
 
int nfrq
 
nec_float delfrq
 
int_array ldtyp
 
int_array ldtag
 
int_array ldtagf
 
int_array ldtagt
 
real_array zlr
 
real_array zli
 
real_array zlc
 
real_matrix fnorm
 
int nthi
 
int nphi
 
nec_float thetis
 
nec_float phiss
 
nec_results m_results
 The results object that holds all the specific results.
 
nec_output_flags m_output_flags
 an object to pipe output through...
 
nec_float wavelength
 
complex_array cm
 
int icase
 
int npblk
 
int nlast
 
int nbbx
 
int npbx
 
int nlbx
 
int nbbl
 
int npbl
 
int nlbl
 
int_array ip
 
nec_float freq_mhz
 
real_array air
 
real_array aii
 
real_array bir
 coefficients of the constant terms in the current interpolation functions for the current vector
 
real_array bii
 
real_array cir
 coefficients of the sine terms in the current interpolation functions
 
real_array cii
 
complex_array current_vector
 coefficients of the cosine terms in the current interpolation functions
 
int ifar
 the current vector
 
int nload
 input integer flag (from RP card) specifies type of field computation, or type of ground system for far fields
 
complex_array zarray
 
int ncoup
 
int icoup
 
int_array nctag
 
int_array ncseg
 
complex_array y11a
 
complex_array y12a
 
int_array ivqd
 
int_array source_segment_array
 
int_array iqds
 
int nvqd
 
int voltage_source_count
 
int nqds
 
complex_array vqd
 
complex_array vqds
 
complex_array source_voltage_array
 
int masym
 
int neq
 
int npeq
 
int neq2
 
int network_count
 
int ntsol
 
int nprint
 
int_array iseg1
 
int_array iseg2
 
int_array ntyp
 
real_array x11r
 
real_array x11i
 
real_array x12r
 
real_array x12i
 
real_array x22r
 
real_array x22i
 
nec_float input_power
 
nec_float network_power_loss
 
nec_complex zped
 
enum excitation_type m_excitation_type
 
int m_rp_output_format
 
int m_rp_normalization
 
int m_near
 
int nfeh
 
int nrx
 
int nry
 
int nrz
 
int nth
 
int nph
 
int ipd
 
int iavp
 
nec_float thets
 
nec_float phis
 
nec_float dth
 
nec_float dph
 
nec_float rfld
 
nec_float gnor
 
nec_float xpr6
 
nec_float structure_power_loss
 
nec_float xnr
 
nec_float ynr
 
nec_float znr
 
nec_float dxnr
 
nec_float dynr
 
nec_float dznr
 
int ind1
 
int indd1
 
int ind2
 
int indd2
 
bool m_use_exk
 
nec_float m_s
 
nec_float m_b
 
nec_float xj
 
nec_float yj
 
nec_float zj
 
nec_float cabj
 
nec_float sabj
 
nec_float salpj
 
nec_float rkh
 
nec_float t1xj
 
nec_float t1yj
 
nec_float t1zj
 
nec_float t2xj
 
nec_float t2yj
 
nec_float t2zj
 
nec_complex exk
 
nec_complex eyk
 
nec_complex ezk
 
nec_complex exs
 
nec_complex eys
 
nec_complex ezs
 
nec_complex exc
 
nec_complex eyc
 
nec_complex ezc
 
int nop
 
complex_array symmetry_array
 
int isnor
 
nec_float xo
 
nec_float yo
 
nec_float zo
 
nec_float sn
 
nec_float xsn
 
nec_float ysn
 
int ija
 
nec_float zpk
 
nec_float rkb2
 
nec_float zpka
 
nec_float rhks
 

Detailed Description

Container for an nec2++ simulation.

An nec_context object is the container for an nec2++ simulation. A c_geometry object is associated with the nec_context, and then after the simulation is done, the results can be requested from this object.

Examples:
test_cpp.cpp, and test_nec.c.

Member Function Documentation

void nec_context::all_jobs_completed ( )
inline

normal exit of nec2++ when all jobs complete ok ***

void nec_context::arc ( int  tag_id,
int  segment_count,
nec_float  rada,
nec_float  ang1,
nec_float  ang2,
nec_float  rad 
)

Add an arc to the geometry,

All co-ordinates are in meters.

    \param tag_id The tag ID.
    \param segment_count The number of segments.
    \param rada The radius.
    \param ang1 The angle of the arc starting point.
    \param ang2 The angle of the arc end point.
    \param rad The wire radius.
nec_float nec_context::benchmark ( )
static

Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800.

Benchmark the libnecpp engine. A score of 1.0 is roughly an Athlon XP 1800.

References ex_card(), fr_card(), geometry_complete(), gn_card(), initialize(), ld_card(), pt_card(), rp_card(), c_geometry::wire(), and xq_card().

Referenced by nec_benchmark().

void nec_context::cp_card ( int  itmp1,
int  itmp2,
int  itmp3,
int  itmp4 
)

"cp" card, maximum coupling between antennas

void nec_context::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 
)

"ex" card, excitation parameters

                EX      EXCITE STRUCTURE, LAST ENCOUNTERED=USED
                        I1- 0=E VOLTAGE (A), 1=LINEAR WAVE (B), 2= R CIRC WAVE (B) 3=L CIRC WAVE (B), 4= CURRENT (C), 5= VOLTAGE DISC. (A)
                        I2- (A) SOURCE TAG#, (B) # TH ANGLS, (C) BLANK
                        I3- (A) SOURCE SEG#, (B) # PH ANGLS, (C) BLANK
                        I4- (A) XX= ADMIT.,IMPED. PRINT, X=0 NO/1 DO, (BC), 1= ADM. PRINT
                        F1- (A) EREAL, (B) TH ANGL, (C) X OF SOURCE
                        F2- (A) EIMAG, (B) PH ANGL, (C) Y OF SOURCE
                        F3- (A) NORM FOR I4, (B) ET ANGL, Z OF SOURCE
                        F4- (A) BLANK, (B) TH INC, (C) ALPHA ANGLE FROM XY
                        F5- (A) BLANK, (B) PH INC, (C) BETA ANGLE FROM X
                        F6- (A) BLANK, (B) MIN/MAJ AXIS, PRODUCT AMPS X LENGTH
                        
                        // NOT YET DONE... F7- (A) BLANK, (B) INCIDENT AMPLITUDE (Volts/m)
Examples:
test_cpp.cpp.

References c_geometry::get_segment_number().

Referenced by benchmark(), nec_ex_card(), nec_excitation_current(), nec_excitation_planewave(), and nec_excitation_voltage().

void nec_context::fr_card ( int  in_ifrq,
int  in_nfrq,
nec_float  in_freq_mhz,
nec_float  in_del_freq 
)

"fr" card, frequency parameters

FREQUENCY
I1- O= LINEAR STEP, 1=MULTIPLICATIVE
I2- NO. STEPS, BLANK=1
F1- FREQUENCY OR START FREQUENCY
F2- FREQ INCREMENT, ADD OR MULTIPLY
Examples:
test_cpp.cpp.

Referenced by benchmark(), and nec_fr_card().

void nec_context::gd_card ( nec_float  tmp1,
nec_float  tmp2,
nec_float  tmp3,
nec_float  tmp4 
)

"gd" card, ground representation

void nec_context::geometry_complete ( int  gpflag)

Signal the end of a geometry description.

This function prepares for a calculation by calling calc_prepare().

Examples:
test_cpp.cpp.

References calc_prepare(), and c_geometry::geometry_complete().

Referenced by benchmark(), and nec_geometry_complete().

double nec_context::get_gain ( int  freq_index,
int  theta_index,
int  phi_index 
)
inline

Get the maximum gain in dB.

This function requires a previous rp_card() method to have been called (with gain normalization requested)

Returns
The maximum gain in dB or -999.0 if no radiation pattern had been previously requested.

References nec_radiation_pattern::get_power_gain(), and get_radiation_pattern().

Referenced by nec_gain().

nec_antenna_input* nec_context::get_input_parameters ( int  index)
inline

Get Antenna Input Parameter Results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested antenna input parameter data (or NULL if the result does not exist).
Note
You must NOT delete the nec_antenna_input object when finished with it.

References nec_results::get_antenna_input(), and m_results.

Referenced by get_impedance_imag(), and get_impedance_real().

nec_near_field_pattern* nec_context::get_near_field_pattern ( int  index)
inline

Get near field pattern results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested radiation pattern data (or NULL if the result does not exist).
Note
You must NOT delete the results object when finished with it.

References nec_results::get_near_field_pattern(), and m_results.

nec_norm_rx_pattern* nec_context::get_norm_rx_pattern ( int  index)
inline

Get Normalized Receiving Pattern Results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested radiation pattern data (or NULL if the result does not exist).
Note
You must NOT delete the nec_norm_rx_pattern object when finished with it.

References nec_results::get_norm_rx_pattern(), and m_results.

nec_radiation_pattern* nec_context::get_radiation_pattern ( int  index)
inline

Get Radiation Pattern results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested radiation pattern data (or NULL if the result does not exist).
Note
You must NOT delete the results object when finished with it.
Examples:
test_cpp.cpp.

References nec_results::get_radiation_pattern(), and m_results.

Referenced by get_gain().

nec_structure_currents* nec_context::get_structure_currents ( int  index)
inline

Get structure currents results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested radiation pattern data (or NULL if the result does not exist).
Note
You must NOT delete the results object when finished with it.

References nec_results::get_structure_currents(), and m_results.

nec_structure_excitation* nec_context::get_structure_excitation ( int  index)
inline

Get structure excitation results.

Parameters
indexThe zero-based index for the result (simulations can return more than one set of results).
Returns
The requested radiation pattern data (or NULL if the result does not exist).
Note
You must NOT delete the results object when finished with it.

References nec_results::get_structure_excitation(), and m_results.

void nec_context::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 
)

gfld computes the radiated field including ground wave.

Parameters
space_onlyCompute only the space wave (was ksymp == 1)

References bir, and cir.

Referenced by nec_radiation_pattern::analyze().

void nec_context::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.

Remarks
Specifies the relative dielectric constant and conductivity of ground in the vicinity of the antenna. In addition, a second set of ground parameters for a second medium can be specified, or a radial wire ground screen can be modeled using a reflection coefficient approximation.
Parameters
ground_type(was IPERF) Ground-type flag. The options are:
  • -1 - Nullifies ground parameters previously used and sets free-space condition. The remainder of the parameters should be zero in this case.
  • O - Finite ground, reflection-coefficient approximation.
  • 1 - Perfectly conducting ground.
  • 2 - Finite ground, Sommerfeld/Norton method.
rad_wire_count(was NRADL) - Number of radial wires in the ground screen approximation; Set to zero implies no ground screen.
EPSE(F1) - Relative dielectric constant for ground in the vicinity of the antenna. Set to zero in case of a perfect ground.
SIG(F2) - Conductivity in mhos/meter of the ground in the vicinity of the antenna. Set to zero in the case of a perfect ground. If SIG is input as a negative number, the complex dielectric constant Ec = Er -j*sigma/(omega*epsilonzero) is set to EPSR - |SIG|.
Remarks

Options for Remaining Floating Point Fields (F3-F6):

  • a. For an infinite ground plane, F3 through F6 are blank.
  • b. Radial wire ground screen approximation (NRADL nonzero). The ground screen is always centered at the origin, i.e., at (0,0,0), and lies in the XY plane. (F3) - The radius of the screen in meters. (F4) - Radius of the wires used in the screen, in meters. (F5) & (F6) - Blank.
  • c. Second medium parameters (NRADL = O) for medium outside the region of the first medium (cliff problem). These parameters alter the far field patterns but do not affect the antenna impedance or current distribution. (F3) - Relative dielectric constant of medium 2. (F4) - Conductivity of medium 2 in mhos/meter. (F5) - Distance in meters from the origin of the coordinate system to the join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance out the positive X axis to where the two media join in a line parallel to the Y axis. Specification of the circular or linear option is on the RP card. See Figure 16. (F6) - Distance in meters (positive or zero) by which the surface of medium 2 is below medium 1.
Examples:
test_cpp.cpp.

Referenced by benchmark(), and nec_gn_card().

void nec_context::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,.

Remarks
The helix is a versatile geometry element. For example, to generate a spiral printed circuit antenna, use a helix of zero height.

All co-ordinates are in meters.

    \param tag_id The tag ID.
    \param segment_count The number of segments.
    \param s The turn spacing.
    \param h1 The total length of the helix (negative for a left-handed helix).
    \param a1 x-start radius.
    \param b1 y-start radius.
    \param a2 x-end radius.
    \param b2 y-end radius.
    \param rad The wire radius.
Remarks
The helix is a versatile m_geometry->element. For example, to generate a spiral printed circuit antenna, use a helix of zero height.

All co-ordinates are in meters.

    \param tag_id The tag ID.
    \param segment_count The number of segments.
    \param s The turn spacing.
    \param h1 The total length of the helix (negative for a left-handed helix).
    \param a1 x-start radius.
    \param b1 y-start radius.
    \param a2 x-end radius.
    \param b2 y-end radius.
    \param rad The wire radius.
void nec_context::kh_card ( nec_float  tmp1)

"kh" card, matrix integration limit

void nec_context::ld_card ( int  itmp1,
int  itmp2,
int  itmp3,
int  itmp4,
nec_float  tmp1,
nec_float  tmp2,
nec_float  tmp3 
)

1: "ld" card, loading parameters

LD      LOADING
        itmp1-  -1 CANCEL LOADS,
                0=SERIES RLC LUMP,
                1=PARALLEL RLC LUMP,
                2=SERIES DIST.,
                3=PARALLEL DIST. (A),
                4=Z (B),
                5=WIRE COND. (C)
        itmp2- TAG# TO BE LOADED, BLANK/0= USE ABSOLUTE #s      
        itmp3- SEG# OF TAG # TO START LOADS, OR ABSOLUTE SEG#
        itmp4- SEG# OF TAG# TO END LOADS, OR OR ABSOLUTE SEG#
        F1- RES., OHMS, OR (A) OHMS/UNIT LENGTH, OR (B) RES. OR (C) OHMS/METER
        F2- IND., HENRY, OR (A) HY/LENGTH OR (B) REACT. OR (C) BLANK
        F3- CAP,. FARAD, OR (A,B) BLANK
Examples:
test_cpp.cpp.

References nload.

Referenced by benchmark(), and nec_ld_card().

void nec_context::medium_parameters ( nec_float  permittivity,
nec_float  permeability 
)
inline

Set the prameters of the medium (permittivity and permeability)

\param permittivity The electric permittivity of the medium (in farads per meter)
\param permeability The magnetic permeability of the medium (in henries per meter)

From these parameters a speed of light is chosen.

Referenced by nec_medium_parameters().

void nec_context::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

Remarks
  • 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 nec_context::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 
)

Near field calculation parameters

Remarks
  • 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 nec_context::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 
)

4: "nt" card, network parameters

        NT      NETWORKS
                I1- PORT 1 TAG #, BLANK/0, USE I2 AS ABSOLUTE
                I2- SEGMENT#, OR ABSOLUTE END 1 SEGMENT, -1=CANCEL NETS/LINES
                I3- AS I1 FOR PORT 2
                I4- AS I2 FOR PORT 2
                F1- REAL OF Y(11), MHOS
                F2- IMAG OF Y(11)
                F3- REAL OF Y(12)
                F4- IMAG OF Y(12)
                F5- REAL OF Y(22)
                F6- IMAG OF Y(22)

References c_geometry::get_segment_number().

void nec_context::pl_card ( const char *  ploutput_filename,
int  itmp1,
int  itmp2,
int  itmp3,
int  itmp4 
)

"pl" card, plot flags

Exceptions
intThrows int on error.
void nec_context::pq_card ( int  itmp1,
int  itmp2,
int  itmp3,
int  itmp4 
)

"pq" card, print control for charge

References iptflq.

void nec_context::pt_card ( int  itmp1,
int  itmp2,
int  itmp3,
int  itmp4 
)

"pt" card, print control for current

Examples:
test_cpp.cpp.

References iptflg.

Referenced by benchmark(), and nec_pt_card().

void nec_context::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.

Parameters
calc_modeThis integer selects the mode of calculation for the radiated field. Some values of (calc_mode) will affect the meaning of the remaining parameters on the card. Options available for calc_mode are:
  • O - normal mode. Space-wave fields are computed. An infinite ground plane is included if it has been specified previously on a GN card; otherwise, the antenna is in free space.
  • 1 - surface wave propagating along ground is added to the normal space wave. This option changes the meaning of some of the other parameters on the RP card as explained below, and the results appear in a special output format. Ground parameters must have been input on a GN card. The following options cause calculation of only the space wave but with special ground conditions. Ground conditions include a two-medium ground (cliff where the media join in a circle or a line), and a radial wire ground screen. Ground parameters and dimensions must be input on a GN or GD card before the RP card is read. The RP card only selects the option for inclusion in the field calculation. (Refer to the GN and GD cards for further explanation.)
  • 2 - linear cliff with antenna above upper level. Lower medium parameters are as specified for the second medium on the GN card or on the GD card.
  • 3 - circular cliff centered at origin of coordinate system: with antenna above upper level. Lower medium parameters are as specified for the second medium on the GN card or on the GD card.
  • 4 - radial wire ground screen centered at origin.
  • 5 - both radial wire ground screen and linear cliff.
  • 6 - both radial wire ground screen ant circular cliff.
n_thetaThe number of theta angles.
n_phiThe number of phi angles.
output_formatThe output format:
  • 0 major axis, minor axis and total gain printed.
  • 1 vertical, horizontal ant total gain printed.
normalizationControls the type of normalization of the radiation pattern
  • 0 no normalized gain.
  • 1 major axis gain normalized.
  • 2 minor axis gain normalized.
  • 3 vertical axis gain normalized.
  • 4 horizontal axis gain normalized.
  • 5 total gain normalized.
DSelects 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.
  • 0 power gain.
  • 1 directive gain.
A- Requests calculation of average power gain over the region covered by field points.
  • 0 no averaging.
  • 1 average gain computed.
  • 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.)
calc_mode
n_theta
n_phi
output_formatThe output format (0 major axis, minor axis and total gain printed. 1 vertical, horizontal ant total gain printed.)
normalizationControls the type of normalization of the radiation pattern N = 0 no normalized gain. = 1 major axis gain normalized. = 2 minor axis gain normalized. = 3 vertical axis gain normalized. = 4 horizontal axis gain normalized. = 5 total gain normalized.
DSelects 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.
  • D = 0 power gain.
  • D = 1 directive gain.
A- Requests calculation of average power gain over the region covered by field points.
  • A = 0 no averaging.
  • A = 1 average gain computed.
  • A = 2 average gain computed, printing of gain at the field points used for averaging is suppressed. If NTH 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.
theta0- Initial theta angle in degrees (initial z coordinate in meters if I1 = 1).
phi0- Initial phi angle in degrees.
delta_theta- Increment for theta in degrees (increment for z in meters if I1 = 1).
delta_phi- Increment for phi in degrees.
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 I1 = 1, then radial_distance represents the cylindrical coordinate phi in meters and is not optional. It must be greater than about one wavelength.)
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 w111 be normalized to the value of gain_norm.
Examples:
test_cpp.cpp.

References ifar, and simulate().

Referenced by benchmark(), and nec_rp_card().

void nec_context::set_extended_thin_wire_kernel ( bool  ekflag)

"ek" card, extended thin wire kernel option

Referenced by nec_ek_card().

void nec_context::simulate ( bool  far_field_flag = false)

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.

Parameters
far_field_flagis 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.

References ifar, iptflg, and m_output.

Referenced by rp_card(), and xq_card().

void nec_context::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 
)

5: "tl" card, transmission line parameters

Remarks
To generate a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters.
TL TRANSMISSION LINE 
        I1- PORT 1 TAG #, BLANK/0, USE I2 AS ABSOLUTE
        I2- SEGMENT#, OR ABSOLUTE END 1 SEGMENT, -1=CANCEL NETS/LINES
        I3- AS I1 FOR PORT 2
        I4- AS I2 FOR PORT 2
        F1- LINE Zo, -=CROSSED LINE
        F2- LINE LENGTH METERS, BLANK=STRAIGHT LINE P1 TO P2
        F3- REAL SHUNT ADM., END 1 MHOS
        F4- IMAG SHUNT ADM., END 1
        F5- REAL SHUNT ADM., END 2
        F6- IMAG SHUNT ADM., END 2

References c_geometry::get_segment_number().

void nec_context::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 
)

Add a wire to the geometry,

All co-ordinates are in meters.

Parameters
tag_idThe tag ID.
segment_countThe number of segments.
xw1The x coordinate of the wire starting point.
yw1The y coordinate of the wire starting point.
zw1The z coordinate of the wire starting point.
xw2The x coordinate of the wire ending point.
yw2The y coordinate of the wire ending point.
zw2The z coordinate of the wire ending point.
radThe wire radius (meters)
rdelFor tapered wires, the. Otherwise set to 1.0
rradFor tapered wires, the. Otherwise set to 1.0

Add a wire to the geometry,

All co-ordinates are in meters.

    \param tag_id The tag ID.
    \param segment_count The number of segments.
    \param xw1 The x coordinate of the wire starting point.
    \param yw1 The y coordinate of the wire starting point.
    \param zw1 The z coordinate of the wire starting point.
    \param xw2 The x coordinate of the wire ending point.
    \param yw2 The y coordinate of the wire ending point.
    \param zw2 The z coordinate of the wire ending point.
    \param rad The wire radius (meters)
    \param rdel For tapered wires, the. Otherwise set to 1.0
    \param rrad For tapered wires, the. Otherwise set to 1.0

References c_geometry::wire().

Referenced by nec_wire().

void nec_context::xq_card ( int  itmp1)

"xq" execute card - calc. including radiated fields

XQ      EXECUTE ACCUMULATED CARD DECK
        itmp1-
                0=NO PATTERN,
                1=XY PATTERN,
                2= YZ PATTERN,
                3=BOTH
        (DO NOT USE FOR RADIAL GND SCREEN OR 2ND GND MEDIUM)

        NOTES: FOR A SINGLE FREQUENCY, XQ, NE, NH, RP CAUSE IMMEDIATE EXECUTION
        FOR MULTIPLE FREQS, ONLY XQ, RP CAUSE EXECUTION

References ifar, and simulate().

Referenced by benchmark(), and nec_xq_card().


The documentation for this class was generated from the following files: