History of nec (nec_exe.zip)

nec and nec_exe.zip superceeds nec_exe.zip version 1.0.

 

nec_exe.zip contains the executable nec.exe which will run on Windows platforms supporting the Microsoft 32 bit executable console model, including Windows XP.

 

nec has been written in C++ and this latest revision, nec version 2.0, sports a user modifiable configuration file, enhanced command line parameters and more complete processing of the nec2d input deck.

 

nec(.exe) was compiled with unmanaged Visual C++ version 7 (from Visual Studio.NET) and will also compile with Visual C++ version 6, which means it no longer requires any other support files, unlike version 1.0 which was compiled with Borland C++ and required RTM.exe and CW3220.DLL.

 

The source code has also been provided to assist users with the migration to other platforms. When I made the enhacements for version 20 I sectionalised the code into machine dependent code (machdep.h and machdep.cpp) and machine independent code (stand,.h, nec.h and nec.cpp).

Intoduction

Nec2d is an antenna simulation program based on the Method of Moments (MoM) technique where lineal antenna structures are represented by adjoining wire segments and antenna surfaces are either represented by wire grids or optionally, in cases of closed surfaces, by adjoining surface patches. The simulation problem is specified by sequences of lines supplied in an input stream which, given the program lineage, is referred to as the input card deck.

 

In the tradition implementation of MoM (FORTRAN or C) the solution matrices are statically declared and thus are of finite extent. Different variants of nec2d exist depending on the precision and dimensions of the problem set and each of these variants is thus resistricted to a maximum number of segments and patches.

 

The program nec(.exe) was written to assist in the automatic selection and invocation of one of these nec2d variants obviating the need for the controlling program to have neither prior knowledge of the implementation restrictions of the nec2d variants, nor get involved with the generation of the Sommerfeld interpolation grid, in cases of real ground simulations.

 

nec(.exe) processes the input card deck to determine the number of segments and patches, the frequency, ground parameters and whether the Sommerfeld interpolation grid input file is required.  Previously generated Sommerfeld interpolation grid files are stored in a database, and if a file cannot be found in the database for the specified frequency and ground parameters, somnec2d is automatically invoked and the output file is saved in the database for later use. Nec will re-use the stored Sommerfeld Interpolation Grid file in any problem with the same ground and frequency parameters because each file is named uniquely in accordance with these parameters and stored in the regular file system.

The MoM matrix bounds are determined from the number of segments and twice the number of patches and a suitable nec2d variant is then invoked to process the input deck.

 

A configuration file contains the name of the somnec2d executable in the first line and the relationship between the maximum number of segments and the nec2d variants is stored in subsequent lines on a line-by-line basis. This configuration file is read each time nec is invoked and the supplied maximum segments in each line is used to choose which nec2d variant will be invoked to process the number of segments and patches contained in the input card deck. If the configuration file is not found a default file will be written which contains the executables supported under Windows XP. The configuration file is an ASCII file and you can modify it to include your own somnec2d and nec2d variants.

Usage Synopsis:

nec is a shell program to execute nec2d variants.

 

Nec reads the NEC input deck and processes the: GA, GH, GR, GW, GX, SP, SM and FR cards to determine which nec2d variant to execute

 

If a Somnec input file is required for a real ground  (specified in the GN card) nec will use the SOMDATA environment variable or –pPath, or by default the directory ./SOMDATA, to read or write the appropriate somnec2d input file.

 

Usage:

nec [-sn] [-p[\"]SOMNEC_PATH[\"]]  [-c[\"]CONFIG_PATH[\"]] [\"]inputfile[\"]" "[[\"]outputfile[\"]] [-e]"

 

inputfile is the path to the .nec data file, the .nec extension is optional

 

outputfile is the optional output file specification the default is the same basename as the input file and the suffix .out (The default output file name is determined by the processing in the nec2d variant.)

 

–s is the segment calculation override switch and n is the maximum number of segments. This will force a particular variant to be used and can be employed in cases where the number of segments is mis-calculated.

 

-p is the somnec_path switch. This switch is optional, if it is not supplied the environment variable SOMDATA will be used. If neither the switch nor the variable are supplied the default will be to archive the data in ./SOMDATA/*

 

-c switch optionally specified the configuration file path which overrides the environment variable

NEC_CONFIG. If neither the switch, nor the environment variable exist then a default configuration path is determined from the executable path. If the configuration file is not found then one is written for you. The configuration file format is as follows:

All variants must be organized in ascending order of maximum segments because  the configuration file data is not sorted. If the problem size (number of segments + 2 * number of patches) exceed the size specified on a given line the next line is read. In the case where the problem size is greater than any line specification the last specification is used.

 

-e is the optional effect switch. If you specify –e then nec will just process the input card deck to determine the availability of the Sommerfeld Interpolation Grid file, if that file does not exist somnec2d will be invoked to generate the file and the file will be stored for subsequent use.

Author

Ralph B. Holland, VK1BRH. 

 

mailto: ralph@arising.com.au http://www.arising.com.au/people/Holland/.ralph/index.htm

 

The author would appreciate hearing from anybody who has migrated or would like to migrate this code to another platform.