The Numerical Electromagnetics Code (NEC-2) is a comprehensive package for the analysis of the electromagnetic properties of structures. It can analyse radiating properties i.e. antenna gain, as well as scattering properties (radar cross section) of structures. NEC-2 was originally written in FORTRAN.
NEC2++ is an extensive rewrite of NEC-2 in C++ by Tim Molteno. This work was helped tremendously by the work of N. Kyriazis who ported NEC-2 to C. The new portions of code are licensed under the GNU Public License (GPL).
To use nec2++, after installation
usage: nec2++ [-i input-file-name] [-o output-file-name] -g: print maximum gain to stdout. -b: Perform NEC++ Benchmark. -s: print results to standard output. -c: print results in comma-separated-value (CSV) format, this options is used in conjunction with (-s) above. -h: print this usage information and exit. -v: print nec2++ version number and exit.
The output file name is optional. If it is not specified, a file will be created in the same directory as the input file and with an extension .out.
Decompress the source-code archive, and issue the following commands. This should work on systems with a C++ compiler (almost all systems)
tar -jxf necpp_latest.tar.bz2 cd necpp_31 July 2008_short make -f makefile.dist make -f makefile.dist install
Decompress the Windows Code Distribution, and build the Visual Studio project inside the win32 subdirectory
To build libnecpp, and use NEC from a C API, you need to use autoconf and friends -- to install these on Debian linux, simply type
apt-get install automake libtool
To build the library, download the autoconf distribution [1 MB] and issue the following commands:
tar -zxf necpp-1.2.9.tar.gz cd necpp-1.2.9 ./configure make make install"); ?>
In the very near future, nec2++ will depend on the ATLAS. To install this use the following commands under DEBIAN linux (http://www.debian.org).
apt-get install atlas3-base atlas3-headers atlas3-base-dev apt-get install refblas3-dev lapack3-dev lapack3-doc
For installation on other operating systems, you should look at the ATLAS page.