necpp-1.5.0+cvs20101003/0000755000175000017500000000000011452152163012702 5ustar numanumanecpp-1.5.0+cvs20101003/docs/0000755000175000017500000000000011452152150013626 5ustar numanumanecpp-1.5.0+cvs20101003/docs/install.sh0000755000175000017500000000014111044231413015624 0ustar numanuma#!/bin/sh scp index.html tcam-guest@necpp.alioth.debian.org:/home/groups/necpp/htdocs/index.html necpp-1.5.0+cvs20101003/docs/nec.bib0000644000175000017500000000563010310210756015054 0ustar numanuma @TechReport{Burke81, author = {Burke, G. and Poggio, A.}, title = {Numerical electromagnetics code -- method of moments}, institution = {Lawrence Livermore National Laboratory}, year = {1981}, number = {UCID-18834} } @Article{Excell95, author = {Excell, P.S. and Porter, G.J. and Tang, Y.K. and Yip, K.W.}, title = {Re-working of two standard moment-method codes for execution on parallel processors}, journal = {International Journal of Numerical Modelling: Electronic Networks, Devices and Fields.}, year = {1995}, volume = {8}, pages = {} } @Article{Nitch94, author = {Nitch, D.C. and Fourie, A.P.C.}, title = {Parallel implementation of {{NEC}}}, journal = {Applied Computational Electromagnetics Society Journal}, year = {1994}, volume = {9}, number = {1}, pages = {51-57} } @Article{Jones97, author = {Jones, E.A. and Joines, W.T.}, title = {Design of {Y}agi-{U}da antennas using genetic algorithms}, journal= {IEEE Transactions on Antennas and Propagation}, institution = {Dept. of Electr. & Comput. Eng., Duke Univ., Durham, NC}, year={1997}, volume={45}, issue={9}, pages= {1386-1392} } @InProceedings{NitchOOP94, author = {Nitch, D.C. and Fourie, A.P.C.}, title = {A redesign of {NEC2} using the object-oriented paradigm}, booktitle = {Antennas and Propagation Society International Symposium}, year = {1994}, volume = {2}, pages = {1150-1153} } @Article{Rubinstein2003, author = {Rubinstein, A. and Rachidi, F. and Rubinstein, M. and Reusser, B.}, title = {A parallel implementation of {NEC} for the analysis of large structures}, journal= {IEEE Transactions on Electromagnetic Compatibility}, institution = {Swiss Fed. Inst. of Technol., Lausanne, Switzerland}, year={2003}, volume={45}, issue={2}, pages= {177-188} } @ARTICLE{Whaley2001, AUTHOR = "R. Clint Whaley and Antoine Petitet and Jack J. Dongarra", TITLE = "Automated Empirical Optimization of Software and the {ATLAS} Project", JOURNAL = "Parallel Computing", VOLUME = "27", NUMBER = "1--2", PAGES = "3--35", YEAR = 2001 } @Book{SCALAPACK, author = {Blackford, L. S. and J. Choi and A. Cleary and E. D'Azevedo and J. Demmel and I. Dhillon and J. Dongarra and S. Hammarling and G. Henry, A. Petitet and K. Stanley and D. Walker and R. C. Whaley}, title = {{ScaLAPACK} Users' Guide}, publisher = {SIAM}, year = {1997}, address = {Philadelphia} } @Unpublished{GPL, author = {{Free Software Foundation, Inc}}, title = {{GNU} {G}eneral {P}ublic {L}icense}, note = {Version 2}, year = {1991}, annote = {\url{http://www.gnu.org/copyleft/gpl.html}} } @Unpublished{NEC_HOMEPAGE, author = {Molteno, T.C.A.}, title = {{NEC2++} homepage}, year = {2004-5}, note = {\url{http://www.physics.otago.ac.nz/research/electronics/nec}} } @Unpublished{NEC2C, author = {Kyriazis, Neoklis}, title = {{nec2c} A translation of {NEC-2} to {C}}, year = {2004-5}, note = {{\url{http://www.si-list.org/NEC_Archives/nec2c.tar.gz}}} } necpp-1.5.0+cvs20101003/docs/paper.tex0000644000175000017500000002570011106427435015472 0ustar numanuma\documentclass{report} %\documentclass[letterpaper, 12pt]{article} \usepackage{amsfonts} \usepackage{listings} \usepackage{url} \title{NEC2++: An NEC-2 compatible Numerical Electromagnetics Code} \author{T.C.A. Molteno\thanks{Department of Physics. University of Otago. Box 56. Dunedin. New Zealand. tim@physics.otago.ac.nz}, N. Kyriazis\thanks{neoklisk@cytanet.com.cy}} \begin{document} \lstset{language=C} \lstset{tabsize=4} \lstset{breaklines=true} \lstset{showspaces=false} \lstset{basicstyle={\footnotesize\ttfamily}} \maketitle \begin{abstract} We present NEC2++ -- an open-source numerical electromagnetics code, compatible with NEC-2. This code, based on the original FORTRAN, has been rewritten as C++ and provides a readable, modular foundation for investigations into numerical electromagnetism and antenna simulation. In addition the NEC2++ code has a C API and can be compiled into a library for inclusion into other software, for example automatic antenna design optimisation systems, plugins for other languages, and graphical front-ends. \end{abstract} \section{Introduction} Numerical Electromagnetics Code (NEC-2) is a widely used standard method-of-moments code for the analysis of antennas~\cite{Burke81}. The code is written in FORTRAN and there have been many modifications of the original FORTRAN released, for example versions have been optimised for parallel processor architectures~\cite{Excell95, Nitch94, Rubinstein2003}. These re-implementations have not addressed some difficulties associated with the NEC-2 source code, including lack of modularity, the unreadability of the original FORTRAN source and the interweaving of analysis code with output code. These difficulties combine to present a formidable hurdle for investigators wishing to add new features or understand how the code operates. Translations of NEC-2 to an object oriented paradigm have also been described~\cite{NitchOOP94}, however this work is not in the public domain, and is not available as a resource for investigations into numerical electromagnetism. The NEC2++ code we describe in this article addresses these difficulties. The code~\cite{NEC_HOMEPAGE} released under the GNU General Public License (GPL)~\cite{GPL} is written in C++ and derived from the original NEC-2 FORTRAN source and the nec2c~\cite{NEC2C} C translation. Extensive changes have been made to the code including: \begin{itemize} \item All vectors and matrices are represented as C++ objects. \item Number precision has been abstracted by use of a standard template complex number class. The code can be altered to use single precision, double precision or long double precision by changing a single line. \item Elimination of all global variables. \item Replacement of the more obscure variable names by more explicit names. \item File output code has been largely separated from the analysis code. This allows the incorporation of the NEC2++ code as a library within other applications. \end{itemize} To facilitate further development, a testharness (nec2diff) has been written that compares NEC-2 output files. This testharness allows rapid development of NEC-compatible code because the results of a suite of test geometries and analysis can be compared to the original FORTRAN results and any differences are immediately reported. This testharness is not described here, however source-code and details are available from the NEC2++ homepage~\cite{NEC_HOMEPAGE}. This paper describes the aims of the NEC2++ project, the current architecture of the codebase and shows a simple example that incorporates an NEC-2 simulation into a C program. NEC2++ is under constant development and we conclude with plans for future development of the codebase. \section{Overall code structure} The NEC2++ codebase is written using the C++ language. This language has powerful object-oriented features that we invoke to simplify and clarify the original FORTRAN. An example is the use of objects to represent vectors and matrices. This dramatically streamlines the allocation and handling of memory. As a consequence, all memory is allocated dynamically -- there are no limits imposed in the source code to the size of the structures that can be simulated. The central object in the NEC2++ simulation code is the {\tt nec\_context} object, this object contains information about the state of the simulation as well as storing output information. A new {\tt nec\_context} object is created for each simulation. After creation, a geometry is associated with the {\tt nec\_context} through a {\tt c\_geometry} object. This object contains details of the physical structure to be simulated. Analyses are then be triggered by calling methods on the {\tt nec\_context} object. These methods correspond to the analysis cards of a traditional NEC-2 input file. \section{Modularisation} The separation of the input file parsing, the computation and the output into separate code modules is one of the primary aims of the NEC2++ project. Aside from improvements in code readability, modularisation provides some important benefits. Some of these are described below. The separation of input file parsing into a separate module allows the addition of new front-ends to the NEC code. For example an XML geometry description could be used, or a binary interface added to allow efficient execution of multiple simulations -- as might be used in an automatic antenna design optimisation system (see for example Jones et.al ~\cite{Jones97}). The separation of the structure simulation code from the output code allows simulation without the generation of an output file. The parsing of this output file to access appropriate information is often inefficient. In addition, moving simulation and output into separate modules improves the readability and understandability of both. The initial separation of output code and analysis code was accomplished by creating a proxy output function that could be turned off globally. Currently work is underway to design objects that represent each kind of simulation output, e.g. radiation patterns. These objects are created by the simulation code, and can be queried for specific output information, for example the maximum gain. This feature is already available for some kind outputs, for example, the following excerpt from the code shown in Section~\ref{sec_example}; \begin{lstlisting} ... nec_rp_card(nec, 0, 1, ...); gain = nec_get_maximum_gain(nec); \end{lstlisting} will trigger a radiation pattern simulation -- just like an RP card in NEC-2 but with no output. The {\tt nec\_get\_maximum\_gain()} function return the maximum gain in the radiation pattern. The modularisation of the output code is under active development. \subsection{Error handling} Output from NEC-2 simulations consists of error information and results. In NEC2++ error information is handled using C++ exceptions. This allows a client program using the libnecpp library from C++ to trap and manage errors that occur during geometry construction and during simulation. All the methods on the {\tt nec\_context} object now throw exceptions under error conditions however the C-style API does not allow exceptions. Work is underway to wrap each C API function with exception handling codes and provide a mechanism for C programs to access any relevant error information. Additional work is under way to generate warnings under known situations where simulations become inaccurate, for example when the ratio of the segment length to the wire radius is less than 4.0 and the extended thin wire kernel is not employed. \subsection{Geometry parsing} A class {\tt c\_geometry} is defined that contains the geometry of the structure to be simulated. This geometry object can be constructed in two ways, either from a standard NEC-2 description file, or directly from a C or C++ API. The geometry object is then passed to an {\tt nec\_context} object, that manages the simulation of the antenna. The following code snippet shows the construction of a geometry object in C++: \begin{lstlisting} nec_context nec; nec.initialise(); c_geometry& geo = nec.get_geometry(); geo.wire(0, 8, 0, 0, -0.25, 0, 0, 0.25, 0.00001, 1.0, 1.0); nec.geometry_complete(0,0); \end{lstlisting} This geometry consists of a single wire with eight segments, and is equivalent to an NEC-2 `GW' card. \section{Use of NEC2++ as a library} \label{sec_example} The re-factoring of the NEC2++ code to eliminate the interweaving of output and analysis code allows NEC2++ to be efficiently used without any input or output files. The following listing shows an NEC input file that requests a radiation pattern from a vertical antenna excited at 30 MHz. \begin{lstlisting} GW 0 9 0. 0. 2. 0. 0. 7 .1 GE 1 FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 90 1 0500 0 90 1 0 EN \end{lstlisting} Using the C API of libnecpp, the following code performs the same simulation and returns the maximum gain without requiring any analysis of the NEC-2 output files. \begin{lstlisting} #include int main(int argc, char **argv) { nec_context* nec; nec = nec_create(); nec_wire(nec, 0, 9, 0, 0, 2, 0, 0, 7, 0.1, 1, 1); nec_geometry_complete(nec, 1, 0); nec_fr_card(nec, 0, 1, 30, 0); nec_ex_card(nec, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_rp_card(nec, 0, 90, 1, 0500, 0, 90, 1, 0, 0, 0); printf("%f",nec_get_maximum_gain(nec)); nec_delete(nec); return 0; } \end{lstlisting} \section{Conclusions} The NEC2++ codebase provides a platform for the development of systems for analysing and optimising the electromagnetic response of structures. The source-code is freely available, and binary files are available for Microsoft Windows, Unix (Linux) and Mac OS X. The first stage of this project -- the features described in this article -- are complete, and active development of new features is underway. In particular we plan to: \begin{itemize} \item Add an XML specification for antenna geometry and analysis. This will further simplify integration of NEC2++ libraries with existing applications. \item Add a physical-sensitivity analysis front-end that estimates the sensitivity of electromagnetic properties to changes in structure geometry. This is intended to provide a measure of how practical an antenna design is in a non-ideal environment, or to determine appropriate manufacturing tolerances. \item Explore performance enhancements through optimised libraries such as ATLAS~\cite{Whaley2001}, or distributed memory parallel codes such as the Scalable Linear Algebra Package (ScaLAPACK)~\cite{SCALAPACK}. Both these libraries provide dramatically faster LU decomposition routines that would accelerate one of the critical steps in the NEC-2 simulation process. \end{itemize} This list is only indicative, and investigators are invited to download the source, use it, modify it and add features\footnote{The code is released under the GNU General Public License~\cite{GPL} -- this license allows unlimited modification and redistribution, provided the code remains under this license.}. \bibliographystyle{ieeetr} \bibliography{nec} \end{document} necpp-1.5.0+cvs20101003/docs/index.html0000644000175000017500000000742011044231413015623 0ustar numanuma

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).

Latest version is 1.2.9 [31 July 2008]

Check out the NEC Forum for release notes and more

Usage

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.

Compilation on Linux/Unix

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

Compilation on Windows

Decompress the Windows Code Distribution, and build the Visual Studio project inside the win32 subdirectory

Links

Building using Autoconf

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
"); ?>

Release Notes are available from the NEC Forum

Notes

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.

necpp-1.5.0+cvs20101003/docs/users_guide.tex0000644000175000017500000014774010407757575016730 0ustar numanuma\documentclass[a4paper]{book} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \title{NEC2++: Numerical Electromagnetics Code} \author{Tim Molteno} \begin{document} \maketitle \tableofcontents \chapter{Introduction} NEC is software for analysing the electromagnetic response of an arbitrary structure consisting of wires and surfaces in free space or over a ground plane. The analysis is accomplished by the numerical solution of integral equations for induced currents. NEC stands for Numerical Electromagnetics Code. This FORTRAN code was written by Lawrence Livermore National Lab\footnote{The developers of the hydrogen bomb and the inspiration for Dr Strangelove!}, under the sponsorship of the Naval Ocean Systems Center and the Air Force Weapons Laboratory. It is officially called NEC-2, and has been superseded by NEC-4 which remains classified. NEC-2 is the standard system for modelling antennae - it is rather like SPICE. This document describes nec2++ -- a method-of-moments solver that is compatible with NEC2 input files, but is written in a modern language C++. \section{Citing nec2++} You may cite nec2++ in the following form (BibTeX format) \begin{verbatim} @preamble("\usepackage{url}") @manual{NECPP, author = "{Molteno, T.C.A.}", title = "{nec2++, version {\tt 1.2.3}}", year = 2005, address = "Dunedin, New Zealand", note = "available from \url{http://www.physics.otago.ac.nz/research/electronics/nec}" } \end{verbatim} \section{Method of Moments} The integral equation approach used by NEC-2, is best suited to structures with dimensions up to several wavelengths. Although there is no theoretical size limit, the numerical solution requires a matrix equation of increasing order as the structure size is increased relative to wavelength. Hence, modelling very large structures may require more computer time and file storage than is practical on a particular machine. In such cases standard high-frequency approximations such as geometrical optics, physical optics, or geometrical theory of diffraction may be more suitable than the integral equation approach used in NEC-2. \section{Using nec2++} There are two ways to use nec2++. You can use it as a command-line program to analyze a traditional NEC-2 geometry description. This usage is identical to the original FORTRAN version. The other way to use nec2++ is to incorporate it into your own code. Nec2++ is written in C++ and can be called from C as a library (the C-Style interface), from Python (the Python binding) or incorporated as source code directly into your own systems. Nec2++ is licenced under the GNU Public License (see Section~!\ref{Licensing} for more details). \begin{verbatim} Usage: nec2++ [-i] [-o] -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. Example:         nec2++ -i yagi.nec -o yagi.out \end{verbatim} The input file for NEC-2 consists of a series of 'cards', these used to correspond to punch cards, and they are exactly like the members of a SPICE deck. Each card specifies either an antenna description, or an analysis step. \section{Design Flow} The analysis of an antenna can be broken down into several steps. These are; \begin{enumerate} \item Break design into Straight wires. \item For each wire, generate a list of segments roughly 0.05 wavelengths long. This is done using the GW command (see Section~\ref{wire_segments}). \item Add excitation specification - things like frequency and voltage (see Section~\ref{excitation}). \item Specify which analysis to perform. For example, Radiation Pattern. \item Execute nec2c and interpret the horrible unreadable mess that results. \end{enumerate} There are front-ends to NEC-2, rather like SPICE front ends, that plot the output of NEC in a nice way. We will not use these here. \section{Licensing} \label{Licensing} Nec++ is copyrighted free software. It is licensed under the GNU Public License Version 2.0 (GPL). This essentially allows you to incorporate nec2++ into any other software covered by a compatable free software license. \chapter{NEC Reference} \section{Antenna Geometry Syntax} The antenna geometry specification consists of one or more commands followed by a GE command. There are two kinds of geometric object that can be specified, wires and patches. Wires are composed of segments, and grouped according to a {\em tag}. \subsection{'GE': End Geometry} The end of the antenna geometry specification is signalled by a GE card. This card also specifies what kind of ground plane to include in the geometry. \begin{verbatim} GE (integer gpflag) \end{verbatim} gpflag - Geometry ground plain flag. \begin{itemize} \item 0 - no ground plane is present. \item 1 - Indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero) \item -1 - indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. \end{itemize} \subsection{Linear Wire Segments} \label{wire_segments} \begin{verbatim} GW tag_number num_segments x0 y0 z0 x1 y1 z1 wire_radius) \end{verbatim} \subsection{Example: Single horizontal wire} An antenna consisting of an horizontal 10 meter length of 0.002 meter radius wire (the same as number-8 wire) 3 meters above the ground: \begin{verbatim} GW 1  10  0.    0.  3.   10.  0.  3.  .002 GE \end{verbatim} \subsection{Example: Rhombic Antenna} This antenna has four straight wires, each broken into ten segments. This is an horizontal rhombic, elevated 15 meters above the ground -- therefore the $z$ co-ordinates are all $15$. The geometry is: \begin{verbatim} GW 1  10  35.    0.  15.   0.  15.  15.  .1 GW 2  10   0.   15.  15.  35.   0.  15.  .1 GW 3  10 -35.   0.  15.   0.  15.  15.  .1 GW 4  10   0.  -15.  15. 35.   0.  15.  .1 GE \end{verbatim} \subsection{Helix} \begin{verbatim} GH(integer tag_number,         integer num_segments,         double turn_spacing,         double total_length, /* Negative for left-handed helix */         double radius_x0,         double radius_y0,         double radius_x_end,             double radius_y_end         double wire_radius); \end{verbatim} \subsection{Comments} A comment consists of zero or more CM cards, followed be a CE card that signifies the end of the comment. \begin{verbatim} (CM )* CE \end{verbatim} Here is an example: \begin{verbatim} CM This is the description of an antenna. CM Comments can have several lines, the last CM of which must be a CE card. CE This is the last line of the comment. \end{verbatim} \subsection{Transmission Line} To join two segments of an antenna with a transmission line, we can use the TL card. This The shunt admittance is Ys \begin{verbatim} TL      tag_0, segment_0,         tag_1, segment_1,         z0, length Re[Ys0], Im[Ys0] Re[Ys1], Im[ys1] \end{verbatim} \section{Source Specification} \label{excitation} NEC allows antennae to be driven by a voltage source, a current source, or an applied electromagnetic field. For the moment we will only consider the voltage sources, this is the type of source that would be used for a transmitter antenna. The frequency of the applied electric field is specified separately. \subsection{Voltage Source} To specify an applied-E-field source, use the EX card. The wire to be driven is specified with the {\tt source\_tag} -- this is the tag number that was chosen in the antenna geometry (probably with a {\tt GW}) card. The {\tt source\_segment} is the segment number of the wire that is to be driven. This parameter lets you drive a wire in the middle, or at some other point. The element number starts at 1. \begin{verbatim} EX 0 source_tag  source_segment 0 Re(Voltage) Im(Voltage) \end{verbatim} \subsubsection{Example} Drive the 10th segment of the wire with the tag 2 with an amplitude of 11.3 Volts. \begin{verbatim} EX 0 2 10 0 11.3 \end{verbatim} \subsection{Frequency} Specify the frequency (frequencies) in MHz. A linear scan over a range of frequencies is specified by: \begin{verbatim} FR 0 n_freq 0 0 frequency step_size \end{verbatim} A single frequency is specified by setting the {\tt n\_freq} parameter to 1. For example, a 2.4 GHz excitation would be specified by {\tt FR 0 1 0 0 2400}. \section{Specifying Wire Conductivity} The 'LD' card can be used to specify arbitraty loads on segments of an antenna. Here is how to use it to specify a conductivity for all the wires with a certain tag, $t$, where $t \neq 0$. \begin{verbatim} LD 5 t 0 c \end{verbatim} where $c$ is the conductivity in siemens. If the wires were Titanium we would use a thermal conductivity of $1.798E+06$ siemens. A table of electrical properties of various materials is shown in Table~\ref{table_conductivity}. \begin{table} \begin{center} \begin{tabular}{|l|l|} \hline Material & Electrical Conductivity \\ \hline Aluminium 99.99\% & 3.767E+07 \\ Aluminium 6061 T4 & 2.265E+07 \\ Copper (Pure annealed) & 5.800E+07 \\ Gold & 4.257E+07 \\ Graphite & 1.276E+05 \\ Iron & 9.048E+06 \\ Magnesium (Cast Alloy) & 5.220E+06 \\ Seawater & 4-5 \\ Silver & 6.090E+07 \\ Solder Antimonial Tin & 6.902E+06 \\ Solder (Silver) & 9.628E+06 \\ Stainless Steel (304) & 1.450E+06 \\ Stainless Stell (316) & 1.334E+06 \\ Titanium & 1.798E+06 \\ \hline \end{tabular} \caption{Electrical Properties of various elements commonly used in Antenna Construction} \label{table_conductivity} \end{center} \end{table} \section{Analysis Commands} \subsection{Ground Specification} If you want to specify a ground, use the {\tt GN} card. This tells NEC what kind of ground to simulate. \subsection{Extended Thin Wire Kernel} NEC-2 has an option to use a more accurate thin-wire model that works for larger diameter wires. This is called the extended thin-wire kernel. You can specify this by including an EK card in the NEC-2 file. The normal kernel should be used if the segment length, $Delta$, is much greater than the wire radius $a$, i.e.,  $Delta / a > 10$. The extended kernel should be used if $10 > Delta / a > 3$. \subsection{Radiation Pattern Request} In normal mode, space-wave fields are computed. The polar co-ordinates are used where $\Theta$ is the angle from the $z$-axis, and $\phi$ is the angle from the $x$ axis. \begin{verbatim} RP 0 0000,         theta_0 phi_0         theta_step phi_step         distance \end{verbatim} The distance parameter does not have to be specified. \subsubsection{Example} Calculate a radiation pattern for one azimuth angle, and 90 different elevation angles starting at zero (vertical) and in steps of one degree, ending at horizontal (90 degrees). \begin{verbatim} RP 0 90 1 0000 0 90 1 0 \end{verbatim} \subsection{Execute} This is an optional card that forces generation of a radiation pattern. \begin{verbatim} XQ 1 /* generate 2D XZ radiation pattern */ XQ 2 /* Generate 2D YZ radiation pattern */ XQ 3 /* Generate both */ \end{verbatim} \section{End Card} The last card is the EN card that signifies the end of the simulation. \section{Example: Vertical Half Wave Antenna} This is a model of a 5 meter vertical antenna, two meters above the ground. The wire antenna is 0.1 meter in radius. To keep each segment approximately 0.05 wavelengths long, we divide the half wavelength into 9 segments with a GW card. The frequency is then specified as 30 MHz with {\tt FR 0 1 0 0 30.}, and the voltage as 1 Volt with {\tt EX 0 0 5 0 1.} \begin{verbatim} CM VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND CE WITH PERFECT GROUND (GN 1), 1 VOLT, 30 MHZ GW 0 9 0. 0. 2. 0. 0. 7 .1 GE 1 FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 90 1 0000 0 90 1 0 EN \end{verbatim} The output is shown below (with the preamble removed). \begin{verbatim} ---- ANGLES ----- ----- POWER GAINS ----- THETA PHI MAJOR MINOR TOTAL DEGREES DEGREES DB DB DB 0.00 0.00 -999.99 -999.99 -999.99 1.00 0.00 -29.68 -999.99 -29.68 2.00 0.00 -23.66 -999.99 -23.66 3.00 0.00 -20.15 -999.99 -20.15 4.00 0.00 -17.65 -999.99 -17.65 5.00 0.00 -15.72 -999.99 -15.72 6.00 0.00 -14.15 -999.99 -14.15 7.00 0.00 -12.82 -999.99 -12.82 8.00 0.00 -11.68 -999.99 -11.68 9.00 0.00 -10.67 -999.99 -10.67 10.00 0.00 -9.77 -999.99 -9.77 11.00 0.00 -8.97 -999.99 -8.97 ... 87.00 0.00 8.31 -999.99 8.31 88.00 0.00 8.37 -999.99 8.37 89.00 0.00 8.41 -999.99 8.41 \end{verbatim} We can plot this radiation pattern data using xnecview. This is shown in Figure~\ref{radiation_pattern_figure}. \begin{figure} \begin{center} %\includegraphics{figures/radiation_pattern.eps} \caption{Radiation Pattern for a vertical half-wave wire.} \label{radiation_pattern_figure} \end{center} \end{figure} \subsection{Yagi} \begin{verbatim} CM NEC Input File of a 16 element Yagi CE GW 15 7 0.00000 -0.34000 0.00000 0.00000 0.34000 0.00000 0.00250 GW 16 7 0.27300 -0.31750 0.00000 0.27300 0.31750 0.00000 0.00250 GW 1 7 0.69300 -0.30500 0.00000 0.69300 0.30500 0.00000 0.00250 GW 2 7 1.11300 -0.30500 0.00000 1.11300 0.30500 0.00000 0.00250 GW 3 7 1.53300 -0.30500 0.00000 1.53300 0.30500 0.00000 0.00250 GW 4 7 1.95300 -0.30500 0.00000 1.95300 0.30500 0.00000 0.00250 GW 5 7 2.37300 -0.30500 0.00000 2.37300 0.30500 0.00000 0.00250 GW 6 7 2.79300 -0.30500 0.00000 2.79300 0.30500 0.00000 0.00250 GW 7 7 3.21300 -0.30500 0.00000 3.21300 0.30500 0.00000 0.00250 GW 8 7 3.63300 -0.30500 0.00000 3.63300 0.30500 0.00000 0.00250 GW 9 7 4.05300 -0.30500 0.00000 4.05300 0.30500 0.00000 0.00250 GW 10 7 4.47300 -0.30500 0.00000 4.47300 0.30500 0.00000 0.00250 GW 11 7 4.89300 -0.30500 0.00000 4.89300 0.30500 0.00000 0.00250 GW 12 7 5.31300 -0.30500 0.00000 5.31300 0.30500 0.00000 0.00250 GW 13 7 5.73300 -0.30500 0.00000 5.73300 0.30500 0.00000 0.00250 GE 0 FR 0 1 0 0 2.20E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 EX 0 16 4 0 1.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 RP 0 31 73 1001 0.00E+00 0.00E+00 3.00E+00 5.00E+00 1.00E+04 0.00E+00 EN \end{verbatim} \subsection{Example: Bi-Quad 2.4GHz with back reflector} From http://www.nec2.org/wlan.htm. \begin{verbatim} CM NEC Input File Bi-Quad for 2440 MHz, Trevor Marshall, 9/1/2001 CM All data in wavelengths,will scale to 300MHz CM Square copper reflector,w/w choke,modelled as 0.05 lambda mesh CE GW 0 1 0. -0.45 -0.45 0. -0.45 -0.40 0.0082 GW 0 1 0. -0.45 -0.45 0. -0.40 -0.45 0.0082 GM 0 17 0. 0. 0. 0. 0. 0.05 GW 0 1 0. -0.45 0.45 0 -0.40 0.45 0.0082 GM 0 17 0. 0. 0. 0. 0.05 0. GW 0 18 0. 0.45 0.45 0. 0.45 -0.45 0.0082 GW 0 18 0.05 -0.45 -0.45 0.05 -0.45 0.45 0.0082 GW 0 18 0.10 -0.45 -0.45 0.10 -0.45 0.45 0.0082 GW 0 18 0.15 -0.45 -0.45 0.15 -0.45 0.45 0.0082 GW 0 18 0.20 -0.45 -0.45 0.20 -0.45 0.45 0.0082 GW 0 18 0.25 -0.45 -0.45 0.25 -0.45 0.45 0.0082 GW 0 18 0.05 0.45 -0.45 0.05 0.45 0.45 0.0082 GW 0 18 0.10 0.45 -0.45 0.10 0.45 0.45 0.0082 GW 0 18 0.15 0.45 -0.45 0.15 0.45 0.45 0.0082 GW 0 18 0.20 0.45 -0.45 0.20 0.45 0.45 0.0082 GW 0 18 0.25 0.45 -0.45 0.25 0.45 0.45 0.0082 GW 0 5 0.0 -0.45 -0.45 0.25 -0.45 -0.45 0.0082 GW 0 5 0.0 -0.45 -0.40 0.25 -0.45 -0.40 0.0082 GW 0 5 0.0 -0.45 -0.35 0.25 -0.45 -0.35 0.0082 GW 0 5 0.0 -0.45 -0.30 0.25 -0.45 -0.30 0.0082 GW 0 5 0.0 -0.45 -0.25 0.25 -0.45 -0.25 0.0082 GW 0 5 0.0 -0.45 -0.20 0.25 -0.45 -0.20 0.0082 GW 0 5 0.0 -0.45 -0.15 0.25 -0.45 -0.15 0.0082 GW 0 5 0.0 -0.45 -0.10 0.25 -0.45 -0.10 0.0082 GW 0 5 0.0 -0.45 -0.05 0.25 -0.45 -0.05 0.0082 GW 0 5 0.0 -0.45 0.00 0.25 -0.45 0.00 0.0082 GW 0 5 0.0 -0.45 0.05 0.25 -0.45 0.05 0.0082 GW 0 5 0.0 -0.45 0.10 0.25 -0.45 0.10 0.0082 GW 0 5 0.0 -0.45 0.15 0.25 -0.45 0.15 0.0082 GW 0 5 0.0 -0.45 0.20 0.25 -0.45 0.20 0.0082 GW 0 5 0.0 -0.45 0.25 0.25 -0.45 0.25 0.0082 GW 0 5 0.0 -0.45 0.30 0.25 -0.45 0.30 0.0082 GW 0 5 0.0 -0.45 0.35 0.25 -0.45 0.35 0.0082 GW 0 5 0.0 -0.45 0.40 0.25 -0.45 0.40 0.0082 GW 0 5 0.0 -0.45 0.45 0.25 -0.45 0.45 0.0082 GW 0 5 0.0 0.45 -0.45 0.25 0.45 -0.45 0.0082 GW 0 5 0.0 0.45 -0.40 0.25 0.45 -0.40 0.0082 GW 0 5 0.0 0.45 -0.35 0.25 0.45 -0.35 0.0082 GW 0 5 0.0 0.45 -0.30 0.25 0.45 -0.30 0.0082 GW 0 5 0.0 0.45 -0.25 0.25 0.45 -0.25 0.0082 GW 0 5 0.0 0.45 -0.20 0.25 0.45 -0.20 0.0082 GW 0 5 0.0 0.45 -0.15 0.25 0.45 -0.15 0.0082 GW 0 5 0.0 0.45 -0.10 0.25 0.45 -0.10 0.0082 GW 0 5 0.0 0.45 -0.05 0.25 0.45 -0.05 0.0082 GW 0 5 0.0 0.45 0.00 0.25 0.45 0.00 0.0082 GW 0 5 0.0 0.45 0.05 0.25 0.45 0.05 0.0082 GW 0 5 0.0 0.45 0.10 0.25 0.45 0.10 0.0082 GW 0 5 0.0 0.45 0.15 0.25 0.45 0.15 0.0082 GW 0 5 0.0 0.45 0.20 0.25 0.45 0.20 0.0082 GW 0 5 0.0 0.45 0.25 0.25 0.45 0.25 0.0082 GW 0 5 0.0 0.45 0.30 0.25 0.45 0.30 0.0082 GW 0 5 0.0 0.45 0.35 0.25 0.45 0.35 0.0082 GW 0 5 0.0 0.45 0.40 0.25 0.45 0.40 0.0082 GW 0 5 0.0 0.45 0.45 0.25 0.45 0.45 0.0082 GW 1 11 0.1221 +0.0050 0.0 0.1221 .182 .182 0.0048 GW 2 11 0.1221 .182 .182 0.1221 0 .364 0.0048 GW 3 11 0.1221 0 .364 0.1221 -.182 .182 0.0048 GW 4 11 0.1221 -.182 .182 0.1221 -0.0050 0.0 0.0048 GW 5 11 0.1221 -0.0050 0.0 0.1221 -.182 -.182 0.0048 GW 6 11 0.1221 -.182 -.182 0.1221 0.0 -.364 0.0048 GW 7 11 0.1221 0.0 -.364 0.1221 .182 -.182 0.0048 GW 8 11 0.1221 .182 -.182 0.1221 +0.0050 0.0 0.0048 GW 9 1 0.1221 -0.0050 0.0 0.1221 +0.0050 0.0 0.0048 GE 0 FR 0 1 0 0 300. 0 EX 0 9 1 0000 1.0 0 RP 0 73 73 1001 -90. 90. 5. 5. 10000. XQ EN \end{verbatim} \section{NEC-2 Reference} \subsection{Overview: umerical Electromagnetic Code for Antenna Analysis By the Method of Moments and similar problems} R. P. Haviland, W4MB \subsubsection{BACKGROUND ON MOMENT METHODS} The basic equations of antennas were well worked out nearly 100 years ago, not too long after the invention of the dipole and the loop antennas by Hertz. However, the equations were complex and "mathematically intractable", and the early solutions were for limited conditions and special cases. The theories of very short dipoles and very small loops were the first developed. However, it took until the 1930s to get a good solution for dipoles with sinusoidal current distribution at resonance. The theory of arrays of antennas based on the assumption that they could be regarded as point sources came very early, and further advances were made in the 1930s. However, there was still a gap between calculations and measurements for most antenna types. In the 1960s, a new method of obtaining solutions to the equations was developed. Instead of demanding that results were correct at all points on the antenna, exactly correct values were demanded only at selected points, the ends of the antenna and some specific intermediate points. It was recognized that the values away from these points could be in error, but the amount of error could be controlled by selection of the number of points, and by making some assumptions as to the nature of variation between selected points. Following mathmetical nomenclature, the importance of the accumulated error is called its moment (as in the phrase, a momentous occasion). Consequently, the method of analysis came to be called the Method of Moments. It should be remembered that the "exact" used above is a mathmetical fiction. The starting equations are exact, but difficult to solve. Approximations must be used to get numerical results. The accuracy of these must be watched. This use of approximations is found in all of the antenna solution methods. A goal of the originators of the programs has been to make the programs "exact" in the practical sense© hopefully, they are as accurate as the measurement which can be made under conditions outside the laboratory. For many years these techniques were exclusively used by specialists, often under limits of military security. Two factors made the techniques available to Amateurs. One was the development of the small powerful computer, at a price within the Amateur pocketbook. The second was the development and release of a simplified version of the Method of Moments as applied to wire antennas, specifically intended for these computers. The pair made analysis relatively painless. It was possible to think of the antenna in terms of dimensions and connections, common Amateur practice. And the computer did all of the drudgery. Even the time needed became negligible, going from minutes and hours to seconds and even fractional seconds today. This first program to be generally available was called MININEC, standing for Miniature Numerical Electromagnetic Code. While the first version was used by a small number of amateurs, use did not become common until the third version became available, first as developed, then with modifications intended for simplest possible use. The extent of use can be judged from the number of articles based on MININEC results which have appeared in Amateur publications. Users of MININEC will recall will recall that it is: ©Limited to thin wires ©Limited to straight wire segments ©Uses constant current distribution on segments ©Allows near and/or far field calculations ©Allows reactance or resistance at segment junctions ©Provides for single or multiple voltage excitation. And calculates: ©Drive point resistance and reactance ©Current distribution on elements ©Power at specified voltage input ©Far field pattern and gain at specified angles ©Near field intensities along a line. These may be calculated for free space, or with a ground present. However the ground directly under the antenna is always a perfectly reflecting ideal earth. This means that drive impedance errors are appreciable for antennas lower than about 1/4 wavelength above ground. This also affects the far field pattern, in particular the depth of the nulls in the pattern. Errors are acceptably small for higher antennas. Since MININEC is a "minature" code, it follows that there was a full-featured code. This was the earlier NEC. \subsubsection{SUMMARY OF NEC FEATURES} NEC stands for Numerical Electromagnetic Code. The first version of the program (7) was constructed in the late 1970s, although it derives from an antenna analysis program developed a few years earlier. The program is now in its fourth revision, which is being validation tested. However, the last two revisions are restricted to military use, so only the first two revisions are available to Amateurs. (The third revision may be released for general use "any day now"). The following is based on NEC2, with a few indications of changes reported for later revisions. One difference between NEC and MININEC is the handling of assumed segment current variation. Instead of a single form, NEC uses a three term relation, of the form, constant + sine term + cosine term. This means that NEC will give good results with fewer segments than needed for MININEC. This also means that large problems can run faster. Additionally, because NEC provides automatic storage of data on tape when problems are too large for available memory. NEC can handle far more complex antennas. Another difference is that there is an alternate special routine to calculate current on the surface of a wire, rather than assuming that it is concentrated at the wire center. This means that NEC can be more accurate for fat wires. NEC has three methods of exciting an antenna by direct connection. One is a current source, and two are different methods of modelling voltage sources. Antennas may be excited by incoming fields, rather than only by direct connection. There are three possible modes for incident wave excitation, linear and the two senses of circular polarization. There are some restrictions on use of sources, for example, no mixing of the three basic types, voltage, current or incident wave. Other than these points, there is little difference between MININEC and NEC on a lot of Amateur antenna problems. Results are essentially identical for, say, a four element Yagi located well above earth. There is no reason to abandon MININEC for a lot of work. A few tries with NEC will show that the simpler program is best for simple problems. Where NEC really shows its value is in going beyond the limits of MININEC or other programs. For example, NEC will accept input describing wires bent in an arc, or even into helices. Internally, it handles these by simulation with straight segments, which can be done with MININEC. But the process is automatic in NEC. Also,because of its handling of memory, NEC can solve large elements or even arrays of this type. (The spiral antenna use in printed circuit antennas is a helix of zero height: NEC4 can handle logarithmic spirals.) Another NEC extension is ability to handle surfaces. These must be sections of a flat surface, joining other surfaces at the edge. Three or four sided surfaces are possible, singly or as divisions of a large plane surface. Wire--surface junctions can be made, for good analysis of, say, a 2 meter antenna mounted on an auto. This can be simulated with the other programs by wire grid models, but only crudely, due to problem size restrictions. Dish and horn antennas can be modeled as surfaces. NEC can handle very complex surfaces, either directly as solid sheets or as wire grids. Probably the most important feature of NEC for Amateur use is the possibilities for solutions involving the presence of the earth. Free space or ideal ground are two possibilities. Another is reflection coefficient approximation to ground, which, in essence, multiplies the radiation from the underground or image antenna by a factor to account for ground loss. The last possibility is a relatively exact solution based on the work of Sommerfield. This involves table lookup of data prepared separately (and slowly). Any one table applies only to the ground condition and frequency specified, so studies of antenna--ground interactions at different frequencies and ground types is time consuming. The calculation method selected applies to ground directly under the antenna as well as at the point of ground reflection. In addition, more ground conditions can be specified, but apply only to the far field. These may be in circular or linear zones, of different elevations, to simulate hills and valleys. The equations are valid for antennas close to the edge of a cliff. Ground screens can be specified. The near and far fields can be calculated. NEC includes a number of routines to simplify setting up antennas and structures. Symmetry can be used to specify these: for example a rhombic can be specified by one wire and double symmetry. Quasi©circular structures are specified by one face and the number of faces. Arrays are easy, since any antenna or structure can be duplicated at one or more other locations. There are a few other time savers, such as use of interaction range approximations for well separated elements. Loads can be introduced into elements as series or parallel RCL circuits, as impedances, and/or as wire resistance. Transmission lines may connect point pairs on elements or structures, and two©terminal networks any pair of points. True transmission line relations are used, much more accurate than can be obtained with parallel wires in other programs. NEC3 and NEC4 include routines for insulated wires. NEC4 can handle sagging wires directly, and includes detection of error producing overlapping and intersecting wires. The range of output data in NEC is large. The charge on a wire is available as well as the current. Coupling between elements can be output. Far field patterns can use an internally generated format, or one specified. Fixed frequency or stepped operation can be selected, with linear or constant percentage steps. Some intermediate results can be saved to shorten run time on other but similar problems. The paper output of NEC can only be called verbose. It is divided into sections, with the input instructions printed first, then the pertinent conditions, followed by the actual output. The run time of each section is shown, and usually is surprising small. \subsubsection{THE PURPOSE OF NECCARDS} NEC is written in Fortran, the first language developed which did not use machine language for programming. It is still a powerful tool, preferred for large complex scientific and engineering problems. However, is not as easy to use as BASIC. The NEC program is large: a printout of the source code of programs and subroutines by pages is well over an inch thick. Also, as required by techniques of the time, NEC is structured for input by punched cards, and temporary recording by tape. Some 36 card types are needed to cover all features, each have at least one input and some up to four integer and up to seven decimal values. Setting up a problem is not easy. While there is more freedom in card order than found in many Fortran programs, there are many complex order and format requirements. Rather than an extensive rewrite to allow full direct input from the keyboard and use of disk for input and records, the approach here is to retain the card technique, and modify only direct input and output for disk operations. For initial input, the card program encompasses the full range of NEC analysis possibilities, simplifying these by calling for inputs in a logical order acceptable to the program. The program output is written to disk as a simulated tape, in the style that is generated by cards. These "card images" are then used for input to the NEC program itself. The public domain NEC program packagae includes a number of specialized programs, for input and output. A few of these are included here. One is CHECKER, which checks an input file for duplication. The second is GRAPS, a graphical plotting package. The final one is SOMNEC, which generates the special files called TAPE21 used for description of Sommerfield ground analysis. Additionally, input and output files are compatable with many common programs. For example, a text or line editor can be used to read, check and modify the card images use for input. These plus a spreadsheet can be used to read most of the output files. Full feaured spreadsheets include analysis and plotting programs, useful for presenting data. \subsubsection{OBTAINING PROGRAMS AND PROGRAM DATA} The basic source for NEC (and for MININEC) is the Applied Computational Electromagnetic Society, ACES. This may be as NEEDS, a package of antenna programs, or as individual programs, all in source and compiled code form. It is necessary to become a member to obtain the programs from this source. This also brings a Newsletter, a Journal, makes many other programs available, and guarantees that the latest released version can be obtained. Although much of the Newsletter/ Journal material is based on complex mathematical techniques, there is a wealth of practical material. This includes such items as hints on accurate modelling, design of small antenna ranges, graphs of earth characteristics, and reports of bugs and corrections to programs. The material is almost a necessity for any serious worker on antennas. For information, write Dr. Richard Adler, Secretary, ACES, Naval Postgraduate School Code EC/AB, Monterey, CA 93943 The second source for NEC is the report, Numerical Electromagnetics Code (NEC) - Method of Moments, G. J. Burke and A. J. Poggio, available from the National Technical Information Service, Springfield, VA 22161 as AD-AO75 460. This three part report includes theory, code description and fortran code. It is available in microfiche at a very reasonable cost, or in paper at greater cost. This report is an enormous aid in full use of the capabilities of NEC, and is a necessity if program modifications are to be attempted. Versions of NEC are also available from other commercial sources. The announcing ads do not specify the source version. They also imply but do not state that some features of the original code have been eliminated, so check the detail capabilities if you have a difficult problem. Check also the InterNet files if you have access to that system. See the ads and announcements in QST, other amateur magazines and in the technical journals and newsletters for future changes in availability. This computational field is still developing. \subsection{Summary} \begin{verbatim} NEC CARD FORMATS Cards for NEC input must be in the correct format for input to be correct. The following shows the format for each card, in abbreviated form. See the ASCII version of NECCARD for complete information, or the referenced documents. The format is two letters designating card type, then data fields separated by commas. The fields present are designated as A=ASCII, B=blank, I=Integer, F=Floating point. The floating point fields must include a decimal point. DATA CARDS GA,I,I,D,D,D,D WIRE ARC GC,B,B,D,D,D WIRE, D7 OF GW=0 GF,I READ NGF FILE GE,I END GEOMETRY GH,I,I,D,D,D,D,D,D,D HELIX GM,I,I,D,D,D,D,D,D,D COORDINATE TRANSFORM GP SUPPRESS GEOMETRY PRINT GR,I,I GENERATE CYLINDER GS SCALE STRUCTURE GW,I,I,D,D,D,D,D,D,D WIRE (IF D7=0, SEE GC) GX,I,I SYMMETRY SP,B,I,D,D,D,D,D,D SURFACE PATCH, (+ SC IF I1=1,2 OR 3) SC,B,I,D,D,D,D,D,D PATCH CONTINUE, I2 OF SP=1,2 OR 3 SM,I,I,D,D,D,D,D,D MULTIPLE PATCHES, ALWAYS + SC SC,B,B,D,D,D PATCH CONTINUE PROGRAM CONTROL CARDS CP,I,I,I,I MAX COUPLING EK,I EXTENDED KERNEL EN END RUN EX,I,I,I,I,D,D,D,D,D,D EXCITATION FR,I,I,B,B,D,D FREQUENCY GD,B,B,B,B,D,D,D,D FAR GROUND GN,I,I,B,B,D,D NEAR GROUND KH,B,B,B,B,D INTERACT RANGE LD,I,I,I,I,D,D,D LOADING NE,I,I,I,I,D,D,D,D,D,D NEAR ELECTRIC FIELD NH,I,I,I,I,D,D,D,D,D,D NEAR MAGNETIC FIELD NT,I,I,I,I,D,D,D,D,D,D NEWORK NX NEXT STRUCTURE PL,I,I,I,I STORE PLOT DATA PQ,I,I,I,I PRINT CHARGE PT,I,I,I,I PRINT CURRENT RP,I,I,I,I,D,D,D,D,D,D SET PATTERN TL,I,I,I,I,D,D,D,D,D,D TRANSMISSION LINE WG WRITE NGF FILE EQ,I EXECUTE \end{verbatim} \begin{verbatim} CHECKLIST FOR NEC INPUT CARDS CM Comments, up to 78 characters including blanks CE End of comments, blank Following cards have up to 2 integers, up to 7 FP numbers GA Tag#,#segs,Arc Rad,Start Angle,End Angle,Wire Rad (wire curve) GE Ground Present (ends geometry input) GH Tag#,#segs,Spacing,Length,XStart Rad,YStart Rad,XEnd rad,YEnd Rad,Wire Rad (helix) GF Print/no Print (read NGF file) GM TagInc,#new,RotX,RotY,RotZ,MovX,MovY,MovZ,Tag (dupstructure) GR TagInc,#new (generate cylinder from a face) GS ,,Times Factor (Scale by factor) GW Tag#,#segs,X1,Y1,Z1,X2,Y2,Z2,Rad (straight wire) GC ,,RatioLength,Rad1,Rad2 (Taper if GW Rad=0) GX TagInc,Planes (Reflect structure per planes) SP ,Shape,X,Y,Z,eaXY,aaX,Area (surface patch) SC ,NewShape,X3,Y3,Z3,X4,Y4,Z4 (shape if SP>0) SM X#,Y#,X1,Y1,Z1,X2,Y2,Z2 (Multipe Patches in X,Y) SC ,,X3,Y3,Z3 (Required after SM) Following cards have up to 4 integers, up to 6 FP numbers CP Tag1,Seg1,Tag2,Seg2 (max coupling named segs, up to 5) EK Cancel (Extended TW kernel, ©1=cancel) EN (ends run) EX Type, (voltage,current,external, place or angle) FR TypeStep,#step,,Freq,Step (frequency, Mhz) GD ,,,,K,Cond,DistTo2,Elev2 (additional ground zone) GN Type,#Radials,,,K,Cond (first ground type) KH ,,,,Dist (interaction approx range) LD Type,Tag,TagStaet,TagEnd,R,L,C (loads at segments) NE Coord,N1,N2,N3,X,Y,Z,dX,dY,dZ (near field (or angle)) NH (same) NT Tag1,Seg1,Tag2,Seg2,Real11,Imag11,R12,I12,R22,I22 (network) NX (new structure starts) PQ Flag,SegsTag,Flag,Flag (print wire charge) PL File,Flag,Flag,Flag (data Storage for plots) PT Flag,SegsTag,Flag,Flag (print currents) RP Mode,#th,#ph,Th1,Ph1,dTh,dPh,Dist,Normal (Pattern out) TL Tag1,Seg1,Tag2,Seg2,Zo,Len,Radm1,I1,R2,I2 (trans line) WG (write NGF file) XQ Options \end{verbatim} \subsection{More Detail} \begin{verbatim} STRUCTURE OF NEC CARD IMAGES, ONE CARD = ONE LINE IN IMAGE NAME CARD CONTENTS I= INTEGER, NO DECIMAL POINT ALLOWED F= FLOATING POINT VALUE, DECIMAL POINT REQUIRED **** STRUCTURE GEOMETRY CARDS **** CM CE COMMENTS MAX 78 CHARACTERS PER CARD (LINE) GA WIRE ARC I1- TAG NO. I2- NO. SEGMENTS IN ARC F1- ARC RADIUS F2- START ANGLE, DEG. F3- END ANGLE F4- WIRE RADIUS GE GEOMETRY END I1- O=NO GND, +/-=GND, +BASE CHARGE=0, -BASE CURRENT=0 GH HELIX/SPIRAL I1- TAG NO. I2- NO SEGMENTS F1- TURN SPACING, 0=SPIRAL F2- LENGTH, - FOR LEFT HAND F3- X RADIUS AT START F4- Y RADIUS AT START F5- X RADIUS AT END F6- Y RADIUS AT END F7- WIRE RADIUS GF READ SAVED NGF FILE I1- 0 TO PRINT TABLE OF SEGMENT ENDS GM RELOCATE/REORIENT I1- TAG INCREMENT FOR NEW STRUCTURE I2- NO. NEW STRUCTURES F1- ROTATE ABOUT X, DEG., +=RIGHT HAND F2- ROTATE ABOUT Y, DEG. (SEPARATE CARDS TO CHANGE ORDER) F3- ROTATE ABOUT Z, DEG. F4- X TRANSLATE F5- Y TRANSLATE F6- Z TRANSLATE F7- TAG TO MOVE, 0=ALL TAGS GR GENERATE CYLINDER, Z>0 I1- TAG INCREMENT I2- NO. FACES APPROXIMATING CYLINDER GS SCALE DIMENSIONS I1- 0=TIMES F1, 1=FT. TO M., 2=IN TO M. I2- BLANK F1- SCALING FACTOR (I1=0), OR BLANK GW STRAIGHT WIRE, ENDS 1,2 I1- TAG NO. I2- NO. SEGMENTS F1- X1 F2- Y1 F3- Z1 F4- X2 F5- Y2 F6- Z2 F7- WIRE RAD., 0=USE GC FOR TAPERED WIRE GC TAPERED WIRE CONTINUE I1- BLANK I2- BLANK F1- RATIO OF RADII ADJACENT SEGMENTS F2- RADIUS FIRST SEGMENT F3- RADIUS LAST SEGMENT GX REFLECT IN COORDINATE PLANE I1- TAG NO. INCREMENT I2- 1XX FOR REFLECT IN X, 0XX= NO REFLECT IN X X1X FOR REFLECT IN Y, X0X= NO REFLECT IN Y XX1 FOR REFLECT IN Z, XX0= NO REFLECT IN Z SP SURFACE PATCH, SC FOLLOWS IF NOT ARBITRARY I1- BLANK I2- SHAPE, 0-ARBIT.,OR 1=RECT., 2=TRIAN., 3=QUADLAT. (SEE SC) F1- ARB., CENTER X, ELSE CORNER 1 X F2- ARB., CENTER Y, ELSE CORNER 1 Y F3- ARB., CENTER Z, ELSE CORNER 1 Z F4- ARB., ANGLE ABOVE XY, ELSE CORNER 2 X F5- ARB., ANGLE FROM X, ELSE CORNER 2 Y F6- ARB., PATCH AREA, ELSE CORNER 2 Z SC SM PATCH CONTINUE, NOT ARBITRARY I1- BLANK I2- BLANK F1- CORNER 3 X F2- CORNER 3 Y F3- CORNER 3 Z F4- QUAD ONLY, CORNER 4 X F5- QUAD ONLY, CORNER 4 Y F6- QUAD ONLY, CORNER 4 Z SM PATCHES IN RECTANGULAR AREA, SC MUST FOLLOW I1- NUMBER OF PATCHES IN X DIRECTION I2- NUMBER OF PATCHES IN Y DIRECTION F1- CORNER 1 X F2- CORNER 1 Y F3- CORNER 1 Z F4- CORNER 2 X F5- CORNER 2 Y F6- CORNER 2 Z SC SM PATCH CONTINUE I1- BLANK I2- BLANK F1- CORNER 3 X F2- CORNER 3 Y F3- CORNER 3 Z **** PROGRAM CONTROL CARDS **** CP MAXIMUM SEGMENT COUPLING CALCULATION, 2 1/2 CARDS. MAX I1- TAG #1 (EXCITE WITH EX CARD, TYPE I1=0) I2- SEGMENT # IN TAG 1 TO BE EXCITED I3- TAG #2 (CALCULATE WITH XQ, RP, NE, NH CARD) I3- SEGMENT # IN TAG 2 EK USE EXTENDED THIN-WIRE KERNEL I1- BLANK OR 0= USE EXT KERNEL, -1 RESET TO USE NORMAL EN INDICATES END OF RUN 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 FR FREQUENCY I1- O= LINEAR STEP, 1=MULTIPLICATIVE I2- NO. STEPS, BLANK=1 I3- BLANK I4- BLANK F1- FREQUENCY OR START FREQUENCY F2- FREQ INCREMENT, ADD OR MULTIPLY GD FAR GROUND, (NEAR GROUND BY GN), (SET FLAG ON RP) I1- BLANK I2- BLANK I3- BLANK I4- BLANK F1- DIELECTRIC OF FAR GROUND F2- CONDUCTIVITY, FAR GROUND F3- DISTANCE TO START OF FAR GROUND F4- HEIGHT FAR GROUND, 0=SAME AS NEAR, >0= BELOW NEAR GROUND GN NEAR GROUND, GROUND SCREEN, ADDED GROUND I1- -1=SET FREE SPACE (A), 0=REFL COEFF, 1=IDEAL (B), 2-SOMMERFIELD I2- (A) BLANK), NO WIRES IN GND SCREEN (C), 0= NO WIRES (D) I3- BLANK I4- BLANK F1- (A,B) BLANK, DIELECTRIC OF NEAR GROUND F2- (A,B) BLANK, CONDUCTIVITY OF NEAR GROUND F3- (A,B) BLANK, (C) RADIUS OF SCREEN, (D) DIELECTRIC 2ND MEDIUM F4- (A,B) BLANK, (C) RADII SCREEN WIRES, (D) CONDUCT. 2ND MEDIUM F5- (A,B) BLANK, (C) BLANK, (D) DIST TO 2ND MEDIUM, SEE RP F6- (A,B) BLANK, (C) BLANK, (D) HEIGHT 2ND MEDIUM (AS IN GD) KH INTERACTION AP[PROXIMATION RANGE I1- BLANK I2- BLANK I3- BLANK I4- BLANK F1- DISTANCE TO START APPROXIMATION, WAVELENGTHS LD LOADING I1- -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) I2- TAG# TO BE LOADED, BLANK/0= USE ABSOLUTE #s I3- SEG# OF TAG # TO START LOADS, OR ABSOLUTE SEG# I4- 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 NE NH NEAR ELECTRIC, NEAR MAGNETIC FIELD I1- O=RECT. COORD. (A), 1=SPHERICAL (B) I2- NO. POINTS IN (A) X, (B) R (CHANGES MOST RAPIDLY) I3- NO. POINTS IN (A) Y, (B) PHI I4- NO. POINTS IN (A) X, (B) TH F1- COORDINATE (A) X, (B) R F2- COORDINATE (A) Y, (B) PHI F3- COORDINATE (A) Z, (B) TH F4- INCREMENT (A) X, (B) R F5- INCREMENT (A) Y, (B) PHI F6- INCREMENT (A) Z, (B) TH 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) NX NEXT STRUCTURE PQ PRINT WIRE CHARGE I1- -1 NO CHARGE PRINT (DEFAULT), 0 OR BLANK, PRINT CHARGE I2- TAG# TO PRINT, 0=I3/I4 IS ABSOLUTE I3- START SEGMENT # OF TAG, OR ABSOLUTE SEGMENT#, 0 OR BLANK, ALL SEGS I4- END SEG. # OF TAG, OR ABSOLUTE SEG.#, OR BLANK= I3 ONLY PL PLOT DATA STORAGE I1- 0=NO STORE, 1=CURRENTS, 2=NEAR FIELD, 3=PATTERNS I2(1,2)- 0=NO, 1=REAL,IMAG, 3=MAG, PHASE I2(3)- 1=TH, 2=PHI, 3=RHO ANGLES I3(1)- 0=N0, 1=IX, 2=IY, 3=IZ, 4=IX IY IZ I3(2)- 0-N0, 1=X, 2=Y, 3=Z, 4=X Y Z, 5=TOTAL COMPONENT I3(3)- 0=NO, 1=TH, 2=PHI, 3=RHO E-FIELD COMPOMENT I4(1)- BLANK I4(2)- 1=X, 2=Y, 3=Z CORDINATE VALUES I4(3)- 1=V, 2=H, 3=TOTAL, 4=V H T GAINS DB PT CURRENT PRINT CONTROL I1- -2=ALL, -1=SUPR. PRNT., 0=SEGS BELOW, 1=REC. FMT., 2=NORMAL(1) I2- TAG# OF SEGMENT, 0=ABSOLUTE LOCATION I3- START SEG OR ABS SEG I4- END SEG OR ABS SEG (1,1,1,1=SUPPRESS CURRENT PRINT) RP RADIATION PATTERN SET I1- SEE GN; 0=SPACE WAVE, 1=SPACE+GND WAVE, 2=LIN CLIFF, 3=CIR CLIFF, 4=GND SCREEN, 5=SCRN+LIN CLIFF, 6=SCRN+CIR CLIFF I2- # VALUES OF TH, BLANK=1 I3- # VALUES OF PHI, BLANK=1 I4- BLANK IF I1=1, ELSE abcd a- 0=MAJ0R, MINOR, TOT, 1=V, H, TOT AXIS GAIN b- 0=NONE, 1=MAJ, 2=MIN, 3=V, 4=H, 5=T NORMALIZED AXIX GAIN c- 0=POWER GAIN, 1=DIRECTIVE GAIN d- 0= NO AVERAGE, 1=AVERAGE, 2= AVERAGE SOME SUPPRESSED F1- INITIAL TH, OR I1=1, INITIAL Z F2- INITIAL PHI F3- INCREMENT TH OR I1=1, INCREMENT Z F4- INCREMENT PHI F5- RADIAL DIST. OF FIELD POINT OR 0=OMIT EXP, 1- CYLIND. CORD. F6- NORMALIZE FACTOR FOR I4, BLANK/0= TO MAX GAIN. NOTE: A BLANK RP CAN BE USED TO SEPARATE DATA BLOCKS 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 WG WRITE NUMERICAL GREENS FUNCTION FOR LATER USE XQ EXECUTE ACCUMULATED CARD DECK I1- 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 \end{verbatim} \section{Examples} This section includes some examples showing how to use NEC to perform antenna simulations. \subsection{Long-wavelength transmission from a buoy} We are designing an antenna for buoy floating in the ocean. A radio frequency band of 13.75000 MHz with a bandwidth of 2kHz has been allocated. The buoy has a two meter vertical antenna with a radius of 2cm, the antenna is 10cm above the ocean! The transmitter can generate 10 Volts, The simplest NEC description is \begin{verbatim} GW 1 10 0 0 0.1 0 0 2 0.02 GE 1 EK FR 0 1 0 0 13.75 EX 0 1 10 0 10 0 XQ EN \end{verbatim} We can use a more sophisticated analysis by specifying an imperfect ground using the GN card. We use some common values for seawater, a conductivity of 4 siemens and a dielectric constant of 80. We can also experiment with loading the antenna at its top. To compare two possible antennae, we run two simulations in the same NEC file. Each is started by the XQ card. The second includes a top-loading {\tt LD 0 1 10 10 1 6E-5 1E-7} of $R = 1 \Omega$, $L = 60 \mu H$, $C = 0.1 \mu F$. These values were obtained by trial and error (maximizing the radiated power). \begin{verbatim} CM 2m Vertical antenna excited at 13.75 MHz [15m] CM floating in the ocean. We assume properties CM conductivity 4 mhos/meter, dielectric constant 80. CM We use sommerfeld ground under two conditions. CM 1) With no loading CM 2) With RLC loading at end. CE GW 1 10 0 0 0.1 0 0 2 0.02 GE 1 EK FR 0 1 0 0 13.75 EX 0 1 10 0 10 0 GN 2 0 0 0 80.0 4.0 RP 0 10 2 1301 0. 0. 10. 90. XQ LD 0 1 10 10 1 6E-5 1E-7 XQ EN \end{verbatim} The results of this simulation are interesting. \appendix \chapter{Error Messages} \subsection{CHECK DATA, PARAMETER SPECIFYING SEGMENT POSITION IN A GROUP OF EQUAL TAGS CANNOT BE ZERO.} Routine: ISEGNO This error results from an input data error and may occur at any point where a tag number is used to identify a segment. Execution terminated. Data on the NT, TL, EX, and PT cards should be checked. \subsection{CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT } Routine: CONNECT Possible causes: number of segments at a junction exceeds limit; segment lengths are zero; array overflow. \subsection{DATA FAULT ON LOADING CARD NO. = ITAG STEP1 = IS GREATER THAN ITAG STEP2 = } Routine: MAIN When several segments are loaded, the number of the second segment specified must be greater than the number of the first segment. Execution terminated. \subsection{ERROR - ARC ANGLE EXCEEDS 360. DEGREES} Routine: ARC Error on GA card. \subsection{ERROR - B LESS THAN A IN ROM2} Routine: ROM2 Program malfunction. \subsection{ERROR - CORNERS OF QUADRILATERAL PATCH DO NOT LIE IN A PLANE} Routine: Patch The four corners of a quadrilateral patch (SP card) must lie in a plane. \subsection{ERROR - COUPLING IS NOT BETWEEN 0 AND 1} Routine: Couple Inaccuracy in solution or error in data. \subsection{ERROR - GF MUST BE FIRST GEOMETRY DATA CARD} Routine: {\tt c\_geometry::parse\_geometry} See section III-5. \subsection{FAULTY DATA CARD LABEL AFTER GEOMETRY SECTION} Routine: {\tt nec\_main} A card with an unrecognizable mnemonic has been encountered in the program control cards following the geometry cards. Execution terminated. \subsection{GEOMETRY DATA CARD ERROR} Routine: {\tt c\_geometry::parse\_geometry} A geometry data card was expected, but the card mnemonic is not that of a geometry card. Execution terminated. After the GE card in a data deck, the possible geometry mnemonics are GE, GM, GR, GS, GW, GX, SP, and SS. The GE card must be used to terminate the geometry cards. \subsection{GEOMETRY DATA ERROR -- PATCH LIES IN PLANE OF SYMMETRY} Routine: {\tt c\_geometry::reflect} \subsection{GEOMETRY DATA ERROR -- SEGMENT EXTENDS BELOW GROUND} Routine: {\tt c\_geometry::connect\_segments} When ground is specified on the GE card, no segment may extend below the XY plane. Execution terminated. \subsection{GEOMETRY DATA ERROR - - SEGMENT LIES IN GROUND PLANE} Routine: {\tt c\_geometry::connect\_segments} When ground is specified on the GE card, no segment should lie in the XY plane. Execution terminated. \subsection{GEOMETRY DATA ERROR - - SEGMENT LIES IN PLANE OF SYMMETRY} Routine: {\tt c\_geometry::reflect} A segment may not lie in or cross a plane of symmetry about which the structure is reflected since the segment and its image will coincide or cross. Execution terminated. \subsection{IMPROPER LOAD TYPE CHOSEN, REQUESTED TYPE IS } Routine: LOAD Valid load types (LDTYP on the LD card) are from 0 through 5. Execution terminated. \subsection{INCORRECT LABEL FOR A COMMENT CARD} Routine: MAIN The program expected a comment card, with mnemonic CM or CE, but encountered a different mnemonic. Execution terminated. Comment cards must be the first cards in a data set, and the comments must be terminated by the CE mnemonic. \subsection{LOADING DATA CARD ERROR, NO SEGMENT HAS AN ITAG=} Routine: LOAD ITAG specified on an LD card could not be found as a segment tag. Execution terminated. \subsection{NO SEGMENT HAS AN ITAG OF } Routine: ISEGNO This error results from faulty input data and can occur at any point where a tag number is used to identify a segment. Execution terminated. Tag numbers on the NT, TL, EX, CP, PQ, and PT cards should be checked. \subsection{NOTE, SOME OF THE ABOVE SEGMENTS HAVE BEEN LOADED TWICE, IMPEDANCES ADDED} Routine: LOAD A segment or segments have been loaded by two or more LD cards. The impedances of the loads have been added in series. This is only an informative message. Execution continues. \subsection{PATCH DATA ERROR} Routine: {\tt c\_geometry::parse\_geometry} Invalid data on SP, SM, or SC card; or SC card not found where required. \subsection{PIVOT() = } Routine: FACTR (in-core) or LFACTR (out-of-core) This will be printed during the Gauss Doolittle factoring of the interaction matrix or the network matrix when a pivot element less than 10E-10 is encountered, and indicates that the matrix is nearly singular. The number in parentheses shows on which pass through the matrix the condition occurred. This is usually an abnormal condition although execution will continue. It may result from coinciding segments or a segment of zero length. \subsection{RADIAL WIRE G.S. APPROXIMATION MAY NOT BE USED WITH SOMMERFELD GROUND OPTION} Routine: MAIN \subsection{ROM2 - - STEP SIZE LIMITED AT Z = } Routine: ROM2 Probably caused by a wire too close to the ground in the Somerfeld/ Norton ground method. Execution continues but results may be inaccurate. \subsection{SBF - SEGMENT CONNECTION ERROR FOR SEGMENT } \label{error_39} Routine: SBF The number of segments at a junction exceeds dimension limit (30), or the connection numbers are not self-consistant. \subsection{SEGMENT DATA ERROR} Routine: {\tt c\_geometry::geometry\_complete} A segment with zero length or zero radius was found. Execution terminated. \subsection{STEP SIZE LIMTED AT Z=} Routine: INTX, HFX The numerical integration to compute interaction matrix elements, using the Romberg variable interval width method, was limited by the minimum allowed step size. Execution will continue. An inaccuracy may occur but is usually not serious. May result from thin wire or wire close to the ground. \subsection{SYMMETRY ERROR - NROW, NCOL = } Routine: FBLOCK Array overflow or program malfunction. \subsection{TBF - SEGMENT CONNECTION ERROR FOR SEGMENT } Routine: TBF Same as error \ref{error_39}. \subsection{TRIO - SEGMENT CONNECTION ERROR FOR SEGMENT } Routine: TRIO Same as error \ref{error_39}. \subsection{WHEN MULTIPLE FREQUENCIES ARE REQUESTED, ONLY ONE NEAR FIELD CARD CAN BE USED - LAST CARD READ IS USED} Routine: MAIN Execution continues. \end{document} necpp-1.5.0+cvs20101003/docs/CVS/0000755000175000017500000000000011452152150014261 5ustar numanumanecpp-1.5.0+cvs20101003/docs/CVS/Root0000644000175000017500000000007011452152150015124 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/docs/CVS/Repository0000644000175000017500000000001311452152150016355 0ustar numanumanecpp/docs necpp-1.5.0+cvs20101003/docs/CVS/Entries0000644000175000017500000000033611452152150015617 0ustar numanuma/index.html/1.3/Thu Jul 31 03:35:39 2008// /install.sh/1.2/Thu Jul 31 03:35:39 2008// /nec.bib/1.1.1.1/Fri Sep 9 04:39:10 2005// /paper.tex/1.2/Wed Nov 12 01:19:25 2008// /users_guide.tex/1.3/Tue Mar 21 11:11:57 2006// D necpp-1.5.0+cvs20101003/FORTRAN/0000755000175000017500000000000011452152141014011 5ustar numanumanecpp-1.5.0+cvs20101003/FORTRAN/somnec2d.f0000644000175000017500000005327610312700326015705 0ustar numanumaC Last change: PGM 8 Nov 2000 1:04 pm C PROGRAM SOMNEC(INPUT,OUTPUT,TAPE21) C C PROGRAM TO GENERATE NEC INTERPOLATION GRIDS FOR FIELDS DUE TO C GROUND. FIELD COMPONENTS ARE COMPUTED BY NUMERICAL EVALUATION C OF MODIFIED SOMMERFELD INTEGRALS. C C SOMNEC2D IS A DOUBLE PRECISION VERSION OF SOMNEC FOR USE WITH C NEC2D. AN ALTERNATE VERSION (SOMNEC2SD) IS ALSO PROVIDED IN WHICH C COMPUTATION IS IN SINGLE PRECISION BUT THE OUTPUT FILE IS WRITTEN C IN DOUBLE PRECISION FOR USE WITH NEC2D. SOMNEC2SD RUNS ABOUT TWIC C AS FAST AS THE FULL DOUBLE PRECISION SOMNEC2D. THE DIFFERENCE C BETWEEN NEC2D RESULTS USING A FOR021 FILE FROM THIS CODE RATHER C THAN FROM SOMNEC2SD WAS INSIGNFICANT IN THE CASES TESTED. C C Changes made by J Bergervoet, 31-5-95: C Parameter 0. --> 0.D0 in calling of routine TEST C Status of output files set to 'UNKNOWN' C*** IMPLICIT REAL*8(A-H,O-Z) C*** COMPLEX*16 CK1,CK1SQ,ERV,EZV,ERH,EPH,CKSM,CT1,CT2,CT3,CL1,CL2,CON, 1AR1,AR2,AR3,EPSCF COMMON /EVLCOM/ CKSM,CT1,CT2,CT3,CK1,CK1SQ,CK2,CK2SQ,TKMAG,TSMAG,C 1K1R,ZPH,RHO,JH COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3),DY 1A(3),XSA(3),YSA(3),NXA(3),NYA(3) CHARACTER*3 LCOMP(4) DATA LCOMP/'ERV','EZV','ERH','EPH'/ WRITE(*,*) 'SOMNEC2D, Last changes: May 31 1995, J. Bergervoet' WRITE(*,*) C Write(*,*) &'GIVE GROUND PARAMETERS - EPR = RELATIVE DIELECTRIC CONSTANT' Write(*,*) ' SIG = CONDUCTIVITY (MHOS/M)' Write(*,*) ' FMHZ = FREQUENCY (MHZ)' Write(*,*) &' IPT = 1 TO PRINT GRIDS. =0 OTHERWISE.' Write(*,*) &'IF SIG .LT. 0. THEN COMPLEX DIELECTRIC CONSTANT = EPR + J*SIG' Write(*,*) 'AND FMHZ IS NOT USED.' C 999 WRITE(*,21) C 21 FORMAT($,' ENTER EPR,SIG,FMHZ,IPT > ') READ(*,*,ERR=999) EPR,SIG,FMHZ,IPT WRITE(*,22) C 22 FORMAT(' STARTING COMPUTATION OF SOMMERFELD INTEGRAL TABLES') WRITE(*,*) WRITE(*,*) WRITE(*,100) EPR 100 FORMAT(" RELATIVE DIELECTRIC CONSTANT (EPR) = ", D20.5) WRITE(*,101) SIG 101 FORMAT(" SIGMA [CONDUCTIVITY IN MHOS/METER] = ", D20.5) WRITE(*,102) FMHZ 102 FORMAT(" FREQUENCY IN MHZ = ", D20.5) IF(IPT == 1) WRITE(*,*) " GRID FILE [SOM2D.OUT] WILL BE CREATED" IF(IPT == 0) WRITE(*,*) " NO GRID FILE WILL BE CREATED" WRITE(*,*) C*** IF (SIG.LT.0.) GO TO 1 WLAM=299.8/FMHZ EPSCF=DCMPLX(EPR,-SIG*WLAM*59.96) GO TO 2 1 EPSCF=DCMPLX(EPR,SIG) 2 CALL SECOND (TST) CK2=6.283185308 CK2SQ=CK2*CK2 C C SOMMERFELD INTEGRAL EVALUATION USES EXP(-JWT), NEC USES EXP(+JWT), C HENCE NEED CONJG(EPSCF). CONJUGATE OF FIELDS OCCURS IN SUBROUTINE C EVLUA. C CK1SQ=CK2SQ*DCONJG(EPSCF) CK1=SQRT(CK1SQ) CK1R=DREAL(CK1) TKMAG=100.*ABS(CK1) TSMAG=100.*CK1*DCONJG(CK1) CKSM=CK2SQ/(CK1SQ+CK2SQ) CT1=.5*(CK1SQ-CK2SQ) ERV=CK1SQ*CK1SQ EZV=CK2SQ*CK2SQ CT2=.125*(ERV-EZV) ERV=ERV*CK1SQ EZV=EZV*CK2SQ CT3=.0625*(ERV-EZV) C C LOOP OVER 3 GRID REGIONS C DO 6 K=1,3 NR=NXA(K) NTH=NYA(K) DR=DXA(K) DTH=DYA(K) R=XSA(K)-DR IRS=1 IF (K.EQ.1) R=XSA(K) IF (K.EQ.1) IRS=2 C C LOOP OVER R. (R=SQRT(RHO**2 + (Z+H)**2)) C DO 6 IR=IRS,NR R=R+DR THET=YSA(K)-DTH C C LOOP OVER THETA. (THETA=ATAN((Z+H)/RHO)) C DO 6 ITH=1,NTH THET=THET+DTH RHO=R*COS(THET) ZPH=R*SIN(THET) IF (RHO.LT.1.E-7) RHO=1.E-8 IF (ZPH.LT.1.E-7) ZPH=0. CALL EVLUA (ERV,EZV,ERH,EPH) RK=CK2*R CON=-(0.,4.77147)*R/DCMPLX(COS(RK),-SIN(RK)) GO TO (3,4,5), K 3 AR1(IR,ITH,1)=ERV*CON AR1(IR,ITH,2)=EZV*CON AR1(IR,ITH,3)=ERH*CON AR1(IR,ITH,4)=EPH*CON GO TO 6 4 AR2(IR,ITH,1)=ERV*CON AR2(IR,ITH,2)=EZV*CON AR2(IR,ITH,3)=ERH*CON AR2(IR,ITH,4)=EPH*CON GO TO 6 5 AR3(IR,ITH,1)=ERV*CON AR3(IR,ITH,2)=EZV*CON AR3(IR,ITH,3)=ERH*CON AR3(IR,ITH,4)=EPH*CON 6 CONTINUE C C FILL GRID 1 FOR R EQUAL TO ZERO. C CL2=-(0.,188.370)*(EPSCF-1.)/(EPSCF+1.) CL1=CL2/(EPSCF+1.) EZV=EPSCF*CL1 THET=-DTH NTH=NYA(1) DO 9 ITH=1,NTH THET=THET+DTH IF (ITH.EQ.NTH) GO TO 7 TFAC2=COS(THET) TFAC1=(1.-SIN(THET))/TFAC2 TFAC2=TFAC1/TFAC2 ERV=EPSCF*CL1*TFAC1 ERH=CL1*(TFAC2-1.)+CL2 EPH=CL1*TFAC2-CL2 GO TO 8 7 ERV=0. ERH=CL2-.5*CL1 EPH=-ERH 8 AR1(1,ITH,1)=ERV AR1(1,ITH,2)=EZV AR1(1,ITH,3)=ERH 9 AR1(1,ITH,4)=EPH CALL SECOND (TIM) C C WRITE GRID ON TAPE21 C OPEN(UNIT=21,FILE='SOM2D.NEC',STATUS='UNKNOWN',FORM='UNFORMATTED') WRITE (21) AR1,AR2,AR3,EPSCF,DXA,DYA,XSA,YSA,NXA,NYA REWIND 21 IF (IPT.EQ.0) GO TO 14 C C PRINT GRID C C DEBUGGING CODE C --------------------------------------------------- PRINT *,'AR1(1,1,1)= ',AR1(1,1,1) C PRINT *,'AR2(1,1,1)= ',AR2(1,1,1) C PRINT *,'AR3(1,1,1)= ',AR3(1,1,1) PRINT *,'EPSCF= ',EPSCF PRINT *,'DXA= ',DXA PRINT *,'DYA= ',DYA PRINT *,'XSA= ',XSA PRINT *,'YSA= ',YSA PRINT *,'NXA= ',NXA PRINT *,'NYA= ',NYA PRINT *,'AR1= ',AR1 PRINT *,'AR2= ',AR2 PRINT *,'AR3= ',AR3 PRINT 444,AR1(1,1,1) 444 FORMAT(11HAR1(1,1,1)=,E12.5) C --------------------------------------------------- OPEN (UNIT=3,FILE='SOM2D.OUT',STATUS='NEW',ERR=14) WRITE(3,17) EPSCF DO 13 K=1,3 NR=NXA(K) NTH=NYA(K) WRITE(3,18) K,XSA(K),DXA(K),NR,YSA(K),DYA(K),NTH DO 13 L=1,4 WRITE(3,19) LCOMP(L) DO 13 IR=1,NR GO TO (10,11,12), K 10 WRITE(3,20) IR,(AR1(IR,ITH,L),ITH=1,NTH) GO TO 13 11 WRITE(3,20) IR,(AR2(IR,ITH,L),ITH=1,NTH) GO TO 13 12 WRITE(3,20) IR,(AR3(IR,ITH,L),ITH=1,NTH) 13 CONTINUE 14 TIM=TIM-TST WRITE(*,16) TIM STOP C 16 FORMAT (6H TIME=,1PE12.5) 17 FORMAT (30H1NEC GROUND INTERPOLATION GRID,/,21H DIELECTRIC CONSTAN 1T=,1P2E12.5) 18 FORMAT (///,5H GRID,I2,/,4X,5HR(1)=,F7.4,4X,3HDR=,F7.4,4X,3HNR=,I3 1,/,9H THET(1)=,F7.4,3X,4HDTH=,F7.4,3X,4HNTH=,I3,//) 19 FORMAT (///,1X,A3) 20 FORMAT (4H IR=,I3,/,1X,(10E12.5)) 21 FORMAT($,' ENTER EPR,SIG,FMHZ,IPT > ') 22 FORMAT(' STARTING COMPUTATION OF SOMMERFELD INTEGRAL TABLES') END BLOCK DATA SOMSET IMPLICIT REAL*8(A-H,O-Z) COMPLEX*16 AR1,AR2,AR3,EPSCF COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3),DY 1A(3),XSA(3),YSA(3),NXA(3),NYA(3) DATA NXA/11,17,9/,NYA/10,5,8/,XSA/0.,.2,.2/,YSA/0.,0.,.3490658504/ DATA DXA/.02,.05,.1/,DYA/.1745329252,.0872664626,.1745329252/ END SUBROUTINE BESSEL (Z,J0,J0P) C C BESSEL EVALUATES THE ZERO-ORDER BESSEL FUNCTION AND ITS DERIVATIVE C FOR COMPLEX ARGUMENT Z. C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 J0,J0P,P0Z,P1Z,Q0Z,Q1Z,Z,ZI,ZI2,ZK,FJ,CZ,SZ,J0X,J0PX DIMENSION M(101), A1(25), A2(25), FJX(2) EQUIVALENCE (FJ,FJX) DATA PI,C3,P10,P20,Q10,Q20/3.141592654,.7978845608,.0703125,.11215 120996,.125,.0732421875/ DATA P11,P21,Q11,Q21/.1171875,.1441955566,.375,.1025390625/ DATA POF,INIT/.7853981635,0/,FJX/0.,1./ IF (INIT.EQ.0) GO TO 5 1 ZMS=Z*DCONJG(Z) IF (ZMS.GT.1.E-12) GO TO 2 J0=(1.,0.) J0P=-.5*Z RETURN 2 IB=0 IF (ZMS.GT.37.21) GO TO 4 IF (ZMS.GT.36.) IB=1 C SERIES EXPANSION IZ=1.+ZMS MIZ=M(IZ) J0=(1.,0.) J0P=J0 ZK=J0 ZI=Z*Z DO 3 K=1,MIZ ZK=ZK*A1(K)*ZI J0=J0+ZK 3 J0P=J0P+A2(K)*ZK J0P=-.5*Z*J0P IF (IB.EQ.0) RETURN J0X=J0 J0PX=J0P C ASYMPTOTIC EXPANSION 4 ZI=1./Z ZI2=ZI*ZI P0Z=1.+(P20*ZI2-P10)*ZI2 P1Z=1.+(P11-P21*ZI2)*ZI2 Q0Z=(Q20*ZI2-Q10)*ZI Q1Z=(Q11-Q21*ZI2)*ZI ZK=EXP(FJ*(Z-POF)) ZI2=1./ZK CZ=.5*(ZK+ZI2) SZ=FJ*.5*(ZI2-ZK) ZK=C3*SQRT(ZI) J0=ZK*(P0Z*CZ-Q0Z*SZ) J0P=-ZK*(P1Z*SZ+Q1Z*CZ) IF (IB.EQ.0) RETURN ZMS=COS((SQRT(ZMS)-6.)*31.41592654) J0=.5*(J0X*(1.+ZMS)+J0*(1.-ZMS)) J0P=.5*(J0PX*(1.+ZMS)+J0P*(1.-ZMS)) RETURN C INITIALIZATION OF CONSTANTS 5 DO 6 K=1,25 A1(K)=-.25D0/(K*K) 6 A2(K)=1.D0/(K+1.D0) DO 8 I=1,101 TEST=1.D0 DO 7 K=1,24 INIT=K TEST=-TEST*I*A1(K) IF (TEST.LT.1.D-6) GO TO 8 7 CONTINUE 8 M(I)=INIT GO TO 1 END SUBROUTINE EVLUA (ERV,EZV,ERH,EPH) C C EVALUA CONTROLS THE INTEGRATION CONTOUR IN THE COMPLEX LAMBDA C PLANE FOR EVALUATION OF THE SOMMERFELD INTEGRALS. C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 ERV,EZV,ERH,EPH,A,B,CK1,CK1SQ,BK,SUM,DELTA,ANS,DELTA2, 1CP1,CP2,CP3,CKSM,CT1,CT2,CT3 COMMON /CNTOUR/ A,B COMMON /EVLCOM/ CKSM,CT1,CT2,CT3,CK1,CK1SQ,CK2,CK2SQ,TKMAG,TSMAG,C 1K1R,ZPH,RHO,JH DIMENSION SUM(6), ANS(6) DATA PTP/.6283185308/ DEL=ZPH IF (RHO.GT.DEL) DEL=RHO IF (ZPH.LT.2.*RHO) GO TO 4 C C BESSEL FUNCTION FORM OF SOMMERFELD INTEGRALS C JH=0 A=(0.,0.) DEL=1./DEL IF (DEL.LE.TKMAG) GO TO 2 B=DCMPLX(.1*TKMAG,-.1*TKMAG) CALL ROM1 (6,SUM,2) A=B B=DCMPLX(DEL,-DEL) CALL ROM1 (6,ANS,2) DO 1 I=1,6 1 SUM(I)=SUM(I)+ANS(I) GO TO 3 2 B=DCMPLX(DEL,-DEL) CALL ROM1 (6,SUM,2) 3 DELTA=PTP*DEL CALL GSHANK (B,DELTA,ANS,6,SUM,0,B,B) GO TO 10 C C HANKEL FUNCTION FORM OF SOMMERFELD INTEGRALS C 4 JH=1 CP1=DCMPLX(0.D0,.4*CK2) CP2=DCMPLX(.6*CK2,-.2*CK2) CP3=DCMPLX(1.02*CK2,-.2*CK2) A=CP1 B=CP2 CALL ROM1 (6,SUM,2) A=CP2 B=CP3 CALL ROM1 (6,ANS,2) DO 5 I=1,6 5 SUM(I)=-(SUM(I)+ANS(I)) C PATH FROM IMAGINARY AXIS TO -INFINITY SLOPE=1000. IF (ZPH.GT..001*RHO) SLOPE=RHO/ZPH DEL=PTP/DEL DELTA=DCMPLX(-1.D0,SLOPE)*DEL/SQRT(1.+SLOPE*SLOPE) DELTA2=-DCONJG(DELTA) CALL GSHANK (CP1,DELTA,ANS,6,SUM,0,BK,BK) RMIS=RHO*(DREAL(CK1)-CK2) IF (RMIS.LT.2.*CK2) GO TO 8 IF (RHO.LT.1.E-10) GO TO 8 IF (ZPH.LT.1.E-10) GO TO 6 BK=DCMPLX(-ZPH,RHO)*(CK1-CP3) RMIS=-DREAL(BK)/ABS(DIMAG(BK)) IF(RMIS.GT.4.*RHO/ZPH)GO TO 8 C INTEGRATE UP BETWEEN BRANCH CUTS, THEN TO + INFINITY 6 CP1=CK1-(.1,.2) CP2=CP1+.2 BK=DCMPLX(0.D0,DEL) CALL GSHANK (CP1,BK,SUM,6,ANS,0,BK,BK) A=CP1 B=CP2 CALL ROM1 (6,ANS,1) DO 7 I=1,6 7 ANS(I)=ANS(I)-SUM(I) CALL GSHANK (CP3,BK,SUM,6,ANS,0,BK,BK) CALL GSHANK (CP2,DELTA2,ANS,6,SUM,0,BK,BK) GO TO 10 C INTEGRATE BELOW BRANCH POINTS, THEN TO + INFINITY 8 DO 9 I=1,6 9 SUM(I)=-ANS(I) RMIS=DREAL(CK1)*1.01 IF (CK2+1..GT.RMIS) RMIS=CK2+1. BK=DCMPLX(RMIS,.99*DIMAG(CK1)) DELTA=BK-CP3 DELTA=DELTA*DEL/ABS(DELTA) CALL GSHANK (CP3,DELTA,ANS,6,SUM,1,BK,DELTA2) 10 ANS(6)=ANS(6)*CK1 C CONJUGATE SINCE NEC USES EXP(+JWT) ERV=DCONJG(CK1SQ*ANS(3)) EZV=DCONJG(CK1SQ*(ANS(2)+CK2SQ*ANS(5))) ERH=DCONJG(CK2SQ*(ANS(1)+ANS(6))) EPH=-DCONJG(CK2SQ*(ANS(4)+ANS(6))) RETURN END SUBROUTINE GSHANK (START,DELA,SUM,NANS,SEED,IBK,BK,DELB) C C GSHANK INTEGRATES THE 6 SOMMERFELD INTEGRALS FROM START TO C INFINITY (UNTIL CONVERGENCE) IN LAMBDA. AT THE BREAK POINT, BK, C THE STEP INCREMENT MAY BE CHANGED FROM DELA TO DELB. SHANK S C ALGORITHM TO ACCELERATE CONVERGENCE OF A SLOWLY CONVERGING SERIES C IS USED C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 START,DELA,SUM,SEED,BK,DELB,A,B,Q1,Q2,ANS1,ANS2,A1,A2, 1AS1,AS2,DEL,AA COMMON /CNTOUR/ A,B DIMENSION Q1(6,20), Q2(6,20), ANS1(6), ANS2(6), SUM(6), SEED(6) DATA CRIT/1.E-4/,MAXH/20/ RBK=DREAL(BK) DEL=DELA IBX=0 IF (IBK.EQ.0) IBX=1 DO 1 I=1,NANS 1 ANS2(I)=SEED(I) B=START 2 DO 20 INT=1,MAXH INX=INT A=B B=B+DEL IF (IBX.EQ.0.AND.DREAL(B).GE.RBK) GO TO 5 CALL ROM1 (NANS,SUM,2) DO 3 I=1,NANS 3 ANS1(I)=ANS2(I)+SUM(I) A=B B=B+DEL IF (IBX.EQ.0.AND.DREAL(B).GE.RBK) GO TO 6 CALL ROM1 (NANS,SUM,2) DO 4 I=1,NANS 4 ANS2(I)=ANS1(I)+SUM(I) GO TO 11 C HIT BREAK POINT. RESET SEED AND START OVER. 5 IBX=1 GO TO 7 6 IBX=2 7 B=BK DEL=DELB CALL ROM1 (NANS,SUM,2) IF (IBX.EQ.2) GO TO 9 DO 8 I=1,NANS 8 ANS2(I)=ANS2(I)+SUM(I) GO TO 2 9 DO 10 I=1,NANS 10 ANS2(I)=ANS1(I)+SUM(I) GO TO 2 11 DEN=0. DO 18 I=1,NANS AS1=ANS1(I) AS2=ANS2(I) IF (INT.LT.2) GO TO 17 DO 16 J=2,INT JM=J-1 AA=Q2(I,JM) A1=Q1(I,JM)+AS1-2.*AA IF (DREAL(A1).EQ.0..AND.DIMAG(A1).EQ.0.) GO TO 12 A2=AA-Q1(I,JM) A1=Q1(I,JM)-A2*A2/A1 GO TO 13 12 A1=Q1(I,JM) 13 A2=AA+AS2-2.*AS1 IF (DREAL(A2).EQ.0..AND.DIMAG(A2).EQ.0.) GO TO 14 A2=AA-(AS1-AA)*(AS1-AA)/A2 GO TO 15 14 A2=AA 15 Q1(I,JM)=AS1 Q2(I,JM)=AS2 AS1=A1 16 AS2=A2 17 Q1(I,INT)=AS1 Q2(I,INT)=AS2 AMG=ABS(DREAL(AS2))+ABS(DIMAG(AS2)) IF (AMG.GT.DEN) DEN=AMG 18 CONTINUE DENM=1.E-3*DEN*CRIT JM=INT-3 IF (JM.LT.1) JM=1 DO 19 J=JM,INT DO 19 I=1,NANS A1=Q2(I,J) DEN=(ABS(DREAL(A1))+ABS(DIMAG(A1)))*CRIT IF (DEN.LT.DENM) DEN=DENM A1=Q1(I,J)-A1 AMG=ABS(DREAL(A1))+ABS(DIMAG(A1)) IF (AMG.GT.DEN) GO TO 20 19 CONTINUE GO TO 22 20 CONTINUE WRITE(*,24) DO 21 I=1,NANS 21 WRITE(*,25) Q1(I,INX),Q2(I,INX) 22 DO 23 I=1,NANS 23 SUM(I)=.5*(Q1(I,INX)+Q2(I,INX)) RETURN C 24 FORMAT (46H **** NO CONVERGENCE IN SUBROUTINE GSHANK ****) 25 FORMAT (1X,1P10E12.5) END SUBROUTINE HANKEL (Z,H0,H0P) C C HANKEL EVALUATES HANKEL FUNCTION OF THE FIRST KIND, ORDER ZERO, C AND ITS DERIVATIVE FOR COMPLEX ARGUMENT Z. C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 CLOGZ,H0,H0P,J0,J0P,P0Z,P1Z,Q0Z,Q1Z,Y0,Y0P,Z,ZI,ZI2,ZK, 1FJ DIMENSION M(101), A1(25), A2(25), A3(25), A4(25), FJX(2) EQUIVALENCE (FJ,FJX) DATA PI,GAMMA,C1,C2,C3,P10,P20/3.141592654,.5772156649,-.024578509 15,.3674669052,.7978845608,.0703125,.1121520996/ DATA Q10,Q20,P11,P21,Q11,Q21/.125,.0732421875,.1171875,.1441955566 1,.375,.1025390625/ DATA POF,INIT/.7853981635,0/,FJX/0.,1./ IF (INIT.EQ.0) GO TO 5 1 ZMS=Z*DCONJG(Z) IF (ZMS.NE.0.) GO TO 2 WRITE(*,9) STOP 2 IB=0 IF (ZMS.GT.16.81) GO TO 4 IF (ZMS.GT.16.) IB=1 C SERIES EXPANSION IZ=1.+ZMS MIZ=M(IZ) J0=(1.,0.) J0P=J0 Y0=(0.,0.) Y0P=Y0 ZK=J0 ZI=Z*Z DO 3 K=1,MIZ ZK=ZK*A1(K)*ZI J0=J0+ZK J0P=J0P+A2(K)*ZK Y0=Y0+A3(K)*ZK 3 Y0P=Y0P+A4(K)*ZK J0P=-.5*Z*J0P CLOGZ=LOG(.5*Z) Y0=(2.*J0*CLOGZ-Y0)/PI+C2 Y0P=(2./Z+2.*J0P*CLOGZ+.5*Y0P*Z)/PI+C1*Z H0=J0+FJ*Y0 H0P=J0P+FJ*Y0P IF (IB.EQ.0) RETURN Y0=H0 Y0P=H0P C ASYMPTOTIC EXPANSION 4 ZI=1./Z ZI2=ZI*ZI P0Z=1.+(P20*ZI2-P10)*ZI2 P1Z=1.+(P11-P21*ZI2)*ZI2 Q0Z=(Q20*ZI2-Q10)*ZI Q1Z=(Q11-Q21*ZI2)*ZI ZK=EXP(FJ*(Z-POF))*SQRT(ZI)*C3 H0=ZK*(P0Z+FJ*Q0Z) H0P=FJ*ZK*(P1Z+FJ*Q1Z) IF (IB.EQ.0) RETURN ZMS=COS((SQRT(ZMS)-4.)*31.41592654) H0=.5*(Y0*(1.+ZMS)+H0*(1.-ZMS)) H0P=.5*(Y0P*(1.+ZMS)+H0P*(1.-ZMS)) RETURN C INITIALIZATION OF CONSTANTS 5 PSI=-GAMMA DO 6 K=1,25 A1(K)=-.25D0/(K*K) A2(K)=1.D0/(K+1.D0) PSI=PSI+1.D0/K A3(K)=PSI+PSI 6 A4(K)=(PSI+PSI+1.D0/(K+1.D0))/(K+1.D0) DO 8 I=1,101 TEST=1.D0 DO 7 K=1,24 INIT=K TEST=-TEST*I*A1(K) IF (TEST*A3(K).LT.1.D-6) GO TO 8 7 CONTINUE 8 M(I)=INIT GO TO 1 C 9 FORMAT (34H ERROR - HANKEL NOT VALID FOR Z=0.) END SUBROUTINE LAMBDA (T,XLAM,DXLAM) C C COMPUTE INTEGRATION PARAMETER XLAM=LAMBDA FROM PARAMETER T. C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 A,B,XLAM,DXLAM COMMON /CNTOUR/ A,B DXLAM=B-A XLAM=A+DXLAM*T RETURN END SUBROUTINE ROM1 (N,SUM,NX) C C ROM1 INTEGRATES THE 6 SOMMERFELD INTEGRALS FROM A TO B IN LAMBDA. C THE METHOD OF VARIABLE INTERVAL WIDTH ROMBERG INTEGRATION IS USED. C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 A,B,SUM,G1,G2,G3,G4,G5,T00,T01,T10,T02,T11,T20 COMMON /CNTOUR/ A,B DIMENSION SUM(6), G1(6), G2(6), G3(6), G4(6), G5(6), T01(6), T10(6 1), T20(6) DATA NM,NTS,RX/131072,4,1.E-4/ LSTEP=0 Z=0. ZE=1. S=1. EP=S/(1.E4*NM) ZEND=ZE-EP DO 1 I=1,N 1 SUM(I)=(0.,0.) NS=NX NT=0 CALL SAOA (Z,G1) 2 DZ=S/NS IF (Z+DZ.LE.ZE) GO TO 3 DZ=ZE-Z IF (DZ.LE.EP) GO TO 17 3 DZOT=DZ*.5 CALL SAOA (Z+DZOT,G3) CALL SAOA (Z+DZ,G5) 4 NOGO=0 DO 5 I=1,N T00=(G1(I)+G5(I))*DZOT T01(I)=(T00+DZ*G3(I))*.5 T10(I)=(4.*T01(I)-T00)/3. C TEST CONVERGENCE OF 3 POINT ROMBERG RESULT CALL TEST (DREAL(T01(I)),DREAL(T10(I)),TR,DIMAG(T01(I)),DIMAG(T10 1(I)),TI,0.d0) IF (TR.GT.RX.OR.TI.GT.RX) NOGO=1 5 CONTINUE IF (NOGO.NE.0) GO TO 7 DO 6 I=1,N 6 SUM(I)=SUM(I)+T10(I) NT=NT+2 GO TO 11 7 CALL SAOA (Z+DZ*.25,G2) CALL SAOA (Z+DZ*.75,G4) NOGO=0 DO 8 I=1,N T02=(T01(I)+DZOT*(G2(I)+G4(I)))*.5 T11=(4.*T02-T01(I))/3. T20(I)=(16.*T11-T10(I))/15. C TEST CONVERGENCE OF 5 POINT ROMBERG RESULT CALL TEST (DREAL(T11),DREAL(T20(I)),TR,DIMAG(T11),DIMAG(T20(I)),TI 1,0.d0) IF (TR.GT.RX.OR.TI.GT.RX) NOGO=1 8 CONTINUE IF (NOGO.NE.0) GO TO 13 9 DO 10 I=1,N 10 SUM(I)=SUM(I)+T20(I) NT=NT+1 11 Z=Z+DZ IF (Z.GT.ZEND) GO TO 17 DO 12 I=1,N 12 G1(I)=G5(I) IF (NT.LT.NTS.OR.NS.LE.NX) GO TO 2 NS=NS/2 NT=1 GO TO 2 13 NT=0 IF (NS.LT.NM) GO TO 15 IF (LSTEP.EQ.1) GO TO 9 LSTEP=1 CALL LAMBDA (Z,T00,T11) WRITE(*,18) T00 WRITE(*,19) Z,DZ,A,B DO 14 I=1,N 14 WRITE(*,19) G1(I),G2(I),G3(I),G4(I),G5(I) GO TO 9 15 NS=NS*2 DZ=S/NS DZOT=DZ*.5 DO 16 I=1,N G5(I)=G3(I) 16 G3(I)=G2(I) GO TO 4 17 CONTINUE RETURN C 18 FORMAT (38H ROM1 -- STEP SIZE LIMITED AT LAMBDA =,1P2E12.5) 19 FORMAT (1X,1P10E12.5) END SUBROUTINE SAOA (T,ANS) C C SAOA COMPUTES THE INTEGRAND FOR EACH OF THE 6 C SOMMERFELD INTEGRALS FOR SOURCE AND OBSERVER ABOVE GROUND C IMPLICIT REAL*8(A-H,O-Z) SAVE COMPLEX*16 ANS,XL,DXL,CGAM1,CGAM2,B0,B0P,COM,CK1,CK1SQ,CKSM,CT1, 1CT2,CT3,DGAM,DEN1,DEN2 COMMON /EVLCOM/ CKSM,CT1,CT2,CT3,CK1,CK1SQ,CK2,CK2SQ,TKMAG,TSMAG,C 1K1R,ZPH,RHO,JH DIMENSION ANS(6) CALL LAMBDA (T,XL,DXL) IF (JH.GT.0) GO TO 1 C BESSEL FUNCTION FORM CALL BESSEL (XL*RHO,B0,B0P) B0=2.*B0 B0P=2.*B0P CGAM1=SQRT(XL*XL-CK1SQ) CGAM2=SQRT(XL*XL-CK2SQ) IF (DREAL(CGAM1).EQ.0.) CGAM1=DCMPLX(0.D0,-ABS(DIMAG(CGAM1))) IF (DREAL(CGAM2).EQ.0.) CGAM2=DCMPLX(0.D0,-ABS(DIMAG(CGAM2))) GO TO 2 C HANKEL FUNCTION FORM 1 CALL HANKEL (XL*RHO,B0,B0P) COM=XL-CK1 CGAM1=SQRT(XL+CK1)*SQRT(COM) IF (DREAL(COM).LT.0..AND.DIMAG(COM).GE.0.) CGAM1=-CGAM1 COM=XL-CK2 CGAM2=SQRT(XL+CK2)*SQRT(COM) IF (DREAL(COM).LT.0..AND.DIMAG(COM).GE.0.) CGAM2=-CGAM2 2 XLR=XL*DCONJG(XL) IF (XLR.LT.TSMAG) GO TO 3 IF (DIMAG(XL).LT.0.) GO TO 4 XLR=DREAL(XL) IF (XLR.LT.CK2) GO TO 5 IF (XLR.GT.CK1R) GO TO 4 3 DGAM=CGAM2-CGAM1 GO TO 7 4 SIGN=1. GO TO 6 5 SIGN=-1. 6 DGAM=1./(XL*XL) DGAM=SIGN*((CT3*DGAM+CT2)*DGAM+CT1)/XL 7 DEN2=CKSM*DGAM/(CGAM2*(CK1SQ*CGAM2+CK2SQ*CGAM1)) DEN1=1./(CGAM1+CGAM2)-CKSM/CGAM2 COM=DXL*XL*EXP(-CGAM2*ZPH) ANS(6)=COM*B0*DEN1/CK1 COM=COM*DEN2 IF (RHO.EQ.0.) GO TO 8 B0P=B0P/RHO ANS(1)=-COM*XL*(B0P+B0*XL) ANS(4)=COM*XL*B0P GO TO 9 8 ANS(1)=-COM*XL*XL*.5 ANS(4)=ANS(1) 9 ANS(2)=COM*CGAM2*CGAM2*B0 ANS(3)=-ANS(4)*CGAM2*RHO ANS(5)=COM*B0 RETURN END SUBROUTINE TEST (F1R,F2R,TR,F1I,F2I,TI,DMIN) C C TEST FOR CONVERGENCE IN NUMERICAL INTEGRATION C IMPLICIT REAL*8(A-H,O-Z) SAVE DEN=ABS(F2R) TR=ABS(F2I) IF (DEN.LT.TR) DEN=TR IF (DEN.LT.DMIN) DEN=DMIN IF (DEN.LT.1.E-37) GO TO 1 TR=ABS((F1R-F2R)/DEN) TI=ABS((F1I-F2I)/DEN) RETURN 1 TR=0. TI=0. RETURN END SUBROUTINE SECOND (CPUSECD) C Purpose: C SECOND returns cpu time in seconds. Must be customized!!! REAL*8 CPUSECD integer Iticks C-- Not customized: C Cpusecd = 0.0 ! if we have no clock routine C-- MACINTOSH: C CPUSECD= LONG(362)/60.0 C-- Lahey fortran C Call Timer(Iticks) C cpusecd = Iticks/100.d0 END necpp-1.5.0+cvs20101003/FORTRAN/makefile0000644000175000017500000000205210747707064015530 0ustar numanuma#####################################################################3 # # FORTRAN makefile for nec2 # # This makefile builds a slightly modified version of the original # FORTRAN version of nec2. This is used for the testharness so ensure # that nec2++ remains accurate as we develop it. # # The modification is to allow input from stdin and output to stdout. # these modifications might be useful to others too. # # Requires g77. # # Author: T Molteno. # # # # # Note about optimization flags and warnings. The compiler issues many many warnings # about variables that might be used uninitialized. These may be correct. I have not # fixed them since my goal is to simply compare the results of nec2++ with the original # FORTRAN. Some of these might however be causing real problems, so perhaps it would be # better to fix them. # FORTRAN=gfortran nec2: nec2dx.f ${FORTRAN} -Wall -O1 -o nec2 nec2dx.f somnec: somnec2d.f ${FORTRAN} -Wall -O1 -o somnec somnec2d.f clean: rm nec2 rm somnec test: ./nec2 ../test_data/example2.nec ../test_data/example2.outf necpp-1.5.0+cvs20101003/FORTRAN/NEC2DPAR.INC0000644000175000017500000000005310310210754015475 0ustar numanuma PARAMETER (MAXSEG=1000, MAXMAT=1000) necpp-1.5.0+cvs20101003/FORTRAN/nec2dx.f0000644000175000017500000077017710747707064015406 0ustar numanumaC PROGRAM NEC(INPUT,TAPE5=INPUT,OUTPUT,TAPE11,TAPE12,TAPE13,TAPE14, C 1TAPE15,TAPE16,TAPE20,TAPE21) C C NUMERICAL ELECTROMAGNETICS CODE (NEC2) DEVELOPED AT LAWRENCE C LIVERMORE LAB., LIVERMORE, CA. (CONTACT G. BURKE AT 510-422-8414 C FOR PROBLEMS WITH THE NEC CODE.) C FILE CREATED 4/11/80. C C ***********NOTICE********** C THIS COMPUTER CODE MATERIAL WAS PREPARED AS AN ACCOUNT OF WORK C SPONSORED BY THE UNITED STATES GOVERNMENT. NEITHER THE UNITED C STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF C THEIR EMPLOYEES, NOR ANY OF THEIR CONTRACTORS, SUBCONTRACTORS, OR C THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR C ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, C COMPLETENESS OR USEFULNESS OF ANY INFORMATION, APPARATUS, PRODUCT C OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT C INFRINGE PRIVATELY-OWNED RIGHTS. C C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' PARAMETER (IRESRV=MAXMAT**2) IMPLICIT REAL*8(A-H,O-Z) CHARACTER AIN*2,ATST*2,INFILE*80,OUTFILE*80 C*** REAL*8 HPOL,PNET C CHARACTER INMSG*48,OUTMSG*40 C INTEGER*2 GPWNXY(2) C LOGICAL*4 GetPut,LGTPT COMPLEX*16 CM,FJ,VSANT,ETH,EPH,ZRATI,CUR,CURI,ZARRAY,ZRATI2 COMPLEX*16 EX,EY,EZ,ZPED,VQD,VQDS,T1,Y11A,Y12A,EPSC,U,U2,XX1,XX2 COMPLEX*16 AR1,AR2,AR3,EPSCF,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /CMB/CM(IRESRV) COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT, 1ICASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON/SAVE/EPSR,SIG,SCRWLT,SCRWRT,FMHZ,IP(2*MAXSEG),KCOM COMMON/CSAVE/COM(19,5) COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF COMMON/YPARM/Y11A(5),Y12A(20),NCOUP,ICOUP,NCTAG(5),NCSEG(5) COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON, 1IPCON(10),NPCON COMMON/VSORC/VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30), 1IQDS(30),NVQD,NSANT,NQDS COMMON/NETCX/ZPED,PIN,PNLS,X11R(30),X11I(30),X12R(30),X12I(30), &X22R(30),X22I(30),NTYP(30),ISEG1(30),ISEG2(30),NEQ,NPEQ,NEQ2, &NONET,NTSOL,NPRINT,MASYM COMMON/FPAT/THETS,PHIS,DTH,DPH,RFLD,GNOR,CLT,CHT,EPSR2,SIG2, &XPR6,PINR,PNLR,PLOSS,XNR,YNR,ZNR,DXNR,DYNR,DZNR,NTH,NPH,IPD,IAVP, &INOR,IAX,IXTYP,NEAR,NFEH,NRX,NRY,NRZ COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3), 1DYA(3),XSA(3),YSA(3),NXA(3),NYA(3) COMMON/GWAV/U,U2,XX1,XX2,R1,R2,ZMH,ZPH C*** COMMON /PLOT/ IPLP1,IPLP2,IPLP3,IPLP4 C*** DIMENSION CAB(1),SAB(1),X2(1),Y2(1),Z2(1) DIMENSION LDTYP(300),LDTAG(300),LDTAGF(300),LDTAGT(300),ZLR(300), 1ZLI(300),ZLC(300) DIMENSION ATST(22),PNET(6),HPOL(3),IX(2*MAXSEG) DIMENSION FNORM(200) DIMENSION T1X(1),T1Y(1),T1Z(1),T2X(1),T2Y(1),T2Z(1) C*** DIMENSION XTEMP(MAXSEG),YTEMP(MAXSEG),ZTEMP(MAXSEG), &SITEMP(MAXSEG),BITEMP(MAXSEG) EQUIVALENCE (CAB,ALP),(SAB,BET),(X2,SI),(Y2,ALP),(Z2,BET) EQUIVALENCE (T1X,SI),(T1Y,ALP),(T1Z,BET),(T2X,ICON1),(T2Y,ICON2), 1 (T2Z,ITAG) DATA ATST/'CE','FR','LD','GN','EX','NT','XQ','NE','GD','RP','CM', 1 'NX','EN','TL','PT','KH','NH','PQ','EK','WG','CP','PL'/ DATA HPOL/6HLINEAR,5HRIGHT,4HLEFT/ DATA PNET/6H ,2H ,6HSTRAIG,2HHT,6HCROSSE,1HD/ DATA TA/1.745329252D-02/,CVEL/299.8/ DATA LOADMX,NSMAX,NETMX/300,30,30/,NORMF/200/ 706 CONTINUE C C History: C Date Change C ------- ---------------------------------------------- C 5/04/95 Matrix re-transposed in subroutine FACTR. C FACTR and SOLVE changed for non-transposed matrix. C C 4/15/02 Increased limit for LD cards from 30 to 300 C C 8/15/05 Changed to read from standard input and write to C standard output. C C ********** READING FROM COMMAND LINE ARGUMENTS CALL GETARG(1,INFILE) OPEN (UNIT=2,FILE=INFILE,STATUS='OLD',ERR=702) CALL GETARG(2,OUTFILE) OPEN (UNIT=3,FILE=OUTFILE,STATUS='UNKNOWN',ERR=704) GO TO 705 702 CALL ERROR STOP 704 CALL ERROR STOP C***MAC C OPEN IN AND OUT FILES WITH DIALOG BOX FOR MACINTOSH C C INMSG='Select nec input file (NEC-2D) ' C OUTMSG='Enter name of output file ' C GPWNXY(1)=50 C GPWNXY(2)=100 C702 LGTPT= GetPut(1,GPWNXY,INMSG,INFILE,IVOL,1,'TEXT') C IF(.NOT.LGTPT)STOP C OPEN (UNIT=2,FILE=INFILE,STATUS='OLD',ACTION='READ',ERR=702) C704 LGTPT= GetPut(0,GPWNXY,OUTMSG,OUTFILE,IVOL,1,'TEXT') C IF(.NOT.LGTPT)STOP C OPEN (UNIT=3,FILE=OUTFILE,STATUS='UNKNOWN',ERR=704) C WRITE(*,*)' NEC-2D RUN IN PROGRESS' C***MAC 705 CONTINUE CALL CPU_TIME(EXTIM) FJ=(0.,1.) LD=MAXSEG NXA(1)=0 1 KCOM=0 C*** IFRTIMW=0 IFRTIMP=0 C*** 2 KCOM=KCOM+1 IF (KCOM.GT.5) KCOM=5 READ(2,125)AIN,(COM(I,KCOM),I=1,19) CALL UPCASE(AIN,AIN,LAIN) IF(KCOM.GT.1)GO TO 3 WRITE(3,126) WRITE(3,127) WRITE(3,128) 3 WRITE(3,129) (COM(I,KCOM),I=1,19) IF (AIN.EQ.ATST(11)) GO TO 2 IF (AIN.EQ.ATST(1)) GO TO 4 WRITE(3,130) STOP 4 CONTINUE DO 5 I=1,LD 5 ZARRAY(I)=(0.,0.) MPCNT=0 IMAT=0 C C SET UP GEOMETRY DATA IN SUBROUTINE DATAGN C CALL DATAGN IFLOW=1 IF(IMAT.EQ.0)GO TO 326 C C CORE ALLOCATION FOR ARRAYS B, C, AND D FOR N.G.F. SOLUTION C NEQ=N1+2*M1 NEQ2=N-N1+2*(M-M1)+NSCON+2*NPCON CALL FBNGF(NEQ,NEQ2,IRESRV,IB11,IC11,ID11,IX11) GO TO 6 326 NEQ=N+2*M NEQ2=0 IB11=1 IC11=1 ID11=1 IX11=1 ICASX=0 6 NPEQ=NP+2*MP WRITE(3,135) C C DEFAULT VALUES FOR INPUT PARAMETERS AND FLAGS C C*** IPLP1=0 IPLP2=0 IPLP3=0 IPLP4=0 C*** IGO=1 FMHZS=CVEL NFRQ=1 RKH=1. IEXK=0 IXTYP=0 NLOAD=0 NONET=0 NEAR=-1 IPTFLG=-2 IPTFLQ=-1 IFAR=-1 ZRATI=(1.,0.) IPED=0 IRNGF=0 NCOUP=0 ICOUP=0 IF(ICASX.GT.0)GO TO 14 FMHZ=CVEL NLODF=0 KSYMP=1 NRADL=0 IPERF=0 C C MAIN INPUT SECTION - STANDARD READ STATEMENT - JUMPS TO APPRO- C PRIATE SECTION FOR SPECIFIC PARAMETER SET UP C 14 CALL READMN(2,AIN,ITMP1,ITMP2,ITMP3,ITMP4,TMP1,TMP2,TMP3,TMP4, &TMP5,TMP6) MPCNT=MPCNT+1 WRITE(3,137) MPCNT,AIN,ITMP1,ITMP2,ITMP3,ITMP4,TMP1,TMP2,TMP3, 1TMP4,TMP5,TMP6 IF (AIN.EQ.ATST(2)) GO TO 16 IF (AIN.EQ.ATST(3)) GO TO 17 IF (AIN.EQ.ATST(4)) GO TO 21 IF (AIN.EQ.ATST(5)) GO TO 24 IF (AIN.EQ.ATST(6)) GO TO 28 IF (AIN.EQ.ATST(14)) GO TO 28 IF (AIN.EQ.ATST(15)) GO TO 31 IF (AIN.EQ.ATST(18)) GO TO 319 IF (AIN.EQ.ATST(7)) GO TO 37 IF (AIN.EQ.ATST(8)) GO TO 32 IF (AIN.EQ.ATST(17)) GO TO 208 IF (AIN.EQ.ATST(9)) GO TO 34 IF (AIN.EQ.ATST(10)) GO TO 36 IF (AIN.EQ.ATST(16)) GO TO 305 IF (AIN.EQ.ATST(19)) GO TO 320 IF (AIN.EQ.ATST(12)) GO TO 1 IF (AIN.EQ.ATST(20)) GO TO 322 IF (AIN.EQ.ATST(21)) GO TO 304 C*** IF (AIN.EQ.ATST(22)) GO TO 330 C*** IF (AIN.NE.ATST(13)) GO TO 15 CALL CPU_TIME(TMP1) TMP1=TMP1-EXTIM WRITE(3,201) TMP1 STOP 15 WRITE(3,138) STOP C C FREQUENCY PARAMETERS C 16 IFRQ=ITMP1 IF(ICASX.EQ.0)GO TO 8 WRITE(3,303) AIN STOP 8 NFRQ=ITMP2 IF (NFRQ.EQ.0) NFRQ=1 FMHZ=TMP1 DELFRQ=TMP2 IF(IPED.EQ.1)ZPNORM=0. IGO=1 IFLOW=1 GO TO 14 C C MATRIX INTEGRATION LIMIT C 305 RKH=TMP1 IF(IGO.GT.2)IGO=2 IFLOW=1 GO TO 14 C C EXTENDED THIN WIRE KERNEL OPTION C 320 IEXK=1 IF(ITMP1.EQ.-1)IEXK=0 IF(IGO.GT.2)IGO=2 IFLOW=1 GO TO 14 C C MAXIMUM COUPLING BETWEEN ANTENNAS C 304 IF(IFLOW.NE.2)NCOUP=0 ICOUP=0 IFLOW=2 IF(ITMP2.EQ.0)GO TO 14 NCOUP=NCOUP+1 IF(NCOUP.GT.5)GO TO 312 NCTAG(NCOUP)=ITMP1 NCSEG(NCOUP)=ITMP2 IF(ITMP4.EQ.0)GO TO 14 NCOUP=NCOUP+1 IF(NCOUP.GT.5)GO TO 312 NCTAG(NCOUP)=ITMP3 NCSEG(NCOUP)=ITMP4 GO TO 14 312 WRITE(3,313) STOP C C LOADING PARAMETERS C 17 IF (IFLOW.EQ.3) GO TO 18 NLOAD=0 IFLOW=3 IF (IGO.GT.2) IGO=2 IF (ITMP1.EQ.(-1)) GO TO 14 18 NLOAD=NLOAD+1 IF (NLOAD.LE.LOADMX) GO TO 19 WRITE(3,139) STOP 19 LDTYP(NLOAD)=ITMP1 LDTAG(NLOAD)=ITMP2 IF (ITMP4.EQ.0) ITMP4=ITMP3 LDTAGF(NLOAD)=ITMP3 LDTAGT(NLOAD)=ITMP4 IF (ITMP4.GE.ITMP3) GO TO 20 WRITE(3,140) NLOAD,ITMP3,ITMP4 STOP 20 ZLR(NLOAD)=TMP1 ZLI(NLOAD)=TMP2 ZLC(NLOAD)=TMP3 GO TO 14 C C GROUND PARAMETERS UNDER THE ANTENNA C 21 IFLOW=4 IF(ICASX.EQ.0)GO TO 10 WRITE(3,303) AIN STOP 10 IF (IGO.GT.2) IGO=2 IF (ITMP1.NE.(-1)) GO TO 22 KSYMP=1 NRADL=0 IPERF=0 GO TO 14 22 IPERF=ITMP1 NRADL=ITMP2 KSYMP=2 EPSR=TMP1 SIG=TMP2 IF (NRADL.EQ.0) GO TO 23 IF(IPERF.NE.2)GO TO 314 WRITE(3,390) STOP 314 SCRWLT=TMP3 SCRWRT=TMP4 GO TO 14 23 EPSR2=TMP3 SIG2=TMP4 CLT=TMP5 CHT=TMP6 GO TO 14 C C EXCITATION PARAMETERS C 24 IF (IFLOW.EQ.5) GO TO 25 NSANT=0 NVQD=0 IPED=0 IFLOW=5 IF (IGO.GT.3) IGO=3 25 MASYM=ITMP4/10 IF (ITMP1.GT.0.AND.ITMP1.NE.5) GO TO 27 IXTYP=ITMP1 NTSOL=0 IF(IXTYP.EQ.0)GO TO 205 NVQD=NVQD+1 IF(NVQD.GT.NSMAX)GO TO 206 IVQD(NVQD)=ISEGNO(ITMP2,ITMP3) VQD(NVQD)=DCMPLX(TMP1,TMP2) IF(ABS(VQD(NVQD)).LT.1.D-20)VQD(NVQD)=(1.,0.) GO TO 207 205 NSANT=NSANT+1 IF (NSANT.LE.NSMAX) GO TO 26 206 WRITE(3,141) STOP 26 ISANT(NSANT)=ISEGNO(ITMP2,ITMP3) VSANT(NSANT)=DCMPLX(TMP1,TMP2) IF (ABS(VSANT(NSANT)).LT.1.D-20) VSANT(NSANT)=(1.,0.) 207 IPED=ITMP4-MASYM*10 ZPNORM=TMP3 IF (IPED.EQ.1.AND.ZPNORM.GT.0) IPED=2 GO TO 14 27 IF (IXTYP.EQ.0.OR.IXTYP.EQ.5) NTSOL=0 IXTYP=ITMP1 NTHI=ITMP2 NPHI=ITMP3 XPR1=TMP1 XPR2=TMP2 XPR3=TMP3 XPR4=TMP4 XPR5=TMP5 XPR6=TMP6 NSANT=0 NVQD=0 THETIS=XPR1 PHISS=XPR2 GO TO 14 C C NETWORK PARAMETERS C 28 IF (IFLOW.EQ.6) GO TO 29 NONET=0 NTSOL=0 IFLOW=6 IF (IGO.GT.3) IGO=3 IF (ITMP2.EQ.(-1)) GO TO 14 29 NONET=NONET+1 IF (NONET.LE.NETMX) GO TO 30 WRITE(3,142) STOP 30 NTYP(NONET)=2 IF (AIN.EQ.ATST(6)) NTYP(NONET)=1 ISEG1(NONET)=ISEGNO(ITMP1,ITMP2) ISEG2(NONET)=ISEGNO(ITMP3,ITMP4) X11R(NONET)=TMP1 X11I(NONET)=TMP2 X12R(NONET)=TMP3 X12I(NONET)=TMP4 X22R(NONET)=TMP5 X22I(NONET)=TMP6 IF (NTYP(NONET).EQ.1.OR.TMP1.GT.0.) GO TO 14 NTYP(NONET)=3 X11R(NONET)=-TMP1 GO TO 14 C*** C C PLOT FLAGS C 330 IPLP1=ITMP1 IPLP2=ITMP2 IPLP3=ITMP3 IPLP4=ITMP4 OPEN (UNIT=8,FILE='PLTDAT.NEC',STATUS='NEW',ERR=14) C*** GO TO 14 C C PRINT CONTROL FOR CURRENT C 31 IPTFLG=ITMP1 IPTAG=ITMP2 IPTAGF=ITMP3 IPTAGT=ITMP4 IF(ITMP3.EQ.0.AND.IPTFLG.NE.-1)IPTFLG=-2 IF (ITMP4.EQ.0) IPTAGT=IPTAGF GO TO 14 C C WRITE CONTROL FOR CHARGE C 319 IPTFLQ=ITMP1 IPTAQ=ITMP2 IPTAQF=ITMP3 IPTAQT=ITMP4 IF(ITMP3.EQ.0.AND.IPTFLQ.NE.-1)IPTFLQ=-2 IF(ITMP4.EQ.0)IPTAQT=IPTAQF GO TO 14 C C NEAR FIELD CALCULATION PARAMETERS C 208 NFEH=1 GO TO 209 32 NFEH=0 209 IF (.NOT.(IFLOW.EQ.8.AND.NFRQ.NE.1)) GO TO 33 WRITE(3,143) 33 NEAR=ITMP1 NRX=ITMP2 NRY=ITMP3 NRZ=ITMP4 XNR=TMP1 YNR=TMP2 ZNR=TMP3 DXNR=TMP4 DYNR=TMP5 DZNR=TMP6 IFLOW=8 IF (NFRQ.NE.1) GO TO 14 GO TO (41,46,53,71,72), IGO C C GROUND REPRESENTATION C 34 EPSR2=TMP1 SIG2=TMP2 CLT=TMP3 CHT=TMP4 IFLOW=9 GO TO 14 C C STANDARD OBSERVATION ANGLE PARAMETERS C 36 IFAR=ITMP1 NTH=ITMP2 NPH=ITMP3 IF (NTH.EQ.0) NTH=1 IF (NPH.EQ.0) NPH=1 IPD=ITMP4/10 IAVP=ITMP4-IPD*10 INOR=IPD/10 IPD=IPD-INOR*10 IAX=INOR/10 INOR=INOR-IAX*10 IF (IAX.NE.0) IAX=1 IF (IPD.NE.0) IPD=1 IF (NTH.LT.2.OR.NPH.LT.2) IAVP=0 IF (IFAR.EQ.1) IAVP=0 THETS=TMP1 PHIS=TMP2 DTH=TMP3 DPH=TMP4 RFLD=TMP5 GNOR=TMP6 IFLOW=10 GO TO (41,46,53,71,78), IGO C C WRITE NUMERICAL GREEN'S FUNCTION TAPE C 322 IFLOW=12 IF(ICASX.EQ.0)GO TO 301 WRITE(3,302) STOP 301 IRNGF=IRESRV/2 GO TO (41,46,52,52,52),IGO C C EXECUTE CARD - CALC. INCLUDING RADIATED FIELDS C 37 IF (IFLOW.EQ.10.AND.ITMP1.EQ.0) GO TO 14 IF (NFRQ.EQ.1.AND.ITMP1.EQ.0.AND.IFLOW.GT.7) GO TO 14 IF (ITMP1.NE.0) GO TO 39 IF (IFLOW.GT.7) GO TO 38 IFLOW=7 GO TO 40 38 IFLOW=11 GO TO 40 39 IFAR=0 RFLD=0. IPD=0 IAVP=0 INOR=0 IAX=0 NTH=91 NPH=1 THETS=0. PHIS=0. DTH=1.0 DPH=0. IF (ITMP1.EQ.2) PHIS=90. IF (ITMP1.NE.3) GO TO 40 NPH=2 DPH=90. 40 GO TO (41,46,53,71,78), IGO C C END OF THE MAIN INPUT SECTION C C BEGINNING OF THE FREQUENCY DO LOOP C 41 MHZ=1 C*** IF(N.EQ.0 .OR. IFRTIMW .EQ. 1)GO TO 406 IFRTIMW=1 DO 445 I=1,N XTEMP(I)=X(I) YTEMP(I)=Y(I) ZTEMP(I)=Z(I) SITEMP(I)=SI(I) BITEMP(I)=BI(I) 445 CONTINUE 406 IF(M.EQ.0 .OR. IFRTIMP .EQ. 1)GO TO 407 IFRTIMP=1 J=LD+1 DO 545 I=1,M J=J-1 XTEMP(J)=X(J) YTEMP(J)=Y(J) ZTEMP(J)=Z(J) BITEMP(J)=BI(J) 545 CONTINUE 407 CONTINUE FMHZ1=FMHZ C*** C CORE ALLOCATION FOR PRIMARY INTERACTON MATRIX. (A) IF(IMAT.EQ.0)CALL FBLOCK(NPEQ,NEQ,IRESRV,IRNGF,IPSYM) 42 IF (MHZ.EQ.1) GO TO 44 IF (IFRQ.EQ.1) GO TO 43 C FMHZ=FMHZ+DELFRQ C*** FMHZ=FMHZ1+(MHZ-1)*DELFRQ GO TO 44 43 FMHZ=FMHZ*DELFRQ 44 FR=FMHZ/CVEL C*** WLAM=CVEL/FMHZ WRITE(3,145) FMHZ,WLAM WRITE(3,196) RKH IF(IEXK.EQ.1)WRITE(3,321) C FREQUENCY SCALING OF GEOMETRIC PARAMETERS C*** FMHZS=FMHZ IF(N.EQ.0)GO TO 306 DO 45 I=1,N C*** X(I)=XTEMP(I)*FR Y(I)=YTEMP(I)*FR Z(I)=ZTEMP(I)*FR SI(I)=SITEMP(I)*FR 45 BI(I)=BITEMP(I)*FR C*** 306 IF(M.EQ.0)GO TO 307 FR2=FR*FR J=LD+1 DO 245 I=1,M J=J-1 C*** X(J)=XTEMP(J)*FR Y(J)=YTEMP(J)*FR Z(J)=ZTEMP(J)*FR 245 BI(J)=BITEMP(J)*FR2 C*** 307 IGO=2 C STRUCTURE SEGMENT LOADING 46 WRITE(3,146) IF(NLOAD.NE.0) CALL LOAD(LDTYP,LDTAG,LDTAGF,LDTAGT,ZLR,ZLI,ZLC) IF(NLOAD.EQ.0.AND.NLODF.EQ.0)WRITE(3,147) IF(NLOAD.EQ.0.AND.NLODF.NE.0)WRITE(3,327) C GROUND PARAMETER WRITE(3,148) IF (KSYMP.EQ.1) GO TO 49 FRATI=(1.,0.) IF (IPERF.EQ.1) GO TO 48 IF(SIG.LT.0.)SIG=-SIG/(59.96*WLAM) EPSC=DCMPLX(EPSR,-SIG*WLAM*59.96) ZRATI=1./SQRT(EPSC) U=ZRATI U2=U*U IF (NRADL.EQ.0) GO TO 47 SCRWL=SCRWLT/WLAM SCRWR=SCRWRT/WLAM T1=FJ*2367.067D+0/DFLOAT(NRADL) T2=SCRWR*DFLOAT(NRADL) WRITE(3,170) NRADL,SCRWLT,SCRWRT WRITE(3,149) 47 IF(IPERF.EQ.2)GO TO 328 WRITE(3,391) GO TO 329 328 IF(NXA(1).EQ.0)THEN OPEN(UNIT=21,FILE='SOM2D.NEC',STATUS='OLD',FORM='UNFORMATTED', & ERR=800) GO TO 801 800 WRITE(3,900) STOP 801 READ(21)AR1,AR2,AR3,EPSCF,DXA,DYA,XSA,YSA,NXA,NYA END IF FRATI=(EPSC-1.)/(EPSC+1.) IF(ABS((EPSCF-EPSC)/EPSC).LT.1.D-3)GO TO 400 WRITE(3,393) EPSCF,EPSC STOP 400 WRITE(3,392) 329 WRITE(3,150) EPSR,SIG,EPSC GO TO 50 48 WRITE(3,151) GO TO 50 49 WRITE(3,152) 50 CONTINUE C * * * C FILL AND FACTOR PRIMARY INTERACTION MATRIX C CALL CPU_TIME (TIM1) IF(ICASX.NE.0)GO TO 324 CALL CMSET(NEQ,CM,RKH,IEXK) CALL CPU_TIME (TIM2) TIM=TIM2-TIM1 CALL FACTRS(NPEQ,NEQ,CM,IP,IX,11,12,13,14) GO TO 323 C C N.G.F. - FILL B, C, AND D AND FACTOR D-C(INV(A)B) C C **** 324 IF(NEQ2.EQ.0)GO TO 333 C **** CALL CMNGF(CM(IB11),CM(IC11),CM(ID11),NPBX,NEQ,NEQ2,RKH,IEXK) CALL CPU_TIME (TIM2) TIM=TIM2-TIM1 CALL FACGF(CM,CM(IB11),CM(IC11),CM(ID11),CM(IX11),IP,IX,NP,N1,MP, 1M1,NEQ,NEQ2) 323 CALL CPU_TIME (TIM1) TIM2=TIM1-TIM2 WRITE(3,153) TIM,TIM2 333 IGO=3 NTSOL=0 IF(IFLOW.NE.12)GO TO 53 C WRITE N.G.F. FILE 52 CALL GFOUT GO TO 14 C C EXCITATION SET UP (RIGHT HAND SIDE, -E INC.) C 53 NTHIC=1 NPHIC=1 INC=1 NPRINT=0 54 IF (IXTYP.EQ.0.OR.IXTYP.EQ.5) GO TO 56 IF (IPTFLG.LE.0.OR.IXTYP.EQ.4) WRITE(3,154) TMP5=TA*XPR5 TMP4=TA*XPR4 IF (IXTYP.NE.4) GO TO 55 TMP1=XPR1/WLAM TMP2=XPR2/WLAM TMP3=XPR3/WLAM TMP6=XPR6/(WLAM*WLAM) WRITE(3,156) XPR1,XPR2,XPR3,XPR4,XPR5,XPR6 GO TO 56 55 TMP1=TA*XPR1 TMP2=TA*XPR2 TMP3=TA*XPR3 TMP6=XPR6 IF (IPTFLG.LE.0) WRITE(3,155) XPR1,XPR2,XPR3,HPOL(IXTYP),XPR6 56 CALL ETMNS (TMP1,TMP2,TMP3,TMP4,TMP5,TMP6,IXTYP,CUR) C C MATRIX SOLVING (NETWK CALLS SOLVES) C IF (NONET.EQ.0.OR.INC.GT.1) GO TO 60 WRITE(3,158) ITMP3=0 ITMP1=NTYP(1) DO 59 I=1,2 IF (ITMP1.EQ.3) ITMP1=2 IF (ITMP1.EQ.2) WRITE(3,159) IF (ITMP1.EQ.1) WRITE(3,160) DO 58 J=1,NONET ITMP2=NTYP(J) IF ((ITMP2/ITMP1).EQ.1) GO TO 57 ITMP3=ITMP2 GO TO 58 57 ITMP4=ISEG1(J) ITMP5=ISEG2(J) IF (ITMP2.GE.2.AND.X11I(J).LE.0.) X11I(J)=WLAM*SQRT((X(ITMP5)- 1 X(ITMP4))**2+(Y(ITMP5)-Y(ITMP4))**2+(Z(ITMP5)-Z(ITMP4))**2) WRITE(3,157) ITAG(ITMP4),ITMP4,ITAG(ITMP5),ITMP5,X11R(J),X11 1I(J),X12R(J),X12I(J),X22R(J),X22I(J),PNET(2*ITMP2-1),PNET(2*ITMP2) 58 CONTINUE IF (ITMP3.EQ.0) GO TO 60 ITMP1=ITMP3 59 CONTINUE 60 CONTINUE IF (INC.GT.1.AND.IPTFLG.GT.0) NPRINT=1 CALL NETWK(CM,CM(IB11),CM(IC11),CM(ID11),IP,CUR) NTSOL=1 IF (IPED.EQ.0) GO TO 61 ITMP1=MHZ+4*(MHZ-1) IF (ITMP1.GT.(NORMF-3)) GO TO 61 FNORM(ITMP1)=DREAL(ZPED) FNORM(ITMP1+1)=DIMAG(ZPED) FNORM(ITMP1+2)=ABS(ZPED) FNORM(ITMP1+3)=CANG(ZPED) IF (IPED.EQ.2) GO TO 61 IF (FNORM(ITMP1+2).GT.ZPNORM) ZPNORM=FNORM(ITMP1+2) 61 CONTINUE C C PRINTING STRUCTURE CURRENTS C IF(N.EQ.0)GO TO 308 IF (IPTFLG.EQ.(-1)) GO TO 63 IF (IPTFLG.GT.0) GO TO 62 WRITE(3,161) WRITE(3,162) GO TO 63 62 IF (IPTFLG.EQ.3.OR.INC.GT.1) GO TO 63 WRITE(3,163) XPR3,HPOL(IXTYP),XPR6 63 PLOSS=0. ITMP1=0 JUMP=IPTFLG+1 DO 69 I=1,N CURI=CUR(I)*WLAM CMAG=ABS(CURI) PH=CANG(CURI) IF (NLOAD.EQ.0.AND.NLODF.EQ.0) GO TO 64 IF (ABS(DREAL(ZARRAY(I))).LT.1.D-20) GO TO 64 PLOSS=PLOSS+.5*CMAG*CMAG*DREAL(ZARRAY(I))*SI(I) 64 IF (JUMP) 68,69,65 65 IF (IPTAG.EQ.0) GO TO 66 IF (ITAG(I).NE.IPTAG) GO TO 69 66 ITMP1=ITMP1+1 IF (ITMP1.LT.IPTAGF.OR.ITMP1.GT.IPTAGT) GO TO 69 IF (IPTFLG.EQ.0) GO TO 68 IF (IPTFLG.LT.2.OR.INC.GT.NORMF) GO TO 67 FNORM(INC)=CMAG ISAVE=I 67 IF (IPTFLG.NE.3) WRITE(3,164) XPR1,XPR2,CMAG,PH,I GO TO 69 68 WRITE(3,165) I,ITAG(I),X(I),Y(I),Z(I),SI(I),CURI,CMAG,PH C*** IF(IPLP1 .NE. 1) GO TO 69 IF(IPLP2 .EQ. 1) WRITE(8,*) CURI IF(IPLP2 .EQ. 2) WRITE(8,*) CMAG,PH C*** 69 CONTINUE IF(IPTFLQ.EQ.(-1))GO TO 308 WRITE(3,315) ITMP1=0 FR=1.D-6/FMHZ DO 316 I=1,N IF(IPTFLQ.EQ.(-2))GO TO 318 IF(IPTAQ.EQ.0)GO TO 317 IF(ITAG(I).NE.IPTAQ)GO TO 316 317 ITMP1=ITMP1+1 IF(ITMP1.LT.IPTAQF.OR.ITMP1.GT.IPTAQT)GO TO 316 318 CURI=FR*DCMPLX(-BII(I),BIR(I)) CMAG=ABS(CURI) PH=CANG(CURI) WRITE(3,165) I,ITAG(I),X(I),Y(I),Z(I),SI(I),CURI,CMAG,PH 316 CONTINUE 308 IF(M.EQ.0)GO TO 310 WRITE(3,197) J=N-2 ITMP1=LD+1 DO 309 I=1,M J=J+3 ITMP1=ITMP1-1 EX=CUR(J) EY=CUR(J+1) EZ=CUR(J+2) ETH=EX*T1X(ITMP1)+EY*T1Y(ITMP1)+EZ*T1Z(ITMP1) EPH=EX*T2X(ITMP1)+EY*T2Y(ITMP1)+EZ*T2Z(ITMP1) ETHM=ABS(ETH) ETHA=CANG(ETH) EPHM=ABS(EPH) EPHA=CANG(EPH) C309 WRITE(3,198) I,X(ITMP1),Y(ITMP1),Z(ITMP1),ETHM,ETHA,EPHM,EPHA,E C 1X,EY, EZ C*** WRITE(3,198) I,X(ITMP1),Y(ITMP1),Z(ITMP1),ETHM,ETHA,EPHM,EPHA,E 1X,EY,EZ IF(IPLP1 .NE. 1) GO TO 309 IF(IPLP3 .EQ. 1) WRITE(8,*) EX IF(IPLP3 .EQ. 2) WRITE(8,*) EY IF(IPLP3 .EQ. 3) WRITE(8,*) EZ IF(IPLP3 .EQ. 4) WRITE(8,*) EX,EY,EZ 309 CONTINUE C*** 310 IF (IXTYP.NE.0.AND.IXTYP.NE.5) GO TO 70 TMP1=PIN-PNLS-PLOSS TMP2=100.*TMP1/PIN WRITE(3,166) PIN,TMP1,PLOSS,PNLS,TMP2 70 CONTINUE IGO=4 IF(NCOUP.GT.0)CALL COUPLE(CUR,WLAM) IF (IFLOW.NE.7) GO TO 71 IF (IXTYP.GT.0.AND.IXTYP.LT.4) GO TO 113 IF (NFRQ.NE.1) GO TO 120 WRITE(3,135) GO TO 14 71 IGO=5 C C NEAR FIELD CALCULATION C 72 IF (NEAR.EQ.(-1)) GO TO 78 CALL NFPAT IF (MHZ.EQ.NFRQ) NEAR=-1 IF (NFRQ.NE.1) GO TO 78 WRITE(3,135) GO TO 14 C C STANDARD FAR FIELD CALCULATION C 78 IF(IFAR.EQ.-1)GO TO 113 PINR=PIN PNLR=PNLS CALL RDPAT 113 IF (IXTYP.EQ.0.OR.IXTYP.GE.4) GO TO 119 NTHIC=NTHIC+1 INC=INC+1 XPR1=XPR1+XPR4 IF (NTHIC.LE.NTHI) GO TO 54 NTHIC=1 XPR1=THETIS XPR2=XPR2+XPR5 NPHIC=NPHIC+1 IF (NPHIC.LE.NPHI) GO TO 54 NPHIC=1 XPR2=PHISS IF (IPTFLG.LT.2) GO TO 119 C NORMALIZED RECEIVING PATTERN PRINTED ITMP1=NTHI*NPHI IF (ITMP1.LE.NORMF) GO TO 114 ITMP1=NORMF WRITE(3,181) 114 TMP1=FNORM(1) DO 115 J=2,ITMP1 IF (FNORM(J).GT.TMP1) TMP1=FNORM(J) 115 CONTINUE WRITE(3,182) TMP1,XPR3,HPOL(IXTYP),XPR6,ISAVE DO 118 J=1,NPHI ITMP2=NTHI*(J-1) DO 116 I=1,NTHI ITMP3=I+ITMP2 IF (ITMP3.GT.ITMP1) GO TO 117 TMP2=FNORM(ITMP3)/TMP1 TMP3=DB20(TMP2) WRITE(3,183) XPR1,XPR2,TMP3,TMP2 XPR1=XPR1+XPR4 116 CONTINUE 117 XPR1=THETIS XPR2=XPR2+XPR5 118 CONTINUE XPR2=PHISS 119 IF (MHZ.EQ.NFRQ) IFAR=-1 IF (NFRQ.NE.1) GO TO 120 WRITE(3,135) GO TO 14 120 MHZ=MHZ+1 IF (MHZ.LE.NFRQ) GO TO 42 IF (IPED.EQ.0) GO TO 123 IF(NVQD.LT.1)GO TO 199 WRITE(3,184) IVQD(NVQD),ZPNORM GO TO 204 199 WRITE(3,184) ISANT(NSANT),ZPNORM 204 ITMP1=NFRQ IF (ITMP1.LE.(NORMF/4)) GO TO 121 ITMP1=NORMF/4 WRITE(3,185) 121 IF (IFRQ.EQ.0) TMP1=FMHZ-(NFRQ-1)*DELFRQ IF (IFRQ.EQ.1) TMP1=FMHZ/(DELFRQ**(NFRQ-1)) DO 122 I=1,ITMP1 ITMP2=I+4*(I-1) TMP2=FNORM(ITMP2)/ZPNORM TMP3=FNORM(ITMP2+1)/ZPNORM TMP4=FNORM(ITMP2+2)/ZPNORM TMP5=FNORM(ITMP2+3) WRITE(3,186) TMP1,FNORM(ITMP2),FNORM(ITMP2+1),FNORM(ITMP2+2), 1FNORM(ITMP2+3),TMP2,TMP3,TMP4,TMP5 IF (IFRQ.EQ.0) TMP1=TMP1+DELFRQ IF (IFRQ.EQ.1) TMP1=TMP1*DELFRQ 122 CONTINUE WRITE(3,135) 123 CONTINUE NFRQ=1 MHZ=1 GO TO 14 125 FORMAT (A2,19A4) 126 FORMAT ('1') 127 FORMAT (///,33X,'*********************************************', &//,36X,'NUMERICAL ELECTROMAGNETICS CODE (NEC-2D)',//,33X, 2 '*********************************************') 128 FORMAT (////,37X,'- - - - COMMENTS - - - -',//) 129 FORMAT (25X,20A4) 130 FORMAT (///,10X,'INCORRECT LABEL FOR A COMMENT CARD') 135 FORMAT (/////) 136 FORMAT (A2,I3,3I5,6E10.3) 137 FORMAT (1X,'***** DATA CARD NO.',I3,3X,A2,1X,I3,3(1X,I5), 1 6(1X,1P,E12.5)) 138 FORMAT (///,10X,'FAULTY DATA CARD LABEL AFTER GEOMETRY SECTION') 139 FORMAT (///,10X,'NUMBER OF LOADING CARDS EXCEEDS STORAGE ALLOTTED' 1) 140 FORMAT (///,10X,'DATA FAULT ON LOADING CARD NO.=',I5,5X, &'ITAG STEP1=',I5,' IS GREATER THAN ITAG STEP2=',I5) 141 FORMAT (///,10X,'NUMBER OF EXCITATION CARDS EXCEEDS STORAGE ALLO', &'TTED') 142 FORMAT (///,10X,'NUMBER OF NETWORK CARDS EXCEEDS STORAGE ALLOTTE', &'D') 143 FORMAT(///,10X,'WHEN MULTIPLE FREQUENCIES ARE REQUESTED, ONLY ON', &'E NEAR FIELD CARD CAN BE USED -',/,10X,'LAST CARD READ IS USED') 145 FORMAT (////,33X,'- - - - - - FREQUENCY - - - - - -',//,36X, &'FREQUENCY=',1P,E11.4,' MHZ',/,36X,'WAVELENGTH=',E11.4,' METERS') 146 FORMAT (///,30X,' - - - STRUCTURE IMPEDANCE LOADING - - -') 147 FORMAT (/ ,35X,'THIS STRUCTURE IS NOT LOADED') 148 FORMAT (///,34X,'- - - ANTENNA ENVIRONMENT - - -',/) 149 FORMAT (40X,'MEDIUM UNDER SCREEN -') 150 FORMAT (40X,'RELATIVE DIELECTRIC CONST.=',F7.3,/,40X,'CONDUCTIV', &'ITY=',1P,E10.3,' MHOS/METER',/,40X,'COMPLEX DIELECTRIC CONSTANT=' &,2E12.5) 151 FORMAT ( 42X,'PERFECT GROUND') 152 FORMAT ( 44X,'FREE SPACE') 153 FORMAT (///,32X,'- - - MATRIX TIMING - - -',//,24X,'FILL=',F9.3, 1' SEC., FACTOR=',F9.3,' SEC.') 154 FORMAT (///,40X,'- - - EXCITATION - - -') 155 FORMAT (/,4X,'PLANE WAVE',4X,'THETA=',F7.2,' DEG, PHI=',F7.2, &' DEG, ETA=',F7.2,' DEG, TYPE -',A6,'= AXIAL RATIO=',F6.3) 156 FORMAT (/,31X,'POSITION (METERS)',14X,'ORIENTATION (DEG)=',/,28X, 1'X',12X,'Y',12X,'Z',10X,'ALPHA',5X,'BETA',4X,'DIPOLE MOMENT',// 2 ,4X,'CURRENT SOURCE',1X,3(3X,F10.5),1X,2(3X,F7.2),4X,F8.3) 157 FORMAT (4X,4(I5,1X),1P,6(3X,E11.4),3X,A6,A2) 158 FORMAT (///,44X,'- - - NETWORK DATA - - -') 159 FORMAT (/,6X,'- FROM - - TO -',11X,'TRANSMISSION LINE',15X, &'- - SHUNT ADMITTANCES (MHOS) - -',14X,'LINE',/,6X,'TAG SEG.' 2,' TAG SEG.',6X,'IMPEDANCE',6X,'LENGTH',12X,'- END ONE -',17X, 3'- END TWO -',12X,'TYPE',/,6X,'NO. NO. NO. NO.',9X,'OHMS', &8X,'METERS',9X,'REAL',10X,'IMAG.',9X,'REAL',10X,'IMAG.') 160 FORMAT (/,6X,'- FROM -',4X,'- TO -',26X,'- - ADMITTANCE MATRIX', 1' ELEMENTS (MHOS) - -',/,6X,'TAG SEG. TAG SEG.',13X,'(ON', 2'E,ONE)',19X,'(ONE,TWO)',19X,'(TWO,TWO)',/ ,6X,'NO. NO. NO', 3'. NO.',8X,'REAL',10X,'IMAG.',9X,'REAL',10X,'IMAG.',9X,'REAL', 4 10X,'IMAG.') 161 FORMAT (///,29X,'- - - CURRENTS AND LOCATION - - -',//,33X, &'DISTANCES IN WAVELENGTHS') 162 FORMAT ( //,2X,'SEG.',2X,'TAG',4X,'COORD. OF SEG. CENTER',5X, 1 'SEG.',12X,'- - - CURRENT (AMPS) - - -',/,2X,'NO.',3X,'NO.', 2 5X,'X',8X,'Y',8X,'Z',6X,'LENGTH',5X,'REAL',8X,'IMAG.',7X,'MAG.', 3 8X,'PHASE') 163 FORMAT (///,33X,'- - - RECEIVING PATTERN PARAMETERS - - -',/,43X, &'ETA=',F7.2,' DEGREES',/,43X,'TYPE -',A6,/,43X,'AXIAL RATIO=', & F6.3,//,11X,'THETA',6X,'PHI',10X,'- CURRENT -',9X,'SEG',/, &11X,'(DEG)',5X,'(DEG)',7X,'MAGNITUDE',4X,'PHASE',6X,'NO.',/) 164 FORMAT (10X,2(F7.2,3X),1X,1P,E11.4,3X,0P,F7.2,4X,I5) 165 FORMAT (1X,2I5,3F9.4,F9.5,1X,1P,3E12.4,0P,F9.3) 166 FORMAT (///,40X,'- - - POWER BUDGET - - -',//,43X,'INPUT POWER = &',1P,E11.4,' WATTS',/ ,43X,'RADIATED POWER=',E11.4,' WATTS', &/,43X,'STRUCTURE LOSS=',E11.4,' WATTS',/,43X,'NETWORK LOSS =', &E11.4,' WATTS',/,43X,'EFFICIENCY =',0P,F7.2,' PERCENT') 170 FORMAT (40X,'RADIAL WIRE GROUND SCREEN',/,40X,I5,' WIRES',/,40X, 1'WIRE LENGTH=',F8.2,' METERS',/,40X,'WIRE RADIUS=',1P,E10.3, 2' METERS') 181 FORMAT (///,4X,'RECEIVING PATTERN STORAGE TOO SMALL,ARRAY TRUNCA', 1'TED') 182 FORMAT (///,32X,'- - - NORMALIZED RECEIVING PATTERN - - -',/,41X, 1'NORMALIZATION FACTOR=',1P,E11.4,/,41X,'ETA=',0P,F7.2,' DEGREES', 2/,41X,'TYPE -',A6,/,41X,'AXIAL RATIO=',F6.3,/,41X,'SEGMENT NO.=', 3I5,//,21X,'THETA',6X,'PHI',9X,'- PATTERN -',/,21X,'(DEG)',5X, 4'(DEG)',8X,'DB',8X,'MAGNITUDE',/) 183 FORMAT (20X,2(F7.2,3X),1X,F7.2,4X,1P,E11.4) 184 FORMAT (///,36X,32H- - - INPUT IMPEDANCE DATA - - -,/ ,45X,18HSO 1URCE SEGMENT NO.,I4,/ ,45X,21HNORMALIZATION FACTOR=,1P,E12.5,// 2,7X,5HFREQ.,13X,34H- - UNNORMALIZED IMPEDANCE - -,21X, 32H- 3 - NORMALIZED IMPEDANCE - -,/ ,19X,10HRESISTANCE,4X,9HREACTA 4NCE,6X,9HMAGNITUDE,4X,5HPHASE,7X,10HRESISTANCE,4X,9HREACTANCE,6X, 5 9HMAGNITUDE,4X,5HPHASE,/ ,8X,3HMHZ,11X,4HOHMS,10X,4HOHMS,11X, 6 4HOHMS,5X,7HDEGREES,47X,7HDEGREES,/) 185 FORMAT (///,4X,62HSTORAGE FOR IMPEDANCE NORMALIZATION TOO SMALL, A 1RRAY TRUNCATED) 186 FORMAT (3X,F9.3,2X,1P,2(2X,E12.5),3X,E12.5,2X,0P,F7.2,2X,1P,2(2X, 1 E12.5),3X,E12.5,2X,0P,F7.2) 196 FORMAT( ////,20X,55HAPPROXIMATE INTEGRATION EMPLOYED FOR SEGMENT 1S MORE THAN,F8.3,18H WAVELENGTHS APART) 197 FORMAT( ////,41X,38H- - - - SURFACE PATCH CURRENTS - - - -,//, 1 50X,23HDISTANCE IN WAVELENGTHS,/,50X,21HCURRENT IN AMPS/METER, 1 //,28X,26H- - SURFACE COMPONENTS - -,19X,34H- - - RECTANGULAR COM 1PONENTS - - -,/,6X,12HPATCH CENTER,6X,16HTANGENT VECTOR 1,3X, 116HTANGENT VECTOR 2,11X,1HX,19X,1HY,19X,1HZ,/,5X,1HX,6X,1HY,6X, 11HZ,5X,4HMAG.,7X,5HPHASE,3X,4HMAG.,7X,5HPHASE,3(4X,4HREAL,6X, 1 6HIMAG. )) 198 FORMAT(1X,I4,/,1X,3F7.3,2(1P,E11.4,0P,F8.2),1P,6E10.2) 201 FORMAT(/,11H RUN TIME =,F10.3) 315 FORMAT(///,34X,28H- - - CHARGE DENSITIES - - -,//,36X, 1 24HDISTANCES IN WAVELENGTHS,///,2X,4HSEG.,2X,3HTAG,4X, 2 21HCOORD. OF SEG. CENTER,5X,4HSEG.,10X, 3 31HCHARGE DENSITY (COULOMBS/METER),/,2X,3HNO.,3X,3HNO.,5X,1HX,8X, 4 1HY,8X,1HZ,6X,6HLENGTH,5X,4HREAL,8X,5HIMAG.,7X,4HMAG.,8X,5HPHASE) 321 FORMAT( /,20X,42HTHE EXTENDED THIN WIRE KERNEL WILL BE USED) 303 FORMAT(/,9H ERROR - ,A2,32H CARD IS NOT ALLOWED WITH N.G.F.) 327 FORMAT(/,35X,31H LOADING ONLY IN N.G.F. SECTION) 302 FORMAT(48H ERROR - N.G.F. IN USE. CANNOT WRITE NEW N.G.F.) 313 FORMAT(/,62H NUMBER OF SEGMENTS IN COUPLING CALCULATION (CP) EXCEE 1DS LIMIT) 390 FORMAT(78H RADIAL WIRE G. S. APPROXIMATION MAY NOT BE USED WITH SO 1MMERFELD GROUND OPTION) 391 FORMAT(40X,52HFINITE GROUND. REFLECTION COEFFICIENT APPROXIMATION 1) 392 FORMAT(40X,35HFINITE GROUND. SOMMERFELD SOLUTION) 393 FORMAT(/,29H ERROR IN GROUND PARAMETERS -,/,41H COMPLEX DIELECTRIC 1 CONSTANT FROM FILE IS,1P,2E12.5,/,32X,9HREQUESTED,2E12.5) 900 FORMAT(' ERROR OPENING SOMMERFELD GROUND FILE - SOM2D.NEC') END SUBROUTINE ARC (ITG,NS,RADA,ANG1,ANG2,RAD) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C ARC GENERATES SEGMENT GEOMETRY DATA FOR AN ARC OF NS SEGMENTS C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM DIMENSION X2(1), Y2(1), Z2(1) EQUIVALENCE (X2,SI), (Y2,ALP), (Z2,BET) DATA TA/.01745329252D+0/ IST=N+1 N=N+NS NP=N MP=M IPSYM=0 IF (NS.LT.1) RETURN IF (ABS(ANG2-ANG1).LT.360.00001D+0) GO TO 1 WRITE(3,3) STOP 1 ANG=ANG1*TA DANG=(ANG2-ANG1)*TA/NS XS1=RADA*COS(ANG) ZS1=RADA*SIN(ANG) DO 2 I=IST,N ANG=ANG+DANG XS2=RADA*COS(ANG) ZS2=RADA*SIN(ANG) X(I)=XS1 Y(I)=0. Z(I)=ZS1 X2(I)=XS2 Y2(I)=0. Z2(I)=ZS2 XS1=XS2 ZS1=ZS2 BI(I)=RAD 2 ITAG(I)=ITG RETURN C 3 FORMAT (40H ERROR -- ARC ANGLE EXCEEDS 360. DEGREES) END FUNCTION ATGN2 (X,Y) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C ATGN2 IS ARCTANGENT FUNCTION MODIFIED TO RETURN 0. WHEN X=Y=0. C IF (X) 3,1,3 1 IF (Y) 3,2,3 2 ATGN2=0. RETURN 3 ATGN2=ATAN2(X,Y) RETURN END SUBROUTINE BLCKOT (AR,NUNIT,IX1,IX2,NBLKS,NEOF) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C BLCKOT CONTROLS THE READING AND WRITING OF MATRIX BLOCKS ON FILES C FOR THE OUT-OF-CORE MATRIX SOLUTION. C COMPLEX*16 AR DIMENSION AR(1) I1=(IX1+1)/2 I2=(IX2+1)/2 1 WRITE (NUNIT) (AR(J),J=I1,I2) RETURN ENTRY BLCKIN(AR,NUNIT,IX1,IX2,NBLKS,NEOF) I1=(IX1+1)/2 I2=(IX2+1)/2 DO 2 I=1,NBLKS READ (NUNIT,END=3) (AR(J),J=I1,I2) 2 CONTINUE RETURN 3 WRITE(3,4) NUNIT,NBLKS,NEOF IF (NEOF.NE.777) STOP NEOF=0 RETURN C 4 FORMAT (13H EOF ON UNIT,I3,9H NBLKS= ,I3,8H NEOF= ,I5) END SUBROUTINE CABC (CURX) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C CABC COMPUTES COEFFICIENTS OF THE CONSTANT (A), SINE (B), AND C COSINE (C) TERMS IN THE CURRENT INTERPOLATION FUNCTIONS FOR THE C CURRENT VECTOR CUR. C COMPLEX*16 CUR,CURX,VQDS,CURD,CCJ,VSANT,VQD,CS1,CS2 COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /VSORC/ VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30),IQDS( 130),NVQD,NSANT,NQDS COMMON /ANGL/ SALP(MAXSEG) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) DIMENSION CURX(1), CCJX(2) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) EQUIVALENCE (CCJ,CCJX) DATA TP/6.283185308D+0/,CCJX/0.,-0.01666666667D+0/ IF (N.EQ.0) GO TO 6 DO 1 I=1,N AIR(I)=0. AII(I)=0. BIR(I)=0. BII(I)=0. CIR(I)=0. 1 CII(I)=0. DO 2 I=1,N AR=DREAL(CURX(I)) AI=DIMAG(CURX(I)) CALL TBF (I,1) DO 2 JX=1,JSNO J=JCO(JX) AIR(J)=AIR(J)+AX(JX)*AR AII(J)=AII(J)+AX(JX)*AI BIR(J)=BIR(J)+BX(JX)*AR BII(J)=BII(J)+BX(JX)*AI CIR(J)=CIR(J)+CX(JX)*AR 2 CII(J)=CII(J)+CX(JX)*AI IF (NQDS.EQ.0) GO TO 4 DO 3 IS=1,NQDS I=IQDS(IS) JX=ICON1(I) ICON1(I)=0 CALL TBF (I,0) ICON1(I)=JX SH=SI(I)*.5 CURD=CCJ*VQDS(IS)/((LOG(2.*SH/BI(I))-1.)*(BX(JSNO)*COS(TP*SH)+CX( 1JSNO)*SIN(TP*SH))*WLAM) AR=DREAL(CURD) AI=DIMAG(CURD) DO 3 JX=1,JSNO J=JCO(JX) AIR(J)=AIR(J)+AX(JX)*AR AII(J)=AII(J)+AX(JX)*AI BIR(J)=BIR(J)+BX(JX)*AR BII(J)=BII(J)+BX(JX)*AI CIR(J)=CIR(J)+CX(JX)*AR 3 CII(J)=CII(J)+CX(JX)*AI 4 DO 5 I=1,N 5 CURX(I)=DCMPLX(AIR(I)+CIR(I),AII(I)+CII(I)) 6 IF (M.EQ.0) RETURN C CONVERT SURFACE CURRENTS FROM T1,T2 COMPONENTS TO X,Y,Z COMPONENTS K=LD-M JCO1=N+2*M+1 JCO2=JCO1+M DO 7 I=1,M K=K+1 JCO1=JCO1-2 JCO2=JCO2-3 CS1=CURX(JCO1) CS2=CURX(JCO1+1) CURX(JCO2)=CS1*T1X(K)+CS2*T2X(K) CURX(JCO2+1)=CS1*T1Y(K)+CS2*T2Y(K) 7 CURX(JCO2+2)=CS1*T1Z(K)+CS2*T2Z(K) RETURN END FUNCTION CANG (Z) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C CANG RETURNS THE PHASE ANGLE OF A COMPLEX NUMBER IN DEGREES. C COMPLEX*16 Z CANG=ATGN2(DIMAG(Z),DREAL(Z))*57.29577951D+0 RETURN END SUBROUTINE CMNGF (CB,CC,CD,NB,NC,ND,RKHX,IEXKX) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C CMNGF FILLS INTERACTION MATRICIES B, C, AND D FOR N.G.F. SOLUTION COMPLEX*16 CB,CC,CD,ZARRAY,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION CB(NB,1), CC(NC,1), CD(ND,1) RKH=RKHX IEXK=IEXKX M1EQ=2*M1 M2EQ=M1EQ+1 MEQ=2*M NEQP=ND-NPCON*2 NEQS=NEQP-NSCON NEQSP=NEQS+NC NEQN=NC+N-N1 ITX=1 IF (NSCON.GT.0) ITX=2 IF (ICASX.EQ.1) GO TO 1 REWIND 12 REWIND 14 REWIND 15 IF (ICASX.GT.2) GO TO 5 1 DO 4 J=1,ND DO 2 I=1,ND 2 CD(I,J)=(0.,0.) DO 3 I=1,NB CB(I,J)=(0.,0.) 3 CC(I,J)=(0.,0.) 4 CONTINUE 5 IST=N-N1+1 IT=NPBX ISV=-NPBX C LOOP THRU 24 FILLS B. FOR ICASX=1 OR 2 ALSO FILLS D(WW), D(WS) DO 24 IBLK=1,NBBX ISV=ISV+NPBX IF (IBLK.EQ.NBBX) IT=NLBX IF (ICASX.LT.3) GO TO 7 DO 6 J=1,ND DO 6 I=1,IT 6 CB(I,J)=(0.,0.) 7 I1=ISV+1 I2=ISV+IT IN2=I2 IF (IN2.GT.N1) IN2=N1 IM1=I1-N1 IM2=I2-N1 IF (IM1.LT.1) IM1=1 IMX=1 IF (I1.LE.N1) IMX=N1-I1+2 IF (N2.GT.N) GO TO 12 C FILL B(WW),B(WS). FOR ICASX=1,2 FILL D(WW),D(WS) DO 11 J=N2,N CALL TRIO (J) DO 9 I=1,JSNO JSS=JCO(I) IF (JSS.LT.N2) GO TO 8 C SET JCO WHEN SOURCE IS NEW BASIS FUNCTION ON NEW SEGMENT JCO(I)=JSS-N1 GO TO 9 C SOURCE IS PORTION OF MODIFIED BASIS FUNCTION ON NEW SEGMENT 8 JCO(I)=NEQS+ICONX(JSS) 9 CONTINUE IF (I1.LE.IN2) CALL CMWW (J,I1,IN2,CB,NB,CB,NB,0) IF (IM1.LE.IM2) CALL CMWS (J,IM1,IM2,CB(IMX,1),NB,CB,NB,0) IF (ICASX.GT.2) GO TO 11 CALL CMWW (J,N2,N,CD,ND,CD,ND,1) IF (M2.LE.M) CALL CMWS (J,M2EQ,MEQ,CD(1,IST),ND,CD,ND,1) C LOADING IN D(WW) IF (NLOAD.EQ.0) GO TO 11 IR=J-N1 EXK=ZARRAY(J) DO 10 I=1,JSNO JSS=JCO(I) 10 CD(JSS,IR)=CD(JSS,IR)-(AX(I)+CX(I))*EXK 11 CONTINUE 12 IF (NSCON.EQ.0) GO TO 20 C FILL B(WW)PRIME DO 19 I=1,NSCON J=ISCON(I) C SOURCES ARE NEW OR MODIFIED BASIS FUNCTIONS ON OLD SEGMENTS WHICH C CONNECT TO NEW SEGMENTS CALL TRIO (J) JSS=0 DO 15 IX=1,JSNO IR=JCO(IX) IF (IR.LT.N2) GO TO 13 IR=IR-N1 GO TO 14 13 IR=ICONX(IR) IF (IR.EQ.0) GO TO 15 IR=NEQS+IR 14 JSS=JSS+1 JCO(JSS)=IR AX(JSS)=AX(IX) BX(JSS)=BX(IX) CX(JSS)=CX(IX) 15 CONTINUE JSNO=JSS IF (I1.LE.IN2) CALL CMWW (J,I1,IN2,CB,NB,CB,NB,0) IF (IM1.LE.IM2) CALL CMWS (J,IM1,IM2,CB(IMX,1),NB,CB,NB,0) C SOURCE IS SINGULAR COMPONENT OF PATCH CURRENT THAT IS PART OF C MODIFIED BASIS FUNCTION FOR OLD SEGMENT THAT CONNECTS TO A NEW C SEGMENT ON END OPPOSITE PATCH. IF (I1.LE.IN2) CALL CMSW (J,I,I1,IN2,CB,CB,0,NB,-1) IF (NLODF.EQ.0) GO TO 17 JX=J-ISV IF (JX.LT.1.OR.JX.GT.IT) GO TO 17 EXK=ZARRAY(J) DO 16 IX=1,JSNO JSS=JCO(IX) 16 CB(JX,JSS)=CB(JX,JSS)-(AX(IX)+CX(IX))*EXK C SOURCES ARE PORTIONS OF MODIFIED BASIS FUNCTION J ON OLD SEGMENTS C EXCLUDING OLD SEGMENTS THAT DIRECTLY CONNECT TO NEW SEGMENTS. 17 CALL TBF (J,1) JSX=JSNO JSNO=1 IR=JCO(1) JCO(1)=NEQS+I DO 19 IX=1,JSX IF (IX.EQ.1) GO TO 18 IR=JCO(IX) AX(1)=AX(IX) BX(1)=BX(IX) CX(1)=CX(IX) 18 IF (IR.GT.N1) GO TO 19 IF (ICONX(IR).NE.0) GO TO 19 IF (I1.LE.IN2) CALL CMWW (IR,I1,IN2,CB,NB,CB,NB,0) IF (IM1.LE.IM2) CALL CMWS (IR,IM1,IM2,CB(IMX,1),NB,CB,NB,0) C LOADING FOR B(WW)PRIME IF (NLODF.EQ.0) GO TO 19 JX=IR-ISV IF (JX.LT.1.OR.JX.GT.IT) GO TO 19 EXK=ZARRAY(IR) JSS=JCO(1) CB(JX,JSS)=CB(JX,JSS)-(AX(1)+CX(1))*EXK 19 CONTINUE 20 IF (NPCON.EQ.0) GO TO 22 JSS=NEQP C FILL B(SS)PRIME TO SET OLD PATCH BASIS FUNCTIONS TO ZERO FOR C PATCHES THAT CONNECT TO NEW SEGMENTS DO 21 I=1,NPCON IX=IPCON(I)*2+N1-ISV IR=IX-1 JSS=JSS+1 IF (IR.GT.0.AND.IR.LE.IT) CB(IR,JSS)=(1.,0.) JSS=JSS+1 IF (IX.GT.0.AND.IX.LE.IT) CB(IX,JSS)=(1.,0.) 21 CONTINUE 22 IF (M2.GT.M) GO TO 23 C FILL B(SW) AND B(SS) IF (I1.LE.IN2) CALL CMSW (M2,M,I1,IN2,CB(1,IST),CB,N1,NB,0) IF (IM1.LE.IM2) CALL CMSS (M2,M,IM1,IM2,CB(IMX,IST),NB,0) 23 IF (ICASX.EQ.1) GO TO 24 WRITE (14) ((CB(I,J),I=1,IT),J=1,ND) 24 CONTINUE C FILLING B COMPLETE. START ON C AND D IT=NPBL ISV=-NPBL DO 43 IBLK=1,NBBL ISV=ISV+NPBL ISVV=ISV+NC IF (IBLK.EQ.NBBL) IT=NLBL IF (ICASX.LT.3) GO TO 27 DO 26 J=1,IT DO 25 I=1,NC 25 CC(I,J)=(0.,0.) DO 26 I=1,ND 26 CD(I,J)=(0.,0.) 27 I1=ISVV+1 I2=ISVV+IT IN1=I1-M1EQ IN2=I2-M1EQ IF (IN2.GT.N) IN2=N IM1=I1-N IM2=I2-N IF (IM1.LT.M2EQ) IM1=M2EQ IF (IM2.GT.MEQ) IM2=MEQ IMX=1 IF (IN1.LE.IN2) IMX=NEQN-I1+2 IF (ICASX.LT.3) GO TO 32 IF (N2.GT.N) GO TO 32 C SAME AS DO 24 LOOP TO FILL D(WW) FOR ICASX GREATER THAN 2 DO 31 J=N2,N CALL TRIO (J) DO 29 I=1,JSNO JSS=JCO(I) IF (JSS.LT.N2) GO TO 28 JCO(I)=JSS-N1 GO TO 29 28 JCO(I)=NEQS+ICONX(JSS) 29 CONTINUE IF (IN1.LE.IN2) CALL CMWW (J,IN1,IN2,CD,ND,CD,ND,1) IF (IM1.LE.IM2) CALL CMWS (J,IM1,IM2,CD(1,IMX),ND,CD,ND,1) IF (NLOAD.EQ.0) GO TO 31 IR=J-N1-ISV IF (IR.LT.1.OR.IR.GT.IT) GO TO 31 EXK=ZARRAY(J) DO 30 I=1,JSNO JSS=JCO(I) 30 CD(JSS,IR)=CD(JSS,IR)-(AX(I)+CX(I))*EXK 31 CONTINUE 32 IF (M2.GT.M) GO TO 33 C FILL D(SW) AND D(SS) IF (IN1.LE.IN2) CALL CMSW (M2,M,IN1,IN2,CD(IST,1),CD,N1,ND,1) IF (IM1.LE.IM2) CALL CMSS (M2,M,IM1,IM2,CD(IST,IMX),ND,1) 33 IF (N1.LT.1) GO TO 39 C FILL C(WW),C(WS), D(WW)PRIME, AND D(WS)PRIME. DO 37 J=1,N1 CALL TRIO (J) IF (NSCON.EQ.0) GO TO 36 DO 35 IX=1,JSNO JSS=JCO(IX) IF (JSS.LT.N2) GO TO 34 JCO(IX)=JSS+M1EQ GO TO 35 34 IR=ICONX(JSS) IF (IR.NE.0) JCO(IX)=NEQSP+IR 35 CONTINUE 36 IF (IN1.LE.IN2) CALL CMWW (J,IN1,IN2,CC,NC,CD,ND,ITX) IF (IM1.LE.IM2) CALL CMWS (J,IM1,IM2,CC(1,IMX),NC,CD(1,IMX),ND,ITX 1) 37 CONTINUE IF (NSCON.EQ.0) GO TO 39 C FILL C(WW)PRIME DO 38 IX=1,NSCON IR=ISCON(IX) JSS=NEQS+IX-ISV IF (JSS.GT.0.AND.JSS.LE.IT) CC(IR,JSS)=(1.,0.) 38 CONTINUE 39 IF (NPCON.EQ.0) GO TO 41 JSS=NEQP-ISV C FILL C(SS)PRIME DO 40 I=1,NPCON IX=IPCON(I)*2+N1 IR=IX-1 JSS=JSS+1 IF (JSS.GT.0.AND.JSS.LE.IT) CC(IR,JSS)=(1.,0.) JSS=JSS+1 IF (JSS.GT.0.AND.JSS.LE.IT) CC(IX,JSS)=(1.,0.) 40 CONTINUE 41 IF (M1.LT.1) GO TO 42 C FILL C(SW) AND C(SS) IF (IN1.LE.IN2) CALL CMSW (1,M1,IN1,IN2,CC(N2,1),CC,0,NC,1) IF (IM1.LE.IM2) CALL CMSS (1,M1,IM1,IM2,CC(N2,IMX),NC,1) 42 CONTINUE IF (ICASX.EQ.1) GO TO 43 WRITE (12) ((CD(J,I),J=1,ND),I=1,IT) WRITE (15) ((CC(J,I),J=1,NC),I=1,IT) 43 CONTINUE IF(ICASX.EQ.1)RETURN REWIND 12 REWIND 14 REWIND 15 RETURN END SUBROUTINE CMSET (NROW,CM,RKHX,IEXKX) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C CMSET SETS UP THE COMPLEX STRUCTURE MATRIX IN THE ARRAY CM C COMPLEX*16 CM,ZARRAY,ZAJ,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC,SSX, &D,DETER COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SMAT/ SSX(16,16) COMMON /SCRATM/ D(2*MAXSEG) COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION CM(NROW,1) MP2=2*MP NPEQ=NP+MP2 NEQ=N+2*M NOP=NEQ/NPEQ IF (ICASE.GT.2) REWIND 11 RKH=RKHX IEXK=IEXKX IOUT=2*NPBLK*NROW IT=NPBLK C C CYCLE OVER MATRIX BLOCKS C DO 13 IXBLK1=1,NBLOKS ISV=(IXBLK1-1)*NPBLK IF (IXBLK1.EQ.NBLOKS) IT=NLAST DO 1 I=1,NROW DO 1 J=1,IT 1 CM(I,J)=(0.,0.) I1=ISV+1 I2=ISV+IT IN2=I2 IF (IN2.GT.NP) IN2=NP IM1=I1-NP IM2=I2-NP IF (IM1.LT.1) IM1=1 IST=1 IF (I1.LE.NP) IST=NP-I1+2 IF (N.EQ.0) GO TO 5 C C WIRE SOURCE LOOP C DO 4 J=1,N CALL TRIO (J) DO 2 I=1,JSNO IJ=JCO(I) 2 JCO(I)=((IJ-1)/NP)*MP2+IJ IF (I1.LE.IN2) CALL CMWW (J,I1,IN2,CM,NROW,CM,NROW,1) IF (IM1.LE.IM2) CALL CMWS (J,IM1,IM2,CM(1,IST),NROW,CM,NROW,1) IF (NLOAD.EQ.0) GO TO 4 C C MATRIX ELEMENTS MODIFIED BY LOADING C IF (J.GT.NP) GO TO 4 IPR=J-ISV IF (IPR.LT.1.OR.IPR.GT.IT) GO TO 4 ZAJ=ZARRAY(J) DO 3 I=1,JSNO JSS=JCO(I) 3 CM(JSS,IPR)=CM(JSS,IPR)-(AX(I)+CX(I))*ZAJ 4 CONTINUE 5 IF (M.EQ.0) GO TO 7 C MATRIX ELEMENTS FOR PATCH CURRENT SOURCES JM1=1-MP JM2=0 JST=1-MP2 DO 6 I=1,NOP JM1=JM1+MP JM2=JM2+MP JST=JST+NPEQ IF (I1.LE.IN2) CALL CMSW (JM1,JM2,I1,IN2,CM(JST,1),CM,0,NROW,1) IF (IM1.LE.IM2) CALL CMSS (JM1,JM2,IM1,IM2,CM(JST,IST),NROW,1) 6 CONTINUE 7 IF (ICASE.EQ.1) GO TO 13 IF (ICASE.EQ.3) GO TO 12 C COMBINE ELEMENTS FOR SYMMETRY MODES DO 11 I=1,IT DO 11 J=1,NPEQ DO 8 K=1,NOP KA=J+(K-1)*NPEQ 8 D(K)=CM(KA,I) DETER=D(1) DO 9 KK=2,NOP 9 DETER=DETER+D(KK) CM(J,I)=DETER DO 11 K=2,NOP KA=J+(K-1)*NPEQ DETER=D(1) DO 10 KK=2,NOP 10 DETER=DETER+D(KK)*SSX(K,KK) CM(KA,I)=DETER 11 CONTINUE IF (ICASE.LT.3) GO TO 13 C WRITE BLOCK FOR OUT-OF-CORE CASES. 12 CALL BLCKOT (CM,11,1,IOUT,1,31) 13 CONTINUE IF (ICASE.GT.2) REWIND 11 RETURN END SUBROUTINE CMSS (J1,J2,IM1,IM2,CM,NROW,ITRP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C CMSS COMPUTES MATRIX ELEMENTS FOR SURFACE-SURFACE INTERACTIONS. COMPLEX*16 G11,G12,G21,G22,CM,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION CM(NROW,1) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) LDP=LD+1 I1=(IM1+1)/2 I2=(IM2+1)/2 ICOMP=I1*2-3 II1=-1 IF (ICOMP+2.LT.IM1) II1=-2 C LOOP OVER OBSERVATION PATCHES DO 5 I=I1,I2 IL=LDP-I ICOMP=ICOMP+2 II1=II1+2 II2=II1+1 T1XI=T1X(IL)*SALP(IL) T1YI=T1Y(IL)*SALP(IL) T1ZI=T1Z(IL)*SALP(IL) T2XI=T2X(IL)*SALP(IL) T2YI=T2Y(IL)*SALP(IL) T2ZI=T2Z(IL)*SALP(IL) XI=X(IL) YI=Y(IL) ZI=Z(IL) JJ1=-1 C LOOP OVER SOURCE PATCHES DO 5 J=J1,J2 JL=LDP-J JJ1=JJ1+2 JJ2=JJ1+1 S=BI(JL) XJ=X(JL) YJ=Y(JL) ZJ=Z(JL) T1XJ=T1X(JL) T1YJ=T1Y(JL) T1ZJ=T1Z(JL) T2XJ=T2X(JL) T2YJ=T2Y(JL) T2ZJ=T2Z(JL) CALL HINTG (XI,YI,ZI) G11=-(T2XI*EXK+T2YI*EYK+T2ZI*EZK) G12=-(T2XI*EXS+T2YI*EYS+T2ZI*EZS) G21=-(T1XI*EXK+T1YI*EYK+T1ZI*EZK) G22=-(T1XI*EXS+T1YI*EYS+T1ZI*EZS) IF (I.NE.J) GO TO 1 G11=G11-.5 G22=G22+.5 1 IF (ITRP.NE.0) GO TO 3 C NORMAL FILL IF (ICOMP.LT.IM1) GO TO 2 CM(II1,JJ1)=G11 CM(II1,JJ2)=G12 2 IF (ICOMP.GE.IM2) GO TO 5 CM(II2,JJ1)=G21 CM(II2,JJ2)=G22 GO TO 5 C TRANSPOSED FILL 3 IF (ICOMP.LT.IM1) GO TO 4 CM(JJ1,II1)=G11 CM(JJ2,II1)=G12 4 IF (ICOMP.GE.IM2) GO TO 5 CM(JJ1,II2)=G21 CM(JJ2,II2)=G22 5 CONTINUE RETURN END SUBROUTINE CMSW (J1,J2,I1,I2,CM,CW,NCW,NROW,ITRP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTES MATRIX ELEMENTS FOR E ALONG WIRES DUE TO PATCH CURRENT COMPLEX*16 CM,ZRATI,ZRATI2,T1,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC 1,EMEL,CW,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON DIMENSION CAB(1), SAB(1), CM(NROW,1), CW(NROW,1) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1), EMEL(9) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG), (CAB,ALP), (SAB,BET) EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) DATA PI/3.141592654D+0/ LDP=LD+1 NEQS=N-N1+2*(M-M1) IF (ITRP.LT.0) GO TO 13 K=0 ICGO=1 C OBSERVATION LOOP DO 12 I=I1,I2 K=K+1 XI=X(I) YI=Y(I) ZI=Z(I) CABI=CAB(I) SABI=SAB(I) SALPI=SALP(I) IPCH=0 IF (ICON1(I).LT.10000) GO TO 1 IPCH=ICON1(I)-10000 FSIGN=-1. 1 IF (ICON2(I).LT.10000) GO TO 2 IPCH=ICON2(I)-10000 FSIGN=1. 2 JL=0 C SOURCE LOOP DO 12 J=J1,J2 JS=LDP-J JL=JL+2 T1XJ=T1X(JS) T1YJ=T1Y(JS) T1ZJ=T1Z(JS) T2XJ=T2X(JS) T2YJ=T2Y(JS) T2ZJ=T2Z(JS) XJ=X(JS) YJ=Y(JS) ZJ=Z(JS) S=BI(JS) C GROUND LOOP DO 12 IP=1,KSYMP IPGND=IP IF (IPCH.NE.J.AND.ICGO.EQ.1) GO TO 9 IF (IP.EQ.2) GO TO 9 IF (ICGO.GT.1) GO TO 6 CALL PCINT (XI,YI,ZI,CABI,SABI,SALPI,EMEL) PY=PI*SI(I)*FSIGN PX=SIN(PY) PY=COS(PY) EXC=EMEL(9)*FSIGN CALL TRIO (I) IF (I.GT.N1) GO TO 3 IL=NEQS+ICONX(I) GO TO 4 3 IL=I-NCW IF (I.LE.NP) IL=((IL-1)/NP)*2*MP+IL 4 IF (ITRP.NE.0) GO TO 5 CW(K,IL)=CW(K,IL)+EXC*(AX(JSNO)+BX(JSNO)*PX+CX(JSNO)*PY) GO TO 6 5 CW(IL,K)=CW(IL,K)+EXC*(AX(JSNO)+BX(JSNO)*PX+CX(JSNO)*PY) 6 IF (ITRP.NE.0) GO TO 7 CM(K,JL-1)=EMEL(ICGO) CM(K,JL)=EMEL(ICGO+4) GO TO 8 7 CM(JL-1,K)=EMEL(ICGO) CM(JL,K)=EMEL(ICGO+4) 8 ICGO=ICGO+1 IF (ICGO.EQ.5) ICGO=1 GO TO 11 9 CALL UNERE (XI,YI,ZI) IF (ITRP.NE.0) GO TO 10 C NORMAL FILL CM(K,JL-1)=CM(K,JL-1)+EXK*CABI+EYK*SABI+EZK*SALPI CM(K,JL)=CM(K,JL)+EXS*CABI+EYS*SABI+EZS*SALPI GO TO 11 C TRANSPOSED FILL 10 CM(JL-1,K)=CM(JL-1,K)+EXK*CABI+EYK*SABI+EZK*SALPI CM(JL,K)=CM(JL,K)+EXS*CABI+EYS*SABI+EZS*SALPI 11 CONTINUE 12 CONTINUE RETURN C FOR OLD SEG. CONNECTING TO OLD PATCH ON ONE END AND NEW SEG. ON C OTHER END INTEGRATE SINGULAR COMPONENT (9) OF SURFACE CURRENT ONLY 13 IF (J1.LT.I1.OR.J1.GT.I2) GO TO 16 IPCH=ICON1(J1) IF (IPCH.LT.10000) GO TO 14 IPCH=IPCH-10000 FSIGN=-1. GO TO 15 14 IPCH=ICON2(J1) IF (IPCH.LT.10000) GO TO 16 IPCH=IPCH-10000 FSIGN=1. 15 IF (IPCH.GT.M1) GO TO 16 JS=LDP-IPCH IPGND=1 T1XJ=T1X(JS) T1YJ=T1Y(JS) T1ZJ=T1Z(JS) T2XJ=T2X(JS) T2YJ=T2Y(JS) T2ZJ=T2Z(JS) XJ=X(JS) YJ=Y(JS) ZJ=Z(JS) S=BI(JS) XI=X(J1) YI=Y(J1) ZI=Z(J1) CABI=CAB(J1) SABI=SAB(J1) SALPI=SALP(J1) CALL PCINT (XI,YI,ZI,CABI,SABI,SALPI,EMEL) PY=PI*SI(J1)*FSIGN PX=SIN(PY) PY=COS(PY) EXC=EMEL(9)*FSIGN IL=JCO(JSNO) K=J1-I1+1 CW(K,IL)=CW(K,IL)+EXC*(AX(JSNO)+BX(JSNO)*PX+CX(JSNO)*PY) 16 RETURN END SUBROUTINE CMWS (J,I1,I2,CM,NR,CW,NW,ITRP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C CMWS COMPUTES MATRIX ELEMENTS FOR WIRE-SURFACE INTERACTIONS C COMPLEX*16 CM,CW,ETK,ETS,ETC,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION CM(NR,1), CW(NW,1), CAB(1), SAB(1) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) EQUIVALENCE (CAB,ALP), (SAB,BET), (T1X,SI), (T1Y,ALP), (T1Z,BET) EQUIVALENCE (T2X,ICON1), (T2Y,ICON2), (T2Z,ITAG) LDP=LD+1 S=SI(J) B=BI(J) XJ=X(J) YJ=Y(J) ZJ=Z(J) CABJ=CAB(J) SABJ=SAB(J) SALPJ=SALP(J) C C OBSERVATION LOOP C IPR=0 DO 9 I=I1,I2 IPR=IPR+1 IPATCH=(I+1)/2 IK=I-(I/2)*2 IF (IK.EQ.0.AND.IPR.NE.1) GO TO 1 JS=LDP-IPATCH XI=X(JS) YI=Y(JS) ZI=Z(JS) CALL HSFLD (XI,YI,ZI,0.D0) IF (IK.EQ.0) GO TO 1 TX=T2X(JS) TY=T2Y(JS) TZ=T2Z(JS) GO TO 2 1 TX=T1X(JS) TY=T1Y(JS) TZ=T1Z(JS) 2 ETK=-(EXK*TX+EYK*TY+EZK*TZ)*SALP(JS) ETS=-(EXS*TX+EYS*TY+EZS*TZ)*SALP(JS) ETC=-(EXC*TX+EYC*TY+EZC*TZ)*SALP(JS) C C FILL MATRIX ELEMENTS. ELEMENT LOCATIONS DETERMINED BY CONNECTION C DATA. C IF (ITRP.NE.0) GO TO 4 C NORMAL FILL DO 3 IJ=1,JSNO JX=JCO(IJ) 3 CM(IPR,JX)=CM(IPR,JX)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 9 4 IF (ITRP.EQ.2) GO TO 6 C TRANSPOSED FILL DO 5 IJ=1,JSNO JX=JCO(IJ) 5 CM(JX,IPR)=CM(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 9 C TRANSPOSED FILL - C(WS) AND D(WS)PRIME (=CW) 6 DO 8 IJ=1,JSNO JX=JCO(IJ) IF (JX.GT.NR) GO TO 7 CM(JX,IPR)=CM(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 8 7 JX=JX-NR CW(JX,IPR)=CW(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) 8 CONTINUE 9 CONTINUE RETURN END SUBROUTINE CMWW (J,I1,I2,CM,NR,CW,NW,ITRP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C CMWW COMPUTES MATRIX ELEMENTS FOR WIRE-WIRE INTERACTIONS C COMPLEX*16 CM,CW,ETK,ETS,ETC,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION CM(NR,1), CW(NW,1), CAB(1), SAB(1) EQUIVALENCE (CAB,ALP), (SAB,BET) C SET SOURCE SEGMENT PARAMETERS S=SI(J) B=BI(J) XJ=X(J) YJ=Y(J) ZJ=Z(J) CABJ=CAB(J) SABJ=SAB(J) SALPJ=SALP(J) IF (IEXK.EQ.0) GO TO 16 C DECIDE WETHER EXT. T.W. APPROX. CAN BE USED IPR=ICON1(J) IF(IPR.GT.10000)GO TO 5 IF (IPR) 1,6,2 1 IPR=-IPR IF (-ICON1(IPR).NE.J) GO TO 7 GO TO 4 2 IF (IPR.NE.J) GO TO 3 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 7 GO TO 5 3 IF (ICON2(IPR).NE.J) GO TO 7 4 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 7 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 7 5 IND1=0 GO TO 8 6 IND1=1 GO TO 8 7 IND1=2 8 IPR=ICON2(J) IF(IPR.GT.10000)GO TO 15 IF (IPR) 9,14,10 9 IPR=-IPR IF (-ICON2(IPR).NE.J) GO TO 15 GO TO 12 10 IF (IPR.NE.J) GO TO 11 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 15 GO TO 13 11 IF (ICON1(IPR).NE.J) GO TO 15 12 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 15 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 15 13 IND2=0 GO TO 16 14 IND2=1 GO TO 16 15 IND2=2 16 CONTINUE C C OBSERVATION LOOP C IPR=0 DO 23 I=I1,I2 IPR=IPR+1 IJ=I-J XI=X(I) YI=Y(I) ZI=Z(I) AI=BI(I) CABI=CAB(I) SABI=SAB(I) SALPI=SALP(I) CALL EFLD (XI,YI,ZI,AI,IJ) ETK=EXK*CABI+EYK*SABI+EZK*SALPI ETS=EXS*CABI+EYS*SABI+EZS*SALPI ETC=EXC*CABI+EYC*SABI+EZC*SALPI C C FILL MATRIX ELEMENTS. ELEMENT LOCATIONS DETERMINED BY CONNECTION C DATA. C IF (ITRP.NE.0) GO TO 18 C NORMAL FILL DO 17 IJ=1,JSNO JX=JCO(IJ) 17 CM(IPR,JX)=CM(IPR,JX)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 23 18 IF (ITRP.EQ.2) GO TO 20 C TRANSPOSED FILL DO 19 IJ=1,JSNO JX=JCO(IJ) 19 CM(JX,IPR)=CM(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 23 C TRANS. FILL FOR C(WW) - TEST FOR ELEMENTS FOR D(WW)PRIME. (=CW) 20 DO 22 IJ=1,JSNO JX=JCO(IJ) IF (JX.GT.NR) GO TO 21 CM(JX,IPR)=CM(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) GO TO 22 21 JX=JX-NR CW(JX,IPR)=CW(JX,IPR)+ETK*AX(IJ)+ETS*BX(IJ)+ETC*CX(IJ) 22 CONTINUE 23 CONTINUE RETURN END SUBROUTINE CONECT (IGND) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C CONNECT SETS UP SEGMENT CONNECTION DATA IN ARRAYS ICON1 AND ICON2 C BY SEARCHING FOR SEGMENT ENDS THAT ARE IN CONTACT. C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON DIMENSION X2(1), Y2(1), Z2(1) EQUIVALENCE (X2,SI), (Y2,ALP), (Z2,BET) DATA JMAX/30/,SMIN/1.D-3/,NSMAX/50/,NPMAX/10/ NSCON=0 NPCON=0 IF (IGND.EQ.0) GO TO 3 WRITE(3,54) IF (IGND.GT.0) WRITE(3,55) IF (IPSYM.NE.2) GO TO 1 NP=2*NP MP=2*MP 1 IF (IABS(IPSYM).LE.2) GO TO 2 NP=N MP=M 2 IF (NP.GT.N) STOP IF (NP.EQ.N.AND.MP.EQ.M) IPSYM=0 3 IF (N.EQ.0) GO TO 26 DO 15 I=1,N ICONX(I)=0 XI1=X(I) YI1=Y(I) ZI1=Z(I) XI2=X2(I) YI2=Y2(I) ZI2=Z2(I) SLEN=SQRT((XI2-XI1)**2+(YI2-YI1)**2+(ZI2-ZI1)**2)*SMIN C C DETERMINE CONNECTION DATA FOR END 1 OF SEGMENT. C IF (IGND.LT.1) GO TO 5 IF (ZI1.GT.-SLEN) GO TO 4 WRITE(3,56) I STOP 4 IF (ZI1.GT.SLEN) GO TO 5 ICON1(I)=I Z(I)=0. GO TO 9 5 IC=I DO 7 J=2,N IC=IC+1 IF (IC.GT.N) IC=1 SEP=ABS(XI1-X(IC))+ABS(YI1-Y(IC))+ABS(ZI1-Z(IC)) IF (SEP.GT.SLEN) GO TO 6 ICON1(I)=-IC GO TO 8 6 SEP=ABS(XI1-X2(IC))+ABS(YI1-Y2(IC))+ABS(ZI1-Z2(IC)) IF (SEP.GT.SLEN) GO TO 7 ICON1(I)=IC GO TO 8 7 CONTINUE IF (I.LT.N2.AND.ICON1(I).GT.10000) GO TO 8 ICON1(I)=0 C C DETERMINE CONNECTION DATA FOR END 2 OF SEGMENT. C 8 IF (IGND.LT.1) GO TO 12 9 IF (ZI2.GT.-SLEN) GO TO 10 WRITE(3,56) I STOP 10 IF (ZI2.GT.SLEN) GO TO 12 IF (ICON1(I).NE.I) GO TO 11 WRITE(3,57) I STOP 11 ICON2(I)=I Z2(I)=0. GO TO 15 12 IC=I DO 14 J=2,N IC=IC+1 IF (IC.GT.N) IC=1 SEP=ABS(XI2-X(IC))+ABS(YI2-Y(IC))+ABS(ZI2-Z(IC)) IF (SEP.GT.SLEN) GO TO 13 ICON2(I)=IC GO TO 15 13 SEP=ABS(XI2-X2(IC))+ABS(YI2-Y2(IC))+ABS(ZI2-Z2(IC)) IF (SEP.GT.SLEN) GO TO 14 ICON2(I)=-IC GO TO 15 14 CONTINUE IF (I.LT.N2.AND.ICON2(I).GT.10000) GO TO 15 ICON2(I)=0 15 CONTINUE IF (M.EQ.0) GO TO 26 C FIND WIRE-SURFACE CONNECTIONS FOR NEW PATCHES IX=LD+1-M1 I=M2 16 IF (I.GT.M) GO TO 20 IX=IX-1 XS=X(IX) YS=Y(IX) ZS=Z(IX) DO 18 ISEG=1,N XI1=X(ISEG) YI1=Y(ISEG) ZI1=Z(ISEG) XI2=X2(ISEG) YI2=Y2(ISEG) ZI2=Z2(ISEG) SLEN=(ABS(XI2-XI1)+ABS(YI2-YI1)+ABS(ZI2-ZI1))*SMIN C FOR FIRST END OF SEGMENT SEP=ABS(XI1-XS)+ABS(YI1-YS)+ABS(ZI1-ZS) IF (SEP.GT.SLEN) GO TO 17 C CONNECTION - DIVIDE PATCH INTO 4 PATCHES AT PRESENT ARRAY LOC. ICON1(ISEG)=10000+I IC=0 CALL SUBPH (I,IC,XI1,YI1,ZI1,XI2,YI2,ZI2,XA,YA,ZA,XS,YS,ZS) GO TO 19 17 SEP=ABS(XI2-XS)+ABS(YI2-YS)+ABS(ZI2-ZS) IF (SEP.GT.SLEN) GO TO 18 ICON2(ISEG)=10000+I IC=0 CALL SUBPH (I,IC,XI1,YI1,ZI1,XI2,YI2,ZI2,XA,YA,ZA,XS,YS,ZS) GO TO 19 18 CONTINUE 19 I=I+1 GO TO 16 C REPEAT SEARCH FOR NEW SEGMENTS CONNECTED TO NGF PATCHES. 20 IF (M1.EQ.0.OR.N2.GT.N) GO TO 26 IX=LD+1 I=1 21 IF (I.GT.M1) GO TO 25 IX=IX-1 XS=X(IX) YS=Y(IX) ZS=Z(IX) DO 23 ISEG=N2,N XI1=X(ISEG) YI1=Y(ISEG) ZI1=Z(ISEG) XI2=X2(ISEG) YI2=Y2(ISEG) ZI2=Z2(ISEG) SLEN=(ABS(XI2-XI1)+ABS(YI2-YI1)+ABS(ZI2-ZI1))*SMIN SEP=ABS(XI1-XS)+ABS(YI1-YS)+ABS(ZI1-ZS) IF (SEP.GT.SLEN) GO TO 22 ICON1(ISEG)=10001+M IC=1 NPCON=NPCON+1 IPCON(NPCON)=I CALL SUBPH (I,IC,XI1,YI1,ZI1,XI2,YI2,ZI2,XA,YA,ZA,XS,YS,ZS) GO TO 24 22 SEP=ABS(XI2-XS)+ABS(YI2-YS)+ABS(ZI2-ZS) IF (SEP.GT.SLEN) GO TO 23 ICON2(ISEG)=10001+M IC=1 NPCON=NPCON+1 IPCON(NPCON)=I CALL SUBPH (I,IC,XI1,YI1,ZI1,XI2,YI2,ZI2,XA,YA,ZA,XS,YS,ZS) GO TO 24 23 CONTINUE 24 I=I+1 GO TO 21 25 IF (NPCON.LE.NPMAX) GO TO 26 WRITE(3,62) NPMAX STOP 26 WRITE(3,58) N,NP,IPSYM IF (M.GT.0) WRITE(3,61) M,MP ISEG=(N+M)/(NP+MP) IF (ISEG.EQ.1) GO TO 30 IF (IPSYM) 28,27,29 27 STOP 28 WRITE(3,59) ISEG GO TO 30 29 IC=ISEG/2 IF (ISEG.EQ.8) IC=3 WRITE(3,60) IC 30 IF (N.EQ.0) GO TO 48 WRITE(3,50) ISEG=0 C ADJUST CONNECTED SEG. ENDS TO EXACTLY COINCIDE. PRINT JUNCTIONS C OF 3 OR MORE SEG. ALSO FIND OLD SEG. CONNECTING TO NEW SEG. DO 44 J=1,N IEND=-1 JEND=-1 IX=ICON1(J) IC=1 JCO(1)=-J XA=X(J) YA=Y(J) ZA=Z(J) 31 IF (IX.EQ.0) GO TO 43 IF (IX.EQ.J) GO TO 43 IF (IX.GT.10000) GO TO 43 NSFLG=0 32 IF (IX) 33,49,34 33 IX=-IX GO TO 35 34 JEND=-JEND 35 IF (IX.EQ.J) GO TO 37 IF (IX.LT.J) GO TO 43 IC=IC+1 IF (IC.GT.JMAX) GO TO 49 JCO(IC)=IX*JEND IF (IX.GT.N1) NSFLG=1 IF (JEND.EQ.1) GO TO 36 XA=XA+X(IX) YA=YA+Y(IX) ZA=ZA+Z(IX) IX=ICON1(IX) GO TO 32 36 XA=XA+X2(IX) YA=YA+Y2(IX) ZA=ZA+Z2(IX) IX=ICON2(IX) GO TO 32 37 SEP=IC XA=XA/SEP YA=YA/SEP ZA=ZA/SEP DO 39 I=1,IC IX=JCO(I) IF (IX.GT.0) GO TO 38 IX=-IX X(IX)=XA Y(IX)=YA Z(IX)=ZA GO TO 39 38 X2(IX)=XA Y2(IX)=YA Z2(IX)=ZA 39 CONTINUE IF (N1.EQ.0) GO TO 42 IF (NSFLG.EQ.0) GO TO 42 DO 41 I=1,IC IX=IABS(JCO(I)) IF (IX.GT.N1) GO TO 41 IF (ICONX(IX).NE.0) GO TO 41 NSCON=NSCON+1 IF (NSCON.LE.NSMAX) GO TO 40 WRITE(3,62) NSMAX STOP 40 ISCON(NSCON)=IX ICONX(IX)=NSCON 41 CONTINUE 42 IF (IC.LT.3) GO TO 43 ISEG=ISEG+1 WRITE(3,51) ISEG,(JCO(I),I=1,IC) 43 IF (IEND.EQ.1) GO TO 44 IEND=1 JEND=1 IX=ICON2(J) IC=1 JCO(1)=J XA=X2(J) YA=Y2(J) ZA=Z2(J) GO TO 31 44 CONTINUE IF (ISEG.EQ.0) WRITE(3,52) IF (N1.EQ.0.OR.M1.EQ.M) GO TO 48 C FIND OLD SEGMENTS THAT CONNECT TO NEW PATCHES DO 47 J=1,N1 IX=ICON1(J) IF (IX.LT.10000) GO TO 45 IX=IX-10000 IF (IX.GT.M1) GO TO 46 45 IX=ICON2(J) IF (IX.LT.10000) GO TO 47 IX=IX-10000 IF (IX.LT.M2) GO TO 47 46 IF (ICONX(J).NE.0) GO TO 47 NSCON=NSCON+1 ISCON(NSCON)=J ICONX(J)=NSCON 47 CONTINUE 48 CONTINUE RETURN 49 WRITE(3,53) IX STOP C 50 FORMAT (//,9X,27H- MULTIPLE WIRE JUNCTIONS -,/,1X,8HJUNCTION,4X,36 1HSEGMENTS (- FOR END 1, + FOR END 2)) 51 FORMAT (1X,I5,5X,20I5,/,(11X,20I5)) 52 FORMAT (2X,4HNONE) 53 FORMAT (47H CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT,I5) 54 FORMAT (/,3X,23HGROUND PLANE SPECIFIED.) 55 FORMAT (/,3X,46HWHERE WIRE ENDS TOUCH GROUND, CURRENT WILL BE ,38H 1INTERPOLATED TO IMAGE IN GROUND PLANE.,/) 56 FORMAT (30H GEOMETRY DATA ERROR-- SEGMENT,I5,21H EXTENDS BELOW GRO 1UND) 57 FORMAT (29H GEOMETRY DATA ERROR--SEGMENT,I5,16H LIES IN GROUND ,6H 1PLANE.) 58 FORMAT (/,3X,20HTOTAL SEGMENTS USED=,I5,5X,12HNO. SEG. IN ,17HA SY 1MMETRIC CELL=,I5,5X,14HSYMMETRY FLAG=,I3) 59 FORMAT (14H STRUCTURE HAS,I4,25H FOLD ROTATIONAL SYMMETRY,/) 60 FORMAT (14H STRUCTURE HAS,I2,19H PLANES OF SYMMETRY,/) 61 FORMAT (3X,19HTOTAL PATCHES USED=,I5,6X,32HNO. PATCHES IN A SYMMET 1RIC CELL=,I5) 62 FORMAT (' ERROR - NO. NEW SEGMENTS CONNECTED TO N.G.F. SEGMENTS ', &'OR PATCHES EXCEEDS LIMIT OF',I5) END SUBROUTINE COUPLE (CUR,WLAM) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C COUPLE COMPUTES THE MAXIMUM COUPLING BETWEEN PAIRS OF SEGMENTS. C COMPLEX*16 Y11A,Y12A,CUR,Y11,Y12,Y22,YL,YIN,ZL,ZIN,RHO,VQD,VSANT 1,VQDS COMMON/YPARM/Y11A(5),Y12A(20),NCOUP,ICOUP,NCTAG(5),NCSEG(5) COMMON /VSORC/ VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30),IQDS( 130),NVQD,NSANT,NQDS DIMENSION CUR(1) IF (NSANT.NE.1.OR.NVQD.NE.0) RETURN J=ISEGNO(NCTAG(ICOUP+1),NCSEG(ICOUP+1)) IF (J.NE.ISANT(1)) RETURN ICOUP=ICOUP+1 ZIN=VSANT(1) Y11A(ICOUP)=CUR(J)*WLAM/ZIN L1=(ICOUP-1)*(NCOUP-1) DO 1 I=1,NCOUP IF (I.EQ.ICOUP) GO TO 1 K=ISEGNO(NCTAG(I),NCSEG(I)) L1=L1+1 Y12A(L1)=CUR(K)*WLAM/ZIN 1 CONTINUE IF (ICOUP.LT.NCOUP) RETURN WRITE(3,6) NPM1=NCOUP-1 DO 5 I=1,NPM1 ITT1=NCTAG(I) ITS1=NCSEG(I) ISG1=ISEGNO(ITT1,ITS1) L1=I+1 DO 5 J=L1,NCOUP ITT2=NCTAG(J) ITS2=NCSEG(J) ISG2=ISEGNO(ITT2,ITS2) J1=J+(I-1)*NPM1-1 J2=I+(J-1)*NPM1 Y11=Y11A(I) Y22=Y11A(J) Y12=.5*(Y12A(J1)+Y12A(J2)) YIN=Y12*Y12 DBC=ABS(YIN) C=DBC/(2.*DREAL(Y11)*DREAL(Y22)-DREAL(YIN)) IF (C.LT.0..OR.C.GT.1.) GO TO 4 IF (C.LT..01) GO TO 2 GMAX=(1.-SQRT(1.-C*C))/C GO TO 3 2 GMAX=.5*(C+.25*C*C*C) 3 RHO=GMAX*DCONJG(YIN)/DBC YL=((1.-RHO)/(1.+RHO)+1.)*DREAL(Y22)-Y22 ZL=1./YL YIN=Y11-YIN/(Y22+YL) ZIN=1./YIN DBC=DB10(GMAX) WRITE(3,7) ITT1,ITS1,ISG1,ITT2,ITS2,ISG2,DBC,ZL,ZIN GO TO 5 4 WRITE(3,8) ITT1,ITS1,ISG1,ITT2,ITS2,ISG2,C 5 CONTINUE RETURN C 6 FORMAT (///,36X,26H- - - ISOLATION DATA - - -,//,6X,24H- - COUPLIN 1G BETWEEN - -,8X,7HMAXIMUM,15X,32H- - - FOR MAXIMUM COUPLING - - - 2,/,12X,4HSEG.,14X,4HSEG.,3X,8HCOUPLING,4X,25HLOAD IMPEDANCE (2ND S 3EG.),7X,15HINPUT IMPEDANCE,/,2X,8HTAG/SEG.,3X,3HNO.,4X,8HTAG/SEG., 43X,3HNO.,6X,4H(DB),8X,4HREAL,9X,5HIMAG.,9X,4HREAL,9X,5HIMAG.) 7 FORMAT (2(1X,I4,1X,I4,1X,I5,2X),F9.3,2X,1P,2(2X,E12.5,1X,E12.5)) 8 FORMAT (2(1X,I4,1X,I4,1X,I5,2X),45H**ERROR** COUPLING IS NOT BETWE 1EN 0 AND 1. (=,1P,E12.5,1H)) END SUBROUTINE DATAGN C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C DATAGN IS THE MAIN ROUTINE FOR INPUT OF GEOMETRY DATA. C C*** CHARACTER*2 GM,ATST C*** COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) C*** COMMON /PLOT/ IPLP1,IPLP2,IPLP3,IPLP4 C*** DIMENSION X2(1), Y2(1), Z2(1), T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y 1(1), T2Z(1), ATST(13), IFX(2), IFY(2), IFZ(2), CAB(1), SAB(1), IPT 2(4) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG), (X2,SI), (Y2,ALP), (Z2,BET), (CAB,ALP), (SAB,BET) C*** DATA ATST/'GW','GX','GR','GS','GE','GM','SP','SM','GF','GA','SC', 1'GC','GH'/ C*** DATA IFX/1H ,1HX/,IFY/1H ,1HY/,IFZ/1H ,1HZ/ DATA TA/0.01745329252D+0/,TD/57.29577951D+0/,IPT/1HP,1HR,1HT,1HQ/ IPSYM=0 NWIRE=0 N=0 NP=0 M=0 MP=0 N1=0 N2=1 M1=0 M2=1 ISCT=0 IPHD=0 C C READ GEOMETRY DATA CARD AND BRANCH TO SECTION FOR OPERATION C REQUESTED C 1 CALL READGM(2,GM,ITG,NS,XW1,YW1,ZW1,XW2,YW2,ZW2,RAD) IF (N+M.GT.LD) GO TO 37 IF (GM.EQ.ATST(9)) GO TO 27 IF (IPHD.EQ.1) GO TO 2 WRITE(3,40) WRITE(3,41) IPHD=1 2 IF (GM.EQ.ATST(11)) GO TO 10 ISCT=0 IF (GM.EQ.ATST(1)) GO TO 3 IF (GM.EQ.ATST(2)) GO TO 18 IF (GM.EQ.ATST(3)) GO TO 19 IF (GM.EQ.ATST(4)) GO TO 21 IF (GM.EQ.ATST(7)) GO TO 9 IF (GM.EQ.ATST(8)) GO TO 13 IF (GM.EQ.ATST(5)) GO TO 29 IF (GM.EQ.ATST(6)) GO TO 26 IF (GM.EQ.ATST(10)) GO TO 8 C*** IF (GM.EQ.ATST(13)) GO TO 123 C*** GO TO 36 C C GENERATE SEGMENT DATA FOR STRAIGHT WIRE. C 3 NWIRE=NWIRE+1 I1=N+1 I2=N+NS WRITE(3,43) NWIRE,XW1,YW1,ZW1,XW2,YW2,ZW2,RAD,NS,I1,I2,ITG IF (RAD.EQ.0) GO TO 4 XS1=1. YS1=1. GO TO 7 4 CALL READGM(2,GM,IX,IY,XS1,YS1,ZS1,DUMMY,DUMMY,DUMMY,DUMMY) C*** IF (GM.EQ.ATST(12)) GO TO 6 5 WRITE(3,48) STOP 6 WRITE(3,61) XS1,YS1,ZS1 IF (YS1.EQ.0.OR.ZS1.EQ.0) GO TO 5 RAD=YS1 YS1=(ZS1/YS1)**(1./(NS-1.)) 7 CALL WIRE (XW1,YW1,ZW1,XW2,YW2,ZW2,RAD,XS1,YS1,NS,ITG) GO TO 1 C C GENERATE SEGMENT DATA FOR WIRE ARC C 8 NWIRE=NWIRE+1 I1=N+1 I2=N+NS WRITE(3,38) NWIRE,XW1,YW1,ZW1,XW2,NS,I1,I2,ITG CALL ARC (ITG,NS,XW1,YW1,ZW1,XW2) GO TO 1 C*** C C GENERATE HELIX C 123 NWIRE=NWIRE+1 I1=N+1 I2=N+NS WRITE(3,124) XW1,YW1,NWIRE,ZW1,XW2,YW2,ZW2,RAD,NS,I1,I2,ITG CALL HELIX(XW1,YW1,ZW1,XW2,YW2,ZW2,RAD,NS,ITG) GO TO 1 C 124 FORMAT(5X,'HELIX STRUCTURE- AXIAL SPACING BETWEEN TURNS =',F8.3, 1' TOTAL AXIAL LENGTH =',F8.3/1X,I5,2X,'RADIUS OF HELIX =',4(2X, 2F8.3),7X,F11.5,I8,4X,I5,1X,I5,3X,I5) C*** C C GENERATE SINGLE NEW PATCH C 9 I1=M+1 NS=NS+1 IF (ITG.NE.0) GO TO 17 WRITE(3,51) I1,IPT(NS),XW1,YW1,ZW1,XW2,YW2,ZW2 IF (NS.EQ.2.OR.NS.EQ.4) ISCT=1 IF (NS.GT.1) GO TO 14 XW2=XW2*TA YW2=YW2*TA GO TO 16 10 IF (ISCT.EQ.0) GO TO 17 I1=M+1 NS=NS+1 IF (ITG.NE.0) GO TO 17 IF (NS.NE.2.AND.NS.NE.4) GO TO 17 XS1=X4 YS1=Y4 ZS1=Z4 XS2=X3 YS2=Y3 ZS2=Z3 X3=XW1 Y3=YW1 Z3=ZW1 IF (NS.NE.4) GO TO 11 X4=XW2 Y4=YW2 Z4=ZW2 11 XW1=XS1 YW1=YS1 ZW1=ZS1 XW2=XS2 YW2=YS2 ZW2=ZS2 IF (NS.EQ.4) GO TO 12 X4=XW1+X3-XW2 Y4=YW1+Y3-YW2 Z4=ZW1+Z3-ZW2 12 WRITE(3,51) I1,IPT(NS),XW1,YW1,ZW1,XW2,YW2,ZW2 WRITE(3,39) X3,Y3,Z3,X4,Y4,Z4 GO TO 16 C C GENERATE MULTIPLE-PATCH SURFACE C 13 I1=M+1 WRITE(3,59) I1,IPT(2),XW1,YW1,ZW1,XW2,YW2,ZW2,ITG,NS IF (ITG.LT.1.OR.NS.LT.1) GO TO 17 14 CALL READGM(2,GM,IX,IY,X3,Y3,Z3,X4,Y4,Z4,DUMMY) IF (NS.NE.2.AND.ITG.LT.1) GO TO 15 X4=XW1+X3-XW2 Y4=YW1+Y3-YW2 Z4=ZW1+Z3-ZW2 15 WRITE(3,39) X3,Y3,Z3,X4,Y4,Z4 IF (GM.NE.ATST(11)) GO TO 17 16 CALL PATCH (ITG,NS,XW1,YW1,ZW1,XW2,YW2,ZW2,X3,Y3,Z3,X4,Y4,Z4) GO TO 1 17 WRITE(3,60) STOP C C REFLECT STRUCTURE ALONG X,Y, OR Z AXES OR ROTATE TO FORM CYLINDER. C 18 IY=NS/10 IZ=NS-IY*10 IX=IY/10 IY=IY-IX*10 IF (IX.NE.0) IX=1 IF (IY.NE.0) IY=1 IF (IZ.NE.0) IZ=1 WRITE(3,44) IFX(IX+1),IFY(IY+1),IFZ(IZ+1),ITG GO TO 20 19 WRITE(3,45) NS,ITG IX=-1 20 CALL REFLC (IX,IY,IZ,ITG,NS) GO TO 1 C C SCALE STRUCTURE DIMENSIONS BY FACTOR XW1. C 21 IF (N.LT.N2) GO TO 23 DO 22 I=N2,N X(I)=X(I)*XW1 Y(I)=Y(I)*XW1 Z(I)=Z(I)*XW1 X2(I)=X2(I)*XW1 Y2(I)=Y2(I)*XW1 Z2(I)=Z2(I)*XW1 22 BI(I)=BI(I)*XW1 23 IF (M.LT.M2) GO TO 25 YW1=XW1*XW1 IX=LD+1-M IY=LD-M1 DO 24 I=IX,IY X(I)=X(I)*XW1 Y(I)=Y(I)*XW1 Z(I)=Z(I)*XW1 24 BI(I)=BI(I)*YW1 25 WRITE(3,46) XW1 GO TO 1 C C MOVE STRUCTURE OR REPRODUCE ORIGINAL STRUCTURE IN NEW POSITIONS. C 26 WRITE(3,47) ITG,NS,XW1,YW1,ZW1,XW2,YW2,ZW2,RAD XW1=XW1*TA YW1=YW1*TA ZW1=ZW1*TA CALL MOVE (XW1,YW1,ZW1,XW2,YW2,ZW2,INT(RAD+.5),NS,ITG) GO TO 1 C C READ NUMERICAL GREEN'S FUNCTION TAPE C 27 IF (N+M.EQ.0) GO TO 28 WRITE(3,52) STOP 28 CALL GFIL (ITG) NPSAV=NP MPSAV=MP IPSAV=IPSYM GO TO 1 C C TERMINATE STRUCTURE GEOMETRY INPUT. C C*** 29 IF(NS.EQ.0) GO TO 290 IPLP1=1 IPLP2=1 290 IX=N1+M1 C*** IF (IX.EQ.0) GO TO 30 NP=N MP=M IPSYM=0 30 CALL CONECT (ITG) IF (IX.EQ.0) GO TO 31 NP=NPSAV MP=MPSAV IPSYM=IPSAV 31 IF (N+M.GT.LD) GO TO 37 IF (N.EQ.0) GO TO 33 WRITE(3,53) WRITE(3,54) DO 32 I=1,N XW1=X2(I)-X(I) YW1=Y2(I)-Y(I) ZW1=Z2(I)-Z(I) X(I)=(X(I)+X2(I))*.5 Y(I)=(Y(I)+Y2(I))*.5 Z(I)=(Z(I)+Z2(I))*.5 XW2=XW1*XW1+YW1*YW1+ZW1*ZW1 YW2=SQRT(XW2) YW2=(XW2/YW2+YW2)*.5 SI(I)=YW2 CAB(I)=XW1/YW2 SAB(I)=YW1/YW2 XW2=ZW1/YW2 IF (XW2.GT.1.) XW2=1. IF (XW2.LT.-1.) XW2=-1. SALP(I)=XW2 XW2=ASIN(XW2)*TD YW2=ATGN2(YW1,XW1)*TD WRITE(3,55) I,X(I),Y(I),Z(I),SI(I),XW2,YW2,BI(I),ICON1(I),I, 1ICON2(I),ITAG(I) C*** IF(IPLP1.NE.1) GO TO 320 WRITE(8,*)X(I),Y(I),Z(I),SI(I),XW2,YW2,BI(I),ICON1(I),I,ICON2(I) 320 CONTINUE C*** IF (SI(I).GT.1.D-20.AND.BI(I).GT.0.) GO TO 32 WRITE(3,56) STOP 32 CONTINUE 33 IF (M.EQ.0) GO TO 35 WRITE(3,57) J=LD+1 DO 34 I=1,M J=J-1 XW1=(T1Y(J)*T2Z(J)-T1Z(J)*T2Y(J))*SALP(J) YW1=(T1Z(J)*T2X(J)-T1X(J)*T2Z(J))*SALP(J) ZW1=(T1X(J)*T2Y(J)-T1Y(J)*T2X(J))*SALP(J) WRITE(3,58) I,X(J),Y(J),Z(J),XW1,YW1,ZW1,BI(J),T1X(J),T1Y(J), 1T1Z(J),T2X(J),T2Y(J),T2Z(J) 34 CONTINUE 35 RETURN 36 WRITE(3,48) WRITE(3,49) GM,ITG,NS,XW1,YW1,ZW1,XW2,YW2,ZW2,RAD STOP 37 WRITE(3,50) STOP C 38 FORMAT (1X,I5,2X,12HARC RADIUS =,F9.5,2X,4HFROM,F8.3,3H TO,F8.3,8H 1 DEGREES,11X,F11.5,2X,I5,4X,I5,1X,I5,3X,I5) 39 FORMAT (6X,3F11.5,1X,3F11.5) 40 FORMAT (////,33X,35H- - - STRUCTURE SPECIFICATION - - -,//,37X,28H 1COORDINATES MUST BE INPUT IN,/,37X,29HMETERS OR BE SCALED TO METER 2S,/,37X,31HBEFORE STRUCTURE INPUT IS ENDED,//) 41 FORMAT (2X,4HWIRE,79X,6HNO. OF,4X,5HFIRST,2X,4HLAST,5X,3HTAG,/,2X, 13HNO.,8X,2HX1,9X,2HY1,9X,2HZ1,10X,2HX2,9X,2HY2,9X,2HZ2,6X,6HRADIUS 2,3X,4HSEG.,5X,4HSEG.,3X,4HSEG.,5X,3HNO.) 42 FORMAT (A2,I3,I5,7F10.5) 43 FORMAT (1X,I5,3F11.5,1X,4F11.5,2X,I5,4X,I5,1X,I5,3X,I5) 44 FORMAT (6X,34HSTRUCTURE REFLECTED ALONG THE AXES,3(1X,A1),22H. TA 1GS INCREMENTED BY,I5) 45 FORMAT (6X,30HSTRUCTURE ROTATED ABOUT Z-AXIS,I3,30H TIMES. LABELS 1 INCREMENTED BY,I5) 46 FORMAT (6X,26HSTRUCTURE SCALED BY FACTOR,F10.5) 47 FORMAT (6X,49HTHE STRUCTURE HAS BEEN MOVED, MOVE DATA CARD IS -/6X 1,I3,I5,7F10.5) 48 FORMAT (25H GEOMETRY DATA CARD ERROR) 49 FORMAT (1X,A2,I3,I5,7F10.5) 50 FORMAT (69H NUMBER OF WIRE SEGMENTS AND SURFACE PATCHES EXCEEDS DI 1MENSION LIMIT.) 51 FORMAT (1X,I5,A1,F10.5,2F11.5,1X,3F11.5) 52 FORMAT (44H ERROR - GF MUST BE FIRST GEOMETRY DATA CARD) 53 FORMAT (////33X,33H- - - - SEGMENTATION DATA - - - -,//,40X,21HCOO 1RDINATES IN METERS,//,25X,50HI+ AND I- INDICATE THE SEGMENTS BEFOR 2E AND AFTER I,//) 54 FORMAT (2X,4HSEG.,3X,26HCOORDINATES OF SEG. CENTER,5X,4HSEG.,5X,18 1HORIENTATION ANGLES,4X,4HWIRE,4X,15HCONNECTION DATA,3X,3HTAG,/,2X, 23HNO.,7X,1HX,9X,1HY,9X,1HZ,7X,6HLENGTH,5X,5HALPHA,5X,4HBETA,6X,6HR 3ADIUS,4X,2HI-,3X,1HI,4X,2HI+,4X,3HNO.) 55 FORMAT (1X,I5,4F10.5,1X,3F10.5,1X,3I5,2X,I5) 56 FORMAT (19H SEGMENT DATA ERROR) 57 FORMAT (////,44X,30H- - - SURFACE PATCH DATA - - -,//,49X,21HCOORD 1INATES IN METERS,//,1X,5HPATCH,5X,22HCOORD. OF PATCH CENTER,7X,18H 2UNIT NORMAL VECTOR,6X,5HPATCH,12X,34HCOMPONENTS OF UNIT TANGENT VE 3CTORS,/,2X,3HNO.,6X,1HX,9X,1HY,9X,1HZ,9X,1HX,7X,1HY,7X,1HZ,7X,4HAR 4EA,7X,2HX1,6X,2HY1,6X,2HZ1,7X,2HX2,6X,2HY2,6X,2HZ2) 58 FORMAT (1X,I4,3F10.5,1X,3F8.4,F10.5,1X,3F8.4,1X,3F8.4) 59 FORMAT (1X,I5,A1,F10.5,2F11.5,1X,3F11.5,5X,9HSURFACE -,I4,3H BY,I3 1,8H PATCHES) 60 FORMAT (17H PATCH DATA ERROR) 61 FORMAT (9X,43HABOVE WIRE IS TAPERED. SEG. LENGTH RATIO =,F9.5,/,3 13X,11HRADIUS FROM,F9.5,3H TO,F9.5) END FUNCTION DB10 (X) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C FUNCTION DB-- RETURNS DB FOR MAGNITUDE (FIELD) OR MAG**2 (POWER) I C F=10. GO TO 1 ENTRY DB20(X) F=20. 1 IF (X.LT.1.D-20) GO TO 2 DB10=F*LOG10(X) RETURN 2 DB10=-999.99 RETURN END SUBROUTINE EFLD (XI,YI,ZI,AI,IJ) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C COMPUTE NEAR E FIELDS OF A SEGMENT WITH SINE, COSINE, AND C CONSTANT CURRENTS. GROUND EFFECT INCLUDED. C COMPLEX*16 TXK,TYK,TZK,TXS,TYS,TZS,TXC,TYC,TZC,EXK,EYK,EZK,EXS,EYS 1,EZS,EXC,EYC,EZC,EPX,EPY,ZRATI,REFS,REFPS,ZRSIN,ZRATX,T1,ZSCRN 2,ZRATI2,TEZS,TERS,TEZC,TERC,TEZK,TERK,EGND,FRATI COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON /INCOM/ XO,YO,ZO,SN,XSN,YSN,ISNOR DIMENSION EGND(9) EQUIVALENCE (EGND(1),TXK), (EGND(2),TYK), (EGND(3),TZK), (EGND(4), 1TXS), (EGND(5),TYS), (EGND(6),TZS), (EGND(7),TXC), (EGND(8),TYC), 2(EGND(9),TZC) DATA ETA/376.73/,PI/3.141592654D+0/,TP/6.283185308D+0/ XIJ=XI-XJ YIJ=YI-YJ IJX=IJ RFL=-1. DO 12 IP=1,KSYMP IF (IP.EQ.2) IJX=1 RFL=-RFL SALPR=SALPJ*RFL ZIJ=ZI-RFL*ZJ ZP=XIJ*CABJ+YIJ*SABJ+ZIJ*SALPR RHOX=XIJ-CABJ*ZP RHOY=YIJ-SABJ*ZP RHOZ=ZIJ-SALPR*ZP RH=SQRT(RHOX*RHOX+RHOY*RHOY+RHOZ*RHOZ+AI*AI) IF (RH.GT.1.D-10) GO TO 1 RHOX=0. RHOY=0. RHOZ=0. GO TO 2 1 RHOX=RHOX/RH RHOY=RHOY/RH RHOZ=RHOZ/RH 2 R=SQRT(ZP*ZP+RH*RH) IF (R.LT.RKH) GO TO 3 C C LUMPED CURRENT ELEMENT APPROX. FOR LARGE SEPARATIONS C RMAG=TP*R CTH=ZP/R PX=RH/R TXK=DCMPLX(COS(RMAG),-SIN(RMAG)) PY=TP*R*R TYK=ETA*CTH*TXK*DCMPLX(1.D+0,-1.D+0/RMAG)/PY TZK=ETA*PX*TXK*DCMPLX(1.D+0,RMAG-1.D+0/RMAG)/(2.*PY) TEZK=TYK*CTH-TZK*PX TERK=TYK*PX+TZK*CTH RMAG=SIN(PI*S)/PI TEZC=TEZK*RMAG TERC=TERK*RMAG TEZK=TEZK*S TERK=TERK*S TXS=(0.,0.) TYS=(0.,0.) TZS=(0.,0.) GO TO 6 3 IF (IEXK.EQ.1) GO TO 4 C C EKSC FOR THIN WIRE APPROX. OR EKSCX FOR EXTENDED T.W. APPROX. C CALL EKSC (S,ZP,RH,TP,IJX,TEZS,TERS,TEZC,TERC,TEZK,TERK) GO TO 5 4 CALL EKSCX (B,S,ZP,RH,TP,IJX,IND1,IND2,TEZS,TERS,TEZC,TERC,TEZK,TE 1RK) 5 TXS=TEZS*CABJ+TERS*RHOX TYS=TEZS*SABJ+TERS*RHOY TZS=TEZS*SALPR+TERS*RHOZ 6 TXK=TEZK*CABJ+TERK*RHOX TYK=TEZK*SABJ+TERK*RHOY TZK=TEZK*SALPR+TERK*RHOZ TXC=TEZC*CABJ+TERC*RHOX TYC=TEZC*SABJ+TERC*RHOY TZC=TEZC*SALPR+TERC*RHOZ IF (IP.NE.2) GO TO 11 IF (IPERF.GT.0) GO TO 10 ZRATX=ZRATI RMAG=R XYMAG=SQRT(XIJ*XIJ+YIJ*YIJ) C C SET PARAMETERS FOR RADIAL WIRE GROUND SCREEN. C IF (NRADL.EQ.0) GO TO 7 XSPEC=(XI*ZJ+ZI*XJ)/(ZI+ZJ) YSPEC=(YI*ZJ+ZI*YJ)/(ZI+ZJ) RHOSPC=SQRT(XSPEC*XSPEC+YSPEC*YSPEC+T2*T2) IF (RHOSPC.GT.SCRWL) GO TO 7 ZSCRN=T1*RHOSPC*LOG(RHOSPC/T2) ZRATX=(ZSCRN*ZRATI)/(ETA*ZRATI+ZSCRN) 7 IF (XYMAG.GT.1.D-6) GO TO 8 C C CALCULATION OF REFLECTION COEFFICIENTS WHEN GROUND IS SPECIFIED. C PX=0. PY=0. CTH=1. ZRSIN=(1.,0.) GO TO 9 8 PX=-YIJ/XYMAG PY=XIJ/XYMAG CTH=ZIJ/RMAG ZRSIN=SQRT(1.-ZRATX*ZRATX*(1.-CTH*CTH)) 9 REFS=(CTH-ZRATX*ZRSIN)/(CTH+ZRATX*ZRSIN) REFPS=-(ZRATX*CTH-ZRSIN)/(ZRATX*CTH+ZRSIN) REFPS=REFPS-REFS EPY=PX*TXK+PY*TYK EPX=PX*EPY EPY=PY*EPY TXK=REFS*TXK+REFPS*EPX TYK=REFS*TYK+REFPS*EPY TZK=REFS*TZK EPY=PX*TXS+PY*TYS EPX=PX*EPY EPY=PY*EPY TXS=REFS*TXS+REFPS*EPX TYS=REFS*TYS+REFPS*EPY TZS=REFS*TZS EPY=PX*TXC+PY*TYC EPX=PX*EPY EPY=PY*EPY TXC=REFS*TXC+REFPS*EPX TYC=REFS*TYC+REFPS*EPY TZC=REFS*TZC 10 EXK=EXK-TXK*FRATI EYK=EYK-TYK*FRATI EZK=EZK-TZK*FRATI EXS=EXS-TXS*FRATI EYS=EYS-TYS*FRATI EZS=EZS-TZS*FRATI EXC=EXC-TXC*FRATI EYC=EYC-TYC*FRATI EZC=EZC-TZC*FRATI GO TO 12 11 EXK=TXK EYK=TYK EZK=TZK EXS=TXS EYS=TYS EZS=TZS EXC=TXC EYC=TYC EZC=TZC 12 CONTINUE IF (IPERF.EQ.2) GO TO 13 RETURN C C FIELD DUE TO GROUND USING SOMMERFELD/NORTON C 13 SN=SQRT(CABJ*CABJ+SABJ*SABJ) IF (SN.LT.1.D-5) GO TO 14 XSN=CABJ/SN YSN=SABJ/SN GO TO 15 14 SN=0. XSN=1. YSN=0. C C DISPLACE OBSERVATION POINT FOR THIN WIRE APPROXIMATION C 15 ZIJ=ZI+ZJ SALPR=-SALPJ RHOX=SABJ*ZIJ-SALPR*YIJ RHOY=SALPR*XIJ-CABJ*ZIJ RHOZ=CABJ*YIJ-SABJ*XIJ RH=RHOX*RHOX+RHOY*RHOY+RHOZ*RHOZ IF (RH.GT.1.D-10) GO TO 16 XO=XI-AI*YSN YO=YI+AI*XSN ZO=ZI GO TO 17 16 RH=AI/SQRT(RH) IF (RHOZ.LT.0.) RH=-RH XO=XI+RH*RHOX YO=YI+RH*RHOY ZO=ZI+RH*RHOZ 17 R=XIJ*XIJ+YIJ*YIJ+ZIJ*ZIJ IF (R.GT..95) GO TO 18 C C FIELD FROM INTERPOLATION IS INTEGRATED OVER SEGMENT C ISNOR=1 DMIN=EXK*DCONJG(EXK)+EYK*DCONJG(EYK)+EZK*DCONJG(EZK) DMIN=.01*SQRT(DMIN) SHAF=.5*S CALL ROM2 (-SHAF,SHAF,EGND,DMIN) GO TO 19 C C NORTON FIELD EQUATIONS AND LUMPED CURRENT ELEMENT APPROXIMATION C 18 ISNOR=2 CALL SFLDS (0.D0,EGND) GO TO 22 19 ZP=XIJ*CABJ+YIJ*SABJ+ZIJ*SALPR RH=R-ZP*ZP IF (RH.GT.1.D-10) GO TO 20 DMIN=0. GO TO 21 20 DMIN=SQRT(RH/(RH+AI*AI)) 21 IF (DMIN.GT..95) GO TO 22 PX=1.-DMIN TERK=(TXK*CABJ+TYK*SABJ+TZK*SALPR)*PX TXK=DMIN*TXK+TERK*CABJ TYK=DMIN*TYK+TERK*SABJ TZK=DMIN*TZK+TERK*SALPR TERS=(TXS*CABJ+TYS*SABJ+TZS*SALPR)*PX TXS=DMIN*TXS+TERS*CABJ TYS=DMIN*TYS+TERS*SABJ TZS=DMIN*TZS+TERS*SALPR TERC=(TXC*CABJ+TYC*SABJ+TZC*SALPR)*PX TXC=DMIN*TXC+TERC*CABJ TYC=DMIN*TYC+TERC*SABJ TZC=DMIN*TZC+TERC*SALPR 22 EXK=EXK+TXK EYK=EYK+TYK EZK=EZK+TZK EXS=EXS+TXS EYS=EYS+TYS EZS=EZS+TZS EXC=EXC+TXC EYC=EYC+TYC EZC=EZC+TZC RETURN END SUBROUTINE EKSC (S,Z,RH,XK,IJ,EZS,ERS,EZC,ERC,EZK,ERK) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE E FIELD OF SINE, COSINE, AND CONSTANT CURRENT FILAMENTS BY C THIN WIRE APPROXIMATION. COMPLEX*16 CON,GZ1,GZ2,GP1,GP2,GZP1,GZP2,EZS,ERS,EZC,ERC,EZK,ERK COMMON /TMI/ ZPK,RKB2,IJX DIMENSION CONX(2) EQUIVALENCE (CONX,CON) DATA CONX/0.,4.771341189D+0/ IJX=IJ ZPK=XK*Z RHK=XK*RH RKB2=RHK*RHK SH=.5*S SHK=XK*SH SS=SIN(SHK) CS=COS(SHK) Z2=SH-Z Z1=-(SH+Z) CALL GX (Z1,RH,XK,GZ1,GP1) CALL GX (Z2,RH,XK,GZ2,GP2) GZP1=GP1*Z1 GZP2=GP2*Z2 EZS=CON*((GZ2-GZ1)*CS*XK-(GZP2+GZP1)*SS) EZC=-CON*((GZ2+GZ1)*SS*XK+(GZP2-GZP1)*CS) ERK=CON*(GP2-GP1)*RH CALL INTX (-SHK,SHK,RHK,IJ,CINT,SINT) EZK=-CON*(GZP2-GZP1+XK*XK*DCMPLX(CINT,-SINT)) GZP1=GZP1*Z1 GZP2=GZP2*Z2 IF (RH.LT.1.D-10) GO TO 1 ERS=-CON*((GZP2+GZP1+GZ2+GZ1)*SS-(Z2*GZ2-Z1*GZ1)*CS*XK)/RH ERC=-CON*((GZP2-GZP1+GZ2-GZ1)*CS+(Z2*GZ2+Z1*GZ1)*SS*XK)/RH RETURN 1 ERS=(0.,0.) ERC=(0.,0.) RETURN END SUBROUTINE EKSCX (BX,S,Z,RHX,XK,IJ,INX1,INX2,EZS,ERS,EZC,ERC,EZK,E 1RK) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE E FIELD OF SINE, COSINE, AND CONSTANT CURRENT FILAMENTS BY C EXTENDED THIN WIRE APPROXIMATION. COMPLEX*16 CON,GZ1,GZ2,GZP1,GZP2,GR1,GR2,GRP1,GRP2,EZS,EZC,ERS,ERC 1,GRK1,GRK2,EZK,ERK,GZZ1,GZZ2 COMMON /TMI/ ZPK,RKB2,IJX DIMENSION CONX(2) EQUIVALENCE (CONX,CON) DATA CONX/0.,4.771341189D+0/ IF (RHX.LT.BX) GO TO 1 RH=RHX B=BX IRA=0 GO TO 2 1 RH=BX B=RHX IRA=1 2 SH=.5*S IJX=IJ ZPK=XK*Z RHK=XK*RH RKB2=RHK*RHK SHK=XK*SH SS=SIN(SHK) CS=COS(SHK) Z2=SH-Z Z1=-(SH+Z) A2=B*B IF (INX1.EQ.2) GO TO 3 CALL GXX (Z1,RH,B,A2,XK,IRA,GZ1,GZP1,GR1,GRP1,GRK1,GZZ1) GO TO 4 3 CALL GX (Z1,RHX,XK,GZ1,GRK1) GZP1=GRK1*Z1 GR1=GZ1/RHX GRP1=GZP1/RHX GRK1=GRK1*RHX GZZ1=(0.,0.) 4 IF (INX2.EQ.2) GO TO 5 CALL GXX (Z2,RH,B,A2,XK,IRA,GZ2,GZP2,GR2,GRP2,GRK2,GZZ2) GO TO 6 5 CALL GX (Z2,RHX,XK,GZ2,GRK2) GZP2=GRK2*Z2 GR2=GZ2/RHX GRP2=GZP2/RHX GRK2=GRK2*RHX GZZ2=(0.,0.) 6 EZS=CON*((GZ2-GZ1)*CS*XK-(GZP2+GZP1)*SS) EZC=-CON*((GZ2+GZ1)*SS*XK+(GZP2-GZP1)*CS) ERS=-CON*((Z2*GRP2+Z1*GRP1+GR2+GR1)*SS-(Z2*GR2-Z1*GR1)*CS*XK) ERC=-CON*((Z2*GRP2-Z1*GRP1+GR2-GR1)*CS+(Z2*GR2+Z1*GR1)*SS*XK) ERK=CON*(GRK2-GRK1) CALL INTX (-SHK,SHK,RHK,IJ,CINT,SINT) BK=B*XK BK2=BK*BK*.25 EZK=-CON*(GZP2-GZP1+XK*XK*(1.-BK2)*DCMPLX(CINT,-SINT)-BK2*(GZZ2- 1GZZ1)) RETURN END SUBROUTINE ERROR C *** C GET REASON FOR FILE ERROR (VAX ONLY). ERROR SHOULD BE REDUCED TO C "RETURN END" FOR MACINTOSH. C C IMPLICIT INTEGER (A-Z) C CHARACTER MSG*80 C CALL ERRSNS(FNUM,RMSSTS,RMSSTV,IUNIT,CONDVAL) C CALL SYS$GETMSG(%VAL(RMSSTS),MSGLEN,MSG,,,) C CALL STR$UPCASE(MSG,MSG) C IND=INDEX(MSG,',') C TYPE 1,MSG(IND+2:MSGLEN) C1 FORMAT(//,' **** ERROR **** ',//,5X,A,//) RETURN END SUBROUTINE ETMNS (P1,P2,P3,P4,P5,P6,IPR,E) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C ETMNS FILLS THE ARRAY E WITH THE NEGATIVE OF THE ELECTRIC FIELD C INCIDENT ON THE STRUCTURE. E IS THE RIGHT HAND SIDE OF THE MATRIX C EQUATION. C COMPLEX*16 E,CX,CY,CZ,VSANT,ER,ET,EZH,ERH,VQD,VQDS,ZRATI 1,ZRATI2,RRV,RRH,T1,TT1,TT2,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /VSORC/ VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30),IQDS( 130),NVQD,NSANT,NQDS COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF DIMENSION CAB(1), SAB(1), E(2*MAXSEG) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) EQUIVALENCE (CAB,ALP), (SAB,BET) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) DATA TP/6.283185308D+0/,RETA/2.654420938D-3/ NEQ=N+2*M NQDS=0 IF (IPR.GT.0.AND.IPR.NE.5) GO TO 5 C C APPLIED FIELD OF VOLTAGE SOURCES FOR TRANSMITTING CASE C DO 1 I=1,NEQ 1 E(I)=(0.,0.) IF (NSANT.EQ.0) GO TO 3 DO 2 I=1,NSANT IS=ISANT(I) 2 E(IS)=-VSANT(I)/(SI(IS)*WLAM) 3 IF (NVQD.EQ.0) RETURN DO 4 I=1,NVQD IS=IVQD(I) 4 CALL QDSRC (IS,VQD(I),E) RETURN 5 IF (IPR.GT.3) GO TO 19 C C INCIDENT PLANE WAVE, LINEARLY POLARIZED. C CTH=COS(P1) STH=SIN(P1) CPH=COS(P2) SPH=SIN(P2) CET=COS(P3) SET=SIN(P3) PX=CTH*CPH*CET-SPH*SET PY=CTH*SPH*CET+CPH*SET PZ=-STH*CET WX=-STH*CPH WY=-STH*SPH WZ=-CTH QX=WY*PZ-WZ*PY QY=WZ*PX-WX*PZ QZ=WX*PY-WY*PX IF (KSYMP.EQ.1) GO TO 7 IF (IPERF.EQ.1) GO TO 6 RRV=SQRT(1.-ZRATI*ZRATI*STH*STH) RRH=ZRATI*CTH RRH=(RRH-RRV)/(RRH+RRV) RRV=ZRATI*RRV RRV=-(CTH-RRV)/(CTH+RRV) GO TO 7 6 RRV=-(1.,0.) RRH=-(1.,0.) 7 IF (IPR.GT.1) GO TO 13 IF (N.EQ.0) GO TO 10 DO 8 I=1,N ARG=-TP*(WX*X(I)+WY*Y(I)+WZ*Z(I)) 8 E(I)=-(PX*CAB(I)+PY*SAB(I)+PZ*SALP(I))*DCMPLX(COS(ARG),SIN(ARG)) IF (KSYMP.EQ.1) GO TO 10 TT1=(PY*CPH-PX*SPH)*(RRH-RRV) CX=RRV*PX-TT1*SPH CY=RRV*PY+TT1*CPH CZ=-RRV*PZ DO 9 I=1,N ARG=-TP*(WX*X(I)+WY*Y(I)-WZ*Z(I)) 9 E(I)=E(I)-(CX*CAB(I)+CY*SAB(I)+CZ*SALP(I))*DCMPLX(COS(ARG), 1SIN(ARG)) 10 IF (M.EQ.0) RETURN I=LD+1 I1=N-1 DO 11 IS=1,M I=I-1 I1=I1+2 I2=I1+1 ARG=-TP*(WX*X(I)+WY*Y(I)+WZ*Z(I)) TT1=DCMPLX(COS(ARG),SIN(ARG))*SALP(I)*RETA E(I2)=(QX*T1X(I)+QY*T1Y(I)+QZ*T1Z(I))*TT1 11 E(I1)=(QX*T2X(I)+QY*T2Y(I)+QZ*T2Z(I))*TT1 IF (KSYMP.EQ.1) RETURN TT1=(QY*CPH-QX*SPH)*(RRV-RRH) CX=-(RRH*QX-TT1*SPH) CY=-(RRH*QY+TT1*CPH) CZ=RRH*QZ I=LD+1 I1=N-1 DO 12 IS=1,M I=I-1 I1=I1+2 I2=I1+1 ARG=-TP*(WX*X(I)+WY*Y(I)-WZ*Z(I)) TT1=DCMPLX(COS(ARG),SIN(ARG))*SALP(I)*RETA E(I2)=E(I2)+(CX*T1X(I)+CY*T1Y(I)+CZ*T1Z(I))*TT1 12 E(I1)=E(I1)+(CX*T2X(I)+CY*T2Y(I)+CZ*T2Z(I))*TT1 RETURN C C INCIDENT PLANE WAVE, ELLIPTIC POLARIZATION. C 13 TT1=-(0.,1.)*P6 IF (IPR.EQ.3) TT1=-TT1 IF (N.EQ.0) GO TO 16 CX=PX+TT1*QX CY=PY+TT1*QY CZ=PZ+TT1*QZ DO 14 I=1,N ARG=-TP*(WX*X(I)+WY*Y(I)+WZ*Z(I)) 14 E(I)=-(CX*CAB(I)+CY*SAB(I)+CZ*SALP(I))*DCMPLX(COS(ARG),SIN(ARG)) IF (KSYMP.EQ.1) GO TO 16 TT2=(CY*CPH-CX*SPH)*(RRH-RRV) CX=RRV*CX-TT2*SPH CY=RRV*CY+TT2*CPH CZ=-RRV*CZ DO 15 I=1,N ARG=-TP*(WX*X(I)+WY*Y(I)-WZ*Z(I)) 15 E(I)=E(I)-(CX*CAB(I)+CY*SAB(I)+CZ*SALP(I))*DCMPLX(COS(ARG), 1SIN(ARG)) 16 IF (M.EQ.0) RETURN CX=QX-TT1*PX CY=QY-TT1*PY CZ=QZ-TT1*PZ I=LD+1 I1=N-1 DO 17 IS=1,M I=I-1 I1=I1+2 I2=I1+1 ARG=-TP*(WX*X(I)+WY*Y(I)+WZ*Z(I)) TT2=DCMPLX(COS(ARG),SIN(ARG))*SALP(I)*RETA E(I2)=(CX*T1X(I)+CY*T1Y(I)+CZ*T1Z(I))*TT2 17 E(I1)=(CX*T2X(I)+CY*T2Y(I)+CZ*T2Z(I))*TT2 IF (KSYMP.EQ.1) RETURN TT1=(CY*CPH-CX*SPH)*(RRV-RRH) CX=-(RRH*CX-TT1*SPH) CY=-(RRH*CY+TT1*CPH) CZ=RRH*CZ I=LD+1 I1=N-1 DO 18 IS=1,M I=I-1 I1=I1+2 I2=I1+1 ARG=-TP*(WX*X(I)+WY*Y(I)-WZ*Z(I)) TT1=DCMPLX(COS(ARG),SIN(ARG))*SALP(I)*RETA E(I2)=E(I2)+(CX*T1X(I)+CY*T1Y(I)+CZ*T1Z(I))*TT1 18 E(I1)=E(I1)+(CX*T2X(I)+CY*T2Y(I)+CZ*T2Z(I))*TT1 RETURN C C INCIDENT FIELD OF AN ELEMENTARY CURRENT SOURCE. C 19 WZ=COS(P4) WX=WZ*COS(P5) WY=WZ*SIN(P5) WZ=SIN(P4) DS=P6*59.958 DSH=P6/(2.*TP) NPM=N+M IS=LD+1 I1=N-1 DO 24 I=1,NPM II=I IF (I.LE.N) GO TO 20 IS=IS-1 II=IS I1=I1+2 I2=I1+1 20 PX=X(II)-P1 PY=Y(II)-P2 PZ=Z(II)-P3 RS=PX*PX+PY*PY+PZ*PZ IF (RS.LT.1.D-30) GO TO 24 R=SQRT(RS) PX=PX/R PY=PY/R PZ=PZ/R CTH=PX*WX+PY*WY+PZ*WZ STH=SQRT(1.-CTH*CTH) QX=PX-WX*CTH QY=PY-WY*CTH QZ=PZ-WZ*CTH ARG=SQRT(QX*QX+QY*QY+QZ*QZ) IF (ARG.LT.1.D-30) GO TO 21 QX=QX/ARG QY=QY/ARG QZ=QZ/ARG GO TO 22 21 QX=1. QY=0. QZ=0. 22 ARG=-TP*R TT1=DCMPLX(COS(ARG),SIN(ARG)) IF (I.GT.N) GO TO 23 TT2=DCMPLX(1.D+0,-1.D+0/(R*TP))/RS ER=DS*TT1*TT2*CTH ET=.5*DS*TT1*((0.,1.)*TP/R+TT2)*STH EZH=ER*CTH-ET*STH ERH=ER*STH+ET*CTH CX=EZH*WX+ERH*QX CY=EZH*WY+ERH*QY CZ=EZH*WZ+ERH*QZ E(I)=-(CX*CAB(I)+CY*SAB(I)+CZ*SALP(I)) GO TO 24 23 PX=WY*QZ-WZ*QY PY=WZ*QX-WX*QZ PZ=WX*QY-WY*QX TT2=DSH*TT1*DCMPLX(1./R,TP)/R*STH*SALP(II) CX=TT2*PX CY=TT2*PY CZ=TT2*PZ E(I2)=CX*T1X(II)+CY*T1Y(II)+CZ*T1Z(II) E(I1)=CX*T2X(II)+CY*T2Y(II)+CZ*T2Z(II) 24 CONTINUE RETURN END SUBROUTINE FACGF (A,B,C,D,BX,IP,IX,NP,N1,MP,M1,N1C,N2C) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C FACGF COMPUTES AND FACTORS D-C(INV(A)B). COMPLEX*16 A,B,C,D,BX,SUM COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(1), B(N1C,1), C(N1C,1), D(N2C,1), BX(N1C,1), IP(1), IX 1(1) IF (N2C.EQ.0) RETURN IBFL=14 IF (ICASX.LT.3) GO TO 1 C CONVERT B FROM BLOCKS OF ROWS ON T14 TO BLOCKS OF COL. ON T16 CALL REBLK (B,C,N1C,NPBX,N2C) IBFL=16 1 NPB=NPBL IF (ICASX.EQ.2) REWIND 14 C COMPUTE INV(A)B AND WRITE ON TAPE14 DO 2 IB=1,NBBL IF (IB.EQ.NBBL) NPB=NLBL IF (ICASX.GT.1) READ (IBFL) ((BX(I,J),I=1,N1C),J=1,NPB) CALL SOLVES (A,IP,BX,N1C,NPB,NP,N1,MP,M1,13,13) IF (ICASX.EQ.2) REWIND 14 IF (ICASX.GT.1) WRITE (14) ((BX(I,J),I=1,N1C),J=1,NPB) 2 CONTINUE IF (ICASX.EQ.1) GO TO 3 REWIND 11 REWIND 12 REWIND 15 REWIND IBFL 3 NPC=NPBL C COMPUTE D-C(INV(A)B) AND WRITE ON TAPE11 DO 8 IC=1,NBBL IF (IC.EQ.NBBL) NPC=NLBL IF (ICASX.EQ.1) GO TO 4 READ (15) ((C(I,J),I=1,N1C),J=1,NPC) READ (12) ((D(I,J),I=1,N2C),J=1,NPC) REWIND 14 4 NPB=NPBL NIC=0 DO 7 IB=1,NBBL IF (IB.EQ.NBBL) NPB=NLBL IF (ICASX.GT.1) READ (14) ((B(I,J),I=1,N1C),J=1,NPB) DO 6 I=1,NPB II=I+NIC DO 6 J=1,NPC SUM=(0.,0.) DO 5 K=1,N1C 5 SUM=SUM+B(K,I)*C(K,J) 6 D(II,J)=D(II,J)-SUM 7 NIC=NIC+NPBL IF (ICASX.GT.1) WRITE (11) ((D(I,J),I=1,N2C),J=1,NPBL) 8 CONTINUE IF (ICASX.EQ.1) GO TO 9 REWIND 11 REWIND 12 REWIND 14 REWIND 15 9 N1CP=N1C+1 C FACTOR D-C(INV(A)B) IF (ICASX.GT.1) GO TO 10 CALL FACTR (N2C,D,IP(N1CP),N2C) GO TO 13 10 IF (ICASX.EQ.4) GO TO 12 NPB=NPBL IC=0 DO 11 IB=1,NBBL IF (IB.EQ.NBBL) NPB=NLBL II=IC+1 IC=IC+N2C*NPB 11 READ (11) (B(I,1),I=II,IC) REWIND 11 CALL FACTR (N2C,B,IP(N1CP),N2C) NIC=N2C*N2C WRITE (11) (B(I,1),I=1,NIC) REWIND 11 GO TO 13 12 NBLSYS=NBLSYM NPSYS=NPSYM NLSYS=NLSYM ICASS=ICASE NBLSYM=NBBL NPSYM=NPBL NLSYM=NLBL ICASE=3 CALL FACIO (B,N2C,1,IX(N1CP),11,12,16,11) CALL LUNSCR (B,N2C,1,IP(N1CP),IX(N1CP),12,11,16) NBLSYM=NBLSYS NPSYM=NPSYS NLSYM=NLSYS ICASE=ICASS 13 RETURN END SUBROUTINE FACIO (A,NROW,NOP,IP,IU1,IU2,IU3,IU4) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C FACIO CONTROLS I/O FOR OUT-OF-CORE FACTORIZATION C COMPLEX*16 A COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(NROW,1), IP(NROW) IT=2*NPSYM*NROW NBM=NBLSYM-1 I1=1 I2=IT I3=I2+1 I4=2*IT TIME=0. REWIND IU1 REWIND IU2 DO 3 KK=1,NOP KA=(KK-1)*NROW+1 IFILE3=IU1 IFILE4=IU3 DO 2 IXBLK1=1,NBM REWIND IU3 REWIND IU4 CALL BLCKIN (A,IFILE3,I1,I2,1,17) IXBP=IXBLK1+1 DO 1 IXBLK2=IXBP,NBLSYM CALL BLCKIN (A,IFILE3,I3,I4,1,18) CALL CPU_TIME (T1) CALL LFACTR (A,NROW,IXBLK1,IXBLK2,IP(KA)) CALL CPU_TIME (T2) TIME=TIME+T2-T1 IF (IXBLK2.EQ.IXBP) CALL BLCKOT (A,IU2,I1,I2,1,19) IF (IXBLK1.EQ.NBM.AND.IXBLK2.EQ.NBLSYM) IFILE4=IU2 CALL BLCKOT (A,IFILE4,I3,I4,1,20) 1 CONTINUE IFILE3=IU3 IFILE4=IU4 IF ((IXBLK1/2)*2.NE.IXBLK1) GO TO 2 IFILE3=IU4 IFILE4=IU3 2 CONTINUE 3 CONTINUE REWIND IU1 REWIND IU2 REWIND IU3 REWIND IU4 WRITE(3,4) TIME RETURN C 4 FORMAT (35H CP TIME TAKEN FOR FACTORIZATION = ,1P,E12.5) END SUBROUTINE FACTR (N,A,IP,NDIM) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE TO FACTOR A MATRIX INTO A UNIT LOWER TRIANGULAR MATRIX C AND AN UPPER TRIANGULAR MATRIX USING THE GAUSS-DOOLITTLE ALGORITHM C PRESENTED ON PAGES 411-416 OF A. RALSTON--A FIRST COURSE IN C NUMERICAL ANALYSIS. COMMENTS BELOW REFER TO COMMENTS IN RALSTONS C TEXT. (MATRIX TRANSPOSED. C COMPLEX*16 A,D,ARJ DIMENSION A(NDIM,NDIM), IP(NDIM) COMMON /SCRATM/ D(2*MAXSEG) INTEGER R,RM1,RP1,PJ,PR C C Un-transpose the matrix for Gauss elimination C DO 12 I=2,N DO 11 J=1,I-1 ARJ=A(I,J) A(I,J)=A(J,I) A(J,I)=ARJ 11 CONTINUE 12 CONTINUE IFLG=0 DO 9 R=1,N C C STEP 1 C DO 1 K=1,N D(K)=A(K,R) 1 CONTINUE C C STEPS 2 AND 3 C RM1=R-1 IF (RM1.LT.1) GO TO 4 DO 3 J=1,RM1 PJ=IP(J) ARJ=D(PJ) A(J,R)=ARJ D(PJ)=D(J) JP1=J+1 DO 2 I=JP1,N D(I)=D(I)-A(I,J)*ARJ 2 CONTINUE 3 CONTINUE 4 CONTINUE C C STEP 4 C DMAX=DREAL(D(R)*DCONJG(D(R))) IP(R)=R RP1=R+1 IF (RP1.GT.N) GO TO 6 DO 5 I=RP1,N ELMAG=DREAL(D(I)*DCONJG(D(I))) IF (ELMAG.LT.DMAX) GO TO 5 DMAX=ELMAG IP(R)=I 5 CONTINUE 6 CONTINUE IF (DMAX.LT.1.D-10) IFLG=1 PR=IP(R) A(R,R)=D(PR) D(PR)=D(R) C C STEP 5 C IF (RP1.GT.N) GO TO 8 ARJ=1./A(R,R) DO 7 I=RP1,N A(I,R)=D(I)*ARJ 7 CONTINUE 8 CONTINUE IF (IFLG.EQ.0) GO TO 9 WRITE(3,10) R,DMAX IFLG=0 9 CONTINUE RETURN C 10 FORMAT (1H ,6HPIVOT(,I3,2H)=,1P,E16.8) END SUBROUTINE FACTRS (NP,NROW,A,IP,IX,IU1,IU2,IU3,IU4) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C FACTRS, FOR SYMMETRIC STRUCTURE, TRANSFORMS SUBMATRICIES TO FORM C MATRICIES OF THE SYMMETRIC MODES AND CALLS ROUTINE TO FACTOR C MATRICIES. IF NO SYMMETRY, THE ROUTINE IS CALLED TO FACTOR THE C COMPLETE MATRIX. C COMPLEX*16 A COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(1), IP(NROW), IX(NROW) NOP=NROW/NP IF (ICASE.GT.2) GO TO 2 DO 1 KK=1,NOP KA=(KK-1)*NP+1 1 CALL FACTR (NP,A(KA),IP(KA),NROW) RETURN 2 IF (ICASE.GT.3) GO TO 3 C C FACTOR SUBMATRICIES, OR FACTOR COMPLETE MATRIX IF NO SYMMETRY C EXISTS. C CALL FACIO (A,NROW,NOP,IX,IU1,IU2,IU3,IU4) CALL LUNSCR (A,NROW,NOP,IP,IX,IU2,IU3,IU4) RETURN C C REWRITE THE MATRICES BY COLUMNS ON TAPE 13 C 3 I2=2*NPBLK*NROW REWIND IU2 DO 5 K=1,NOP REWIND IU1 ICOLS=NPBLK IR2=K*NP IR1=IR2-NP+1 DO 5 L=1,NBLOKS IF (NBLOKS.EQ.1.AND.K.GT.1) GO TO 4 CALL BLCKIN (A,IU1,1,I2,1,602) IF (L.EQ.NBLOKS) ICOLS=NLAST 4 IRR1=IR1 IRR2=IR2 DO 5 ICOLDX=1,ICOLS WRITE (IU2) (A(I),I=IRR1,IRR2) IRR1=IRR1+NROW IRR2=IRR2+NROW 5 CONTINUE REWIND IU1 REWIND IU2 IF (ICASE.EQ.5) GO TO 8 REWIND IU3 IRR1=NP*NP DO 7 KK=1,NOP IR1=1-NP IR2=0 DO 6 I=1,NP IR1=IR1+NP IR2=IR2+NP 6 READ (IU2) (A(J),J=IR1,IR2) KA=(KK-1)*NP+1 CALL FACTR (NP,A,IP(KA),NP) WRITE (IU3) (A(I),I=1,IRR1) 7 CONTINUE REWIND IU2 REWIND IU3 RETURN 8 I2=2*NPSYM*NP DO 10 KK=1,NOP J2=NPSYM DO 10 L=1,NBLSYM IF (L.EQ.NBLSYM) J2=NLSYM IR1=1-NP IR2=0 DO 9 J=1,J2 IR1=IR1+NP IR2=IR2+NP 9 READ (IU2) (A(I),I=IR1,IR2) 10 CALL BLCKOT (A,IU1,1,I2,1,193) REWIND IU1 CALL FACIO (A,NP,NOP,IX,IU1,IU2,IU3,IU4) CALL LUNSCR (A,NP,NOP,IP,IX,IU2,IU3,IU4) RETURN END COMPLEX*16 FUNCTION FBAR(P) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C FBAR IS SOMMERFELD ATTENUATION FUNCTION FOR NUMERICAL DISTANCE P C COMPLEX*16 Z,ZS,SUM,POW,TERM,P,FJ DIMENSION FJX(2) EQUIVALENCE (FJ,FJX) DATA TOSP/1.128379167D+0/,ACCS/1.D-12/,SP/1.772453851D+0/ 1,FJX/0.,1./ Z=FJ*SQRT(P) IF (ABS(Z).GT.3.) GO TO 3 C C SERIES EXPANSION C ZS=Z*Z SUM=Z POW=Z DO 1 I=1,100 POW=-POW*ZS/DFLOAT(I) TERM=POW/(2.*I+1.) SUM=SUM+TERM TMS=DREAL(TERM*DCONJG(TERM)) SMS=DREAL(SUM*DCONJG(SUM)) IF (TMS/SMS.LT.ACCS) GO TO 2 1 CONTINUE 2 FBAR=1.-(1.-SUM*TOSP)*Z*EXP(ZS)*SP RETURN C C ASYMPTOTIC EXPANSION C 3 IF (DREAL(Z).GE.0.) GO TO 4 MINUS=1 Z=-Z GO TO 5 4 MINUS=0 5 ZS=.5/(Z*Z) SUM=(0.,0.) TERM=(1.,0.) DO 6 I=1,6 TERM=-TERM*(2.*I-1.)*ZS 6 SUM=SUM+TERM IF (MINUS.EQ.1) SUM=SUM-2.*SP*Z*EXP(Z*Z) FBAR=-SUM RETURN END SUBROUTINE FBLOCK (NROW,NCOL,IMAX,IRNGF,IPSYM) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C FBLOCK SETS PARAMETERS FOR OUT-OF-CORE SOLUTION FOR THE PRIMARY C MATRIX (A) COMPLEX*16 SSX,DETER COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SMAT/ SSX(16,16) IMX1=IMAX-IRNGF IF (NROW*NCOL.GT.IMX1) GO TO 2 NBLOKS=1 NPBLK=NROW NLAST=NROW IMAT=NROW*NCOL IF (NROW.NE.NCOL) GO TO 1 ICASE=1 RETURN 1 ICASE=2 GO TO 5 2 IF (NROW.NE.NCOL) GO TO 3 ICASE=3 NPBLK=IMAX/(2*NCOL) NPSYM=IMX1/NCOL IF (NPSYM.LT.NPBLK) NPBLK=NPSYM IF (NPBLK.LT.1) GO TO 12 NBLOKS=(NROW-1)/NPBLK NLAST=NROW-NBLOKS*NPBLK NBLOKS=NBLOKS+1 NBLSYM=NBLOKS NPSYM=NPBLK NLSYM=NLAST IMAT=NPBLK*NCOL WRITE(3,14) NBLOKS,NPBLK,NLAST GO TO 11 3 NPBLK=IMAX/NCOL IF (NPBLK.LT.1) GO TO 12 IF (NPBLK.GT.NROW) NPBLK=NROW NBLOKS=(NROW-1)/NPBLK NLAST=NROW-NBLOKS*NPBLK NBLOKS=NBLOKS+1 WRITE(3,14) NBLOKS,NPBLK,NLAST IF (NROW*NROW.GT.IMX1) GO TO 4 ICASE=4 NBLSYM=1 NPSYM=NROW NLSYM=NROW IMAT=NROW*NROW WRITE(3,15) GO TO 5 4 ICASE=5 NPSYM=IMAX/(2*NROW) NBLSYM=IMX1/NROW IF (NBLSYM.LT.NPSYM) NPSYM=NBLSYM IF (NPSYM.LT.1) GO TO 12 NBLSYM=(NROW-1)/NPSYM NLSYM=NROW-NBLSYM*NPSYM NBLSYM=NBLSYM+1 WRITE(3,16) NBLSYM,NPSYM,NLSYM IMAT=NPSYM*NROW 5 NOP=NCOL/NROW IF (NOP*NROW.NE.NCOL) GO TO 13 IF (IPSYM.GT.0) GO TO 7 C C SET UP SSX MATRIX FOR ROTATIONAL SYMMETRY. C PHAZ=6.2831853072D+0/NOP DO 6 I=2,NOP DO 6 J=I,NOP ARG=PHAZ*DFLOAT(I-1)*DFLOAT(J-1) SSX(I,J)=DCMPLX(COS(ARG),SIN(ARG)) 6 SSX(J,I)=SSX(I,J) GO TO 11 C C SET UP SSX MATRIX FOR PLANE SYMMETRY C 7 KK=1 SSX(1,1)=(1.,0.) IF ((NOP.EQ.2).OR.(NOP.EQ.4).OR.(NOP.EQ.8)) GO TO 8 STOP 8 KA=NOP/2 IF (NOP.EQ.8) KA=3 DO 10 K=1,KA DO 9 I=1,KK DO 9 J=1,KK DETER=SSX(I,J) SSX(I,J+KK)=DETER SSX(I+KK,J+KK)=-DETER 9 SSX(I+KK,J)=DETER 10 KK=KK*2 11 RETURN 12 WRITE(3,17) NROW,NCOL STOP 13 WRITE(3,18) NROW,NCOL STOP C 14 FORMAT (//35H MATRIX FILE STORAGE - NO. BLOCKS=,I5,19H COLUMNS PE 1R BLOCK=,I5,23H COLUMNS IN LAST BLOCK=,I5) 15 FORMAT (25H SUBMATRICIES FIT IN CORE) 16 FORMAT (38H SUBMATRIX PARTITIONING - NO. BLOCKS=,I5,19H COLUMNS P 1ER BLOCK=,I5,23H COLUMNS IN LAST BLOCK=,I5) 17 FORMAT (40H ERROR - INSUFFICIENT STORAGE FOR MATRIX,2I5) 18 FORMAT (28H SYMMETRY ERROR - NROW,NCOL=,2I5) END SUBROUTINE FBNGF (NEQ,NEQ2,IRESRV,IB11,IC11,ID11,IX11) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C FBNGF SETS THE BLOCKING PARAMETERS FOR THE B, C, AND D ARRAYS FOR C OUT-OF-CORE STORAGE. COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL IRESX=IRESRV-IMAT NBLN=NEQ*NEQ2 NDLN=NEQ2*NEQ2 NBCD=2*NBLN+NDLN IF (NBCD.GT.IRESX) GO TO 1 ICASX=1 IB11=IMAT+1 GO TO 2 1 IF (ICASE.LT.3) GO TO 3 IF (NBCD.GT.IRESRV.OR.NBLN.GT.IRESX) GO TO 3 ICASX=2 IB11=1 2 NBBX=1 NPBX=NEQ NLBX=NEQ NBBL=1 NPBL=NEQ2 NLBL=NEQ2 GO TO 5 3 IR=IRESRV IF (ICASE.LT.3) IR=IRESX ICASX=3 IF (NDLN.GT.IR) ICASX=4 NBCD=2*NEQ+NEQ2 NPBL=IR/NBCD NLBL=IR/(2*NEQ2) IF (NLBL.LT.NPBL) NPBL=NLBL IF (ICASE.LT.3) GO TO 4 NLBL=IRESX/NEQ IF (NLBL.LT.NPBL) NPBL=NLBL 4 IF (NPBL.LT.1) GO TO 6 NBBL=(NEQ2-1)/NPBL NLBL=NEQ2-NBBL*NPBL NBBL=NBBL+1 NBLN=NEQ*NPBL IR=IR-NBLN NPBX=IR/NEQ2 IF (NPBX.GT.NEQ) NPBX=NEQ NBBX=(NEQ-1)/NPBX NLBX=NEQ-NBBX*NPBX NBBX=NBBX+1 IB11=1 IF (ICASE.LT.3) IB11=IMAT+1 5 IC11=IB11+NBLN ID11=IC11+NBLN IX11=IMAT+1 WRITE(3,11) NEQ2 IF (ICASX.EQ.1) RETURN WRITE(3,8) ICASX WRITE(3,9) NBBX,NPBX,NLBX WRITE(3,10) NBBL,NPBL,NLBL RETURN 6 WRITE(3,7) IRESRV,IMAT,NEQ,NEQ2 STOP C 7 FORMAT (55H ERROR - INSUFFICIENT STORAGE FOR INTERACTION MATRICIES 1,24H IRESRV,IMAT,NEQ,NEQ2 =,4I5) 8 FORMAT (48H FILE STORAGE FOR NEW MATRIX SECTIONS - ICASX =,I2) 9 FORMAT (19H B FILLED BY ROWS -,15X,12HNO. BLOCKS =,I3,3X,16HROWS P 1ER BLOCK =,I3,3X,20HROWS IN LAST BLOCK =,I3) 10 FORMAT (32H B BY COLUMNS, C AND D BY ROWS -,2X,12HNO. BLOCKS =,I3, 14X,15HR/C PER BLOCK =,I3,4X,19HR/C IN LAST BLOCK =,I3) 11 FORMAT (//,35H N.G.F. - NUMBER OF NEW UNKNOWNS IS,I4) END SUBROUTINE FFLD (THET,PHI,ETH,EPH) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C FFLD CALCULATES THE FAR ZONE RADIATED ELECTRIC FIELDS, C THE FACTOR EXP(J*K*R)/(R/LAMDA) NOT INCLUDED C COMPLEX*16 CIX,CIY,CIZ,EXA,ETH,EPH,CONST,CCX,CCY,CCZ,CDP,CUR COMPLEX*16 ZRATI,ZRSIN,RRV,RRH,RRV1,RRH1,RRV2,RRH2,ZRATI2,TIX,TIY 1,TIZ,T1,ZSCRN,EX,EY,EZ,GX,GY,GZ,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF DIMENSION CAB(1), SAB(1), CONSX(2) EQUIVALENCE (CAB,ALP), (SAB,BET), (CONST,CONSX) DATA PI,TP,ETA/3.141592654D+0,6.283185308D+0,376.73/ DATA CONSX/0.,-29.97922085D+0/ PHX=-SIN(PHI) PHY=COS(PHI) ROZ=COS(THET) ROZS=ROZ THX=ROZ*PHY THY=-ROZ*PHX THZ=-SIN(THET) ROX=-THZ*PHY ROY=THZ*PHX IF (N.EQ.0) GO TO 20 C C LOOP FOR STRUCTURE IMAGE IF ANY C DO 19 K=1,KSYMP C C CALCULATION OF REFLECTION COEFFECIENTS C IF (K.EQ.1) GO TO 4 IF (IPERF.NE.1) GO TO 1 C C FOR PERFECT GROUND C RRV=-(1.,0.) RRH=-(1.,0.) GO TO 2 C C FOR INFINITE PLANAR GROUND C 1 ZRSIN=SQRT(1.-ZRATI*ZRATI*THZ*THZ) RRV=-(ROZ-ZRATI*ZRSIN)/(ROZ+ZRATI*ZRSIN) RRH=(ZRATI*ROZ-ZRSIN)/(ZRATI*ROZ+ZRSIN) 2 IF (IFAR.LE.1) GO TO 3 C C FOR THE CLIFF PROBLEM, TWO REFLCTION COEFFICIENTS CALCULATED C RRV1=RRV RRH1=RRH TTHET=TAN(THET) IF (IFAR.EQ.4) GO TO 3 ZRSIN=SQRT(1.-ZRATI2*ZRATI2*THZ*THZ) RRV2=-(ROZ-ZRATI2*ZRSIN)/(ROZ+ZRATI2*ZRSIN) RRH2=(ZRATI2*ROZ-ZRSIN)/(ZRATI2*ROZ+ZRSIN) DARG=-TP*2.*CH*ROZ 3 ROZ=-ROZ CCX=CIX CCY=CIY CCZ=CIZ 4 CIX=(0.,0.) CIY=(0.,0.) CIZ=(0.,0.) C C LOOP OVER STRUCTURE SEGMENTS C DO 17 I=1,N OMEGA=-(ROX*CAB(I)+ROY*SAB(I)+ROZ*SALP(I)) EL=PI*SI(I) SILL=OMEGA*EL TOP=EL+SILL BOT=EL-SILL IF (ABS(OMEGA).LT.1.D-7) GO TO 5 A=2.*SIN(SILL)/OMEGA GO TO 6 5 A=(2.-OMEGA*OMEGA*EL*EL/3.)*EL 6 IF (ABS(TOP).LT.1.D-7) GO TO 7 TOO=SIN(TOP)/TOP GO TO 8 7 TOO=1.-TOP*TOP/6. 8 IF (ABS(BOT).LT.1.D-7) GO TO 9 BOO=SIN(BOT)/BOT GO TO 10 9 BOO=1.-BOT*BOT/6. 10 B=EL*(BOO-TOO) C=EL*(BOO+TOO) RR=A*AIR(I)+B*BII(I)+C*CIR(I) RI=A*AII(I)-B*BIR(I)+C*CII(I) ARG=TP*(X(I)*ROX+Y(I)*ROY+Z(I)*ROZ) IF (K.EQ.2.AND.IFAR.GE.2) GO TO 11 EXA=DCMPLX(COS(ARG),SIN(ARG))*DCMPLX(RR,RI) C C SUMMATION FOR FAR FIELD INTEGRAL C CIX=CIX+EXA*CAB(I) CIY=CIY+EXA*SAB(I) CIZ=CIZ+EXA*SALP(I) GO TO 17 C C CALCULATION OF IMAGE CONTRIBUTION IN CLIFF AND GROUND SCREEN C PROBLEMS. C 11 DR=Z(I)*TTHET C C SPECULAR POINT DISTANCE C D=DR*PHY+X(I) IF (IFAR.EQ.2) GO TO 13 D=SQRT(D*D+(Y(I)-DR*PHX)**2) IF (IFAR.EQ.3) GO TO 13 IF ((SCRWL-D).LT.0.) GO TO 12 C C RADIAL WIRE GROUND SCREEN REFLECTION COEFFICIENT C D=D+T2 ZSCRN=T1*D*LOG(D/T2) ZSCRN=(ZSCRN*ZRATI)/(ETA*ZRATI+ZSCRN) ZRSIN=SQRT(1.-ZSCRN*ZSCRN*THZ*THZ) RRV=(ROZ+ZSCRN*ZRSIN)/(-ROZ+ZSCRN*ZRSIN) RRH=(ZSCRN*ROZ+ZRSIN)/(ZSCRN*ROZ-ZRSIN) GO TO 16 12 IF (IFAR.EQ.4) GO TO 14 IF (IFAR.EQ.5) D=DR*PHY+X(I) 13 IF ((CL-D).LE.0.) GO TO 15 14 RRV=RRV1 RRH=RRH1 GO TO 16 15 RRV=RRV2 RRH=RRH2 ARG=ARG+DARG 16 EXA=DCMPLX(COS(ARG),SIN(ARG))*DCMPLX(RR,RI) C C CONTRIBUTION OF EACH IMAGE SEGMENT MODIFIED BY REFLECTION COEF. , C FOR CLIFF AND GROUND SCREEN PROBLEMS C TIX=EXA*CAB(I) TIY=EXA*SAB(I) TIZ=EXA*SALP(I) CDP=(TIX*PHX+TIY*PHY)*(RRH-RRV) CIX=CIX+TIX*RRV+CDP*PHX CIY=CIY+TIY*RRV+CDP*PHY CIZ=CIZ-TIZ*RRV 17 CONTINUE IF (K.EQ.1) GO TO 19 IF (IFAR.GE.2) GO TO 18 C C CALCULATION OF CONTRIBUTION OF STRUCTURE IMAGE FOR INFINITE GROUND C CDP=(CIX*PHX+CIY*PHY)*(RRH-RRV) CIX=CCX+CIX*RRV+CDP*PHX CIY=CCY+CIY*RRV+CDP*PHY CIZ=CCZ-CIZ*RRV GO TO 19 18 CIX=CIX+CCX CIY=CIY+CCY CIZ=CIZ+CCZ 19 CONTINUE IF (M.GT.0) GO TO 21 ETH=(CIX*THX+CIY*THY+CIZ*THZ)*CONST EPH=(CIX*PHX+CIY*PHY)*CONST RETURN 20 CIX=(0.,0.) CIY=(0.,0.) CIZ=(0.,0.) 21 ROZ=ROZS C C ELECTRIC FIELD COMPONENTS C RFL=-1. DO 25 IP=1,KSYMP RFL=-RFL RRZ=ROZ*RFL CALL FFLDS (ROX,ROY,RRZ,CUR(N+1),GX,GY,GZ) IF (IP.EQ.2) GO TO 22 EX=GX EY=GY EZ=GZ GO TO 25 22 IF (IPERF.NE.1) GO TO 23 GX=-GX GY=-GY GZ=-GZ GO TO 24 23 RRV=SQRT(1.-ZRATI*ZRATI*THZ*THZ) RRH=ZRATI*ROZ RRH=(RRH-RRV)/(RRH+RRV) RRV=ZRATI*RRV RRV=-(ROZ-RRV)/(ROZ+RRV) ETH=(GX*PHX+GY*PHY)*(RRH-RRV) GX=GX*RRV+ETH*PHX GY=GY*RRV+ETH*PHY GZ=GZ*RRV 24 EX=EX+GX EY=EY+GY EZ=EZ-GZ 25 CONTINUE EX=EX+CIX*CONST EY=EY+CIY*CONST EZ=EZ+CIZ*CONST ETH=EX*THX+EY*THY+EZ*THZ EPH=EX*PHX+EY*PHY RETURN END SUBROUTINE FFLDS (ROX,ROY,ROZ,SCUR,EX,EY,EZ) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C CALCULATES THE XYZ COMPONENTS OF THE ELECTRIC FIELD DUE TO C SURFACE CURRENTS COMPLEX*16 CT,CONS,SCUR,EX,EY,EZ COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM DIMENSION XS(1), YS(1), ZS(1), S(1), SCUR(1), CONSX(2) EQUIVALENCE (XS,X), (YS,Y), (ZS,Z), (S,BI), (CONS,CONSX) DATA TPI/6.283185308D+0/,CONSX/0.,188.365/ EX=(0.,0.) EY=(0.,0.) EZ=(0.,0.) I=LD+1 DO 1 J=1,M I=I-1 ARG=TPI*(ROX*XS(I)+ROY*YS(I)+ROZ*ZS(I)) CT=DCMPLX(COS(ARG)*S(I),SIN(ARG)*S(I)) K=3*J EX=EX+SCUR(K-2)*CT EY=EY+SCUR(K-1)*CT EZ=EZ+SCUR(K)*CT 1 CONTINUE CT=ROX*EX+ROY*EY+ROZ*EZ EX=CONS*(CT*ROX-EX) EY=CONS*(CT*ROY-EY) EZ=CONS*(CT*ROZ-EZ) RETURN END SUBROUTINE GF (ZK,CO,SI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C GF COMPUTES THE INTEGRAND EXP(JKR)/(KR) FOR NUMERICAL INTEGRATION. C COMMON /TMI/ ZPK,RKB2,IJ ZDK=ZK-ZPK RK=SQRT(RKB2+ZDK*ZDK) SI=SIN(RK)/RK IF (IJ) 1,2,1 1 CO=COS(RK)/RK RETURN 2 IF (RK.LT..2) GO TO 3 CO=(COS(RK)-1.)/RK RETURN 3 RKS=RK*RK CO=((-1.38888889D-3*RKS+4.16666667D-2)*RKS-.5)*RK RETURN END SUBROUTINE GFIL (IPRT) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' PARAMETER (IRESRV=MAXMAT**2) IMPLICIT REAL*8(A-H,O-Z) C *** C C GFIL READS THE N.G.F. FILE C COMPLEX*16 CM,SSX,ZRATI,ZRATI2,T1,ZARRAY,AR1,AR2,AR3,EPSCF,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /CMB/ CM(IRESRV) COMMON /ANGL/ SALP(MAXSEG) COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3),DY 1A(3),XSA(3),YSA(3),NXA(3),NYA(3) COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SMAT/ SSX(16,16) COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF COMMON/SAVE/EPSR,SIG,SCRWLT,SCRWRT,FMHZ,IP(2*MAXSEG),KCOM COMMON/CSAVE/COM(19,5) C C*** ERROR CORRECTED 11/20/89 ******************************* DIMENSION T2X(1),T2Y(1),T2Z(1) EQUIVALENCE (T2X,ICON1),(T2Y,ICON2),(T2Z,ITAG) C*** DATA IGFL/20/ OPEN(UNIT=IGFL,FILE='NGF2D.NEC',FORM='UNFORMATTED',STATUS='OLD') REWIND IGFL READ (IGFL) N1,NP,M1,MP,WLAM,FMHZ,IPSYM,KSYMP,IPERF,NRADL,EPSR,SIG 1,SCRWLT,SCRWRT,NLODF,KCOM N=N1 M=M1 N2=N1+1 M2=M1+1 IF (N1.EQ.0) GO TO 2 C READ SEG. DATA AND CONVERT BACK TO END COORD. IN UNITS OF METERS READ (IGFL) (X(I),I=1,N1),(Y(I),I=1,N1),(Z(I),I=1,N1) READ (IGFL) (SI(I),I=1,N1),(BI(I),I=1,N1),(ALP(I),I=1,N1) READ (IGFL) (BET(I),I=1,N1),(SALP(I),I=1,N1) READ (IGFL) (ICON1(I),I=1,N1),(ICON2(I),I=1,N1) READ (IGFL) (ITAG(I),I=1,N1) IF (NLODF.NE.0) READ (IGFL) (ZARRAY(I),I=1,N1) DO 1 I=1,N1 XI=X(I)*WLAM YI=Y(I)*WLAM ZI=Z(I)*WLAM DX=SI(I)*.5*WLAM X(I)=XI-ALP(I)*DX Y(I)=YI-BET(I)*DX Z(I)=ZI-SALP(I)*DX SI(I)=XI+ALP(I)*DX ALP(I)=YI+BET(I)*DX BET(I)=ZI+SALP(I)*DX BI(I)=BI(I)*WLAM 1 CONTINUE 2 IF (M1.EQ.0) GO TO 4 J=LD-M1+1 C READ PATCH DATA AND CONVERT TO METERS READ (IGFL) (X(I),I=J,LD),(Y(I),I=J,LD),(Z(I),I=J,LD) READ (IGFL) (SI(I),I=J,LD),(BI(I),I=J,LD),(ALP(I),I=J,LD) READ (IGFL) (BET(I),I=J,LD),(SALP(I),I=J,LD) C*** ERROR CORRECTED 11/20/89 ******************************* READ (IGFL) (T2X(I),I=J,LD),(T2Y(I),I=J,LD) READ (IGFL) (T2Z(I),I=J,LD) C READ (IGFL) (ICON1(I),I=J,LD),(ICON2(I),I=J,LD) C READ (IGFL) (ITAG(I),I=J,LD) C DX=WLAM*WLAM DO 3 I=J,LD X(I)=X(I)*WLAM Y(I)=Y(I)*WLAM Z(I)=Z(I)*WLAM 3 BI(I)=BI(I)*DX 4 READ (IGFL) ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT IF (IPERF.EQ.2) READ (IGFL) AR1,AR2,AR3,EPSCF,DXA,DYA,XSA,YSA,NXA, 1NYA NEQ=N1+2*M1 NPEQ=NP+2*MP NOP=NEQ/NPEQ IF (NOP.GT.1) READ (IGFL) ((SSX(I,J),I=1,NOP),J=1,NOP) READ (IGFL) (IP(I),I=1,NEQ),COM C READ MATRIX A AND WRITE TAPE13 FOR OUT OF CORE IF (ICASE.GT.2) GO TO 5 IOUT=NEQ*NPEQ READ (IGFL) (CM(I),I=1,IOUT) GO TO 10 5 REWIND 13 IF (ICASE.NE.4) GO TO 7 IOUT=NPEQ*NPEQ DO 6 K=1,NOP READ (IGFL) (CM(J),J=1,IOUT) 6 WRITE (13) (CM(J),J=1,IOUT) GO TO 9 7 IOUT=NPSYM*NPEQ*2 NBL2=2*NBLSYM DO 8 IOP=1,NOP DO 8 I=1,NBL2 CALL BLCKIN (CM,IGFL,1,IOUT,1,206) 8 CALL BLCKOT (CM,13,1,IOUT,1,205) 9 REWIND 13 10 REWIND IGFL C WRITE(3,N) G.F. HEADING WRITE(3,16) WRITE(3,14) WRITE(3,14) WRITE(3,17) WRITE(3,18) N1,M1 IF (NOP.GT.1) WRITE(3,19) NOP WRITE(3,20) IMAT,ICASE IF (ICASE.LT.3) GO TO 11 NBL2=NEQ*NPEQ WRITE(3,21) NBL2 11 WRITE(3,22) FMHZ IF (KSYMP.EQ.2.AND.IPERF.EQ.1) WRITE(3,23) IF (KSYMP.EQ.2.AND.IPERF.EQ.0) WRITE(3,27) IF (KSYMP.EQ.2.AND.IPERF.EQ.2) WRITE(3,28) IF (KSYMP.EQ.2.AND.IPERF.NE.1) WRITE(3,24) EPSR,SIG WRITE(3,17) DO 12 J=1,KCOM 12 WRITE(3,15) (COM(I,J),I=1,19) WRITE(3,17) WRITE(3,14) WRITE(3,14) WRITE(3,16) IF (IPRT.EQ.0) RETURN WRITE(3,25) DO 13 I=1,N1 13 WRITE(3,26) I,X(I),Y(I),Z(I),SI(I),ALP(I),BET(I) RETURN C 14 FORMAT (5X,50H**************************************************, &34H**********************************) 15 FORMAT (5X,3H** ,19A4,3H **) 16 FORMAT (////) 17 FORMAT (5X,2H**,80X,2H**) 18 FORMAT (5X,29H** NUMERICAL GREEN'S FUNCTION,53X,2H**,/,5X,17H** NO 1. SEGMENTS =,I4,10X,13HNO. PATCHES =,I4,34X,2H**) 19 FORMAT (5X,27H** NO. SYMMETRIC SECTIONS =,I4,51X,2H**) 20 FORMAT (5X,34H** N.G.F. MATRIX - CORE STORAGE =,I7,23H COMPLEX NU 1MBERS, CASE,I2,16X,2H**) 21 FORMAT (5X,2H**,19X,13HMATRIX SIZE =,I7,16H COMPLEX NUMBERS,25X,2H 1**) 22 FORMAT (5X,14H** FREQUENCY =,1P,E12.5,5H MHZ.,51X,2H**) 23 FORMAT (5X,17H** PERFECT GROUND,65X,2H**) 24 FORMAT (5X,44H** GROUND PARAMETERS - DIELECTRIC CONSTANT =,1P, 1E12.5,26X,2H**,/,5X,2H**,21X,14HCONDUCTIVITY =,E12.5,8H MHOS/M., 225X,2H**) 25 FORMAT (39X,31HNUMERICAL GREEN'S FUNCTION DATA,/,41X,27HCOORDINATE 1S OF SEGMENT ENDS,/,51X,8H(METERS),/,5X,4HSEG.,11X,19H- - - END ON 2E - - -,26X,19H- - - END TWO - - -,/,6X,3HNO.,6X,1HX,14X,1HY,14X,1 3HZ,14X,1HX,14X,1HY,14X,1HZ) 26 FORMAT (1X,I7,1P,6E15.6) 27 FORMAT (5X,55H** FINITE GROUND. REFLECTION COEFFICIENT APPROXIMAT 1ION,27X,2H**) 28 FORMAT (5X,38H** FINITE GROUND. SOMMERFELD SOLUTION,44X,2H**) END SUBROUTINE GFLD (RHO,PHI,RZ,ETH,EPI,ERD,UX,KSYMP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C GFLD COMPUTES THE RADIATED FIELD INCLUDING GROUND WAVE. C COMPLEX*16 CUR,EPI,CIX,CIY,CIZ,EXA,XX1,XX2,U,U2,ERV,EZV,ERH,EPH COMPLEX*16 EZH,EX,EY,ETH,UX,ERD COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /GWAV/ U,U2,XX1,XX2,R1,R2,ZMH,ZPH DIMENSION CAB(1), SAB(1) EQUIVALENCE (CAB(1),ALP(1)), (SAB(1),BET(1)) DATA PI,TP/3.141592654D+0,6.283185308D+0/ R=SQRT(RHO*RHO+RZ*RZ) IF (KSYMP.EQ.1) GO TO 1 IF (ABS(UX).GT..5) GO TO 1 IF (R.GT.1.E5) GO TO 1 GO TO 4 C C COMPUTATION OF SPACE WAVE ONLY C 1 IF (RZ.LT.1.D-20) GO TO 2 THET=ATAN(RHO/RZ) GO TO 3 2 THET=PI*.5 3 CALL FFLD (THET,PHI,ETH,EPI) ARG=-TP*R EXA=DCMPLX(COS(ARG),SIN(ARG))/R ETH=ETH*EXA EPI=EPI*EXA ERD=(0.,0.) RETURN C C COMPUTATION OF SPACE AND GROUND WAVES. C 4 U=UX U2=U*U PHX=-SIN(PHI) PHY=COS(PHI) RX=RHO*PHY RY=-RHO*PHX CIX=(0.,0.) CIY=(0.,0.) CIZ=(0.,0.) C C SUMMATION OF FIELD FROM INDIVIDUAL SEGMENTS C DO 17 I=1,N DX=CAB(I) DY=SAB(I) DZ=SALP(I) RIX=RX-X(I) RIY=RY-Y(I) RHS=RIX*RIX+RIY*RIY RHP=SQRT(RHS) IF (RHP.LT.1.D-6) GO TO 5 RHX=RIX/RHP RHY=RIY/RHP GO TO 6 5 RHX=1. RHY=0. 6 CALP=1.-DZ*DZ IF (CALP.LT.1.D-6) GO TO 7 CALP=SQRT(CALP) CBET=DX/CALP SBET=DY/CALP CPH=RHX*CBET+RHY*SBET SPH=RHY*CBET-RHX*SBET GO TO 8 7 CPH=RHX SPH=RHY 8 EL=PI*SI(I) RFL=-1. C C INTEGRATION OF (CURRENT)*(PHASE FACTOR) OVER SEGMENT AND IMAGE FOR C CONSTANT, SINE, AND COSINE CURRENT DISTRIBUTIONS C DO 16 K=1,2 RFL=-RFL RIZ=RZ-Z(I)*RFL RXYZ=SQRT(RIX*RIX+RIY*RIY+RIZ*RIZ) RNX=RIX/RXYZ RNY=RIY/RXYZ RNZ=RIZ/RXYZ OMEGA=-(RNX*DX+RNY*DY+RNZ*DZ*RFL) SILL=OMEGA*EL TOP=EL+SILL BOT=EL-SILL IF (ABS(OMEGA).LT.1.D-7) GO TO 9 A=2.*SIN(SILL)/OMEGA GO TO 10 9 A=(2.-OMEGA*OMEGA*EL*EL/3.)*EL 10 IF (ABS(TOP).LT.1.D-7) GO TO 11 TOO=SIN(TOP)/TOP GO TO 12 11 TOO=1.-TOP*TOP/6. 12 IF (ABS(BOT).LT.1.D-7) GO TO 13 BOO=SIN(BOT)/BOT GO TO 14 13 BOO=1.-BOT*BOT/6. 14 B=EL*(BOO-TOO) C=EL*(BOO+TOO) RR=A*AIR(I)+B*BII(I)+C*CIR(I) RI=A*AII(I)-B*BIR(I)+C*CII(I) ARG=TP*(X(I)*RNX+Y(I)*RNY+Z(I)*RNZ*RFL) EXA=DCMPLX(COS(ARG),SIN(ARG))*DCMPLX(RR,RI)/TP IF (K.EQ.2) GO TO 15 XX1=EXA R1=RXYZ ZMH=RIZ GO TO 16 15 XX2=EXA R2=RXYZ ZPH=RIZ 16 CONTINUE C C CALL SUBROUTINE TO COMPUTE THE FIELD OF SEGMENT INCLUDING GROUND C WAVE. C CALL GWAVE (ERV,EZV,ERH,EZH,EPH) ERH=ERH*CPH*CALP+ERV*DZ EPH=EPH*SPH*CALP EZH=EZH*CPH*CALP+EZV*DZ EX=ERH*RHX-EPH*RHY EY=ERH*RHY+EPH*RHX CIX=CIX+EX CIY=CIY+EY 17 CIZ=CIZ+EZH ARG=-TP*R EXA=DCMPLX(COS(ARG),SIN(ARG)) CIX=CIX*EXA CIY=CIY*EXA CIZ=CIZ*EXA RNX=RX/R RNY=RY/R RNZ=RZ/R THX=RNZ*PHY THY=-RNZ*PHX THZ=-RHO/R ETH=CIX*THX+CIY*THY+CIZ*THZ EPI=CIX*PHX+CIY*PHY ERD=CIX*RNX+CIY*RNY+CIZ*RNZ RETURN END SUBROUTINE GFOUT C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' PARAMETER (IRESRV=MAXMAT**2) IMPLICIT REAL*8(A-H,O-Z) C *** C C WRITE N.G.F. FILE C COMPLEX*16 CM,SSX,ZRATI,ZRATI2,T1,ZARRAY,AR1,AR2,AR3,EPSCF,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /CMB/ CM(IRESRV) COMMON /ANGL/ SALP(MAXSEG) COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3),DY 1A(3),XSA(3),YSA(3),NXA(3),NYA(3) COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SMAT/ SSX(16,16) COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF COMMON/SAVE/EPSR,SIG,SCRWLT,SCRWRT,FMHZ,IP(2*MAXSEG),KCOM COMMON/CSAVE/COM(19,5) C C*** ERROR CORRECTED 11/20/89 ******************************* DIMENSION T2X(1),T2Y(1),T2Z(1) EQUIVALENCE (T2X,ICON1),(T2Y,ICON2),(T2Z,ITAG) C*** DATA IGFL/20/ OPEN(UNIT=IGFL,FILE='NGF2D.NEC',FORM='UNFORMATTED',STATUS='NEW') NEQ=N+2*M NPEQ=NP+2*MP NOP=NEQ/NPEQ WRITE (IGFL) N,NP,M,MP,WLAM,FMHZ,IPSYM,KSYMP,IPERF,NRADL,EPSR, 1SIG,SCRWLT,SCRWRT,NLOAD,KCOM IF (N.EQ.0) GO TO 1 WRITE (IGFL) (X(I),I=1,N),(Y(I),I=1,N),(Z(I),I=1,N) WRITE (IGFL) (SI(I),I=1,N),(BI(I),I=1,N),(ALP(I),I=1,N) WRITE (IGFL) (BET(I),I=1,N),(SALP(I),I=1,N) WRITE (IGFL) (ICON1(I),I=1,N),(ICON2(I),I=1,N) WRITE (IGFL) (ITAG(I),I=1,N) IF (NLOAD.GT.0) WRITE (IGFL) (ZARRAY(I),I=1,N) 1 IF (M.EQ.0) GO TO 2 J=LD-M+1 WRITE (IGFL) (X(I),I=J,LD),(Y(I),I=J,LD),(Z(I),I=J,LD) WRITE (IGFL) (SI(I),I=J,LD),(BI(I),I=J,LD),(ALP(I),I=J,LD) WRITE (IGFL) (BET(I),I=J,LD),(SALP(I),I=J,LD) C C*** ERROR CORRECTED 11/20/89 ******************************* WRITE (IGFL) (T2X(I),I=J,LD),(T2Y(I),I=J,LD) WRITE (IGFL) (T2Z(I),I=J,LD) C WRITE (IGFL) (ICON1(I),I=J,LD),(ICON2(I),I=J,LD) C WRITE (IGFL) (ITAG(I),I=J,LD) C 2 WRITE (IGFL) ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT IF (IPERF.EQ.2) WRITE (IGFL) AR1,AR2,AR3,EPSCF,DXA,DYA,XSA,YSA,NXA 1,NYA IF (NOP.GT.1) WRITE (IGFL) ((SSX(I,J),I=1,NOP),J=1,NOP) WRITE (IGFL) (IP(I),I=1,NEQ),COM IF (ICASE.GT.2) GO TO 3 IOUT=NEQ*NPEQ WRITE (IGFL) (CM(I),I=1,IOUT) GO TO 12 3 IF (ICASE.NE.4) GO TO 5 REWIND 13 I=NPEQ*NPEQ DO 4 K=1,NOP READ (13) (CM(J),J=1,I) 4 WRITE (IGFL) (CM(J),J=1,I) REWIND 13 GO TO 12 5 REWIND 13 REWIND 14 IF (ICASE.EQ.5) GO TO 8 IOUT=NPBLK*NEQ*2 DO 6 I=1,NBLOKS CALL BLCKIN (CM,13,1,IOUT,1,201) 6 CALL BLCKOT (CM,IGFL,1,IOUT,1,202) DO 7 I=1,NBLOKS CALL BLCKIN (CM,14,1,IOUT,1,203) 7 CALL BLCKOT (CM,IGFL,1,IOUT,1,204) GO TO 12 8 IOUT=NPSYM*NPEQ*2 DO 11 IOP=1,NOP DO 9 I=1,NBLSYM CALL BLCKIN (CM,13,1,IOUT,1,205) 9 CALL BLCKOT (CM,IGFL,1,IOUT,1,206) DO 10 I=1,NBLSYM CALL BLCKIN (CM,14,1,IOUT,1,207) 10 CALL BLCKOT (CM,IGFL,1,IOUT,1,208) 11 CONTINUE REWIND 13 REWIND 14 12 REWIND IGFL WRITE(3,13) IGFL,IMAT RETURN C 13 FORMAT (///,44H ****NUMERICAL GREEN'S FUNCTION FILE ON TAPE,I3,5H 1****,/,5X,16HMATRIX STORAGE -,I7,16H COMPLEX NUMBERS,///) END SUBROUTINE GH (ZK,HR,HI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C INTEGRAND FOR H FIELD OF A WIRE COMMON /TMH/ ZPK,RHKS RS=ZK-ZPK RS=RHKS+RS*RS R=SQRT(RS) CKR=COS(R) SKR=SIN(R) RR2=1./RS RR3=RR2/R HR=SKR*RR2+CKR*RR3 HI=CKR*RR2-SKR*RR3 RETURN END SUBROUTINE GWAVE (ERV,EZV,ERH,EZH,EPH) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C GWAVE COMPUTES THE ELECTRIC FIELD, INCLUDING GROUND WAVE, OF A C CURRENT ELEMENT OVER A GROUND PLANE USING FORMULAS OF K.A. NORTON C (PROC. IRE, SEPT., 1937, PP.1203,1236.) C COMPLEX*16 FJ,TPJ,U2,U,RK1,RK2,T1,T2,T3,T4,P1,RV,OMR,W,F,Q1,RH,V,G 1,XR1,XR2,X1,X2,X3,X4,X5,X6,X7,EZV,ERV,EZH,ERH,EPH,XX1,XX2,ECON, 2FBAR COMMON /GWAV/ U,U2,XX1,XX2,R1,R2,ZMH,ZPH DIMENSION FJX(2), TPJX(2), ECONX(2) EQUIVALENCE (FJ,FJX), (TPJ,TPJX), (ECON,ECONX) DATA PI/3.141592654D+0/,FJX/0.,1./,TPJX/0.,6.283185308D+0/ DATA ECONX/0.,-188.367/ SPPP=ZMH/R1 SPPP2=SPPP*SPPP CPPP2=1.-SPPP2 IF (CPPP2.LT.1.D-20) CPPP2=1.D-20 CPPP=SQRT(CPPP2) SPP=ZPH/R2 SPP2=SPP*SPP CPP2=1.-SPP2 IF (CPP2.LT.1.D-20) CPP2=1.D-20 CPP=SQRT(CPP2) RK1=-TPJ*R1 RK2=-TPJ*R2 T1=1.-U2*CPP2 T2=SQRT(T1) T3=(1.-1./RK1)/RK1 T4=(1.-1./RK2)/RK2 P1=RK2*U2*T1/(2.*CPP2) RV=(SPP-U*T2)/(SPP+U*T2) OMR=1.-RV W=1./OMR W=(4.,0.)*P1*W*W F=FBAR(W) Q1=RK2*T1/(2.*U2*CPP2) RH=(T2-U*SPP)/(T2+U*SPP) V=1./(1.+RH) V=(4.,0.)*Q1*V*V G=FBAR(V) XR1=XX1/R1 XR2=XX2/R2 X1=CPPP2*XR1 X2=RV*CPP2*XR2 X3=OMR*CPP2*F*XR2 X4=U*T2*SPP*2.*XR2/RK2 X5=XR1*T3*(1.-3.*SPPP2) X6=XR2*T4*(1.-3.*SPP2) EZV=(X1+X2+X3-X4-X5-X6)*ECON X1=SPPP*CPPP*XR1 X2=RV*SPP*CPP*XR2 X3=CPP*OMR*U*T2*F*XR2 X4=SPP*CPP*OMR*XR2/RK2 X5=3.*SPPP*CPPP*T3*XR1 X6=CPP*U*T2*OMR*XR2/RK2*.5 X7=3.*SPP*CPP*T4*XR2 ERV=-(X1+X2-X3+X4-X5+X6-X7)*ECON EZH=-(X1-X2+X3-X4-X5-X6+X7)*ECON X1=SPPP2*XR1 X2=RV*SPP2*XR2 X4=U2*T1*OMR*F*XR2 X5=T3*(1.-3.*CPPP2)*XR1 X6=T4*(1.-3.*CPP2)*(1.-U2*(1.+RV)-U2*OMR*F)*XR2 X7=U2*CPP2*OMR*(1.-1./RK2)*(F*(U2*T1-SPP2-1./RK2)+1./RK2)*XR2 ERH=(X1-X2-X4-X5+X6+X7)*ECON X1=XR1 X2=RH*XR2 X3=(RH+1.)*G*XR2 X4=T3*XR1 X5=T4*(1.-U2*(1.+RV)-U2*OMR*F)*XR2 X6=.5*U2*OMR*(F*(U2*T1-SPP2-1./RK2)+1./RK2)*XR2/RK2 EPH=-(X1-X2+X3-X4+X5+X6)*ECON RETURN END SUBROUTINE GX (ZZ,RH,XK,GZ,GZP) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C SEGMENT END CONTRIBUTIONS FOR THIN WIRE APPROX. COMPLEX*16 GZ,GZP R2=ZZ*ZZ+RH*RH R=SQRT(R2) RK=XK*R GZ=DCMPLX(COS(RK),-SIN(RK))/R GZP=-DCMPLX(1.D+0,RK)*GZ/R2 RETURN END SUBROUTINE GXX (ZZ,RH,A,A2,XK,IRA,G1,G1P,G2,G2P,G3,GZP) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C SEGMENT END CONTRIBUTIONS FOR EXT. THIN WIRE APPROX. COMPLEX*16 GZ,C1,C2,C3,G1,G1P,G2,G2P,G3,GZP R2=ZZ*ZZ+RH*RH R=SQRT(R2) R4=R2*R2 RK=XK*R RK2=RK*RK RH2=RH*RH T1=.25*A2*RH2/R4 T2=.5*A2/R2 C1=DCMPLX(1.D+0,RK) C2=3.*C1-RK2 C3=DCMPLX(6.D+0,RK)*RK2-15.*C1 GZ=DCMPLX(COS(RK),-SIN(RK))/R G2=GZ*(1.+T1*C2) G1=G2-T2*C1*GZ GZ=GZ/R2 G2P=GZ*(T1*C3-C1) GZP=T2*C2*GZ G3=G2P+GZP G1P=G3*ZZ IF (IRA.EQ.1) GO TO 2 G3=(G3+GZP)*RH GZP=-ZZ*C1*GZ IF (RH.GT.1.D-10) GO TO 1 G2=0. G2P=0. RETURN 1 G2=G2/RH G2P=G2P*ZZ/RH RETURN 2 T2=.5*A G2=-T2*C1*GZ G2P=T2*GZ*C2/R2 G3=RH2*G2P-A*GZ*C1 G2P=G2P*ZZ GZP=-ZZ*C1*GZ RETURN END SUBROUTINE HELIX(S,HL,A1,B1,A2,B2,RAD,NS,ITG) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C SUBROUTINE HELIX GENERATES SEGMENT GEOMETRY DATA FOR A HELIX OF NS C SEGMENTS COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM DIMENSION X2(1),Y2(1),Z2(1) EQUIVALENCE (X2(1),SI(1)), (Y2(1),ALP(1)), (Z2(1),BET(1)) DATA PI/3.1415926D+0/ IST=N+1 N=N+NS NP=N MP=M IPSYM=0 IF(NS.LT.1) RETURN TURNS=ABS(HL/S) ZINC=ABS(HL/NS) Z(IST)=0. DO 25 I=IST,N BI(I)=RAD ITAG(I)=ITG IF(I.NE.IST) Z(I)=Z(I-1)+ZINC Z2(I)=Z(I)+ZINC IF(A2.NE.A1) GO TO 10 IF(B1.EQ.0) B1=A1 X(I)=A1*COS(2.*PI*Z(I)/S) Y(I)=B1*SIN(2.*PI*Z(I)/S) X2(I)=A1*COS(2.*PI*Z2(I)/S) Y2(I)=B1*SIN(2.*PI*Z2(I)/S) GO TO 20 10 IF(B2.EQ.0) B2=A2 X(I)=(A1+(A2-A1)*Z(I)/ABS(HL))*COS(2.*PI*Z(I)/S) Y(I)=(B1+(B2-B1)*Z(I)/ABS(HL))*SIN(2.*PI*Z(I)/S) X2(I)=(A1+(A2-A1)*Z2(I)/ABS(HL))*COS(2.*PI*Z2(I)/S) Y2(I)=(B1+(B2-B1)*Z2(I)/ABS(HL))*SIN(2.*PI*Z2(I)/S) 20 IF(HL.GT.0) GO TO 25 COPY=X(I) X(I)=Y(I) Y(I)=COPY COPY=X2(I) X2(I)=Y2(I) Y2(I)=COPY 25 CONTINUE IF(A2.EQ.A1) GO TO 21 SANGLE=ATAN(A2/(ABS(HL)+(ABS(HL)*A1)/(A2-A1))) WRITE(3,104) SANGLE 104 FORMAT(5X,'THE CONE ANGLE OF THE SPIRAL IS',F10.4) RETURN 21 IF(A1.NE.B1) GO TO 30 HDIA=2.*A1 TURN=HDIA*PI PITCH=ATAN(S/(PI*HDIA)) TURN=TURN/COS(PITCH) PITCH=180.*PITCH/PI GO TO 40 30 IF(A1.LT.B1) GO TO 34 HMAJ=2.*A1 HMIN=2.*B1 GO TO 35 34 HMAJ=2.*B1 HMIN=2.*A1 35 HDIA=SQRT((HMAJ**2+HMIN**2)/2*HMAJ) TURN=2.*PI*HDIA PITCH=(180./PI)*ATAN(S/(PI*HDIA)) 40 WRITE(3,105) PITCH,TURN 105 FORMAT(5X,'THE PITCH ANGLE IS',F10.4/5X,'THE LENGTH OF WIRE/TURN I 1S',F10.4) RETURN END SUBROUTINE HFK (EL1,EL2,RHK,ZPKX,SGR,SGI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C HFK COMPUTES THE H FIELD OF A UNIFORM CURRENT FILAMENT BY C NUMERICAL INTEGRATION COMMON /TMH/ ZPK,RHKS DATA NX,NM,NTS,RX/1,65536,4,1.D-4/ ZPK=ZPKX RHKS=RHK*RHK Z=EL1 ZE=EL2 S=ZE-Z EP=S/(10.*NM) ZEND=ZE-EP SGR=0.0 SGI=0.0 NS=NX NT=0 CALL GH (Z,G1R,G1I) 1 DZ=S/NS ZP=Z+DZ IF (ZP-ZE) 3,3,2 2 DZ=ZE-Z IF (ABS(DZ)-EP) 17,17,3 3 DZOT=DZ*.5 ZP=Z+DZOT CALL GH (ZP,G3R,G3I) ZP=Z+DZ CALL GH (ZP,G5R,G5I) 4 T00R=(G1R+G5R)*DZOT T00I=(G1I+G5I)*DZOT T01R=(T00R+DZ*G3R)*0.5 T01I=(T00I+DZ*G3I)*0.5 T10R=(4.0*T01R-T00R)/3.0 T10I=(4.0*T01I-T00I)/3.0 CALL TEST (T01R,T10R,TE1R,T01I,T10I,TE1I,0.D0) IF (TE1I-RX) 5,5,6 5 IF (TE1R-RX) 8,8,6 6 ZP=Z+DZ*0.25 CALL GH (ZP,G2R,G2I) ZP=Z+DZ*0.75 CALL GH (ZP,G4R,G4I) T02R=(T01R+DZOT*(G2R+G4R))*0.5 T02I=(T01I+DZOT*(G2I+G4I))*0.5 T11R=(4.0*T02R-T01R)/3.0 T11I=(4.0*T02I-T01I)/3.0 T20R=(16.0*T11R-T10R)/15.0 T20I=(16.0*T11I-T10I)/15.0 CALL TEST (T11R,T20R,TE2R,T11I,T20I,TE2I,0.D0) IF (TE2I-RX) 7,7,14 7 IF (TE2R-RX) 9,9,14 8 SGR=SGR+T10R SGI=SGI+T10I NT=NT+2 GO TO 10 9 SGR=SGR+T20R SGI=SGI+T20I NT=NT+1 10 Z=Z+DZ IF (Z-ZEND) 11,17,17 11 G1R=G5R G1I=G5I IF (NT-NTS) 1,12,12 12 IF (NS-NX) 1,1,13 13 NS=NS/2 NT=1 GO TO 1 14 NT=0 IF (NS-NM) 16,15,15 15 WRITE(3,18) Z GO TO 9 16 NS=NS*2 DZ=S/NS DZOT=DZ*0.5 G5R=G3R G5I=G3I G3R=G2R G3I=G2I GO TO 4 17 CONTINUE SGR=SGR*RHK*.5 SGI=SGI*RHK*.5 RETURN C 18 FORMAT (24H STEP SIZE LIMITED AT Z=,F10.5) END SUBROUTINE HINTG (XI,YI,ZI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C HINTG COMPUTES THE H FIELD OF A PATCH CURRENT COMPLEX*16 EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC,ZRATI,ZRATI2,GAM 1,F1X,F1Y,F1Z,F2X,F2Y,F2Z,RRV,RRH,T1,FRATI COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) DATA FPI/12.56637062D+0/,TP/6.283185308D+0/ RX=XI-XJ RY=YI-YJ RFL=-1. EXK=(0.,0.) EYK=(0.,0.) EZK=(0.,0.) EXS=(0.,0.) EYS=(0.,0.) EZS=(0.,0.) DO 5 IP=1,KSYMP RFL=-RFL RZ=ZI-ZJ*RFL RSQ=RX*RX+RY*RY+RZ*RZ IF (RSQ.LT.1.D-20) GO TO 5 R=SQRT(RSQ) RK=TP*R CR=COS(RK) SR=SIN(RK) GAM=-(DCMPLX(CR,-SR)+RK*DCMPLX(SR,CR))/(FPI*RSQ*R)*S EXC=GAM*RX EYC=GAM*RY EZC=GAM*RZ T1ZR=T1ZJ*RFL T2ZR=T2ZJ*RFL F1X=EYC*T1ZR-EZC*T1YJ F1Y=EZC*T1XJ-EXC*T1ZR F1Z=EXC*T1YJ-EYC*T1XJ F2X=EYC*T2ZR-EZC*T2YJ F2Y=EZC*T2XJ-EXC*T2ZR F2Z=EXC*T2YJ-EYC*T2XJ IF (IP.EQ.1) GO TO 4 IF (IPERF.NE.1) GO TO 1 F1X=-F1X F1Y=-F1Y F1Z=-F1Z F2X=-F2X F2Y=-F2Y F2Z=-F2Z GO TO 4 1 XYMAG=SQRT(RX*RX+RY*RY) IF (XYMAG.GT.1.D-6) GO TO 2 PX=0. PY=0. CTH=1. RRV=(1.,0.) GO TO 3 2 PX=-RY/XYMAG PY=RX/XYMAG CTH=RZ/R RRV=SQRT(1.-ZRATI*ZRATI*(1.-CTH*CTH)) 3 RRH=ZRATI*CTH RRH=(RRH-RRV)/(RRH+RRV) RRV=ZRATI*RRV RRV=-(CTH-RRV)/(CTH+RRV) GAM=(F1X*PX+F1Y*PY)*(RRV-RRH) F1X=F1X*RRH+GAM*PX F1Y=F1Y*RRH+GAM*PY F1Z=F1Z*RRH GAM=(F2X*PX+F2Y*PY)*(RRV-RRH) F2X=F2X*RRH+GAM*PX F2Y=F2Y*RRH+GAM*PY F2Z=F2Z*RRH 4 EXK=EXK+F1X EYK=EYK+F1Y EZK=EZK+F1Z EXS=EXS+F2X EYS=EYS+F2Y EZS=EZS+F2Z 5 CONTINUE RETURN END SUBROUTINE HSFLD (XI,YI,ZI,AI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C HSFLD COMPUTES THE H FIELD FOR CONSTANT, SINE, AND COSINE CURRENT C ON A SEGMENT INCLUDING GROUND EFFECTS. COMPLEX*16 EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC,ZRATI,ZRATI2,T1 1,HPK,HPS,HPC,QX,QY,QZ,RRV,RRH,ZRATX,FRATI COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF DATA ETA/376.73/ XIJ=XI-XJ YIJ=YI-YJ RFL=-1. DO 7 IP=1,KSYMP RFL=-RFL SALPR=SALPJ*RFL ZIJ=ZI-RFL*ZJ ZP=XIJ*CABJ+YIJ*SABJ+ZIJ*SALPR RHOX=XIJ-CABJ*ZP RHOY=YIJ-SABJ*ZP RHOZ=ZIJ-SALPR*ZP RH=SQRT(RHOX*RHOX+RHOY*RHOY+RHOZ*RHOZ+AI*AI) IF (RH.GT.1.D-10) GO TO 1 EXK=0. EYK=0. EZK=0. EXS=0. EYS=0. EZS=0. EXC=0. EYC=0. EZC=0. GO TO 7 1 RHOX=RHOX/RH RHOY=RHOY/RH RHOZ=RHOZ/RH PHX=SABJ*RHOZ-SALPR*RHOY PHY=SALPR*RHOX-CABJ*RHOZ PHZ=CABJ*RHOY-SABJ*RHOX CALL HSFLX (S,RH,ZP,HPK,HPS,HPC) IF (IP.NE.2) GO TO 6 IF (IPERF.EQ.1) GO TO 5 ZRATX=ZRATI RMAG=SQRT(ZP*ZP+RH*RH) XYMAG=SQRT(XIJ*XIJ+YIJ*YIJ) C C SET PARAMETERS FOR RADIAL WIRE GROUND SCREEN. C IF (NRADL.EQ.0) GO TO 2 XSPEC=(XI*ZJ+ZI*XJ)/(ZI+ZJ) YSPEC=(YI*ZJ+ZI*YJ)/(ZI+ZJ) RHOSPC=SQRT(XSPEC*XSPEC+YSPEC*YSPEC+T2*T2) IF (RHOSPC.GT.SCRWL) GO TO 2 RRV=T1*RHOSPC*LOG(RHOSPC/T2) ZRATX=(RRV*ZRATI)/(ETA*ZRATI+RRV) 2 IF (XYMAG.GT.1.D-6) GO TO 3 C C CALCULATION OF REFLECTION COEFFICIENTS WHEN GROUND IS SPECIFIED. C PX=0. PY=0. CTH=1. RRV=(1.,0.) GO TO 4 3 PX=-YIJ/XYMAG PY=XIJ/XYMAG CTH=ZIJ/RMAG RRV=SQRT(1.-ZRATX*ZRATX*(1.-CTH*CTH)) 4 RRH=ZRATX*CTH RRH=-(RRH-RRV)/(RRH+RRV) RRV=ZRATX*RRV RRV=(CTH-RRV)/(CTH+RRV) QY=(PHX*PX+PHY*PY)*(RRV-RRH) QX=QY*PX+PHX*RRH QY=QY*PY+PHY*RRH QZ=PHZ*RRH EXK=EXK-HPK*QX EYK=EYK-HPK*QY EZK=EZK-HPK*QZ EXS=EXS-HPS*QX EYS=EYS-HPS*QY EZS=EZS-HPS*QZ EXC=EXC-HPC*QX EYC=EYC-HPC*QY EZC=EZC-HPC*QZ GO TO 7 5 EXK=EXK-HPK*PHX EYK=EYK-HPK*PHY EZK=EZK-HPK*PHZ EXS=EXS-HPS*PHX EYS=EYS-HPS*PHY EZS=EZS-HPS*PHZ EXC=EXC-HPC*PHX EYC=EYC-HPC*PHY EZC=EZC-HPC*PHZ GO TO 7 6 EXK=HPK*PHX EYK=HPK*PHY EZK=HPK*PHZ EXS=HPS*PHX EYS=HPS*PHY EZS=HPS*PHZ EXC=HPC*PHX EYC=HPC*PHY EZC=HPC*PHZ 7 CONTINUE RETURN END SUBROUTINE HSFLX (S,RH,ZPX,HPK,HPS,HPC) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C CALCULATES H FIELD OF SINE COSINE, AND CONSTANT CURRENT OF SEGMENT COMPLEX*16 FJ,FJK,EKR1,EKR2,T1,T2,CONS,HPS,HPC,HPK DIMENSION FJX(2), FJKX(2) EQUIVALENCE (FJ,FJX), (FJK,FJKX) DATA TP/6.283185308D+0/,FJX/0.,1./,FJKX/0.,-6.283185308D+0/ DATA PI8/25.13274123D+0/ IF (RH.LT.1.D-10) GO TO 6 IF (ZPX.LT.0.) GO TO 1 ZP=ZPX HSS=1. GO TO 2 1 ZP=-ZPX HSS=-1. 2 DH=.5*S Z1=ZP+DH Z2=ZP-DH IF (Z2.LT.1.D-7) GO TO 3 RHZ=RH/Z2 GO TO 4 3 RHZ=1. 4 DK=TP*DH CDK=COS(DK) SDK=SIN(DK) CALL HFK (-DK,DK,RH*TP,ZP*TP,HKR,HKI) HPK=DCMPLX(HKR,HKI) IF (RHZ.LT.1.D-3) GO TO 5 RH2=RH*RH R1=SQRT(RH2+Z1*Z1) R2=SQRT(RH2+Z2*Z2) EKR1=EXP(FJK*R1) EKR2=EXP(FJK*R2) T1=Z1*EKR1/R1 T2=Z2*EKR2/R2 HPS=(CDK*(EKR2-EKR1)-FJ*SDK*(T2+T1))*HSS HPC=-SDK*(EKR2+EKR1)-FJ*CDK*(T2-T1) CONS=-FJ/(2.*TP*RH) HPS=CONS*HPS HPC=CONS*HPC RETURN 5 EKR1=DCMPLX(CDK,SDK)/(Z2*Z2) EKR2=DCMPLX(CDK,-SDK)/(Z1*Z1) T1=TP*(1./Z1-1./Z2) T2=EXP(FJK*ZP)*RH/PI8 HPS=T2*(T1+(EKR1+EKR2)*SDK)*HSS HPC=T2*(-FJ*T1+(EKR1-EKR2)*CDK) RETURN 6 HPS=(0.,0.) HPC=(0.,0.) HPK=(0.,0.) RETURN END SUBROUTINE INTRP (X,Y,F1,F2,F3,F4) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C INTRP USES BIVARIATE CUBIC INTERPOLATION TO OBTAIN THE VALUES OF C 4 FUNCTIONS AT THE POINT (X,Y). C COMPLEX*16 F1,F2,F3,F4,A,B,C,D,FX1,FX2,FX3,FX4,P1,P2,P3,P4,A11,A12 1,A13,A14,A21,A22,A23,A24,A31,A32,A33,A34,A41,A42,A43,A44,B11,B12 2,B13,B14,B21,B22,B23,B24,B31,B32,B33,B34,B41,B42,B43,B44,C11,C12 3,C13,C14,C21,C22,C23,C24,C31,C32,C33,C34,C41,C42,C43,C44,D11,D12 4,D13,D14,D21,D22,D23,D24,D31,D32,D33,D34,D41,D42,D43,D44 COMPLEX*16 AR1,AR2,AR3,ARL1,ARL2,ARL3,EPSCF COMMON /GGRID/ AR1(11,10,4),AR2(17,5,4),AR3(9,8,4),EPSCF,DXA(3),DY 1A(3),XSA(3),YSA(3),NXA(3),NYA(3) DIMENSION NDA(3), NDPA(3) DIMENSION A(4,4), B(4,4), C(4,4), D(4,4), ARL1(1), ARL2(1), ARL3(1 1) EQUIVALENCE (A(1,1),A11), (A(1,2),A12), (A(1,3),A13), (A(1,4),A14) EQUIVALENCE (A(2,1),A21), (A(2,2),A22), (A(2,3),A23), (A(2,4),A24) EQUIVALENCE (A(3,1),A31), (A(3,2),A32), (A(3,3),A33), (A(3,4),A34) EQUIVALENCE (A(4,1),A41), (A(4,2),A42), (A(4,3),A43), (A(4,4),A44) EQUIVALENCE (B(1,1),B11), (B(1,2),B12), (B(1,3),B13), (B(1,4),B14) EQUIVALENCE (B(2,1),B21), (B(2,2),B22), (B(2,3),B23), (B(2,4),B24) EQUIVALENCE (B(3,1),B31), (B(3,2),B32), (B(3,3),B33), (B(3,4),B34) EQUIVALENCE (B(4,1),B41), (B(4,2),B42), (B(4,3),B43), (B(4,4),B44) EQUIVALENCE (C(1,1),C11), (C(1,2),C12), (C(1,3),C13), (C(1,4),C14) EQUIVALENCE (C(2,1),C21), (C(2,2),C22), (C(2,3),C23), (C(2,4),C24) EQUIVALENCE (C(3,1),C31), (C(3,2),C32), (C(3,3),C33), (C(3,4),C34) EQUIVALENCE (C(4,1),C41), (C(4,2),C42), (C(4,3),C43), (C(4,4),C44) EQUIVALENCE (D(1,1),D11), (D(1,2),D12), (D(1,3),D13), (D(1,4),D14) EQUIVALENCE (D(2,1),D21), (D(2,2),D22), (D(2,3),D23), (D(2,4),D24) EQUIVALENCE (D(3,1),D31), (D(3,2),D32), (D(3,3),D33), (D(3,4),D34) EQUIVALENCE (D(4,1),D41), (D(4,2),D42), (D(4,3),D43), (D(4,4),D44) EQUIVALENCE (ARL1,AR1), (ARL2,AR2), (ARL3,AR3), (XS2,XSA(2)), (YS3 1,YSA(3)) DATA IXS,IYS,IGRS/-10,-10,-10/,DX,DY,XS,YS/1.,1.,0.,0./ DATA NDA/11,17,9/,NDPA/110,85,72/,IXEG,IYEG/0,0/ IF (X.LT.XS.OR.Y.LT.YS) GO TO 1 IX=INT((X-XS)/DX)+1 IY=INT((Y-YS)/DY)+1 C C IF POINT LIES IN SAME 4 BY 4 POINT REGION AS PREVIOUS POINT, OLD C VALUES ARE REUSED C IF (IX.LT.IXEG.OR.IY.LT.IYEG) GO TO 1 IF (IABS(IX-IXS).LT.2.AND.IABS(IY-IYS).LT.2) GO TO 12 C C DETERMINE CORRECT GRID AND GRID REGION C 1 IF (X.GT.XS2) GO TO 2 IGR=1 GO TO 3 2 IGR=2 IF (Y.GT.YS3) IGR=3 3 IF (IGR.EQ.IGRS) GO TO 4 IGRS=IGR DX=DXA(IGRS) DY=DYA(IGRS) XS=XSA(IGRS) YS=YSA(IGRS) NXM2=NXA(IGRS)-2 NYM2=NYA(IGRS)-2 NXMS=((NXM2+1)/3)*3+1 NYMS=((NYM2+1)/3)*3+1 ND=NDA(IGRS) NDP=NDPA(IGRS) IX=INT((X-XS)/DX)+1 IY=INT((Y-YS)/DY)+1 4 IXS=((IX-1)/3)*3+2 IF (IXS.LT.2) IXS=2 IXEG=-10000 IF (IXS.LE.NXM2) GO TO 5 IXS=NXM2 IXEG=NXMS 5 IYS=((IY-1)/3)*3+2 IF (IYS.LT.2) IYS=2 IYEG=-10000 IF (IYS.LE.NYM2) GO TO 6 IYS=NYM2 IYEG=NYMS C C COMPUTE COEFFICIENTS OF 4 CUBIC POLYNOMIALS IN X FOR THE 4 GRID C VALUES OF Y FOR EACH OF THE 4 FUNCTIONS C 6 IADZ=IXS+(IYS-3)*ND-NDP DO 11 K=1,4 IADZ=IADZ+NDP IADD=IADZ DO 11 I=1,4 IADD=IADD+ND GO TO (7,8,9), IGRS C P1=AR1(IXS-1,IYS-2+I,K) 7 P1=ARL1(IADD-1) P2=ARL1(IADD) P3=ARL1(IADD+1) P4=ARL1(IADD+2) GO TO 10 8 P1=ARL2(IADD-1) P2=ARL2(IADD) P3=ARL2(IADD+1) P4=ARL2(IADD+2) GO TO 10 9 P1=ARL3(IADD-1) P2=ARL3(IADD) P3=ARL3(IADD+1) P4=ARL3(IADD+2) 10 A(I,K)=(P4-P1+3.*(P2-P3))*.1666666667D+0 B(I,K)=(P1-2.*P2+P3)*.5 C(I,K)=P3-(2.*P1+3.*P2+P4)*.1666666667D+0 11 D(I,K)=P2 XZ=(IXS-1)*DX+XS YZ=(IYS-1)*DY+YS C C EVALUATE POLYMOMIALS IN X AND THEN USE CUBIC INTERPOLATION IN Y C FOR EACH OF THE 4 FUNCTIONS. C 12 XX=(X-XZ)/DX YY=(Y-YZ)/DY FX1=((A11*XX+B11)*XX+C11)*XX+D11 FX2=((A21*XX+B21)*XX+C21)*XX+D21 FX3=((A31*XX+B31)*XX+C31)*XX+D31 FX4=((A41*XX+B41)*XX+C41)*XX+D41 P1=FX4-FX1+3.*(FX2-FX3) P2=3.*(FX1-2.*FX2+FX3) P3=6.*FX3-2.*FX1-3.*FX2-FX4 F1=((P1*YY+P2)*YY+P3)*YY*.1666666667D+0+FX2 FX1=((A12*XX+B12)*XX+C12)*XX+D12 FX2=((A22*XX+B22)*XX+C22)*XX+D22 FX3=((A32*XX+B32)*XX+C32)*XX+D32 FX4=((A42*XX+B42)*XX+C42)*XX+D42 P1=FX4-FX1+3.*(FX2-FX3) P2=3.*(FX1-2.*FX2+FX3) P3=6.*FX3-2.*FX1-3.*FX2-FX4 F2=((P1*YY+P2)*YY+P3)*YY*.1666666667D+0+FX2 FX1=((A13*XX+B13)*XX+C13)*XX+D13 FX2=((A23*XX+B23)*XX+C23)*XX+D23 FX3=((A33*XX+B33)*XX+C33)*XX+D33 FX4=((A43*XX+B43)*XX+C43)*XX+D43 P1=FX4-FX1+3.*(FX2-FX3) P2=3.*(FX1-2.*FX2+FX3) P3=6.*FX3-2.*FX1-3.*FX2-FX4 F3=((P1*YY+P2)*YY+P3)*YY*.1666666667D+0+FX2 FX1=((A14*XX+B14)*XX+C14)*XX+D14 FX2=((A24*XX+B24)*XX+C24)*XX+D24 FX3=((A34*XX+B34)*XX+C34)*XX+D34 FX4=((A44*XX+B44)*XX+C44)*XX+D44 P1=FX4-FX1+3.*(FX2-FX3) P2=3.*(FX1-2.*FX2+FX3) P3=6.*FX3-2.*FX1-3.*FX2-FX4 F4=((P1*YY+P2)*YY+P3)*YY*.1666666667D+0+FX2 RETURN END SUBROUTINE INTX (EL1,EL2,B,IJ,SGR,SGI) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C INTX PERFORMS NUMERICAL INTEGRATION OF EXP(JKR)/R BY THE METHOD OF C VARIABLE INTERVAL WIDTH ROMBERG INTEGRATION. THE INTEGRAND VALUE C IS SUPPLIED BY SUBROUTINE GF. C DATA NX,NM,NTS,RX/1,65536,4,1.D-4/ Z=EL1 ZE=EL2 IF (IJ.EQ.0) ZE=0. S=ZE-Z FNM=NM EP=S/(10.*FNM) ZEND=ZE-EP SGR=0. SGI=0. NS=NX NT=0 CALL GF (Z,G1R,G1I) 1 FNS=NS DZ=S/FNS ZP=Z+DZ IF (ZP-ZE) 3,3,2 2 DZ=ZE-Z IF (ABS(DZ)-EP) 17,17,3 3 DZOT=DZ*.5 ZP=Z+DZOT CALL GF (ZP,G3R,G3I) ZP=Z+DZ CALL GF (ZP,G5R,G5I) 4 T00R=(G1R+G5R)*DZOT T00I=(G1I+G5I)*DZOT T01R=(T00R+DZ*G3R)*0.5 T01I=(T00I+DZ*G3I)*0.5 T10R=(4.0*T01R-T00R)/3.0 T10I=(4.0*T01I-T00I)/3.0 C C TEST CONVERGENCE OF 3 POINT ROMBERG RESULT. C CALL TEST (T01R,T10R,TE1R,T01I,T10I,TE1I,0.D0) IF (TE1I-RX) 5,5,6 5 IF (TE1R-RX) 8,8,6 6 ZP=Z+DZ*0.25 CALL GF (ZP,G2R,G2I) ZP=Z+DZ*0.75 CALL GF (ZP,G4R,G4I) T02R=(T01R+DZOT*(G2R+G4R))*0.5 T02I=(T01I+DZOT*(G2I+G4I))*0.5 T11R=(4.0*T02R-T01R)/3.0 T11I=(4.0*T02I-T01I)/3.0 T20R=(16.0*T11R-T10R)/15.0 T20I=(16.0*T11I-T10I)/15.0 C C TEST CONVERGENCE OF 5 POINT ROMBERG RESULT. C CALL TEST (T11R,T20R,TE2R,T11I,T20I,TE2I,0.D0) IF (TE2I-RX) 7,7,14 7 IF (TE2R-RX) 9,9,14 8 SGR=SGR+T10R SGI=SGI+T10I NT=NT+2 GO TO 10 9 SGR=SGR+T20R SGI=SGI+T20I NT=NT+1 10 Z=Z+DZ IF (Z-ZEND) 11,17,17 11 G1R=G5R G1I=G5I IF (NT-NTS) 1,12,12 12 IF (NS-NX) 1,1,13 C C DOUBLE STEP SIZE C 13 NS=NS/2 NT=1 GO TO 1 14 NT=0 IF (NS-NM) 16,15,15 15 WRITE(3,20) Z GO TO 9 C C HALVE STEP SIZE C 16 NS=NS*2 FNS=NS DZ=S/FNS DZOT=DZ*0.5 G5R=G3R G5I=G3I G3R=G2R G3I=G2I GO TO 4 17 CONTINUE IF (IJ) 19,18,19 C C ADD CONTRIBUTION OF NEAR SINGULARITY FOR DIAGONAL TERM C 18 SGR=2.*(SGR+LOG((SQRT(B*B+S*S)+S)/B)) SGI=2.*SGI 19 CONTINUE RETURN C 20 FORMAT (24H STEP SIZE LIMITED AT Z=,F10.5) END FUNCTION ISEGNO (ITAGI,MX) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C ISEGNO RETURNS THE SEGMENT NUMBER OF THE MTH SEGMENT HAVING THE C TAG NUMBER ITAGI. IF ITAGI=0 SEGMENT NUMBER M IS RETURNED. C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM IF (MX.GT.0) GO TO 1 WRITE(3,6) STOP 1 ICNT=0 IF (ITAGI.NE.0) GO TO 2 ISEGNO=MX RETURN 2 IF (N.LT.1) GO TO 4 DO 3 I=1,N IF (ITAG(I).NE.ITAGI) GO TO 3 ICNT=ICNT+1 IF (ICNT.EQ.MX) GO TO 5 3 CONTINUE 4 WRITE(3,7) ITAGI STOP 5 ISEGNO=I RETURN C 6 FORMAT (4X,91HCHECK DATA, PARAMETER SPECIFYING SEGMENT POSITION IN 1 A GROUP OF EQUAL TAGS MUST NOT BE ZERO) 7 FORMAT (///,10X,26HNO SEGMENT HAS AN ITAG OF ,I5) END SUBROUTINE LFACTR (A,NROW,IX1,IX2,IP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C LFACTR PERFORMS GAUSS-DOOLITTLE MANIPULATIONS ON THE TWO BLOCKS OF C THE TRANSPOSED MATRIX IN CORE STORAGE. THE GAUSS-DOOLITTLE C ALGORITHM IS PRESENTED ON PAGES 411-416 OF A. RALSTON -- A FIRST C COURSE IN NUMERICAL ANALYSIS. COMMENTS BELOW REFER TO COMMENTS IN C RALSTONS TEXT. C COMPLEX*16 A,D,AJR INTEGER R,R1,R2,PJ,PR LOGICAL L1,L2,L3 COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SCRATM/ D(2*MAXSEG) DIMENSION A(NROW,1), IP(NROW) IFLG=0 C C INITIALIZE R1,R2,J1,J2 C L1=IX1.EQ.1.AND.IX2.EQ.2 L2=(IX2-1).EQ.IX1 L3=IX2.EQ.NBLSYM IF (L1) GO TO 1 GO TO 2 1 R1=1 R2=2*NPSYM J1=1 J2=-1 GO TO 5 2 R1=NPSYM+1 R2=2*NPSYM J1=(IX1-1)*NPSYM+1 IF (L2) GO TO 3 GO TO 4 3 J2=J1+NPSYM-2 GO TO 5 4 J2=J1+NPSYM-1 5 IF (L3) R2=NPSYM+NLSYM DO 16 R=R1,R2 C C STEP 1 C DO 6 K=J1,NROW D(K)=A(K,R) 6 CONTINUE C C STEPS 2 AND 3 C IF (L1.OR.L2) J2=J2+1 IF (J1.GT.J2) GO TO 9 IXJ=0 DO 8 J=J1,J2 IXJ=IXJ+1 PJ=IP(J) AJR=D(PJ) A(J,R)=AJR D(PJ)=D(J) JP1=J+1 DO 7 I=JP1,NROW D(I)=D(I)-A(I,IXJ)*AJR 7 CONTINUE 8 CONTINUE 9 CONTINUE C C STEP 4 C J2P1=J2+1 IF (L1.OR.L2) GO TO 11 IF (NROW.LT.J2P1) GO TO 16 DO 10 I=J2P1,NROW A(I,R)=D(I) 10 CONTINUE GO TO 16 11 DMAX=DREAL(D(J2P1)*DCONJG(D(J2P1))) IP(J2P1)=J2P1 J2P2=J2+2 IF (J2P2.GT.NROW) GO TO 13 DO 12 I=J2P2,NROW ELMAG=DREAL(D(I)*DCONJG(D(I))) IF (ELMAG.LT.DMAX) GO TO 12 DMAX=ELMAG IP(J2P1)=I 12 CONTINUE 13 CONTINUE IF (DMAX.LT.1.D-10) IFLG=1 PR=IP(J2P1) A(J2P1,R)=D(PR) D(PR)=D(J2P1) C C STEP 5 C IF (J2P2.GT.NROW) GO TO 15 AJR=1./A(J2P1,R) DO 14 I=J2P2,NROW A(I,R)=D(I)*AJR 14 CONTINUE 15 CONTINUE IF (IFLG.EQ.0) GO TO 16 WRITE(3,17) J2,DMAX IFLG=0 16 CONTINUE RETURN C 17 FORMAT (1H ,6HPIVOT(,I3,2H)=,1P,E16.8) END SUBROUTINE LOAD (LDTYP,LDTAG,LDTAGF,LDTAGT,ZLR,ZLI,ZLC) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C LOAD CALCULATES THE IMPEDANCE OF SPECIFIED SEGMENTS FOR VARIOUS C TYPES OF LOADING C COMPLEX*16 ZARRAY,ZT,TPCJ,ZINT COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF DIMENSION LDTYP(1), LDTAG(1), LDTAGF(1), LDTAGT(1), ZLR(1), ZLI(1) 1, ZLC(1), TPCJX(2) EQUIVALENCE (TPCJ,TPCJX) DATA TPCJX/0.,1.883698955D+9/ C C WRITE(3,HEADING) C WRITE(3,25) C C INITIALIZE D ARRAY, USED FOR TEMPORARY STORAGE OF LOADING C INFORMATION. C DO 1 I=N2,N 1 ZARRAY(I)=(0.,0.) IWARN=0 C C CYCLE OVER LOADING CARDS C ISTEP=0 2 ISTEP=ISTEP+1 IF (ISTEP.LE.NLOAD) GO TO 5 IF (IWARN.EQ.1) WRITE(3,26) IF (N1+2*M1.GT.0) GO TO 4 NOP=N/NP IF (NOP.EQ.1) GO TO 4 DO 3 I=1,NP ZT=ZARRAY(I) L1=I DO 3 L2=2,NOP L1=L1+NP 3 ZARRAY(L1)=ZT 4 RETURN 5 IF (LDTYP(ISTEP).LE.5) GO TO 6 WRITE(3,27) LDTYP(ISTEP) STOP 6 LDTAGS=LDTAG(ISTEP) JUMP=LDTYP(ISTEP)+1 ICHK=0 C C SEARCH SEGMENTS FOR PROPER ITAGS C L1=N2 L2=N IF (LDTAGS.NE.0) GO TO 7 IF (LDTAGF(ISTEP).EQ.0.AND.LDTAGT(ISTEP).EQ.0) GO TO 7 L1=LDTAGF(ISTEP) L2=LDTAGT(ISTEP) IF (L1.GT.N1) GO TO 7 WRITE(3,29) STOP 7 DO 17 I=L1,L2 IF (LDTAGS.EQ.0) GO TO 8 IF (LDTAGS.NE.ITAG(I)) GO TO 17 IF (LDTAGF(ISTEP).EQ.0) GO TO 8 ICHK=ICHK+1 IF (ICHK.GE.LDTAGF(ISTEP).AND.ICHK.LE.LDTAGT(ISTEP)) GO TO 9 GO TO 17 8 ICHK=1 C C CALCULATION OF LAMDA*IMPED. PER UNIT LENGTH, JUMP TO APPROPRIATE C SECTION FOR LOADING TYPE C 9 GO TO (10,11,12,13,14,15), JUMP 10 ZT=ZLR(ISTEP)/SI(I)+TPCJ*ZLI(ISTEP)/(SI(I)*WLAM) IF (ABS(ZLC(ISTEP)).GT.1.D-20) ZT=ZT+WLAM/(TPCJ*SI(I)*ZLC(ISTEP)) GO TO 16 11 ZT=TPCJ*SI(I)*ZLC(ISTEP)/WLAM IF (ABS(ZLI(ISTEP)).GT.1.D-20) ZT=ZT+SI(I)*WLAM/(TPCJ*ZLI(ISTEP)) IF (ABS(ZLR(ISTEP)).GT.1.D-20) ZT=ZT+SI(I)/ZLR(ISTEP) ZT=1./ZT GO TO 16 12 ZT=ZLR(ISTEP)*WLAM+TPCJ*ZLI(ISTEP) IF (ABS(ZLC(ISTEP)).GT.1.D-20) ZT=ZT+1./(TPCJ*SI(I)*SI(I)*ZLC(ISTE 1P)) GO TO 16 13 ZT=TPCJ*SI(I)*SI(I)*ZLC(ISTEP) IF (ABS(ZLI(ISTEP)).GT.1.D-20) ZT=ZT+1./(TPCJ*ZLI(ISTEP)) IF (ABS(ZLR(ISTEP)).GT.1.D-20) ZT=ZT+1./(ZLR(ISTEP)*WLAM) ZT=1./ZT GO TO 16 14 ZT=DCMPLX(ZLR(ISTEP),ZLI(ISTEP))/SI(I) GO TO 16 15 ZT=ZINT(ZLR(ISTEP)*WLAM,BI(I)) 16 IF ((ABS(DREAL(ZARRAY(I)))+ABS(DIMAG(ZARRAY(I)))).GT.1.D-20) 1IWARN=1 ZARRAY(I)=ZARRAY(I)+ZT 17 CONTINUE IF (ICHK.NE.0) GO TO 18 WRITE(3,28) LDTAGS STOP C C PRINTING THE SEGMENT LOADING DATA, JUMP TO PROPER PRINT C 18 GO TO (19,20,21,22,23,24), JUMP 19 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),ZLR(ISTEP),ZLI(ISTEP 1),ZLC(ISTEP),0.D0,0.D0,0.D0,' SERIES ') GO TO 2 20 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),ZLR(ISTEP),ZLI(ISTEP 1),ZLC(ISTEP),0.D0,0.D0,0.D0,'PARALLEL') GO TO 2 21 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),ZLR(ISTEP),ZLI(ISTEP 1),ZLC(ISTEP),0.D0,0.D0,0.D0,' SERIES (PER METER) ') GO TO 2 22 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),ZLR(ISTEP),ZLI(ISTEP 1),ZLC(ISTEP),0.D0,0.D0,0.D0,'PARALLEL (PER METER)') GO TO 2 23 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),0.D0,0.D0,0.D0, &ZLR(ISTEP),ZLI(ISTEP),0.D0,'FIXED IMPEDANCE ') GO TO 2 24 CALL PRNT (LDTAGS,LDTAGF(ISTEP),LDTAGT(ISTEP),0.D0,0.D0,0.D0,0.D0, &0.D0,ZLR(ISTEP),' WIRE ') GO TO 2 C 25 FORMAT (//,7X,8HLOCATION,10X,10HRESISTANCE,3X,10HINDUCTANCE,2X,11H 1CAPACITANCE,7X,16HIMPEDANCE (OHMS),5X,12HCONDUCTIVITY,4X,4HTYPE,/, 24X,4HITAG,10H FROM THRU,10X,4HOHMS,8X,6HHENRYS,7X,6HFARADS,8X,4HRE 3AL,6X,9HIMAGINARY,4X,10HMHOS/METER) 26 FORMAT (/,10X,74HNOTE, SOME OF THE ABOVE SEGMENTS HAVE BEEN LOADED 1 TWICE - IMPEDANCES ADDED) 27 FORMAT (/,10X,46HIMPROPER LOAD TYPE CHOOSEN, REQUESTED TYPE IS ,I3 1) 28 FORMAT (/,10X,50HLOADING DATA CARD ERROR, NO SEGMENT HAS AN ITAG = 1 ,I5) 29 FORMAT (63H ERROR - LOADING MAY NOT BE ADDED TO SEGMENTS IN N.G.F. 1 SECTION) END SUBROUTINE LTSOLV (A,NROW,IX,B,NEQ,NRH,IFL1,IFL2) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C LTSOLV SOLVES THE MATRIX EQ. Y(R)*LU(T)=B(R) WHERE (R) DENOTES ROW C VECTOR AND LU(T) DENOTES THE LU DECOMPOSITION OF THE TRANSPOSE OF C THE ORIGINAL COEFFICIENT MATRIX. THE LU(T) DECOMPOSITION IS C STORED ON TAPE 5 IN BLOCKS IN ASCENDING ORDER AND ON FILE 3 IN C BLOCKS OF DESCENDING ORDER. C COMPLEX*16 A,B,Y,SUM COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL COMMON /SCRATM/ Y(2*MAXSEG) DIMENSION A(NROW,NROW), B(NEQ,NRH), IX(NEQ) C C FORWARD SUBSTITUTION C I2=2*NPSYM*NROW DO 4 IXBLK1=1,NBLSYM CALL BLCKIN (A,IFL1,1,I2,1,121) K2=NPSYM IF (IXBLK1.EQ.NBLSYM) K2=NLSYM JST=(IXBLK1-1)*NPSYM DO 4 IC=1,NRH J=JST DO 3 K=1,K2 JM1=J J=J+1 SUM=(0.,0.) IF (JM1.LT.1) GO TO 2 DO 1 I=1,JM1 1 SUM=SUM+A(I,K)*B(I,IC) 2 B(J,IC)=(B(J,IC)-SUM)/A(J,K) 3 CONTINUE 4 CONTINUE C C BACKWARD SUBSTITUTION C JST=NROW+1 DO 8 IXBLK1=1,NBLSYM CALL BLCKIN (A,IFL2,1,I2,1,122) K2=NPSYM IF (IXBLK1.EQ.1) K2=NLSYM DO 7 IC=1,NRH KP=K2+1 J=JST DO 6 K=1,K2 KP=KP-1 JP1=J J=J-1 SUM=(0.,0.) IF (NROW.LT.JP1) GO TO 6 DO 5 I=JP1,NROW 5 SUM=SUM+A(I,KP)*B(I,IC) B(J,IC)=B(J,IC)-SUM 6 CONTINUE 7 CONTINUE 8 JST=JST-K2 C C UNSCRAMBLE SOLUTION C DO 10 IC=1,NRH DO 9 I=1,NROW IXI=IX(I) 9 Y(IXI)=B(I,IC) DO 10 I=1,NROW 10 B(I,IC)=Y(I) RETURN END SUBROUTINE LUNSCR (A,NROW,NOP,IX,IP,IU2,IU3,IU4) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C S/R WHICH UNSCRAMBLES, SCRAMBLED FACTORED MATRIX C COMPLEX*16 A,TEMP COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(NROW,1), IP(NROW), IX(NROW) I1=1 I2=2*NPSYM*NROW NM1=NROW-1 REWIND IU2 REWIND IU3 REWIND IU4 DO 9 KK=1,NOP KA=(KK-1)*NROW DO 4 IXBLK1=1,NBLSYM CALL BLCKIN (A,IU2,I1,I2,1,121) K1=(IXBLK1-1)*NPSYM+2 IF (NM1.LT.K1) GO TO 3 J2=0 DO 2 K=K1,NM1 IF (J2.LT.NPSYM) J2=J2+1 IPK=IP(K+KA) DO 1 J=1,J2 TEMP=A(K,J) A(K,J)=A(IPK,J) A(IPK,J)=TEMP 1 CONTINUE 2 CONTINUE 3 CONTINUE CALL BLCKOT (A,IU3,I1,I2,1,122) 4 CONTINUE DO 5 IXBLK1=1,NBLSYM BACKSPACE IU3 IF (IXBLK1.NE.1) BACKSPACE IU3 CALL BLCKIN (A,IU3,I1,I2,1,123) CALL BLCKOT (A,IU4,I1,I2,1,124) 5 CONTINUE DO 6 I=1,NROW IX(I+KA)=I 6 CONTINUE DO 7 I=1,NROW IPI=IP(I+KA) IXT=IX(I+KA) IX(I+KA)=IX(IPI+KA) IX(IPI+KA)=IXT 7 CONTINUE IF (NOP.EQ.1) GO TO 9 NB1=NBLSYM-1 C SKIP NB1 LOGICAL RECORDS FORWARD DO 8 IXBLK1=1,NB1 CALL BLCKIN (A,IU3,I1,I2,1,125) 8 CONTINUE 9 CONTINUE REWIND IU2 REWIND IU3 REWIND IU4 RETURN END SUBROUTINE MOVE (ROX,ROY,ROZ,XS,YS,ZS,ITS,NRPT,ITGI) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE MOVE MOVES THE STRUCTURE WITH RESPECT TO ITS C COORDINATE SYSTEM OR REPRODUCES STRUCTURE IN NEW POSITIONS. C STRUCTURE IS ROTATED ABOUT X,Y,Z AXES BY ROX,ROY,ROZ C RESPECTIVELY, THEN SHIFTED BY XS,YS,ZS C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1), X2(1), Y 12(1), Z2(1) EQUIVALENCE (X2(1),SI(1)), (Y2(1),ALP(1)), (Z2(1),BET(1)) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) IF (ABS(ROX)+ABS(ROY).GT.1.D-10) IPSYM=IPSYM*3 SPS=SIN(ROX) CPS=COS(ROX) STH=SIN(ROY) CTH=COS(ROY) SPH=SIN(ROZ) CPH=COS(ROZ) XX=CPH*CTH XY=CPH*STH*SPS-SPH*CPS XZ=CPH*STH*CPS+SPH*SPS YX=SPH*CTH YY=SPH*STH*SPS+CPH*CPS YZ=SPH*STH*CPS-CPH*SPS ZX=-STH ZY=CTH*SPS ZZ=CTH*CPS NRP=NRPT IF (NRPT.EQ.0) NRP=1 IX=1 IF (N.LT.N2) GO TO 3 I1=ISEGNO(ITS,1) IF (I1.LT.N2) I1=N2 IX=I1 K=N IF (NRPT.EQ.0) K=I1-1 DO 2 IR=1,NRP DO 1 I=I1,N K=K+1 XI=X(I) YI=Y(I) ZI=Z(I) X(K)=XI*XX+YI*XY+ZI*XZ+XS Y(K)=XI*YX+YI*YY+ZI*YZ+YS Z(K)=XI*ZX+YI*ZY+ZI*ZZ+ZS XI=X2(I) YI=Y2(I) ZI=Z2(I) X2(K)=XI*XX+YI*XY+ZI*XZ+XS Y2(K)=XI*YX+YI*YY+ZI*YZ+YS Z2(K)=XI*ZX+YI*ZY+ZI*ZZ+ZS BI(K)=BI(I) ITAG(K)=ITAG(I) IF(ITAG(I).NE.0)ITAG(K)=ITAG(I)+ITGI 1 CONTINUE I1=N+1 N=K 2 CONTINUE 3 IF (M.LT.M2) GO TO 6 I1=M2 K=M LDI=LD+1 IF (NRPT.EQ.0) K=M1 DO 5 II=1,NRP DO 4 I=I1,M K=K+1 IR=LDI-I KR=LDI-K XI=X(IR) YI=Y(IR) ZI=Z(IR) X(KR)=XI*XX+YI*XY+ZI*XZ+XS Y(KR)=XI*YX+YI*YY+ZI*YZ+YS Z(KR)=XI*ZX+YI*ZY+ZI*ZZ+ZS XI=T1X(IR) YI=T1Y(IR) ZI=T1Z(IR) T1X(KR)=XI*XX+YI*XY+ZI*XZ T1Y(KR)=XI*YX+YI*YY+ZI*YZ T1Z(KR)=XI*ZX+YI*ZY+ZI*ZZ XI=T2X(IR) YI=T2Y(IR) ZI=T2Z(IR) T2X(KR)=XI*XX+YI*XY+ZI*XZ T2Y(KR)=XI*YX+YI*YY+ZI*YZ T2Z(KR)=XI*ZX+YI*ZY+ZI*ZZ SALP(KR)=SALP(IR) 4 BI(KR)=BI(IR) I1=M+1 5 M=K 6 IF ((NRPT.EQ.0).AND.(IX.EQ.1)) RETURN NP=N MP=M IPSYM=0 RETURN END SUBROUTINE NEFLD (XOB,YOB,ZOB,EX,EY,EZ) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C NEFLD COMPUTES THE NEAR FIELD AT SPECIFIED POINTS IN SPACE AFTER C THE STRUCTURE CURRENTS HAVE BEEN COMPUTED. C COMPLEX*16 EX,EY,EZ,CUR,ACX,BCX,CCX,EXK,EYK,EZK,EXS,EYS,EZS,EXC 1,EYC,EZC,ZRATI,ZRATI2,T1,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF DIMENSION CAB(1), SAB(1), T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), 1T2Z(1) EQUIVALENCE (CAB,ALP), (SAB,BET) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) EX=(0.,0.) EY=(0.,0.) EZ=(0.,0.) AX=0. IF (N.EQ.0) GO TO 20 DO 1 I=1,N XJ=XOB-X(I) YJ=YOB-Y(I) ZJ=ZOB-Z(I) ZP=CAB(I)*XJ+SAB(I)*YJ+SALP(I)*ZJ IF (ABS(ZP).GT.0.5001*SI(I)) GO TO 1 ZP=XJ*XJ+YJ*YJ+ZJ*ZJ-ZP*ZP XJ=BI(I) IF (ZP.GT.0.9*XJ*XJ) GO TO 1 AX=XJ GO TO 2 1 CONTINUE 2 DO 19 I=1,N S=SI(I) B=BI(I) XJ=X(I) YJ=Y(I) ZJ=Z(I) CABJ=CAB(I) SABJ=SAB(I) SALPJ=SALP(I) IF (IEXK.EQ.0) GO TO 18 IPR=ICON1(I) IF (IPR.GT.10000) GO TO 9 IF (IPR) 3,8,4 3 IPR=-IPR IF (-ICON1(IPR).NE.I) GO TO 9 GO TO 6 4 IF (IPR.NE.I) GO TO 5 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 9 GO TO 7 5 IF (ICON2(IPR).NE.I) GO TO 9 6 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 9 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 9 7 IND1=0 GO TO 10 8 IND1=1 GO TO 10 9 IND1=2 10 IPR=ICON2(I) IF (IPR.GT.10000) GO TO 17 IF (IPR) 11,16,12 11 IPR=-IPR IF (-ICON2(IPR).NE.I) GO TO 17 GO TO 14 12 IF (IPR.NE.I) GO TO 13 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 17 GO TO 15 13 IF (ICON1(IPR).NE.I) GO TO 17 14 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 17 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 17 15 IND2=0 GO TO 18 16 IND2=1 GO TO 18 17 IND2=2 18 CONTINUE CALL EFLD (XOB,YOB,ZOB,AX,1) ACX=DCMPLX(AIR(I),AII(I)) BCX=DCMPLX(BIR(I),BII(I)) CCX=DCMPLX(CIR(I),CII(I)) EX=EX+EXK*ACX+EXS*BCX+EXC*CCX EY=EY+EYK*ACX+EYS*BCX+EYC*CCX 19 EZ=EZ+EZK*ACX+EZS*BCX+EZC*CCX IF (M.EQ.0) RETURN 20 JC=N JL=LD+1 DO 21 I=1,M JL=JL-1 S=BI(JL) XJ=X(JL) YJ=Y(JL) ZJ=Z(JL) T1XJ=T1X(JL) T1YJ=T1Y(JL) T1ZJ=T1Z(JL) T2XJ=T2X(JL) T2YJ=T2Y(JL) T2ZJ=T2Z(JL) JC=JC+3 ACX=T1XJ*CUR(JC-2)+T1YJ*CUR(JC-1)+T1ZJ*CUR(JC) BCX=T2XJ*CUR(JC-2)+T2YJ*CUR(JC-1)+T2ZJ*CUR(JC) DO 21 IP=1,KSYMP IPGND=IP CALL UNERE (XOB,YOB,ZOB) EX=EX+ACX*EXK+BCX*EXS EY=EY+ACX*EYK+BCX*EYS 21 EZ=EZ+ACX*EZK+BCX*EZS RETURN END SUBROUTINE NETWK (CM,CMB,CMC,CMD,IP,EINC) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE NETWK SOLVES FOR STRUCTURE CURRENTS FOR A GIVEN C EXCITATION INCLUDING THE EFFECT OF NON-RADIATING NETWORKS IF C PRESENT. C COMPLEX*16 CMN,RHNT,YMIT,RHS,ZPED,EINC,VSANT,VLT,CUR,VSRC,RHNX 1,VQD,VQDS,CUX,CM,CMB,CMC,CMD COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /VSORC/ VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30),IQDS( 130),NVQD,NSANT,NQDS COMMON/NETCX/ZPED,PIN,PNLS,X11R(30),X11I(30),X12R(30),X12I(30), &X22R(30),X22I(30),NTYP(30),ISEG1(30),ISEG2(30),NEQ,NPEQ,NEQ2, &NONET,NTSOL,NPRINT,MASYM DIMENSION EINC(1), IP(1),CM(1),CMB(1),CMC(1),CMD(1) DIMENSION CMN(30,30), RHNT(30), IPNT(30), NTEQA(30), NTSCA(30), &RHS(3*MAXSEG), VSRC(30), RHNX(30) DATA NDIMN,NDIMNP/30,31/,TP/6.283185308D+0/ NEQZ2=NEQ2 IF(NEQZ2.EQ.0)NEQZ2=1 PIN=0. PNLS=0. NEQT=NEQ+NEQ2 IF (NTSOL.NE.0) GO TO 42 NOP=NEQ/NPEQ IF (MASYM.EQ.0) GO TO 14 C C COMPUTE RELATIVE MATRIX ASYMMETRY C IROW1=0 IF (NONET.EQ.0) GO TO 5 DO 4 I=1,NONET NSEG1=ISEG1(I) DO 3 ISC1=1,2 IF (IROW1.EQ.0) GO TO 2 DO 1 J=1,IROW1 IF (NSEG1.EQ.IPNT(J)) GO TO 3 1 CONTINUE 2 IROW1=IROW1+1 IPNT(IROW1)=NSEG1 3 NSEG1=ISEG2(I) 4 CONTINUE 5 IF (NSANT.EQ.0) GO TO 9 DO 8 I=1,NSANT NSEG1=ISANT(I) IF (IROW1.EQ.0) GO TO 7 DO 6 J=1,IROW1 IF (NSEG1.EQ.IPNT(J)) GO TO 8 6 CONTINUE 7 IROW1=IROW1+1 IPNT(IROW1)=NSEG1 8 CONTINUE 9 IF (IROW1.LT.NDIMNP) GO TO 10 WRITE(3,59) STOP 10 IF (IROW1.LT.2) GO TO 14 DO 12 I=1,IROW1 ISC1=IPNT(I) ASM=SI(ISC1) DO 11 J=1,NEQT 11 RHS(J)=(0.,0.) RHS(ISC1)=(1.,0.) CALL SOLGF (CM,CMB,CMC,CMD,RHS,IP,NP,N1,N,MP,M1,M,NEQ,NEQ2,NEQZ2) CALL CABC (RHS) DO 12 J=1,IROW1 ISC1=IPNT(J) 12 CMN(J,I)=RHS(ISC1)/ASM ASM=0. ASA=0. DO 13 I=2,IROW1 ISC1=I-1 DO 13 J=1,ISC1 CUX=CMN(I,J) PWR=ABS((CUX-CMN(J,I))/CUX) ASA=ASA+PWR*PWR IF (PWR.LT.ASM) GO TO 13 ASM=PWR NTEQ=IPNT(I) NTSC=IPNT(J) 13 CONTINUE ASA=SQRT(ASA*2./DFLOAT(IROW1*(IROW1-1))) WRITE(3,58) ASM,NTEQ,NTSC,ASA 14 IF (NONET.EQ.0) GO TO 48 C C SOLUTION OF NETWORK EQUATIONS C DO 15 I=1,NDIMN RHNX(I)=(0.,0.) DO 15 J=1,NDIMN 15 CMN(I,J)=(0.,0.) NTEQ=0 NTSC=0 C C SORT NETWORK AND SOURCE DATA AND ASSIGN EQUATION NUMBERS TO C SEGMENTS. C DO 38 J=1,NONET NSEG1=ISEG1(J) NSEG2=ISEG2(J) IF (NTYP(J).GT.1) GO TO 16 Y11R=X11R(J) Y11I=X11I(J) Y12R=X12R(J) Y12I=X12I(J) Y22R=X22R(J) Y22I=X22I(J) GO TO 17 16 Y22R=TP*X11I(J)/WLAM Y12R=0. Y12I=1./(X11R(J)*SIN(Y22R)) Y11R=X12R(J) Y11I=-Y12I*COS(Y22R) Y22R=X22R(J) Y22I=Y11I+X22I(J) Y11I=Y11I+X12I(J) IF (NTYP(J).EQ.2) GO TO 17 Y12R=-Y12R Y12I=-Y12I 17 IF (NSANT.EQ.0) GO TO 19 DO 18 I=1,NSANT IF (NSEG1.NE.ISANT(I)) GO TO 18 ISC1=I GO TO 22 18 CONTINUE 19 ISC1=0 IF (NTEQ.EQ.0) GO TO 21 DO 20 I=1,NTEQ IF (NSEG1.NE.NTEQA(I)) GO TO 20 IROW1=I GO TO 25 20 CONTINUE 21 NTEQ=NTEQ+1 IROW1=NTEQ NTEQA(NTEQ)=NSEG1 GO TO 25 22 IF (NTSC.EQ.0) GO TO 24 DO 23 I=1,NTSC IF (NSEG1.NE.NTSCA(I)) GO TO 23 IROW1=NDIMNP-I GO TO 25 23 CONTINUE 24 NTSC=NTSC+1 IROW1=NDIMNP-NTSC NTSCA(NTSC)=NSEG1 VSRC(NTSC)=VSANT(ISC1) 25 IF (NSANT.EQ.0) GO TO 27 DO 26 I=1,NSANT IF (NSEG2.NE.ISANT(I)) GO TO 26 ISC2=I GO TO 30 26 CONTINUE 27 ISC2=0 IF (NTEQ.EQ.0) GO TO 29 DO 28 I=1,NTEQ IF (NSEG2.NE.NTEQA(I)) GO TO 28 IROW2=I GO TO 33 28 CONTINUE 29 NTEQ=NTEQ+1 IROW2=NTEQ NTEQA(NTEQ)=NSEG2 GO TO 33 30 IF (NTSC.EQ.0) GO TO 32 DO 31 I=1,NTSC IF (NSEG2.NE.NTSCA(I)) GO TO 31 IROW2=NDIMNP-I GO TO 33 31 CONTINUE 32 NTSC=NTSC+1 IROW2=NDIMNP-NTSC NTSCA(NTSC)=NSEG2 VSRC(NTSC)=VSANT(ISC2) 33 IF (NTSC+NTEQ.LT.NDIMNP) GO TO 34 WRITE(3,59) STOP C C FILL NETWORK EQUATION MATRIX AND RIGHT HAND SIDE VECTOR WITH C NETWORK SHORT-CIRCUIT ADMITTANCE MATRIX COEFFICIENTS. C 34 IF (ISC1.NE.0) GO TO 35 CMN(IROW1,IROW1)=CMN(IROW1,IROW1)-DCMPLX(Y11R,Y11I)*SI(NSEG1) CMN(IROW1,IROW2)=CMN(IROW1,IROW2)-DCMPLX(Y12R,Y12I)*SI(NSEG1) GO TO 36 35 RHNX(IROW1)=RHNX(IROW1)+DCMPLX(Y11R,Y11I)*VSANT(ISC1)/WLAM RHNX(IROW2)=RHNX(IROW2)+DCMPLX(Y12R,Y12I)*VSANT(ISC1)/WLAM 36 IF (ISC2.NE.0) GO TO 37 CMN(IROW2,IROW2)=CMN(IROW2,IROW2)-DCMPLX(Y22R,Y22I)*SI(NSEG2) CMN(IROW2,IROW1)=CMN(IROW2,IROW1)-DCMPLX(Y12R,Y12I)*SI(NSEG2) GO TO 38 37 RHNX(IROW1)=RHNX(IROW1)+DCMPLX(Y12R,Y12I)*VSANT(ISC2)/WLAM RHNX(IROW2)=RHNX(IROW2)+DCMPLX(Y22R,Y22I)*VSANT(ISC2)/WLAM 38 CONTINUE C C ADD INTERACTION MATRIX ADMITTANCE ELEMENTS TO NETWORK EQUATION C MATRIX C DO 41 I=1,NTEQ DO 39 J=1,NEQT 39 RHS(J)=(0.,0.) IROW1=NTEQA(I) RHS(IROW1)=(1.,0.) CALL SOLGF (CM,CMB,CMC,CMD,RHS,IP,NP,N1,N,MP,M1,M,NEQ,NEQ2,NEQZ2) CALL CABC (RHS) DO 40 J=1,NTEQ IROW1=NTEQA(J) 40 CMN(I,J)=CMN(I,J)+RHS(IROW1) 41 CONTINUE C C FACTOR NETWORK EQUATION MATRIX C CALL FACTR (NTEQ,CMN,IPNT,NDIMN) C C ADD TO NETWORK EQUATION RIGHT HAND SIDE THE TERMS DUE TO ELEMENT C INTERACTIONS C 42 IF (NONET.EQ.0) GO TO 48 DO 43 I=1,NEQT 43 RHS(I)=EINC(I) CALL SOLGF (CM,CMB,CMC,CMD,RHS,IP,NP,N1,N,MP,M1,M,NEQ,NEQ2,NEQZ2) CALL CABC (RHS) DO 44 I=1,NTEQ IROW1=NTEQA(I) 44 RHNT(I)=RHNX(I)+RHS(IROW1) C C SOLVE NETWORK EQUATIONS C CALL SOLVE (NTEQ,CMN,IPNT,RHNT,NDIMN) C C ADD FIELDS DUE TO NETWORK VOLTAGES TO ELECTRIC FIELDS APPLIED TO C STRUCTURE AND SOLVE FOR INDUCED CURRENT C DO 45 I=1,NTEQ IROW1=NTEQA(I) 45 EINC(IROW1)=EINC(IROW1)-RHNT(I) CALL SOLGF (CM,CMB,CMC,CMD,EINC,IP,NP,N1,N,MP,M1,M,NEQ,NEQ2,NEQZ2) CALL CABC (EINC) IF (NPRINT.EQ.0) WRITE(3,61) IF (NPRINT.EQ.0) WRITE(3,60) DO 46 I=1,NTEQ IROW1=NTEQA(I) VLT=RHNT(I)*SI(IROW1)*WLAM CUX=EINC(IROW1)*WLAM YMIT=CUX/VLT ZPED=VLT/CUX IROW2=ITAG(IROW1) PWR=.5*DREAL(VLT*DCONJG(CUX)) PNLS=PNLS-PWR 46 IF (NPRINT.EQ.0) WRITE(3,62) IROW2,IROW1,VLT,CUX,ZPED,YMIT,PWR IF (NTSC.EQ.0) GO TO 49 DO 47 I=1,NTSC IROW1=NTSCA(I) VLT=VSRC(I) CUX=EINC(IROW1)*WLAM YMIT=CUX/VLT ZPED=VLT/CUX IROW2=ITAG(IROW1) PWR=.5*DREAL(VLT*DCONJG(CUX)) PNLS=PNLS-PWR 47 IF (NPRINT.EQ.0) WRITE(3,62) IROW2,IROW1,VLT,CUX,ZPED,YMIT,PWR GO TO 49 C C SOLVE FOR CURRENTS WHEN NO NETWORKS ARE PRESENT C 48 CALL SOLGF (CM,CMB,CMC,CMD,EINC,IP,NP,N1,N,MP,M1,M,NEQ,NEQ2,NEQZ2) CALL CABC (EINC) NTSC=0 49 IF (NSANT+NVQD.EQ.0) RETURN WRITE(3,63) WRITE(3,60) IF (NSANT.EQ.0) GO TO 56 DO 55 I=1,NSANT ISC1=ISANT(I) VLT=VSANT(I) IF (NTSC.EQ.0) GO TO 51 DO 50 J=1,NTSC IF (NTSCA(J).EQ.ISC1) GO TO 52 50 CONTINUE 51 CUX=EINC(ISC1)*WLAM IROW1=0 GO TO 54 52 IROW1=NDIMNP-J CUX=RHNX(IROW1) DO 53 J=1,NTEQ 53 CUX=CUX-CMN(J,IROW1)*RHNT(J) CUX=(EINC(ISC1)+CUX)*WLAM 54 YMIT=CUX/VLT ZPED=VLT/CUX PWR=.5*DREAL(VLT*DCONJG(CUX)) PIN=PIN+PWR IF (IROW1.NE.0) PNLS=PNLS+PWR IROW2=ITAG(ISC1) 55 WRITE(3,62) IROW2,ISC1,VLT,CUX,ZPED,YMIT,PWR 56 IF (NVQD.EQ.0) RETURN DO 57 I=1,NVQD ISC1=IVQD(I) VLT=VQD(I) CUX=DCMPLX(AIR(ISC1),AII(ISC1)) YMIT=DCMPLX(BIR(ISC1),BII(ISC1)) ZPED=DCMPLX(CIR(ISC1),CII(ISC1)) PWR=SI(ISC1)*TP*.5 CUX=(CUX-YMIT*SIN(PWR)+ZPED*COS(PWR))*WLAM YMIT=CUX/VLT ZPED=VLT/CUX PWR=.5*DREAL(VLT*DCONJG(CUX)) PIN=PIN+PWR IROW2=ITAG(ISC1) 57 WRITE(3,64) IROW2,ISC1,VLT,CUX,ZPED,YMIT,PWR RETURN C 58 FORMAT (///,3X,47HMAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT, 121H ADMITTANCE MATRIX IS,1P,E10.3,13H FOR SEGMENTS,I5,4H AND,I5,/, 23X,25HRMS RELATIVE ASYMMETRY IS,E10.3) 59 FORMAT (1X,44HERROR - - NETWORK ARRAY DIMENSIONS TOO SMALL) 60 FORMAT (/,3X,3HTAG,3X,4HSEG.,4X,15HVOLTAGE (VOLTS),9X,14HCURRENT ( 1AMPS),9X,16HIMPEDANCE (OHMS),8X,17HADMITTANCE (MHOS),6X,5HPOWER,/, 23X,3HNO.,3X,3HNO.,4X,4HREAL,8X,5HIMAG.,3(7X,4HREAL,8X,5HIMAG.),5X, 37H(WATTS)) 61 FORMAT (///,27X,66H- - - STRUCTURE EXCITATION DATA AT NETWORK CONN 1ECTION POINTS - - -) 62 FORMAT (2(1X,I5),1P,9E12.5) 63 FORMAT (///,42X,36H- - - ANTENNA INPUT PARAMETERS - - -) 64 FORMAT (1X,I5,2H *,I4,1P,9E12.5) END SUBROUTINE NFPAT C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE NEAR E OR H FIELDS OVER A RANGE OF POINTS COMPLEX*16 EX,EY,EZ COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON/FPAT/THETS,PHIS,DTH,DPH,RFLD,GNOR,CLT,CHT,EPSR2,SIG2, &XPR6,PINR,PNLR,PLOSS,XNR,YNR,ZNR,DXNR,DYNR,DZNR,NTH,NPH,IPD,IAVP, &INOR,IAX,IXTYP,NEAR,NFEH,NRX,NRY,NRZ C*** COMMON /PLOT/ IPLP1,IPLP2,IPLP3,IPLP4 C*** DATA TA/1.745329252D-02/ IF (NFEH.EQ.1) GO TO 1 WRITE(3,10) GO TO 2 1 WRITE(3,12) 2 ZNRT=ZNR-DZNR DO 9 I=1,NRZ ZNRT=ZNRT+DZNR IF (NEAR.EQ.0) GO TO 3 CTH=COS(TA*ZNRT) STH=SIN(TA*ZNRT) 3 YNRT=YNR-DYNR DO 9 J=1,NRY YNRT=YNRT+DYNR IF (NEAR.EQ.0) GO TO 4 CPH=COS(TA*YNRT) SPH=SIN(TA*YNRT) 4 XNRT=XNR-DXNR DO 9 KK=1,NRX XNRT=XNRT+DXNR IF (NEAR.EQ.0) GO TO 5 XOB=XNRT*STH*CPH YOB=XNRT*STH*SPH ZOB=XNRT*CTH GO TO 6 5 XOB=XNRT YOB=YNRT ZOB=ZNRT 6 TMP1=XOB/WLAM TMP2=YOB/WLAM TMP3=ZOB/WLAM IF (NFEH.EQ.1) GO TO 7 CALL NEFLD (TMP1,TMP2,TMP3,EX,EY,EZ) GO TO 8 7 CALL NHFLD (TMP1,TMP2,TMP3,EX,EY,EZ) 8 TMP1=ABS(EX) TMP2=CANG(EX) TMP3=ABS(EY) TMP4=CANG(EY) TMP5=ABS(EZ) TMP6=CANG(EZ) WRITE(3,11) XOB,YOB,ZOB,TMP1,TMP2,TMP3,TMP4,TMP5,TMP6 C*** IF(IPLP1 .NE. 2) GO TO 9 GO TO (14,15,16),IPLP4 14 XXX=XOB GO TO 17 15 XXX=YOB GO TO 17 16 XXX=ZOB 17 CONTINUE IF(IPLP2 .NE. 2) GO TO 13 IF(IPLP3 .EQ. 1) WRITE(8,*) XXX,TMP1,TMP2 IF(IPLP3 .EQ. 2) WRITE(8,*) XXX,TMP3,TMP4 IF(IPLP3 .EQ. 3) WRITE(8,*) XXX,TMP5,TMP6 IF(IPLP3 .EQ. 4) WRITE(8,*) XXX,TMP1,TMP2,TMP3,TMP4,TMP5,TMP6 GO TO 9 13 IF(IPLP2 .NE. 1) GO TO 9 IF(IPLP3 .EQ. 1) WRITE(8,*) XXX,EX IF(IPLP3 .EQ. 2) WRITE(8,*) XXX,EY IF(IPLP3 .EQ. 3) WRITE(8,*) XXX,EZ IF(IPLP3 .EQ. 4) WRITE(8,*) XXX,EX,EY,EZ C*** 9 CONTINUE RETURN C 10 FORMAT (///,35X,32H- - - NEAR ELECTRIC FIELDS - - -,//,12X,14H- L 1OCATION -,21X,8H- EX -,15X,8H- EY -,15X,8H- EZ -,/,8X,1HX,1 20X,1HY,10X,1HZ,10X,9HMAGNITUDE,3X,5HPHASE,6X,9HMAGNITUDE,3X,5HPHAS 3E,6X,9HMAGNITUDE,3X,5HPHASE,/,6X,6HMETERS,5X,6HMETERS,5X,6HMETERS, 48X,7HVOLTS/M,3X,7HDEGREES,6X,7HVOLTS/M,3X,7HDEGREES,6X,7HVOLTS/M,3 5X,7HDEGREES) 11 FORMAT (2X,3(2X,F9.4),1X,3(3X,1P,E11.4,2X,0P,F7.2)) 12 FORMAT (///,35X,32H- - - NEAR MAGNETIC FIELDS - - -,//,12X,14H- L 1OCATION -,21X,8H- HX -,15X,8H- HY -,15X,8H- HZ -,/,8X,1HX,1 20X,1HY,10X,1HZ,10X,9HMAGNITUDE,3X,5HPHASE,6X,9HMAGNITUDE,3X,5HPHAS 3E,6X,9HMAGNITUDE,3X,5HPHASE,/,6X,6HMETERS,5X,6HMETERS,5X,6HMETERS, 49X,6HAMPS/M,3X,7HDEGREES,7X,6HAMPS/M,3X,7HDEGREES,7X,6HAMPS/M,3X,7 5HDEGREES) END SUBROUTINE NHFLD (XOB,YOB,ZOB,HX,HY,HZ) C C NHFLD COMPUTES THE NEAR FIELD AT SPECIFIED POINTS IN SPACE AFTER C THE STRUCTURE CURRENTS HAVE BEEN COMPUTED. C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) COMPLEX*16 HX,HY,HZ,CUR,ACX,BCX,CCX,EXK,EYK,EZK,EXS,EYS,EZS,EXC, &EYC,EZC C*************************************** COMPLEX*16 ZRATI,ZRATI2,FRATI,T1,CON COMPLEX*16 EXPX,EXMX,EXPY,EXMY,EXPZ,EXMZ COMPLEX*16 EYPX,EYMX,EYPY,EYMY,EYPZ,EYMZ COMPLEX*16 EZPX,EZMX,EZPY,EZMY,EZPZ,EZMZ COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF C*************************************** COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) COMMON /CRNT/ AIR(MAXSEG),AII(MAXSEG),BIR(MAXSEG),BII(MAXSEG), &CIR(MAXSEG),CII(MAXSEG),CUR(3*MAXSEG) COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION CAB(1), SAB(1) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1), XS(1), Y 1S(1), ZS(1) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG), (XS,X), (YS,Y), (ZS,Z) EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) EQUIVALENCE (CAB,ALP), (SAB,BET) C*************************************** IF (IPERF.EQ.2) GO TO 6 C*************************************** HX=(0.,0.) HY=(0.,0.) HZ=(0.,0.) AX=0. IF (N.EQ.0) GO TO 4 DO 1 I=1,N XJ=XOB-X(I) YJ=YOB-Y(I) ZJ=ZOB-Z(I) ZP=CAB(I)*XJ+SAB(I)*YJ+SALP(I)*ZJ IF (ABS(ZP).GT.0.5001*SI(I)) GO TO 1 ZP=XJ*XJ+YJ*YJ+ZJ*ZJ-ZP*ZP XJ=BI(I) IF (ZP.GT.0.9*XJ*XJ) GO TO 1 AX=XJ GO TO 2 1 CONTINUE 2 DO 3 I=1,N S=SI(I) B=BI(I) XJ=X(I) YJ=Y(I) ZJ=Z(I) CABJ=CAB(I) SABJ=SAB(I) SALPJ=SALP(I) CALL HSFLD (XOB,YOB,ZOB,AX) ACX=DCMPLX(AIR(I),AII(I)) BCX=DCMPLX(BIR(I),BII(I)) CCX=DCMPLX(CIR(I),CII(I)) HX=HX+EXK*ACX+EXS*BCX+EXC*CCX HY=HY+EYK*ACX+EYS*BCX+EYC*CCX 3 HZ=HZ+EZK*ACX+EZS*BCX+EZC*CCX IF (M.EQ.0) RETURN 4 JC=N JL=LD+1 DO 5 I=1,M JL=JL-1 S=BI(JL) XJ=X(JL) YJ=Y(JL) ZJ=Z(JL) T1XJ=T1X(JL) T1YJ=T1Y(JL) T1ZJ=T1Z(JL) T2XJ=T2X(JL) T2YJ=T2Y(JL) T2ZJ=T2Z(JL) CALL HINTG (XOB,YOB,ZOB) JC=JC+3 ACX=T1XJ*CUR(JC-2)+T1YJ*CUR(JC-1)+T1ZJ*CUR(JC) BCX=T2XJ*CUR(JC-2)+T2YJ*CUR(JC-1)+T2ZJ*CUR(JC) HX=HX+ACX*EXK+BCX*EXS HY=HY+ACX*EYK+BCX*EYS 5 HZ=HZ+ACX*EZK+BCX*EZS RETURN C C GET H BY FINITE DIFFERENCE OF E FOR SOMMERFELD GROUND C CON=j/(2*pi*eta) C DELT is the increment for getting central differences C 6 DELT=1.E-3 CON=(0.,4.2246E-4) CALL NEFLD (XOB+DELT,YOB,ZOB,EXPX,EYPX,EZPX) CALL NEFLD (XOB-DELT,YOB,ZOB,EXMX,EYMX,EZMX) CALL NEFLD (XOB,YOB+DELT,ZOB,EXPY,EYPY,EZPY) CALL NEFLD (XOB,YOB-DELT,ZOB,EXMY,EYMY,EZMY) CALL NEFLD (XOB,YOB,ZOB+DELT,EXPZ,EYPZ,EZPZ) CALL NEFLD (XOB,YOB,ZOB-DELT,EXMZ,EYMZ,EZMZ) HX=CON*(EZPY-EZMY-EYPZ+EYMZ)/(2.*DELT) HY=CON*(EXPZ-EXMZ-EZPX+EZMX)/(2.*DELT) HZ=CON*(EYPX-EYMX-EXPY+EXMY)/(2.*DELT) RETURN END SUBROUTINE PATCH (NX,NY,X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,X4,Y4,Z4) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C PATCH GENERATES AND MODIFIES PATCH GEOMETRY DATA COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) C NEW PATCHES. FOR NX=0, NY=1,2,3,4 PATCH IS (RESPECTIVELY) C ARBITRARY, RECTAGULAR, TRIANGULAR, OR QUADRILATERAL. C FOR NX AND NY .GT. 0 A RECTANGULAR SURFACE IS PRODUCED WITH C NX BY NY RECTANGULAR PATCHES. M=M+1 MI=LD+1-M NTP=NY IF (NX.GT.0) NTP=2 IF (NTP.GT.1) GO TO 2 X(MI)=X1 Y(MI)=Y1 Z(MI)=Z1 BI(MI)=Z2 ZNV=COS(X2) XNV=ZNV*COS(Y2) YNV=ZNV*SIN(Y2) ZNV=SIN(X2) XA=SQRT(XNV*XNV+YNV*YNV) IF (XA.LT.1.D-6) GO TO 1 T1X(MI)=-YNV/XA T1Y(MI)=XNV/XA T1Z(MI)=0. GO TO 6 1 T1X(MI)=1. T1Y(MI)=0. T1Z(MI)=0. GO TO 6 2 S1X=X2-X1 S1Y=Y2-Y1 S1Z=Z2-Z1 S2X=X3-X2 S2Y=Y3-Y2 S2Z=Z3-Z2 IF (NX.EQ.0) GO TO 3 S1X=S1X/NX S1Y=S1Y/NX S1Z=S1Z/NX S2X=S2X/NY S2Y=S2Y/NY S2Z=S2Z/NY 3 XNV=S1Y*S2Z-S1Z*S2Y YNV=S1Z*S2X-S1X*S2Z ZNV=S1X*S2Y-S1Y*S2X XA=SQRT(XNV*XNV+YNV*YNV+ZNV*ZNV) XNV=XNV/XA YNV=YNV/XA ZNV=ZNV/XA XST=SQRT(S1X*S1X+S1Y*S1Y+S1Z*S1Z) T1X(MI)=S1X/XST T1Y(MI)=S1Y/XST T1Z(MI)=S1Z/XST IF (NTP.GT.2) GO TO 4 X(MI)=X1+.5*(S1X+S2X) Y(MI)=Y1+.5*(S1Y+S2Y) Z(MI)=Z1+.5*(S1Z+S2Z) BI(MI)=XA GO TO 6 4 IF (NTP.EQ.4) GO TO 5 X(MI)=(X1+X2+X3)/3. Y(MI)=(Y1+Y2+Y3)/3. Z(MI)=(Z1+Z2+Z3)/3. BI(MI)=.5*XA GO TO 6 5 S1X=X3-X1 S1Y=Y3-Y1 S1Z=Z3-Z1 S2X=X4-X1 S2Y=Y4-Y1 S2Z=Z4-Z1 XN2=S1Y*S2Z-S1Z*S2Y YN2=S1Z*S2X-S1X*S2Z ZN2=S1X*S2Y-S1Y*S2X XST=SQRT(XN2*XN2+YN2*YN2+ZN2*ZN2) SALPN=1./(3.*(XA+XST)) X(MI)=(XA*(X1+X2+X3)+XST*(X1+X3+X4))*SALPN Y(MI)=(XA*(Y1+Y2+Y3)+XST*(Y1+Y3+Y4))*SALPN Z(MI)=(XA*(Z1+Z2+Z3)+XST*(Z1+Z3+Z4))*SALPN BI(MI)=.5*(XA+XST) S1X=(XNV*XN2+YNV*YN2+ZNV*ZN2)/XST IF (S1X.GT.0.9998) GO TO 6 WRITE(3,14) STOP 6 T2X(MI)=YNV*T1Z(MI)-ZNV*T1Y(MI) T2Y(MI)=ZNV*T1X(MI)-XNV*T1Z(MI) T2Z(MI)=XNV*T1Y(MI)-YNV*T1X(MI) SALP(MI)=1. IF (NX.EQ.0) GO TO 8 M=M+NX*NY-1 XN2=X(MI)-S1X-S2X YN2=Y(MI)-S1Y-S2Y ZN2=Z(MI)-S1Z-S2Z XS=T1X(MI) YS=T1Y(MI) ZS=T1Z(MI) XT=T2X(MI) YT=T2Y(MI) ZT=T2Z(MI) MI=MI+1 DO 7 IY=1,NY XN2=XN2+S2X YN2=YN2+S2Y ZN2=ZN2+S2Z DO 7 IX=1,NX XST=IX MI=MI-1 X(MI)=XN2+XST*S1X Y(MI)=YN2+XST*S1Y Z(MI)=ZN2+XST*S1Z BI(MI)=XA SALP(MI)=1. T1X(MI)=XS T1Y(MI)=YS T1Z(MI)=ZS T2X(MI)=XT T2Y(MI)=YT 7 T2Z(MI)=ZT 8 IPSYM=0 NP=N MP=M RETURN C DIVIDE PATCH FOR WIRE CONNECTION ENTRY SUBPH (NX,NY,X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,X4,Y4,Z4) IF (NY.GT.0) GO TO 10 IF (NX.EQ.M) GO TO 10 NXP=NX+1 IX=LD-M DO 9 IY=NXP,M IX=IX+1 NYP=IX-3 X(NYP)=X(IX) Y(NYP)=Y(IX) Z(NYP)=Z(IX) BI(NYP)=BI(IX) SALP(NYP)=SALP(IX) T1X(NYP)=T1X(IX) T1Y(NYP)=T1Y(IX) T1Z(NYP)=T1Z(IX) T2X(NYP)=T2X(IX) T2Y(NYP)=T2Y(IX) 9 T2Z(NYP)=T2Z(IX) 10 MI=LD+1-NX XS=X(MI) YS=Y(MI) ZS=Z(MI) XA=BI(MI)*.25 XST=SQRT(XA)*.5 S1X=T1X(MI) S1Y=T1Y(MI) S1Z=T1Z(MI) S2X=T2X(MI) S2Y=T2Y(MI) S2Z=T2Z(MI) SALN=SALP(MI) XT=XST YT=XST IF (NY.GT.0) GO TO 11 MIA=MI GO TO 12 11 M=M+1 MP=MP+1 MIA=LD+1-M 12 DO 13 IX=1,4 X(MIA)=XS+XT*S1X+YT*S2X Y(MIA)=YS+XT*S1Y+YT*S2Y Z(MIA)=ZS+XT*S1Z+YT*S2Z BI(MIA)=XA T1X(MIA)=S1X T1Y(MIA)=S1Y T1Z(MIA)=S1Z T2X(MIA)=S2X T2Y(MIA)=S2Y T2Z(MIA)=S2Z SALP(MIA)=SALN IF (IX.EQ.2) YT=-YT IF (IX.EQ.1.OR.IX.EQ.3) XT=-XT MIA=MIA-1 13 CONTINUE M=M+3 IF (NX.LE.MP) MP=MP+3 IF (NY.GT.0) Z(MI)=10000. RETURN C 14 FORMAT (62H ERROR -- CORNERS OF QUADRILATERAL PATCH DO NOT LIE IN 1A PLANE) END SUBROUTINE PCINT (XI,YI,ZI,CABI,SABI,SALPI,E) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C INTEGRATE OVER PATCHES AT WIRE CONNECTION POINT COMPLEX*16 EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC,E,E1,E2,E3,E4,E5 1,E6,E7,E8,E9 COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND DIMENSION E(9) EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) DATA TPI/6.283185308D+0/,NINT/10/ D=SQRT(S)*.5 DS=4.*D/DFLOAT(NINT) DA=DS*DS GCON=1./S FCON=1./(2.*TPI*D) XXJ=XJ XYJ=YJ XZJ=ZJ XS=S S=DA S1=D+DS*.5 XSS=XJ+S1*(T1XJ+T2XJ) YSS=YJ+S1*(T1YJ+T2YJ) ZSS=ZJ+S1*(T1ZJ+T2ZJ) S1=S1+D S2X=S1 E1=(0.,0.) E2=(0.,0.) E3=(0.,0.) E4=(0.,0.) E5=(0.,0.) E6=(0.,0.) E7=(0.,0.) E8=(0.,0.) E9=(0.,0.) DO 1 I1=1,NINT S1=S1-DS S2=S2X XSS=XSS-DS*T1XJ YSS=YSS-DS*T1YJ ZSS=ZSS-DS*T1ZJ XJ=XSS YJ=YSS ZJ=ZSS DO 1 I2=1,NINT S2=S2-DS XJ=XJ-DS*T2XJ YJ=YJ-DS*T2YJ ZJ=ZJ-DS*T2ZJ CALL UNERE (XI,YI,ZI) EXK=EXK*CABI+EYK*SABI+EZK*SALPI EXS=EXS*CABI+EYS*SABI+EZS*SALPI G1=(D+S1)*(D+S2)*GCON G2=(D-S1)*(D+S2)*GCON G3=(D-S1)*(D-S2)*GCON G4=(D+S1)*(D-S2)*GCON F2=(S1*S1+S2*S2)*TPI F1=S1/F2-(G1-G2-G3+G4)*FCON F2=S2/F2-(G1+G2-G3-G4)*FCON E1=E1+EXK*G1 E2=E2+EXK*G2 E3=E3+EXK*G3 E4=E4+EXK*G4 E5=E5+EXS*G1 E6=E6+EXS*G2 E7=E7+EXS*G3 E8=E8+EXS*G4 1 E9=E9+EXK*F1+EXS*F2 E(1)=E1 E(2)=E2 E(3)=E3 E(4)=E4 E(5)=E5 E(6)=E6 E(7)=E7 E(8)=E8 E(9)=E9 XJ=XXJ YJ=XYJ ZJ=XZJ S=XS RETURN END SUBROUTINE PRNT(IN1,IN2,IN3,FL1,FL2,FL3,FL4,FL5,FL6,CTYPE) C C Purpose: C PRNT prints the input data for impedance loading, inserting blanks C for numbers that are zero. C C INPUT: C IN1-3 = INTEGER VALUES TO BE PRINTED C FL1-6 = REAL VALUES TO BE PRINTED C CTYPE = CHARACTER STRING TO BE PRINTED C IMPLICIT REAL*8(A-H,O-Z) CHARACTER CTYPE*(*), CINT(3)*5, CFLT(6)*13 C DO 1 I=1,3 1 CINT(I)=' ' IF(IN1.EQ.0.AND.IN2.EQ.0.AND.IN3.EQ.0)THEN CINT(1)=' ALL' ELSE IF(IN1.NE.0)WRITE(CINT(1),90)IN1 IF(IN2.NE.0)WRITE(CINT(2),90)IN2 IF(IN3.NE.0)WRITE(CINT(3),90)IN3 END IF DO 2 I=1,6 2 CFLT(I)=' ' IF(ABS(FL1).GT.1.E-30)WRITE(CFLT(1),91)FL1 IF(ABS(FL2).GT.1.E-30)WRITE(CFLT(2),91)FL2 IF(ABS(FL3).GT.1.E-30)WRITE(CFLT(3),91)FL3 IF(ABS(FL4).GT.1.E-30)WRITE(CFLT(4),91)FL4 IF(ABS(FL5).GT.1.E-30)WRITE(CFLT(5),91)FL5 IF(ABS(FL6).GT.1.E-30)WRITE(CFLT(6),91)FL6 WRITE(3,92)(CINT(I),I=1,3),(CFLT(I),I=1,6),CTYPE RETURN C 90 FORMAT(I5) 91 FORMAT(1P,E13.4) 92 FORMAT(/,3X,3A,3X,6A,3X,A) END SUBROUTINE QDSRC (IS,V,E) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C FILL INCIDENT FIELD ARRAY FOR CHARGE DISCONTINUITY VOLTAGE SOURCE COMPLEX*16 VQDS,CURD,CCJ,V,EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC 1,ETK,ETS,ETC,VSANT,VQD,E,ZARRAY COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /VSORC/ VQD(30),VSANT(30),VQDS(30),IVQD(30),ISANT(30),IQDS( 130),NVQD,NSANT,NQDS COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /ANGL/ SALP(MAXSEG) COMMON /ZLOAD/ ZARRAY(MAXSEG),NLOAD,NLODF DIMENSION CCJX(2), E(1), CAB(1), SAB(1) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1) EQUIVALENCE (CCJ,CCJX), (CAB,ALP), (SAB,BET) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG) DATA TP/6.283185308D+0/,CCJX/0.,-.01666666667D+0/ I=ICON1(IS) ICON1(IS)=0 CALL TBF (IS,0) ICON1(IS)=I S=SI(IS)*.5 CURD=CCJ*V/((LOG(2.*S/BI(IS))-1.)*(BX(JSNO)*COS(TP*S)+CX(JSNO)*SI 1N(TP*S))*WLAM) NQDS=NQDS+1 VQDS(NQDS)=V IQDS(NQDS)=IS DO 20 JX=1,JSNO J=JCO(JX) S=SI(J) B=BI(J) XJ=X(J) YJ=Y(J) ZJ=Z(J) CABJ=CAB(J) SABJ=SAB(J) SALPJ=SALP(J) IF (IEXK.EQ.0) GO TO 16 IPR=ICON1(J) IF (IPR.GT.10000) GO TO 7 IF (IPR) 1,6,2 1 IPR=-IPR IF (-ICON1(IPR).NE.J) GO TO 7 GO TO 4 2 IF (IPR.NE.J) GO TO 3 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 7 GO TO 5 3 IF (ICON2(IPR).NE.J) GO TO 7 4 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 7 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 7 5 IND1=0 GO TO 8 6 IND1=1 GO TO 8 7 IND1=2 8 IPR=ICON2(J) IF (IPR.GT.10000) GO TO 15 IF (IPR) 9,14,10 9 IPR=-IPR IF (-ICON2(IPR).NE.J) GO TO 15 GO TO 12 10 IF (IPR.NE.J) GO TO 11 IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 15 GO TO 13 11 IF (ICON1(IPR).NE.J) GO TO 15 12 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) IF (XI.LT.0.999999D+0) GO TO 15 IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 15 13 IND2=0 GO TO 16 14 IND2=1 GO TO 16 15 IND2=2 16 CONTINUE DO 17 I=1,N IJ=I-J XI=X(I) YI=Y(I) ZI=Z(I) AI=BI(I) CALL EFLD (XI,YI,ZI,AI,IJ) CABI=CAB(I) SABI=SAB(I) SALPI=SALP(I) ETK=EXK*CABI+EYK*SABI+EZK*SALPI ETS=EXS*CABI+EYS*SABI+EZS*SALPI ETC=EXC*CABI+EYC*SABI+EZC*SALPI 17 E(I)=E(I)-(ETK*AX(JX)+ETS*BX(JX)+ETC*CX(JX))*CURD IF (M.EQ.0) GO TO 19 IJ=LD+1 I1=N DO 18 I=1,M IJ=IJ-1 XI=X(IJ) YI=Y(IJ) ZI=Z(IJ) CALL HSFLD (XI,YI,ZI,0.D0) I1=I1+1 TX=T2X(IJ) TY=T2Y(IJ) TZ=T2Z(IJ) ETK=EXK*TX+EYK*TY+EZK*TZ ETS=EXS*TX+EYS*TY+EZS*TZ ETC=EXC*TX+EYC*TY+EZC*TZ E(I1)=E(I1)+(ETK*AX(JX)+ETS*BX(JX)+ETC*CX(JX))*CURD*SALP(IJ) I1=I1+1 TX=T1X(IJ) TY=T1Y(IJ) TZ=T1Z(IJ) ETK=EXK*TX+EYK*TY+EZK*TZ ETS=EXS*TX+EYS*TY+EZS*TZ ETC=EXC*TX+EYC*TY+EZC*TZ 18 E(I1)=E(I1)+(ETK*AX(JX)+ETS*BX(JX)+ETC*CX(JX))*CURD*SALP(IJ) 19 IF (NLOAD.GT.0.OR.NLODF.GT.0) E(J)=E(J)+ZARRAY(J)*CURD*(AX(JX)+CX( 1JX)) 20 CONTINUE RETURN END SUBROUTINE RDPAT C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' PARAMETER(NORMAX=4*MAXSEG) IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE RADIATION PATTERN, GAIN, NORMALIZED GAIN REAL*8 IGNTP,IGAX,IGTP,HCIR,HBLK,HPOL,HCLIF,ISENS C INTEGER HPOL,HBLK,HCIR,HCLIF COMPLEX*16 ETH,EPH,ERD,ZRATI,ZRATI2,T1,FRATI COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON/SAVE/EPSR,SIG,SCRWLT,SCRWRT,FMHZ,IP(2*MAXSEG),KCOM COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF COMMON/FPAT/THETS,PHIS,DTH,DPH,RFLD,GNOR,CLT,CHT,EPSR2,SIG2, &XPR6,PINR,PNLR,PLOSS,XNR,YNR,ZNR,DXNR,DYNR,DZNR,NTH,NPH,IPD,IAVP, &INOR,IAX,IXTYP,NEAR,NFEH,NRX,NRY,NRZ COMMON /SCRATM/ GAIN(NORMAX) C*** COMMON /PLOT/ IPLP1,IPLP2,IPLP3,IPLP4 C*** DIMENSION IGTP(4), IGAX(4), IGNTP(10), HPOL(3) DATA HPOL/6HLINEAR,5HRIGHT,4HLEFT/,HBLK,HCIR/1H ,6HCIRCLE/ DATA IGTP/6H - ,6HPOWER ,6H- DIRE,6HCTIVE / DATA IGAX/6H MAJOR,6H MINOR,6H VERT.,6H HOR. / DATA IGNTP/6H MAJOR,6H AXIS ,6H MINOR,6H AXIS ,6H VER,6HTICAL ,6 1H HORIZ,6HONTAL ,6H ,6HTOTAL / DATA PI,TA,TD/3.141592654D+0,1.745329252D-02,57.29577951D+0/ IF (IFAR.LT.2) GO TO 2 WRITE(3,35) IF (IFAR.LE.3) GO TO 1 WRITE(3,36) NRADL,SCRWLT,SCRWRT IF (IFAR.EQ.4) GO TO 2 1 IF (IFAR.EQ.2.OR.IFAR.EQ.5) HCLIF=HPOL(1) IF (IFAR.EQ.3.OR.IFAR.EQ.6) HCLIF=HCIR CL=CLT/WLAM CH=CHT/WLAM ZRATI2=SQRT(1./DCMPLX(EPSR2,-SIG2*WLAM*59.96)) WRITE(3,37) HCLIF,CLT,CHT,EPSR2,SIG2 2 IF (IFAR.NE.1) GO TO 3 WRITE(3,41) GO TO 5 3 I=2*IPD+1 J=I+1 ITMP1=2*IAX+1 ITMP2=ITMP1+1 WRITE(3,38) IF (RFLD.LT.1.D-20) GO TO 4 EXRM=1./RFLD EXRA=RFLD/WLAM EXRA=-360.*(EXRA-AINT(EXRA)) WRITE(3,39) RFLD,EXRM,EXRA 4 WRITE(3,40) IGTP(I),IGTP(J),IGAX(ITMP1),IGAX(ITMP2) 5 IF (IXTYP.EQ.0.OR.IXTYP.EQ.5) GO TO 7 IF (IXTYP.EQ.4) GO TO 6 PRAD=0. GCON=4.*PI/(1.+XPR6*XPR6) GCOP=GCON GO TO 8 6 PINR=394.51*XPR6*XPR6*WLAM*WLAM 7 GCOP=WLAM*WLAM*2.*PI/(376.73*PINR) PRAD=PINR-PLOSS-PNLR GCON=GCOP IF (IPD.NE.0) GCON=GCON*PINR/PRAD 8 I=0 GMAX=-1.E10 PINT=0. TMP1=DPH*TA TMP2=.5*DTH*TA PHI=PHIS-DPH DO 29 KPH=1,NPH PHI=PHI+DPH PHA=PHI*TA THET=THETS-DTH DO 29 KTH=1,NTH THET=THET+DTH IF (KSYMP.EQ.2.AND.THET.GT.90.01.AND.IFAR.NE.1) GO TO 29 THA=THET*TA IF (IFAR.EQ.1) GO TO 9 CALL FFLD (THA,PHA,ETH,EPH) GO TO 10 9 CALL GFLD (RFLD/WLAM,PHA,THET/WLAM,ETH,EPH,ERD,ZRATI,KSYMP) ERDM=ABS(ERD) ERDA=CANG(ERD) 10 ETHM2=DREAL(ETH*DCONJG(ETH)) ETHM=SQRT(ETHM2) ETHA=CANG(ETH) EPHM2=DREAL(EPH*DCONJG(EPH)) EPHM=SQRT(EPHM2) EPHA=CANG(EPH) IF (IFAR.EQ.1) GO TO 28 C ELLIPTICAL POLARIZATION CALC. IF (ETHM2.GT.1.D-20.OR.EPHM2.GT.1.D-20) GO TO 11 TILTA=0. EMAJR2=0. EMINR2=0. AXRAT=0. ISENS=HBLK GO TO 16 11 DFAZ=EPHA-ETHA IF (EPHA.LT.0.) GO TO 12 DFAZ2=DFAZ-360. GO TO 13 12 DFAZ2=DFAZ+360. 13 IF (ABS(DFAZ).GT.ABS(DFAZ2)) DFAZ=DFAZ2 CDFAZ=COS(DFAZ*TA) TSTOR1=ETHM2-EPHM2 TSTOR2=2.*EPHM*ETHM*CDFAZ TILTA=.5*ATGN2(TSTOR2,TSTOR1) STILTA=SIN(TILTA) TSTOR1=TSTOR1*STILTA*STILTA TSTOR2=TSTOR2*STILTA*COS(TILTA) EMAJR2=-TSTOR1+TSTOR2+ETHM2 EMINR2=TSTOR1-TSTOR2+EPHM2 IF (EMINR2.LT.0.) EMINR2=0. AXRAT=SQRT(EMINR2/EMAJR2) TILTA=TILTA*TD IF (AXRAT.GT.1.D-5) GO TO 14 ISENS=HPOL(1) GO TO 16 14 IF (DFAZ.GT.0.) GO TO 15 ISENS=HPOL(2) GO TO 16 15 ISENS=HPOL(3) 16 GNMJ=DB10(GCON*EMAJR2) GNMN=DB10(GCON*EMINR2) GNV=DB10(GCON*ETHM2) GNH=DB10(GCON*EPHM2) GTOT=DB10(GCON*(ETHM2+EPHM2)) IF (INOR.LT.1) GO TO 23 I=I+1 IF (I.GT.NORMAX) GO TO 23 GO TO (17,18,19,20,21), INOR 17 TSTOR1=GNMJ GO TO 22 18 TSTOR1=GNMN GO TO 22 19 TSTOR1=GNV GO TO 22 20 TSTOR1=GNH GO TO 22 21 TSTOR1=GTOT 22 GAIN(I)=TSTOR1 IF (TSTOR1.GT.GMAX) GMAX=TSTOR1 23 IF (IAVP.EQ.0) GO TO 24 TSTOR1=GCOP*(ETHM2+EPHM2) TMP3=THA-TMP2 TMP4=THA+TMP2 IF (KTH.EQ.1) TMP3=THA IF (KTH.EQ.NTH) TMP4=THA DA=ABS(TMP1*(COS(TMP3)-COS(TMP4))) IF (KPH.EQ.1.OR.KPH.EQ.NPH) DA=.5*DA PINT=PINT+TSTOR1*DA IF (IAVP.EQ.2) GO TO 29 24 IF (IAX.EQ.1) GO TO 25 TMP5=GNMJ TMP6=GNMN GO TO 26 25 TMP5=GNV TMP6=GNH 26 ETHM=ETHM*WLAM EPHM=EPHM*WLAM IF (RFLD.LT.1.D-20) GO TO 27 ETHM=ETHM*EXRM ETHA=ETHA+EXRA EPHM=EPHM*EXRM EPHA=EPHA+EXRA 27 WRITE(3,42) THET,PHI,TMP5,TMP6,GTOT,AXRAT,TILTA,ISENS,ETHM,ETHA 1,EPHM,EPHA C GO TO 29 C*** C28 WRITE(3,43) RFLD,PHI,THET,ETHM,ETHA,EPHM,EPHA,ERDM,ERDA IF(IPLP1 .NE. 3) GO TO 299 IF(IPLP3 .EQ. 0) GO TO 290 IF(IPLP2 .EQ. 1 .AND. IPLP3 .EQ. 1) 1WRITE(8,*) THET,ETHM,ETHA IF(IPLP2 .EQ. 1 .AND. IPLP3 .EQ. 2) 1WRITE(8,*) THET,EPHM,EPHA IF(IPLP2 .EQ. 2 .AND. IPLP3 .EQ. 1) 1WRITE(8,*) PHI,ETHM,ETHA IF(IPLP2 .EQ. 2 .AND. IPLP3 .EQ. 2) 1WRITE(8,*) PHI,EPHM,EPHA IF(IPLP4 .EQ. 0) GO TO 299 290 IF(IPLP2 .EQ. 1 .AND. IPLP4 .EQ. 1) 1WRITE(8,*) THET,TMP5 IF(IPLP2 .EQ. 1 .AND. IPLP4 .EQ. 2) 1WRITE(8,*) THET,TMP6 IF(IPLP2 .EQ. 1 .AND. IPLP4 .EQ. 3) 1WRITE(8,*) THET,GTOT IF(IPLP2 .EQ. 2 .AND. IPLP4 .EQ. 1) 1WRITE(8,*) PHI,TMP5 IF(IPLP2 .EQ. 2 .AND. IPLP4 .EQ. 2) 1WRITE(8,*) PHI,TMP6 IF(IPLP2 .EQ. 2 .AND. IPLP4 .EQ. 3) 1WRITE(8,*) PHI,GTOT GO TO 299 28 WRITE(3,43) RFLD,PHI,THET,ETHM,ETHA,EPHM,EPHA,ERDM,ERDA 299 CONTINUE C*** 29 CONTINUE IF (IAVP.EQ.0) GO TO 30 TMP3=THETS*TA TMP4=TMP3+DTH*TA*DFLOAT(NTH-1) TMP3=ABS(DPH*TA*DFLOAT(NPH-1)*(COS(TMP3)-COS(TMP4))) PINT=PINT/TMP3 TMP3=TMP3/PI WRITE(3,44) PINT,TMP3 30 IF (INOR.EQ.0) GO TO 34 IF (ABS(GNOR).GT.1.D-20) GMAX=GNOR ITMP1=(INOR-1)*2+1 ITMP2=ITMP1+1 WRITE(3,45) IGNTP(ITMP1),IGNTP(ITMP2),GMAX ITMP2=NPH*NTH IF (ITMP2.GT.NORMAX) ITMP2=NORMAX ITMP1=(ITMP2+2)/3 ITMP2=ITMP1*3-ITMP2 ITMP3=ITMP1 ITMP4=2*ITMP1 IF (ITMP2.EQ.2) ITMP4=ITMP4-1 DO 31 I=1,ITMP1 ITMP3=ITMP3+1 ITMP4=ITMP4+1 J=(I-1)/NTH TMP1=THETS+DFLOAT(I-J*NTH-1)*DTH TMP2=PHIS+DFLOAT(J)*DPH J=(ITMP3-1)/NTH TMP3=THETS+DFLOAT(ITMP3-J*NTH-1)*DTH TMP4=PHIS+DFLOAT(J)*DPH J=(ITMP4-1)/NTH TMP5=THETS+DFLOAT(ITMP4-J*NTH-1)*DTH TMP6=PHIS+DFLOAT(J)*DPH TSTOR1=GAIN(I)-GMAX IF (I.EQ.ITMP1.AND.ITMP2.NE.0) GO TO 32 TSTOR2=GAIN(ITMP3)-GMAX PINT=GAIN(ITMP4)-GMAX 31 WRITE(3,46) TMP1,TMP2,TSTOR1,TMP3,TMP4,TSTOR2,TMP5,TMP6,PINT GO TO 34 32 IF (ITMP2.EQ.2) GO TO 33 TSTOR2=GAIN(ITMP3)-GMAX WRITE(3,46) TMP1,TMP2,TSTOR1,TMP3,TMP4,TSTOR2 GO TO 34 33 WRITE(3,46) TMP1,TMP2,TSTOR1 34 RETURN C 35 FORMAT (///,31X,39H- - - FAR FIELD GROUND PARAMETERS - - -,//) 36 FORMAT (40X,25HRADIAL WIRE GROUND SCREEN,/,40X,I5,6H WIRES,/,40X,1 12HWIRE LENGTH=,F8.2,7H METERS,/,40X,12HWIRE RADIUS=,1P,E10.3, 27H METERS) 37 FORMAT (40X,A6,6H CLIFF,/,40X,14HEDGE DISTANCE=,F9.2,7H METERS,/,4 10X,7HHEIGHT=,F8.2,7H METERS,/,40X,15HSECOND MEDIUM -,/,40X,27HRELA 2TIVE DIELECTRIC CONST.=,F7.3,/,40X,13HCONDUCTIVITY=,1P,E10.3, 35H MHOS) 38 FORMAT (///,48X,30H- - - RADIATION PATTERNS - - -) 39 FORMAT (54X,6HRANGE=,1P,E13.6,7H METERS,/,54X,12HEXP(-JKR)/R=, 1E12.5,9H AT PHASE,0P,F7.2,8H DEGREES,/) 40 FORMAT (/,2X,14H- - ANGLES - -,7X,2A6,7HGAINS -,7X,24H- - - POLARI 1ZATION - - -,4X,20H- - - E(THETA) - - -,4X,18H- - - E(PHI) - - -, 2/,2X,5HTHETA,5X,3HPHI,7X,A6,2X,A6,3X,5HTOTAL,6X,5HAXIAL,5X,4HTILT, 33X,5HSENSE,2(5X,9HMAGNITUDE,4X,6HPHASE ),/,2(1X,7HDEGREES,1X),3( 46X,2HDB),8X,5HRATIO,5X,4HDEG.,8X,2(6X,7HVOLTS/M,4X,7HDEGREES)) 41 FORMAT (///,28X,40H - - - RADIATED FIELDS NEAR GROUND - - -,//,8X, 120H- - - LOCATION - - -,10X,16H- - E(THETA) - -,8X,14H- - E(PHI) - 2 -,8X,17H- - E(RADIAL) - -,/,7X,3HRHO,6X,3HPHI,9X,1HZ,12X,3HMAG,6X 3,5HPHASE,9X,3HMAG,6X,5HPHASE,9X,3HMAG,6X,5HPHASE,/,5X,6HMETERS,3X, 47HDEGREES,4X,6HMETERS,8X,7HVOLTS/M,3X,7HDEGREES,6X,7HVOLTS/M,3X,7H 5DEGREES,6X,7HVOLTS/M,3X,7HDEGREES,/) 42 FORMAT(1X,F7.2,F9.2,3X,3F8.2,F11.5,F9.2,2X,A6,2(1P,E15.5,0P,F9.2)) 43 FORMAT (3X,F9.2,2X,F7.2,2X,F9.2,1X,3(3X,1P,E11.4,2X,0P,F7.2)) 44 FORMAT (//,3X,19HAVERAGE POWER GAIN=,1P,E12.5,7X, 31HSOLID ANGLE U 1SED IN AVERAGING=(,0P,F7.4,16H)*PI STERADIANS.,//) 45 FORMAT (//,37X,31H- - - - NORMALIZED GAIN - - - -,//,37X,2A6,4HGAI 1N,/,38X,22HNORMALIZATION FACTOR =,F9.2,3H DB,//,3(4X,14H- - ANGLES 2 - -,6X,4HGAIN,7X),/,3(4X,5HTHETA,5X,3HPHI,8X,2HDB,8X),/,3(3X,7HDE 3GREES,2X,7HDEGREES,16X)) 46 FORMAT (3(1X,2F9.2,1X,F9.2,6X)) END SUBROUTINE READGM(INUNIT,CODE,I1,I2,R1,R2,R3,R4,R5,R6,R7) C C READGM reads a geometry record and parses it. C C ***** Passed variables C CODE two letter mnemonic code C I1 - I2 integer values from record C R1 - R7 real values from record C IMPLICIT REAL*8(A-H,O-Z) CHARACTER*(*) CODE DIMENSION INTVAL(2),REAVAL(7) C C Call the routine to read the record and parse it. C CALL PARSIT(INUNIT,2,7,CODE,INTVAL,REAVAL,IEOF) C C Set the return variables to the buffer array elements. C IF(IEOF.LT.0)CODE='GE' I1=INTVAL(1) I2=INTVAL(2) R1=REAVAL(1) R2=REAVAL(2) R3=REAVAL(3) R4=REAVAL(4) R5=REAVAL(5) R6=REAVAL(6) R7=REAVAL(7) RETURN END SUBROUTINE READMN(INUNIT,CODE,I1,I2,I3,I4,F1,F2,F3,F4,F5,F6) C C READMN reads a control record and parses it. C IMPLICIT REAL*8(A-H,O-Z) CHARACTER*(*) CODE DIMENSION INTVAL(4),REAVAL(6) C C Call the routine to read the record and parse it. C CALL PARSIT(INUNIT,4,6,CODE,INTVAL,REAVAL,IEOF) C C Set the return variables to the buffer array elements. IF(IEOF.LT.0)CODE='EN' I1=INTVAL(1) I2=INTVAL(2) I3=INTVAL(3) I4=INTVAL(4) F1=REAVAL(1) F2=REAVAL(2) F3=REAVAL(3) F4=REAVAL(4) F5=REAVAL(5) F6=REAVAL(6) RETURN END SUBROUTINE PARSIT(INUNIT,MAXINT,MAXREA,CMND,INTFLD,REAFLD,IEOF) C UPDATED: 21 July 87 C Called by: READGM READMN C PARSIT reads an input record and parses it. C ***** Passed variables C MAXINT total number of integers in record C MAXREA total number of real values in record C CMND two letter mnemonic code C INTFLD integer values from record C REAFLD real values from record C ***** Internal Variables C BGNFLD list of starting indices C BUFFER text buffer C ENDFLD list of ending indices C FLDTRM flag to indicate that pointer is in field position C REC input line as read C TOTCOL total number of columns in REC C TOTFLD number of numeric fields IMPLICIT REAL*8(A-H,O-Z) CHARACTER CMND*2, BUFFER*20, REC*80 INTEGER INTFLD(MAXINT) INTEGER BGNFLD(12), ENDFLD(12), TOTCOL, TOTFLD LOGICAL FLDTRM DIMENSION REAFLD(MAXREA) C READ(INUNIT, 8000, IOSTAT=IEOF) REC CALL UPCASE( REC, REC, TOTCOL ) C C Store opcode and clear field arrays. C CMND= REC(1:2) DO 3000 I=1,MAXINT INTFLD(I)= 0 3000 CONTINUE DO 3010 I=1,MAXREA REAFLD(I)= 0.0 3010 CONTINUE DO 3020 I=1,12 BGNFLD(I)= 0 ENDFLD(I)= 0 3020 CONTINUE C C Find the beginning and ending of each field as well as the total number of C fields. C TOTFLD= 0 FLDTRM= .FALSE. LAST= MAXREA + MAXINT DO 4000 J=3,TOTCOL K= ICHAR( REC(J:J) ) C C Check for end of line comment (`!'). This is a new modification to allow C VAX-like comments at the end of data records, i.e. C GW 1 7 0 0 0 0 0 .5 .0001 ! DIPOLE WIRE C GE ! END OF GEOMETRY C IF (K .EQ. 33) THEN IF (FLDTRM) ENDFLD(TOTFLD)= J - 1 GO TO 5000 C C Set the ending index when the character is a comma or space and the pointer C is in a field position (FLDTRM = .TRUE.). C ELSE IF (K .EQ. 32 .OR. K .EQ. 44) THEN IF (FLDTRM) THEN ENDFLD(TOTFLD)= J - 1 FLDTRM= .FALSE. ENDIF C C Set the beginning index when the character is not a comma or space and the C pointer is not currently in a field position (FLDTRM = .FALSE). C ELSE IF (.NOT. FLDTRM) THEN TOTFLD= TOTFLD + 1 FLDTRM= .TRUE. BGNFLD(TOTFLD)= J ENDIF 4000 CONTINUE IF (FLDTRM) ENDFLD(TOTFLD)= TOTCOL C Check to see if the total number of value fields is within the precribed C limits. 5000 IF (TOTFLD .EQ. 0) THEN RETURN ELSE IF (TOTFLD .GT. LAST) THEN WRITE(3, 8001 ) GOTO 9010 ENDIF J= MIN( TOTFLD, MAXINT ) C Parse out integer values and store into integer buffer array. DO 5090 I=1,J LENGTH= ENDFLD(I) - BGNFLD(I) + 1 BUFFER= REC(BGNFLD(I):ENDFLD(I)) IND= INDEX( BUFFER(1:LENGTH), '.' ) IF (IND .GT. 0 .AND. IND .LT. LENGTH) GO TO 9000 IF (IND .EQ. LENGTH) LENGTH= LENGTH - 1 READ( BUFFER(1:LENGTH), *, ERR=9000 ) INTFLD(I) 5090 CONTINUE C Parse out real values and store into real buffer array. IF (TOTFLD .GT. MAXINT) THEN J= MAXINT + 1 DO 6000 I=J,TOTFLD LENGTH= ENDFLD(I) - BGNFLD(I) + 1 BUFFER= REC(BGNFLD(I):ENDFLD(I)) IND= INDEX( BUFFER(1:LENGTH), '.' ) IF (IND .EQ. 0) THEN INDE= INDEX( BUFFER(1:LENGTH), 'E' ) LENGTH= LENGTH + 1 IF (INDE .EQ. 0) THEN BUFFER(LENGTH:LENGTH)= '.' ELSE BUFFER= BUFFER(1:INDE-1)//'.'// & BUFFER(INDE:LENGTH-1) ENDIF ENDIF READ( BUFFER(1:LENGTH), *, ERR=9000 ) REAFLD(I-MAXINT) 6000 CONTINUE ENDIF RETURN C Print out text of record line when error occurs. 9000 IF (I .LE. MAXINT) THEN WRITE(3, 8002 ) I ELSE I= I - MAXINT WRITE(3, 8003 ) I ENDIF 9010 WRITE(3, 8004 ) REC STOP 'CARD ERROR' C C Input formats and output messages. C 8000 FORMAT (A80) 8001 FORMAT (//,' ***** CARD ERROR - TOO MANY FIELDS IN RECORD') 8002 FORMAT (//,' ***** CARD ERROR - INVALID NUMBER AT INTEGER', & ' POSITION ',I1) 8003 FORMAT (//,' ***** CARD ERROR - INVALID NUMBER AT REAL', & ' POSITION ',I1) 8004 FORMAT (' ***** TEXT --> ',A80) END SUBROUTINE UPCASE( INTEXT, OUTTXT, LENGTH ) C C UPCASE finds the length of INTEXT and converts it to upper case. C CHARACTER *(*) INTEXT, OUTTXT C C LENGTH = LEN( INTEXT ) DO 3000 I=1,LENGTH J = ICHAR( INTEXT(I:I) ) IF (J .GE. 96) J = J - 32 OUTTXT(I:I) = CHAR( J ) 3000 CONTINUE RETURN END SUBROUTINE REBLK (B,BX,NB,NBX,N2C) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C REBLOCK ARRAY B IN N.G.F. SOLUTION FROM BLOCKS OF ROWS ON TAPE14 C TO BLOCKS OF COLUMNS ON TAPE16 COMPLEX*16 B,BX COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION B(NB,1), BX(NBX,1) REWIND 16 NIB=0 NPB=NPBL DO 3 IB=1,NBBL IF (IB.EQ.NBBL) NPB=NLBL REWIND 14 NIX=0 NPX=NPBX DO 2 IBX=1,NBBX IF (IBX.EQ.NBBX) NPX=NLBX READ (14) ((BX(I,J),I=1,NPX),J=1,N2C) DO 1 I=1,NPX IX=I+NIX DO 1 J=1,NPB 1 B(IX,J)=BX(I,J+NIB) 2 NIX=NIX+NPBX WRITE (16) ((B(I,J),I=1,NB),J=1,NPB) 3 NIB=NIB+NPBL REWIND 14 REWIND 16 RETURN END SUBROUTINE REFLC (IX,IY,IZ,ITX,NOP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C REFLC REFLECTS PARTIAL STRUCTURE ALONG X,Y, OR Z AXES OR ROTATES C STRUCTURE TO COMPLETE A SYMMETRIC STRUCTURE. C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /ANGL/ SALP(MAXSEG) DIMENSION T1X(1), T1Y(1), T1Z(1), T2X(1), T2Y(1), T2Z(1), X2(1), Y 12(1), Z2(1) EQUIVALENCE (T1X,SI), (T1Y,ALP), (T1Z,BET), (T2X,ICON1), (T2Y,ICON 12), (T2Z,ITAG), (X2,SI), (Y2,ALP), (Z2,BET) NP=N MP=M IPSYM=0 ITI=ITX IF (IX.LT.0) GO TO 19 IF (NOP.EQ.0) RETURN IPSYM=1 IF (IZ.EQ.0) GO TO 6 C C REFLECT ALONG Z AXIS C IPSYM=2 IF (N.LT.N2) GO TO 3 DO 2 I=N2,N NX=I+N-N1 E1=Z(I) E2=Z2(I) IF (ABS(E1)+ABS(E2).GT.1.D-5.AND.E1*E2.GE.-1.D-6) GO TO 1 WRITE(3,24) I STOP 1 X(NX)=X(I) Y(NX)=Y(I) Z(NX)=-E1 X2(NX)=X2(I) Y2(NX)=Y2(I) Z2(NX)=-E2 ITAGI=ITAG(I) IF (ITAGI.EQ.0) ITAG(NX)=0 IF (ITAGI.NE.0) ITAG(NX)=ITAGI+ITI 2 BI(NX)=BI(I) N=N*2-N1 ITI=ITI*2 3 IF (M.LT.M2) GO TO 6 NXX=LD+1-M1 DO 5 I=M2,M NXX=NXX-1 NX=NXX-M+M1 IF (ABS(Z(NXX)).GT.1.D-10) GO TO 4 WRITE(3,25) I STOP 4 X(NX)=X(NXX) Y(NX)=Y(NXX) Z(NX)=-Z(NXX) T1X(NX)=T1X(NXX) T1Y(NX)=T1Y(NXX) T1Z(NX)=-T1Z(NXX) T2X(NX)=T2X(NXX) T2Y(NX)=T2Y(NXX) T2Z(NX)=-T2Z(NXX) SALP(NX)=-SALP(NXX) 5 BI(NX)=BI(NXX) M=M*2-M1 6 IF (IY.EQ.0) GO TO 12 C C REFLECT ALONG Y AXIS C IF (N.LT.N2) GO TO 9 DO 8 I=N2,N NX=I+N-N1 E1=Y(I) E2=Y2(I) IF (ABS(E1)+ABS(E2).GT.1.D-5.AND.E1*E2.GE.-1.D-6) GO TO 7 WRITE(3,24) I STOP 7 X(NX)=X(I) Y(NX)=-E1 Z(NX)=Z(I) X2(NX)=X2(I) Y2(NX)=-E2 Z2(NX)=Z2(I) ITAGI=ITAG(I) IF (ITAGI.EQ.0) ITAG(NX)=0 IF (ITAGI.NE.0) ITAG(NX)=ITAGI+ITI 8 BI(NX)=BI(I) N=N*2-N1 ITI=ITI*2 9 IF (M.LT.M2) GO TO 12 NXX=LD+1-M1 DO 11 I=M2,M NXX=NXX-1 NX=NXX-M+M1 IF (ABS(Y(NXX)).GT.1.D-10) GO TO 10 WRITE(3,25) I STOP 10 X(NX)=X(NXX) Y(NX)=-Y(NXX) Z(NX)=Z(NXX) T1X(NX)=T1X(NXX) T1Y(NX)=-T1Y(NXX) T1Z(NX)=T1Z(NXX) T2X(NX)=T2X(NXX) T2Y(NX)=-T2Y(NXX) T2Z(NX)=T2Z(NXX) SALP(NX)=-SALP(NXX) 11 BI(NX)=BI(NXX) M=M*2-M1 12 IF (IX.EQ.0) GO TO 18 C C REFLECT ALONG X AXIS C IF (N.LT.N2) GO TO 15 DO 14 I=N2,N NX=I+N-N1 E1=X(I) E2=X2(I) IF (ABS(E1)+ABS(E2).GT.1.D-5.AND.E1*E2.GE.-1.D-6) GO TO 13 WRITE(3,24) I STOP 13 X(NX)=-E1 Y(NX)=Y(I) Z(NX)=Z(I) X2(NX)=-E2 Y2(NX)=Y2(I) Z2(NX)=Z2(I) ITAGI=ITAG(I) IF (ITAGI.EQ.0) ITAG(NX)=0 IF (ITAGI.NE.0) ITAG(NX)=ITAGI+ITI 14 BI(NX)=BI(I) N=N*2-N1 15 IF (M.LT.M2) GO TO 18 NXX=LD+1-M1 DO 17 I=M2,M NXX=NXX-1 NX=NXX-M+M1 IF (ABS(X(NXX)).GT.1.D-10) GO TO 16 WRITE(3,25) I STOP 16 X(NX)=-X(NXX) Y(NX)=Y(NXX) Z(NX)=Z(NXX) T1X(NX)=-T1X(NXX) T1Y(NX)=T1Y(NXX) T1Z(NX)=T1Z(NXX) T2X(NX)=-T2X(NXX) T2Y(NX)=T2Y(NXX) T2Z(NX)=T2Z(NXX) SALP(NX)=-SALP(NXX) 17 BI(NX)=BI(NXX) M=M*2-M1 18 RETURN C C REPRODUCE STRUCTURE WITH ROTATION TO FORM CYLINDRICAL STRUCTURE C 19 FNOP=NOP IPSYM=-1 SAM=6.283185308D+0/FNOP CS=COS(SAM) SS=SIN(SAM) IF (N.LT.N2) GO TO 21 N=N1+(N-N1)*NOP NX=NP+1 DO 20 I=NX,N K=I-NP+N1 XK=X(K) YK=Y(K) X(I)=XK*CS-YK*SS Y(I)=XK*SS+YK*CS Z(I)=Z(K) XK=X2(K) YK=Y2(K) X2(I)=XK*CS-YK*SS Y2(I)=XK*SS+YK*CS Z2(I)=Z2(K) ITAGI=ITAG(K) IF (ITAGI.EQ.0) ITAG(I)=0 IF (ITAGI.NE.0) ITAG(I)=ITAGI+ITI 20 BI(I)=BI(K) 21 IF (M.LT.M2) GO TO 23 M=M1+(M-M1)*NOP NX=MP+1 K=LD+1-M1 DO 22 I=NX,M K=K-1 J=K-MP+M1 XK=X(K) YK=Y(K) X(J)=XK*CS-YK*SS Y(J)=XK*SS+YK*CS Z(J)=Z(K) XK=T1X(K) YK=T1Y(K) T1X(J)=XK*CS-YK*SS T1Y(J)=XK*SS+YK*CS T1Z(J)=T1Z(K) XK=T2X(K) YK=T2Y(K) T2X(J)=XK*CS-YK*SS T2Y(J)=XK*SS+YK*CS T2Z(J)=T2Z(K) SALP(J)=SALP(K) 22 BI(J)=BI(K) 23 RETURN C 24 FORMAT (29H GEOMETRY DATA ERROR--SEGMENT,I5,26H LIES IN PLANE OF S 1YMMETRY) 25 FORMAT (27H GEOMETRY DATA ERROR--PATCH,I4,26H LIES IN PLANE OF SYM 1METRY) END SUBROUTINE ROM2 (A,B,SUM,DMIN) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C FOR THE SOMMERFELD GROUND OPTION, ROM2 INTEGRATES OVER THE SOURCE C SEGMENT TO OBTAIN THE TOTAL FIELD DUE TO GROUND. THE METHOD OF C VARIABLE INTERVAL WIDTH ROMBERG INTEGRATION IS USED. THERE ARE 9 C FIELD COMPONENTS - THE X, Y, AND Z COMPONENTS DUE TO CONSTANT, C SINE, AND COSINE CURRENT DISTRIBUTIONS. C COMPLEX*16 SUM,G1,G2,G3,G4,G5,T00,T01,T10,T02,T11,T20 DIMENSION SUM(9), G1(9), G2(9), G3(9), G4(9), G5(9), T01(9), T10(9 1), T20(9) DATA NM,NTS,NX,N/65536,4,1,9/,RX/1.D-4/ Z=A ZE=B S=B-A IF (S.GE.0.) GO TO 1 WRITE(3,18) STOP 1 EP=S/(1.E4*NM) ZEND=ZE-EP DO 2 I=1,N 2 SUM(I)=(0.,0.) NS=NX NT=0 CALL SFLDS (Z,G1) 3 DZ=S/NS IF (Z+DZ.LE.ZE) GO TO 4 DZ=ZE-Z IF (DZ.LE.EP) GO TO 17 4 DZOT=DZ*.5 CALL SFLDS (Z+DZOT,G3) CALL SFLDS (Z+DZ,G5) 5 TMAG1=0. TMAG2=0. C C EVALUATE 3 POINT ROMBERG RESULT AND TEST CONVERGENCE. C DO 6 I=1,N T00=(G1(I)+G5(I))*DZOT T01(I)=(T00+DZ*G3(I))*.5 T10(I)=(4.*T01(I)-T00)/3. IF (I.GT.3) GO TO 6 TR=DREAL(T01(I)) TI=DIMAG(T01(I)) TMAG1=TMAG1+TR*TR+TI*TI TR=DREAL(T10(I)) TI=DIMAG(T10(I)) TMAG2=TMAG2+TR*TR+TI*TI 6 CONTINUE TMAG1=SQRT(TMAG1) TMAG2=SQRT(TMAG2) CALL TEST(TMAG1,TMAG2,TR,0.D0,0.D0,TI,DMIN) IF(TR.GT.RX)GO TO 8 DO 7 I=1,N 7 SUM(I)=SUM(I)+T10(I) NT=NT+2 GO TO 12 8 CALL SFLDS (Z+DZ*.25,G2) CALL SFLDS (Z+DZ*.75,G4) TMAG1=0. TMAG2=0. C C EVALUATE 5 POINT ROMBERG RESULT AND TEST CONVERGENCE. C DO 9 I=1,N T02=(T01(I)+DZOT*(G2(I)+G4(I)))*.5 T11=(4.*T02-T01(I))/3. T20(I)=(16.*T11-T10(I))/15. IF (I.GT.3) GO TO 9 TR=DREAL(T11) TI=DIMAG(T11) TMAG1=TMAG1+TR*TR+TI*TI TR=DREAL(T20(I)) TI=DIMAG(T20(I)) TMAG2=TMAG2+TR*TR+TI*TI 9 CONTINUE TMAG1=SQRT(TMAG1) TMAG2=SQRT(TMAG2) CALL TEST(TMAG1,TMAG2,TR,0.D0,0.D0,TI,DMIN) IF(TR.GT.RX)GO TO 14 10 DO 11 I=1,N 11 SUM(I)=SUM(I)+T20(I) NT=NT+1 12 Z=Z+DZ IF (Z.GT.ZEND) GO TO 17 DO 13 I=1,N 13 G1(I)=G5(I) IF (NT.LT.NTS.OR.NS.LE.NX) GO TO 3 NS=NS/2 NT=1 GO TO 3 14 NT=0 IF (NS.LT.NM) GO TO 15 WRITE(3,19) Z GO TO 10 15 NS=NS*2 DZ=S/NS DZOT=DZ*.5 DO 16 I=1,N G5(I)=G3(I) 16 G3(I)=G2(I) GO TO 5 17 CONTINUE RETURN C 18 FORMAT (30H ERROR - B LESS THAN A IN ROM2) 19 FORMAT (33H ROM2 -- STEP SIZE LIMITED AT Z =,1P,E12.5) END SUBROUTINE SBF (I,IS,AA,BB,CC) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE COMPONENT OF BASIS FUNCTION I ON SEGMENT IS. COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM DATA PI/3.141592654D+0/,JMAX/30/ AA=0. BB=0. CC=0. JUNE=0 JSNO=0 PP=0. JCOX=ICON1(I) IF (JCOX.GT.10000) JCOX=I JEND=-1 IEND=-1 SIG=-1. IF (JCOX) 1,11,2 1 JCOX=-JCOX GO TO 3 2 SIG=-SIG JEND=-JEND 3 JSNO=JSNO+1 IF (JSNO.GE.JMAX) GO TO 24 D=PI*SI(JCOX) SDH=SIN(D) CDH=COS(D) SD=2.*SDH*CDH IF (D.GT.0.015) GO TO 4 OMC=4.*D*D OMC=((1.3888889D-3*OMC-4.1666666667D-2)*OMC+.5)*OMC GO TO 5 4 OMC=1.-CDH*CDH+SDH*SDH 5 AJ=1./(LOG(1./(PI*BI(JCOX)))-.577215664D+0) PP=PP-OMC/SD*AJ IF (JCOX.NE.IS) GO TO 6 AA=AJ/SD*SIG BB=AJ/(2.*CDH) CC=-AJ/(2.*SDH)*SIG JUNE=IEND 6 IF (JCOX.EQ.I) GO TO 9 IF (JEND.EQ.1) GO TO 7 JCOX=ICON1(JCOX) GO TO 8 7 JCOX=ICON2(JCOX) 8 IF (IABS(JCOX).EQ.I) GO TO 10 IF (JCOX) 1,24,2 9 IF (JCOX.EQ.IS) BB=-BB 10 IF (IEND.EQ.1) GO TO 12 11 PM=-PP PP=0. NJUN1=JSNO JCOX=ICON2(I) IF (JCOX.GT.10000) JCOX=I JEND=1 IEND=1 SIG=-1. IF (JCOX) 1,12,2 12 NJUN2=JSNO-NJUN1 D=PI*SI(I) SDH=SIN(D) CDH=COS(D) SD=2.*SDH*CDH CD=CDH*CDH-SDH*SDH IF (D.GT.0.015) GO TO 13 OMC=4.*D*D OMC=((1.3888889D-3*OMC-4.1666666667D-2)*OMC+.5)*OMC GO TO 14 13 OMC=1.-CD 14 AP=1./(LOG(1./(PI*BI(I)))-.577215664D+0) AJ=AP IF (NJUN1.EQ.0) GO TO 19 IF (NJUN2.EQ.0) GO TO 21 QP=SD*(PM*PP+AJ*AP)+CD*(PM*AP-PP*AJ) QM=(AP*OMC-PP*SD)/QP QP=-(AJ*OMC+PM*SD)/QP IF (JUNE) 15,18,16 15 AA=AA*QM BB=BB*QM CC=CC*QM GO TO 17 16 AA=-AA*QP BB=BB*QP CC=-CC*QP 17 IF (I.NE.IS) RETURN 18 AA=AA-1. BB=BB+(AJ*QM+AP*QP)*SDH/SD CC=CC+(AJ*QM-AP*QP)*CDH/SD RETURN 19 IF (NJUN2.EQ.0) GO TO 23 QP=PI*BI(I) XXI=QP*QP XXI=QP*(1.-.5*XXI)/(1.-XXI) QP=-(OMC+XXI*SD)/(SD*(AP+XXI*PP)+CD*(XXI*AP-PP)) IF (JUNE.NE.1) GO TO 20 AA=-AA*QP BB=BB*QP CC=-CC*QP IF (I.NE.IS) RETURN 20 AA=AA-1. D=CD-XXI*SD BB=BB+(SDH+AP*QP*(CDH-XXI*SDH))/D CC=CC+(CDH+AP*QP*(SDH+XXI*CDH))/D RETURN 21 QM=PI*BI(I) XXI=QM*QM XXI=QM*(1.-.5*XXI)/(1.-XXI) QM=(OMC+XXI*SD)/(SD*(AJ-XXI*PM)+CD*(PM+XXI*AJ)) IF (JUNE.NE.-1) GO TO 22 AA=AA*QM BB=BB*QM CC=CC*QM IF (I.NE.IS) RETURN 22 AA=AA-1. D=CD-XXI*SD BB=BB+(AJ*QM*(CDH-XXI*SDH)-SDH)/D CC=CC+(CDH-AJ*QM*(SDH+XXI*CDH))/D RETURN 23 AA=-1. QP=PI*BI(I) XXI=QP*QP XXI=QP*(1.-.5*XXI)/(1.-XXI) CC=1./(CDH-XXI*SDH) RETURN 24 WRITE(3,25) I STOP C 25 FORMAT (43H SBF - SEGMENT CONNECTION ERROR FOR SEGMENT,I5) END C SUBROUTINE CPU_TIME (CPUSECD) C C Purpose: C CPU_TIME returns cpu time in seconds. Must be customized!!! C C VAX or other (modify subroutine stopwtch): C C REAL*8 CPUSECD C CALL STOPWTCH(CPUSECS,WALLTOT,CPUSPLT,WALLSPLT) C CPUSECD=60.*CPUSECS C MACINTOSH: C CPUSECD= LONG(362)/60.0 C RETURN C END c ********************************************************************** SUBROUTINE SFLDS (T,E) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C SFLDX RETURNS THE FIELD DUE TO GROUND FOR A CURRENT ELEMENT ON C THE SOURCE SEGMENT AT T RELATIVE TO THE SEGMENT CENTER. C COMPLEX*16 E,ERV,EZV,ERH,EZH,EPH,T1,EXK,EYK,EZK,EXS,EYS,EZS,EXC 1,EYC,EZC,XX1,XX2,U,U2,ZRATI,ZRATI2,FRATI,ER,ET,HRV,HZV,HRH COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /INCOM/ XO,YO,ZO,SN,XSN,YSN,ISNOR COMMON /GWAV/ U,U2,XX1,XX2,R1,R2,ZMH,ZPH COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF DIMENSION E(9) DATA PI/3.141592654D+0/,TP/6.283185308D+0/,POT/1.570796327D+0/ XT=XJ+T*CABJ YT=YJ+T*SABJ ZT=ZJ+T*SALPJ RHX=XO-XT RHY=YO-YT RHS=RHX*RHX+RHY*RHY RHO=SQRT(RHS) IF (RHO.GT.0.) GO TO 1 RHX=1. RHY=0. PHX=0. PHY=1. GO TO 2 1 RHX=RHX/RHO RHY=RHY/RHO PHX=-RHY PHY=RHX 2 CPH=RHX*XSN+RHY*YSN SPH=RHY*XSN-RHX*YSN IF (ABS(CPH).LT.1.D-10) CPH=0. IF (ABS(SPH).LT.1.D-10) SPH=0. ZPH=ZO+ZT ZPHS=ZPH*ZPH R2S=RHS+ZPHS R2=SQRT(R2S) RK=R2*TP XX2=DCMPLX(COS(RK),-SIN(RK)) IF (ISNOR.EQ.1) GO TO 3 C C USE NORTON APPROXIMATION FOR FIELD DUE TO GROUND. CURRENT IS C LUMPED AT SEGMENT CENTER WITH CURRENT MOMENT FOR CONSTANT, SINE, C OR COSINE DISTRIBUTION. C ZMH=1. R1=1. XX1=0. CALL GWAVE (ERV,EZV,ERH,EZH,EPH) ET=-(0.,4.77134)*FRATI*XX2/(R2S*R2) ER=2.*ET*DCMPLX(1.D+0,RK) ET=ET*DCMPLX(1.D+0-RK*RK,RK) HRV=(ER+ET)*RHO*ZPH/R2S HZV=(ZPHS*ER-RHS*ET)/R2S HRH=(RHS*ER-ZPHS*ET)/R2S ERV=ERV-HRV EZV=EZV-HZV ERH=ERH+HRH EZH=EZH+HRV EPH=EPH+ET ERV=ERV*SALPJ EZV=EZV*SALPJ ERH=ERH*SN*CPH EZH=EZH*SN*CPH EPH=EPH*SN*SPH ERH=ERV+ERH E(1)=(ERH*RHX+EPH*PHX)*S E(2)=(ERH*RHY+EPH*PHY)*S E(3)=(EZV+EZH)*S E(4)=0. E(5)=0. E(6)=0. SFAC=PI*S SFAC=SIN(SFAC)/SFAC E(7)=E(1)*SFAC E(8)=E(2)*SFAC E(9)=E(3)*SFAC RETURN C C INTERPOLATE IN SOMMERFELD FIELD TABLES C 3 IF (RHO.LT.1.D-12) GO TO 4 THET=ATAN(ZPH/RHO) GO TO 5 4 THET=POT 5 CALL INTRP (R2,THET,ERV,EZV,ERH,EPH) C COMBINE VERTICAL AND HORIZONTAL COMPONENTS AND CONVERT TO X,Y,Z C COMPONENTS. MULTIPLY BY EXP(-JKR)/R. XX2=XX2/R2 SFAC=SN*CPH ERH=XX2*(SALPJ*ERV+SFAC*ERH) EZH=XX2*(SALPJ*EZV-SFAC*ERV) EPH=SN*SPH*XX2*EPH C X,Y,Z FIELDS FOR CONSTANT CURRENT E(1)=ERH*RHX+EPH*PHX E(2)=ERH*RHY+EPH*PHY E(3)=EZH RK=TP*T C X,Y,Z FIELDS FOR SINE CURRENT SFAC=SIN(RK) E(4)=E(1)*SFAC E(5)=E(2)*SFAC E(6)=E(3)*SFAC C X,Y,Z FIELDS FOR COSINE CURRENT SFAC=COS(RK) E(7)=E(1)*SFAC E(8)=E(2)*SFAC E(9)=E(3)*SFAC RETURN END SUBROUTINE SOLGF (A,B,C,D,XY,IP,NP,N1,N,MP,M1,M,N1C,N2C,N2CZ) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C SOLVE FOR CURRENT IN N.G.F. PROCEDURE COMPLEX*16 A,B,C,D,SUM,XY,Y COMMON /SCRATM/ Y(2*MAXSEG) COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(1), B(N1C,1), C(N1C,1), D(N2CZ,1), IP(1), XY(1) IFL=14 IF (ICASX.GT.0) IFL=13 IF (N2C.GT.0) GO TO 1 C NORMAL SOLUTION. NOT N.G.F. CALL SOLVES (A,IP,XY,N1C,1,NP,N,MP,M,13,IFL) GO TO 22 1 IF (N1.EQ.N.OR.M1.EQ.0) GO TO 5 C REORDER EXCITATION ARRAY N2=N1+1 JJ=N+1 NPM=N+2*M1 DO 2 I=N2,NPM 2 Y(I)=XY(I) J=N1 DO 3 I=JJ,NPM J=J+1 3 XY(J)=Y(I) DO 4 I=N2,N J=J+1 4 XY(J)=Y(I) 5 NEQS=NSCON+2*NPCON IF (NEQS.EQ.0) GO TO 7 NEQ=N1C+N2C NEQS=NEQ-NEQS+1 C COMPUTE INV(A)E1 DO 6 I=NEQS,NEQ 6 XY(I)=(0.,0.) 7 CALL SOLVES (A,IP,XY,N1C,1,NP,N1,MP,M1,13,IFL) NI=0 NPB=NPBL C COMPUTE E2-C(INV(A)E1) DO 10 JJ=1,NBBL IF (JJ.EQ.NBBL) NPB=NLBL IF (ICASX.GT.1) READ (15) ((C(I,J),I=1,N1C),J=1,NPB) II=N1C+NI DO 9 I=1,NPB SUM=(0.,0.) DO 8 J=1,N1C 8 SUM=SUM+C(J,I)*XY(J) J=II+I 9 XY(J)=XY(J)-SUM 10 NI=NI+NPBL IF (ICASX.GT.1) REWIND 15 JJ=N1C+1 C COMPUTE INV(D)(E2-C(INV(A)E1)) = I2 IF (ICASX.GT.1) GO TO 11 CALL SOLVE (N2C,D,IP(JJ),XY(JJ),N2C) GO TO 13 11 IF (ICASX.EQ.4) GO TO 12 NI=N2C*N2C READ (11) (B(J,1),J=1,NI) REWIND 11 CALL SOLVE (N2C,B,IP(JJ),XY(JJ),N2C) GO TO 13 12 NBLSYS=NBLSYM NPSYS=NPSYM NLSYS=NLSYM ICASS=ICASE NBLSYM=NBBL NPSYM=NPBL NLSYM=NLBL ICASE=3 REWIND 11 REWIND 16 CALL LTSOLV (B,N2C,IP(JJ),XY(JJ),N2C,1,11,16) REWIND 11 REWIND 16 NBLSYM=NBLSYS NPSYM=NPSYS NLSYM=NLSYS ICASE=ICASS 13 NI=0 NPB=NPBL C COMPUTE INV(A)E1-(INV(A)B)I2 = I1 DO 16 JJ=1,NBBL IF (JJ.EQ.NBBL) NPB=NLBL IF (ICASX.GT.1) READ (14) ((B(I,J),I=1,N1C),J=1,NPB) II=N1C+NI DO 15 I=1,N1C SUM=(0.,0.) DO 14 J=1,NPB JP=II+J 14 SUM=SUM+B(I,J)*XY(JP) 15 XY(I)=XY(I)-SUM 16 NI=NI+NPBL IF (ICASX.GT.1) REWIND 14 IF (N1.EQ.N.OR.M1.EQ.0) GO TO 20 C REORDER CURRENT ARRAY DO 17 I=N2,NPM 17 Y(I)=XY(I) JJ=N1C+1 J=N1 DO 18 I=JJ,NPM J=J+1 18 XY(J)=Y(I) DO 19 I=N2,N1C J=J+1 19 XY(J)=Y(I) 20 IF (NSCON.EQ.0) GO TO 22 J=NEQS-1 DO 21 I=1,NSCON J=J+1 JJ=ISCON(I) 21 XY(JJ)=XY(J) 22 RETURN END SUBROUTINE SOLVE (N,A,IP,B,NDIM) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE TO SOLVE THE MATRIX EQUATION LU*X=B WHERE L IS A UNIT C LOWER TRIANGULAR MATRIX AND U IS AN UPPER TRIANGULAR MATRIX BOTH C OF WHICH ARE STORED IN A. THE RHS VECTOR B IS INPUT AND THE C SOLUTION IS RETURNED THROUGH VECTOR B. C COMPLEX*16 A,B,Y,SUM INTEGER PI COMMON /SCRATM/ Y(2*MAXSEG) DIMENSION A(NDIM,NDIM), IP(NDIM), B(NDIM) C C FORWARD SUBSTITUTION C DO 3 I=1,N PI=IP(I) Y(I)=B(PI) B(PI)=B(I) IP1=I+1 IF (IP1.GT.N) GO TO 2 DO 1 J=IP1,N B(J)=B(J)-A(J,I)*Y(I) 1 CONTINUE 2 CONTINUE 3 CONTINUE C C BACKWARD SUBSTITUTION C DO 6 K=1,N I=N-K+1 SUM=(0.,0.) IP1=I+1 IF (IP1.GT.N) GO TO 5 DO 4 J=IP1,N SUM=SUM+A(I,J)*B(J) 4 CONTINUE 5 CONTINUE B(I)=(Y(I)-SUM)/A(I,I) 6 CONTINUE RETURN END SUBROUTINE SOLVES (A,IP,B,NEQ,NRH,NP,N,MP,M,IFL1,IFL2) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE SOLVES, FOR SYMMETRIC STRUCTURES, HANDLES THE C TRANSFORMATION OF THE RIGHT HAND SIDE VECTOR AND SOLUTION OF THE C MATRIX EQ. C COMPLEX*16 A,B,Y,SUM,SSX COMMON /SMAT/ SSX(16,16) COMMON /SCRATM/ Y(2*MAXSEG) COMMON /MATPAR/ ICASE,NBLOKS,NPBLK,NLAST,NBLSYM,NPSYM,NLSYM,IMAT,I 1CASX,NBBX,NPBX,NLBX,NBBL,NPBL,NLBL DIMENSION A(1), IP(1), B(NEQ,NRH) NPEQ=NP+2*MP NOP=NEQ/NPEQ FNOP=NOP FNORM=1./FNOP NROW=NEQ IF (ICASE.GT.3) NROW=NPEQ IF (NOP.EQ.1) GO TO 11 DO 10 IC=1,NRH IF (N.EQ.0.OR.M.EQ.0) GO TO 6 DO 1 I=1,NEQ 1 Y(I)=B(I,IC) KK=2*MP IA=NP IB=N J=NP DO 5 K=1,NOP IF (K.EQ.1) GO TO 3 DO 2 I=1,NP IA=IA+1 J=J+1 2 B(J,IC)=Y(IA) IF (K.EQ.NOP) GO TO 5 3 DO 4 I=1,KK IB=IB+1 J=J+1 4 B(J,IC)=Y(IB) 5 CONTINUE C C TRANSFORM MATRIX EQ. RHS VECTOR ACCORDING TO SYMMETRY MODES C 6 DO 10 I=1,NPEQ DO 7 K=1,NOP IA=I+(K-1)*NPEQ 7 Y(K)=B(IA,IC) SUM=Y(1) DO 8 K=2,NOP 8 SUM=SUM+Y(K) B(I,IC)=SUM*FNORM DO 10 K=2,NOP IA=I+(K-1)*NPEQ SUM=Y(1) DO 9 J=2,NOP 9 SUM=SUM+Y(J)*DCONJG(SSX(K,J)) 10 B(IA,IC)=SUM*FNORM 11 IF (ICASE.LT.3) GO TO 12 REWIND IFL1 REWIND IFL2 C C SOLVE EACH MODE EQUATION C 12 DO 16 KK=1,NOP IA=(KK-1)*NPEQ+1 IB=IA IF (ICASE.NE.4) GO TO 13 I=NPEQ*NPEQ READ (IFL1) (A(J),J=1,I) IB=1 13 IF (ICASE.EQ.3.OR.ICASE.EQ.5) GO TO 15 DO 14 IC=1,NRH 14 CALL SOLVE (NPEQ,A(IB),IP(IA),B(IA,IC),NROW) GO TO 16 15 CALL LTSOLV (A,NPEQ,IP(IA),B(IA,1),NEQ,NRH,IFL1,IFL2) 16 CONTINUE IF (NOP.EQ.1) RETURN C C INVERSE TRANSFORM THE MODE SOLUTIONS C DO 26 IC=1,NRH DO 20 I=1,NPEQ DO 17 K=1,NOP IA=I+(K-1)*NPEQ 17 Y(K)=B(IA,IC) SUM=Y(1) DO 18 K=2,NOP 18 SUM=SUM+Y(K) B(I,IC)=SUM DO 20 K=2,NOP IA=I+(K-1)*NPEQ SUM=Y(1) DO 19 J=2,NOP 19 SUM=SUM+Y(J)*SSX(K,J) 20 B(IA,IC)=SUM IF (N.EQ.0.OR.M.EQ.0) GO TO 26 DO 21 I=1,NEQ 21 Y(I)=B(I,IC) KK=2*MP IA=NP IB=N J=NP DO 25 K=1,NOP IF (K.EQ.1) GO TO 23 DO 22 I=1,NP IA=IA+1 J=J+1 22 B(IA,IC)=Y(J) IF (K.EQ.NOP) GO TO 25 23 DO 24 I=1,KK IB=IB+1 J=J+1 24 B(IB,IC)=Y(J) 25 CONTINUE 26 CONTINUE RETURN END SUBROUTINE TBF (I,ICAP) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE BASIS FUNCTION I COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON DATA PI/3.141592654D+0/,JMAX/30/ JSNO=0 PP=0. JCOX=ICON1(I) IF (JCOX.GT.10000) JCOX=I JEND=-1 IEND=-1 SIG=-1. IF (JCOX) 1,10,2 1 JCOX=-JCOX GO TO 3 2 SIG=-SIG JEND=-JEND 3 JSNO=JSNO+1 IF (JSNO.GE.JMAX) GO TO 28 JCO(JSNO)=JCOX D=PI*SI(JCOX) SDH=SIN(D) CDH=COS(D) SD=2.*SDH*CDH IF (D.GT.0.015) GO TO 4 OMC=4.*D*D OMC=((1.3888889D-3*OMC-4.1666666667D-2)*OMC+.5)*OMC GO TO 5 4 OMC=1.-CDH*CDH+SDH*SDH 5 AJ=1./(LOG(1./(PI*BI(JCOX)))-.577215664D+0) PP=PP-OMC/SD*AJ AX(JSNO)=AJ/SD*SIG BX(JSNO)=AJ/(2.*CDH) CX(JSNO)=-AJ/(2.*SDH)*SIG IF (JCOX.EQ.I) GO TO 8 IF (JEND.EQ.1) GO TO 6 JCOX=ICON1(JCOX) GO TO 7 6 JCOX=ICON2(JCOX) 7 IF (IABS(JCOX).EQ.I) GO TO 9 IF (JCOX) 1,28,2 8 BX(JSNO)=-BX(JSNO) 9 IF (IEND.EQ.1) GO TO 11 10 PM=-PP PP=0. NJUN1=JSNO JCOX=ICON2(I) IF (JCOX.GT.10000) JCOX=I JEND=1 IEND=1 SIG=-1. IF (JCOX) 1,11,2 11 NJUN2=JSNO-NJUN1 JSNOP=JSNO+1 JCO(JSNOP)=I D=PI*SI(I) SDH=SIN(D) CDH=COS(D) SD=2.*SDH*CDH CD=CDH*CDH-SDH*SDH IF (D.GT.0.015) GO TO 12 OMC=4.*D*D OMC=((1.3888889D-3*OMC-4.1666666667D-2)*OMC+.5)*OMC GO TO 13 12 OMC=1.-CD 13 AP=1./(LOG(1./(PI*BI(I)))-.577215664D+0) AJ=AP IF (NJUN1.EQ.0) GO TO 16 IF (NJUN2.EQ.0) GO TO 20 QP=SD*(PM*PP+AJ*AP)+CD*(PM*AP-PP*AJ) QM=(AP*OMC-PP*SD)/QP QP=-(AJ*OMC+PM*SD)/QP BX(JSNOP)=(AJ*QM+AP*QP)*SDH/SD CX(JSNOP)=(AJ*QM-AP*QP)*CDH/SD DO 14 IEND=1,NJUN1 AX(IEND)=AX(IEND)*QM BX(IEND)=BX(IEND)*QM 14 CX(IEND)=CX(IEND)*QM JEND=NJUN1+1 DO 15 IEND=JEND,JSNO AX(IEND)=-AX(IEND)*QP BX(IEND)=BX(IEND)*QP 15 CX(IEND)=-CX(IEND)*QP GO TO 27 16 IF (NJUN2.EQ.0) GO TO 24 IF (ICAP.NE.0) GO TO 17 XXI=0. GO TO 18 17 QP=PI*BI(I) XXI=QP*QP XXI=QP*(1.-.5*XXI)/(1.-XXI) 18 QP=-(OMC+XXI*SD)/(SD*(AP+XXI*PP)+CD*(XXI*AP-PP)) D=CD-XXI*SD BX(JSNOP)=(SDH+AP*QP*(CDH-XXI*SDH))/D CX(JSNOP)=(CDH+AP*QP*(SDH+XXI*CDH))/D DO 19 IEND=1,NJUN2 AX(IEND)=-AX(IEND)*QP BX(IEND)=BX(IEND)*QP 19 CX(IEND)=-CX(IEND)*QP GO TO 27 20 IF (ICAP.NE.0) GO TO 21 XXI=0. GO TO 22 21 QM=PI*BI(I) XXI=QM*QM XXI=QM*(1.-.5*XXI)/(1.-XXI) 22 QM=(OMC+XXI*SD)/(SD*(AJ-XXI*PM)+CD*(PM+XXI*AJ)) D=CD-XXI*SD BX(JSNOP)=(AJ*QM*(CDH-XXI*SDH)-SDH)/D CX(JSNOP)=(CDH-AJ*QM*(SDH+XXI*CDH))/D DO 23 IEND=1,NJUN1 AX(IEND)=AX(IEND)*QM BX(IEND)=BX(IEND)*QM 23 CX(IEND)=CX(IEND)*QM GO TO 27 24 BX(JSNOP)=0. IF (ICAP.NE.0) GO TO 25 XXI=0. GO TO 26 25 QP=PI*BI(I) XXI=QP*QP XXI=QP*(1.-.5*XXI)/(1.-XXI) 26 CX(JSNOP)=1./(CDH-XXI*SDH) 27 JSNO=JSNOP AX(JSNO)=-1. RETURN 28 WRITE(3,29) I STOP C 29 FORMAT (43H TBF - SEGMENT CONNECTION ERROR FOR SEGMENT,I5) END SUBROUTINE TEST (F1R,F2R,TR,F1I,F2I,TI,DMIN) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C TEST FOR CONVERGENCE IN NUMERICAL INTEGRATION C DEN=ABS(F2R) TR=ABS(F2I) IF (DEN.LT.TR) DEN=TR IF (DEN.LT.DMIN) DEN=DMIN IF (DEN.LT.1.D-37) GO TO 1 TR=ABS((F1R-F2R)/DEN) TI=ABS((F1I-F2I)/DEN) RETURN 1 TR=0. TI=0. RETURN END SUBROUTINE TRIO (J) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C COMPUTE THE COMPONENTS OF ALL BASIS FUNCTIONS ON SEGMENT J COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM COMMON /SEGJ/ AX(30),BX(30),CX(30),JCO(30),JSNO,ISCON(50),NSCON,IP 1CON(10),NPCON DATA JMAX/30/ JSNO=0 JCOX=ICON1(J) IF (JCOX.GT.10000) GO TO 7 JEND=-1 IEND=-1 IF (JCOX) 1,7,2 1 JCOX=-JCOX GO TO 3 2 JEND=-JEND 3 IF (JCOX.EQ.J) GO TO 6 JSNO=JSNO+1 IF (JSNO.GE.JMAX) GO TO 9 CALL SBF (JCOX,J,AX(JSNO),BX(JSNO),CX(JSNO)) JCO(JSNO)=JCOX IF (JEND.EQ.1) GO TO 4 JCOX=ICON1(JCOX) GO TO 5 4 JCOX=ICON2(JCOX) 5 IF (JCOX) 1,9,2 6 IF (IEND.EQ.1) GO TO 8 7 JCOX=ICON2(J) IF (JCOX.GT.10000) GO TO 8 JEND=1 IEND=1 IF (JCOX) 1,8,2 8 JSNO=JSNO+1 CALL SBF (J,J,AX(JSNO),BX(JSNO),CX(JSNO)) JCO(JSNO)=J RETURN 9 WRITE(3,10) J STOP C 10 FORMAT (44H TRIO - SEGMENT CONNENTION ERROR FOR SEGMENT,I5) END SUBROUTINE UNERE (XOB,YOB,ZOB) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C CALCULATES THE ELECTRIC FIELD DUE TO UNIT CURRENT IN THE T1 AND T2 C DIRECTIONS ON A PATCH COMPLEX*16 EXK,EYK,EZK,EXS,EYS,EZS,EXC,EYC,EZC,ZRATI,ZRATI2,T1 1,ER,Q1,Q2,RRV,RRH,EDP,FRATI COMMON /DATAJ/ S,B,XJ,YJ,ZJ,CABJ,SABJ,SALPJ,EXK,EYK,EZK,EXS,EYS, &EZS,EXC,EYC,EZC,RKH,IND1,INDD1,IND2,INDD2,IEXK,IPGND COMMON /GND/ZRATI,ZRATI2,FRATI,T1,T2,CL,CH,SCRWL,SCRWR,NRADL, &KSYMP,IFAR,IPERF EQUIVALENCE (T1XJ,CABJ), (T1YJ,SABJ), (T1ZJ,SALPJ), (T2XJ,B), (T2Y 1J,IND1), (T2ZJ,IND2) DATA TPI,CONST/6.283185308D+0,4.771341188D+0/ C CONST=ETA/(8.*PI**2) ZR=ZJ T1ZR=T1ZJ T2ZR=T2ZJ IF (IPGND.NE.2) GO TO 1 ZR=-ZR T1ZR=-T1ZR T2ZR=-T2ZR 1 RX=XOB-XJ RY=YOB-YJ RZ=ZOB-ZR R2=RX*RX+RY*RY+RZ*RZ IF (R2.GT.1.D-20) GO TO 2 EXK=(0.,0.) EYK=(0.,0.) EZK=(0.,0.) EXS=(0.,0.) EYS=(0.,0.) EZS=(0.,0.) RETURN 2 R=SQRT(R2) TT1=-TPI*R TT2=TT1*TT1 RT=R2*R ER=DCMPLX(SIN(TT1),-COS(TT1))*(CONST*S) Q1=DCMPLX(TT2-1.,TT1)*ER/RT Q2=DCMPLX(3.-TT2,-3.*TT1)*ER/(RT*R2) ER=Q2*(T1XJ*RX+T1YJ*RY+T1ZR*RZ) EXK=Q1*T1XJ+ER*RX EYK=Q1*T1YJ+ER*RY EZK=Q1*T1ZR+ER*RZ ER=Q2*(T2XJ*RX+T2YJ*RY+T2ZR*RZ) EXS=Q1*T2XJ+ER*RX EYS=Q1*T2YJ+ER*RY EZS=Q1*T2ZR+ER*RZ IF (IPGND.EQ.1) GO TO 6 IF (IPERF.NE.1) GO TO 3 EXK=-EXK EYK=-EYK EZK=-EZK EXS=-EXS EYS=-EYS EZS=-EZS GO TO 6 3 XYMAG=SQRT(RX*RX+RY*RY) IF (XYMAG.GT.1.D-6) GO TO 4 PX=0. PY=0. CTH=1. RRV=(1.,0.) GO TO 5 4 PX=-RY/XYMAG PY=RX/XYMAG CTH=RZ/SQRT(XYMAG*XYMAG+RZ*RZ) RRV=SQRT(1.-ZRATI*ZRATI*(1.-CTH*CTH)) 5 RRH=ZRATI*CTH RRH=(RRH-RRV)/(RRH+RRV) RRV=ZRATI*RRV RRV=-(CTH-RRV)/(CTH+RRV) EDP=(EXK*PX+EYK*PY)*(RRH-RRV) EXK=EXK*RRV+EDP*PX EYK=EYK*RRV+EDP*PY EZK=EZK*RRV EDP=(EXS*PX+EYS*PY)*(RRH-RRV) EXS=EXS*RRV+EDP*PX EYS=EYS*RRV+EDP*PY EZS=EZS*RRV 6 RETURN END SUBROUTINE WIRE (XW1,YW1,ZW1,XW2,YW2,ZW2,RAD,RDEL,RRAD,NS,ITG) C *** C DOUBLE PRECISION 6/4/85 C INCLUDE 'NEC2DPAR.INC' IMPLICIT REAL*8(A-H,O-Z) C *** C C SUBROUTINE WIRE GENERATES SEGMENT GEOMETRY DATA FOR A STRAIGHT C WIRE OF NS SEGMENTS. C COMMON /DATA/ X(MAXSEG),Y(MAXSEG),Z(MAXSEG),SI(MAXSEG),BI(MAXSEG), &ALP(MAXSEG),BET(MAXSEG),WLAM,ICON1(2*MAXSEG),ICON2(2*MAXSEG), &ITAG(2*MAXSEG),ICONX(MAXSEG),LD,N1,N2,N,NP,M1,M2,M,MP,IPSYM DIMENSION X2(1), Y2(1), Z2(1) EQUIVALENCE (X2(1),SI(1)), (Y2(1),ALP(1)), (Z2(1),BET(1)) IST=N+1 N=N+NS NP=N MP=M IPSYM=0 IF (NS.LT.1) RETURN XD=XW2-XW1 YD=YW2-YW1 ZD=ZW2-ZW1 IF (ABS(RDEL-1.).LT.1.D-6) GO TO 1 DELZ=SQRT(XD*XD+YD*YD+ZD*ZD) XD=XD/DELZ YD=YD/DELZ ZD=ZD/DELZ DELZ=DELZ*(1.-RDEL)/(1.-RDEL**NS) RD=RDEL GO TO 2 1 FNS=NS XD=XD/FNS YD=YD/FNS ZD=ZD/FNS DELZ=1. RD=1. 2 RADZ=RAD XS1=XW1 YS1=YW1 ZS1=ZW1 DO 3 I=IST,N ITAG(I)=ITG XS2=XS1+XD*DELZ YS2=YS1+YD*DELZ ZS2=ZS1+ZD*DELZ X(I)=XS1 Y(I)=YS1 Z(I)=ZS1 X2(I)=XS2 Y2(I)=YS2 Z2(I)=ZS2 BI(I)=RADZ DELZ=DELZ*RD RADZ=RADZ*RRAD XS1=XS2 YS1=YS2 3 ZS1=ZS2 X2(N)=XW2 Y2(N)=YW2 Z2(N)=ZW2 RETURN END COMPLEX*16 FUNCTION ZINT(SIGL,ROLAM) C *** C DOUBLE PRECISION 6/4/85 C IMPLICIT REAL*8(A-H,O-Z) C *** C C ZINT COMPUTES THE INTERNAL IMPEDANCE OF A CIRCULAR WIRE C C COMPLEX*16 TH,PH,F,G,FJ,CN,BR1,BR2 COMPLEX*16 CC1,CC2,CC3,CC4,CC5,CC6,CC7,CC8,CC9,CC10,CC11,CC12 1,CC13,CC14 DIMENSION FJX(2), CNX(2), CCN(28) EQUIVALENCE (FJ,FJX), (CN,CNX), (CC1,CCN(1)), (CC2,CCN(3)), (CC3,C 1CN(5)), (CC4,CCN(7)), (CC5,CCN(9)), (CC6,CCN(11)), (CC7,CCN(13)), 2(CC8,CCN(15)), (CC9,CCN(17)), (CC10,CCN(19)), (CC11,CCN(21)), (CC1 32,CCN(23)), (CC13,CCN(25)), (CC14,CCN(27)) DATA PI,POT,TP,TPCMU/3.1415926D+0,1.5707963D+0,6.2831853D+0, 12.368705D+3/ DATA CMOTP/60.00/,FJX/0.,1./,CNX/.70710678D+0,.70710678D+0/ DATA CCN/6.D-7,1.9D-6,-3.4D-6,5.1D-6,-2.52D-5,0.,-9.06D-5,-9.01D-5 1,0.,-9.765D-4,.0110486D+0,-.0110485D+0,0.,-.3926991D+0,1.6D-6, 2-3.2D-6,1.17D-5,-2.4D-6,3.46D-5,3.38D-5,5.D-7,2.452D-4,-1.3813D-3 3,1.3811D-3,-6.25001D-2,-1.D-7,.7071068D+0,.7071068D+0/ TH(D)=(((((CC1*D+CC2)*D+CC3)*D+CC4)*D+CC5)*D+CC6)*D+CC7 PH(D)=(((((CC8*D+CC9)*D+CC10)*D+CC11)*D+CC12)*D+CC13)*D+CC14 F(D)=SQRT(POT/D)*EXP(-CN*D+TH(-8./X)) G(D)=EXP(CN*D+TH(8./X))/SQRT(TP*D) X=SQRT(TPCMU*SIGL)*ROLAM IF (X.GT.110.) GO TO 2 IF (X.GT.8.) GO TO 1 Y=X/8. Y=Y*Y S=Y*Y BER=((((((-9.01D-6*S+1.22552D-3)*S-.08349609D+0)*S+2.6419140D+0) 1*S-32.363456D+0)*S+113.77778D+0)*S-64.)*S+1. BEI=((((((1.1346D-4*S-.01103667D+0)*S+.52185615D+0)*S- 110.567658D+0)*S+72.817777D+0)*S-113.77778D+0)*S+16.)*Y BR1=DCMPLX(BER,BEI) BER=(((((((-3.94D-6*S+4.5957D-4)*S-.02609253D+0)*S+.66047849D+0) 1*S-6.0681481D+0)*S+14.222222D+0)*S-4.)*Y)*X BEI=((((((4.609D-5*S-3.79386D-3)*S+.14677204D+0)*S-2.3116751D+0) 1*S+11.377778D+0)*S-10.666667D+0)*S+.5)*X BR2=DCMPLX(BER,BEI) BR1=BR1/BR2 GO TO 3 1 BR2=FJ*F(X)/PI BR1=G(X)+BR2 BR2=G(X)*PH(8./X)-BR2*PH(-8./X) BR1=BR1/BR2 GO TO 3 2 BR1=DCMPLX(.70710678D+0,-.70710678D+0) 3 ZINT=FJ*SQRT(CMOTP/SIGL)*BR1/ROLAM RETURN END logical*4 function GetPut(what,wher,message,file,volume,nt,types) C C implicit none C C integer NEWHANDLE C parameter (NEWHANDLE = Z'122000A8') C integer HLOCK C parameter (HLOCK = Z'02980008') C integer HUNLOCK C parameter (HUNLOCK = Z'02A80008') C integer NEWDIALOG C parameter (NEWDIALOG = Z'97D20002') C integer DISPOSHANDLE C parameter (DISPOSHANDLE = Z'02380008') C integer SFPUTFILE C parameter (SFPUTFILE = Z'9EA16CB1') C integer SFGETFILE C parameter (SFGETFILE = Z'9EA20003') C integer PTR C parameter (PTR = Z'C0000000') C integer DISPOSEDIALOG C parameter (DISPOSEDIALOG = Z'98310000') C integer PBSETVOL C parameter (PBSETVOL = Z'01580010') C C integer*4 what ! 0 SFPUTFILE; 1 SFGETFILE C integer*2 where(2) ! location of box upper-left corner (y,x) C character*(*) message ! string to go over dialog box C character*(*) file ! file name C integer*4 volume ! volume number C integer*4 nt ! number of filter types C character*(*) types ! filter types C C integer*4 toolbx ! toolbx interface C C integer*4 dptr ! dialog pointer C character*64 fname C logical*1 good ! result flag C integer*4 i C integer*2 iovrefnum C integer*4 lhdl ! handle of item list C integer*4 lptr ! pointer to item list C integer*4 nc ! number of characters in file name C integer*2 posd(2) ! location of standard dialog C integer*2 rect(4) ! rectangle C integer*2 vrefnum C integer*1 params(108) ! partial PBGETVOL parameter block C equivalence (params(23),iovrefnum) C integer*1 reply(76) ! reply record C equivalence (reply(1),good) C equivalence (reply(7),vrefnum) C equivalence (reply(11),fname) C GetPut = .false. C volume = 0 C good = .true. C if (what .eq. 0) then C lhdl = 0 C lhdl = toolbx(NEWHANDLE,72) C if (lhdl .eq. 0) return C call toolbx(HLOCK,lhdl) C lptr = LONG(lhdl) C WORD(lptr) = 1 C LONG(lptr + 2) = 0 C WORD(lptr + 6) = 0 C WORD(lptr + 8) = 0 C WORD(lptr + 10) = 32 C WORD(lptr + 12) = 32 C BYTE(lptr + 14) = 160 C BYTE(lptr + 15) = 2 C WORD(lptr + 16) = 1 C LONG(lptr + 18) = 0 C WORD(lptr + 22) = 8 C WORD(lptr + 24) = 40 C WORD(lptr + 26) = 24 C WORD(lptr + 28) = 304 C BYTE(lptr + 30) = 136 C BYTE(lptr + 31) = 40 C do (i = 1, 40) C BYTE(lptr + 31 + i) = ICHAR(message(i:i)) C enddo C call toolbx(HUNLOCK,lhdl) C rect(1) = where(1) C rect(2) = where(2) C rect(3) = rect(1) + 32 C rect(4) = rect(2) + 304 C elseif (what .eq. 1) then C lhdl = 0 C lhdl = toolbx(NEWHANDLE,80) C if (lhdl .eq. 0) return C call toolbx(HLOCK,lhdl) C lptr = LONG(lhdl) C WORD(lptr) = 1 C LONG(lptr + 2) = 0 C WORD(lptr + 6) = 0 C WORD(lptr + 8) = 0 C WORD(lptr + 10) = 32 C WORD(lptr + 12) = 32 C BYTE(lptr + 14) = 160 C BYTE(lptr + 15) = 2 C WORD(lptr + 16) = 1 C LONG(lptr + 18) = 0 C WORD(lptr + 22) = 8 C WORD(lptr + 24) = 40 C WORD(lptr + 26) = 24 C WORD(lptr + 28) = 348 C BYTE(lptr + 30) = 136 C BYTE(lptr + 31) = 48 C do (i = 1, 48) C BYTE(lptr + 31 + i) = ICHAR(message(i:i)) C enddo C call toolbx(HUNLOCK,lhdl) C rect(1) = where(1) C rect(2) = where(2) C rect(3) = rect(1) + 32 C rect(4) = rect(2) + 348 C else C return C endif C dptr = 0 C dptr = toolbx(NEWDIALOG,0,rect,0,.true.,1,-1,.false.,0,lhdl) C if (dptr .eq. 0) then C call toolbx(DISPOSHANDLE,lhdl) C return C endif C posd(1) = where(1) + 50 C posd(2) = where(2) C if (what .eq. 0) then C call toolbx(SFPUTFILE,posd,0,0,0,reply,1) C else C call toolbx(SFGETFILE,posd,0,0,nt,toolbx(PTR,types),0,reply,2) C endif C call toolbx(DISPOSEDIALOG,dptr) ! Dispose of Header dialog C if (good .eq. .false.) return C nc = ICHAR(fname(1:1)) C file = fname(2:nc + 1) C do (i = 1, 108) C params(i) = 0 C enddo C iovrefnum = vrefnum C if (toolbx(PBSETVOL,toolbx(PTR,params)) .eq. 0) then C GetPut = .true. C volume = vrefnum C endif C return end necpp-1.5.0+cvs20101003/FORTRAN/somnec_readme.txt0000644000175000017500000000371510312700326017357 0ustar numanuma The accompanying file SOMNEC.FOR contains the FORTRAN source code for the SOMNEC program. The SOMNEC program generates grids used by the NEC2 program for the Sommerfeld-Norton approximation to realistic grounds. I hand-coded the source code from the listing given in NOSC TD-116, Volume I, Part II, pages 390 -- 433. I changed the code given in the listing to enable interactive user input of relative dielectric constant, ground conductivity, and frequency in MHz. The source code as given relied on the use of a tape drive to accomplish communication of the results of the SOMNEC program to the NEC2 program (old-timers, takes you back, doesn't it?). I elected to accomplish inter-program communication on the DEC VAX and Unix workstations available to me by using a binary unformatted file. Hence the user is also prompted for a file name, and the grid arrays are written to the file. I also had to make changes in the NEC2 code, to tell NEC2 the name of the SOMNEC file, to open the file, and to read in the file contents. Users wishing to employ the SOMNEC code with implementations of NEC2 or NEC81 expecting SOMNEC file input will have to determine the file type and format expected and recode accordingly. I eventually incorporated the SOMNEC program in NEC2 as a set of subroutines, and that is the version I am now using. The file SOMNEC_OUTPUT.TXT contains the results of a run of SOMNEC using the inputs in example 10 in Volume II of NOSC TD 116. Note the agreement with the results given on pages 154 -- 156 of Volume II. The time for execution of this case was 257 seconds on a DEC VAX 8600. On a Silicon Graphics 4D/440 workstation, I obtained around 100 seconds execution time for the same case, and I would expect tens of seconds when I port the code to a DEC AXP, as I will do soon. I hope this code is useful to you -- 73! George B. Christianson Princeton University Plasma Physics Laboratory gchristianson@pppl.gov (Amateur Radio NJ2P) October 5, 1994 necpp-1.5.0+cvs20101003/FORTRAN/CVS/0000755000175000017500000000000011452152141014444 5ustar numanumanecpp-1.5.0+cvs20101003/FORTRAN/CVS/Root0000644000175000017500000000007011452152140015306 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/FORTRAN/CVS/Repository0000644000175000017500000000001611452152140016542 0ustar numanumanecpp/FORTRAN necpp-1.5.0+cvs20101003/FORTRAN/CVS/Entries0000644000175000017500000000034211452152141015777 0ustar numanuma/NEC2DPAR.INC/1.1.1.1/Fri Sep 9 04:39:08 2005// /makefile/1.4/Tue Jan 29 20:36:04 2008// /nec2dx.f/1.3/Tue Jan 29 20:36:04 2008// /somnec2d.f/1.1/Sat Sep 17 02:35:02 2005// /somnec_readme.txt/1.1/Sat Sep 17 02:35:02 2005// D necpp-1.5.0+cvs20101003/COPYING0000644000175000017500000004313110310210751013725 0ustar numanuma GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. necpp-1.5.0+cvs20101003/makefile.dist0000644000175000017500000001007611307554756015365 0ustar numanuma########################################################################### # # MAKEFILE Distributing the C++ port of NEC # # Author: Tim Molteno. # # # # Copyright (C) 2004-2008 Timothy C.A. Molteno # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # all: dist ########################################################################################################### # # This builds a source code distribution (and a Windows executable) and packages it into # an archive. Also uploads it to the server # BUILD_DATE=$(shell date +%Y-%m-%d) BUILDDIR=necpp_$(shell date +%Y%m%d) DEST=elec@www.physics.otago.ac.nz:electronics/nec ARCHIVE=${BUILDDIR} VERSION=$(shell fgrep AM_INIT_AUTOMAKE configure.in | sed -r -e "s/([^0-9]+)([0-9\.]+).+/\2/g") NEC_VERSION=${VERSION} "[${BUILD_DATE}]" test: echo ${NEC_VERSION} .PHONY : win32 win32: # # Make a zipped source distribution for Windows rm -rf ${BUILDDIR} mkdir -p ${BUILDDIR}/src cp src/*.cpp ${BUILDDIR}/src cp src/*.h ${BUILDDIR}/src cp README ${BUILDDIR} mkdir -p ${BUILDDIR}/test_data cp test_data/*.nec ${BUILDDIR}/test_data cp -a win32/ ${BUILDDIR} cd ${BUILDDIR}; rm -rf `find . -name CVS` rm -f ${ARCHIVE}.zip zip -vr ${ARCHIVE}.zip ${BUILDDIR} # # Make the Windows executable (nec2++.exe) with MinGW # # To install mingw on debian simply issue the command: # # aptitude install mingw32 #nec_version win32_exe: # make distclean ./configure --without-lapack --host=i586-mingw32msvc --build=i386-linux CXXFLAGS="-O3 -mtune=athlon-xp -march=pentium -Dnec_build_date='\"${BUILD_DATE}\"' -Dbuild_version='\"${VERSION}\"' " --prefix=/tmp/necpp_w32 make make install-strip mv /tmp/necpp_w32/bin/nec2++.exe . zip nec2++.zip nec2++.exe # # If we're using Visual Studio we just copy the executable over # scp electron:nec2++.exe . dist: rm -rf ${BUILDDIR} mkdir -p ${BUILDDIR}/src cp src/*.cpp ${BUILDDIR}/src cp src/*.h ${BUILDDIR}/src cp makefile.dist Makefile.test ${BUILDDIR} cp AUTHORS README INSTALL COPYING ChangeLog TODO ${BUILDDIR} cp install-sh ${BUILDDIR} cp configure ${BUILDDIR} mkdir -p ${BUILDDIR}/test_data cp test_data/*.nec ${BUILDDIR}/test_data tar -cf ${ARCHIVE}.tar ${BUILDDIR} rm -f ${ARCHIVE}.tar.bz2 bzip2 -9 ${ARCHIVE}.tar # # Make a .tar.bz2 source distribution for Linux rm -rf www mkdir -p www cp ${ARCHIVE}.tar.bz2 www/necpp_latest.tar.bz2 mv ${ARCHIVE}.tar.bz2 www # # Make a zipped source distribution for Windows # cp -a win32/ ${BUILDDIR} cd ${BUILDDIR}; rm -rf `find . -name CVS` rm -f ${ARCHIVE}.zip zip -vr ${ARCHIVE}.zip ${BUILDDIR} mv ${ARCHIVE}.zip www build_dist: # - make distclean make -f Makefile.cvs ./configure CXXFLAGS="-O3 -mtune=athlon-xp -march=pentium -Dnec_build_date='\"${BUILD_DATE}\"' -Dbuild_version='\"${VERSION}\"'" make -f Makefile dist mv necpp-${VERSION}.tar.gz www # # Make a linux executable # make -f Makefile mv src/nec2++ www strip --strip-all www/nec2++ cd www; tar -cf nec2++.tar nec2++; gzip -9 nec2++.tar # # The following used to make the Windows executable # make -f makefile.dist win32_exe mv nec2++.zip www cp docs/*.html www # cp docs/users_guide.pdf www rsync --verbose --rsh=ssh --cvs-exclude --recursive www/* ${DEST} nec2c_src: rm -rf nec2c_src mkdir -p nec2c_src cp c_src/*.* nec2c_src cp c_src/Makefile nec2c_src cp c_src/README nec2c_src cd nec2c_src; rm -rf `find . -name CVS` rm -f nec2c_src.tar.gz tar -cf nec2c_src.tar nec2c_src gzip -9 nec2c_src.tar scp nec2c_src.tar.gz ${DEST} necpp-1.5.0+cvs20101003/Makefile.test0000644000175000017500000000621711117073437015332 0ustar numanuma########################################################################### # # MAKEFILE for the NEC++ testharness # # Author: Tim Molteno. # # # Copyright (C) 2004-2008 Timothy C.A. Molteno # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # all: check_build test python BUILD=debug TARGET = ${BUILD}/src/nec2++ NEC2DIFF = ${BUILD}/src/nec2diff NEC2C = c_src/nec2c NECF = FORTRAN/nec2 # # This target makes sure that the C and FORTRAN executables have been built # Please note that the testharness assumes that you have built the debug # version of nec2++ using kdevelop. # check_build: ${NEC2C} ${NECF} ${TARGET} test_fast: make -f Makefile.test test 'BUILD=optimized' ############################################################################ # # TESTHARNESS # # This tests the output of the C++ port against the nec2c, C # port as well as the original FORTRAN # NEC_TESTS := $(shell find test_data/ -name "example*.nec") SOM_TESTS := $(shell find test_data/ -name "sommer*.nec") ALL_TESTS := $(shell find test_data/ -name "*.nec") DO_TESTS = ${NEC_TESTS} ${SOM_TESTS} #DO_TESTS = ${ALL_TESTS} ############################################################################ # # Rewrite Rules are used to automate the generation # and comparison of output files. # Generate an output file from nec2c %.nec %.outc: - ./${NEC2C} -i $*.nec -o temp.$(*F); mv temp.$(*F) $@ # Generate an output file from nec2cpp %.nec %.outcpp: - ./$(TARGET) -i $*.nec -o $@ # Generate an output file from the FORTRAN version %.nec %.outf: - ./$(NECF) $*.nec $@ # Compare two outputs (c and cpp) %.nec %.diff: %.outc %.outcpp ./${NEC2DIFF} $*.outc $*.outcpp > $@ ./${NEC2DIFF} $*.outf $*.outcpp >> $@ # Compare two outputs (FORTRAN and cpp) %.nec %.dif: %.out %.outcpp ./${NEC2DIFF} $*.out $*.outcpp > $@ test: echo "testing ${DO_TESTS}" rm -f $(DO_TESTS:.nec=.diff) rm -f $(DO_TESTS:.nec=.outcpp) rm -f $(DO_TESTS:.nec=.outc) rm -f $(DO_TESTS:.nec=.outf) make -f Makefile.test test_aux # Change the following line to # test_aux: ${NEC2DIFF} nec2cpp $(NEC_TESTS:.nec=.outcpp) $(NEC_TESTS:.nec=.outc) $(NEC_TESTS:.nec=.diff) $(NEC_TESTS:.nec=.dif) # in order to include the FORTRAN code in the test suite. test_aux: $(DO_TESTS:.nec=.outcpp) $(DO_TESTS:.nec=.outc) $(DO_TESTS:.nec=.outf) $(DO_TESTS:.nec=.diff) echo "Test Complete" ############################################################################ # # PYTHON TESTHARNESS # # This tests the python bindings # python: echo "Put something in here to test the python code" necpp-1.5.0+cvs20101003/INSTALL0000644000175000017500000000333011121277014013726 0ustar numanumaInstallation from CVS ===================== To create the files using autoconf and friends, issue the following command, and then proceed to the Basic Installation. ==Pre-requisites== Nec2++ requires a C++ compiler and uses the GNU autoconf packages for keeping track of dependencies. On Debian or a derivative, you can install these with the following command. aptitude install g++ make automake autoconf libtool libatlas-base-dev ==Installation Steps== 1. Install the autoconf and libtool packages. On Debian this is done with `aptitude install automake autoconf libtool' on other systems you will have to find the appropriate way to do this. 2. Cenerate the ./configure script. To do this, type `make -f Makefile.cvs' 3. Then do the usual thing ./configure --without-lapack make sudo make install 4. To use LAPACK, you should install the appropriate atlas system aptitude install libatlas-base-dev. And then to the usual thing, i.e., ./configure make sudo make install ==Compiling for a specific architecture== Particularly using gcc-4.0 it is important to specify the architecture you are using (this will produce approximately a 50% speedup on the athlon-xp for example. The following configure options will do this: 1. ./configure CXX=g++-4.0 CXXFLAGS="-O3 -march=athlon-xp" 2. make 3. make install ==Building for Windows== The MinGW toolset (a free compiler for Windows based on GCC) can be used to compile nec2++ for windows operating systems. This is easily done from a command line (cygwin shell is best). 1. ./configure --host=i586-mingw32msvc 2. make 3. The executable nec2++.exe can now be found in the src subdirectory. necpp-1.5.0+cvs20101003/Doxyfile0000644000175000017500000002423711111373374014421 0ustar numanuma# Doxyfile 1.5.5-KDevelop #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = nec++ PROJECT_NUMBER = 1.2.9 OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = /home/tim/physics/nec/necpp/ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = NO EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES SHOW_FILES = YES SHOW_NAMESPACES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = /home/tim/alioth/necpp/src INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.C \ *.H \ *.tlh \ *.diff \ *.patch \ *.moc \ *.xpm \ *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project HTML_DYNAMIC_SECTIONS = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = YES LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = YES XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO DOT_FONTNAME = FreeSans DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO necpp-1.5.0+cvs20101003/README0000644000175000017500000000235211121076315013561 0ustar numanumaNEC2++ a C++ port of Numerical Electromagnetic Code This is a free (GPL) NEC-2 compatable electromagnetic code. It can both read nec2 antenna description files (like the original) and also be incorporated into other projects like GUI tools and automatic antenna optimization systems. Nec2++ is developed on debian linux, but will work on a variety of other operating systems. ==Instructions for Linux== ** NOTE ** nec2++ now requires LAPACK (unless you use the --without-lapack command line switch) See the INSTALL file. But here is the short version make -f Makefile.cvs ./configure make sudo make install Instructions for Compiling on Windows Versions of nec2++ since 1.2.3 now compile fine with the MinGW (http://www.mingw.org/) free compiler tools. Just download the source distribution, and follow the unix installation guide (./configure and make). Compiling with Visual Studio 7 NEC2++ has been tested with Microsoft Visual Studio 7. A project file for VC++ 7.0 is part of the source code distribution. Visual Studio 6.0 is now supported because it does not conform to modern C++ standards. Step-by-step instructions 1) Unzip the Windows source code distribution. 2) Build the project inside the win32 subdirectory with Visual Studio 7. necpp-1.5.0+cvs20101003/TODO0000644000175000017500000000254711130554610013376 0ustar numanumaTODO list for nec2++ * Test and make sure that the Somerfeld Ground code is working (compare outputs with the FORTRAN version) * BUG with S/N nec2++ -i gn2.nec -g (check with PJW) * Get CurrentInput comparison going with nec2diff * Work on Doxygen Source Documentation * Work on the LaTeX users guide. * Get rid of libnec's dependance on the C++ standard library. See Below. * Export only the C API functions from libnec. This requires some extra know-how that I don't have right now -- probably an exports file. When done, this will mean that libnec can be linked to without additional libc++ linking. NEC Syntax Improvements * Handle commenting out lines (Look into how this should be done). Some folk seem to use a ' at the start of the line. * Add a geometry method (and nec card) for catenary hung wires (cf NEC4) CW card input. NEC improvements * Export radiation patterns (command line switch) as CSV files. This will allow them to be plotted using other plotting tools. * Add Leeson Corrections for tapered wires (these are frequency dependant). * Add Monte Carlo simulations that measure the sensitivity of a design to random fluctuations in the geometry. Suggestion from Mike Pot. * Add output option for the impedance (admittance) matrix to go to the output file. Using Eigen Nec2++ requires Eigen. svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2 necpp-1.5.0+cvs20101003/Python/0000755000175000017500000000000011452152143014161 5ustar numanumanecpp-1.5.0+cvs20101003/Python/python_module/0000755000175000017500000000000011452152141017045 5ustar numanumanecpp-1.5.0+cvs20101003/Python/python_module/nec_context.py0000644000175000017500000007147510323754613021756 0ustar numanuma#nec_context.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by Swig import exceptions #class "nec_context" class nec_context(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_context, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_context, name) def __repr__(self): return "<%s.%s; proxy of C++ nec_context instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): _swig_setattr(self, nec_context, 'this', _PyNEC.new_nec_context(*args)) _swig_setattr(self, nec_context, 'thisown', 1) _PyNEC.nec_context_initialize(self) def __del__(self, destroy=_PyNEC.delete_nec_context): try: if self.thisown: destroy(self) except: pass def get_geometry(*args): """ Get the associated c_geometry object c_geometry* get_geometry() """ return _PyNEC.nec_context_get_geometry(*args) def get_input_parameters(*args): """ Get the result antenna_input_parameters specified by index nec_antenna_input* get_input_parameters(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_input_parameters(*args) def get_norm_rx_pattern(*args): """ Get the result norm_rx_pattern specified by index nec_norm_rx_pattern* get_norm_rx_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_norm_rx_pattern(*args) def get_radiation_pattern(*args): """ Get the result radiation_pattern specified by index nec_radiation_pattern* get_radiation_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_radiation_pattern(*args) def get_structure_excitation(*args): """ Get the result structure_excitation specified by index nec_structure_excitation* get_structure_excitation(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_structure_excitation(*args) def get_near_field_pattern(*args): """ Get the result near_field_pattern specified by index nec_near_field_pattern* get_near_field_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_near_field_pattern(*args) def get_structure_currents(*args): """ Get the result structure_currents specified by index nec_structure_currents* get_structure_currents(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_structure_currents(*args) def geometry_complete(*args): """ Indicates the end of the geometry input void geometry_complete(int card_int_1) \param card_int_1 Geometry ground plain flag : card_int_1 = 0 : no ground plane is present. card_int_1 = 1 : indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero). card_int_1 = -1 : indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. """ return _PyNEC.nec_context_geometry_complete(*args) def fr_card(*args): """ Frequency parameters void fr_card(int ifrq, int nfrq, nec_float freq_hz, nec_float del_freq) \param ifrq Determines the type of frequency stepping : in_ifrq = 0 : linear stepping in_ifrq = 1 : mutliplicative stepping. \param nfrq The number of frequency steps. \param freq_hz The frequency first value in Herz. \param del_freq The frequency stepping increment. """ return _PyNEC.nec_context_fr_card(*args) def ld_card(*args): """ Specifies the impedance loading on one segment or a number of segments. Series and parallel RLC circuits can be generated. In addition, a finite conductivity can be specified for segments. void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3) \param itmp1 Determines the type of loading and the expected units which are used : itmp1 = -1 : Nullifies previous loads. itmp1 = 0 : series RLC, input ohms, henries, farads. itmp1 = 1 : parallel RLC, input ohms, henries, farads. itmp1 = 2 : series RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 3 : parallel RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 4 : impedance, input resistance and reactance in ohms. itmp1 = 5 : wire conductivity, input mhos/meter. \param itmp2 The tag number of the segments to be loaded. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment to be loaded. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment to be loaded. if both itmp3 and itmp4 are zero, all segments will be loaded. \param tmp1 If itmp1 = 0, 1, 2, 3 or 4 : the resistance ; if itmp1 = 5 : the wire conductivity ; else tmp1 = 0. \param tmp2 If itmp1 = 0, 1, 2 or 3 : the inductance ; if itmp1 = 4 : the reactance ; else tmp2 = 0. \param tmp3 If itmp1 = 0, 1, 2 or 3 : the capacitance ; else tmp3 = 0. """ return _PyNEC.nec_context_ld_card(*args) def gn_card(*args): """ Ground parameters under the antenna All coordinates are in meters. 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) \param ground_type Ground-type flag : ground_type = -1 : nullifies ground parameters previously used and sets free-space condition. ground_type = 0 : finite ground, reflection coefficient approximation. ground_type = 1 : perfectly conducting ground. ground_type = 2 : finite ground, Sommerfeld/Norton method. \param rad_wire_count The number of radial wires in the ground screen approximation, O implies no ground screen. \param tmp1 Relative dielectric constant for ground in the vicinity of the antenna ; Zero in case of a perfect ground. \param tmp2 Conductivity in mhos/meter of the ground in the vicinity of the antenna ; Zero in the case of a perfect ground. If tmp2 is input as a negative number, the complex dielectric constant Ec = Er -j sigma/omega epsilon is set to EPSR - |SIG|. \param tmp3 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the ground screen ; else the relative dielectric constant of medium 2 (cliff problem). \param tmp4 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the wires used in the screen ; else the conductivity of medium 2 in mhos/meter (cliff problem). \param tmp5 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp6 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance (positive or zero) by which the surface of medium 2 is below medium 1. """ return _PyNEC.nec_context_gn_card(*args) def gd_card(*args): """ Specifies the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the field of surface patches All coordinates are in meters. void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4) \param tmp1 The relative dielectric constant of medium 2. \param tmp2 The conductivity of medium 2 in mhos/meter. \param tmp3 The distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp4 The distance (positive or zero) by which the surface of medium 2 is below medium 1. """ return _PyNEC.nec_context_gd_card(*args) def ex_card(*args): """ Specifies the excitation for the structure. The excitation can be voltage sources on the structure, an elementary current source, or a plane-wave incident on the structure. All angles are in degrees. 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) \param excitation_type Determines the type of excitation which is used : excitation_type = O - voltage source (applied-E-field source). excitation_type = 1 - incident plane wave, linear polarization. excitation_type = 2 - incident plane wave, right-hand (thumb along the incident k vector) elliptic polarization. excitation_type = 3 - incident plane wave, left-hand elliptic polarization. excitation_type = 4 - elementary current source. excitation_type = 5 - voltage source (current-slope-discontinuity). \param itmp2 If excitation_type = 0 or 5 : the tag number of the source segment (if itmp1 = 0 absolute segment numbers will be used) ; else if excitation_type = 1, 2 or 3 : number of theta angles desired for the incident plane wave ; else zero. \param itmp3 If excitation_type = 0 or 5 : the rank (among the segments the tag number of which is itmp2) or absolute segment number of the source segment ; else if excitation_type = 1, 2 or 3 : number of phi angles desired for the incident plane wave ; else zero. \param itmp4 If itmp4 = 1 the maximum relative admittance matrix asymmetry for source segment (if excitation_type = 0 or 5) and network connections (whatever excitation_type may be) will be calculated and printed. \param itmp5 If excitation_type = 0 or 5 : tmp3 will be taken under account if itmp5 = 1 ; else zero. \param tmp1 If excitation_type = 0 or 5 : the real part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of theta ; else the x-coordinate of the current source. \param tmp2 If excitation_type = 0 or 5 : the imaginary part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of phi ; else if excitation_type = 4 : the y-coordinate of the current source. \param tmp3 If excitation_type = 0 or 5 : the normalization constant for the impedance printed in the optional impedance table (if tmp3 = 0 the impedance will be normalized to their maximum value) ; else if excitation_type = 1, 2 or 3 : eta in degrees. Eta is the polarization angle defined as the angle between the theta unit vector and the direction of the electric field for linear polarization or the major ellipse axis for elliptical polarization ; else if excitation_type = 4 : the z-coordinate of the current source. \param tmp4 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : theta angle stepping increment. else if excitation_type = 4 : the angle the current source makes with the XY plane. \param tmp5 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : phi angle stepping increment. else if excitation_type = 4 : the angle the projection of the current source on the XY plane makes with the X axis. \param tmp6 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : ratio of minor axis to major axis for elliptic polarization (major axis field strength - 1 V/m). else if excitation_type = 4 : "Current moment" of the source (in amp meter). """ return _PyNEC.nec_context_ex_card(*args) def tl_card(*args): """ Generates a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. All coordinates are in meters. 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) \param itmp1 Tag number of the segment to which end one of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end one of the transmission line is connected. \param itmp3 Tag number of the segment to which end two of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end two of the transmission line is connected. \param tmp1 The characteristic impedance of the transmission line in ohms. A negative sign in front of the characteristic impedance will act as a flag for generating the transmission line with a 180 degree phase reversal (crossed line). \param tmp2 The length of transmission line. \param tmp3 Real part of the shunt admittance in mhos at end one. \param tmp4 Imaginary part of the shunt admittance in mhos at end one. \param tmp5 Real part of the shunt admittance in mhos at end two \param tmp6 Imaginary part of the shunt admittance in mhos at end two. """ return _PyNEC.nec_context_tl_card(*args) def nt_card(*args): """ Generates a two-port nonradiating, network connected between any two segments in the structure. The characteristics of the network are specified by its short-circuit admittance matrix elements. 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) \param itmp1 Tag number of the segment to which port one of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port one of the network is connected. \param itmp3 Tag number of the segment to which port two of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port two of the network is connected. \param tmp1 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp2 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp3 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp4 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp5 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. \param tmp6 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. """ return _PyNEC.nec_context_nt_card(*args) def xq_card(*args): """ Causes program execution at points in the data stream where execution is not automatic. Options on the card also allow for automatic generation of radiation patterns in either of two vertical cuts. void xq_card(int itmp1) \param itmp1 Options controlled by itmp1 are: itmp1 = 0 : no patterns requested (normal case). itmp1 = 1 : generates a pattern cut in the XZ plane, i.e., phi = 0 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 2 : generates a pattern cut in the YZ plane, i.e., phi = 90 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 3 : generates both of the cuts described for the values 1 and 2. """ return _PyNEC.nec_context_xq_card(*args) def rp_card(*args): """ Specifies radiation pattern sampling parameters and to cause program execution. Options for a field computation include a radial wire ground screen, a cliff, or surface-wave fields. All coordinates are in meters, angles are in degrees. 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) \param calc_mode The mode of calculation for the radiated field : calc_mode = 0 : normal mode. Space-wave fields are computed. An infinite ground plane is included if it has been specified previously on a GN cart; otherwise, antenna is in free space. calc_mode = 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 cart 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.) calc_mode = 2 : linear cliff with antenna above upper level. Lower medium parameters are as specified for the second medium on the GN cart or on the GD card. calc_mode = 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. calc_mode = 4 : radial wire ground screen centered at origin. calc_mode = 5 : both radial wire ground screen and linear cliff. calc_mode = 6 : both radial wire ground screen ant circular cliff. \param n_theta If calc_mode = 1 : number of values of z ; else number of values of theta. \param n_phi Number of values of phi. \param output_format If calc_mode = 1 : zero ; else controls the output format : output_format = 0 : major axis, minor axis and total gain printed. output_format = 1 : vertical, horizontal ant total gain printed. \param normalization If calc_mode = 1 : zero ; else causes normalized gain for the specified field points to be printed after the standard gain output : normalization = 0 : no normalized gain. normalization = 1 : major axis gain normalized. normalization = 2 : minor axis gain normalized. normalization = 3 : vertical axis gain normalized. normalization = 4 : horizontal axis gain normalized. normalization = 5 : total gain normalized. \param D If calc_mode = 1 : zero else selects either power gain or directive gain for both standard printing and normalization : D = 0 : power gain. D = 1 : directive gain. \param A If calc_mode = 1 : zero else 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. \param theta0 If calc_mode = 1 : initial value of z ; else initial value of theta. \param phi0 Initial value of phi. \param delta_theta If calc_mode = 1 : increment for z ; else increment for theta. \param delta_phi Increment for phi. \param radial_distance If calc_mode = 1 : cylindrical coordinate rho. It must be greater than about one wavelength ; else radial distance (R) of field point from the origin. 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. \param gain_norm Gain normalization factor if normalization has been required by the parameter normalization. If gain_norm = 0 the gain will be normalized to its maximum value. """ return _PyNEC.nec_context_rp_card(*args) def pt_card(*args): """ Controls the printing for currents void pt_card(int itmp1, int itmp2, int itmp3, int itmp4) \param itmp1 Print control flag, specifies the type of format used in printing segment currents : itmp1 = -2 : all currents printed. This it a default value for the program if the card is Omitted. itmp1 = -1 : suppress printing of all wire segment currents. itmp1 = O : current printing will be limited to the segments specified by the next three parameters. itmp1 = 1 : currents are printed by using a format designed for a receiving pattern. Only currents for the segments specified by the next three parameters are printed. itmp1 = 2 : same as for 1 above; in addition, however, the current for one segment will be normalized to its maximum, ant the normalized values along with the relative strength in dB will be printed in a table. If the currents for more than one segment are being printed, only currents from the last segment in the group appear in the normalized table. itmp1 = 3 : only normalized currents from one segment are printed for the receiving pattern case. \param itmp2 The tag number of the segments the currents on which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the current on which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the current on which will be printed. if both itmp3 and itmp4 are zero, all currents will be printed. """ return _PyNEC.nec_context_pt_card(*args) def pq_card(*args): """ Controls the printing for charges void pq_card(int itmp1, int itmp2, int itmp3, int itmp4) \param itmp1 Print control flag : itmp1 = -2 : all charge densities printed. itmp1 = -1 : suppress printing of charge densities. This is the default condition. itmp1 = 0 : print charge densities on segments speficied by the following parameters. \param itmp2 The tag number of the segments the charge densities of which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the charge density of which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the charge density of which will be printed. if both itmp3 and itmp4 are zero, all charge densities will be printed. """ return _PyNEC.nec_context_pq_card(*args) def kh_card(*args): """ Sets the minimum separation distance for use of a time-saving approximation in filling the interaction matrix. void kh_card(nec_float tmp1) \param tmp1 The approximation is used for interactions over distances greater than tmp1 wavelengths. """ return _PyNEC.nec_context_kh_card(*args) def ne_card(*args): """ To request calculation of the near electric field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. 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) \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. """ return _PyNEC.nec_context_ne_card(*args) def nh_card(*args): """ To request calculation of the near magnetic field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. 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) \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta """ return _PyNEC.nec_context_nh_card(*args) def ek_card(*args): """ Controls the use of the extended thin-wire kernal approximation. void ek_card(bool ekflag) \param ekflag Controls the use of the kernel : ekflag = -1 : returns to standard thin-wire kernel (the one used if there's no ek card). ekflag = 0 : initiates use of the extended thin-wire kernel. """ return _PyNEC.nec_context_set_extended_thin_wire_kernel(*args) def cp_card(*args): #return _PyNEC.nec_context_cp_card(*args) error_msg = "The maximum coupling between segments is currently not wrapped, therefore this card has been disabled." raise exceptions.Warning(error_msg) class nec_contextPtr(nec_context): def __init__(self, this): _swig_setattr(self, nec_context, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_context, 'thisown', 0) _swig_setattr(self, nec_context,self.__class__,nec_context) _PyNEC.nec_context_swigregister(nec_contextPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_structure_currents.py0000644000175000017500000003612210323754613024245 0ustar numanuma#nec_structure_currents.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #some utility functions def _get_iptflg(arg0): """ Returns the flag which controls the printing of the currents. """ return _PyNEC.nec_structure_currents_get_iptflg(arg0) def _get_iptflq(arg0): """ Returns the flag which controls the printing of charge densities. """ return _PyNEC.nec_structure_currents_get_iptflq(arg0) def _get_n(arg0): """ Returns the number the wire segments in the geometry. """ return _PyNEC.nec_structure_currents_get_n(arg0) def _get_m(arg0): """ Returns the number of patches in the geometry. """ return _PyNEC.nec_structure_currents_get_m(arg0) #class "nec_structure_currents" class nec_structure_currents(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_structure_currents, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_structure_currents, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_structure_currents instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_structure_currents_get_frequency(*args) def get_current_output_format(*args): """ Returns the output format used for the printing of currents, provided it has been requested. """ _iptflg = _get_iptflg(*args) if _iptflg != -1: if _iptflg == -2 or _iptflg == 0 : return 'Standard output format' elif _iptflg == 1 or _iptflg == 2 : return 'Format designed for a receiving pattern' else : error_msg = "Unknown output format." raise exceptions.Warning(error_msg) def get_current_segment_number(*args) : """ Returns the array of segment numbers for the printing of currrents. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : return _PyNEC.nec_structure_currents_get_current_segment_number(*args) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_tag(*args): """ Returns the array of segment tag numbers for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_tag(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_x(*args): """ Returns the array of x-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_x(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_y(*args): """ Returns the array of y-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_y(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_z(*args): """ Returns the array of z-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_z(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_length(*args): """ Returns the array of segment lengths in meters for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_length(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_theta(*args): """ Returns the array of theta angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == 1 or _iptflg == 2 : return _PyNEC.nec_structure_currents_get_current_theta(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_phi(*args): """ Returns the array of phi angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == 1 or _iptflg == 2 : return _PyNEC.nec_structure_currents_get_current_phi(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current(*args): """ Returns the array of complex currents in Ampere. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : return _PyNEC.nec_structure_currents_get_current(*args) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_number(*args): """ Returns the array of segment numbers for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_number(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_tag(*args): """ Returns the array of segment tag numbers for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_tag(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_x(*args): """ Returns the array of x-coordinate of segment centers in meters for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_x(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_y(*args): """ Returns the array of y-coordinate of segment centers in meters for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_y(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_z(*args): """ Returns the array of z-coordinate of segment centers in meters for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_z(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_length(*args): """ Returns the array of segment lengths in meters for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_length(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density(*args): """ Returns the array of complex charge densities in Coulomb/meter. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_patch_number(*args): """ Returns the array of patch numbers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_number(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_x(*args): """ Returns the array of x-coordinate of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_x(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_y(*args): """ Returns the array of y-coordinate of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_y(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_z(*args): """ Returns the array of z-coordinate of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_z(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_tangent_vector1(*args): """ Returns the array of complex tangent vector 1 of the patches. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_tangent_vector1(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_tangent_vector2(*args): """ Returns the array of complex tangent vector 2 of the patches. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_tangent_vector2(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_x(*args): """ Returns the complex x-component of the electric field E. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_x(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_y(*args): """ Returns the complex y-component of the electric field E. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_y(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_z(*args): """ Returns the complex z-component of the electric field E. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_z(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) class nec_structure_currentsPtr(nec_structure_currents): def __init__(self, this): _swig_setattr(self, nec_structure_currents, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_structure_currents, 'thisown', 0) _swig_setattr(self, nec_structure_currents,self.__class__,nec_structure_currents) _PyNEC.nec_structure_currents_swigregister(nec_structure_currentsPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_near_field_pattern.py0000644000175000017500000001143410323754613024104 0ustar numanuma#nec_near_field_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #some utility functions def _get_nfeh(arg0): """ Returns the flag indicating whether the result is a near electric or magnetic field pattern. """ return _PyNEC.nec_near_field_pattern_get_nfeh(arg0) #class "near_field_pattern" class nec_near_field_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_near_field_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_near_field_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_near_field_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_near_field_pattern_get_frequency(*args) def get_x(*args): """ Returns the array of x-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_x(*args) def get_y(*args): """ Returns the array of y-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_y(*args) def get_z(*args): """ Returns the array of z-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_z(*args) def get_e_x(*args): """ Returns the array of x_components of the electric field. """ if(_get_nfeh(*args) != 1): return _PyNEC.nec_near_field_pattern_get_field_x(*args) else: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_x' instead." raise exceptions.Warning(error_msg) def get_e_y(*args): """ Returns the array of y_components of the electric field. """ if(_get_nfeh(*args) != 1): return _PyNEC.nec_near_field_pattern_get_field_y(*args) else: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_y' instead." raise exceptions.Warning(error_msg) def get_e_z(*args): """ Returns the array of z_components of the electric field. """ if(_get_nfeh(*args) != 1): return _PyNEC.nec_near_field_pattern_get_field_z(*args) else: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_z' instead." raise exceptions.Warning(error_msg) def get_h_x(*args): """ Returns the array of x_components of the magnetic field. """ if(_get_nfeh(*args) == 1): return _PyNEC.nec_near_field_pattern_get_field_x(*args) else: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_x' instead." raise exceptions.Warning(error_msg) def get_h_y(*args): """ Returns the array of y_components of the magnetic field. """ if(_get_nfeh(*args) == 1): return _PyNEC.nec_near_field_pattern_get_field_y(*args) else: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_y' instead." raise exceptions.Warning(error_msg) def get_h_z(*args): """ Returns the array of z_components of the magnetic field. """ if(_get_nfeh(*args) == 1): return _PyNEC.nec_near_field_pattern_get_field_z(*args) else: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_z' instead." raise exceptions.Warning(error_msg) class nec_near_field_patternPtr(nec_near_field_pattern): def __init__(self, this): _swig_setattr(self, nec_near_field_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_near_field_pattern, 'thisown', 0) _swig_setattr(self, nec_near_field_pattern,self.__class__,nec_near_field_pattern) _PyNEC.nec_near_field_pattern_swigregister(nec_near_field_patternPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_ground.py0000644000175000017500000001354010323754613021555 0ustar numanuma#nec_ground.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #class "nec_ground" class nec_ground(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_ground, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_ground, name) def __repr__(self): return "<%s.%s; proxy of C++ nec_ground instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): _swig_setattr(self, nec_ground, 'this', _PyNEC.new_nec_ground(*args)) _swig_setattr(self, nec_ground, 'thisown', 1) self._ifar=0 def get_relative_dielectric_constant(*args): """ Returns the relative dielectric constant (no units) of the ground medium 1. """ return _PyNEC.nec_ground_get_relative_dielectric_constant(*args) def get_conductivity(*args): """ Returns the conductivity in Siemens/meter of the ground medium 1. """ return _PyNEC.nec_ground_get_conductivity(*args) def get_radial_wire_count(self,*args): """ Returns the number of radial wires in the ground screen approximation, provided it has been used. """ _ifar=self._ifar if _ifar>3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_count(*args) else : error_msg="The count of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_radial_wire_length(self,*args): """ Returns the length of radial wires used in the ground screen approximation - provided this approximation has been used. """ _ifar=self._ifar if _ifar >3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_length(*args) else : error_msg="The length of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_radial_wire_radius(self,*args): """ Returns the radius of radial wires used in the ground screen approximation - provided this approximation has been used. """ _ifar=self._ifar if _ifar >3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_radius(*args) else : error_msg="The radius of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_cliff_type(self): """ Returns the type of cliff provided there's a cliff problem. """ _ifar=self._ifar if _ifar == 2 or _ifar == 5 : return "Linear" elif _ifar == 3 or _ifar == 6 : return "Circular" else : error_msg = "Unknown cliff type." raise exceptions.Warining(error_msg) def get_cliff_edge_distance(self): """ If there's a cliff problem, returns the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_cliff_edge_distance(self) else : error_msg = "The edge distance of the cliff is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_cliff_height(self): """ If there's a cliff problem, returns the distance (positive or zero) by which the surface of medium 2 is below medium 1. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_cliff_height(self) else : error_msg = "The height of the cliff is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_relative_dielectric_constant2(self): """ If there's a cliff problem, returns the relative dielectric constant (no units) of the ground medium 2. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_relative_dielectric_constant2(self) else : error_msg = "The relative dielectric constant of medium 2 is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_conductivity2(self): """ If there's a cliff problem, returns the conductivity in Siemens/meter of the ground medium 2. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_conductivity2(self) else : error_msg = "The conductivity of medium 2 is not available : there is no cliff." raise exceptions.Warning(error_msg) class nec_groundPtr(nec_ground): def __init__(self, this): _swig_setattr(self, nec_ground, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_ground, 'thisown', 0) _swig_setattr(self, nec_ground,self.__class__,nec_ground) _PyNEC.nec_ground_swigregister(nec_groundPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_antenna_input.py0000644000175000017500000000553110323754613023123 0ustar numanuma#nec_antenna_input.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG #class "nec_antenna_input" class nec_antenna_input(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_antenna_input, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_antenna_input, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_antenna_input instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_antenna_input_get_frequency(*args) def get_tag(*args): """ Returns the array of segment tag numbers. """ return _PyNEC.nec_antenna_input_get_tag(*args) def get_segment(*args): """ Returns the array of segment numbers. """ return _PyNEC.nec_antenna_input_get_segment(*args) def get_current(*args): """ Returns the array of complex currents in Amperes. """ return _PyNEC.nec_antenna_input_get_current(*args) def get_voltage(*args): """ Returns the array of complex voltages in Volts. """ return _PyNEC.nec_antenna_input_get_voltage(*args) def get_power(*args): """ Returns the array of power in Watts """ return _PyNEC.nec_antenna_input_get_power(*args) class nec_antenna_inputPtr(nec_antenna_input): def __init__(self, this): _swig_setattr(self, nec_antenna_input, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_antenna_input, 'thisown', 0) _swig_setattr(self, nec_antenna_input,self.__class__,nec_antenna_input) _PyNEC.nec_antenna_input_swigregister(nec_antenna_inputPtr) necpp-1.5.0+cvs20101003/Python/python_module/PyNEC.py0000644000175000017500000000061110323754613020343 0ustar numanuma# This file replace the Swig generated proxy class. It allows the other python files to be used. from nec_context import * from c_geometry import * from nec_norm_rx_pattern import * from nec_radiation_pattern import * from nec_structure_excitation import * from nec_antenna_input import * from nec_near_field_pattern import * from nec_structure_currents import * from nec_ground import * necpp-1.5.0+cvs20101003/Python/python_module/nec_norm_rx_pattern.py0000644000175000017500000001175010323754613023501 0ustar numanuma#nec_norm_rx_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import numarray import numarray.ma #some utility functions def _get_mag(arg0): """ Returns the array of receiving gain not yet normalized. """ n_theta = _get_n_theta(arg0) n_phi = _get_n_phi(arg0) ar = numarray.reshape(_PyNEC.nec_norm_rx_pattern_get_mag(arg0),(n_theta, n_phi)) ar.transpose() return ar def _get_n_theta(arg0): """ Returns the number of theta angles. """ return _PyNEC.nec_norm_rx_pattern_get_n_theta(arg0) def _get_n_phi(arg0): """ Returns the number of phi angles. """ return _PyNEC.nec_norm_rx_pattern_get_n_phi(arg0) def _get_theta_start(arg0): """ Returns the first value of theta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_theta_start(arg0) def _get_phi_start(arg0): """ Returns the first value of phi angles in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_phi_start(arg0) def _get_delta_theta(arg0): """ Returns the increment for theta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_delta_theta(arg0) def _get_delta_phi(arg0): """ Returns the increment for phi in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_delta_phi(arg0) #class "nec_norm_rx_pattern" class nec_norm_rx_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_norm_rx_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_norm_rx_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_norm_rx_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_norm_rx_pattern_get_frequency(*args) def get_eta(*args): """ Returns the value of eta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_eta(*args) def get_axial_ratio(*args): """ Returns the axial ratio (no units). """ return _PyNEC.nec_norm_rx_pattern_get_axial_ratio(*args) def get_segment_number(*args): """ Returns the segment number. """ return _PyNEC.nec_norm_rx_pattern_get_segment_number(*args) def get_type(*args): """ Return the polarization type. """ return _PyNEC.nec_norm_rx_pattern_get_type(*args) def get_norm_factor(*args): """ Returns the normalization factor in dB. """ return _PyNEC.nec_norm_rx_pattern_get_norm_factor(*args) def get_coordinates(*args): """ Returns the array of coordinates of the elements of the other arrays : an array of tuples (theta, phi) - in (degrees, degrees). """ n_theta=_get_n_theta(*args) n_phi=_get_n_phi(*args) theta_start = _get_theta_start(*args) delta_theta = _get_delta_theta(*args) phi_start = _get_phi_start(*args) delta_phi = _get_delta_phi(*args) l=[] for i in range(n_phi) : for j in range(n_theta) : l.append((theta_start+j*delta_theta, phi_start+i*delta_phi)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,2)) return ar def get_magnitude(*args): """ Returns the array of magnitude of the normalized receiving gain (no units). """ norm_factor = nec_norm_rx_pattern.get_norm_factor(*args) return _get_mag(*args)/norm_factor def get_gain(self,*args): """ Returns the array of normalized receiving gain in dB. """ mag = self.get_magnitude(*args) gain = 20*numarray.ma.log10(mag) gain.set_fill_value(-999.999) return gain.filled() class nec_norm_rx_patternPtr(nec_norm_rx_pattern): def __init__(self, this): _swig_setattr(self, nec_norm_rx_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_norm_rx_pattern, 'thisown', 0) _swig_setattr(self, nec_norm_rx_pattern,self.__class__,nec_norm_rx_pattern) _PyNEC.nec_norm_rx_pattern_swigregister(nec_norm_rx_patternPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_radiation_pattern.py0000644000175000017500000003410210323754613023763 0ustar numanuma#nec_radiation_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import numarray import math import exceptions #some utility functions def _get_gain(arg0): """ Returns the array of gains in dB used in the averaging process. """ return _reshape(_PyNEC.nec_radiation_pattern_get_gain(arg0),arg0) def _get_n_theta(arg0): """ Returns the number of theta angles (or of z values if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_ntheta(arg0) def _get_n_phi(arg0): """ Returns the number of phi angles. """ return _PyNEC.nec_radiation_pattern_get_nphi(arg0) def _get_theta_start(arg0): """ Returns the first value of theta in degrees (or of z in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_theta_start(arg0) def _get_delta_theta(arg0): """ Returns the increment for theta in degrees (or for z in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_delta_theta(arg0) def _get_phi_start(arg0): """ Returns the first value of phi in degrees. """ return _PyNEC.nec_radiation_pattern_get_phi_start(arg0) def _get_delta_phi(arg0): """ Returns the increment for phi in degrees. """ return _PyNEC.nec_radiation_pattern_get_delta_phi(arg0) def _get_wavelength(arg0): """ Returns the wavelength in meters. """ return (299.8*1e6/arg0.get_frequency()) def _get_range(arg0): """ Returns the radial distance in meters ( or the rho cylindrical coordinate in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_range(arg0) def _reshape(arg0,arg1): """ Changes the shape of the array arg0 to (n_phi, n_theta) to balance the effect of the typemaps which return flat arrays. """ n_theta=_get_n_theta(arg1) n_phi=_get_n_phi(arg1) return numarray.reshape(arg0,(n_phi,n_theta)) #the following functions precise the results that can be requested from the radiation pattern def _get_ifar(arg0): """ Returns the flag (no units) which indicates the calculation mode chosen. """ return _PyNEC.nec_radiation_pattern_get_ifar(arg0) def _get_rp_normalization(arg0): """ Returns the flag (no units) which indicates the target of the normalization process. """ return _PyNEC.nec_radiation_pattern_get_rp_normalization(arg0) def _get_rp_output_format(arg0): """ Returns the flag (no units) which indicates the output format chosen. """ return _PyNEC.nec_radiation_pattern_get_rp_output_format(arg0) def _get_rp_average(arg0): """ Returns the flag (no units) which indicates whether the average gain will be computed or not. """ return _PyNEC.nec_radiation_pattern_get_rp_power_average(arg0) def _get_rp_ipd(arg0): """ Returns the flag (no units) which indicates the type of gain computed : power or directive gain. """ return _PyNEC.nec_radiation_pattern_get_rp_ipd(arg0) #class "nec_radiation_pattern" class nec_radiation_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_radiation_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_radiation_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_radiation_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_radiation_pattern_get_frequency(*args) def get_ground(*args): """ Returns the associated ground object. """ _ifar = _get_ifar(*args) ground = _PyNEC.nec_radiation_pattern_get_ground(*args) ground._ifar = _ifar return ground def get_radial_distance(*args): """ Returns the radial distance in meters provided the calculation mode chosen is different from mode 1. """ if _get_ifar(*args) != 1 : return _get_range(*args) else : error_msg = " The radial distance is not defined for this calculation mode." raise exceptions.Warning(error_msg) def get_radial_attenuation(self): """ Returns the radial attenuation (no units) provided the calculation mode chosen is different from mode 1. """ if (_get_ifar(self) != 1) : _range = _get_range(self) if (_range >= 1.0e-20) : _wavelength = _get_wavelength(self) exrm = 1.0 / _range; exra = _range/ _wavelength; exra = -360.0*(exra - math.floor(exra)); return ("EXP(-JKR)/R : %.5e at phase %.2f degrees" % (exrm, exra)) else : error_msg = "The radial distance value is bellow 1E-20 : the attenuation is ignored." raise exceptions.Warning(error_msg) else : error_msg = "The radial attenuation is not available for this calculation mode." raise exceptions.Warning(error_msg) def get_calculation_mode(*args): """ Returns the calculation mode. """ _ifar = _get_ifar(*args) if _ifar == 0 : return "Normal mode" elif _ifar == 1 : return "A surface wave propagating along the ground is added to the normal space wave. The results appear in a special output format." elif _ifar == 2 : return "Linear cliff with antenna above upper level" elif _ifar == 3 : return "Circular cliff centered at origin of coordinate system: with antenna above upper level" elif _ifar == 4 : return "Radial wire ground screen centered at origin" elif _ifar == 5 : return "Both radial wire ground screen and linear cliff" elif _ifar == 6 : return "Both radial wire ground screen ant circular cliff" else : error_msg = "Unknown calculation mode." raise exceptions.Warning(error_msg) def get_coordinates(*args): """ Returns the array of coordinates of the elements of the other arrays : either an array of tuples (theta, phi) or of tuples (rho, phi, z) - either in (degrees, degrees) or in (meters, degrees, meters). """ _ifar = _get_ifar(*args) n_theta=_get_n_theta(*args) n_phi=_get_n_phi(*args) theta_start = _get_theta_start(*args) delta_theta = _get_delta_theta(*args) phi_start = _get_phi_start(*args) delta_phi = _get_delta_phi(*args) l=[] if _ifar == 1 : rho = _PyNEC.nec_radiation_pattern_get_range(*args) for i in range(n_phi) : for j in range(n_theta) : l.append((rho, phi_start+i*delta_phi,theta_start+j*delta_theta)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,3)) else : for i in range(n_phi) : for j in range(n_theta) : l.append((theta_start+j*delta_theta, phi_start+i*delta_phi)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,2)) return ar def get_gain_type(*args): """ Returns the type of gain computed : power or directive gain. """ if _get_ifar(*args) != 1 : ipd = _get_rp_ipd(*args) if ipd == 0 : return "Power gain" elif ipd == 1 : return "Directive gain" else : error_msg = "Unknown gain type." raise exceptions.Warning(error_msg) else : error_msg = "No computing of gain has been requested." raise exceptions.Warning(error_msg) def get_output_format(*args): """ Returns the type of output format. """ _output_format = _get_rp_output_format(*args) if _output_format == 0 : return 'major axis, minor axis and total gain computed' elif _output_format == 1 : return 'vertical, horizontal ant total gain printed' else : error_msg = "Unknown output format." raise exceptions.Warning(error_msg) def get_gain_vert(*args): """ Returns the array of vertical gains provided the output format chosen is format 1. """ if _get_rp_output_format(*args)==1 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_vert(*args),*args) else : error_msg="The computing of the vertical gain has not been requested. Try and get the 'major axis' gain instead." raise exceptions.Warning(error_msg) def get_gain_horiz(*args): """ Returns the array of horizontal gains in dB provided the output format chosen is format 1. """ if _get_rp_output_format(*args)==1 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_horiz(*args),*args) else : error_msg="The computing of the horizontal gain has not been requested. Try and get the 'minor axis' gain instead." raise exceptions.Warning(error_msg) def get_gain_major_axis(*args): """ Returns the array of major axis gains in dB provided the output format chosen is format 0. """ if _get_rp_output_format(*args)==0 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_vert(*args),*args) else : error_msg="The computing of the 'major axis' gain has not been requested. Try and get the vertical gain instead." raise exceptions.Warning(error_msg) def get_gain_minor_axis(*args): """ Returns the array of minor axis gains in dB provided the output format chosen is format 0. """ if _get_rp_output_format(*args)==0 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_horiz(*args),*args) else : error_msg="The computing of the 'minor axis' gain has not been requested. Try and get the horizontal gain instead." raise exceptions.Warning(error_msg) def get_gain_tot(*args): """ Returns the array of total gains in dB. """ return _reshape(_PyNEC.nec_radiation_pattern_get_gain_tot(*args),*args) def get_normalization_target(*args): """ Returns the target of the normalization process. """ _rp_normalization = _get_rp_normalization(*args) if _rp_normalization == 0 : return "No normalized gain" elif _rp_normalization == 1 : return "Major axis gain normalized" elif _rp_normalization == 2 : return "minor axis gain normalized" elif _rp_normalization == 3 : return "Vertical gain normalized" elif _rp_normalization == 4 : return "Horizontal gain normalized" elif _rp_normalization == 5 : return "Total gain normalized" else : error_msg='Unknown normalization target.' raise exceptions.Warning(error_msg) def get_normalization_factor(*args): """ Returns the normalization factor in dB provided a normalization has been requested. """ if (_get_rp_normalization(*args)) != 0 : return _PyNEC.nec_radiation_pattern_get_normalization_factor(*args) else : error_msg = "No normalization has been requested." raise exceptions.Warning(error_msg) def get_normalized_gain(*args): """ Returns the array of normalized gains in dB. """ return _get_gain(*args)-args[0].get_normalization_factor() def get_pol_axial_ratio(*args): """ Returns the array of polarization axial ratio (no units). """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_axial_ratio(*args),*args) def get_pol_tilt(*args): """ Returns the array of polarization tilt in degrees. """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_tilt(*args),*args) def get_pol_sense_index(*args): """ Returns the array of polarization sense index (no units). The relationship between the index and the actual sense is the following : 0 : linear 1 : right 2 : left """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_sense_index(*args),*args) def get_e_theta(*args): """ Returns the array of complex theta-component of electric field E in Volt/meter. """ return _reshape(_PyNEC.nec_radiation_pattern_get_e_theta(*args),*args) def get_e_phi(*args): """ Returns the array of complex phi-component of electric field E in Volt/meter. """ return _reshape(_PyNEC.nec_radiation_pattern_get_e_phi(*args),*args) def get_e_r(*args): """ Returns the array of complex radial-component of electric field E in Volt/meter - only available for the calculation mode 1. """ if _get_ifar(*args) == 1 : return _reshape(_PyNEC.nec_radiation_pattern_get_e_r(*args),*args) else : error_msg="The radial field is not available for this calculation mode." raise exceptions.Warning(error_msg) def get_average_gain(*args): """ Returns the array of average power gains in dB, provided its computation has been requested. """ _rpa=_get_rp_power_average(*args) if _rpa==1 or _rpa==2 : return _PyNEC.nec_radiation_pattern_get_average_gain(*args) else : error_msg="The computing of the average gain has not been requested." raise exceptions.Warning(error_msg) def get_average_solid_angle(*args): """ Returns the solid angle in steradians used in the averaging process, provided the computation of an average gain has been requested. """ _rpa=_get_rp_power_average(*args) if _rpa==1 or _rpa==2 : return _PyNEC.nec_radiation_pattern_get_average_solid_angle(*args) else : error_msg="The computing of the average gain has not been requested." raise exceptions.Warning(error_msg) class nec_radiation_patternPtr(nec_radiation_pattern): def __init__(self, this): _swig_setattr(self, nec_radiation_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_radiation_pattern, 'thisown', 0) _swig_setattr(self, nec_radiation_pattern,self.__class__,nec_radiation_pattern) _PyNEC.nec_radiation_pattern_swigregister(nec_radiation_patternPtr) necpp-1.5.0+cvs20101003/Python/python_module/c_geometry.py0000644000175000017500000002547410324716575021606 0ustar numanuma#c_geometry.py #header generated by Swig import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header genrated by Swig import exceptions #class "c_geometry" class c_geometry(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, c_geometry, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, c_geometry, name) def __repr__(self): return "<%s.%s; proxy of C++ c_geometry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def wire(*args): """ Add a wire to the geometry, All co-ordinates are in meters. void wire(int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad) \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 """ if args[10]>0 and args[11]>0 : return _PyNEC.c_geometry_wire(*args) else: error_msg = 'The last two parameters must both be greater than zero.' raise exceptions.RuntimeError(error_msg) def arc(*args): """ Add an arc to the geometry, All co-ordinates are in meters. void arc( int tag_id, int segment_count, double rada, double ang1, double ang2, double rad ) \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. """ return _PyNEC.c_geometry_arc(*args) def helix(*args): """ Add an helix to the geometry, \remark The helix is a versatile element. For example, to generate a spiral printed circuit antenna, use a helix of zero height. All co-ordinates are in meters. void helix(int tag_id, int segment_count, double s, double hl, double a1, double b1, double a2, double b2, double rad) \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. """ return _PyNEC.c_geometry_helix(*args) def move(*args): """ Move the structure with respect to its coordinate system or reproduces structure in new positions, All co-ordinates are in meters and angles are in degrees. void move( double rox, double roy, double roz, double xs, double ys, double zs, int its, int nrpt, int itgi ) \param rox The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation. \param roy The angle of rotation about Y-axis. \param roz The angle of rotation about Z-axis. \param xs The x component of vector by which the structure is translated with respect to the coordinate system. \param ys The y component of vector by which the structure is translated. \param zs The z component of vector by which the structure is translated. \param its The tag number of the segments that will be moved. If its = 0 then the entire structure is moved. \param nrpt The number of new Structures to be generated. \param itgi The tag number increment. """ return _PyNEC.c_geometry_move(*args) def scale(*args): """ Scale all dimensions of a structure by a constant. void scale( double xw1) \param xw1 All structure dimensions, including wire radius, are multiplied by xw1. """ return _PyNEC.c_geometry_scale(*args) def reflect(*args): """ Reflects partial structure along x,y, or z axes. void reflect_along_axis(int ix, int iy, int iz, int itx) \param ix If ix = 1 then the structure is reflected along X axis. \param iy If iy = 1 then the structure is reflected along Y axis. \param iz If iz = 1 then the structure is reflected along Z axis. \param itx The tag number increment. """ return _PyNEC.c_geometry_reflect(*args) def generate_cylindrical_structure(*args): """ Rotates structure along Z-axis to complete a symmetric structure. void generate_cylindrical_structure(int itx, int nop) \param itx The tag number increment. \param nop The total number of times that the structure is to occur in the cylindrical array. """ return _PyNEC.c_geometry_generate_cylindrical_structure(*args) def arbitrary_shaped_patch(*args): """ Add a arbitrary-shaped patch to the geometry All coordinates are in meters, angles are in radians. void arbitrary_shaped_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2 ) \param ax1 The x-coordinate of patch center. \param ay1 The y-coordinate of patch center. \param az1 The z-coordinate of patch center. \param ax2 The elevation angle above the X-Y plane of outward normal vector. \param ay2 The azimuth angle from X-axis of outward normal vector. \param az2 The patch area if ny=1. """ return _PyNEC.c_geometry_arbitrary_shaped_patch(*args) def rectangular_patch(*args): """ Add a rectangular patch to the geometry All coordinates are in meters. void rectangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. """ return _PyNEC.c_geometry_rectangular_patch(*args) def triangular_patch(*args): """ Add a triangular patch to the geometry All coordinates are in meters. void triangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. """ return _PyNEC.c_geometry_triangular_patch(*args) def quadrilateral_patch(*args): """ Add a quadrilateral patch to the geometry All coordinates are in meters. void quadrilateral_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. """ return _PyNEC.c_geometry_quadrilateral_patch(*args) def multiple_patch(*args): """ Add a multiple patch to the geometry. All coordinates are in meters. void multiple_patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) \param nx The rectangular surface is divided into nx patches from corner 1 to corner 2. \param ny The rectangular surface is divided into ny patches from corner 2 to corner 3. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. """ if args[1]>0 and args[2]>0: return _PyNEC.c_geometry_multiple_patch(*args) else: error_msg='The first two parameters should both be greater than zero.' raise exceptions.RuntimeError(error_msg) def __init__(self, *args): _swig_setattr(self, c_geometry, 'this', _PyNEC.new_c_geometry(*args)) _swig_setattr(self, c_geometry, 'thisown', 1) def __del__(self, destroy=_PyNEC.delete_c_geometry): try: if self.thisown: destroy(self) except: pass class c_geometryPtr(c_geometry): def __init__(self, this): _swig_setattr(self, c_geometry, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, c_geometry, 'thisown', 0) _swig_setattr(self, c_geometry,self.__class__,c_geometry) _PyNEC.c_geometry_swigregister(c_geometryPtr) necpp-1.5.0+cvs20101003/Python/python_module/nec_structure_excitation.py0000644000175000017500000000571410323754613024552 0ustar numanuma#nec_structure_excitation.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG #class "nec_struture_excitation" class nec_structure_excitation(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_structure_excitation, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_structure_excitation, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_structure_excitation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Herz. """ return _PyNEC.nec_structure_excitation_get_frequency(*args) def get_tag(*args): """ Returns the array of segment tag numbers. """ return _PyNEC.nec_structure_excitation_get_tag(*args) def get_segment(*args): """ Returns the array of segment numbers. """ return _PyNEC.nec_structure_excitation_get_segment(*args) def get_current(*args): """ Returns the array of complex currents in Ampere. """ return _PyNEC.nec_structure_excitation_get_current(*args) def get_voltage(*args): """ Returns the array of complex voltages in Volt. """ return _PyNEC.nec_structure_excitation_get_voltage(*args) def get_power(*args): """ Returns the array of power in Watt. """ return _PyNEC.nec_structure_excitation_get_power(*args) class nec_structure_excitationPtr(nec_structure_excitation): def __init__(self, this): _swig_setattr(self, nec_structure_excitation, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_structure_excitation, 'thisown', 0) _swig_setattr(self, nec_structure_excitation,self.__class__,nec_structure_excitation) _PyNEC.nec_structure_excitation_swigregister(nec_structure_excitationPtr) necpp-1.5.0+cvs20101003/Python/python_module/CVS/0000755000175000017500000000000011452152141017500 5ustar numanumanecpp-1.5.0+cvs20101003/Python/python_module/CVS/Root0000644000175000017500000000007011452152141020343 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/python_module/CVS/Repository0000644000175000017500000000003311452152141021576 0ustar numanumanecpp/Python/python_module necpp-1.5.0+cvs20101003/Python/python_module/CVS/Entries0000644000175000017500000000101311452152141021027 0ustar numanuma/PyNEC.py/1.9/Fri Oct 14 16:15:07 2005// /c_geometry.py/1.6/Mon Oct 17 12:47:57 2005// /nec_antenna_input.py/1.6/Fri Oct 14 16:15:07 2005// /nec_context.py/1.7/Fri Oct 14 16:15:07 2005// /nec_ground.py/1.5/Fri Oct 14 16:15:07 2005// /nec_near_field_pattern.py/1.5/Fri Oct 14 16:15:07 2005// /nec_norm_rx_pattern.py/1.6/Fri Oct 14 16:15:07 2005// /nec_radiation_pattern.py/1.7/Fri Oct 14 16:15:07 2005// /nec_structure_currents.py/1.5/Fri Oct 14 16:15:07 2005// /nec_structure_excitation.py/1.6/Fri Oct 14 16:15:07 2005// D necpp-1.5.0+cvs20101003/Python/test_scripts/0000755000175000017500000000000011452152143016707 5ustar numanumanecpp-1.5.0+cvs20101003/Python/test_scripts/test_rp.py0000644000175000017500000000646310323406006020746 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example given for the "libnec" (modified in order to have several values for phi and theta) # #nec = nec_create(); #nec_wire(nec, 0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); #nec_geometry_complete(nec, 0, 0); # #nec_gn_card(nec, -1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); #nec_ld_card(nec, 5,0,0,0,3.72e7,0.0,0.0); #nec_pt_card(nec, -1, 0, 0, 0); #nec_ex_card(nec, 1, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); #nec_fr_card(nec, 0, 2, 2400.0, 100.0); #nec_rp_card(nec, 0, 3, 2, 0,5,0,0, 90.0, 90.0, 10.0, 10.0, 0.0, 0.0); #gain = nec_get_maximum_gain(nec); from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0) geo.wire(0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0) geo.wire(0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0) geo.wire(0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0) geo.wire(0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0) geo.wire(0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0) geo.wire(0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0) geo.wire(0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0) geo.wire(0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0) geo.wire(0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0) #end of the geometry input context.geometry_complete(0) #add a "gn" card to specify the ground parameters context.gn_card(-1, 0, 0, 0, 0, 0, 0, 0) #add a "ld" card for "loading" context.ld_card(5, 0, 0, 0, 3.72e7, 0.0, 0.0) #add a "pt" card to ask for Control for Current on Wires to be printed context.pt_card(0, 0, 1, 10) #add a "ex" card to specify an excitation context.ex_card(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) #add a "fr" card to specify the frequency context.fr_card(0, 2, 2400.0e6, 100.0e6) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 3, 2, 0, 5, 0, 0, 90.0, 90.0, 10.0, 10.0, 1.0, 0.0) #get the radiation_pattern rp = context.get_radiation_pattern(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_surface_patch_currents.py0000644000175000017500000000517010323406006025053 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example6.nec # #CECYLINDER WITH ATTACHED WIRES #SP 0 0 10 0 7.3333 0. 0. 38.4 #SP 0 0 10 0 0. 0. 0. 38.4 #SP 0 0 10 0 -7.3333 0. 0. 38.4 #GM 0 1 0. 0. 30. #SP 0 0 6.89 0. 11. 90. 0. 44.88 #SP 0 0 6.89 0. -11. -90. 0. 44.88 #GR 0 6 #SP 0 0 0. 0. 11. 90. 0. 44.89 #SP 0 0 0. 0. -11. -90. 0. 44.89 #GW 1 4 0. 0. 11. 0. 0. 23. .1 #GW 2 5 10. 0. 0. 27.6 0. 0. .2 #GS 0 0 .01 #GE #FR 0 1 0 0 465.84 #CP 1 1 2 1 #EX 0 1 1 0 1. #RP 0 73 1 1000 0. 0. 5. 0. #EX 0 2 1 0 1. #XQ #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, 7.3333, 0., 0., 38.4) #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, 0, 0., 0., 38.4) #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, -7.3333, 0., 0., 38.4) #move the structure (here the structure is copied, its copy is rotated by 30 degrees about Z-axis) geo.move(0, 0, 30, 0, 0, 0, 0, 1, 0) #add a patch to the geometry geo.arbitrary_shaped_patch(6.89, 0., 11., 90., 0., 44.88) #add a patch to the geometry geo.arbitrary_shaped_patch(6.89, 0., -11., -90., 0., 44.88) #ask for a cylindrical structure to be generated from the existing structure geo.generate_cylindrical_structure(0, 6) #add a patch to the geometry geo.arbitrary_shaped_patch(0, 0, 11, 90, 0, 44.89) #add a patch to the geometry geo.arbitrary_shaped_patch(0, 0, -11, -90, 0, 44.89) #add a wire to the geometry geo.wire(1, 4, 0, 0, 11, 0, 0, 23, .1, 1, 1) #add a wire to the geometry geo.wire(2, 5, 10, 0, 0, 27.6, 0, 0, .2, 1, 1) #scale all the structure dimensions by a constant geo.scale(0.01) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 1, 465.84e6, 0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 73, 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0) #add a "xq" card to force the simulation execution context.xq_card(0) #get the currents sc = context.get_structure_currents(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_structure_currents.py0000644000175000017500000000502510323406006024303 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example3.nec # #CMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND #CM EXTENDED THIN WIRE KERNEL USED #CM 1. PERFECT GROUND #CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING #CE PATTERN CALCULATIONS #GW 0 9 0. 0. 2. 0. 0. 7. .3 #GE 1 #EK #PT 0 0 3 4 #LD 0 0 0 0 1000 1 1 #FR 0 1 0 0 30. #EX 0 0 5 0 1. #GN 1 #RP 0 10 2 1301 0. 0. 10. 90. #GN 0 0 0 0 6. 1.000E-03 #RP 0 10 2 1301 0. 0. 10. 90. #RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 #EX 2 10 1 0 0. 0. 0.1 10. 0. 0.6 #PT 2 0 5 5 #XQ #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 9, 0, 0, 2, 0, 0, 7, .3, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ek" card to initiate use of the extended thin-wire kernal context.ek_card(1) #add a "pt" card to control the printing of currents on wire segments context.pt_card(0, 0, 3, 4) #add a "ld" card for "loading" context.ld_card(0, 0, 0, 0, 1000, 1, 1) #add a "fr" card to specify the frequency context.fr_card(0, 1, 30e6, 0) #add a "ex" card to specify an excitation context.ex_card(0, 0, 5, 0, 0, 1, 0, 0, 0, 0, 0) #add a "gn" card to specify the ground parameters context.gn_card(1, 0, 0, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 10, 2, 1, 3, 0, 1, 0, 0, 10.0, 90.0, 0.0, 0.0) #add a "gn" card to specify the ground parameters context.gn_card(0, 0, 6, 1.000e-3, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 10, 2, 1, 3, 0, 1, 0, 0, 10.0, 90.0, 0.0, 0.0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(1, 10, 1, 0, 0, 0, 0, 1, 0, 2, 0, 1.000e5, 0.0) #add a "ex" card to specify an excitation context.ex_card(2, 10, 1, 0, 0, 0, 0, 0.1, 10, 0, 0.6) #add a "pt" card to control the printing of currents on wire segments context.pt_card(2, 0, 5, 5) #get the currents sc = context.get_structure_currents(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_ne_nh.py0000644000175000017500000000346110323406006021407 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #dipole_anim.nec # #CM Simple dipole, with calculation of currents, charges and near field. #CE #GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 #GE #EX 0 1 11 00 1 0 #PQ 0, 0 #NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #RP 0, 19, 36, 1000, 0, 0, 10, 10 #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(1, 21, 0, -0.25, 0.0, 0, 0.25, 0.0, 0.001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 11, 0, 0, 1, 0, 0, 0, 0, 0) #add a "pq" card to ask for the charge densities to be computed context.pq_card(0, 0, 0, 0) #add a "ne" card to ask for the "near electric field pattern" to be computed context.ne_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "nh" card to ask for the "near magnetic field pattern" to be computed context.nh_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 19, 36, 1, 0, 0, 0, 0, 0, 10, 10, 0, 0) #get the currents sc = context.get_structure_currents(0) #get the near electric and magnetic field : ne = context.get_near_field_pattern(0) nh = context.get_near_field_pattern(1) necpp-1.5.0+cvs20101003/Python/test_scripts/test_nrp.py0000644000175000017500000000336310323406006021120 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example3.nec (modified) # #CMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND #CM EXTENDED THIN WIRE KERNEL USED #CM 1. PERFECT GROUND #CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING #CE PATTERN CALCULATIONS #GW 0 9 0. 0. 2. 0. 0. 7. .3 #GE 1 #EK #FR 0 1 0 0 30. #EX 0 0 5 0 1. #GN 1 #RP 0 10 2 1301 0. 0. 10. 90. #GN 0 0 0 0 6. 1.000E-03 #RP 0 10 2 1301 0. 0. 10. 90. #RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 #EX 1 10 1 0 0. 0. 0. 10. #PT 2 0 5 5 #XQ #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(0, 9, 0, 0, 2, 0, 0, 7, .3, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ek" card to initiate use of the extended thin-wire kernal context.ek_card(1) #add a "fr" card to specify the frequency context.fr_card(0, 1, 30e6, 0) #add a "gn" card to specify the ground parameters context.gn_card(0, 0, 6., 0.001, 0, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(1, 10, 3, 0, 0, 0, 0, 0, 10, 20, 0) #add a "pt" card to control the printing of currents on wire segments context.pt_card(2, 0, 5, 5) #add a "xq" card to force the simulation execution context.xq_card(0) #get the norm_rx_pattern nrp = context.get_norm_rx_pattern(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_se.py0000644000175000017500000000716210323406006020731 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example5.nec (modified because there was a little bug in the last TL card...) # #CM 12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE #CM 78 SEGMENTS. SIGMA=O/L RECEIVING AND TRANS. PATTERNS. #CM DIPOLE LENGTH TO DIAMETER RATIO=150. #CE TAU=0.93. SIGMA=0.70. BOOM IMPEDANCE=50. OHMS. #GW 1 5 0.0000 -1.0000 0.0000000 0.00000 1.0000 0.000 .00667 #GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717 #GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771 #GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829 #GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891 #GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958 #GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103 #GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108 #GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191 #GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281 #GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377 #GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481 #GE #FR 0 0 0 0 46.29 0. #TL 1 3 2 3 -50. #TL 2 3 3 3 -50. #TL 3 3 4 3 -50. #TL 4 3 5 3 -50. #TL 5 3 6 4 -50. #TL 6 4 7 4 -50. #TL 7 4 8 4 -50. #TL 8 4 9 4 -50. #TL 9 4 10 4 -50. #TL 10 4 11 5 -50. #TL 11 5 12 5 -50. 0. 0. 0. .02 #EX 0 1 3 10 1 0 #RP 0 37 1 1110 90. 0. -5. 0. #EN from PyNEC import * #creation of a nec_context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(1, 5, 0, -1, 0, 0, 1, 0, .00667, 1, 1) geo.wire(2, 5, -.7527, -1.0753,0, -.7527, 1.0753, 0, .00717, 1, 1) geo.wire(3, 5, -1.562, -1.1562, 0, -1.562, 1.1562, 0, .00771, 1, 1) geo.wire(4, 5, -2.4323, -1.2432, 0, -2.4323, 1.2432, 0,.00829, 1, 1) geo.wire(5, 5, -3.368, -1.3368, 0, -3.368, 1.3368, 0, .00891, 1, 1) geo.wire(6, 7, -4.3742, -1.4374, 0, -4.3742, 1.4374, 0, .00958, 1, 1) geo.wire(7, 7, -5.4562, -1.5456, 0, -5.4562, 1.5456, 0, .0103, 1, 1) geo.wire(8, 7, -6.6195, -1.6619, 0, -6.6195, 1.6619, 0, .01108, 1, 1) geo.wire(9, 7, -7.8705, -1.787, 0, -7.8705, 1.787, 0, .01191, 1, 1) geo.wire(10, 7, -9.2156, -1.9215, 0, -9.2156, 1.9215, 0, .01281, 1, 1) geo.wire(11, 9, -10.6619, -2.0662, 0, -10.6619, 2.0662, 0, .01377, 1, 1) geo.wire(12, 9, -12.2171, -2.2217, 0, -12.2171, 2.2217, 0,.01481, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 0, 46.29e6, 0) #add "tl" cards to generate transmission lines context.tl_card(1, 3, 2, 3, -50, 0.7527, 0, 0, 0, 0) context.tl_card(2, 3, 3, 3, -50, 0.8093, 0, 0, 0, 0) context.tl_card(3, 3, 4, 3, -50, 0.8703, 0, 0, 0, 0) context.tl_card(4, 3, 5, 3, -50, 0.9357, 0, 0, 0, 0) context.tl_card(5 ,3 ,6, 4, -50, 1.0062, 0, 0, 0, 0) context.tl_card(6, 4, 7, 4, -50, 1.082, 0, 0, 0, 0) context.tl_card(7, 4, 8, 4, -50, 1.1633, 0, 0, 0, 0) context.tl_card(8, 4, 9, 4, -50, 1.251, 0, 0, 0, 0) context.tl_card(9, 4, 10, 4, -50, 1.3451, 0, 0, 0, 0) context.tl_card(10, 4 ,11 , 5, -50, 1.4463, 0, 0, 0, 0) context.tl_card(11, 5, 12, 5, -50, 1.5552, 0, 0, 0, 0.02) #add a "ex" card to specify an excitation context.ex_card(0, 1, 3, 1, 0, 1, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 37, 1, 1, 1, 1, 0, 90, 0, -5, 0, 0, 0) #get structure excitation se = context.get_structure_excitation(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_rp2.py0000644000175000017500000000202510323406006021016 0ustar numanumafrom PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 36, -0.0001, -0.0001, -0.0001, -0.0002, -0.0002, -0.0001, 0.001, 1.0, 1.0) #end of the geometry input context.geometry_complete(0) #add a "gn" card to specify the ground parameters context.gn_card(2, 0, 100., 50., 25., 10., 0.7, 0.6) #add a "ld" card for "loading" context.ld_card(5, 0, 0, 0, 3.72e7, 0.0, 0.0) #add a "pt" card to ask for Control for Current on Wires to be printed context.pt_card(-1, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) #add a "fr" card to specify the frequency context.fr_card(0, 2, 2400.0e6, 100.0e6) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(2, 3, 2, 0, 5, 0, 0, 90.0, 90.0, 10.0, 10.0, 0.0, 0.0) #get the radiation_pattern rp = context.get_radiation_pattern(0) #get the associated ground gr = rp.get_ground() necpp-1.5.0+cvs20101003/Python/test_scripts/test_ai.py0000644000175000017500000000275410323406006020715 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example2.nec (modified in order to get several excitations) : # #CMEXAMPLE 2. CENTER FED LINEAR ANTENNA. #CM CURRENT SLOPE DISCONTINUITY SOURCE. #CM 1. THIN PERFECTLY CONDUCTING WIRE #CE 2. THIN ALUMINUM WIRE #GW 0 8 0. 0. -.25 0. 0. .25 .00001 #GE #FR 0 3 0 0 200. 50. #EX 5 0 5 1 1. 0. 50. #EX 5 0 4 1 1. 0. 50. #XQ #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(0, 8, 0, 0, -.25, 0, 0, .25, .00001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 3, 200e6, 50) #add a "ex" card to specify an excitation context.ex_card(5, 0, 5, 0, 0, 1, 0, 0, 0, 0, 0) #add an other "ex" card to specify a second excitation context.ex_card(5, 0, 4, 0, 0, 1, 0, 0, 0, 0, 0) #add a "xq" card to force the simulation execution context.xq_card(0) #get the first antenna_input (there are several ones, each one corresponding to one single frequency) ai=context.get_input_parameters(0) necpp-1.5.0+cvs20101003/Python/test_scripts/test_charge_densities.py0000644000175000017500000000326610323406006023623 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #dipole_anim.nec # #CM Simple dipole, with calculation of currents, charges and near field. #CE #GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 #GE #EX 0 1 11 00 1 0 #PQ 0, 0 #NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #RP 0, 19, 36, 1000, 0, 0, 10, 10 #EN from PyNEC import * #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(1, 21, 0, -0.25, 0.0, 0, 0.25, 0.0, 0.001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 11, 0, 0, 1, 0, 0, 0, 0, 0) #add a "pq" card to ask for the charge densities to be computed context.pq_card(0, 0, 0, 0) #add a "ne" card to ask for the "near electric field pattern" to be computed context.ne_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "nh" card to ask for the "near magnetic field pattern" to be computed context.nh_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 19, 36, 1, 0, 0, 0, 0, 0, 10, 10, 0, 0) #get the currents sc = context.get_structure_currents(0) necpp-1.5.0+cvs20101003/Python/test_scripts/CVS/0000755000175000017500000000000011452152143017342 5ustar numanumanecpp-1.5.0+cvs20101003/Python/test_scripts/CVS/Root0000644000175000017500000000007011452152143020205 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/test_scripts/CVS/Repository0000644000175000017500000000003211452152143021437 0ustar numanumanecpp/Python/test_scripts necpp-1.5.0+cvs20101003/Python/test_scripts/CVS/Entries0000644000175000017500000000067411452152143020705 0ustar numanuma/test_ai.py/1.3/Thu Oct 13 07:25:58 2005// /test_charge_densities.py/1.3/Thu Oct 13 07:25:58 2005// /test_ne_nh.py/1.2/Thu Oct 13 07:25:58 2005// /test_nrp.py/1.3/Thu Oct 13 07:25:58 2005// /test_rp.py/1.3/Thu Oct 13 07:25:58 2005// /test_rp2.py/1.2/Thu Oct 13 07:25:58 2005// /test_se.py/1.3/Thu Oct 13 07:25:58 2005// /test_structure_currents.py/1.2/Thu Oct 13 07:25:58 2005// /test_surface_patch_currents.py/1.2/Thu Oct 13 07:25:58 2005// D necpp-1.5.0+cvs20101003/Python/README0000644000175000017500000000542310320770721015046 0ustar numanumaPyNEC is a Python module wrapped from NEC-2 *** How one can build it ? *** To build it one must have Swig ver 1.3.25 installed (http://www.swig.org/). SWIG is the tool used for the wrapping of NEC-2. - Get the NEC-2 src. should be something like ".../necppYYYYMMDD/". - Compile NEC-2. - Copy the files from the "interface_files/" directory in "/src/". These are the interface description files that will be used by Swig - Move to "/src/". - Have Swig generate the wrapper code : swig -c++ -python PyNEC.i When Swig generates the wrapper code, it also generates a "shadow class" python file (PyNEC.py here) to have a more user friendly module. This file has been modifed (and shared in several parts) to further improve the module. The resulting python files can be found in the "python_module/" directory. - Compile the wrapper code : g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H - Link the compiled wrapper code with the other ".o" files g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so - Get _PyNEC.so (the shared library) and copy it to the "python_module/" directory (in order to take advantage of the improved python files mentioned above). - You can now load the module. *** How one can load it ? *** To load PyNEC move to the "python_module/" directory, and import the module from a python interpreter : from PyNEC import * Warning : to use PyNEC one must have the numarray module installed (http://www.stsci.edu/resources/software_hardware/numarray). The version used for the tests is ver 1.3.3. Then you can start using the module. *** List of directories *** - The directory "interface_files/" contains the different interface files. "PyNEC.i" is the "master" interface file. - The directory "python_module/" contains the module itself (_PyNEC.so), and the remaining python files are the "shadow class" files (actually the "shadow class" file generated by Swig have been shared in several parts and some methods have been added). - The directory "swig_output/" contains different files generated by Swig, that are not much usefull for the end-user. - The directory "test_scripts/" contains a test script for each result type defined in "nec_results.h". You should use the python command line, and copy/paste the scripts in it (so they're not genuine "scripts"...). They create an object corresponding to one result type, and then it's up to you to try and use the different methods available for this object. - The directory "test_nec_files" contains the nec files corresponding to the different scripts. necpp-1.5.0+cvs20101003/Python/test_nec_files/0000755000175000017500000000000011452152142017146 5ustar numanumanecpp-1.5.0+cvs20101003/Python/test_nec_files/test_ne_nh.nec0000644000175000017500000000052010322432605021760 0ustar numanumaCM Simple dipole, with calculation of currents, charges and near field. CE GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 GE EX 0 1 11 00 1 0 PQ 0, 0 NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 RP 0, 19, 36, 1000, 0, 0, 10, 10 EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_ai.nec0000644000175000017500000000021410322432605021262 0ustar numanumaCMEXAMPLE 2. MODIFIE CE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE PT 2 FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 0. EX 5 0 4 1 1. 0. 0. XQ EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_charge_densities.nec0000644000175000017500000000052010321433752024174 0ustar numanumaCM Simple dipole, with calculation of currents, charges and near field. CE GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 GE EX 0 1 11 00 1 0 PQ 0, 0 NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 RP 0, 19, 36, 1000, 0, 0, 10, 10 EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_structure_currents.nec0000644000175000017500000000101510322432605024656 0ustar numanumaCMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND CM EXTENDED THIN WIRE KERNEL USED CM 1. PERFECT GROUND CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING CE PATTERN CALCULATIONS GW 0 9 0. 0. 2. 0. 0. 7. .3 GE 1 EK PT 0 0 3 4 LD 0 0 0 0 1000 1 1 FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 10 2 1301 0. 0. 10. 90. GN 0 0 0 0 6. 1.000E-03 RP 0 10 2 1301 0. 0. 10. 90. RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 EX 2 10 1 0 0. 0. 0.1 10. 0. 0.6 PT 2 0 5 5 XQ EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_nrp.nec0000644000175000017500000000023310322432605021471 0ustar numanumaCMEXAMPLE 3. modified CE GW 0 9 0. 0. 2. 0. 0. 7. .3 GE 1 EK FR 0 1 0 0 30. GN 0 0 0 0 6. 1.000E-03 EX 1 10 3 0 0. 0. 0. 10. 20. PT 2 0 5 5 XQ EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_se.nec0000644000175000017500000000234410322432605021306 0ustar numanumaCM 12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE CM 78 SEGMENTS. SIGMA=O/L RECEIVING AND TRANS. PATTERNS. CM DIPOLE LENGTH TO DIAMETER RATIO=150. CE TAU=0.93. SIGMA=0.70. BOOM IMPEDANCE=50. OHMS. GW 1 5 0.0000 -1.0000 0.0000000 0.00000 1.0000 0.000 .00667 GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717 GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771 GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829 GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891 GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958 GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103 GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108 GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191 GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281 GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377 GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481 GE FR 0 1 0 0 46.29 TL 1 3 2 3 -50. 0. 0. 0. 0. 0. TL 2 3 3 3 -50. 0. 0. 0. 0. 0. TL 3 3 4 3 -50. 0. 0. 0. 0. 0. TL 4 3 5 3 -50. 0. 0. 0. 0. 0. TL 5 3 6 4 -50. 0. 0. 0. 0. 0. TL 6 4 7 4 -50. 0. 0. 0. 0. 0. TL 7 4 8 4 -50. 0. 0. 0. 0. 0. TL 8 4 9 4 -50. 0. 0. 0. 0. 0. TL 9 4 10 4 -50. 0. 0. 0. 0. 0. TL 10 4 11 5 -50. 0. 0. 0. 0. 0. TL 11 5 12 5 -50. 1.5552 0. 0. 0. .02 EX 0 1 3 10 1 0 RP 0 37 1 1110 90. 0. -5. 0. EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_rp2.nec0000644000175000017500000000040110322432605021372 0ustar numanumaCMAdapted from the example of the "libnec" CE GW 0 36 -0.0001 -0.0001 -0.0001 -0.0002 -0.0002 -0.0001 0.001 GE GN 2 0 0 0 100 50 25 10 0.7 0.6 LD 5 0 0 0 3.72e7 FR 0 1 0 0 2400. PT -1 EX 5 0 1 0 0. 0. 0. 0. 0. 0. RP 2 3 2 0500 90. 90. 10. 10. 0. 0. EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_rp.nec0000644000175000017500000000124510322432605021317 0ustar numanumaCMAdapted from the example of the "libnec" CE GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE GN -1 LD 5 0 0 0 3.72e7 FR 0 2 0 0 2400. 100 PT -1 EX 1 1 1 0 0 0 0 0 0 0 RP 0 3 2 0500 90. 90. 10. 10. 1. 0. EN necpp-1.5.0+cvs20101003/Python/test_nec_files/test_surface_patch_currents.nec0000644000175000017500000000066510322432605025437 0ustar numanumaCECYLINDER WITH ATTACHED WIRES SP 0 0 10 0 7.3333 0. 0. 38.4 SP 0 0 10 0 0. 0. 0. 38.4 SP 0 0 10 0 -7.3333 0. 0. 38.4 GM 0 1 0. 0. 30. SP 0 0 6.89 0. 11. 90. 0. 44.88 SP 0 0 6.89 0. -11. -90. 0. 44.88 GR 0 6 SP 0 0 0. 0. 11. 90. 0. 44.89 SP 0 0 0. 0. -11. -90. 0. 44.89 GW 1 4 0. 0. 11. 0. 0. 23. .1 GW 2 5 10. 0. 0. 27.6 0. 0. .2 GS 0 0 .01 GE FR 0 1 0 0 465.84 CP 1 1 2 1 EX 0 1 1 0 1. RP 0 73 1 1000 0. 0. 5. 0. EX 0 2 1 0 1. XQ EN necpp-1.5.0+cvs20101003/Python/test_nec_files/CVS/0000755000175000017500000000000011452152142017601 5ustar numanumanecpp-1.5.0+cvs20101003/Python/test_nec_files/CVS/Root0000644000175000017500000000007011452152142020444 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/test_nec_files/CVS/Repository0000644000175000017500000000003411452152142021700 0ustar numanumanecpp/Python/test_nec_files necpp-1.5.0+cvs20101003/Python/test_nec_files/CVS/Entries0000644000175000017500000000070511452152142021137 0ustar numanuma/test_ai.nec/1.2/Mon Oct 10 09:33:57 2005// /test_charge_densities.nec/1.1/Fri Oct 7 08:55:06 2005// /test_ne_nh.nec/1.1/Mon Oct 10 09:33:57 2005// /test_nrp.nec/1.2/Mon Oct 10 09:33:57 2005// /test_rp.nec/1.2/Mon Oct 10 09:33:57 2005// /test_rp2.nec/1.1/Mon Oct 10 09:33:57 2005// /test_se.nec/1.2/Mon Oct 10 09:33:57 2005// /test_structure_currents.nec/1.1/Mon Oct 10 09:33:57 2005// /test_surface_patch_currents.nec/1.1/Mon Oct 10 09:33:57 2005// D necpp-1.5.0+cvs20101003/Python/interface_files/0000755000175000017500000000000011452152141017301 5ustar numanumanecpp-1.5.0+cvs20101003/Python/interface_files/nec_radiation_pattern.i0000644000175000017500000000637310323405645024026 0ustar numanuma%nodefault; class nec_radiation_pattern { public: /*! Returns the frequency in Herz. */ nec_float get_frequency(); /*! Returns the associated ground object. */ nec_ground get_ground(); /*! Returns the radial distance in meters ( or the rho cylindrical coordinate in meters if the calculation mode chosen is mode 1 ). */ nec_float get_range(); /*! Returns the array of gains in dB used in the normalization process. */ real_array get_gain(); /*! Returns the array of vertical (or major axis, depending on the output format chosen) gains in dB. */ real_array get_gain_vert(); /*! Returns the array of horizontal (or minor axis, depending on the output format chosen) gains in dB*/ real_array get_gain_horiz(); /*! Returns the array of total gains in dB*/ real_array get_gain_tot(); /*! Returns the array of polarization axial ratios (no units). */ real_array get_pol_axial_ratio(); /*! Returns the array of polarization tilts in degrees. */ real_array get_pol_tilt(); /*! Returns the array of polarization sense indexes (no units). The relationship between the index and the actual sense is the following : 0 : linear 1 : right 2 : left */ int_array get_pol_sense_index(); /*! Returns the array of complex theta-components of electric field E in Volt/meter. */ complex_array get_e_theta(); /*! Returns the array of complex phi-components of electric field E in Volt/meter. */ complex_array get_e_phi(); /*! Returns the array of complex radial-components of electric field E in Volt/meter - only available for the calculation mode 1. */ complex_array get_e_r(); /*! Returns the normalization factors in dB provided a normalization has been requested. */ nec_float get_normalization_factor(); /*! Returns the increment for theta in degrees (or for z in meters if the calculation mode chosen is mode 1 ). */ nec_float get_delta_theta(); /*! Returns the first value of theta in degrees (or of z in meters if the calculation mode chosen is mode 1 ). */ nec_float get_theta_start(); /*! Returns the increment for phi in degrees. */ nec_float get_delta_phi(); /*! Returns the first value of phi in degrees. */ nec_float get_phi_start(); /*! Returns the number of theta angles. */ int get_ntheta() const; /*! Returns the number of phi angles. */ int get_nphi() const; /*! Returns the array of average power gains in dB, provided its computation has been requested. */ nec_float get_average_power_gain(); /*! Returns the solid angle in steradians used in the averaging process, provided the computation of an average gain has been requested. */ nec_float get_average_power_solid_angle(); /*! Returns the flag (no units) which indicates the calculation mode chosen. */ int get_ifar(); /*! Returns the flag (no units) which indicates the target of the normalization process. */ int get_rp_normalization(); /*! Returns the flag (no units) which indicates the output format chosen. */ int get_rp_output_format(); /*! Returns the flag (no units) which indicates whether the average gain will be computed or not. */ int get_rp_power_average(); /*! Returns the flag (no units) which indicates the type of gain computed : power or directive gain. */ int get_rp_ipd(); }; necpp-1.5.0+cvs20101003/Python/interface_files/c_geometry.i0000644000175000017500000002116210323405645021620 0ustar numanumaclass c_geometry { public: /*! Add a wire to the geometry, All coordinates 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 */ 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); /*! Add an arc to the geometry, All coordinates are in meters and angles are in degrees. \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. */ void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); /*! Add an helix to the geometry, \remark The helix is a versatile m_geometry->element. For example, to generate a spiral printed circuit antenna, use a helix of zero height. All coordinates 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 helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ); /*! Scale all dimensions of a structure by a constant. \param xw1 All structure dimensions, including wire radius, are multiplied by xw1. */ void scale( nec_float xw1); %extend{ /*! Move the structure with respect to its coordinate system or reproduces structure in new positions, All coordinates are in meters and angles are in degrees. \param rox_deg The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation. \param roy_deg The angle of rotation about Y-axis. \param roz_deg The angle of rotation about Z-axis. \param xs The x component of vector by which the structure is translated with respect to the coordinate system. \param ys The y component of vector by which the structure is translated. \param zs The z component of vector by which the structure is translated. \param its The tag number of the segments that will be moved. If its = 0 then the entire structure is moved. \param nrpt The number of new Structures to be generated. \param itgi The tag number increment. */ void move( nec_float rox_deg, nec_float roy_deg, nec_float roz_deg, nec_float xs, nec_float ys, nec_float zs, int its, int nrpt, int itgi ) { nec_float rox_rad = degrees_to_rad(rox_deg); nec_float roy_rad = degrees_to_rad(roy_deg); nec_float roz_rad = degrees_to_rad(roz_deg); return self->move( rox_rad, roy_rad, roz_rad, xs, ys, zs, its, nrpt, itgi ); } /*! Reflects partial structure along x,y, or z axes. \param ix If ix = 1 then the structure is reflected along X axis. \param iy If iy = 1 then the structure is reflected along Y axis. \param iz If iz = 1 then the structure is reflected along Z axis. \param itx The tag number increment. */ void reflect(int ix, int iy, int iz, int itx) { int nop = 100*ix + 10*iy + iz; return self->reflect(ix, iy, iz, itx, nop); } /*! Rotates structure along Z-axis to complete a symmetric structure. \param itx The tag number increment. \param nop The total number of times that the structure is to occur in the cylindrical array. */ void generate_cylindrical_structure(int itx, int nop) { return self->reflect(-1, 0, 0, itx, nop); } /*! Add a arbitrary-shaped patch to the geometry All coordinates are in meters, angles are in degrees. \param ax1 The x-coordinate of patch center. \param ay1 The y-coordinate of patch center. \param az1 The z-coordinate of patch center. \param ax2_deg The elevation angle above the X-Y plane of outward normal vector. \param ay2_deg The azimuth angle from X-axis of outward normal vector. \param az2 The patch area if ny=1. */ void arbitrary_shaped_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2_deg, nec_float ay2_deg, nec_float az2 ) { nec_float ax2_rad = degrees_to_rad(ax2_deg); nec_float ay2_rad = degrees_to_rad(ay2_deg); return self->patch( 0, 1, ax1, ay1, az1, ax2_rad, ay2_rad, az2, 0, 0, 0, 0, 0, 0 ); } /*! Add a rectangular patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. */ void rectangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) { return self->patch( 0, 2, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 ); } /*! Add a triangular patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. */ void triangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) { return self->patch( 0, 3, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 ); } /*! Add a quadrilateral patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. */ void quadrilateral_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { return self->patch( 0, 4, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 ); } /*! Add a multiple patch to the geometry. All coordinates are in meters. \param nx The rectangular surface is divided into nx patches from corner 1 to corner 2. \param ny The rectangular surface is divided into ny patches from corner 2 to corner 3. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. */ void multiple_patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { return self->patch( nx, ny, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 ); } } }; necpp-1.5.0+cvs20101003/Python/interface_files/nec_antenna_input.i0000644000175000017500000000103310323405645023146 0ustar numanumaclass nec_antenna_input { public: /*! Returns the frequency in Herz. */ nec_float get_frequency(); /*! Returns the array of segment tag numbers. */ vector get_tag(); /*! Returns the array of segment numbers. */ vector get_segment(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of complex voltages in Volt. */ vector get_voltage(); /*! Returns the array of power in Watt. */ vector get_power(); }; necpp-1.5.0+cvs20101003/Python/interface_files/nec_ground.i0000644000175000017500000000376710323405645021621 0ustar numanuma%nodefault; class nec_ground { public: %extend { /*! Returns the relative dielectric constant (no units) of the ground medium 1. */ nec_float get_relative_dielectric_constant() { return self->epsr; } /*! Returns the conductivity in Siemens/meter of the ground medium 1. */ nec_float get_conductivity() { return self->sig; } /*! Returns the number of radial wires in the ground screen approximation. If it's zero then this approximation has not been used.*/ int get_radial_wire_count() { return self->radial_wire_count; } /*! Returns the length of radial wires used in the ground screen approximation - provided this approximation has been used. */ nec_float get_radial_wire_length() { return self->radial_wire_count; } /*! Returns the radius of radial wires in the ground screen approximation - provided this approximation has been used. */ nec_float get_radial_wire_radius() { return self->radial_wire_radius; } /*! If there's a cliff problem, returns the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. */ nec_float get_cliff_edge_distance() { return self->cliff_edge_distance; } /*! If there's a cliff problem, returns the distance (positive or zero) by which the surface of medium 2 is below medium 1. */ nec_float get_cliff_height() { return self->cliff_height; } /*! If there's a cliff problem, returns the relative dielectric constant (no units) of the ground medium 2. */ nec_float get_relative_dielectric_constant2() { return self->epsr2; } /*! If there's a cliff problem, returns the conductivity in Siemens/meter of the ground medium 2. */ nec_float get_conductivity2() { return self->sig2; } } }; necpp-1.5.0+cvs20101003/Python/interface_files/nec_context.i0000644000175000017500000006332410323405645022002 0ustar numanumaclass nec_context { int index=0; public: nec_context(); virtual ~nec_context(); /*! Must be called after construction */ void initialize(); /*! Get the associated c_geometry object */ c_geometry* get_geometry(); /*! Get the result antenna_input_parameters specified by index \param index The index of the requested result. */ inline nec_antenna_input* get_input_parameters(int index); /*! Get the result norm_rx_pattern specified by index \param index The index of the requested result. */ inline nec_norm_rx_pattern* get_norm_rx_pattern(int index); /*! Get the result radiation_pattern specified by index \param index The index of the requested result. */ inline nec_radiation_pattern* get_radiation_pattern(int index); /*! Get the result structure_excitation specified by index \param index The index of the requested result. */ inline nec_structure_excitation* get_structure_excitation(int index); /*! Get the result near_field_pattern specified by index \param index The index of the requested result. */ inline nec_near_field_pattern* get_near_field_pattern(int index); /*! Get the result structure_currents specified by index \param index The index of the requested result. */ inline nec_structure_currents* get_structure_currents(int index); %extend{ /* Indicates the end of the geometry input \param card_int_1 Geometry ground plain flag : card_int_1 = 0 : no ground plane is present. card_int_1 = 1 : indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero). card_int_1 = -1 : indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. */ void geometry_complete(int card_int_1) { return self->geometry_complete(card_int_1, 0); } /*! Frequency parameters \param ifrq Determines the type of frequency stepping : in_ifrq = 0 : linear stepping in_ifrq = 1 : mutliplicative stepping. \param nfrq The number of frequency steps. \param freq_hz The frequency first value in Herz. \param del_freq The frequency stepping increment. */ void fr_card(int ifrq, int nfrq, nec_float freq_hz, nec_float del_freq) { nec_float freq_mhz = freq_hz * 1.0e-6; return self->fr_card(ifrq, nfrq, freq_mhz, del_freq); } } /* Specifies the impedance loading on one segment or a number of segments. Series and parallel RLC circuits can be generated. In addition, a finite conductivity can be specified for segments. \param itmp1 Determines the type of loading and the expected units which are used : itmp1 = -1 : Nullifies previous loads. itmp1 = 0 : series RLC, input ohms, henries, farads. itmp1 = 1 : parallel RLC, input ohms, henries, farads. itmp1 = 2 : series RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 3 : parallel RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 4 : impedance, input resistance and reactance in ohms. itmp1 = 5 : wire conductivity, input mhos/meter. \param itmp2 The tag number of the segments to be loaded. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment to be loaded. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment to be loaded. if both itmp3 and itmp4 are zero, all segments will be loaded. \param tmp1 If itmp1 = 0, 1, 2, 3 or 4 : the resistance ; if itmp1 = 5 : the wire conductivity ; else tmp1 = 0. \param tmp2 If itmp1 = 0, 1, 2 or 3 : the inductance ; if itmp1 = 4 : the reactance ; else tmp2 = 0. \param tmp3 If itmp1 = 0, 1, 2 or 3 : the capacitance ; else tmp3 = 0. */ void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3); /*! Ground parameters under the antenna All coordinates are in meters. \param ground_type Ground-type flag : ground_type = -1 : nullifies ground parameters previously used and sets free-space condition. ground_type = 0 : finite ground, reflection coefficient approximation. ground_type = 1 : perfectly conducting ground. ground_type = 2 : finite ground, Sommerfeld/Norton method. \param rad_wire_count The number of radial wires in the ground screen approximation, O implies no ground screen. \param tmp1 Relative dielectric constant for ground in the vicinity of the antenna ; Zero in case of a perfect ground. \param tmp2 Conductivity in mhos/meter of the ground in the vicinity of the antenna ; Zero in the case of a perfect ground. If tmp2 is input as a negative number, the complex dielectric constant Ec = Er -j sigma/omega epsilon is set to EPSR - |SIG|. \param tmp3 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the ground screen ; else the relative dielectric constant of medium 2 (cliff problem). \param tmp4 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the wires used in the screen ; else the conductivity of medium 2 in mhos/meter (cliff problem). \param tmp5 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp6 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance (positive or zero) by which the surface of medium 2 is below medium 1. */ 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); /*! Specifies the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the field of surface patches All coordinates are in meters. \param tmp1 The relative dielectric constant of medium 2. \param tmp2 The conductivity of medium 2 in mhos/meter. \param tmp3 The distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp4 The distance (positive or zero) by which the surface of medium 2 is below medium 1. */ void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4); %extend{ /*! Specifies the excitation for the structure. The excitation can be voltage sources on the structure, an elementary current source, or a plane-wave incident on the structure. All angles are in degrees. \param excitation_type Determines the type of excitation which is used : excitation_type = O - voltage source (applied-E-field source). excitation_type = 1 - incident plane wave, linear polarization. excitation_type = 2 - incident plane wave, right-hand (thumb along the incident k vector) elliptic polarization. excitation_type = 3 - incident plane wave, left-hand elliptic polarization. excitation_type = 4 - elementary current source. excitation_type = 5 - voltage source (current-slope-discontinuity). \param itmp2 If excitation_type = 0 or 5 : the tag number of the source segment (if itmp1 = 0 absolute segment numbers will be used) ; else if excitation_type = 1, 2 or 3 : number of theta angles desired for the incident plane wave ; else zero. \param itmp3 If excitation_type = 0 or 5 : the rank (among the segments the tag number of which is itmp2) or absolute segment number of the source segment ; else if excitation_type = 1, 2 or 3 : number of phi angles desired for the incident plane wave ; else zero. \param itmp4 If itmp4 = 1 the maximum relative admittance matrix asymmetry for source segment (if excitation_type = 0 or 5) and network connections (whatever excitation_type may be) will be calculated and printed. \param itmp5 If excitation_type = 0 or 5 : tmp3 will be taken under account if itmp5 = 1 ; else zero. \param tmp1 If excitation_type = 0 or 5 : the real part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of theta ; else the x-coordinate of the current source. \param tmp2 If excitation_type = 0 or 5 : the imaginary part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of phi ; else if excitation_type = 4 : the y-coordinate of the current source. \param tmp3 If excitation_type = 0 or 5 : the normalization constant for the impedance printed in the optional impedance table (if tmp3 = 0 the impedance will be normalized to their maximum value) ; else if excitation_type = 1, 2 or 3 : eta in degrees. Eta is the polarization angle defined as the angle between the theta unit vector and the direction of the electric field for linear polarization or the major ellipse axis for elliptical polarization ; else if excitation_type = 4 : the z-coordinate of the current source. \param tmp4 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : theta angle stepping increment. else if excitation_type = 4 : the angle the current source makes with the XY plane. \param tmp5 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : phi angle stepping increment. else if excitation_type = 4 : the angle the projection of the current source on the XY plane makes with the X axis. \param tmp6 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : ratio of minor axis to major axis for elliptic polarization (major axis field strength - 1 V/m). else if excitation_type = 4 : "Current moment" of the source (in amp meter). */ 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) { int itmp45 = 10*itmp4 + itmp5; return self->ex_card( itmp1, itmp2, itmp3, itmp45, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); } } /*! Generates a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. All coordinates are in meters. \param itmp1 Tag number of the segment to which end one of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end one of the transmission line is connected. \param itmp3 Tag number of the segment to which end two of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end two of the transmission line is connected. \param tmp1 The characteristic impedance of the transmission line in ohms. A negative sign in front of the characteristic impedance will act as a flag for generating the transmission line with a 180 degree phase reversal (crossed line). \param tmp2 The length of transmission line. \param tmp3 Real part of the shunt admittance in mhos at end one. \param tmp4 Imaginary part of the shunt admittance in mhos at end one. \param tmp5 Real part of the shunt admittance in mhos at end two \param tmp6 Imaginary part of the shunt admittance in mhos at end two. */ 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); /*! Generates a two-port nonradiating, network connected between any two segments in the structure. The characteristics of the network are specified by its short-circuit admittance matrix elements. \param itmp1 Tag number of the segment to which port one of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port one of the network is connected. \param itmp3 Tag number of the segment to which port two of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port two of the network is connected. \param tmp1 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp2 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp3 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp4 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp5 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. \param tmp6 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. */ 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); /*! Causes program execution at points in the data stream where execution is not automatic. Options on the card also allow for automatic generation of radiation patterns in either of two vertical cuts. \param itmp1 Options controlled by itmp1 are: itmp1 = 0 : no patterns requested (normal case). itmp1 = 1 : generates a pattern cut in the XZ plane, i.e., phi = 0 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 2 : generates a pattern cut in the YZ plane, i.e., phi = 90 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 3 : generates both of the cuts described for the values 1 and 2. */ void xq_card(int itmp1); /*! Specifies radiation pattern sampling parameters and to cause program execution. Options for a field computation include a radial wire ground screen, a cliff, or surface-wave fields. All coordinates are in meters, angles are in degrees. \param calc_mode The mode of calculation for the radiated field : calc_mode = 0 : normal mode. Space-wave fields are computed. An infinite ground plane is included if it has been specified previously on a GN cart; otherwise, antenna is in free space. calc_mode = 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 cart 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.) calc_mode = 2 : linear cliff with antenna above upper level. Lower medium parameters are as specified for the second medium on the GN cart or on the GD card. calc_mode = 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. calc_mode = 4 : radial wire ground screen centered at origin. calc_mode = 5 : both radial wire ground screen and linear cliff. calc_mode = 6 : both radial wire ground screen ant circular cliff. \param n_theta If calc_mode = 1 : number of values of z ; else number of values of theta. \param n_phi Number of values of phi. \param output_format If calc_mode = 1 : zero ; else controls the output format : output_format = 0 : major axis, minor axis and total gain printed. output_format = 1 : vertical, horizontal ant total gain printed. \param normalization If calc_mode = 1 : zero ; else causes normalized gain for the specified field points to be printed after the standard gain output : normalization = 0 : no normalized gain. normalization = 1 : major axis gain normalized. normalization = 2 : minor axis gain normalized. normalization = 3 : vertical axis gain normalized. normalization = 4 : horizontal axis gain normalized. normalization = 5 : total gain normalized. \param D If calc_mode = 1 : zero else selects either power gain or directive gain for both standard printing and normalization : D = 0 : power gain. D = 1 : directive gain. \param A If calc_mode = 1 : zero else 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. \param theta0 If calc_mode = 1 : initial value of z ; else initial value of theta. \param phi0 Initial value of phi. \param delta_theta If calc_mode = 1 : increment for z ; else increment for theta. \param delta_phi Increment for phi. \param radial_distance If calc_mode = 1 : cylindrical coordinate rho. It must be greater than about one wavelength ; else radial distance (R) of field point from the origin. 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. \param gain_norm Gain normalization factor if normalization has been required by the parameter normalization. If gain_norm = 0 the gain will be normalized to its maximum value. */ 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); /*! Controls the printing for currents \param itmp1 Print control flag, specifies the type of format used in printing segment currents : itmp1 = -2 : all currents printed. This it a default value for the program if the card is Omitted. itmp1 = -1 : suppress printing of all wire segment currents. itmp1 = O : current printing will be limited to the segments specified by the next three parameters. itmp1 = 1 : currents are printed by using a format designed for a receiving pattern. Only currents for the segments specified by the next three parameters are printed. itmp1 = 2 : same as for 1 above; in addition, however, the current for one segment will be normalized to its maximum, ant the normalized values along with the relative strength in dB will be printed in a table. If the currents for more than one segment are being printed, only currents from the last segment in the group appear in the normalized table. itmp1 = 3 : only normalized currents from one segment are printed for the receiving pattern case. \param itmp2 The tag number of the segments the currents on which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the current on which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the current on which will be printed. if both itmp3 and itmp4 are zero, all currents will be printed. */ void pt_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! Controls the printing for charges \param itmp1 Print control flag : itmp1 = -2 : all charge densities printed. itmp1 = -1 : suppress printing of charge densities. This is the default condition. itmp1 = 0 : print charge densities on segments speficied by the following parameters. \param itmp2 The tag number of the segments the charge densities of which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the charge density of which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the charge density of which will be printed. if both itmp3 and itmp4 are zero, all charge densities will be printed. */ void pq_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! Sets the minimum separation distance for use of a time-saving approximation in filling the interaction matrix. \param tmp1 The approximation is used for interactions over distances greater than tmp1 wavelengths. */ void kh_card(nec_float tmp1); /*! To request calculation of the near electric field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. */ 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); /*! To request calculation of the near magnetic field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. */ 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); /*! Controls the use of the extended thin-wire kernal approximation. \param ekflag Controls the use of the kernel : ekflag = -1 : returns to standard thin-wire kernel (the one used if there's no ek card). ekflag = 0 : initiates use of the extended thin-wire kernel. */ void set_extended_thin_wire_kernel(bool ekflag); /*! Request calculation of the maximum coupling between segments. \param itmp1 Tag number of the first segment. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp1) or absolute segment number of the first segment. \param itmp3 Tag number of the second segment. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp3) or absolute segment number of the second segment. */ 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); }; necpp-1.5.0+cvs20101003/Python/interface_files/safe_array.i0000644000175000017500000000011410316726332021572 0ustar numanumatemplate class safe_array { public: T* get_ptr() const; }; necpp-1.5.0+cvs20101003/Python/interface_files/math_util.i0000644000175000017500000000051510323405645021450 0ustar numanuma/* these typedefs can be moved to an other interface file. They have been left here to respect the structure of the original code. */ typedef double nec_float; typedef std::complex nec_complex; typedef safe_array int_array; typedef safe_array real_array; typedef safe_array complex_array; necpp-1.5.0+cvs20101003/Python/interface_files/nec_structure_excitation.i0000644000175000017500000000104310323405645024573 0ustar numanumaclass nec_structure_excitation { public: /*! Returns the frequency in Herz */ nec_float get_frequency(); /*! Returns the array of segment tag numbers. */ vector get_tag(); /*! Returns the array of segment numbers. */ vector get_segment(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of complex voltages in Volt. */ vector get_voltage(); /*! Returns the array of power in Watt. */ vector get_power(); }; necpp-1.5.0+cvs20101003/Python/interface_files/nec_structure_currents.i0000644000175000017500000001033610323405645024276 0ustar numanumaclass nec_structure_currents { public: /*! Returns the frequency in Herz. */ nec_float get_frequency(); /*! Returns the flag which controls the printing of the currents. */ int get_iptflg(); /*! Returns the flag which controls the printing of charge densities. */ int get_iptflq(); /*! Returns the number the wire segments in the geometry. */ int get_n(); /*! Returns the number of patches in the geometry. */ int get_m(); /*! Returns the array of segment numbers for the printing of currrents. */ vector get_current_segment_number(); /*! Returns the array of segment tag numbers for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_tag(); /*! Returns the array of x-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_x(); /*! Returns the array of y-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_y(); /*! Returns the array of z-coordinate of segment centers in meters for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_z(); /*! Returns the array of segment lengths in meters for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_length(); /*! Returns the array of theta angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. */ vector get_current_theta(); /*! Returns the array of phi angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. */ vector get_current_phi(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of segment numbers for the printing of charge densities. */ vector get_q_density_segment_number(); /*! Returns the array of segment tag numbers for the printing of charge densities. */ vector get_q_density_segment_tag(); /*! Returns the array of x-coordinate of segment centers in meters for the printing of charge densities. */ vector get_q_density_segment_center_x(); /*! Returns the array of y-coordinate of segment centers in meters for the printing of charge densities. */ vector get_q_density_segment_center_y(); /*! Returns the array of z-coordinate of segment centers in meters for the printing of charge densities. */ vector get_q_density_segment_center_z(); /*! Returns the array of segment lengths in meters for the printing of charge densities. */ vector get_q_density_segment_length(); /*! Returns the array of complex charge densities in Coulomb/meter. */ vector get_q_density(); /*! Returns the array of patch numbers. */ vector get_patch_number(); /*! Returns the array of x-coordinate of patch centers. */ vector get_patch_center_x(); /*! Returns the array of y-coordinate of patch centers. */ vector get_patch_center_y(); /*! Returns the array of z-coordinate of patch centers. */ vector get_patch_center_z(); /*! Returns the array of complex tangent vector 1 of the patches. */ vector get_patch_tangent_vector1(); /*! Returns the array of complex tangent vector 2 of the patches. */ vector get_patch_tangent_vector2(); /*! Returns the complex x-component of the electric field E. */ vector get_patch_e_x(); /*! Returns the complex y-component of the electric field E. */ vector get_patch_e_y(); /*! Returns the complex z-component of the electric field E. */ vector get_patch_e_z(); /*this private method won't be wrapped, but allow an error in the compilation process to be avoided.*/ private: nec_structure_currents(nec_context * in_context, char * in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6); }; necpp-1.5.0+cvs20101003/Python/interface_files/PyNEC.i0000644000175000017500000000524710324716510020404 0ustar numanuma%module PyNEC %include %include %{ #include "Python.h" #include "numarray/libnumarray.h" #include "math_util.h" #include "nec_context.h" #include "c_geometry.h" #include "nec_radiation_pattern.h" #include "nec_structure_currents.h" #include "nec_results.h" #include "nec_ground.h" #include "safe_array.h" #include "nec_exception.h" #include %} /*! Exception handling stuff */ %include exception.i %exception { try { $action } catch (nec_exception* nex) { SWIG_exception(SWIG_RuntimeError,nex->get_message().c_str()); } catch (const char* message){ SWIG_exception(SWIG_RuntimeError,message); } catch (...){ SWIG_exception(SWIG_RuntimeError,"Unknown exception"); } } /*! The following typemaps allow the automatic conversion of vectors and safe_arrays into numarrays */ %typemap (python, out) real_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tFloat64, nd, size)); } %typemap (python, out) int_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tLong, nd, size)); } %typemap (python, out) complex_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tComplex64, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } /*! The two following interface files have only been created to avoid errors during the wrapping process. */ %import "math_util.i" %include "safe_array.i" /*! For each of the following interface files a corresponding python file has been created. The python genrated file has been used as a starting point, then it has been improved to provide a more user-friendly module. */ %include "nec_context.i" %include "c_geometry.i" %include "nec_radiation_pattern.i" %include "nec_norm_rx_pattern.i" %include "nec_structure_excitation.i" %include "nec_antenna_input.i" %include "nec_near_field_pattern.i" %include "nec_structure_currents.i" %include "nec_ground.i" /*The function below is added to the init function of the wrapped module. It's mandatory to do so before to use the numarray API*/ %init %{ import_libnumarray(); %} necpp-1.5.0+cvs20101003/Python/interface_files/nec_norm_rx_pattern.i0000644000175000017500000000203410323405645023526 0ustar numanuma%nodefault; class nec_norm_rx_pattern { public: /*! Returns the frequency in Herz. */ nec_float get_frequency(); /*! Returns the number of theta angles. */ int get_n_theta(); /*! Returns the number of phi angles. */ int get_n_phi(); /*! Returns the first value of theta in degrees. */ nec_float get_theta_start(); /*! Returns the first value of phi angles in degrees. */ nec_float get_phi_start(); /*! Returns the increment for theta in degrees. */ nec_float get_delta_theta(); /*! Returns the increment for phi in degrees. */ nec_float get_delta_phi(); /*! Returns the value of eta in degrees. */ nec_float get_eta(); /*! Returns the axial ratio (no units). */ nec_float get_axial_ratio(); /*! Returns the segment number. */ int get_segment_number(); /*! Return the polarization type. */ string get_type(); /*! Returns the normalization factor in dB. */ nec_float get_norm_factor(); /*! Returns the array of receiving gains not yet normalized. */ real_array get_mag(); }; necpp-1.5.0+cvs20101003/Python/interface_files/nec_near_field_pattern.i0000644000175000017500000000203010323405645024126 0ustar numanumaclass nec_near_field_pattern { public: /*! Returns the frequency in Herz. */ nec_float get_frequency(); /*! Returns the flag indicating whether the result is a near electric or magnetic field pattern. */ int get_nfeh(); /*! Returns the array of x-coordinate in meters of field points. */ vector get_x(); /*! Returns the array of y-coordinate in meters of field points. */ vector get_y(); /*! Returns the array of z-coordinate in meters of field points. */ vector get_z(); /*! Returns the array of x_components of the electric or magnetic field. */ vector get_field_x(); /*! Returns the array of y_components of the electric or magnetic field. */ vector get_field_y(); /*! Returns the array of z_components of the electric or magnetic field. */ vector get_field_z(); /*this private method won't be wrapped, but allow an error in the compilation process to be avoided.*/ private: nec_near_field_pattern(int nfeh); }; necpp-1.5.0+cvs20101003/Python/interface_files/CVS/0000755000175000017500000000000011452152141017734 5ustar numanumanecpp-1.5.0+cvs20101003/Python/interface_files/CVS/Root0000644000175000017500000000007011452152141020577 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/interface_files/CVS/Repository0000644000175000017500000000003511452152141022034 0ustar numanumanecpp/Python/interface_files necpp-1.5.0+cvs20101003/Python/interface_files/CVS/Entries0000644000175000017500000000113211452152141021265 0ustar numanuma/PyNEC.i/1.6/Mon Oct 17 12:47:04 2005// /c_geometry.i/1.3/Thu Oct 13 07:24:21 2005// /math_util.i/1.2/Thu Oct 13 07:24:21 2005// /nec_antenna_input.i/1.4/Thu Oct 13 07:24:21 2005// /nec_context.i/1.3/Thu Oct 13 07:24:21 2005// /nec_ground.i/1.3/Thu Oct 13 07:24:21 2005// /nec_near_field_pattern.i/1.2/Thu Oct 13 07:24:21 2005// /nec_norm_rx_pattern.i/1.3/Thu Oct 13 07:24:21 2005// /nec_radiation_pattern.i/1.4/Thu Oct 13 07:24:21 2005// /nec_structure_currents.i/1.4/Thu Oct 13 07:24:21 2005// /nec_structure_excitation.i/1.4/Thu Oct 13 07:24:21 2005// /safe_array.i/1.1/Thu Sep 29 08:59:06 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/0000755000175000017500000000000011452152141015075 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/python_module/0000755000175000017500000000000011452152141017763 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/python_module/__init__.py0000644000175000017500000000002410325660436022101 0ustar numanumafrom PyNEC import * necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_context.py0000644000175000017500000007076110330425143022660 0ustar numanuma#nec_context.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by Swig import exceptions #class "nec_context" class nec_context(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_context, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_context, name) def __repr__(self): return "<%s.%s; proxy of C++ nec_context instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): _swig_setattr(self, nec_context, 'this', _PyNEC.new_nec_context(*args)) _swig_setattr(self, nec_context, 'thisown', 1) _PyNEC.nec_context_initialize(self) def __del__(self, destroy=_PyNEC.delete_nec_context): try: if self.thisown: destroy(self) except: pass def get_geometry(*args): """ Get the associated c_geometry object c_geometry* get_geometry() """ return _PyNEC.nec_context_get_geometry(*args) def get_antenna_input(*args): """ Get the result antenna_input_parameters specified by index nec_antenna_input* get_input_parameters(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_input_parameters(*args) def get_norm_rx_pattern(*args): """ Get the result norm_rx_pattern specified by index nec_norm_rx_pattern* get_norm_rx_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_norm_rx_pattern(*args) def get_radiation_pattern(*args): """ Get the result radiation_pattern specified by index nec_radiation_pattern* get_radiation_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_radiation_pattern(*args) def get_structure_excitation(*args): """ Get the result structure_excitation specified by index nec_structure_excitation* get_structure_excitation(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_structure_excitation(*args) def get_near_field_pattern(*args): """ Get the result near_field_pattern specified by index nec_near_field_pattern* get_near_field_pattern(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_near_field_pattern(*args) def get_structure_currents(*args): """ Get the result structure_currents specified by index nec_structure_currents* get_structure_currents(int index) \param index The index of the requested result. """ return _PyNEC.nec_context_get_structure_currents(*args) def geometry_complete(*args): """ Indicates the end of the geometry input void geometry_complete(int card_int_1) \param card_int_1 Geometry ground plain flag : card_int_1 = 0 : no ground plane is present. card_int_1 = 1 : indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero). card_int_1 = -1 : indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. """ return _PyNEC.nec_context_geometry_complete(*args) def fr_card(*args): """ Frequency parameters void fr_card(int ifrq, int nfrq, double freq_hz, double del_freq) \param ifrq Determines the type of frequency stepping : in_ifrq = 0 : linear stepping in_ifrq = 1 : mutliplicative stepping. \param nfrq The number of frequency steps. \param freq_hz The frequency first value in Herz. \param del_freq The frequency stepping increment. """ return _PyNEC.nec_context_fr_card(*args) def ld_card(*args): """ Specifies the impedance loading on one segment or a number of segments. Series and parallel RLC circuits can be generated. In addition, a finite conductivity can be specified for segments. void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3) \param itmp1 Determines the type of loading and the expected units which are used : itmp1 = -1 : Nullifies previous loads. itmp1 = 0 : series RLC, input ohms, henries, farads. itmp1 = 1 : parallel RLC, input ohms, henries, farads. itmp1 = 2 : series RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 3 : parallel RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 4 : impedance, input resistance and reactance in ohms. itmp1 = 5 : wire conductivity, input mhos/meter. \param itmp2 The tag number of the segments to be loaded. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment to be loaded. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment to be loaded. if both itmp3 and itmp4 are zero, all segments will be loaded. \param tmp1 If itmp1 = 0, 1, 2, 3 or 4 : the resistance ; if itmp1 = 5 : the wire conductivity ; else tmp1 = 0. \param tmp2 If itmp1 = 0, 1, 2 or 3 : the inductance ; if itmp1 = 4 : the reactance ; else tmp2 = 0. \param tmp3 If itmp1 = 0, 1, 2 or 3 : the capacitance ; else tmp3 = 0. """ return _PyNEC.nec_context_ld_card(*args) def gn_card(*args): """ Ground parameters under the antenna All coordinates are in meters. void gn_card(int ground_type, int rad_wire_count, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param ground_type Ground-type flag : ground_type = -1 : nullifies ground parameters previously used and sets free-space condition. ground_type = 0 : finite ground, reflection coefficient approximation. ground_type = 1 : perfectly conducting ground. ground_type = 2 : finite ground, Sommerfeld/Norton method. \param rad_wire_count The number of radial wires in the ground screen approximation, O implies no ground screen. \param tmp1 Relative dielectric constant for ground in the vicinity of the antenna ; Zero in case of a perfect ground. \param tmp2 Conductivity in mhos/meter of the ground in the vicinity of the antenna ; Zero in the case of a perfect ground. If tmp2 is input as a negative number, the complex dielectric constant Ec = Er -j sigma/omega epsilon is set to EPSR - |SIG|. \param tmp3 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the ground screen ; else the relative dielectric constant of medium 2 (cliff problem). \param tmp4 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the wires used in the screen ; else the conductivity of medium 2 in mhos/meter (cliff problem). \param tmp5 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp6 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance (positive or zero) by which the surface of medium 2 is below medium 1. """ return _PyNEC.nec_context_gn_card(*args) def gd_card(*args): """ Specifies the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the field of surface patches All coordinates are in meters. void gd_card(double tmp1, double tmp2, double tmp3, double tmp4) \param tmp1 The relative dielectric constant of medium 2. \param tmp2 The conductivity of medium 2 in mhos/meter. \param tmp3 The distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp4 The distance (positive or zero) by which the surface of medium 2 is below medium 1. """ return _PyNEC.nec_context_gd_card(*args) def ex_card(*args): """ Specifies the excitation for the structure. The excitation can be voltage sources on the structure, an elementary current source, or a plane-wave incident on the structure. All angles are in degrees. void ex_card(enum excitation_type itmp1, int itmp2, int itmp3, int itmp4, int itmp5, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param excitation_type Determines the type of excitation which is used : excitation_type = O - voltage source (applied-E-field source). excitation_type = 1 - incident plane wave, linear polarization. excitation_type = 2 - incident plane wave, right-hand (thumb along the incident k vector) elliptic polarization. excitation_type = 3 - incident plane wave, left-hand elliptic polarization. excitation_type = 4 - elementary current source. excitation_type = 5 - voltage source (current-slope-discontinuity). \param itmp2 If excitation_type = 0 or 5 : the tag number of the source segment (if itmp1 = 0 absolute segment numbers will be used) ; else if excitation_type = 1, 2 or 3 : number of theta angles desired for the incident plane wave ; else zero. \param itmp3 If excitation_type = 0 or 5 : the rank (among the segments the tag number of which is itmp2) or absolute segment number of the source segment ; else if excitation_type = 1, 2 or 3 : number of phi angles desired for the incident plane wave ; else zero. \param itmp4 If itmp4 = 1 the maximum relative admittance matrix asymmetry for source segment (if excitation_type = 0 or 5) and network connections (whatever excitation_type may be) will be calculated and printed. \param itmp5 If excitation_type = 0 or 5 : tmp3 will be taken under account if itmp5 = 1 ; else zero. \param tmp1 If excitation_type = 0 or 5 : the real part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of theta ; else the x-coordinate of the current source. \param tmp2 If excitation_type = 0 or 5 : the imaginary part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of phi ; else if excitation_type = 4 : the y-coordinate of the current source. \param tmp3 If excitation_type = 0 or 5 : the normalization constant for the impedance printed in the optional impedance table (if tmp3 = 0 the impedance will be normalized to their maximum value) ; else if excitation_type = 1, 2 or 3 : eta in degrees. Eta is the polarization angle defined as the angle between the theta unit vector and the direction of the electric field for linear polarization or the major ellipse axis for elliptical polarization ; else if excitation_type = 4 : the z-coordinate of the current source. \param tmp4 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : theta angle stepping increment. else if excitation_type = 4 : the angle the current source makes with the XY plane. \param tmp5 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : phi angle stepping increment. else if excitation_type = 4 : the angle the projection of the current source on the XY plane makes with the X axis. \param tmp6 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : ratio of minor axis to major axis for elliptic polarization (major axis field strength - 1 V/m). else if excitation_type = 4 : "Current moment" of the source (in amp meter). """ return _PyNEC.nec_context_ex_card(*args) def tl_card(*args): """ Generates a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. All coordinates are in meters. void tl_card(int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param itmp1 Tag number of the segment to which end one of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end one of the transmission line is connected. \param itmp3 Tag number of the segment to which end two of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end two of the transmission line is connected. \param tmp1 The characteristic impedance of the transmission line in ohms. A negative sign in front of the characteristic impedance will act as a flag for generating the transmission line with a 180 degree phase reversal (crossed line). \param tmp2 The length of transmission line. \param tmp3 Real part of the shunt admittance in mhos at end one. \param tmp4 Imaginary part of the shunt admittance in mhos at end one. \param tmp5 Real part of the shunt admittance in mhos at end two \param tmp6 Imaginary part of the shunt admittance in mhos at end two. """ return _PyNEC.nec_context_tl_card(*args) def nt_card(*args): """ Generates a two-port nonradiating, network connected between any two segments in the structure. The characteristics of the network are specified by its short-circuit admittance matrix elements. void nt_card(int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param itmp1 Tag number of the segment to which port one of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port one of the network is connected. \param itmp3 Tag number of the segment to which port two of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port two of the network is connected. \param tmp1 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp2 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp3 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp4 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp5 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. \param tmp6 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. """ return _PyNEC.nec_context_nt_card(*args) def xq_card(*args): """ Causes program execution at points in the data stream where execution is not automatic. Options on the card also allow for automatic generation of radiation patterns in either of two vertical cuts. void xq_card(int itmp1) \param itmp1 Options controlled by itmp1 are: itmp1 = 0 : no patterns requested (normal case). itmp1 = 1 : generates a pattern cut in the XZ plane, i.e., phi = 0 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 2 : generates a pattern cut in the YZ plane, i.e., phi = 90 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 3 : generates both of the cuts described for the values 1 and 2. """ return _PyNEC.nec_context_xq_card(*args) def rp_card(*args): """ Specifies radiation pattern sampling parameters and to cause program execution. Options for a field computation include a radial wire ground screen, a cliff, or surface-wave fields. All coordinates are in meters, angles are in degrees. void rp_card(int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, double theta0, double phi0, double delta_theta, double delta_phi, double radial_distance, double gain_norm) \param calc_mode The mode of calculation for the radiated field : calc_mode = 0 : normal mode. Space-wave fields are computed. An infinite ground plane is included if it has been specified previously on a GN cart; otherwise, antenna is in free space. calc_mode = 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 cart 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 problem) 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 card for further explanation.) calc_mode = 2 : linear cliff with antenna above upper level. Lower medium parameters are as specified for the second medium by the GN or GD card. calc_mode = 3 : circular cliff centered at origin of coordinate system: with antenna above upper level (refer to above). calc_mode = 4 : radial wire ground screen centered at origin. calc_mode = 5 : both radial wire ground screen and linear cliff. calc_mode = 6 : both radial wire ground screen and circular cliff. \param n_theta If calc_mode = 1 : number of values of z ; else number of values of theta. \param n_phi Number of values of phi. \param output_format If calc_mode = 1 : zero ; else controls the output format : output_format = 0 : major axis, minor axis and total gain printed. output_format = 1 : vertical, horizontal ant total gain printed. \param normalization If calc_mode = 1 : zero ; else causes normalized gain for the specified field points to be printed after the standard gain output : normalization = 0 : no normalized gain. normalization = 1 : major axis gain normalized. normalization = 2 : minor axis gain normalized. normalization = 3 : vertical axis gain normalized. normalization = 4 : horizontal axis gain normalized. normalization = 5 : total gain normalized. \param D If calc_mode = 1 : zero else selects either power gain or directive gain for both standard printing and normalization : D = 0 : power gain. D = 1 : directive gain. \param A If calc_mode = 1 : zero else requests calculation of average power gain over the region covered by field points : A = 0 : no averaging. A = 1 : average gain computed. \param theta0 If calc_mode = 1 : initial value of z ; else initial value of theta. \param phi0 Initial value of phi. \param delta_theta If calc_mode = 1 : increment for z ; else increment for theta. \param delta_phi Increment for phi. \param radial_distance If calc_mode = 1 : cylindrical coordinate rho. It must be greater than about one wavelength ; else radial distance (R) of field point from the origin. 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. \param gain_norm Gain normalization factor if normalization has been required by the parameter normalization. If gain_norm = 0 the gain will be normalized to its maximum value. """ return _PyNEC.nec_context_rp_card(*args) def pt_card(*args): """ Controls the printing for currents void pt_card(int itmp1, int itmp2, int itmp3, int itmp4) \param itmp1 Print control flag, specifies the type of format used in printing segment currents : itmp1 = -2 : all currents printed. This it a default value for the program if the card is Omitted. itmp1 = -1 : suppress printing of all wire segment currents. itmp1 = O : current printing will be limited to the segments specified by the next three parameters. itmp1 = 1 : currents are printed by using a format designed for a receiving pattern. Only currents for the segments specified by the next three parameters are printed. itmp1 = 2 : same as for 1 above; in addition, however, the current for one segment will be normalized to its maximum, ant the normalized values along with the relative strength in dB will be printed in a table. If the currents for more than one segment are being printed, only currents from the last segment in the group appear in the normalized table. itmp1 = 3 : only normalized currents from one segment are printed for the receiving pattern case. \param itmp2 The tag number of the segments the currents on which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the current on which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the current on which will be printed. if both itmp3 and itmp4 are zero, all currents will be printed. """ return _PyNEC.nec_context_pt_card(*args) def pq_card(*args): """ Controls the printing for charges void pq_card(int itmp1, int itmp2, int itmp3, int itmp4) \param itmp1 Print control flag : itmp1 = -2 : all charge densities printed. itmp1 = -1 : suppress printing of charge densities. This is the default condition. itmp1 = 0 : print charge densities on segments speficied by the following parameters. \param itmp2 The tag number of the segments the charge densities of which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the charge density of which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the charge density of which will be printed. if both itmp3 and itmp4 are zero, all charge densities will be printed. """ return _PyNEC.nec_context_pq_card(*args) def kh_card(*args): """ Sets the minimum separation distance for use of a time-saving approximation in filling the interaction matrix. void kh_card(double tmp1) \param tmp1 The approximation is used for interactions over distances greater than tmp1 wavelengths. """ return _PyNEC.nec_context_kh_card(*args) def ne_card(*args): """ To request calculation of the near electric field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. void ne_card(int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. """ return _PyNEC.nec_context_ne_card(*args) def nh_card(*args): """ To request calculation of the near magnetic field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. void nh_card(int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta """ return _PyNEC.nec_context_nh_card(*args) def ek_card(*args): """ Controls the use of the extended thin-wire kernal approximation. void ek_card(bool ekflag) \param ekflag Controls the use of the kernel : ekflag = -1 : returns to standard thin-wire kernel (the one used if there's no ek card). ekflag = 0 : initiates use of the extended thin-wire kernel. """ return _PyNEC.nec_context_set_extended_thin_wire_kernel(*args) def cp_card(*args): #return _PyNEC.nec_context_cp_card(*args) error_msg = "The maximum coupling between segments is currently not wrapped, therefore this card has been disabled." raise exceptions.Warning(error_msg) class nec_contextPtr(nec_context): def __init__(self, this): _swig_setattr(self, nec_context, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_context, 'thisown', 0) _swig_setattr(self, nec_context,self.__class__,nec_context) _PyNEC.nec_context_swigregister(nec_contextPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_structure_currents.py0000644000175000017500000003637610330425143025165 0ustar numanuma#nec_structure_currents.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #some utility functions def _get_iptflg(arg0): """ Returns the flag which controls the printing of the currents. """ return _PyNEC.nec_structure_currents_get_iptflg(arg0) def _get_iptflq(arg0): """ Returns the flag which controls the printing of charge densities. """ return _PyNEC.nec_structure_currents_get_iptflq(arg0) def _get_n(arg0): """ Returns the number the wire segments in the geometry. """ return _PyNEC.nec_structure_currents_get_n(arg0) def _get_m(arg0): """ Returns the number of patches in the geometry. """ return _PyNEC.nec_structure_currents_get_m(arg0) #class "nec_structure_currents" class nec_structure_currents(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_structure_currents, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_structure_currents, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_structure_currents instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_structure_currents_get_frequency(*args) def get_current_output_format(*args): """ Returns the output format used for the printing of currents, provided it has been requested. """ _iptflg = _get_iptflg(*args) if _iptflg != -1: if _iptflg == -2 or _iptflg == 0 : return 'Standard output format' elif _iptflg == 1 or _iptflg == 2 : return 'Format designed for a receiving pattern' else : error_msg = "Unknown output format." raise exceptions.Warning(error_msg) def get_current_segment_number(*args) : """ Returns the array of segment numbers for the printing of currrents. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : return _PyNEC.nec_structure_currents_get_current_segment_number(*args) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_tag(*args): """ Returns the array of segment tag numbers for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_tag(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_x(*args): """ Returns the array of x-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_x(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_y(*args): """ Returns the array of y-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_y(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_center_z(*args): """ Returns the array of z-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_center_z(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_segment_length(*args): """ Returns the array of segment lengths in wavelengths for the printing of currents, provided the standard output format has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == -2 or _iptflg == 0 : return _PyNEC.nec_structure_currents_get_current_segment_length(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_theta(*args): """ Returns the array of theta angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == 1 or _iptflg == 2 : return _PyNEC.nec_structure_currents_get_current_theta(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current_phi(*args): """ Returns the array of phi angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : if _iptflg == 1 or _iptflg == 2 : return _PyNEC.nec_structure_currents_get_current_phi(*args) else : error_msg = "Wrong ouptut format." raise exceptions.Warning(error_msg) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_current(*args): """ Returns the array of complex currents in Ampere. """ if _get_n(*args) != 0 : _iptflg = _get_iptflg(*args) if _iptflg != -1 : return _PyNEC.nec_structure_currents_get_current(*args) else : error_msg = "The printing of currents has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_number(*args): """ Returns the array of segment numbers for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_number(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_tag(*args): """ Returns the array of segment tag numbers for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_tag(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_x(*args): """ Returns the array of x-coordinate of segment centers in wavelengths for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_x(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_y(*args): """ Returns the array of y-coordinate of segment centers in wavelengths for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_y(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_center_z(*args): """ Returns the array of z-coordinate of segment centers in wavelengths for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_center_z(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density_segment_length(*args): """ Returns the array of segment lengths in wavelengths for the printing of charge densities. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density_segment_length(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_q_density(*args): """ Returns the array of complex charge densities in Coulomb/meter. """ if _get_n(*args) != 0 : if _get_iptflq(*args) != -1 : return _PyNEC.nec_structure_currents_get_q_density(*args) else : error_msg = "The printing of charge densities has not been requested." raise exceptions.Warning(error_msg); else : error_msg = "There are no wires in the structure." raise exceptions.Warning(error_msg) def get_patch_number(*args): """ Returns the array of patch numbers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_number(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_x(*args): """ Returns the array of x-coordinate in wavelengths of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_x(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_y(*args): """ Returns the array of y-coordinate in wavelengths of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_y(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_center_z(*args): """ Returns the array of z-coordinate in wavelengths of patch centers. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_center_z(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_tangent_vector1(*args): """ Returns the array of complex currents (in Amps/meter) along tangent vector 1 of the patches. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_tangent_vector1(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_tangent_vector2(*args): """ Returns the array of complex currents (in Amps/meter) along tangent vector 2 of the patches. """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_tangent_vector2(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_x(*args): """ Returns the complex x-component of the currents (in Amps/meter). """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_x(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_y(*args): """ Returns the complex y-component of the currents (in Amps/meter). """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_y(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) def get_patch_e_z(*args): """ Returns the complex z-component of the currents (in Amps/meter). """ if _get_m(*args) != 0 : return _PyNEC.nec_structure_currents_get_patch_e_z(*args) else : error_msg = "There are no patches in the structure." raise exceptions.Warning(error_msg) class nec_structure_currentsPtr(nec_structure_currents): def __init__(self, this): _swig_setattr(self, nec_structure_currents, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_structure_currents, 'thisown', 0) _swig_setattr(self, nec_structure_currents,self.__class__,nec_structure_currents) _PyNEC.nec_structure_currents_swigregister(nec_structure_currentsPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_near_field_pattern.py0000644000175000017500000001403610327663212025021 0ustar numanuma#nec_near_field_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #some utility functions def _get_nfeh(arg0): """ Returns the flag indicating whether the result is a near electric or magnetic field pattern. """ return _PyNEC.nec_near_field_pattern_get_nfeh(arg0) #class "near_field_pattern" class nec_near_field_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_near_field_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_near_field_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_near_field_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_near_field_pattern_get_frequency(*args) def get_x(*args): """ Returns the array of x-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_x(*args) def get_y(*args): """ Returns the array of y-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_y(*args) def get_z(*args): """ Returns the array of z-coordinate in meters of field points. """ return _PyNEC.nec_near_field_pattern_get_z(*args) def get_near_field_type(*args): """ Returns the type of near field : either magnetic or electric. """ nfeh = _get_nfeh(*args) if nfeh == 0 : return "near electric field" elif nfeh == 1 : return "near magnetic field" else : error_msg ="Unknown near field type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_e_x(*args): """ Returns the array of x_components in volts / meters of the electric field. """ nfeh = _get_nfeh(*args) if nfeh == 0 : return _PyNEC.nec_near_field_pattern_get_field_x(*args) elif nfeh == 1: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_x' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_e_y(*args): """ Returns the array of y_components in volts / meters of the electric field. """ nfeh = _get_nfeh(*args) if nfeh == 0 : return _PyNEC.nec_near_field_pattern_get_field_y(*args) elif nfeh == 1: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_y' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_e_z(*args): """ Returns the array of z_components in volts / meters of the electric field. """ nfeh = _get_nfeh(*args) if nfeh == 0 : return _PyNEC.nec_near_field_pattern_get_field_z(*args) elif nfeh == 1: error_msg = "This result is a Near Magnetic Field Pattern. Try and get 'h_z' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_h_x(*args): """ Returns the array of x_components in amps / meters of the magnetic field. """ nfeh = _get_nfeh(*args) if nfeh == 1 : return _PyNEC.nec_near_field_pattern_get_field_x(*args) elif nfeh == 0: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_x' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_h_y(*args): """ Returns the array of y_components in amps / meters of the magnetic field. """ nfeh = _get_nfeh(*args) if nfeh == 1 : return _PyNEC.nec_near_field_pattern_get_field_y(*args) elif nfeh == 0: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_y' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) def get_h_z(*args): """ Returns the array of z_components in amps / meters of the magnetic field. """ nfeh = _get_nfeh(*args) if nfeh == 1 : return _PyNEC.nec_near_field_pattern_get_field_z(*args) elif nfeh == 0: error_msg = "This result is a Near Electric Field Pattern. Try and get 'e_z' instead." raise exceptions.Warning(error_msg) else : error_msg = "Unknown near_field_type : " + nfeh.__str__() + "." raise exceptions.Warning(error_msg) class nec_near_field_patternPtr(nec_near_field_pattern): def __init__(self, this): _swig_setattr(self, nec_near_field_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_near_field_pattern, 'thisown', 0) _swig_setattr(self, nec_near_field_pattern,self.__class__,nec_near_field_pattern) _PyNEC.nec_near_field_pattern_swigregister(nec_near_field_patternPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_ground.py0000644000175000017500000001354010325372102022462 0ustar numanuma#nec_ground.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import exceptions #class "nec_ground" class nec_ground(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_ground, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_ground, name) def __repr__(self): return "<%s.%s; proxy of C++ nec_ground instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): _swig_setattr(self, nec_ground, 'this', _PyNEC.new_nec_ground(*args)) _swig_setattr(self, nec_ground, 'thisown', 1) self._ifar=0 def get_relative_dielectric_constant(*args): """ Returns the relative dielectric constant (no units) of the ground medium 1. """ return _PyNEC.nec_ground_get_relative_dielectric_constant(*args) def get_conductivity(*args): """ Returns the conductivity in Siemens/meter of the ground medium 1. """ return _PyNEC.nec_ground_get_conductivity(*args) def get_radial_wire_count(self,*args): """ Returns the number of radial wires in the ground screen approximation, provided it has been used. """ _ifar=self._ifar if _ifar>3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_count(*args) else : error_msg="The count of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_radial_wire_length(self,*args): """ Returns the length of radial wires used in the ground screen approximation - provided this approximation has been used. """ _ifar=self._ifar if _ifar >3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_length(*args) else : error_msg="The length of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_radial_wire_radius(self,*args): """ Returns the radius of radial wires used in the ground screen approximation - provided this approximation has been used. """ _ifar=self._ifar if _ifar >3 and _ifar<7 : return _PyNEC.nec_ground_get_radial_wire_radius(*args) else : error_msg="The radius of radial wires is not available : there is no radial wire ground screen." raise exceptions.Warning(error_msg) def get_cliff_type(self): """ Returns the type of cliff provided there's a cliff problem. """ _ifar=self._ifar if _ifar == 2 or _ifar == 5 : return "Linear" elif _ifar == 3 or _ifar == 6 : return "Circular" else : error_msg = "Unknown cliff type." raise exceptions.Warining(error_msg) def get_cliff_edge_distance(self): """ If there's a cliff problem, returns the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_cliff_edge_distance(self) else : error_msg = "The edge distance of the cliff is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_cliff_height(self): """ If there's a cliff problem, returns the distance (positive or zero) by which the surface of medium 2 is below medium 1. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_cliff_height(self) else : error_msg = "The height of the cliff is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_relative_dielectric_constant2(self): """ If there's a cliff problem, returns the relative dielectric constant (no units) of the ground medium 2. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_relative_dielectric_constant2(self) else : error_msg = "The relative dielectric constant of medium 2 is not available : there is no cliff." raise exceptions.Warning(error_msg) def get_conductivity2(self): """ If there's a cliff problem, returns the conductivity in Siemens/meter of the ground medium 2. """ _ifar=self._ifar if _ifar>1 and _ifar!=4 and _ifar<7 : return _PyNEC.nec_ground_get_conductivity2(self) else : error_msg = "The conductivity of medium 2 is not available : there is no cliff." raise exceptions.Warning(error_msg) class nec_groundPtr(nec_ground): def __init__(self, this): _swig_setattr(self, nec_ground, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_ground, 'thisown', 0) _swig_setattr(self, nec_ground,self.__class__,nec_ground) _PyNEC.nec_ground_swigregister(nec_groundPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_antenna_input.py0000644000175000017500000000553210327663211024037 0ustar numanuma#nec_antenna_input.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG #class "nec_antenna_input" class nec_antenna_input(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_antenna_input, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_antenna_input, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_antenna_input instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_antenna_input_get_frequency(*args) def get_tag(*args): """ Returns the array of segment tag numbers. """ return _PyNEC.nec_antenna_input_get_tag(*args) def get_segment(*args): """ Returns the array of segment numbers. """ return _PyNEC.nec_antenna_input_get_segment(*args) def get_current(*args): """ Returns the array of complex currents in Amperes. """ return _PyNEC.nec_antenna_input_get_current(*args) def get_voltage(*args): """ Returns the array of complex voltages in Volts. """ return _PyNEC.nec_antenna_input_get_voltage(*args) def get_power(*args): """ Returns the array of power in Watts """ return _PyNEC.nec_antenna_input_get_power(*args) class nec_antenna_inputPtr(nec_antenna_input): def __init__(self, this): _swig_setattr(self, nec_antenna_input, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_antenna_input, 'thisown', 0) _swig_setattr(self, nec_antenna_input,self.__class__,nec_antenna_input) _PyNEC.nec_antenna_input_swigregister(nec_antenna_inputPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/PyNEC.py0000644000175000017500000000060510325372102021253 0ustar numanuma# This file replace the Swig generated proxy class. It allows the other python files to be used. from nec_context import * from c_geometry import * from nec_norm_rx_pattern import * from nec_radiation_pattern import * from nec_structure_excitation import * from nec_antenna_input import * from nec_near_field_pattern import * from nec_structure_currents import * from nec_ground import * necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_norm_rx_pattern.py0000644000175000017500000001177310330425143024413 0ustar numanuma#nec_norm_rx_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import numarray import numarray.ma #some utility functions def _get_mag(arg0): """ Returns the array of receiving gain not yet normalized. """ n_theta = _get_n_theta(arg0) n_phi = _get_n_phi(arg0) ar = numarray.reshape(_PyNEC.nec_norm_rx_pattern_get_mag(arg0),(n_theta, n_phi)) ar.transpose() return ar def _get_n_theta(arg0): """ Returns the number of theta angles. """ return _PyNEC.nec_norm_rx_pattern_get_n_theta(arg0) def _get_n_phi(arg0): """ Returns the number of phi angles. """ return _PyNEC.nec_norm_rx_pattern_get_n_phi(arg0) def _get_theta_start(arg0): """ Returns the first value of theta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_theta_start(arg0) def _get_phi_start(arg0): """ Returns the first value of phi angles in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_phi_start(arg0) def _get_delta_theta(arg0): """ Returns the increment for theta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_delta_theta(arg0) def _get_delta_phi(arg0): """ Returns the increment for phi in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_delta_phi(arg0) #class "nec_norm_rx_pattern" class nec_norm_rx_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_norm_rx_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_norm_rx_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_norm_rx_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_norm_rx_pattern_get_frequency(*args) def get_eta(*args): """ Returns the value of eta in degrees. """ return _PyNEC.nec_norm_rx_pattern_get_eta(*args) def get_axial_ratio(*args): """ Returns the axial ratio (no units). """ return _PyNEC.nec_norm_rx_pattern_get_axial_ratio(*args) def get_segment_number(*args): """ Returns the segment number. """ return _PyNEC.nec_norm_rx_pattern_get_segment_number(*args) def get_polarization_type(*args): """ Return the polarization type. """ return _PyNEC.nec_norm_rx_pattern_get_type(*args) def get_norm_factor(*args): """ Returns the normalization factor in Amperes. """ return _PyNEC.nec_norm_rx_pattern_get_norm_factor(*args) def get_coordinates(*args): """ Returns the array of coordinates of the elements of the other arrays : an array of tuples (theta, phi) - in (degrees, degrees). """ n_theta=_get_n_theta(*args) n_phi=_get_n_phi(*args) theta_start = _get_theta_start(*args) delta_theta = _get_delta_theta(*args) phi_start = _get_phi_start(*args) delta_phi = _get_delta_phi(*args) l=[] for i in range(n_phi) : for j in range(n_theta) : l.append((theta_start+j*delta_theta, phi_start+i*delta_phi)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,2)) return ar def get_magnitude(*args): """ Returns the array of magnitude of the normalized receiving gain (no units). """ norm_factor = nec_norm_rx_pattern.get_norm_factor(*args) return _get_mag(*args)/norm_factor def get_gain(self,*args): """ Returns the array of normalized receiving gain in dB. """ mag = self.get_magnitude(*args) gain = 20*numarray.ma.log10(mag) gain.set_fill_value(-999.999) return gain.filled() class nec_norm_rx_patternPtr(nec_norm_rx_pattern): def __init__(self, this): _swig_setattr(self, nec_norm_rx_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_norm_rx_pattern, 'thisown', 0) _swig_setattr(self, nec_norm_rx_pattern,self.__class__,nec_norm_rx_pattern) _PyNEC.nec_norm_rx_pattern_swigregister(nec_norm_rx_patternPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_radiation_pattern.py0000644000175000017500000003604510330425143024700 0ustar numanuma#nec_radiation_pattern.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG import numarray import math import exceptions #some utility functions def _get_gain(arg0): """ Returns the array of gains in dB used in the averaging process. """ return _reshape(_PyNEC.nec_radiation_pattern_get_gain(arg0),arg0) def _get_n_theta(arg0): """ Returns the number of theta angles (or of z values if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_ntheta(arg0) def _get_n_phi(arg0): """ Returns the number of phi angles. """ return _PyNEC.nec_radiation_pattern_get_nphi(arg0) def _get_theta_start(arg0): """ Returns the first value of theta in degrees (or of z in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_theta_start(arg0) def _get_delta_theta(arg0): """ Returns the increment for theta in degrees (or for z in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_delta_theta(arg0) def _get_phi_start(arg0): """ Returns the first value of phi in degrees. """ return _PyNEC.nec_radiation_pattern_get_phi_start(arg0) def _get_delta_phi(arg0): """ Returns the increment for phi in degrees. """ return _PyNEC.nec_radiation_pattern_get_delta_phi(arg0) def _get_wavelength(arg0): """ Returns the wavelength in meters. """ return (299.8*1e6/arg0.get_frequency()) def _get_range(arg0): """ Returns the radial distance in meters ( or the rho cylindrical coordinate in meters if the calculation mode chosen is mode 1 ). """ return _PyNEC.nec_radiation_pattern_get_range(arg0) def _reshape(arg0,arg1): """ Changes the shape of the array arg0 to (n_phi, n_theta) to balance the effect of the typemaps which return flat arrays. """ n_theta=_get_n_theta(arg1) n_phi=_get_n_phi(arg1) return numarray.reshape(arg0,(n_phi,n_theta)) #the following functions precise the results that can be requested from the radiation pattern def _get_ifar(arg0): """ Returns the flag (no units) which indicates the calculation mode chosen. """ return _PyNEC.nec_radiation_pattern_get_ifar(arg0) def _get_rp_normalization(arg0): """ Returns the flag (no units) which indicates the target of the normalization process. """ if _get_ifar(arg0) != 1 : return _PyNEC.nec_radiation_pattern_get_rp_normalization(arg0) else : error_msg = "No computing of gain has been requested." raise exceptions.Warning(error_msg) def _get_rp_output_format(arg0): """ Returns the flag (no units) which indicates the output format chosen. """ if _get_ifar(arg0) != 1 : return _PyNEC.nec_radiation_pattern_get_rp_output_format(arg0) else : error_msg = "No computing of gain has been requested." raise exceptions.Warning(error_msg) def _get_rp_average(arg0): """ Returns the flag (no units) which indicates whether the average gain will be computed or not. """ if _get_ifar(arg0) != 1 : return _PyNEC.nec_radiation_pattern_get_rp_power_average(arg0) else : error_msg = "No computing of gain has been requested." raise exceptions.Warning(error_msg) def _get_rp_ipd(arg0): """ Returns the flag (no units) which indicates the type of gain computed : power or directive gain. """ if _get_ifar(arg0) != 1 : return _PyNEC.nec_radiation_pattern_get_rp_ipd(arg0) else : error_msg = "No computing of gain has been requested." raise exceptions.Warning(error_msg) #class "nec_radiation_pattern" class nec_radiation_pattern(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_radiation_pattern, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_radiation_pattern, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_radiation_pattern instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_radiation_pattern_get_frequency(*args) def get_ground(*args): """ Returns the associated ground object. """ _ifar = _get_ifar(*args) ground = _PyNEC.nec_radiation_pattern_get_ground(*args) ground._ifar = _ifar return ground def get_radial_distance(*args): """ Returns the radial distance in meters provided the calculation mode chosen is different from mode 1. """ if _get_ifar(*args) != 1 : return _get_range(*args) else : error_msg = " The radial distance is not defined for this calculation mode." raise exceptions.Warning(error_msg) def get_radial_attenuation(self): """ Returns the radial attenuation (no units) provided the calculation mode chosen is different from mode 1. """ if (_get_ifar(self) != 1) : _range = _get_range(self) if (_range >= 1.0e-20) : _wavelength = _get_wavelength(self) exrm = 1.0 / _range; exra = _range/ _wavelength; exra = -360.0*(exra - math.floor(exra)); return ("EXP(-JKR)/R : %.5e at phase %.2f degrees" % (exrm, exra)) else : error_msg = "The radial distance value is bellow 1E-20 : the attenuation is ignored." raise exceptions.Warning(error_msg) else : error_msg = "The radial attenuation is not available for this calculation mode." raise exceptions.Warning(error_msg) def get_calculation_mode(*args): """ Returns the calculation mode. """ _ifar = _get_ifar(*args) if _ifar == 0 : return "Normal mode" elif _ifar == 1 : return "A surface wave propagating along the ground is added to the normal space wave. The results appear in a special output format." elif _ifar == 2 : return "Linear cliff with antenna above upper level" elif _ifar == 3 : return "Circular cliff centered at origin of coordinate system: with antenna above upper level" elif _ifar == 4 : return "Radial wire ground screen centered at origin" elif _ifar == 5 : return "Both radial wire ground screen and linear cliff" elif _ifar == 6 : return "Both radial wire ground screen ant circular cliff" else : error_msg = "Unknown calculation mode : " + _ifar.__str__() + "." raise exceptions.Warning(error_msg) def get_coordinates(*args): """ Returns the array of coordinates of the elements of the other arrays : either an array of tuples (r, theta, phi) or of tuples (rho, phi, z) - either in (meters, degrees, degrees) or in (meters, degrees, meters). """ _ifar = _get_ifar(*args) n_theta=_get_n_theta(*args) n_phi=_get_n_phi(*args) theta_start = _get_theta_start(*args) delta_theta = _get_delta_theta(*args) phi_start = _get_phi_start(*args) delta_phi = _get_delta_phi(*args) l=[] if _ifar == 1 : rho = _get_range(*args) for i in range(n_phi) : for j in range(n_theta) : l.append((rho, phi_start+i*delta_phi,theta_start+j*delta_theta)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,3)) else : r = _get_range(*args) for i in range(n_phi) : for j in range(n_theta) : l.append((r, theta_start+j*delta_theta, phi_start+i*delta_phi)) ar = numarray.array(l); ar = numarray.reshape(ar, (n_phi,n_theta,3)) return ar def get_gain_type(*args): """ Returns the type of gain computed : power or directive gain. """ ipd = _get_rp_ipd(*args) if ipd == 0 : return "Power gain" elif ipd == 1 : return "Directive gain" else : error_msg = "Unknown gain type : " + ipd.__str__() + "." raise exceptions.Warning(error_msg) def get_output_format(*args): """ Returns the type of output format. """ _output_format = _get_rp_output_format(*args) if _output_format == 0 : return 'major axis, minor axis and total gain computed' elif _output_format == 1 : return 'vertical, horizontal and total gain computed' else : error_msg = "Unknown output format : " + _output_format.__str__() + "." raise exceptions.Warning(error_msg) def get_gain_vert(*args): """ Returns the array of vertical gains provided the output format chosen is format 1. """ if _get_rp_output_format(*args)==1 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_vert(*args),*args) else : error_msg="The computing of the vertical gain has not been requested. Try and get the 'major axis' gain instead." raise exceptions.Warning(error_msg) def get_gain_horiz(*args): """ Returns the array of horizontal gains in dB provided the output format chosen is format 1. """ if _get_rp_output_format(*args)==1 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_horiz(*args),*args) else : error_msg="The computing of the horizontal gain has not been requested. Try and get the 'minor axis' gain instead." raise exceptions.Warning(error_msg) def get_gain_major_axis(*args): """ Returns the array of major axis gains in dB provided the output format chosen is format 0. """ if _get_rp_output_format(*args)==0 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_vert(*args),*args) else : error_msg="The computing of the 'major axis' gain has not been requested. Try and get the vertical gain instead." raise exceptions.Warning(error_msg) def get_gain_minor_axis(*args): """ Returns the array of minor axis gains in dB provided the output format chosen is format 0. """ if _get_rp_output_format(*args)==0 : return _reshape(_PyNEC.nec_radiation_pattern_get_gain_horiz(*args),*args) else : error_msg="The computing of the 'minor axis' gain has not been requested. Try and get the horizontal gain instead." raise exceptions.Warning(error_msg) def get_gain_tot(*args): """ Returns the array of total gains in dB. """ return _reshape(_PyNEC.nec_radiation_pattern_get_gain_tot(*args),*args) def get_normalization_target(*args): """ Returns the target of the normalization process. """ _rp_normalization = _get_rp_normalization(*args) if _rp_normalization == 0 : return "No normalized gain" elif _rp_normalization == 1 : return "Major axis gain normalized" elif _rp_normalization == 2 : return "minor axis gain normalized" elif _rp_normalization == 3 : return "Vertical gain normalized" elif _rp_normalization == 4 : return "Horizontal gain normalized" elif _rp_normalization == 5 : return "Total gain normalized" else : error_msg="Unknown normalization target : " + _rp_normalization.__str__() + "." raise exceptions.Warning(error_msg) def get_normalization_factor(*args): """ Returns the normalization factor in dB provided a normalization has been requested. """ if (_get_rp_normalization(*args)) != 0 : return _PyNEC.nec_radiation_pattern_get_normalization_factor(*args) else : error_msg = "No normalization has been requested." raise exceptions.Warning(error_msg) def get_normalized_gain(self): """ Returns the array of normalized gains in dB. """ if (_get_rp_normalization(*args)) != 0 : return _get_gain(self)-self.get_normalization_factor() else : error_msg = "No normalization has been requested." raise exceptions.Warning(error_msg) def get_pol_axial_ratio(*args): """ Returns the array of polarization axial ratio (no units). """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_axial_ratio(*args),*args) def get_pol_tilt(*args): """ Returns the array of polarization tilt in degrees. """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_tilt(*args),*args) def get_pol_sense_index(*args): """ Returns the array of polarization sense index (no units). The relationship between the index and the actual sense is the following : 0 : linear 1 : right 2 : left """ return _reshape(_PyNEC.nec_radiation_pattern_get_pol_sense_index(*args),*args) def get_e_theta(*args): """ Returns the array of complex theta-component of electric field E in Volt/meter. """ return _reshape(_PyNEC.nec_radiation_pattern_get_e_theta(*args),*args) def get_e_phi(*args): """ Returns the array of complex phi-component of electric field E in Volt/meter. """ return _reshape(_PyNEC.nec_radiation_pattern_get_e_phi(*args),*args) def get_e_r(*args): """ Returns the array of complex radial-component of electric field E in Volt/meter - only available for the calculation mode 1. """ if _get_ifar(*args) == 1 : return _reshape(_PyNEC.nec_radiation_pattern_get_e_r(*args),*args) else : error_msg="The radial field is not available for this calculation mode." raise exceptions.Warning(error_msg) def get_averaging_mode(*args): """ Returns the averaging mode. """ _rpa=_get_rp_average(*args) if _rpa == 0 : return "No averaging requested" elif _rpa == 1 : return "Averaging of the total gain requested" else : error_msg = "Unknown averaging mode : " + _rpa.__str__() + "." raise exceptions.Warning(error_msg) def get_average_gain(*args): """ Returns the array of average power gains in dB, provided its computation has been requested. """ _rpa=_get_rp_average(*args) if _rpa==1 or _rpa==2 : return _PyNEC.nec_radiation_pattern_get_average_power_gain(*args) else : error_msg="The computing of the average gain has not been requested." raise exceptions.Warning(error_msg) def get_average_solid_angle(*args): """ Returns the solid angle in steradians used in the averaging process, provided the computation of an average gain has been requested. """ _rpa=_get_rp_average(*args) if _rpa==1 or _rpa==2 : return _PyNEC.nec_radiation_pattern_get_average_power_solid_angle(*args) else : error_msg="The computing of the average gain has not been requested." raise exceptions.Warning(error_msg) class nec_radiation_patternPtr(nec_radiation_pattern): def __init__(self, this): _swig_setattr(self, nec_radiation_pattern, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_radiation_pattern, 'thisown', 0) _swig_setattr(self, nec_radiation_pattern,self.__class__,nec_radiation_pattern) _PyNEC.nec_radiation_pattern_swigregister(nec_radiation_patternPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/c_geometry.py0000644000175000017500000002525410327626237022516 0ustar numanuma#c_geometry.py #header generated by Swig import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header genrated by Swig import exceptions #class "c_geometry" class c_geometry(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, c_geometry, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, c_geometry, name) def __repr__(self): return "<%s.%s; proxy of C++ c_geometry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def wire(*args): """ Add a wire to the geometry, All co-ordinates are in meters. void wire(int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad) \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 """ if args[10]>0 and args[11]>0 : return _PyNEC.c_geometry_wire(*args) else: error_msg = 'The last two parameters must both be greater than zero.' raise exceptions.RuntimeError(error_msg) def arc(*args): """ Add an arc to the geometry, All co-ordinates are in meters. void arc( int tag_id, int segment_count, double rada, double ang1, double ang2, double rad ) \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. """ return _PyNEC.c_geometry_arc(*args) def helix(*args): """ Add an helix to the geometry, \remark The helix is a versatile element. For example, to generate a spiral printed circuit antenna, use a helix of zero height. All co-ordinates are in meters. void helix(int tag_id, int segment_count, double s, double hl, double a1, double b1, double a2, double b2, double rad) \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. """ return _PyNEC.c_geometry_helix(*args) def move(*args): """ Move the structure with respect to its coordinate system or reproduces structure in new positions, All co-ordinates are in meters and angles are in degrees. void move( double rox, double roy, double roz, double xs, double ys, double zs, int its, int nrpt, int itgi ) \param rox The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation. \param roy The angle of rotation about Y-axis. \param roz The angle of rotation about Z-axis. \param xs The x component of vector by which the structure is translated with respect to the coordinate system. \param ys The y component of vector by which the structure is translated. \param zs The z component of vector by which the structure is translated. \param its The tag number of the segments that will be moved. If its = 0 then the entire structure is moved. \param nrpt The number of new Structures to be generated. \param itgi The tag number increment. """ return _PyNEC.c_geometry_move(*args) def scale(*args): """ Scale all dimensions of a structure by a constant. void scale( double xw1) \param xw1 All structure dimensions, including wire radius, are multiplied by xw1. """ return _PyNEC.c_geometry_scale(*args) def reflect(*args): """ Reflects partial structure along x,y, or z axes. void reflect_along_axis(int ix, int iy, int iz, int itx) \param ix If ix = 1 then the structure is reflected along X axis. \param iy If iy = 1 then the structure is reflected along Y axis. \param iz If iz = 1 then the structure is reflected along Z axis. \param itx The tag number increment. """ return _PyNEC.c_geometry_reflect(*args) def generate_cylindrical_structure(*args): """ Rotates structure along Z-axis to complete a symmetric structure. void generate_cylindrical_structure(int itx, int nop) \param itx The tag number increment. \param nop The total number of times that the structure is to occur in the cylindrical array. """ return _PyNEC.c_geometry_generate_cylindrical_structure(*args) def arbitrary_shaped_patch(*args): """ Add a arbitrary-shaped patch to the geometry All coordinates are in meters, angles are in radians. void arbitrary_shaped_patch( double ax1, double ay1, double az1, double ax2, double ay2, double az2 ) \param ax1 The x-coordinate of patch center. \param ay1 The y-coordinate of patch center. \param az1 The z-coordinate of patch center. \param ax2 The elevation angle above the X-Y plane of outward normal vector. \param ay2 The azimuth angle from X-axis of outward normal vector. \param az2 The patch area if ny=1. """ return _PyNEC.c_geometry_arbitrary_shaped_patch(*args) def rectangular_patch(*args): """ Add a rectangular patch to the geometry All coordinates are in meters. void rectangular_patch( double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. """ return _PyNEC.c_geometry_rectangular_patch(*args) def triangular_patch(*args): """ Add a triangular patch to the geometry All coordinates are in meters. void triangular_patch( double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. """ return _PyNEC.c_geometry_triangular_patch(*args) def quadrilateral_patch(*args): """ Add a quadrilateral patch to the geometry All coordinates are in meters. void quadrilateral_patch( double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3, double ax4, double ay4, double az4 ) \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. """ return _PyNEC.c_geometry_quadrilateral_patch(*args) def multiple_patch(*args): """ Add a multiple patch to the geometry. All coordinates are in meters. void multiple_patch( int nx, int ny, double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3, double ax4, double ay4, double az4 ) \param nx The rectangular surface is divided into nx patches from corner 1 to corner 2. \param ny The rectangular surface is divided into ny patches from corner 2 to corner 3. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. """ if args[1]>0 and args[2]>0: return _PyNEC.c_geometry_multiple_patch(*args) else: error_msg='The first two parameters should both be greater than zero.' raise exceptions.RuntimeError(error_msg) def __init__(self, *args): _swig_setattr(self, c_geometry, 'this', _PyNEC.new_c_geometry(*args)) _swig_setattr(self, c_geometry, 'thisown', 1) def __del__(self, destroy=_PyNEC.delete_c_geometry): try: if self.thisown: destroy(self) except: pass class c_geometryPtr(c_geometry): def __init__(self, this): _swig_setattr(self, c_geometry, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, c_geometry, 'thisown', 0) _swig_setattr(self, c_geometry,self.__class__,c_geometry) _PyNEC.c_geometry_swigregister(c_geometryPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/nec_structure_excitation.py0000644000175000017500000000571510327663212025467 0ustar numanuma#nec_structure_excitation.py #header generated by SWIG import _PyNEC def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types #end of the header generated by SWIG #class "nec_struture_excitation" class nec_structure_excitation(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, nec_structure_excitation, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, nec_structure_excitation, name) def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ nec_structure_excitation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def get_frequency(*args): """ Returns the frequency in Hertz. """ return _PyNEC.nec_structure_excitation_get_frequency(*args) def get_tag(*args): """ Returns the array of segment tag numbers. """ return _PyNEC.nec_structure_excitation_get_tag(*args) def get_segment(*args): """ Returns the array of segment numbers. """ return _PyNEC.nec_structure_excitation_get_segment(*args) def get_current(*args): """ Returns the array of complex currents in Ampere. """ return _PyNEC.nec_structure_excitation_get_current(*args) def get_voltage(*args): """ Returns the array of complex voltages in Volt. """ return _PyNEC.nec_structure_excitation_get_voltage(*args) def get_power(*args): """ Returns the array of power in Watt. """ return _PyNEC.nec_structure_excitation_get_power(*args) class nec_structure_excitationPtr(nec_structure_excitation): def __init__(self, this): _swig_setattr(self, nec_structure_excitation, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, nec_structure_excitation, 'thisown', 0) _swig_setattr(self, nec_structure_excitation,self.__class__,nec_structure_excitation) _PyNEC.nec_structure_excitation_swigregister(nec_structure_excitationPtr) necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/CVS/0000755000175000017500000000000011452152141020416 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/python_module/CVS/Root0000644000175000017500000000007011452152141021261 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/CVS/Repository0000644000175000017500000000004111452152141022513 0ustar numanumanecpp/Python/PyNEC/python_module necpp-1.5.0+cvs20101003/Python/PyNEC/python_module/CVS/Entries0000644000175000017500000000106711452152141021756 0ustar numanuma/PyNEC.py/1.1/Wed Oct 19 07:22:42 2005// /__init__.py/1.1/Thu Oct 20 09:19:26 2005// /c_geometry.py/1.2/Wed Oct 26 07:13:35 2005// /nec_antenna_input.py/1.2/Wed Oct 26 11:20:41 2005// /nec_context.py/1.3/Fri Oct 28 13:40:51 2005// /nec_ground.py/1.1/Wed Oct 19 07:22:42 2005// /nec_near_field_pattern.py/1.2/Wed Oct 26 11:20:42 2005// /nec_norm_rx_pattern.py/1.3/Fri Oct 28 13:40:51 2005// /nec_radiation_pattern.py/1.3/Fri Oct 28 13:40:51 2005// /nec_structure_currents.py/1.4/Fri Oct 28 13:40:51 2005// /nec_structure_excitation.py/1.2/Wed Oct 26 11:20:42 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/INSTALL0000644000175000017500000000435710334412035016136 0ustar numanumaPyNEC is a Python module wrapped from NEC-2. *** What is required to use PyNEC ? *** You must have Python installed. The versions tested are 2.3 and 2.4 (but it may work with other versions). You must have Numarray installed. The only version tested is 1.3.3 (like above, it may work with other versions). You must have SWIG installed (for build only). The versions tested are 1.3.25 and 1.3.27. (like above, it may work with other versions). If you lack any of these, here are some links that might help you : for Python : http://www.python.org/ for Numarray : http://www.stsci.edu/resources/software_hardware/numarray for SWIG : http://www.swig.org/ *** How can I build it ? *** Linux version : --------------- First generate the makefile. To do so move to the PyNEC directory (let call it ) : $>cd PyNEC Then run the setup script, which will generate the makefile (you may be asked for some pieces of informations) : $>python setup.py Then use this makefile (which should be called "makefile.linux2") to build PyNEC : $>make -f makefile.linux2 To install the module (root privileges are required) : $>make -f makefile.linux2 install The compiler used is g++ (tested version : 3.2.3.) *** How can I test PyNEC ? *** PyNEC is provided with some test scripts (in the test_scripts/ directory). You can try and run them to test PyNEC installation. To further test it, you should install NEC-2, and use the provided Nec files (in the repository test_nec_files/) as input files. These files are the Nec counterparts of the pythons scripts. to get NEC-2 : http://www.physics.otago.ac.nz/research/electronics/nec/ *** Remark *** PyNEC is provided with the sources of NEC-2. But as NEC-2 is still under work, it may evolve. Note that as long as the signature of the different functions wrapped don't get modified, you can replace the sources of NEC-2 (in the directory /wrap/src/) ; then re-install PyNEC (you shouldn't have to re-generate the makefile). If the signature of functions are modified, you'll have to modify the interface file which declares the function(s) concerned. As for the python part, it won't need to be modified as long as the names of functions remain unmodified (python knows nothing about the number and types of the arguments). necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/0000755000175000017500000000000011452152141017623 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_rp.py0000644000175000017500000001066710325660220021667 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example given for the "libnec" (modified in order to have several values for phi and theta) # #nec = nec_create(); #nec_wire(nec, 0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); #nec_wire(nec, 0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); #nec_geometry_complete(nec, 0, 0); # #nec_gn_card(nec, -1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); #nec_ld_card(nec, 5,0,0,0,3.72e7,0.0,0.0); #nec_pt_card(nec, -1, 0, 0, 0); #nec_ex_card(nec, 1, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); #nec_fr_card(nec, 0, 2, 2400.0, 100.0); #nec_rp_card(nec, 0, 3, 2, 0,5,0,0, 90.0, 90.0, 10.0, 10.0, 0.0, 0.0); #gain = nec_get_maximum_gain(nec); print('beginning of the test') import sys print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0) geo.wire(0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0) geo.wire(0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0) geo.wire(0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0) geo.wire(0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0) geo.wire(0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0) geo.wire(0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0) geo.wire(0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0) geo.wire(0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0) geo.wire(0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0) #end of the geometry input context.geometry_complete(0) #add a "gn" card to specify the ground parameters context.gn_card(-1, 0, 0, 0, 0, 0, 0, 0) #add a "ld" card for "loading" context.ld_card(5, 0, 0, 0, 3.72e7, 0.0, 0.0) #add a "pt" card to ask for Control for Current on Wires to be printed context.pt_card(0, 0, 1, 10) #add a "ex" card to specify an excitation context.ex_card(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) #add a "fr" card to specify the frequency context.fr_card(0, 2, 2400.0e6, 100.0e6) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 3, 2, 0, 5, 0, 0, 90.0, 90.0, 10.0, 10.0, 1.0, 0.0) print('end of card input\n') print('get the radiation_pattern\n') rp = context.get_radiation_pattern(0) print('get the radial attenuation') print(rp.get_radial_attenuation()) print('\nget the calculation mode') print(rp.get_calculation_mode()) print('\nget the coordinates (here tuples (theta, phi)') print(rp.get_coordinates()) print('\nget the type of gain computed') print(rp.get_gain_type()) print('\nget the the output format') print(rp.get_output_format()) print('\ntry and get the array of horizontal gains') try: print(rp.get_gain_horiz()) print('ERROR - the output format chosen is "major axis, minor axis and total gain printed" !') sys.exit(-1) except Warning, msg: print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the ouptut format is "major axis, minor axis and total gain printed"') print('\nget the array of minor axis gains') print(rp.get_gain_minor_axis()) print('\nget the array of total gains') print(rp.get_gain_tot()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_rp.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_surface_patch_currents.py0000644000175000017500000000725210334412035025775 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example6.nec # #CECYLINDER WITH ATTACHED WIRES #SP 0 0 10 0 7.3333 0. 0. 38.4 #SP 0 0 10 0 0. 0. 0. 38.4 #SP 0 0 10 0 -7.3333 0. 0. 38.4 #GM 0 1 0. 0. 30. #SP 0 0 6.89 0. 11. 90. 0. 44.88 #SP 0 0 6.89 0. -11. -90. 0. 44.88 #GR 0 6 #SP 0 0 0. 0. 11. 90. 0. 44.89 #SP 0 0 0. 0. -11. -90. 0. 44.89 #GW 1 4 0. 0. 11. 0. 0. 23. .1 #GW 2 5 10. 0. 0. 27.6 0. 0. .2 #GS 0 0 .01 #GE #FR 0 1 0 0 465.84 #CP 1 1 2 1 #EX 0 1 1 0 1. #RP 0 73 1 1000 0. 0. 5. 0. #EX 0 2 1 0 1. #XQ #EN print('beginning of the test') import sys print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, 7.3333, 0., 0., 38.4) #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, 0, 0., 0., 38.4) #add a patch to the geometry geo.arbitrary_shaped_patch(10, 0, -7.3333, 0., 0., 38.4) #move the structure (here the structure is copied, its copy is rotated by 30 degrees about Z-axis) geo.move(0, 0, 30, 0, 0, 0, 0, 1, 0) #add a patch to the geometry geo.arbitrary_shaped_patch(6.89, 0., 11., 90., 0., 44.88) #add a patch to the geometry geo.arbitrary_shaped_patch(6.89, 0., -11., -90., 0., 44.88) #ask for a cylindrical structure to be generated from the existing structure geo.generate_cylindrical_structure(0, 6) #add a patch to the geometry geo.arbitrary_shaped_patch(0, 0, 11, 90, 0, 44.89) #add a patch to the geometry geo.arbitrary_shaped_patch(0, 0, -11, -90, 0, 44.89) #add a wire to the geometry geo.wire(1, 4, 0, 0, 11, 0, 0, 23, .1, 1, 1) #add a wire to the geometry geo.wire(2, 5, 10, 0, 0, 27.6, 0, 0, .2, 1, 1) #scale all the structure dimensions by a constant geo.scale(0.01) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 1, 465.84e6, 0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 73, 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0) #add a "xq" card to force the simulation execution context.xq_card(0) print('end of card input\n') print('get the structure currents (here there are currents in wire segments and surface patch currents\n') sc = context.get_structure_currents(0) print('get the array of segment numbers for the printing of currents in wire segments') print(sc.get_current_segment_number()) print('\nget the array of currents in wire segments') print(sc.get_current()) print('\ntry and get the array of charge densities') try: print(sc.get_q_density()) print('ERROR - the printing of charge densities has not been requested !') sys.exit(-1) except Warning, msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the printing of charge densities has not been requested') print('\nget the patch numbers') print(sc.get_patch_number()) print('\nget the array of x-component of currents in patches') print(sc.get_patch_e_x()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_surface_patch_currents.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_structure_currents.py0000644000175000017500000001205610325660220025225 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example3.nec # #CMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND #CM EXTENDED THIN WIRE KERNEL USED #CM 1. PERFECT GROUND #CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING #CE PATTERN CALCULATIONS #GW 0 9 0. 0. 2. 0. 0. 7. .3 #GE 1 #EK #PT 0 0 3 4 #LD 0 0 0 0 1000 1 1 #FR 0 1 0 0 30. #EX 0 0 5 0 1. #GN 1 #RP 0 10 2 1301 0. 0. 10. 90. #GN 0 0 0 0 6. 1.000E-03 #RP 0 10 2 1301 0. 0. 10. 90. #RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 #EX 2 10 1 0 0. 0. 0.1 10. 0. 0.6 #PT 2 0 5 5 #XQ #EN print('beginning of the test') import sys print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 9, 0, 0, 2, 0, 0, 7, .3, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ek" card to initiate use of the extended thin-wire kernal context.ek_card(1) #add a "pt" card to control the printing of currents on wire segments context.pt_card(0, 0, 3, 4) #add a "ld" card for "loading" context.ld_card(0, 0, 0, 0, 1000, 1, 1) #add a "fr" card to specify the frequency context.fr_card(0, 1, 30e6, 0) #add a "ex" card to specify an excitation context.ex_card(0, 0, 5, 0, 0, 1, 0, 0, 0, 0, 0) #add a "gn" card to specify the ground parameters context.gn_card(1, 0, 0, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 10, 2, 1, 3, 0, 1, 0, 0, 10.0, 90.0, 0.0, 0.0) #add a "gn" card to specify the ground parameters context.gn_card(0, 0, 6, 1.000e-3, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 10, 2, 1, 3, 0, 1, 0, 0, 10.0, 90.0, 0.0, 0.0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(1, 10, 1, 0, 0, 0, 0, 1, 0, 2, 0, 1.000e5, 0.0) #add a "ex" card to specify an excitation context.ex_card(2, 10, 1, 0, 0, 0, 0, 0.1, 10, 0, 0.6) #add a "pt" card to control the printing of currents on wire segments context.pt_card(2, 0, 5, 5) #add a "xq" card to force the simulation execution context.xq_card(0) print('end of card input\n') print('get the currents from the first PT card (here there are nothing but the currents in wires printed in the standard output format)\n') sc = context.get_structure_currents(0) print('get the output format for the currents') print(sc.get_current_output_format()) print('\ntry and get the array of theta angles for the printing of currents') try: print(sc.get_current_theta()) print('ERROR - the output format used is the standard one !') sys.exit(-1) except Warning, msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the output format used is the standard one') print('\nget the array of z-coordinate of segment centers for the printing of currents') print(sc.get_current_segment_center_z()) print('\nget the array of complex current in wire segments') print(sc.get_current()) print('\ntry and get the array of wire segment numbers for the printing of charge densities') try: print(sc.get_q_density_segment_number()) print('ERROR - the printing of charge densities has not been requested !') except Warning,msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the printing of charge densities has not been requested') print('\ntry and get the array of patch numbers') try: print(sc.get_patch_number()) print('ERROR - there are no patches !') except Warning,msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as there are no patches') print('\n\nget the currents from the second PT card - but it is the third currents result as there were 2 frequencies for the first one\n') sc2 = context.get_structure_currents(2) print('get the output format for the currents') print(sc2.get_current_output_format()) print('\nget the array of theta angles for the printing of currents') print(sc2.get_current_theta()) print('\ntry and get the array of x-coordinate of segment centers for the printing of currents') try: print(sc2.get_current_segment_center_x()) print('ERROR - Wrong output format !') except Warning,msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the output format used is the one designed for a receiving pattern') print('\nget the array of complex current in wire segments') print(sc2.get_current()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_structure_currents.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_ne_nh.py0000644000175000017500000000414510325660220022327 0ustar numanuma#dipole_anim.nec # #CM Simple dipole, with calculation of currents, charges and near field. #CE #GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 #GE #EX 0 1 11 00 1 0 #PQ 0, 0 #NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #RP 0, 19, 36, 1000, 0, 0, 10, 10 #EN print('beginning of the test') import sys print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(1, 21, 0, -0.25, 0.0, 0, 0.25, 0.0, 0.001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 11, 0, 0, 1, 0, 0, 0, 0, 0) #add a "pq" card to ask for the charge densities to be computed context.pq_card(0, 0, 0, 0) #add a "ne" card to ask for the "near electric field pattern" to be computed context.ne_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "nh" card to ask for the "near magnetic field pattern" to be computed context.nh_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 19, 36, 1, 0, 0, 0, 0, 0, 10, 10, 0, 0) #get the currents sc = context.get_structure_currents(0) print('end of card input\n') print('get the near electric and magnetic field\n') ne = context.get_near_field_pattern(0) nh = context.get_near_field_pattern(1) print('try and get the array of z-coordinates of electric field from the near magnetic field') try: print(nh.get_e_x()) print('ERROR - the result is a magnetic field !') sys.exit(-1) except Warning, msg : print('Warning : '+msg.__str__()) print('SUCCESS - an exception has been raised as the result is a magnetic field\n') print('get the array of x-coordinates of magnetic field from the near magnetic field') print(nh.get_h_x()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_ne_nh.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_nrp.py0000644000175000017500000000342010325660220022032 0ustar numanuma#example3.nec (modified) # #CMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND #CM EXTENDED THIN WIRE KERNEL USED #CM 1. PERFECT GROUND #CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING #CE PATTERN CALCULATIONS #GW 0 9 0. 0. 2. 0. 0. 7. .3 #GE 1 #EK #FR 0 1 0 0 30. #EX 0 0 5 0 1. #GN 1 #RP 0 10 2 1301 0. 0. 10. 90. #GN 0 0 0 0 6. 1.000E-03 #RP 0 10 2 1301 0. 0. 10. 90. #RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 #EX 1 10 1 0 0. 0. 0. 10. #PT 2 0 5 5 #XQ #EN print('beginning of the test') print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(0, 9, 0, 0, 2, 0, 0, 7, .3, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ek" card to initiate use of the extended thin-wire kernal context.ek_card(1) #add a "fr" card to specify the frequency context.fr_card(0, 1, 30e6, 0) #add a "gn" card to specify the ground parameters context.gn_card(0, 0, 6., 0.001, 0, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(1, 10, 3, 0, 0, 0, 0, 0, 10, 20, 0) #add a "pt" card to control the printing of currents on wire segments context.pt_card(2, 0, 5, 5) #add a "xq" card to force the simulation execution context.xq_card(0) print('end of card input\n') print('get the norm_rx_pattern\n') nrp = context.get_norm_rx_pattern(0) print('get the array of coordinates (tuples (theta, phi))') print(nrp.get_coordinates()) print('\nget the array of normalized receiving gains') print(nrp.get_gain()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_nrp.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_se.py0000644000175000017500000001016410325660220021645 0ustar numanuma#instructions to compile : # #swig -c++ -python PyNEC.i #g++ -c nec_context.cpp PyNEC_wrap.cxx -I/usr/local/include/python2.4 -I/usr/local/lib/python2.4/config -DHAVE_CONFIG_H #g++ -shared -lstdc++ nec_context.o nec_output.o c_plot_card.o c_geometry.o misc.o nec_exception.o nec_ground.o c_ggrid.o matrix_algebra.o nec_radiation_pattern.o nec_structure_currents.o c_evlcom.o PyNEC_wrap.o -o _PyNEC.so #example5.nec (modified because there was a little bug in the last TL card...) # #CM 12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE #CM 78 SEGMENTS. SIGMA=O/L RECEIVING AND TRANS. PATTERNS. #CM DIPOLE LENGTH TO DIAMETER RATIO=150. #CE TAU=0.93. SIGMA=0.70. BOOM IMPEDANCE=50. OHMS. #GW 1 5 0.0000 -1.0000 0.0000000 0.00000 1.0000 0.000 .00667 #GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717 #GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771 #GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829 #GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891 #GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958 #GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103 #GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108 #GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191 #GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281 #GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377 #GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481 #GE #FR 0 0 0 0 46.29 0. #TL 1 3 2 3 -50. #TL 2 3 3 3 -50. #TL 3 3 4 3 -50. #TL 4 3 5 3 -50. #TL 5 3 6 4 -50. #TL 6 4 7 4 -50. #TL 7 4 8 4 -50. #TL 8 4 9 4 -50. #TL 9 4 10 4 -50. #TL 10 4 11 5 -50. #TL 11 5 12 5 -50. 0. 0. 0. .02 #EX 0 1 3 10 1 0 #RP 0 37 1 1110 90. 0. -5. 0. #EN print('beginning of the test') print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec_context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(1, 5, 0, -1, 0, 0, 1, 0, .00667, 1, 1) geo.wire(2, 5, -.7527, -1.0753,0, -.7527, 1.0753, 0, .00717, 1, 1) geo.wire(3, 5, -1.562, -1.1562, 0, -1.562, 1.1562, 0, .00771, 1, 1) geo.wire(4, 5, -2.4323, -1.2432, 0, -2.4323, 1.2432, 0,.00829, 1, 1) geo.wire(5, 5, -3.368, -1.3368, 0, -3.368, 1.3368, 0, .00891, 1, 1) geo.wire(6, 7, -4.3742, -1.4374, 0, -4.3742, 1.4374, 0, .00958, 1, 1) geo.wire(7, 7, -5.4562, -1.5456, 0, -5.4562, 1.5456, 0, .0103, 1, 1) geo.wire(8, 7, -6.6195, -1.6619, 0, -6.6195, 1.6619, 0, .01108, 1, 1) geo.wire(9, 7, -7.8705, -1.787, 0, -7.8705, 1.787, 0, .01191, 1, 1) geo.wire(10, 7, -9.2156, -1.9215, 0, -9.2156, 1.9215, 0, .01281, 1, 1) geo.wire(11, 9, -10.6619, -2.0662, 0, -10.6619, 2.0662, 0, .01377, 1, 1) geo.wire(12, 9, -12.2171, -2.2217, 0, -12.2171, 2.2217, 0,.01481, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 0, 46.29e6, 0) #add "tl" cards to generate transmission lines context.tl_card(1, 3, 2, 3, -50, 0.7527, 0, 0, 0, 0) context.tl_card(2, 3, 3, 3, -50, 0.8093, 0, 0, 0, 0) context.tl_card(3, 3, 4, 3, -50, 0.8703, 0, 0, 0, 0) context.tl_card(4, 3, 5, 3, -50, 0.9357, 0, 0, 0, 0) context.tl_card(5 ,3 ,6, 4, -50, 1.0062, 0, 0, 0, 0) context.tl_card(6, 4, 7, 4, -50, 1.082, 0, 0, 0, 0) context.tl_card(7, 4, 8, 4, -50, 1.1633, 0, 0, 0, 0) context.tl_card(8, 4, 9, 4, -50, 1.251, 0, 0, 0, 0) context.tl_card(9, 4, 10, 4, -50, 1.3451, 0, 0, 0, 0) context.tl_card(10, 4 ,11 , 5, -50, 1.4463, 0, 0, 0, 0) context.tl_card(11, 5, 12, 5, -50, 1.5552, 0, 0, 0, 0.02) #add a "ex" card to specify an excitation context.ex_card(0, 1, 3, 1, 0, 1, 0, 0, 0, 0, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 37, 1, 1, 1, 1, 0, 90, 0, -5, 0, 0, 0) print('end of card input\n') print('get structure excitation\n') se = context.get_structure_excitation(0) print('get the frequency') print(se.get_frequency()) print('\nget the array of segment numbers') print(se.get_segment()) print('\nget the array of complex voltages') print(se.get_voltage()) print('\nget the array of powers') print(se.get_power()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_se.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_rp2.py0000644000175000017500000000343110332115040021731 0ustar numanuma#CMAdapted from the example of the "libnec" #CE #GW 0 36 -0.0001 -0.0001 -0.0001 -0.0002 -0.0002 -0.0001 0.001 #GE #GN 2 0 0 0 100 50 25 10 0.7 0.6 #LD 5 0 0 0 3.72e7 #FR 0 1 0 0 2400. #PT -1 #EX 5 0 1 0 0. 0. 0. 0. 0. 0. #RP 2 3 2 0500 90. 90. 10. 10. 0. 0. #EN print('beginning of the test') print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add wires to the geometry geo.wire(0, 36, -0.0001, -0.0001, -0.0001, -0.0002, -0.0002, -0.0001, 0.001, 1.0, 1.0) #end of the geometry input context.geometry_complete(0) #add a "gn" card to specify the ground parameters context.gn_card(2, 0, 100., 50., 25., 10., 0.7, 0.6) #add a "ld" card for "loading" context.ld_card(5, 0, 0, 0, 3.72e7, 0.0, 0.0) #add a "pt" card to ask for Control for Current on Wires to be printed context.pt_card(-1, 0, 0, 0) #add a "ex" card to specify an excitation context.ex_card(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) #add a "fr" card to specify the frequency context.fr_card(0, 2, 2400.0e6, 0) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(2, 3, 2, 0, 5, 0, 0, 90.0, 90.0, 10.0, 10.0, 0.0, 0.0) print('end of card input\n') print('get the radiation pattern') rp = context.get_radiation_pattern(0) print('get the associated ground\n') gr = rp.get_ground() print('get the relative dielectric constant of medium 2') print(gr.get_relative_dielectric_constant2()) print('\nget the cliff edge distance') print(gr.get_cliff_edge_distance()) print('\nget the cliff type') print(gr.get_cliff_type()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_rp2.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_ai.py0000644000175000017500000000311510334412035021624 0ustar numanuma#example2.nec (modified in order to get several excitations) : # #CMEXAMPLE 2. CENTER FED LINEAR ANTENNA. #CM CURRENT SLOPE DISCONTINUITY SOURCE. #CM 1. THIN PERFECTLY CONDUCTING WIRE #CE 2. THIN ALUMINUM WIRE #GW 0 8 0. 0. -.25 0. 0. .25 .00001 #GE #FR 0 3 0 0 200. 50. #EX 5 0 5 1 1. 0. 50. #EX 5 0 4 1 1. 0. 50. #XQ #EN print('beginning of the test') print('import of the module') from PyNEC import * print('begininning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(0, 8, 0, 0, -.25, 0, 0, .25, .00001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "fr" card to specify the frequency context.fr_card(0, 3, 200e6, 50e6) #add a "ex" card to specify an excitation context.ex_card(5, 0, 5, 0, 0, 1, 0, 0, 0, 0, 0) #add an other "ex" card to specify a second excitation context.ex_card(5, 0, 4, 0, 0, 1, 0, 0, 0, 0, 0) #add a "xq" card to force the simulation execution context.xq_card(0) print('end of card input\n') print('get the first antenna_input (there are several ones, each one corresponding to one single frequency)\n') ai=context.get_antenna_input(0) print('get some of the available results') print('get the array of segments numbers') print(ai.get_segment()) print('\nget the array of complex currents') print(ai.get_current()) print('\nget the array of powers') print(ai.get_power()) print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_ai.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/test_charge_densities.py0000644000175000017500000000426510325660220024543 0ustar numanuma#dipole_anim.nec # #CM Simple dipole, with calculation of currents, charges and near field. #CE #GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 #GE #EX 0 1 11 00 1 0 #PQ 0, 0 #NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 #RP 0, 19, 36, 1000, 0, 0, 10, 10 #EN print('beginning of the test') import sys print('import of the module') from PyNEC import * print('beginning of card input') #creation of a nec context context=nec_context() #get the associated geometry geo = context.get_geometry() #add a wire to the geometry geo.wire(1, 21, 0, -0.25, 0.0, 0, 0.25, 0.0, 0.001, 1, 1) #end of the geometry input context.geometry_complete(0) #add a "ex" card to specify an excitation context.ex_card(0, 1, 11, 0, 0, 1, 0, 0, 0, 0, 0) #add a "pq" card to ask for the charge densities to be computed context.pq_card(0, 0, 0, 0) #add a "ne" card to ask for the "near electric field pattern" to be computed context.ne_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "nh" card to ask for the "near magnetic field pattern" to be computed context.nh_card(0, 1, 20, 20, 0, 0.05, 0.05, 0, 0.05, 0.05) #add a "rp" card to specify radiation pattern sampling parameters and to cause program execution context.rp_card(0, 19, 36, 1, 0, 0, 0, 0, 0, 10, 10, 0, 0) print('end of card input\n') print('get the currents (here the currents and charge densities datas)\n') sc = context.get_structure_currents(0) print('get the array of length of the segment wires for the printing of currents') print(sc.get_current_segment_length()) print('\nget the array of y-coordinates of segment centers for the printing of charge densities') print(sc.get_q_density_segment_center_y()) print('\ntry and get the array of x-coordinates of patch centers') try: print(sc.get_patch_center_x()) print('ERROR - there are no patches !') sys.exit(-1) except Warning, msg : print('Warning : '+msg.__str__()) print("SUCCESS - an exception is raised as there are no patches their datas can't be requested") print('\nend of the test - you can compare the results with the ones provided by NEC-2 using test_charge_densities.nec as the input file\n') necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/CVS/0000755000175000017500000000000011452152141020256 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/CVS/Root0000644000175000017500000000007011452152141021121 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/CVS/Repository0000644000175000017500000000004011452152141022352 0ustar numanumanecpp/Python/PyNEC/test_scripts necpp-1.5.0+cvs20101003/Python/PyNEC/test_scripts/CVS/Entries0000644000175000017500000000067411452152141021621 0ustar numanuma/test_ai.py/1.3/Wed Nov 9 15:22:05 2005// /test_charge_densities.py/1.1/Thu Oct 20 09:17:04 2005// /test_ne_nh.py/1.1/Thu Oct 20 09:17:04 2005// /test_nrp.py/1.1/Thu Oct 20 09:17:04 2005// /test_rp.py/1.1/Thu Oct 20 09:17:04 2005// /test_rp2.py/1.2/Wed Nov 2 10:51:12 2005// /test_se.py/1.1/Thu Oct 20 09:17:04 2005// /test_structure_currents.py/1.1/Thu Oct 20 09:17:04 2005// /test_surface_patch_currents.py/1.2/Wed Nov 9 15:22:05 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/0000755000175000017500000000000011452152141020063 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_ne_nh.nec0000644000175000017500000000052010325372102022674 0ustar numanumaCM Simple dipole, with calculation of currents, charges and near field. CE GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 GE EX 0 1 11 00 1 0 PQ 0, 0 NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 RP 0, 19, 36, 1000, 0, 0, 10, 10 EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_ai.nec0000644000175000017500000000016210332115040022172 0ustar numanumaCMEXAMPLE 2. MODIFIE CE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE FR 0 1 0 0 200. 50. EX 5 0 5 1 1. 0. 0. XQ EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_charge_densities.nec0000644000175000017500000000052010325372102025105 0ustar numanumaCM Simple dipole, with calculation of currents, charges and near field. CE GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 GE EX 0 1 11 00 1 0 PQ 0, 0 NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 RP 0, 19, 36, 1000, 0, 0, 10, 10 EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_structure_currents.nec0000644000175000017500000000101510325372102025572 0ustar numanumaCMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND CM EXTENDED THIN WIRE KERNEL USED CM 1. PERFECT GROUND CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING CE PATTERN CALCULATIONS GW 0 9 0. 0. 2. 0. 0. 7. .3 GE 1 EK PT 0 0 3 4 LD 0 0 0 0 1000 1 1 FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 10 2 1301 0. 0. 10. 90. GN 0 0 0 0 6. 1.000E-03 RP 0 10 2 1301 0. 0. 10. 90. RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 EX 2 10 1 0 0. 0. 0.1 10. 0. 0.6 PT 2 0 5 5 XQ EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_nrp.nec0000644000175000017500000000023310325372102022405 0ustar numanumaCMEXAMPLE 3. modified CE GW 0 9 0. 0. 2. 0. 0. 7. .3 GE 1 EK FR 0 1 0 0 30. GN 0 0 0 0 6. 1.000E-03 EX 1 10 3 0 0. 0. 0. 10. 20. PT 2 0 5 5 XQ EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_se.nec0000644000175000017500000000234410325372102022222 0ustar numanumaCM 12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE CM 78 SEGMENTS. SIGMA=O/L RECEIVING AND TRANS. PATTERNS. CM DIPOLE LENGTH TO DIAMETER RATIO=150. CE TAU=0.93. SIGMA=0.70. BOOM IMPEDANCE=50. OHMS. GW 1 5 0.0000 -1.0000 0.0000000 0.00000 1.0000 0.000 .00667 GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717 GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771 GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829 GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891 GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958 GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103 GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108 GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191 GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281 GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377 GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481 GE FR 0 1 0 0 46.29 TL 1 3 2 3 -50. 0. 0. 0. 0. 0. TL 2 3 3 3 -50. 0. 0. 0. 0. 0. TL 3 3 4 3 -50. 0. 0. 0. 0. 0. TL 4 3 5 3 -50. 0. 0. 0. 0. 0. TL 5 3 6 4 -50. 0. 0. 0. 0. 0. TL 6 4 7 4 -50. 0. 0. 0. 0. 0. TL 7 4 8 4 -50. 0. 0. 0. 0. 0. TL 8 4 9 4 -50. 0. 0. 0. 0. 0. TL 9 4 10 4 -50. 0. 0. 0. 0. 0. TL 10 4 11 5 -50. 0. 0. 0. 0. 0. TL 11 5 12 5 -50. 1.5552 0. 0. 0. .02 EX 0 1 3 10 1 0 RP 0 37 1 1110 90. 0. -5. 0. EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_rp2.nec0000644000175000017500000000040110325372102022306 0ustar numanumaCMAdapted from the example of the "libnec" CE GW 0 36 -0.0001 -0.0001 -0.0001 -0.0002 -0.0002 -0.0001 0.001 GE GN 2 0 0 0 100 50 25 10 0.7 0.6 LD 5 0 0 0 3.72e7 FR 0 1 0 0 2400. PT -1 EX 5 0 1 0 0. 0. 0. 0. 0. 0. RP 2 3 2 0500 90. 90. 10. 10. 0. 0. EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_rp.nec0000644000175000017500000000124510325372102022233 0ustar numanumaCMAdapted from the example of the "libnec" CE GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE GN -1 LD 5 0 0 0 3.72e7 FR 0 2 0 0 2400. 100 PT -1 EX 1 1 1 0 0 0 0 0 0 0 RP 0 3 2 0500 90. 90. 10. 10. 1. 0. EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/test_surface_patch_currents.nec0000644000175000017500000000066510325372102026353 0ustar numanumaCECYLINDER WITH ATTACHED WIRES SP 0 0 10 0 7.3333 0. 0. 38.4 SP 0 0 10 0 0. 0. 0. 38.4 SP 0 0 10 0 -7.3333 0. 0. 38.4 GM 0 1 0. 0. 30. SP 0 0 6.89 0. 11. 90. 0. 44.88 SP 0 0 6.89 0. -11. -90. 0. 44.88 GR 0 6 SP 0 0 0. 0. 11. 90. 0. 44.89 SP 0 0 0. 0. -11. -90. 0. 44.89 GW 1 4 0. 0. 11. 0. 0. 23. .1 GW 2 5 10. 0. 0. 27.6 0. 0. .2 GS 0 0 .01 GE FR 0 1 0 0 465.84 CP 1 1 2 1 EX 0 1 1 0 1. RP 0 73 1 1000 0. 0. 5. 0. EX 0 2 1 0 1. XQ EN necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/CVS/0000755000175000017500000000000011452152141020516 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/CVS/Root0000644000175000017500000000007011452152141021361 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/CVS/Repository0000644000175000017500000000004211452152141022614 0ustar numanumanecpp/Python/PyNEC/test_nec_files necpp-1.5.0+cvs20101003/Python/PyNEC/test_nec_files/CVS/Entries0000644000175000017500000000070511452152141022054 0ustar numanuma/test_ai.nec/1.2/Wed Nov 2 10:51:12 2005// /test_charge_densities.nec/1.1/Wed Oct 19 07:22:42 2005// /test_ne_nh.nec/1.1/Wed Oct 19 07:22:42 2005// /test_nrp.nec/1.1/Wed Oct 19 07:22:42 2005// /test_rp.nec/1.1/Wed Oct 19 07:22:42 2005// /test_rp2.nec/1.1/Wed Oct 19 07:22:42 2005// /test_se.nec/1.1/Wed Oct 19 07:22:42 2005// /test_structure_currents.nec/1.1/Wed Oct 19 07:22:42 2005// /test_surface_patch_currents.nec/1.1/Wed Oct 19 07:22:42 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/setup.py0000644000175000017500000002114010334412035016604 0ustar numanumaimport sys import os print('Installation start') #================================================================================================================================================================================== #get the platform used platform = sys.platform #================================================================================================================================================================================== #checks the Numarray installation print('\nNumarray installation check...') try: from numarray import * except: print('FAILURE - PyNEC requires Numarray to be installed. Please install Numarrray first.') print('Installation aborted') sys.exit(-1) print('SUCCESS - Numarray seems to be installed.') #================================================================================================================================================================================== #Detects the Python version number print('\nDetecting Python version number...') print(sys.version) python_version = sys.version[:3] if python_version != '2.3' and python_version != '2.4' : print('WARNING - This python version has not yet been tested. Try and move to Python version 2.3 or 2.4 if you encounter problems') api_version = sys.api_version if api_version != 1012 : print('WARNING - This api version has not yet been tested. Try and move to API version 1012 if you encounter problems') #================================================================================================================================================================================== #Looks for the python "include path" print('\nLooking for the Python include path...') def test_include_path(str): open(os.path.join(str, 'Python.h'), 'rb') return 0 def search_include_path(flag): try: if platform == 'win32' : include_path = os.path.join(sys.prefix, 'include') else : include_path = os.path.join(sys.prefix, 'include', 'python'+python_version) test_include_path(include_path) return include_path except: if flag == False : print("PROBLEM - Can not find the Python include path.\nPlease enter the actual Python include path ( example : " + include_path + ") :") else : print('Try again :') include_provided = False while(include_provided == False) : include_path = sys.stdin.readline()[:-1] include_provided = True try : test_include_path(include_path) return include_path except : print('Wrong Python include path') return search_include_path(True) if flag == False : print('The include path provided seems to be correct') python_include_path = search_include_path(False) print('SUCCESS - Python include path found') #================================================================================================================================================================================== #Looks for the Numarray "API path" print('\nLooking for the Numarray API path...') def test_api_path(str): open(os.path.join(str, 'libnumarray.h'), 'rb') return 0 def search_api_path(flag): try: if platform == 'win32' : api_path = os.path.join(sys.prefix, 'include','numarray') else : api_path = os.path.join(sys.prefix, 'include', 'python'+python_version, 'numarray') test_api_path(api_path) return api_path except: if flag == False : print("PROBLEM - Can not find the Numarray API path.\nPlease enter the actual Numarray API path ( example : " + api_path + ") :") else : print('Try again :') api_provided = False while(api_provided == False) : api_path = sys.stdin.readline()[:-1] api_provided = True try : test_api_path(api_path) return api_path except : print('Wrong Numarray API path') return search_api_path(True) if flag == False : print('The API path provided seems to be correct') numarray_api_path = search_api_path(False) print('SUCCESS - Numarray API path found') #================================================================================================================================================================================== #Looks for the python "lib path" print('\nLooking for the Python lib path...') def test_lib_path(str): open(os.path.join(str, 'os.py'), 'rb') return 0 def search_lib_path(flag): try: if platform == 'win32' : lib_path = os.path.join(sys.prefix, 'lib') else : lib_path = os.path.join(sys.prefix, 'lib', 'python'+python_version) test_lib_path(lib_path) return lib_path except: if flag == False : print("PROBLEM - Can not find the Python lib path.\nPlease enter the actual Python lib path ( example : " + lib_path + ") :") else : print('Try again :') lib_provided = False while(lib_provided == False) : lib_path = sys.stdin.readline()[:-1] lib_provided = True try : test_lib_path(lib_path) return lib_path except : print('Wrong Python lib path') return search_lib_path(True) if flag == False : print('The lib path provided seems to be correct.') python_lib_path = search_lib_path(False) print('SUCCESS - Python lib path found') #================================================================================================================================================================================== #Generates the makefile print('\nGenerating the makefile...') if platform == 'linux2' or platform == 'win32' : try : f = open ('makefile.'+platform, 'wb') except : print('FAILURE - the install process failed to create a file.') print('Installation aborted') sys.exit(-1) print('File created') print('Writting the file...') try : f.write('# MAKEFILE FOR THE PYTHON WRAPPING OF NEC-2\n') l = ['misc', 'c_ggrid', 'c_evlcom', 'c_plot_card', 'matrix_algebra', 'nec_output', 'c_geometry'] list_hdrs = l + ['math_util', 'common', 'nec_results'] list_src = l + ['nec_context', 'nec_ground', 'nec_radiation_pattern', 'nec_exception', 'nec_structure_currents'] if platform == 'linux2' : f.write('\nPYMOD=python_module/_PyNEC.so\n'); hdrs = '\nHDRS = ' i = -1 for j in range(list_hdrs.__len__()) : i += 1 if i == 4 : hdrs += "\\\n " i = 0 hdrs += "wrap/src/" + list_hdrs[j] + ".h" + " " f.write(hdrs + "\n") src = '\nSRC = ' i = -1 for j in range(list_src.__len__()) : i += 1 if i == 4 : src += "\\\n " i = 0 src += "wrap/src/" + list_src[j] + ".cpp" + " " f.write(src + "\n") f.write("\nOBJS = $(SRC:.cpp=.o)\n") f.write("\nCXX=g++\n") f.write("\nLDFLAGS=-shared -lstdc++\n") f.write("\nCXXFLAGS=-Wall\n") swigcxxflags = "\nSWIGCXXFLAGS=-c" swigcxxflags += " -I"+python_include_path swigcxxflags += " -I"+numarray_api_path swigcxxflags += " -I"+python_lib_path swigcxxflags += " -DHAVE_CONFIG_H" f.write(swigcxxflags+"\n") f.write("\nSWIGFLAGS=-python -c++\n") f.write("\n\n") f.write("\nall: $(PYMOD)\n") pynec_so = "\npython_module/_PyNEC.so: $(OBJS) wrap/PyNEC_wrap.o\n" pynec_so += " cd ..\n" pynec_so += " $(CXX) $(LDFLAGS) $^ -o $@\n" pynec_so += " @echo\n" pynec_so += " @echo To install the module on your python system, type make -f makefile." + platform + " install - root privileges may be required" f.write(pynec_so) pynec_wrap_o = "\nwrap/PyNEC_wrap.o: wrap/PyNEC_wrap.cxx\n" pynec_wrap_o += " $(CXX) $(SWIGCXXFLAGS) $< wrap/src/nec_context.cpp\n" pynec_wrap_o += " @mv PyNEC_wrap.o wrap/\n" pynec_wrap_o += " @rm -rf nec_context.o\n" f.write(pynec_wrap_o) pynec_wrap_cxx = "\nwrap/PyNEC_wrap.cxx: wrap/PyNEC.i\n" pynec_wrap_cxx += " swig $(SWIGFLAGS) $<\n" pynec_wrap_cxx += " @rm -rf wrap/PyNEC.py\n" f.write(pynec_wrap_cxx) o_from_cpp = "\n%.o: %.cpp\n" o_from_cpp += " $(CXX) $(CXXFLAGS) -o $@ -c $<\n" f.write(o_from_cpp) install = "\ninstall:\n" install += " @rm -fr " + python_lib_path + "/site-packages/PyNEC\n" install += " @mkdir " + python_lib_path + "/site-packages/PyNEC\n" install += " cp python_module/*.* " + python_lib_path + "/site-packages/PyNEC/\n" f.write(install) clean = "\nclean:\n" clean += " rm -rf wrap/src/*.o wrap/PyNEC_wrap.cxx wrap/PyNEC_wrap.o python_module/*.pyc python_module/_PyNEC.so" f.write(clean) print('File written\n') print('You can now use the generated makefile (named makefile.' + platform +') to compile PyNEC\n') except : print('FAILURE - an error occured so the file has not been filled properly.') print('Installation aborted') sys.exit(-1) else : print('FAILURE - The installation of PyNEC has not yet been tested on this platform.') print('Installation aborted') sys.exit(-1) necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/0000755000175000017500000000000011452152141016046 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/0000755000175000017500000000000011452152141016635 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_context.h0000644000175000017500000007473310325372102021334 0ustar numanuma#ifndef __nec_context__ #define __nec_context__ /* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "common.h" #include "c_ggrid.h" #include "math_util.h" #include "matrix_algebra.h" #include "electromag.h" #include "nec_radiation_pattern.h" #include "nec_results.h" #include "nec_structure_currents.h" #include "nec_output.h" #include "nec_ground.h" #include "c_plot_card.h" class c_geometry; enum excitation_return { FREQ_PRINT_NORMALIZATION = 0, FREQ_LOOP_CONTINUE = 1, FREQ_LOOP_CARD_CONTINUE = 2 }; /** 0=E VOLTAGE (A), 1=LINEAR WAVE (B), 2= R CIRC WAVE (B) 3=L CIRC WAVE (B), 4= CURRENT (C), 5= VOLTAGE DISC. */ enum excitation_type { EXCITATION_VOLTAGE = 0, EXCITATION_LINEAR = 1, EXCITATION_CIRC_RIGHT = 2, EXCITATION_CIRC_LEFT = 3, EXCITATION_CURRENT = 4, EXCITATION_VOLTAGE_DISC = 5 }; /*! A 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. */ class nec_context { public: nec_context(); virtual ~nec_context(); // Called after construction... void initialize(); void calc_prepare(); inline c_geometry* get_geometry() { return m_geometry; } /*! \brief Get the maximum gain in dB. This function requires a previous rp_card() method to have been called. \return The maximum gain in dB or -999.0 if no radiation pattern had been previously requested. This only works for a SINGLE FRQUENCY rp_card request. */ double get_maximum_gain(int index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(index); if (NULL == rp) return -999.0; return rp->get_maximum_gain_db(); } /*! \brief Get Antenna Input Parameter Results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_antenna_input* get_input_parameters(int index) { return m_results.get_antenna_input(index); } /*! \brief Get Normalized Receiving Pattern Results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_norm_rx_pattern* get_norm_rx_pattern(int index) { return m_results.get_norm_rx_pattern(index); } /*! \brief Get Radiation Pattern results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_radiation_pattern* get_radiation_pattern(int index) { return m_results.get_radiation_pattern(index); } /*! \brief Get structure excitation results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_structure_excitation* get_structure_excitation(int index) { return m_results.get_structure_excitation(index); } /*! \brief Get near field pattern results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_near_field_pattern* get_near_field_pattern(int index) { return m_results.get_near_field_pattern(index); } /*! \brief Get structure currents results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_structure_currents* get_structure_currents(int index) { return m_results.get_structure_currents(index); } /* added for the python wrapping : some access functions */ void set_isave(int in_isave) { isave = in_isave; } int get_inc() { return inc; } nec_float get_xpr1() { return xpr1; } nec_float get_xpr2() { return xpr2; } /* end of functions added for the python wrapping */ inline void set_output(nec_output_file in_output, nec_output_flags in_output_flags) { m_output = in_output; m_output_flags = in_output_flags; m_output_fp = m_output.get_fp(); } inline void set_results_stdout(bool flag) { m_results.set_stdout(flag); } inline void set_results_format(enum RESULT_FORMAT result_format) { m_results.m_result_format = result_format; } inline void set_gain_only(bool flag) { m_output_flags.set_gain_only(flag); } /*!\brief Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. */ static nec_float benchmark(); /*! \brief Signal the end of a geometry description. This function prepares for a calculation by calling calc_prepare(). */ void geometry_complete(int card_int_1, int card_int_2); /*! 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 */ 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); /*! 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. */ void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); /*! \brief Add an helix to the geometry, \remark 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. */ 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); /*! "fr" card, frequency parameters \verbatim FREQUENCY I1- O= LINEAR STEP, 1=MULTIPLICATIVE I2- NO. STEPS, BLANK=1 F1- FREQUENCY OR START FREQUENCY F2- FREQ INCREMENT, ADD OR MULTIPLY \endverbatim */ void fr_card(int in_ifrq, int in_nfrq, nec_float in_freq_mhz, nec_float in_del_freq); /*! 1: "ld" card, loading parameters \verbatim 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 \endverbatim */ void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3); /*! \brief Ground parameters under the antenna \remark 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. \param ground_type (was IPERF) Ground-type flag. The options are: \arg \c -1 - Nullifies ground parameters previously used and sets free-space condition. The remainder of the parameters should be zero in this case. \arg \c O - Finite ground, reflection-coefficient approximation. \arg \c 1 - Perfectly conducting ground. \arg \c 2 - Finite ground, Sommerfeld/Norton method. \param rad_wire_count (was NRADL) - Number of radial wires in the ground screen approximation; Set to zero implies no ground screen. \param EPSE (F1) - Relative dielectric constant for ground in the vicinity of the antenna. Set to zero in case of a perfect ground. \param 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|. \remark Options for Remaining Floating Point Fields (F3-F6): \li a. For an infinite ground plane, F3 through F6 are blank. \li 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. \li 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. */ 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); /*! "ex" card, excitation parameters \verbatim 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) \endverbatim */ 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); /*! 5: "tl" card, transmission line parameters \remark To generate a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. \verbatim 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 \endverbatim */ 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); /*! 4: "nt" card, network parameters \verbatim 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) \endverbatim */ 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); /*! "xq" execute card - calc. including radiated fields \verbatim 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 \endverbatim */ void xq_card(int itmp1); /*! "gd" card, ground representation */ void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4); /*! \brief Standard radiation pattern parameters \param calc_mode This 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: \arg \c 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. \arg \c 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.) \arg \c 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. \arg \c 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. \arg \c 4 - radial wire ground screen centered at origin. \arg \c 5 - both radial wire ground screen and linear cliff. \arg \c 6 - both radial wire ground screen ant circular cliff. \param n_theta The number of theta angles. \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); /*no more used */ 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; nec_structure_currents* structure_currents; 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__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_ggrid.cpp0000644000175000017500000002771610325372102020753 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_ggrid.h" #include "common.h" #include "nec_output.h" // for DEBUG_TRACE() int c_ggrid::m_nxa[3] = {11,17,9}, c_ggrid::m_nya[3] = {10,5,8}; nec_float c_ggrid::m_dxa[3] = {.02,.05,.1}, c_ggrid::m_dya[3] = {.1745329252,.0872664626,.1745329252}; nec_float c_ggrid::m_xsa[3] = {0.,.2,.2}, c_ggrid::m_ysa[3] = {0.,0.,.3490658504}; /*! \brief interpolate (was intrp) uses bivariate cubic interpolation to obtain the values of 4 functions at the point (x,y). */ void c_ggrid::interpolate( nec_float x, nec_float y, nec_complex *f1, nec_complex *f2, nec_complex *f3, nec_complex *f4 ) { static int ix, iy, ixs=-10, iys=-10, igrs=-10, ixeg=0, iyeg=0; static int nxm2, nym2, nxms, nyms, nd, ndp; static nec_float dx = 1., dy = 1., xs = 0., ys = 0., xz, yz; static nec_complex a[4][4], b[4][4], c[4][4], d[4][4]; static int nda[3] = {11,17,9}, ndpa[3] = {110, 85, 72}; nec_complex p1, p2, p3, p4, fx1, fx2, fx3, fx4; bool skip_recalculation = false; if( (x < xs) || (y < ys) ) skip_recalculation = true; else { ix = (int)((x-xs) / dx)+1; iy = (int)((y-ys) / dy)+1; } /* if point lies in same 4 by 4 point region */ /* as previous point, old values are reused. */ if( (ix < ixeg) || (iy < iyeg) || (abs(ix- ixs) >= 2) || (abs(iy- iys) >= 2) || (skip_recalculation == false) ) { /* determine correct grid and grid region */ int igr; if( x <= m_xsa[1]) igr=0; else { if( y > m_ysa[2]) igr=2; else igr=1; } if( igr != igrs) { igrs= igr; dx= m_dxa[igrs]; dy= m_dya[igrs]; xs= m_xsa[igrs]; ys= m_ysa[igrs]; nxm2= m_nxa[igrs]-2; nym2= m_nya[igrs]-2; nxms=(( nxm2+1)/3)*3+1; nyms=(( nym2+1)/3)*3+1; nd= nda[igrs]; ndp= ndpa[igrs]; ix= (int)(( x- xs)/ dx)+1; iy= (int)(( y- ys)/ dy)+1; } /* if( igr != igrs) */ ixs=(( ix-1)/3)*3+2; if( ixs < 2) ixs=2; ixeg=-10000; if( ixs > nxm2) { ixs= nxm2; ixeg= nxms; } iys=(( iy-1)/3)*3+2; if( iys < 2) iys=2; iyeg=-10000; if( iys > nym2) { iys= nym2; iyeg= nyms; } /* compute coefficients of 4 cubic polynomials in x for */ /* the 4 grid values of y for each of the 4 functions */ int iadz= ixs+( iys-3)* nd- ndp; for (int k = 0; k < 4; k++ ) { iadz += ndp; int iadd = iadz; for (int i = 0; i < 4; i++ ) { iadd += nd; switch( igrs ) { case 0: p1= m_ar1[iadd-2]; p2= m_ar1[iadd-1]; p3= m_ar1[iadd]; p4= m_ar1[iadd+1]; break; case 1: p1= m_ar2[iadd-2]; p2= m_ar2[iadd-1]; p3= m_ar2[iadd]; p4= m_ar2[iadd+1]; break; case 2: p1= m_ar3[iadd-2]; p2= m_ar3[iadd-1]; p3= m_ar3[iadd]; p4= m_ar3[iadd+1]; } /* switch( igrs ) */ a[i][k]=( p4- p1+3.*( p2- p3))*.1666666667; b[i][k]=( p1-2.* p2+ p3)*.5; c[i][k]= p3-(2.* p1+3.* p2+ p4)*.1666666667; d[i][k]= p2; } /* for ( i = 0; i < 4; i++ ) */ } /* for ( k = 0; k < 4; k++ ) */ xz=( ixs-1)* dx+ xs; yz=( iys-1)* dy+ ys; } /* if( (abs(ix- ixs) >= 2) || */ /* evaluate polymomials in x and use cubic */ /* interpolation in y for each of the 4 functions. */ nec_float xx=( x- xz)/ dx; nec_float yy=( y- yz)/ dy; fx1=(( a[0][0]* xx+ b[0][0])* xx+ c[0][0])* xx+ d[0][0]; fx2=(( a[1][0]* xx+ b[1][0])* xx+ c[1][0])* xx+ d[1][0]; fx3=(( a[2][0]* xx+ b[2][0])* xx+ c[2][0])* xx+ d[2][0]; fx4=(( a[3][0]* xx+ b[3][0])* xx+ c[3][0])* xx+ d[3][0]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f1=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][1]* xx+ b[0][1])* xx+ c[0][1])* xx+ d[0][1]; fx2=(( a[1][1]* xx+ b[1][1])* xx+ c[1][1])* xx+ d[1][1]; fx3=(( a[2][1]* xx+ b[2][1])* xx+ c[2][1])* xx+ d[2][1]; fx4=(( a[3][1]* xx+ b[3][1])* xx+ c[3][1])* xx+ d[3][1]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f2=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][2]* xx+ b[0][2])* xx+ c[0][2])* xx+ d[0][2]; fx2=(( a[1][2]* xx+ b[1][2])* xx+ c[1][2])* xx+ d[1][2]; fx3=(( a[2][2]* xx+ b[2][2])* xx+ c[2][2])* xx+ d[2][2]; fx4=(( a[3][2]* xx+ b[3][2])* xx+ c[3][2])* xx+ d[3][2]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f3=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][3]* xx+ b[0][3])* xx+ c[0][3])* xx+ d[0][3]; fx2=(( a[1][3]* xx+ b[1][3])* xx+ c[1][3])* xx+ d[1][3]; fx3=(( a[2][3]* xx+ b[2][3])* xx+ c[2][3])* xx+ d[2][3]; fx4=(( a[3][3]* xx+ b[3][3])* xx+ c[3][3])* xx+ d[3][3]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f4=(( p1* yy+ p2)* yy+ p3)* yy*.16666666670+ fx2; } void c_ggrid::sommerfeld( nec_float epr, nec_float sig, nec_float freq_mhz ) { static nec_complex const1_neg = - nec_complex(0.0,4.771341189); nec_float tim, wavelength, tst, dr, dth, r, rk, thet, tfac1, tfac2; nec_complex erv, ezv, erh, eph, cl1, cl2, con; if(sig >= 0.0) { wavelength=CVEL/freq_mhz; m_epscf=nec_complex(epr,-sig*wavelength*59.96); } else m_epscf=nec_complex(epr,sig); secnds(&tst); m_evlcom.m_ck2 = two_pi(); m_evlcom.m_ck2sq = m_evlcom.m_ck2*m_evlcom.m_ck2; /* Sommerfeld integral evaluation uses exp(-jwt), NEC uses exp(+jwt), hence need conjg(epscf). Conjugate of fields occurs in subroutine evlua. */ m_evlcom.m_ck1sq=m_evlcom.m_ck2sq*conj(m_epscf); m_evlcom.m_ck1=sqrt(m_evlcom.m_ck1sq); m_evlcom.m_ck1r=real(m_evlcom.m_ck1); m_evlcom.m_tkmag=100.0*abs(m_evlcom.m_ck1); m_evlcom.m_tsmag=100.0*norm(m_evlcom.m_ck1); // TCAM changed from previous line m_evlcom.m_cksm=m_evlcom.m_ck2sq/(m_evlcom.m_ck1sq+m_evlcom.m_ck2sq); m_evlcom.m_ct1=.5*(m_evlcom.m_ck1sq-m_evlcom.m_ck2sq); erv=m_evlcom.m_ck1sq*m_evlcom.m_ck1sq; ezv=m_evlcom.m_ck2sq*m_evlcom.m_ck2sq; m_evlcom.m_ct2=.125*(erv-ezv); erv *= m_evlcom.m_ck1sq; ezv *= m_evlcom.m_ck2sq; m_evlcom.m_ct3=.0625*(erv-ezv); /* loop over 3 grid regions */ for (int k = 0; k < 3; k++ ) { int nr = m_nxa[k]; int nth = m_nya[k]; dr = m_dxa[k]; dth = m_dya[k]; r = m_xsa[k]-dr; int irs=1; if(k == 0) { r=m_xsa[k]; irs=2; } /* loop over r. (r=sqrt(m_evlcom.m_rho**2 + (z+h)**2)) */ for (int ir = irs-1; ir < nr; ir++ ) { r += dr; thet = m_ysa[k]-dth; /* loop over theta. (theta=atan((z+h)/m_evlcom.m_rho)) */ for (int ith = 0; ith < nth; ith++ ) { thet += dth; m_evlcom.m_rho=r*cos(thet); m_evlcom.m_zph=r*sin(thet); if(m_evlcom.m_rho < 1.e-7) m_evlcom.m_rho=1.e-8; if(m_evlcom.m_zph < 1.e-7) m_evlcom.m_zph=0.; m_evlcom.evlua( &erv, &ezv, &erh, &eph ); rk=m_evlcom.m_ck2*r; con=const1_neg*r/nec_complex(cos(rk),-sin(rk)); switch( k ) { case 0: m_ar1[ir+ith*11+ 0]=erv*con; m_ar1[ir+ith*11+110]=ezv*con; m_ar1[ir+ith*11+220]=erh*con; m_ar1[ir+ith*11+330]=eph*con; break; case 1: m_ar2[ir+ith*17+ 0]=erv*con; m_ar2[ir+ith*17+ 85]=ezv*con; m_ar2[ir+ith*17+170]=erh*con; m_ar2[ir+ith*17+255]=eph*con; break; case 2: m_ar3[ir+ith*9+ 0]=erv*con; m_ar3[ir+ith*9+ 72]=ezv*con; m_ar3[ir+ith*9+144]=erh*con; m_ar3[ir+ith*9+216]=eph*con; } /* switch( k ) */ } /* for ( ith = 0; ith < nth; ith++ ) */ } /* for ( ir = irs-1; ir < nr; ir++; ) */ } /* for ( k = 0; k < 3; k++; ) */ /* fill grid 1 for r equal to zero. */ cl2 = -CONST4*(m_epscf-1.)/(m_epscf+1.); cl1 = cl2/(m_epscf+1.); ezv = m_epscf*cl1; thet=-dth; int nth = m_nya[0]; for (int ith = 0; ith < nth; ith++ ) { thet += dth; if( (ith+1) != nth ) { tfac2=cos(thet); tfac1=(1.-sin(thet))/tfac2; tfac2=tfac1/tfac2; erv=m_epscf*cl1*tfac1; erh=cl1*(tfac2-1.)+cl2; eph=cl1*tfac2-cl2; } else { erv=0.; erh=cl2-.5*cl1; eph=-erh; } m_ar1[0+ith*11+ 0]=erv; m_ar1[0+ith*11+110]=ezv; m_ar1[0+ith*11+220]=erh; m_ar1[0+ith*11+330]=eph; } secnds(&tim); tim -= tst; } /* fbar is the Sommerfeld attenuation function for numerical distance . */ nec_complex fbar( nec_complex p ); nec_complex fbar( nec_complex p ) { int minus; nec_float tms, sms; nec_complex z, zs, sum, pow, term, fbar; z= cplx_01()* sqrt( p); if ( abs( z) <= 3.) { /* series expansion */ zs= z* z; sum= z; pow= z; for (int i = 1; i <= 100; i++ ) { pow=- pow* zs/ (nec_float)i; term= pow/(2.* i+1.); sum = sum + term; tms = norm(term); sms = norm(sum); if ( tms/sms < ACCS) break; } fbar=1.-(1.- sum* TOSP)* z* exp( zs)* SP; return( fbar ); } /* if ( abs( z) <= 3.) */ /* asymptotic expansion */ if ( real( z) < 0.) { minus=1; z=- z; } else minus=0; zs=.5/( z* z); sum=cplx_00(); term=cplx_10(); for (int i = 1; i <= 6; i++ ) { term =- term*(2.*i -1.)* zs; sum += term; } if ( minus == 1) sum -= 2.* SP* z* exp( z* z); fbar=- sum; return( fbar ); } /* gwave computes the electric field, including ground wave, of a */ /* current element over a ground plane using formulas of k.a. norton */ /* (proc. ire, sept., 1937, pp.1203,1236.) */ void gwave( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *ezh, nec_complex *eph, c_ground_wave& ground_wave) { nec_float sppp, sppp2, cppp2, cppp, spp, spp2, cpp2, cpp; nec_complex rk1, rk2, t1, t2, t3, t4, p1, rv; nec_complex omr, w, f, q1, rh, v, g, xr1, xr2; nec_complex x1, x2, x3, x4, x5, x6, x7; sppp= ground_wave.zmh/ ground_wave.r1; sppp2= sppp* sppp; cppp2=1.- sppp2; if ( cppp2 < 1.0e-20) cppp2=1.0e-20; cppp= sqrt( cppp2); spp= ground_wave.zph/ ground_wave.r2; spp2= spp* spp; cpp2=1.- spp2; if ( cpp2 < 1.0e-20) cpp2=1.0e-20; cpp= sqrt( cpp2); rk1=- two_pi_j()* ground_wave.r1; rk2=- two_pi_j()* ground_wave.r2; t1=1. -ground_wave.u2* cpp2; t2= sqrt( t1); t3=(1. -1./ rk1)/ rk1; t4=(1. -1./ rk2)/ rk2; p1= rk2* ground_wave.u2* t1/(2.* cpp2); rv=( spp- ground_wave.u* t2)/( spp+ ground_wave.u* t2); omr=1.- rv; w=1./ omr; w= nec_complex(4.0,0.0)* p1* w* w; f= fbar( w); q1= rk2* t1/(2.* ground_wave.u2* cpp2); rh=( t2- ground_wave.u* spp)/( t2+ ground_wave.u* spp); v=1./(1.+ rh); v=nec_complex(4.0,0.0)* q1* v* v; g= fbar( v); xr1= ground_wave.xx1/ ground_wave.r1; xr2= ground_wave.xx2/ ground_wave.r2; x1= cppp2* xr1; x2= rv* cpp2* xr2; x3= omr* cpp2* f* xr2; x4= ground_wave.u* t2* spp*2.* xr2/ rk2; x5= xr1* t3*(1.-3.* sppp2); x6= xr2* t4*(1.-3.* spp2); *ezv=( x1+ x2+ x3- x4- x5- x6)* (-CONST4); x1= sppp* cppp* xr1; x2= rv* spp* cpp* xr2; x3= cpp* omr* ground_wave.u* t2* f* xr2; x4= spp* cpp* omr* xr2/ rk2; x5=3.* sppp* cppp* t3* xr1; x6= cpp* ground_wave.u* t2* omr* xr2/ rk2*.5; x7=3.* spp* cpp* t4* xr2; *erv=-( x1+ x2- x3+ x4- x5+ x6- x7)* (-CONST4); *ezh=-( x1- x2+ x3- x4- x5- x6+ x7)* (-CONST4); x1= sppp2* xr1; x2= rv* spp2* xr2; x4= ground_wave.u2* t1* omr* f* xr2; x5= t3*(1.-3.* cppp2)* xr1; x6= t4*(1.-3.* cpp2)*(1.- ground_wave.u2*(1.+ rv)- ground_wave.u2* omr* f)* xr2; x7= ground_wave.u2* cpp2* omr*(1.-1./ rk2)*( f*( ground_wave.u2* t1- spp2-1./ rk2)+1./rk2)* xr2; *erh=( x1- x2- x4- x5+ x6+ x7)* (-CONST4); x1= xr1; x2= rh* xr2; x3=( rh+1.)* g* xr2; x4= t3* xr1; x5= t4*(1.- ground_wave.u2*(1.+ rv)- ground_wave.u2* omr* f)* xr2; x6=.5* ground_wave.u2* omr*( f*( ground_wave.u2* t1- spp2-1./ rk2)+1./ rk2)* xr2/ rk2; *eph=-( x1- x2+ x3- x4+ x5+ x6)* (-CONST4); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/common.h0000644000175000017500000000276410325372102020306 0ustar numanuma#ifndef __common__ #define __common__ /* Various Definitions for nec2++ Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Version information */ #define nec_version_major "1" #define nec_version_minor "2" #define nec_version_build "3" #ifndef nec_build_date #define nec_build_date "2005-07-29" #endif #ifndef build_version #define nec_version nec_version_major "." nec_version_minor "." nec_version_build " [" nec_build_date "]" #else #define nec_version build_version " [" nec_build_date "]" #endif /* These are some common constants that should be moved into more appropriate locations */ #define ETA 376.73 #define CVEL 299.8 #define RETA 2.654420938E-3 #define TOSP 1.128379167 #define ACCS 1.E-12 #define SP 1.772453851 #define FPI 12.56637062 #define CONST2 4.771341188 #define SMIN 1.e-3 #endif /* __common__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/AntennaInput.h0000644000175000017500000000644610325372102021423 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Antenna_Input__ #define __Antenna_Input__ #include #include "BaseInput.h" /* - - - ANTENNA INPUT PARAMETERS - - - TAG SEG. VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER NO. NO. REAL IMAG. REAL IMAG. REAL IMAG. REAL IMAG. (WATTS) 0 * 5 1.00000E+00 0.00000E+00 6.64451E-03-3.86651E-03 1.12429E+02 6.54238E+01 6.64451E-03-3.86651E-03 3.32225E-03 --------- ANTENNA INPUT PARAMETERS --------- TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER NO. NO. REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS) 0 5 1.0000E+00 0.0000E+00 6.6443E-03 -3.8666E-03 1.1243E+02 6.5428E+01 6.6443E-03 -3.8666E-03 3.3222E-03 */ class AntennaInput : public BaseInput { public: vector tag, seg, vRe, vIm, iRe, iIm, zRe, zIm, power; long n_items; AntennaInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("ANTENNA INPUT PARAMETERS"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("(WATTS)",0) == string::npos) line = readline(); line = readline(); // get rid of '*' characters if (line.find("*",0) != string::npos) { line.erase(line.find("*",0),1); } stringstream ss(line); tag.push_back(read_fixed(ss)); seg.push_back(read_fixed(ss)); vRe.push_back(read_fixed(ss)); vIm.push_back(read_fixed(ss)); iRe.push_back(read_fixed(ss)); iIm.push_back(read_fixed(ss)); zRe.push_back(read_fixed(ss)); zIm.push_back(read_fixed(ss)); power.push_back(read_fixed(ss)); cout << "Impedance : " << zRe[n_items] << " " << zIm[n_items] << endl; n_items++; } } } bool equalto(const AntennaInput& ai) { if (difference(ai) > 1e-4) return false; return true; } double difference(const AntennaInput& ai) { double ret = 0; if (n_items != ai.n_items) return 1.0; try { for (long i=0; i #include /* ---------------------------------------------------------------------*/ nec_output_file::nec_output_file() { set_file(NULL); set_error_mode(false); } void nec_output_file::set_file(FILE* in_fp) { m_output_fp = in_fp; set_indent(0); } void nec_output_file::set_error_mode(bool f) { m_error_mode = f; } /* private */ void nec_output_file::do_output(const char* str) { if (NULL == m_output_fp) return; fprintf(m_output_fp, str); if (m_error_mode) fprintf(stderr,str); } void nec_output_file::endl(int n_lines) { for (int i=0; i < n_lines; i++) do_output("\n"); m_require_indent = true; } void nec_output_file::end_section() { endl(3); } void nec_output_file::set_indent(int n) { m_indent = n; m_require_indent = true; indent(); } void nec_output_file::indent() { if (m_require_indent) { for (int i=0; i< m_indent; i++) do_output(" "); m_require_indent = false; } } void nec_output_file::line(const char* in_str) { string(in_str,true); } void nec_output_file::string(const char* in_str, bool require_endl) { indent(); do_output(in_str); if (require_endl) endl(); } void nec_output_file::real(nec_float in_nec_float) { real_out(11,4,in_nec_float,true); } void nec_output_file::integer(long in_integer) { if (NULL == m_output_fp) return; fprintf(m_output_fp,"%ld",in_integer); if (m_error_mode) fprintf(stderr,"%ld",in_integer); } void nec_output_file::real_out(int w, int p, nec_float f, bool sci) { if (NULL == m_output_fp) return; std::stringstream ss; ss << "%" << w << "." << p; if (sci) ss << "E"; else ss << "f"; std::string s = ss.str(); const char* fmt = s.c_str(); fprintf(m_output_fp,fmt,f); if (m_error_mode) fprintf(stderr,fmt,f); } #include "stdarg.h" #include "safe_array.h" void nec_output_file::nec_printf(const char* fmt, ...) { if (NULL == m_output_fp) return; { va_list ap; /* special type for variable */ safe_array format(2048); /* argument lists */ int count = 0; int i, j; /* Need all these to store */ char c; /* values below in switch */ double d; unsigned u; char *s; void *v; va_start(ap, fmt); /* must be called before work */ while (*fmt) { for (j = 0; fmt[j] && fmt[j] != '%'; j++) format[j] = fmt[j]; /* not a format string */ if (j) { format[j] = '\0'; count += fprintf(m_output_fp, format.get_ptr()); /* log it verbatim */ fmt += j; } else { for (j = 0; !isalpha(fmt[j]); j++) { /* find end of format specifier */ format[j] = fmt[j]; if (j && fmt[j] == '%') /* special case printing '%' */ break; } format[j] = fmt[j]; /* finish writing specifier */ format[j + 1] = '\0'; /* don't forget NULL terminator */ fmt += j + 1; switch (format[j]) { /* cases for all specifiers */ case 'd': case 'i': /* many use identical actions */ i = va_arg(ap, int); /* process the argument */ count += fprintf(m_output_fp, format.get_ptr(), i); /* and log it */ break; case 'o': case 'x': case 'X': case 'u': u = va_arg(ap, unsigned); count += fprintf(m_output_fp, format.get_ptr(), u); break; case 'c': c = (char) va_arg(ap, int); /* must cast! */ count += fprintf(m_output_fp, format.get_ptr(), c); break; case 's': s = va_arg(ap, char *); count += fprintf(m_output_fp, format.get_ptr(), s); break; case 'f': case 'e': case 'E': case 'g': case 'G': d = va_arg(ap, double); count += fprintf(m_output_fp, format.get_ptr(), d); break; case 'p': v = va_arg(ap, void *); count += fprintf(m_output_fp, format.get_ptr(), v); break; case 'n': count += fprintf(m_output_fp, "%d", count); break; case '%': count += fprintf(m_output_fp, "%%"); break; default: throw new nec_exception("Invalid format specifier in nec_printf()"); } } } va_end(ap); /* clean up */ } } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/net_solve.cpp0000644000175000017500000004161310325372102021343 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This class is not fully functional yet. It will perform the network solution when done! */ #include "matrix_algebra.h" #include "electromag.h" #include "nec_ground.h" #include "c_geometry.h" #include #include "nec_results.h" extern nec_results s_results; #include "nec_output.h" extern nec_output_file s_output; extern nec_output_flags s_output_flags; extern nec_float wavelength; extern int nop; extern complex_array symmetry_array; /* subroutine netwk solves for structure currents for a given */ /* excitation including the effect of non-radiating networks if */ /* present. */ class c_network { public: c_network(); void net_solve( complex_array& cm, nec_complex *cmb, nec_complex *cmc, nec_complex *cmd, int_array& ip, complex_array& einc ); private: FILE *output_fp; c_geometry geometry; nec_ground ground; /* 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 /* 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; }; void c_network::net_solve( complex_array& cm, nec_complex *cmb, nec_complex *cmc, nec_complex *cmd, int_array& ip, complex_array& einc ) { /* Network buffers */ int_array ipnt, nteqa, ntsca; complex_array vsrc, rhs, cmn, rhnt, rhnx; bool jump1, jump2; int nteq=0, ntsc=0, nseg2, irow2=0; int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0; nec_float asmx, asa, y11r, y11i, y12r, y12i, y22r, y22i; nec_complex ymit, vlt, cux; neqz2= neq2; if ( neqz2 == 0) neqz2=1; input_power = 0.0; network_power_loss = 0.0; neqt= neq+ neq2; int ndimn = (2*network_count + voltage_source_count); /* Allocate network buffers */ if ( network_count > 0 ) { rhs.resize( geometry.n_plus_3m ); // this should probably be ndimn! rhnt.resize( ndimn ); rhnx.resize( ndimn); cmn.resize( ndimn * ndimn ); ntsca.resize( ndimn ); nteqa.resize( ndimn ); ipnt.resize( ndimn ); vsrc.resize( voltage_source_count ); } if ( ntsol == 0) { /* compute relative matrix asymmetry */ if ( masym != 0) { irow1=0; for( i = 0; i < network_count; i++ ) { nseg1= iseg1[i]; for( isc1 = 0; isc1 < 2; isc1++ ) { if ( irow1 == 0) { ipnt[irow1]= nseg1; nseg1= iseg2[i]; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } nseg1= iseg2[i]; } /* for( isc1 = 0; isc1 < 2; isc1++ ) */ } /* for( i = 0; i < network_count; i++ ) */ ASSERT(voltage_source_count >= 0); for( i = 0; i < voltage_source_count; i++ ) { nseg1= source_segment_array[i]; if ( irow1 == 0) { ipnt[irow1]= nseg1; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } } /* for( i = 0; i < voltage_source_count; i++ ) */ if ( irow1 >= 2) { for( i = 0; i < irow1; i++ ) { isc1 = ipnt[i]-1; asmx= geometry.segment_length[isc1]; for (int j = 0; j < neqt; j++ ) rhs[j] = cplx_00(); rhs[isc1] = cplx_10(); solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < irow1; j++ ) { isc1= ipnt[j]-1; cmn[j+i*ndimn]= rhs[isc1]/ asmx; } } /* for( i = 0; i < irow1; i++ ) */ asmx=0.0; asa=0.0; for( i = 1; i < irow1; i++ ) { for (int j = 0; j < i; j++ ) { cux = cmn[i+j*ndimn]; nec_float pwr= abs(( cux- cmn[j+i*ndimn])/ cux); asa += pwr* pwr; if ( pwr >= asmx) { asmx= pwr; nteq= ipnt[i]; ntsc= ipnt[j]; } } /* for( j = 0; j < i; j++ ) */ } /* for( i = 1; i < irow1; i++ ) */ asa= sqrt( asa*2./ (nec_float)( irow1*( irow1-1))); fprintf( output_fp, "\n\n" " MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n" " MATRIX IS %10.3E FOR SEGMENTS %d AND %d\n" " RMS RELATIVE ASYMMETRY IS %10.3E", asmx, nteq, ntsc, asa ); } /* if ( irow1 >= 2) */ } /* if ( masym != 0) */ /* solution of network equations */ if ( network_count != 0) { // zero the cmn array, and the rhnx array cmn.fill(cplx_00()); rhnx.fill(cplx_00()); /* for( i = 0; i < ndimn; i++ ) { rhnx[i]=cplx_00(); for (int j = 0; j < ndimn; j++ ) cmn[j+i*ndimn]=cplx_00(); } */ nteq=0; ntsc=0; /* sort network and source data and assign equation numbers to segments */ for (int j = 0; j < network_count; j++ ) { nseg1= iseg1[j]; nseg2= iseg2[j]; if ( ntyp[j] <= 1) { y11r= x11r[j]; y11i= x11i[j]; y12r= x12r[j]; y12i= x12i[j]; y22r= x22r[j]; y22i= x22i[j]; } else { y22r= two_pi() * x11i[j]/ wavelength; y12r=0.; y12i=1./( x11r[j]* sin( y22r)); y11r= x12r[j]; y11i=- y12i* cos( y22r); y22r= x22r[j]; y22i= y11i+ x22i[j]; y11i= y11i+ x12i[j]; if ( ntyp[j] != 2) { y12r=- y12r; y12i=- y12i; } } /* if ( ntyp[j] <= 1) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg1 == source_segment_array[i]) { isc1 = i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc1=-1; for( i = 0; i < nteq; i++ ) { if ( nseg1 == nteqa[i]) { irow1 = i; jump2 = true; break; } } if ( ! jump2 ) { irow1= nteq; nteqa[nteq]= nseg1; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg1 == ntsca[i]) { irow1 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow1= ndimn- (ntsc+1); ntsca[ntsc]= nseg1; vsrc[ntsc]= source_voltage_array[isc1]; ntsc++; } } /* if ( ! jump1 ) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg2 == source_segment_array[i]) { isc2= i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc2=-1; for( i = 0; i < nteq; i++ ) { if ( nseg2 == nteqa[i]) { irow2= i; jump2 = true; break; } } if ( ! jump2 ) { irow2= nteq; nteqa[nteq]= nseg2; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg2 == ntsca[i]) { irow2 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow2= ndimn- (ntsc+1); ntsca[ntsc]= nseg2; vsrc[ntsc]= source_voltage_array[isc2]; ntsc++; } } /* if ( ! jump1 ) */ /* fill network equation matrix and right hand side vector with */ /* network short-circuit admittance matrix coefficients. */ if ( isc1 == -1) { cmn[irow1+irow1*ndimn] -= nec_complex( y11r, y11i)* geometry.segment_length[nseg1-1]; cmn[irow1+irow2*ndimn] -= nec_complex( y12r, y12i)* geometry.segment_length[nseg1-1]; } else { rhnx[irow1] += nec_complex( y11r, y11i)* source_voltage_array[isc1]/wavelength; rhnx[irow2] += nec_complex( y12r, y12i)* source_voltage_array[isc1]/wavelength; } if ( isc2 == -1) { cmn[irow2+irow2*ndimn] -= nec_complex( y22r, y22i)* geometry.segment_length[nseg2-1]; cmn[irow2+irow1*ndimn] -= nec_complex( y12r, y12i)* geometry.segment_length[nseg2-1]; } else { rhnx[irow1] += nec_complex( y12r, y12i)* source_voltage_array[isc2]/wavelength; rhnx[irow2] += nec_complex( y22r, y22i)* source_voltage_array[isc2]/wavelength; } } /* for( j = 0; j < network_count; j++ ) */ /* add interaction matrix admittance elements to network equation matrix */ for( i = 0; i < nteq; i++ ) { for (int j = 0; j < neqt; j++ ) rhs[j] = cplx_00(); irow1= nteqa[i]-1; rhs[irow1]=cplx_10(); solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < nteq; j++ ) { irow1= nteqa[j]-1; cmn[i+j*ndimn] += rhs[irow1]; } } /* for( i = 0; i < nteq; i++ ) */ /* factor network equation matrix */ lu_decompose( nteq, cmn, ipnt, ndimn); } /* if ( network_count != 0) */ } /* if ( ntsol != 0) */ if (0 == network_count) { /* solve for currents when no networks are present */ solves( cm, ip, einc, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); ntsc=0; } else // if ( network_count != 0) { /* add to network equation right hand side */ /* the terms due to element interactions */ for( i = 0; i < neqt; i++ ) rhs[i]= einc[i]; solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; rhnt[i]= rhnx[i]+ rhs[irow1]; } /* solve network equations */ solve( nteq, cmn, ipnt, rhnt, ndimn); /* add fields due to network voltages to electric fields */ /* applied to structure and solve for induced current */ for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; einc[irow1] -= rhnt[i]; } solves( cm, ip, einc, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); if ( nprint == 0) { fprintf( output_fp, "\n\n\n" " " "--------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) " " IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY (WATTS)" ); } for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* geometry.segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; int segment_tag = geometry.segment_tags[irow1]; nec_float power = em::power(voltage,current); network_power_loss= network_power_loss - power; if ( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_number, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } for( i = 0; i < ntsc; i++ ) { irow1= ntsca[i]-1; vlt= vsrc[i]; cux= einc[irow1]* wavelength; ymit= cux/ vlt; zped= vlt/ cux; irow2= geometry.segment_tags[irow1]; nec_float pwr= em::power(vlt,cux); network_power_loss= network_power_loss- pwr; if ( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, irow1+1, real(vlt), imag(vlt), real(cux), imag(cux), real(zped), imag(zped), real(ymit), imag(ymit), pwr ); } /* for( i = 0; i < ntsc; i++ ) */ } /* if ( network_count != 0) */ if ( (voltage_source_count+nvqd) == 0) return; nec_antenna_input* antenna_input = new nec_antenna_input(); s_results.add(antenna_input); s_output.end_section(); fprintf( output_fp, " " "--------- ANTENNA INPUT PARAMETERS ---------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) " "CURRENT (AMPS) IMPEDANCE (OHMS) " " ADMITTANCE (MHOS) POWER\n" " NO. NO. REAL IMAGINARY" " REAL IMAGINARY REAL " "IMAGINARY REAL IMAGINARY (WATTS)" ); for( i = 0; i < voltage_source_count; i++ ) { int segment_index = source_segment_array[i]-1; nec_complex voltage = source_voltage_array[i]; nec_complex current = einc[segment_index] * wavelength; bool add_as_network_loss = false; // the following loop is completely mysterious! for (int j = 0; j < ntsc; j++ ) { // I am now almost sure that the following code is not correct. // This modifies the current, however if the inner loop is executed more // than once, then only the last current modification is kept! if ( ntsca[j] == segment_index+1) { int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; // I wish I knew what was going on here... nec_complex temp = rhnx[row_index]; // renamed current -> temp to avoid confusion for (int k = 0; k < nteq; k++ ) temp -= cmn[k + row_offset]*rhnt[k]; current = (temp + einc[segment_index])* wavelength; add_as_network_loss = true; #warning "This loop is messed up. The j is inside another j loop" // I have removed the j from the "for (int k = 0; k < nteq; k++ )" loop // and placed this"j=nteq" statement here. j = nteq; } } nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); if ( add_as_network_loss ) network_power_loss += power; input_power += power; int segment_tag = geometry.segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } /* for( i = 0; i < voltage_source_count; i++ ) */ for( i = 0; i < nvqd; i++ ) { int segment_index = ivqd[i]-1; nec_complex voltage = vqd[i]; nec_complex _ai( air[segment_index], aii[segment_index]); nec_complex _bi( bir[segment_index], bii[segment_index]); nec_complex _ci( cir[segment_index], cii[segment_index]); // segment length is measured in wavelengths. The pase is therefore the length in wavelengths // multiplied by pi(). nec_float segment_length_phase = geometry.segment_length[segment_index] * pi(); // TCAM CHANGED TO pi() (from TP*.5)!! nec_complex current = ( _ai - _bi* sin(segment_length_phase)+ _ci * cos(segment_length_phase)) * wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); input_power += power; int segment_tag = geometry.segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } /* for( i = 0; i < nvqd; i++ ) */ } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_structure_currents.h0000644000175000017500000001137410325656770023645 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_structure_currents__ #define __nec_structure_currents__ #include "nec_results.h" #include "math_util.h" #include "nec_context.h" #include "c_geometry.h" class nec_context; class nec_structure_currents : public nec_base_result { public: /*Structure currents*/ nec_structure_currents(nec_context * in_context, char * in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6); void analyze(); virtual ~nec_structure_currents() { } virtual void write_to_file(ostream& os) { write_to_file_aux(os); } virtual enum nec_result_type get_result_type() { return RESULT_STRUCTURE_CURRENTS; } int get_iptflg() { return iptflg; } int get_iptflq() { return iptflq; } int get_n() { return m_geometry->n; } int get_m() { return m_geometry->m; } vector get_current_segment_number() { return _current_segment_number; } vector get_current_segment_tag() { return _current_segment_tag; } vector get_current_segment_center_x() { return _current_segment_center_x; } vector get_current_segment_center_y() { return _current_segment_center_y; } vector get_current_segment_center_z() { return _current_segment_center_z; } vector get_current_segment_length() { return _current_segment_length; } vector get_current_theta() { return _current_theta; } vector get_current_phi() { return _current_phi; } vector get_current() { return _current; } vector get_q_density_segment_number() { return _q_density_segment_number; } vector get_q_density_segment_tag() { return _q_density_segment_tag; } vector get_q_density_segment_center_x() { return _q_density_segment_center_x; } vector get_q_density_segment_center_y() { return _q_density_segment_center_y; } vector get_q_density_segment_center_z() { return _q_density_segment_center_z; } vector get_q_density_segment_length() { return _q_density_segment_length; } vector get_q_density() { return _q_density; } vector get_patch_number() { return _patch_number; } vector get_patch_center_x() { return _patch_center_x; } vector get_patch_center_y() { return _patch_center_y; } vector get_patch_center_z() { return _patch_center_z; } vector get_patch_tangent_vector1() { return _patch_tangent_vector1; } vector get_patch_tangent_vector2() { return _patch_tangent_vector2; } vector get_patch_e_x() { return _patch_e_x; } vector get_patch_e_y() { return _patch_e_y; } vector get_patch_e_z() { return _patch_e_z; } private: nec_context *m_context; c_geometry * m_geometry; char * pattype; int iptflg; int iptag, iptagf, iptagt; int iptflq; int iptaq, iptaqf, iptaqt; int nload; nec_float xpr3, xpr6; nec_float wavelength; nec_float freq_mhz; nec_float structure_power_loss; int current_nb_elements; int q_density_nb_elements; int patch_nb_elements; complex_array zarray; real_array fnorm; vector _current_segment_number; vector _current_segment_tag; vector _current_segment_center_x, _current_segment_center_y, _current_segment_center_z; vector _current_segment_length; vector _current_theta, _current_phi; vector _current; vector _q_density_segment_number; vector _q_density_segment_tag; vector _q_density_segment_center_x, _q_density_segment_center_y, _q_density_segment_center_z; vector _q_density_segment_length; vector _q_density; vector _patch_number; vector _patch_center_x, _patch_center_y, _patch_center_z; vector _patch_tangent_vector1, _patch_tangent_vector2; vector _patch_e_x, _patch_e_y, _patch_e_z; void write_to_file_aux(ostream& os); }; #endif necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/libNEC.cpp0000644000175000017500000001520610325372102020440 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2005 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "libnecpp.h" #include "nec_context.h" #include "nec_exception.h" #define NEC_ERROR_HANDLE(__x) { try { __x; } catch (nec_exception* ex) { return 1; }} #define NEC_VOID_HANDLE(__x) { try { __x; } catch (nec_exception* ex) { }} /*! \brief Create an nec_context and initialize it. Note: Do NOT delete or free the nec_context yourself, rather call nec_delete() to free memory associated with the nec simulation. */ nec_context* nec_create() { nec_context* ret = new nec_context(); ret->initialize(); return ret; } /*! \brief Delete an nec_context. */ long nec_delete(nec_context* in_context) { NEC_ERROR_HANDLE(delete in_context); return 0; } long nec_benchmark() { return long(100.0*nec_context::benchmark()); } void nec_wire(nec_context* in_context, int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad) { in_context->wire(tag_id, segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, rdel, rrad); } void nec_geometry_complete(nec_context* in_context, int card_int_1, int card_int_2) { in_context->geometry_complete(card_int_1, card_int_2); } double nec_get_maximum_gain(nec_context* in_context) { return in_context->get_maximum_gain(); } /** * FR crd * @param in_context The nec_context created with nec_create() * @param in_ifrq 0 is a linear range of frequencies, 1 is a log range. * @param in_nfrq The number of frequencies * @param in_freq_mhz The starting frequency in MHz. * @param in_del_freq The frequency step (in MHz for ifrq = 0) */ void nec_fr_card(nec_context* in_context, int in_ifrq, int in_nfrq, double in_freq_mhz, double in_del_freq) { in_context->fr_card(in_ifrq, in_nfrq, in_freq_mhz, in_del_freq); } void nec_ld_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3) { in_context->ld_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3); } /* "gn" card, ground parameters under the antenna */ void nec_gn_card(nec_context* in_context, int itmp1, int itmp2, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->gn_card(itmp1, itmp2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_ex_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->ex_card((enum excitation_type)itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_tl_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->tl_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_nt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->nt_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_xq_card(nec_context* in_context, int itmp1) { in_context->xq_card(itmp1); } /* "gd" card, ground representation */ void nec_gd_card(nec_context* in_context, double tmp1, double tmp2, double tmp3, double tmp4) { in_context->gd_card(tmp1, tmp2, tmp3, tmp4); } /* "rp" card, standard observation angle parameters */ void nec_rp_card(nec_context* in_context, int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, double theta0, double phi0, double delta_theta, double delta_phi, double radial_distance, double gain_norm) { in_context->rp_card(calc_mode, n_theta, n_phi, output_format, normalization, D, A, theta0, phi0, delta_theta, delta_phi, radial_distance, gain_norm); } /* "pt" card, print control for current */ void nec_pt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pt_card(itmp1, itmp2, itmp3, itmp4); } /* "pq" card, print control for charge */ void nec_pq_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pq_card(itmp1, itmp2, itmp3, itmp4); } /* "kh" card, matrix integration limit */ void nec_kh_card(nec_context* in_context, double tmp1); void nec_ne_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->ne_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_nh_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->nh_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } /* "ek" card, extended thin wire kernel option */ void nec_ek_card(nec_context* in_context, int itmp1) { in_context->set_extended_thin_wire_kernel(-1 != itmp1); } /* "cp" card, maximum coupling between antennas */ void nec_cp_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->cp_card(itmp1, itmp2, itmp3, itmp4); } /* "pl" card, plot flags throws int on error. */ void nec_pl_card(nec_context* in_context, char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pl_card(ploutput_filename, itmp1, itmp2, itmp3, itmp4); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_debug.h0000644000175000017500000000404110325372102020717 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2005 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef __nec_debug__ #define __nec_debug__ #include #include #include #ifdef NEC_ERROR_CHECK #define DEBUG_TRACE(__x) {std::cout << __x << std::endl;} #define ASSERT(__x) \ { if (false == (__x))\ { std::stringstream __ss; \ __ss << "assert in file " << __FILE__ << " at line " << __LINE__;\ std::string __s = __ss.str(); \ throw __s.c_str(); \ } \ } #define ASSERT_EQUAL(__x, __y) ASSERT(fabs((__x) - (__y)) < 1e-15) #else #define DEBUG_TRACE(__x) #define ASSERT(__x) #define ASSERT_EQUAL(__x, __y) #endif /* NEC_ERROR_CHECK */ #endif /* __nec_debug__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/CurrentInput.h0000644000175000017500000000427110325372102021453 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Current_Input__ #define __Current_Input__ #include "math_util.h" #include #include "BaseInput.h" class segment { public: int number; int tag; nec_float x,y,z; nec_float length; nec_complex current; // Read the segment data from a NEC-2 output file segment(istream& m_stream) { } }; class CurrentInput : public BaseInput { public: vector segments; long n_items; CurrentInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("CURRENTS AND LOCATION"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("PHASE",0) == string::npos) line = readline(); line = readline(); while (line != "") { stringstream ss(line); segment s(ss); segments.push_back(s); line = readline(); n_items++; } cout << "Currents and Location: " << n_items << " lines" << endl; } } } bool equalto(const CurrentInput& ai) { if (difference(ai) > 1e-5) return false; return true; } nec_float difference(const CurrentInput& ai) { nec_float ret = 0.0; if (n_items != ai.n_items) return 1; for (long i=0; i < n_items;i++) { try { ret += segments[i].diff(ai.segments[i]); } catch (string message) { cout << "Diff at segment [" << i << "] : " << message << endl; } } return ret; }; }; #endif /* __Current_Input__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/math_util.h0000644000175000017500000001442610325372102021002 0ustar numanuma#ifndef __math_util__ #define __math_util__ /* Various Useful Math Utilities for nec2++ Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "safe_array.h" /*! This typedef allows us to use nec2++ with a different complex number precision. For example float, or long double. */ typedef double nec_float; typedef std::complex nec_complex; typedef safe_array int_array; typedef safe_array real_array; typedef safe_array complex_array; inline nec_complex cplx_00() { static nec_complex _cplx00(0.0,0.0); return _cplx00; } inline nec_complex cplx_01() { static nec_complex _cplx01(0.0,1.0); return _cplx01; } inline nec_complex cplx_10() { static nec_complex _cplx10(1.0,0.0); return _cplx10; } inline nec_complex cplx_11() { static nec_complex _cplx11(1.0,1.0); return _cplx11; } inline nec_complex cplx_exp(nec_float x) { return nec_complex(cos(x),sin(x)); } inline nec_float pi() { static nec_float _pi = 3.1415926536; return _pi; } inline nec_float two_pi() { static nec_float _tmp = 2.0 * pi(); return _tmp; } inline nec_float pi_two() { static nec_float _tmp = pi() / 2.0; return _tmp; } inline nec_complex two_pi_j() { static nec_complex _tmp(0.0,two_pi()); return _tmp; } inline nec_float rad_to_degrees(nec_float in_radians) { static nec_float _rad_to_deg = 360.0 / (2 * pi()); // 57.29577951 return in_radians * _rad_to_deg; } inline nec_float degrees_to_rad(nec_float in_degrees) { static nec_float _deg_to_rad = (2 * pi()) / 360.0; return in_degrees * _deg_to_rad; } /** Create a complex number from a magnitude and an angle in degrees. */ inline nec_complex deg_polar(nec_float r, nec_float theta) { return std::polar(r, degrees_to_rad(theta)); } /** Get the angle of a complex number in degrees. */ inline nec_float arg_degrees(nec_complex z) { return rad_to_degrees(std::arg(z)); } /** atgn2 is the arctangent function modified to return 0 when x=y=0. */ inline nec_float atgn2( nec_float x, nec_float y) { if ((0.0 == y) && (0.0 == x)) return 0.0; return( std::atan2(y, x) ); } /** This function returns db for magnitude (field) */ inline nec_float db10( nec_float x ) { if ( x < 1.0e-20 ) return( -999.99 ); return( 10.0 * log10(x) ); } /** This function returns db for mag**2 (power) */ inline nec_float db20( nec_float x ) { if ( x < 1.0e-20 ) return( -999.99 ); return( 20.0 * log10(x) ); } inline nec_float norm(const nec_float x, const nec_float y) { return std::sqrt(x*x + y*y); } inline nec_float norm(const nec_float x, const nec_float y, const nec_float z) { return std::sqrt(x*x + y*y + z*z); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1(const nec_float x, const nec_float y, const nec_float z) { return std::fabs(x) + std::fabs(y) + std::fabs(z); } inline nec_float norm2(const nec_float x, const nec_float y, const nec_float z) { return (x*x + y*y + z*z); } /** \brief A Class for handling 3 dimensional vectors */ class nec_3vector { public: nec_3vector(const nec_float& in_x, const nec_float& in_y, const nec_float& in_z) : m_x(in_x), m_y(in_y), m_z(in_z) { }; nec_3vector(const nec_3vector& copy) : m_x(copy.m_x), m_y(copy.m_y), m_z(copy.m_z) { }; /**!\brief The Euclidian norm */ inline nec_float norm() const { return ::norm(m_x, m_y, m_z); } inline nec_float norm2() const { return ::norm2(m_x, m_y, m_z); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1() const { return ::normL1(m_x, m_y, m_z); } inline nec_3vector& operator=(const nec_3vector& copy) { m_x = copy.m_x; m_y = copy.m_y; m_z = copy.m_z; return *this; } inline int operator==(const nec_3vector& copy) const { if (m_x != copy.m_x) return 0; if (m_y != copy.m_y) return 0; if (m_z != copy.m_z) return 0; return 1; } inline nec_3vector& operator+=(const nec_3vector& a) { m_x += a.m_x; m_y += a.m_y; m_z += a.m_z; return *this; } inline nec_3vector operator+(nec_float a) const { return nec_3vector(m_x + a, m_y + a, m_z + a); } inline nec_3vector operator+(const nec_3vector& a) const { return nec_3vector(m_x + a.m_x, m_y + a.m_y, m_z + a.m_z); } inline nec_3vector& operator-=(const nec_3vector& a) { m_x -= a.m_x; m_y -= a.m_y; m_z -= a.m_z; return *this; } inline nec_3vector operator-(const nec_3vector& a) const { return nec_3vector(m_x - a.m_x, m_y - a.m_y, m_z - a.m_z); } inline nec_3vector& operator/=(const nec_float& a) { m_x /= a; m_y /= a; m_z /= a; return *this; } inline nec_3vector operator/(nec_float a) const { return nec_3vector(m_x / a, m_y / a, m_z / a); } inline nec_float dot(const nec_3vector& a) const { return (m_x * a.m_x) + (m_y * a.m_y) + (m_z * a.m_z); } inline nec_3vector& operator*=(const nec_float& a) { m_x *= a; m_y *= a; m_z *= a; return *this; } inline nec_3vector operator*(nec_float a) const { return nec_3vector(m_x * a, m_y * a, m_z * a); } /**\brief Cross-product */ nec_3vector operator*(const nec_3vector& a) const { return nec_3vector( m_y*a.m_z - m_z*a.m_y, m_z*a.m_x - m_x*a.m_z, m_x*a.m_y - m_y*a.m_x ); } inline nec_float x() const { return m_x; } inline nec_float y() const { return m_y; } inline nec_float z() const { return m_z; } private: nec_float m_x, m_y, m_z; }; /**!\brief The Euclidian norm */ inline nec_float norm(const nec_3vector& v) { return v.norm(); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1(const nec_3vector& v) { return v.normL1(); } #endif /* __math_util__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec2cpp.h0000644000175000017500000000031410325372102020335 0ustar numanuma/* * nec2cpp.h - header file for nec2 c++ */ #include "math_util.h" using namespace std; int main(int argc, char **argv); void fblock(int nrow, int ncol, int imax, int ipsym); #include "misc.h" necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_evlcom.h0000644000175000017500000000462710325372102020605 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_evlcom__ #define __c_evlcom__ #include "math_util.h" void bessel(nec_complex z, nec_complex *j0, nec_complex *j0p); void hankel(nec_complex z, nec_complex *h0, nec_complex *h0p); class c_evlcom { public: nec_float m_ck2, m_ck2sq, m_tkmag, m_tsmag, m_ck1r, m_zph, m_rho; nec_complex m_ct1, m_ct2, m_ct3, m_ck1, m_ck1sq, m_cksm; nec_complex m_contour_a, m_contour_b; /*! \brief Compute integration parameter xlam=lambda from parameter t. */ void lambda( nec_float t, nec_complex *xlam, nec_complex *dxlam ) const; /*! \brief gshank integrates the 6 Sommerfeld integrals from start to infinity (until convergence) in lambda. At the break point, bk, the step increment may be changed from dela to delb. Shank's algorithm to accelerate convergence of a slowly converging series is used. */ void gshank( nec_complex start, nec_complex dela, complex_array& sum, int nans, complex_array& seed, int ibk, nec_complex bk, nec_complex delb ); /*! \brief rom1 integrates the 6 Sommerfeld integrals from m_contour_a to m_contour_b in lambda. The method of variable interval width Romberg integration is used. */ void rom1( int n, complex_array& sum, int nx ); /*! \brief saoa computes the integrand for each of the 6 Sommerfeld integrals for source and observer above ground. */ void saoa( nec_float t, complex_array& ans); /*! \brief evlua controls the integration contour in the complex lambda plane for evaluation of the Sommerfeld integrals. */ void evlua( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *eph ); private: /*! \brief Flag to select Bessel or Hankel function form (was jh) */ bool m_bessel_flag; }; #endif /* __c_evlcom__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/misc.h0000644000175000017500000000113310325372102017736 0ustar numanuma#ifndef __MISC__ #define __MISC__ #include #include "math_util.h" /* carriage return and line feed */ #define CR 0x0d #define LF 0x0a /* max length of a line read from input file */ #define LINE_LEN 132 /* usage() * * prints usage information */ void usage(void); /* Returns process time (user+system) BUT in _msec_ */ void secnds( nec_float *x); /* load_line() * * Loads a line from a file, aborts on failure. Lines beginning * with a '#' are ignored as comments. At the end of file EOF is * returned. */ int load_line( char *buff, FILE *pfile ); #endif /* __MISC__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_radiation_pattern.cpp0000644000175000017500000004324010325372102023677 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_radiation_pattern.h" #include "nec_context.h" #include "c_geometry.h" #include "nec_exception.h" int nec_radiation_pattern::get_index(int theta_index, int phi_index) const { if (theta_index >= n_theta) throw new nec_exception("nec_radiation_pattern: Theta index too large"); if (phi_index >= n_phi) throw new nec_exception("nec_radiation_pattern: Phi index too large"); return phi_index*n_theta + theta_index; } nec_radiation_pattern::nec_radiation_pattern(int in_n_theta, int in_n_phi, nec_float in_theta_start, nec_float in_phi_start, nec_float in_delta_theta, nec_float in_delta_phi, nec_float in_range, nec_ground& in_ground, int in_ifar, nec_float in_wavelength, nec_float pinr, nec_float pnlr, int in_rp_output_format, int in_rp_normalization, int in_rp_ipd, int in_rp_power_average, nec_float in_gnor, c_plot_card& in_plot_card) : m_ground(in_ground), m_plot_card(in_plot_card) { n_theta = in_n_theta; n_phi = in_n_phi; m_theta_start = in_theta_start; m_phi_start = in_phi_start; delta_theta = in_delta_theta; delta_phi = in_delta_phi; m_range = in_range; // was rfld m_rp_output_format = in_rp_output_format; m_rp_normalization = in_rp_normalization; m_rp_ipd = in_rp_ipd; m_rp_power_average = in_rp_power_average; // was iavp m_rp_gnor = in_gnor; int n_angles = n_theta * n_phi; _gain.resize(n_angles); _power_gain_vert.resize(n_angles); _power_gain_horiz.resize(n_angles); _power_gain_tot.resize(n_angles); _polarization_axial_ratio.resize(n_angles); _polarization_tilt.resize(n_angles); _polarization_sense_index.resize(n_angles); _e_theta.resize(n_angles); _e_phi.resize(n_angles); _e_r.resize(n_angles); _ifar = in_ifar; _wavelength = in_wavelength; _pinr = pinr; _pnlr = pnlr; m_analysis_done = false; _maximum_gain = -999.0; } /*! \brief Write the analyzed data to a file */ void nec_radiation_pattern::write_to_file_aux(ostream& os) { if (false == m_analysis_done) throw new nec_exception("Internal Error: Radiation Pattern Analysis not done"); static char *hpol[4] = { "LINEAR", "RIGHT ", "LEFT ", " " }; static char *gain_type[2] = { "----- POWER GAINS ----- ", "--- DIRECTIVE GAINS ---" }; static char *igax[4] = { " MAJOR", " MINOR", " VERTC", " HORIZ" }; int i; output_helper oh(os,_result_format); if ( _ifar >= 2) { oh.section_start(); os << " ------ FAR FIELD GROUND PARAMETERS ------" << endl << endl; if ( _ifar > 3) { os << endl; os << " RADIAL WIRE GROUND SCREEN" << endl; os << " "; oh.int_out(5, m_ground.radial_wire_count); os << " WIRES" << endl; os << " WIRE LENGTH= "; oh.real_out(8,2, m_ground.radial_wire_length,false); os << " METERS" << endl; os << " WIRE RADIUS= "; oh.real_out(10,3, m_ground.radial_wire_radius); os << " METERS" << endl; } /* if ( _ifar > 3) */ if ( _ifar != 4 ) { std::string hclif; if ( (_ifar == 2) || (_ifar == 5) ) hclif = "LINEAR"; if ( (_ifar == 3) || (_ifar == 6) ) hclif= "CIRCLE"; os << endl; os << " " << hclif << " CLIFF" << endl; os << " EDGE DISTANCE= "; oh.real_out(9,2,m_ground.cliff_edge_distance,false); os << " METERS" << endl; os << " HEIGHT= "; oh.real_out(8,2,m_ground.cliff_height,false); os << " METERS" << endl; os << " SECOND MEDIUM -" << endl; os << " RELATIVE DIELECTRIC CONST.= "; oh.real_out(7,3,m_ground.epsr2, false); os << endl; os << " CONDUCTIVITY= "; oh.real_out(10,3,m_ground.sig2,false); os << " MHOS" << endl; } /* if ( _ifar != 4 ) */ } /* if ( _ifar >= 2) */ if ( _ifar == 1) { oh.section_start(); os << " ------- RADIATED FIELDS NEAR GROUND --------" << endl << endl; os << " ------- LOCATION ------- --- E(THETA) --- ---- E(PHI) ---- --- E(RADIAL) ---" << endl; os << " RHO PHI Z MAG PHASE MAG PHASE MAG PHASE" << endl; os << " METERS DEGREES METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" << endl; } else // _ifar != 1 { oh.section_start(); os << " ---------- RADIATION PATTERNS -----------" << endl << endl; if ( m_range >= 1.0e-20) { nec_float exrm = 1.0 / m_range; nec_float exra = m_range/ _wavelength; exra = -360.0*(exra - floor(exra)); os << " RANGE: "; oh.real_out(13,6,m_range); os << " METERS" << endl; os << " EXP(-JKR)/R: "; oh.real_out(12,5,exrm); os << " AT PHASE: "; oh.real_out(7,2,exra,false); os << " DEGREES" << endl; } int itmp1 = 2 * m_rp_output_format; int itmp2 = itmp1+1; os << " ---- ANGLES ----- "; oh.string_out(23,gain_type[m_rp_ipd]); os << " ---- POLARIZATION ---- ---- E(THETA) ---- ----- E(PHI) ------" << endl; os << " THETA PHI "; oh.string_out(6,igax[itmp1]); os << " "; oh.string_out(6,igax[itmp2]); os << " TOTAL AXIAL TILT SENSE MAGNITUDE PHASE MAGNITUDE PHASE" << endl; os << " DEGREES DEGREES DB DB DB RATIO DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" << endl; } /* if ( _ifar == 1) */ i=0; nec_float phi = m_phi_start- delta_phi; for (int kph = 1; kph <= n_phi; kph++ ) { phi += delta_phi; nec_float thet= m_theta_start- delta_theta; for(int kth = 1; kth <= n_theta; kth++ ) { thet += delta_theta; if ( m_ground.present() && (thet > 90.01) && (_ifar != 1) ) continue; /* elliptical polarization */ if ( _ifar == 1) { nec_complex e_theta = _e_theta[i]; nec_complex e_phi = _e_phi[i]; nec_complex e_r = _e_r[i]; oh.start_record(); oh.padding(" "); oh.real_out(9,2,m_range,false); oh.separator(); oh.real_out(7,2,phi,false); oh.separator(); oh.real_out(9,2,thet,false); oh.separator(); oh.real_out(11,4,abs(e_theta)); oh.separator(); oh.real_out(7,2,arg_degrees(e_theta),false); oh.separator(); oh.real_out(11,4,abs(e_phi)); oh.separator(); oh.real_out(7,2,arg_degrees(e_phi),false); oh.separator(); oh.real_out(11,4,abs(e_r)); oh.separator(); oh.real_out(7,2,arg_degrees(e_r),false); oh.end_record(); } else { nec_complex e_theta = _e_theta[i]; nec_complex e_phi = _e_phi[i]; char* pol_sense = hpol[_polarization_sense_index[i]]; oh.start_record(); oh.padding(" "); oh.real_out(7,2,thet,false); oh.separator(); oh.real_out(9,2,phi,false); oh.separator(); oh.padding(" "); oh.real_out(8,2,_power_gain_vert[i],false); oh.separator(); oh.real_out(8,2,_power_gain_horiz[i],false); oh.separator(); oh.real_out(8,2,_power_gain_tot[i],false); oh.separator(); oh.real_out(11,4,_polarization_axial_ratio[i],false); oh.separator(); oh.real_out(9,2,_polarization_tilt[i],false); oh.separator(); oh.string_out(6,pol_sense); oh.separator(); oh.real_out(11,4,abs(e_theta)); oh.separator(); oh.real_out(9,2,arg_degrees(e_theta),false); oh.separator(); oh.real_out(11,4,abs(e_phi)); oh.separator(); oh.real_out(9,2,arg_degrees(e_phi),false); oh.end_record(); m_plot_card.plot_patterns(thet, phi, e_theta, e_phi, _power_gain_vert[i], _power_gain_horiz[i], _power_gain_tot[i]); } /* if ( _ifar != 1) */ i++; } /* for( kth = 1; kth <= n_theta; kth++ ) */ } /* for( kph = 1; kph <= n_phi; kph++ ) */ if ( m_rp_power_average != 0) { oh.section_start(); os << " AVERAGE POWER GAIN: "; oh.real_out(11,4,_average_power_gain); os << " - SOLID ANGLE USED IN AVERAGING: ("; oh.real_out(7,4,_average_power_solid_angle,false); os << ")*PI STERADIANS" << endl; } if ( m_rp_normalization != 0) write_normalized_gain(os); } /*! \brief Generate the data for the radiation pattern */ void nec_radiation_pattern::analyze(nec_context* m_context) { static nec_float s_impedance = 376.73; // impedance of free space if (m_analysis_done) return; int pol_sense_index; nec_float exrm=0., exra=0., prad, gcon, gcop; nec_float phi, thet; nec_float tilta, emajr2, eminr2, pol_axial_ratio; nec_float dfaz, dfaz2, cdfaz, tstor1=0., tstor2, stilta; if ((m_context->m_excitation_type == EXCITATION_VOLTAGE) || (m_context->m_excitation_type == EXCITATION_VOLTAGE_DISC) ) { gcop= _wavelength * _wavelength * 2.0 * pi()/(s_impedance * _pinr); prad= _pinr- m_context->structure_power_loss- _pnlr; gcon= gcop; if ( m_context->ipd != 0) gcon= gcon* _pinr/ prad; } else if ( m_context->m_excitation_type == EXCITATION_CURRENT) { _pinr=394.51* m_context->xpr6* m_context->xpr6* _wavelength* _wavelength; gcop= _wavelength* _wavelength*2.* pi()/(s_impedance * _pinr); prad= _pinr- m_context->structure_power_loss- _pnlr; gcon= gcop; if ( m_context->ipd != 0) gcon= gcon* _pinr/ prad; } else { prad=0.; gcon=4.* pi()/(1.0+ m_context->xpr6* m_context->xpr6); gcop= gcon; } if ( m_range >= 1.0e-20) { exrm=1./ m_range; exra= m_range/ _wavelength; exra=-360.*( exra- floor( exra)); } int result_counter=0; nec_float pint = 0.0; nec_float delta_phi_rad = degrees_to_rad(delta_phi); nec_float tmp2 = 0.5 * degrees_to_rad(delta_theta); phi= m_phi_start- delta_phi; for (int kph = 1; kph <= n_phi; kph++ ) { phi += delta_phi; nec_float pha = degrees_to_rad(phi); thet= m_theta_start- delta_theta; for (int kth = 1; kth <= n_theta; kth++ ) { thet += delta_theta; if ( m_ground.present() && (thet > 90.01) && (_ifar != 1) ) continue; nec_float tha = degrees_to_rad(thet); nec_complex eth, eph; if ( 1 == _ifar) { bool space_wave_only = (false == m_ground.present()); nec_complex erd; m_context->gfld(m_range/_wavelength, pha, thet/_wavelength, ð, &eph, &erd, space_wave_only, _wavelength ); _e_theta[result_counter] = eth; _e_phi[result_counter] = eph; _e_r[result_counter] = erd; } else { m_context->ffld(tha, pha, ð, &eph, _wavelength); nec_float ethm2= norm(eth); nec_float ethm= sqrt(ethm2); nec_float etha= arg_degrees(eth); nec_float ephm2= norm(eph); nec_float ephm= sqrt( ephm2); nec_float epha= arg_degrees( eph); /* elliptical polarization calc. */ if ( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) { tilta=0.; emajr2=0.; eminr2=0.; pol_axial_ratio=0.; pol_sense_index = 3; } else { dfaz= epha- etha; if ( epha >= 0.) dfaz2= dfaz-360.; else dfaz2= dfaz+360.; if ( fabs(dfaz) > fabs(dfaz2) ) dfaz= dfaz2; cdfaz= cos(degrees_to_rad(dfaz)); tstor1= ethm2- ephm2; tstor2=2.* ephm* ethm* cdfaz; tilta=.5* atan2( tstor2, tstor1); stilta= sin( tilta); tstor1= tstor1* stilta* stilta; tstor2= tstor2* stilta* cos( tilta); emajr2=- tstor1+ tstor2+ ethm2; eminr2= tstor1- tstor2+ ephm2; if ( eminr2 < 0.) eminr2=0.; pol_axial_ratio= sqrt( eminr2/ emajr2); tilta= rad_to_degrees(tilta); if ( pol_axial_ratio <= 1.0e-5) pol_sense_index = 0; else if ( dfaz <= 0.) pol_sense_index = 1; else pol_sense_index = 2; } /* if ( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) */ /* Gain Normalization Variables */ nec_float gnmj= db10( gcon* emajr2); nec_float gnmn= db10( gcon* eminr2); nec_float gnv = db10( gcon* ethm2); nec_float gnh = db10( gcon* ephm2); nec_float gtot= db10( gcon*(ethm2+ ephm2) ); if (m_rp_normalization > 0) { nec_float temp_gain; switch(m_rp_normalization ) { case 1: temp_gain = gnmj; break; case 2: temp_gain = gnmn; break; case 3: temp_gain = gnv; break; case 4: temp_gain = gnh; break; case 5: temp_gain = gtot; break; default: throw new nec_exception("Unknown Gain Normalization Encountered."); } _gain[result_counter] = temp_gain; } /* if ( m_rp_normalization > 0) */ if ( m_rp_power_average != 0) { // compute the numerical integral of the power gain in angular co-ordinates tstor1= gcop*( ethm2+ ephm2); nec_float tmp3 = tha - tmp2; nec_float tmp4 = tha + tmp2; if ( kth == 1) tmp3= tha; else if ( kth == n_theta) tmp4= tha; nec_float da = fabs( delta_phi_rad*( cos(tmp3)- cos(tmp4))); if ( (kph == 1) || (kph == n_phi) ) da *=.5; pint += tstor1 * da; if ( m_rp_power_average == 2) // do not print the power gain values (just compute the average) continue; } if ( m_rp_output_format != 1) { _power_gain_vert[result_counter] = gnmj; _power_gain_horiz[result_counter] = gnmn; } else { _power_gain_vert[result_counter] = gnv; _power_gain_horiz[result_counter] = gnh; } ethm *= _wavelength; ephm *= _wavelength; if ( m_range >= 1.0e-20 ) { ethm= ethm* exrm; etha= etha+ exra; ephm= ephm* exrm; epha= epha+ exra; } _e_theta[result_counter] = deg_polar(ethm, etha); _e_phi[result_counter] = deg_polar(ephm, epha); _power_gain_tot[result_counter] = gtot; _polarization_axial_ratio[result_counter] = pol_axial_ratio; _polarization_tilt[result_counter] = tilta; _polarization_sense_index[result_counter] = pol_sense_index; } /* if ( _ifar == 1) */ result_counter++; } /* for( kth = 1; kth <= n_theta; kth++ ) */ } /* for( kph = 1; kph <= n_phi; kph++ ) */ if ( m_rp_power_average != 0) { /* nec_float tmp3 = degrees_to_rad(m_theta_start); tmp4 = tmp3 + degrees_to_rad(delta_theta) * (nec_float)(n_theta-1); tmp3 = fabs( degrees_to_rad(delta_phi) * (nec_float)( n_phi-1)*( cos( tmp3)- cos( tmp4))); pint /= tmp3; tmp3 /= pi(); _average_power_gain = pint; _average_power_solid_angle = tmp3; */ // We now compute the solid angle over which the power is averaged nec_float theta_start_rad = degrees_to_rad(m_theta_start); nec_float theta_range = degrees_to_rad(delta_theta) * (nec_float)(n_theta-1); nec_float phi_range = degrees_to_rad(delta_phi) * (nec_float)(n_phi-1); nec_float total_theta = theta_start_rad + theta_range; nec_float solid_angle = fabs(phi_range * (cos(theta_start_rad) - cos(total_theta)) ); _average_power_gain = pint / solid_angle; _average_power_solid_angle = solid_angle / pi(); // We display it as a multiple of pi() } _maximum_gain = _gain.max(); m_analysis_done = true; } nec_float nec_radiation_pattern::get_gain_normalization_factor(nec_float gnor) { if ( fabs(gnor) > 1.0e-20) return gnor; if (false == m_analysis_done) throw new nec_exception("Internal Error: Radiation Pattern Analysis not done"); return _maximum_gain; } void nec_radiation_pattern::write_normalized_gain(ostream& os) { // if is non-zero then use it as a normaliztion factor nec_float normalization_factor = get_gain_normalization_factor(m_rp_gnor); string norm_type; switch (m_rp_normalization) { case 1: norm_type = " MAJOR AXIS"; break; case 2: norm_type = " MINOR AXIS"; break; case 3: norm_type = " VERTICAL"; break; case 4: norm_type = " HORIZONTAL"; break; case 5: norm_type = " TOTAL "; break; default: throw new nec_exception("Unknown Gain Normalization Encountered."); } output_helper oh(os,_result_format); oh.section_start(); os << " ---------- NORMALIZED GAIN ----------" << endl; os << " " << norm_type << " GAIN" << endl; os << " NORMALIZATION FACTOR: "; oh.real_out(7,2,normalization_factor,false); os << " db" << endl << endl; os << " ---- ANGLES ---- ---- ANGLES ---- ---- ANGLES ----" << endl; os << " THETA PHI GAIN THETA PHI GAIN THETA PHI GAIN" << endl; os << " DEGREES DEGREES DB DEGREES DEGREES DB DEGREES DEGREES DB" << endl; int row_count = 0; int n_cols = 3; int item_count = 0; for (int p=0;p #include /* Replaces the "10000" limit used to */ /* identify segment/patch connections */ #define PCHCON 100000 class nec_context; #include "nec_output.h" /**! \brief Use of the c_geometry class. c_geometry g = new c_geometry(); g.parse_geometry(file); OR c_geometry g = new c_geometry(); g.wire(xxxxxxx); g.arc(); ... g.geometry_complete(); */ class c_geometry { public: c_geometry(); void set_context(nec_context* m_context); void wire( int tag_id, int segment_count, nec_float xw1, nec_float yw1, nec_float zw1, // first co-ordinate nec_float xw2, nec_float yw2, nec_float zw2, // second co-ordinate nec_float rad, // wire radius (=0 if tapered) nec_float rdel, nec_float rrad); // set to 1.0 if not tapered void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); void helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ); 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 reflect( int ix, int iy, int iz, int itx, int nop ); void scale( nec_float xw1); void patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ); /*! \brief Geometry is complete \exception nec_exception* If there is an error with the geometry. */ void geometry_complete(nec_context* m_context, int card_int_1, int card_int_2); /*!\brief Parse an NEC geometry description contained in the file input_fp */ void parse_geometry(nec_context* m_context, FILE* input_fp); /*!\brief Helper method to decide whether extended. thin-wire approximation can be used */ int test_ek_approximation(int seg1, int seg2); int get_segment_number( int in_tag, int m); void frequency_scale(nec_float freq_mhz); void tbf( int i, int icap); void trio( int j ); void get_current_coefficients(nec_float wavelength, complex_array& curx, real_array& air, real_array& aii, real_array& bir, real_array& bii, real_array& cir, real_array& cii, complex_array& vqds, int nqds, int_array& iqds); nec_float patch_angle(int patch_index, nec_float in_ax, nec_float in_ay, nec_float in_az); /*! \brief Calculate the xyz components of the electric field due to surface currents. */ void fflds(nec_float rox, nec_float roy, nec_float roz, complex_array& scur, nec_complex *in_ex, nec_complex *in_ey, nec_complex *in_ez ); int n; // The number of segments int np; int_array segment_tags; real_array x, y, z, segment_length, segment_radius; real_array x2, y2, z2, cab, sab, salp; int m, mp; // The number of patches int m_ipsym; real_array t1x, t1y, t1z, t2x, t2y, t2z; // t1, t2 basis co-ordinates? real_array px, py, pz, pbi, psalp; // patch data int n_plus_m, n_plus_2m, n_plus_3m; /* n+m,n+2m,n+3m */ int_array icon1, icon2; // Connected Segment Information (was common /segj/ in FORTRAN code) int jsno, nscon, maxcon; /* Max. no. connections */ int_array jco; real_array ax, bx, cx; private: // The geometry data measured in meters is stored in these arrays // and the x,y,z,si,bi arrays are then scaled for each frequency real_array x_unscaled, y_unscaled, z_unscaled, si_unscaled, bi_unscaled; real_array px_unscaled, py_unscaled, pz_unscaled, pbi_unscaled; void sbf( int i, int is, nec_float *aa, nec_float *bb, nec_float *cc ); void divide_patch( int nx ); void connect_segments( int ignd ); void read_geometry_card(FILE* input_fp, char *gm, int *i1, int *i2, nec_float *x1, nec_float *y1,nec_float *z1, nec_float *x2, nec_float *y2, nec_float *z2, nec_float *rad ); nec_context* m_context; nec_output_file* m_output; }; #endif /* __c_geometry__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/misc.cpp0000644000175000017500000000556610325372102020307 0ustar numanuma/* * Miscellaneous support functions for nec2++ */ #include "misc.h" #include using namespace std; /*------------------------------------------------------------------------*/ /* usage() * * prints usage information */ void usage(void) { fprintf( stderr, "usage: nec2++ [-i] [-o]" "\n -g: print maximum gain to stdout." "\n -b: Perform NEC++ Benchmark." "\n -s: print results to standard output." "\n -c: print results in comma-separated-value (CSV) format," "\n this options is used in conjunction with (-s) above." "\n -h: print this usage information and exit." "\n -v: print nec2++ version number and exit.\n"); } /* end of usage() */ /*------------------------------------------------------------------------*/ /* Returns process time (user+system) BUT in _msec_ */ #ifndef _WIN32 #include #include void secnds( nec_float *x) { struct tms buffer; times(&buffer); *x = 1000.0 * ( (nec_float)(buffer.tms_utime + buffer.tms_stime) ) / ( (nec_float) sysconf(_SC_CLK_TCK) ); } #else #include void secnds( nec_float *x) { nec_float c = nec_float(clock()); *x = (1000.0 * c) / CLOCKS_PER_SEC; } #endif /*------------------------------------------------------------------*/ /* load_line() * * loads a line from a file, aborts on failure. lines beginning * with a '#' are ignored as comments. at the end of file EOF is * returned. */ int load_line( char *buff, FILE *pfile ) { int num_chr = 0, /* number of characters read, excluding lf/cr */ eof = 0, /* EOF flag */ chr; /* character read by getc */ /* clear buffer at start */ buff[0] = '\0'; /* ignore commented lines, white spaces and eol/cr */ if( (chr = fgetc(pfile)) == EOF ) return( EOF ); while( (chr == '#') || (chr == ' ') || (chr == CR ) || (chr == LF ) ) { /* go to the end of line (look for lf or cr) */ while( (chr != CR) && (chr != LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); /* dump any cr/lf remaining */ while( (chr == CR) || (chr == LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); } /* end of while( (chr == '#') || ... */ while( num_chr < LINE_LEN ) { /* if lf/cr reached before filling buffer, return */ if( (chr == CR) || (chr == LF) ) break; /* enter new char to buffer */ buff[num_chr++] = chr; /* terminate buffer as a string on EOF */ if( (chr = fgetc(pfile)) == EOF ) { buff[num_chr] = '\0'; eof = EOF; } } /* end of while( num_chr < max_chr ) */ /* Capitalize first two characters (mnemonics) */ if( (buff[0] > 0x60) && (buff[0] < 0x79) ) buff[0] -= 0x20; if( (buff[1] > 0x60) && (buff[1] < 0x79) ) buff[1] -= 0x20; /* terminate buffer as a string */ buff[num_chr] = '\0'; return( eof ); } /* end of load_line() */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/XGetopt.cpp0000644000175000017500000001304410325372102020734 0ustar numanuma// XGetopt.cpp Version 1.1 // // Author: Hans Dietrich // hdietrich2@hotmail.com // // This software is released into the public domain. // You are free to use it in any way you like. // // This software is provided "as is" with no expressed // or implied warranty. I accept no liability for any // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include "XGetopt.h" /////////////////////////////////////////////////////////////////////////////// // // X G e t o p t . c p p // // // NAME // getopt -- parse command line options // // SYNOPSIS // int getopt(int argc, char *argv[], char *optstring) // // extern char *optarg; // extern int optind; // // DESCRIPTION // The getopt() function parses the command line arguments. Its // arguments argc and argv are the argument count and array as // passed into the application on program invocation. In the case // of Visual C++ programs, argc and argv are available via the // variables __argc and __argv (double underscores), respectively. // getopt returns the next option letter in argv that matches a // letter in optstring. // // optstring is a string of recognized option letters; if a letter // is followed by a colon, the option is expected to have an argument // that may or may not be separated from it by white space. optarg // is set to point to the start of the option argument on return from // getopt. // // Option letters may be combined, e.g., "-ab" is equivalent to // "-a -b". Option letters are case sensitive. // // getopt places in the external variable optind the argv index // of the next argument to be processed. optind is initialized // to 0 before the first call to getopt. // // When all options have been processed (i.e., up to the first // non-option argument), getopt returns EOF, optarg will point // to the argument, and optind will be set to the argv index of // the argument. If there are no non-option arguments, optarg // will be set to NULL. // // The special option "--" may be used to delimit the end of the // options; EOF will be returned, and "--" (and everything after it) // will be skipped. // // RETURN VALUE // For option letters contained in the string optstring, getopt // will return the option letter. getopt returns a question mark (?) // when it encounters an option letter not included in optstring. // EOF is returned when processing is finished. // // BUGS // 1) Long options are not supported. // 2) The GNU double-colon extension is not supported. // 3) The environment variable POSIXLY_CORRECT is not supported. // 4) The + syntax is not supported. // 5) The automatic permutation of arguments is not supported. // 6) This implementation of getopt() returns EOF if an error is // encountered, instead of -1 as the latest standard requires. // // EXAMPLE // BOOL CMyApp::ProcessCommandLine(int argc, char *argv[]) // { // int c; // // while ((c = getopt(argc, argv, "aBn:")) != EOF) // { // switch (c) // { // case 'a': // TRACE(_T("option a\n")); // // // // set some flag here // // // break; // // case 'B': // TRACE( _T("option B\n")); // // // // set some other flag here // // // break; // // case 'n': // TRACE(_T("option n: value=%d\n"), atoi(optarg)); // // // // do something with value here // // // break; // // case '?': // TRACE(_T("ERROR: illegal option %s\n"), argv[optind-1]); // return FALSE; // break; // // default: // TRACE(_T("WARNING: no handler for option %c\n"), c); // return FALSE; // break; // } // } // // // // check for non-option args here // // // return TRUE; // } // /////////////////////////////////////////////////////////////////////////////// char *optarg; // global argument pointer int optind = 0; // global argv index int XGetopt(int argc, char *argv[], char *optstring) { char c; char *cp; static char *next = NULL; if (optind == 0) next = NULL; optarg = NULL; if (next == NULL || *next == '\0') { if (optind == 0) optind++; if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') { optarg = NULL; if (optind < argc) optarg = argv[optind]; return EOF; } if (strcmp(argv[optind], "--") == 0) { optind++; optarg = NULL; if (optind < argc) optarg = argv[optind]; return EOF; } next = argv[optind]+1; optind++; } c = *next++; cp = strchr(optstring, c); if (cp == NULL || c == ':') return '?'; cp++; if (*cp == ':') { if (*next != '\0') { optarg = next; next = NULL; } else if (optind < argc) { optarg = argv[optind]; optind++; } else { return '?'; } } return c; } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/electromag.h0000644000175000017500000000214010325372102021124 0ustar numanuma#ifndef __electromag__ #define __electromag__ /* Various Useful Electromagnetism Utilities for nec2cpp Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "math_util.h" namespace em { // Calculate the power from a voltage and a current. inline nec_float power(nec_complex voltage, nec_complex current) { return 0.5* real(voltage * conj(current)); } } #endif /* __electromag__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec2cpp.cpp0000644000175000017500000005165410325372102020705 0ustar numanuma/* Translation to C++ by Tim Molteno Based on the C port by N. Kyriazis Including some pieces from additional work by Jeroen Vreeken Fixed a few bugs in the process. Using the std vector library in preparation for moving to ATLAS for the matrix and vector operations. Debian Build Instructions apt-get install atlas3-base atlas3-headers atlas3-base-dev apt-get install refblas3-dev lapack3-dev lapack3-doc For more information on using LAPACK for doing efficient computation, see http://seehuhn.de/comp/linear.html */ /* Original disclaimer that came with the FORTRAN code */ /******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2cpp.h" #include "nec_exception.h" #include #include #include using namespace std; #include "nec_context.h" #ifndef _WIN32 /* Signal handler */ static void sig_handler( int signal ); #endif /*-------------------------------------------------------------------*/ int nec_main( int argc, char **argv, nec_output_file& s_output ); /* New main() function This places an exception handler around the old main loop to allow errors to be nicely caught! */ int main( int argc, char **argv ) { nec_output_file s_output; try { // This is an nec_3vector testharness { nec_3vector x(1,2,3); nec_3vector y(3,5,1); nec_3vector a = x + y; ASSERT(a == nec_3vector(4,7,4)); a = x * y; ASSERT(a == nec_3vector(-13,8,-1)); a = y * x; ASSERT(a == nec_3vector(13,-8,1)); a = x + 3.0; ASSERT(a == nec_3vector(4,5,6)); nec_float ip = x.dot(y); ASSERT(ip == 16); } nec_main(argc, argv, s_output); } catch (const char* message) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(message); exit(1); } catch (nec_exception* nex) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(nex->get_message().c_str()); exit(1); } } #include "c_geometry.h" void benchmark(); void benchmark() { cout << "The nec2++ benchmark." << endl; cout << "nec2++ version " nec_version << endl << endl; nec_float bench = nec_context::benchmark(); cout << "Your computer's score is: " << bench << " NEC's" << endl; } int readmn(FILE* input_fp, FILE* output_fp, char *gm, int *i1, int *i2, int *i3, int *i4, nec_float *f1, nec_float *f2, nec_float *f3, nec_float *f4, nec_float *f5, nec_float *f6); #include "XGetopt.h" int nec_main( int argc, char **argv, nec_output_file& s_output ) { nec_output_flags s_output_flags; FILE *input_fp=NULL; FILE *output_fp=NULL; string input_filename, output_filename; char ain[3], line_buf[81]; /* input card mnemonic list */ /* "XT" stands for "exit", added for testing */ #define CMD_NUM 20 char *atst[CMD_NUM] = { "FR", "LD", "GN", "EX", "NT", "TL", \ "XQ", "GD", "RP", "NX", "PT", "KH", \ "NE", "NH", "PQ", "EK", "CP", "PL", \ "EN", "WG" }; int itmp3, itmp2, itmp4; int ain_num; /* ain mnemonic as a number */ nec_float tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; nec_float ex_timer; /* getopt() variables */ extern char *optarg; int option; #ifndef _WIN32 /*** signal handler related code ***/ /* new and old actions for sigaction() */ struct sigaction sa_new, sa_old; /* initialize new actions */ sa_new.sa_handler = sig_handler; sigemptyset( &sa_new.sa_mask ); sa_new.sa_flags = 0; /* register function to handle signals */ sigaction( SIGINT, &sa_new, &sa_old ); sigaction( SIGSEGV, &sa_new, 0 ); sigaction( SIGFPE, &sa_new, 0 ); sigaction( SIGTERM, &sa_new, 0 ); sigaction( SIGABRT, &sa_new, 0 ); #endif /*** command line arguments handler ***/ if ( argc == 1 ) { usage(); exit(-1); } bool results_to_stdout = false; bool results_in_csv_format = false; /* process command line options */ while( (option = XGetopt(argc, argv, "i:o:hvscgb") ) != -1 ) { switch( option ) { case 'i' : /* specify input file name */ input_filename = optarg; break; case 'o' : /* specify output file name */ output_filename = optarg; break; case 'g': /* return only the maximum gain to stdout */ s_output_flags.set_gain_only(true); break; case 's': /* return output to stdout */ results_to_stdout = true; break; case 'c': /* use CVS result data */ results_in_csv_format = true; break; case 'h' : /* print usage and exit */ usage(); exit(0); case 'v' : /* print nec2++ version */ #ifdef _MSC_VER cout << ( "nec2++ " nec_version ) << " compiler: " << _MSC_VER << endl; #else cout << ( "nec2++ " nec_version ) << (" compiler: " __VERSION__) << endl; #endif exit(0); case 'b' : /* Run benchmark */ benchmark(); exit(0); default: /* print usage and exit */ usage(); exit(-1); } } /*** open input file ***/ if ( (input_fp = fopen(input_filename.c_str(), "r")) == NULL ) { string mesg = "nec2++: " + input_filename; perror( mesg.c_str() ); exit(-1); } /* make an output file name if not */ /* specified by user on invocation */ if ( output_filename == "" ) { /* strip the input file name extension if there is one */ output_filename = input_filename.substr(0, input_filename.find(".",0)) + ".out"; } /* open output file */ if ( (output_fp = fopen(output_filename.c_str(), "w")) == NULL ) { string mesg = "nec2++: " + output_filename; perror( mesg.c_str() ); exit(-1); } s_output.set_file(output_fp); secnds( &ex_timer ); // allocate a new nec_context; nec_context s_context; s_context.set_output(s_output, s_output_flags); s_context.set_results_stdout(results_to_stdout); if (results_in_csv_format) s_context.set_results_format(RESULT_FORMAT_CSV); s_context.initialize(); /* main execution loop, exits at various points */ /* depending on error conditions or end of jobs */ while( true ) { s_output.end_section(); s_output.set_indent(31); s_output.line(" __________________________________________"); s_output.line("| |"); s_output.line("| NUMERICAL ELECTROMAGNETICS CODE (nec2++) |"); s_output.line("| Translated to 'C++' in Double Precision |"); s_output.line("| Version " nec_version " |"); s_output.line("|__________________________________________|"); /* read a line from input file */ if ( load_line(line_buf, input_fp) == EOF ) throw new nec_exception("Error reading input file."); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* If its an "XT" card, exit (used for debugging) */ if ( strcmp(ain, "XT") == 0 ) { nec_error_mode em(s_output); s_output.end_section(); s_output.line("nec2++: Exiting after an \"XT\" command in main()"); exit(0); } /* if its a "cm" or "ce" card start reading comments */ if ( (strcmp(ain, "CM") == 0) || (strcmp(ain, "CE") == 0) ) { s_output.end_section(); s_output.set_indent(31); s_output.line("---------------- COMMENTS ----------------"); s_output.line(&line_buf[2]); while( strcmp(ain, "CM") == 0 ) { /* read a line from input file */ if ( load_line(line_buf, input_fp) == EOF ) throw new nec_exception("Error reading input file (comments not terminated?)"); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* write comment to output file */ s_output.line(&line_buf[2]); } /* no "ce" card at end of comments */ if ( strcmp(ain, "CE") != 0 ) { throw new nec_exception("ERROR: INCORRECT LABEL FOR A COMMENT CARD"); } } else { rewind( input_fp ); } /* initializations etc from original fortran code */ int data_card_count=0; /* set up geometry data in subroutine parse_geometry */ c_geometry* geo = s_context.get_geometry(); geo->parse_geometry(&s_context, input_fp); s_context.calc_prepare(); s_output.end_section(); /* Main input section, exits at various points depending on error conditions or end of job. This is called the card input loop. */ bool next_job = false; /* start next job (next structure) flag */ while ( ! next_job ) { int itmp1; /* main input section - standard read statement - jumps */ /* to appropriate section for specific parameter set up */ int parameter_count = readmn(input_fp, output_fp, ain, &itmp1, &itmp2, &itmp3, &itmp4, &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6 ); /* If its an "XT" card, exit */ if ( strcmp(ain, "XT" ) == 0 ) { nec_error_mode em(s_output); s_output.endl(); s_output.line("nec2++: Exiting after an \"XT\" command in main()" ); exit(0); } data_card_count++; fprintf( output_fp, "\n***** DATA CARD N0. %3d " "%s %3d %5d %5d %5d %12.5E %12.5E %12.5E %12.5E %12.5E %12.5E", data_card_count, ain, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); /* identify card id mnemonic (except "ce" and "cm") */ for( ain_num = 0; ain_num < CMD_NUM; ain_num++ ) if ( strncmp( ain, atst[ain_num], 2) == 0 ) break; /* take action according to card id mnemonic */ switch( ain_num ) { case 0: /* "fr" card, frequency parameters */ s_context.fr_card(itmp1, itmp2, tmp1, tmp2); continue; case 1: /* "ld" card, loading parameters */ s_context.ld_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3); continue; case 2: /* "gn" card, ground parameters under the antenna */ s_context.gn_card(itmp1, itmp2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 3: /* "ex" card, excitation parameters */ s_context.ex_card((enum excitation_type)itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 4: /* "nt" card, network parameters */ s_context.nt_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 5: /* "tl" card, network parameters */ if (parameter_count < 10) { nec_error_mode em(s_output); s_output.endl(); s_output.line("nec2++: Missing parameters in \"TL\" card. Blank parameters should be specified as zero." ); exit(0); } s_context.tl_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 6: /* "xq" execute card - calc. including radiated fields */ s_context.xq_card(itmp1); continue; case 7: /* "gd" card, ground representation */ s_context.gd_card(tmp1, tmp2, tmp3, tmp4); continue; /* continue card input loop */ case 8: /* "rp" card, standard observation angle parameters */ { // pull out the XNDA parameters here... int XNDA = itmp4; int X = XNDA / 1000; int N = (XNDA / 100) % 10; int D = (XNDA / 10) % 10; int A = XNDA % 10; s_context.rp_card(itmp1, itmp2, itmp3, X, N, D, A, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } continue; /* was break; followed by special code */ case 9: /* "nx" card, do next job */ next_job = true; continue; /* continue card input loop */ case 10: /* "pt" card, print control for current */ s_context.pt_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 11: /* "kh" card, matrix integration limit */ s_context.kh_card(tmp1); continue; /* continue card input loop */ case 12: /* "ne" card, near field calculation parameters */ s_context.ne_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 13: /* "nh" card, near field calculation parameters */ s_context.nh_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 14: /* "pq" card, print control for charge */ s_context.pq_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 15: /* "ek" card, extended thin wire kernel option */ if (-1 == itmp1) s_context.set_extended_thin_wire_kernel(false); else s_context.set_extended_thin_wire_kernel(true); continue; /* continue card input loop */ case 16: /* "cp" card, maximum coupling between antennas */ s_context.cp_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 17: /* "pl" card, plot flags */ { std::string ploutput_filename(input_filename); ploutput_filename += ".plt"; try { s_context.pl_card(ploutput_filename.c_str(), itmp1, itmp2, itmp3, itmp4); } catch(...) { char mesg[88] = "nec2++: "; strcat( mesg, ploutput_filename.c_str() ); perror( mesg ); exit(-1); } } continue; /* continue card input loop */ case 19: /* "wg" card, not supported */ throw new nec_exception("\"WG\" card, not supported."); default: if ( ain_num != 18 ) // EN card { throw new nec_exception("FAULTY DATA CARD LABEL AFTER GEOMETRY SECTION."); } /****************************************************** *** normal exit of nec2++ when all jobs complete ok *** ******************************************************/ s_context.all_jobs_completed(); /* time the process */ secnds( &tmp1 ); tmp1 -= ex_timer; fprintf( output_fp, "\n\n TOTAL RUN TIME: %d msec", (int)tmp1 ); if( input_fp != NULL ) fclose( input_fp ); if( output_fp != NULL ) fclose(output_fp); return(0); } /* switch( ain_num ) */ /* End of the main input section. far_field_flag is true if last card was XQ or RP This is no longer used, but I am leaving it in here while I iron this out properly. simulate() should be called by the xq card and the rp card. */ ASSERT(false == ((ain_num == 6) || (ain_num == 8))); s_context.simulate(false); } /* while( ! next_job ) */ } /* while(true) */ return(0); } /* end of nec_main() */ /*-----------------------------------------------------------------------*/ /*!\brief Read a line and fill in the parameter values. \return The number of parameters read */ int readmn(FILE* input_fp, FILE* output_fp, char *gm, int *i1, int *i2, int *i3, int *i4, nec_float *f1, nec_float *f2, nec_float *f3, nec_float *f4, nec_float *f5, nec_float *f6 ) { int parameter_count = 0; char line_buf[134]; int line_idx; int n_integer_params = 4, n_float_params = 6; int integer_array[4] = { 0, 0, 0, 0 }; nec_float real_array[6] = { 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ int eof = load_line( line_buf, input_fp ); /* get line length */ int line_length = (int) strlen(line_buf ); /* abort if card's mnemonic too short or missing */ if ( line_length < 2 ) { if (EOF == eof) { // insert an EN card if we get to an end of file strncpy( gm, "EN", 2 ); return 0; } else { fprintf( output_fp, "\n COMMAND DATA CARD ERROR:" "\n CARD'S MNEMONIC CODE TOO SHORT OR MISSING." ); exit(-1); } } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if ( strcmp( gm, "XT" ) == 0 ) { fprintf( stderr, "\nnec2++: Exiting after an \"XT\" command in read_geometry_card()\n" ); fprintf( output_fp, "\n\n nec2++: Exiting after an \"XT\" command in read_geometry_card()" ); exit(0); } /* Return if only mnemonic on card */ if ( line_length == 2 ) { *i1 = *i2 = *i3 = *i4 = 0; *f1 = *f2 = *f3 = *f4 = *f5 = *f6 = 0.0; return 0; } /* read integers from line */ line_idx = 1; for (int i = 0; i < n_integer_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if ( (line_buf[line_idx] == '\0') ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /* read an integer from line */ integer_array[i] = atoi( &line_buf[line_idx] ); parameter_count++; /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); exit(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } } /* for( i = 0; i < n_integer_params; i++ ) */ /* read nec_floats from line */ for (int i = 0; i < n_float_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if ( (line_buf[line_idx] == '\0') ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /* read a nec_float from line */ real_array[i] = atof( &line_buf[line_idx] ); parameter_count++; /* traverse numerical field to next ' ' or ',' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); exit(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } } /* for( i = 0; i < n_float_params; i++ ) */ *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /*-----------------------------------------------------------------------*/ #ifndef _WIN32 static void sig_handler(int signal ) { switch( signal ) { case SIGINT : fprintf(stderr, "nec2++: exiting via user interrupt" ); exit( signal ); case SIGSEGV : fprintf(stderr, "nec2++: segmentation fault" ); exit( signal ); case SIGFPE : fprintf(stderr, "nec2++: floating point exception" ); exit( signal ); case SIGABRT : fprintf(stderr, "nec2++: abort signal received" ); exit( signal ); case SIGTERM : fprintf(stderr, "nec2++: termination request received" ); exit( signal ); } } #endif necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/necDiff.cpp0000644000175000017500000000430510325372102020700 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* necDiff A program to compare two output files from NEC style antenna simulations. The purpose is to support a testharness for the development of a C++ version of NEC-2. Author: Tim Molteno tim@physics.otago.ac.nz */ #include #include #include using namespace std; #include "AntennaInput.h" #include "RadiationInput.h" #include "PowerBudget.h" int main(int argc, char** argv) { cout << "NecDiff 0.12" << endl; string file1(argv[1]); string file2(argv[2]); cout << "File1: " << file1 << endl; cout << "File2: " << file2 << endl; { AntennaInput ai1(file1); AntennaInput ai2(file2); cout << "AntennaInput Difference = " << ai1.difference(ai2) << endl; if (!ai1.equalto(ai2)) { cerr << file1 << "::" << file2; cerr << ". Input Parameters Different " << ai1.difference(ai2) << endl; } } // Compare Power Budget { PowerBudget r1(file1); PowerBudget r2(file2); cout << "PowerBudget Difference = " << r1.difference(r2) << endl; if (!r1.equalto(r2)) { cerr << file1 << "::" << file2; cerr << ". Power Budgets Different " << r1.difference(r2) << endl; // return 1; } } // Compare Radiation Patterns { RadiationInput r1(file1); RadiationInput r2(file2); cout << "RadiationInput Difference = " << r1.difference(r2) << endl; if (!r1.equalto(r2)) { cerr << file1 << "::" << file2; cerr << ". Radiation Patterns Different " << r1.difference(r2) << endl; // return 1; } } return 0; } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_geometry.cpp0000644000175000017500000020103610325372102021477 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_geometry.h" #include "nec_context.h" #include "nec_exception.h" c_geometry::c_geometry() { n = 0; np = 0; // n is the number of segments m = 0; mp = 0; // m is the number of patches m_ipsym = 0; n_plus_m = 0; n_plus_2m = 0; n_plus_3m = 0; jsno = 0; nscon = 0; maxcon = 0; m_context = NULL; m_output = NULL; } void c_geometry::set_context(nec_context* in_context) { m_context = in_context; m_output = &m_context->m_output; } /*! \brief Get a segment number for a specified tag. \param in_tag The tag \param in_m The mth segment with the specified tag will be returned. \return The segment number of the mth segment having the tag number in_tag. if in_tag=0 segment number m is returned. */ int c_geometry::get_segment_number( int in_tag, int in_m) { ASSERT(in_tag >= 0); ASSERT(in_m >= 0); if (in_m <= 0) { throw new nec_exception("CHECK DATA, PARAMETER SPECIFYING SEGMENT POSITION IN A GROUP OF EQUAL TAGS MUST NOT BE ZERO" ); } if ( 0 == in_tag) { return( in_m ); } int tag_seg_count=0; for (int i = 0; i < n; i++ ) { if ( segment_tags[i] == in_tag ) { tag_seg_count++; if ( tag_seg_count == in_m) { return( i+1 ); } } } throw new nec_exception("NO SEGMENT HAS AN ITAG OF ", in_tag); return 0; } /* parse_geometry is the main routine for input of geometry data. ANTLR Grammar for geometry input geometry : (geometry_element {transform}*)+ geometry_end ; geometry_element : wire | arc | helix | patch | multi_patch ; transform : scale | reflect | rotate | move ; wire = "GW" int int real real real real real real {taper} taper = "GC" xxx arc = "GA" helix = "GH" patch = "SP" multi_patch = "SM" {patch_data}+ patch_data = "SC" scale = "GS" reflect = "GX" rotate = "GR" move = "GM" geometry_end = "GE" .+ int: [0-9]+; real: int:{.int}; */ #include "c_plot_card.h" void c_geometry::parse_geometry(nec_context* in_context, FILE* input_fp ) { char gm[3]; char ifx[2] = {'*', 'X'}, ify[2]={'*','Y'}, ifz[2]={'*','Z'}; char ipt[4] = { 'P', 'R', 'T', 'Q' }; /* input card mnemonic list */ /* "XT" stands for "exit", added for testing */ #define GM_NUM 12 char *atst[GM_NUM] = { "GW", "GX", "GR", "GS", "GE", "GM", \ "SP", "SM", "GA", "SC", "GH", "GF" }; bool print_structure_spec = true; int nwire, isct, i1, i2, iy, iz; int ix; int card_int_1, card_int_2; /* The two integer parameters from the geometry card */ nec_float rad, xs1, xs2, ys1, ys2, zs1, zs2, x4=0, y4=0, z4=0; nec_float x3=0, y3=0, z3=0, xw1, xw2, yw1, yw2, zw1, zw2; nec_float dummy; m_ipsym=0; nwire=0; n=0; np=0; m=0; mp=0; isct=0; /* read geometry data card and branch to */ /* section for operation requested */ do { read_geometry_card(input_fp, gm, &card_int_1, &card_int_2, &xw1, &yw1, &zw1, &xw2, &yw2, &zw2, &rad); /* identify card id mnemonic */ int gm_num; for( gm_num = 0; gm_num < GM_NUM; gm_num++ ) if ( strncmp( gm, atst[gm_num], 2) == 0 ) break; if ( print_structure_spec ) { m_output->end_section(); m_output->set_indent(32); m_output->line("-------- STRUCTURE SPECIFICATION --------"); m_output->line("COORDINATES MUST BE INPUT IN" ); m_output->line("METERS OR BE SCALED TO METERS" ); m_output->line("BEFORE STRUCTURE INPUT IS ENDED" ); m_output->set_indent(0); m_output->line(" WIRE SEG FIRST LAST TAG"); m_output->line(" No: X1 Y1 Z1 X2 Y2 Z2 RADIUS No: SEG SEG No:" ); print_structure_spec = false; } if ( gm_num != 10 ) isct=0; switch( gm_num ) { case 0: /* "gw" card, generate segment data for straight wire. GW STRAIGHT WIRE, ENDS 1,2 card_int_1- TAG NO. card_int_2- NO. SEGMENTS xw1- X1 F2- Y1 F3- Z1 F4- X2 F5- Y2 F6- Z2 F7- WIRE RAD., 0=USE GC FOR TAPERED WIRE */ { int wire_segment_count = card_int_2; int wire_tag = card_int_1; nwire++; // output some wire diagnostics. m_output->nec_printf( "\n" " %5d %10.4f %10.4f %10.4f %10.4f" " %10.4f %10.4f %10.4f %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, yw2, zw2, rad, wire_segment_count, n+1, n + wire_segment_count, wire_tag ); if ( rad != 0) // rad == 0 implies a tapered wire { xs1 = 1.0; ys1 = 1.0; } else { read_geometry_card(input_fp, gm, &ix, &iy, &xs1, &ys1, &zs1, &dummy, &dummy, &dummy, &dummy); if ( strcmp(gm, "GC" ) != 0 ) { throw new nec_exception("GEOMETRY DATA CARD ERROR" ); } m_output->nec_printf( "\n ABOVE WIRE IS TAPERED. SEGMENT LENGTH RATIO: %9.5f\n" " " "RADIUS FROM: %9.5f TO: %9.5f", xs1, ys1, zs1 ); if ( (ys1 == 0) || (zs1 == 0) ) { throw new nec_exception("GEOMETRY DATA CARD ERROR" ); } rad= ys1; ys1= pow( (zs1/ys1), (1./(wire_segment_count-1.)) ); } wire(wire_tag, wire_segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, xs1, ys1); } continue; /* reflect structure along x,y, or z */ /* axes or rotate to form cylinder. */ case 1: /* "gx" card */ iy= card_int_2/10; iz= card_int_2- iy*10; ix= iy/10; iy= iy- ix*10; if ( ix != 0) ix=1; if ( iy != 0) iy=1; if ( iz != 0) iz=1; m_output->nec_printf( "\n STRUCTURE REFLECTED ALONG THE AXES %c %c %c" " - TAGS INCREMENTED BY %d\n", ifx[ix], ify[iy], ifz[iz], card_int_1 ); reflect( ix, iy, iz, card_int_1, card_int_2); continue; case 2: /* "gr" card */ m_output->nec_printf( "\n STRUCTURE ROTATED ABOUT Z-AXIS %d TIMES" " - LABELS INCREMENTED BY %d\n", card_int_2, card_int_1 ); ix=-1; iz = 0; reflect( ix, iy, iz, card_int_1, card_int_2); continue; case 3: /* "gs" card, scale structure dimensions by factor xw1. */ m_output->nec_printf( "\n STRUCTURE SCALED BY FACTOR: %10.5f", xw1 ); scale(xw1); continue; case 4: /* "ge" card, terminate structure geometry input. */ geometry_complete(in_context, card_int_1, card_int_2); return; /* "gm" card, move structure or reproduce */ /* original structure in new positions. */ case 5: m_output->nec_printf( "\n THE STRUCTURE HAS BEEN MOVED, MOVE DATA CARD IS:\n" " %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, rad ); xw1= degrees_to_rad(xw1); yw1= degrees_to_rad(yw1); zw1= degrees_to_rad(zw1); move( xw1, yw1, zw1, xw2, yw2, zw2, (int)( rad+.5), card_int_2, card_int_1); continue; case 6: /* "sp" card, generate single new patch */ i1= m+1; card_int_2++; if ( card_int_1 != 0) { throw new nec_exception("PATCH DATA ERROR" ); } m_output->nec_printf( "\n" " %5d%c %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", i1, ipt[card_int_2-1], xw1, yw1, zw1, xw2, yw2, zw2 ); if ( (card_int_2 == 2) || (card_int_2 == 4) ) isct=1; if ( card_int_2 > 1) { // read another geometry card for the rest of the patch data read_geometry_card(input_fp, gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if ( (card_int_2 == 2) || (card_int_1 > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); if ( strcmp(gm, "SC") != 0 ) { throw new nec_exception("PATCH DATA ERROR" ); } } /* if ( card_int_2 > 1) */ else { xw2= degrees_to_rad(xw2); yw2= degrees_to_rad(yw2); } patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 7: /* "sm" card, generate multiple-patch surface */ i1= m+1; m_output->nec_printf( "\n" " %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f" " SURFACE - %d BY %d PATCHES", i1, ipt[1], xw1, yw1, zw1, xw2, yw2, zw2, card_int_1, card_int_2 ); if ( (card_int_1 < 1) || (card_int_2 < 1) ) { throw new nec_exception("PATCH DATA ERROR" ); } read_geometry_card(input_fp, gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if ( (card_int_2 == 2) || (card_int_1 > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); if ( strcmp(gm, "SC" ) != 0 ) { throw new nec_exception("PATCH DATA ERROR" ); } patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 8: /* "ga" card, generate segment data for wire arc */ nwire++; i1= n+1; i2= n+ card_int_2; m_output->nec_printf( "\n" " %5d ARC RADIUS: %9.5f FROM: %8.3f TO: %8.3f DEGREES" " %11.5f %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, card_int_2, i1, i2, card_int_1 ); arc( card_int_1, card_int_2, xw1, yw1, zw1, xw2); continue; case 9: /* "sc" card */ if ( isct == 0) { throw new nec_exception("PATCH DATA ERROR" ); } i1= m+1; card_int_2++; if ( (card_int_1 != 0) || ((card_int_2 != 2) && (card_int_2 != 4)) ) { throw new nec_exception("PATCH DATA ERROR" ); } xs1= x4; ys1= y4; zs1= z4; xs2= x3; ys2= y3; zs2= z3; x3= xw1; y3= yw1; z3= zw1; if ( card_int_2 == 4) { x4= xw2; y4= yw2; z4= zw2; } xw1= xs1; yw1= ys1; zw1= zs1; xw2= xs2; yw2= ys2; zw2= zs2; if ( card_int_2 != 4) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f", i1, ipt[card_int_2-1], xw1, yw1, zw1, xw2, yw2, zw2 ); m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 10: /* "gh" card, generate helix */ nwire++; i1= n+1; i2= n+ card_int_2; m_output->nec_printf( "\n" " %5d HELIX STRUCTURE - SPACING OF TURNS: %8.3f AXIAL" " LENGTH: %8.3f %8.3f %5d %5d %5d %4d\n " " RADIUS X1:%8.3f Y1:%8.3f X2:%8.3f Y2:%8.3f ", nwire, xw1, yw1, rad, card_int_2, i1, i2, card_int_1, zw1, xw2, yw2, zw2 ); helix( xw1, yw1, zw1, xw2, yw2, zw2, rad, card_int_2, card_int_1); continue; case 11: /* "gf" card, not supported */ throw new nec_exception("NGF solution option not supported"); default: /* error message */ m_output->nec_printf( "\n GEOMETRY DATA CARD ERROR" ); m_output->nec_printf( "\n" " %2s %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", gm, card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, rad ); throw new nec_exception("GEOMETRY DATA CARD ERROR"); } /* switch( gm_num ) */ } /* do */ while( true ); } /** We have finished with the geometry description, now connect things up. */ void c_geometry::geometry_complete(nec_context* in_context, int card_int_1, int card_int_2) { if (0 == np + mp) throw new nec_exception("Geometry has no wires or patches."); /* TCAM: The following does not make sense for the semantics of the plot card. I have left this in, I hope someone will tell me why it is required. */ if (card_int_2 != 0) in_context->plot_card.set_plot_real_imag_currents(); // now proceed and complete the geometry setup... connect_segments( card_int_1); if ( n != 0) { /* Allocate wire buffers */ segment_length.resize(n); sab.resize(n); cab.resize(n); salp.resize(n); m_output->nec_printf( "\n\n\n" " " " ---------- SEGMENTATION DATA ----------\n" " " " COORDINATES IN METERS\n" " " " I+ AND I- INDICATE THE SEGMENTS BEFORE AND AFTER I\n" ); m_output->nec_printf( "\n" " SEG COORDINATES OF SEGM CENTER SEGM ORIENTATION" " ANGLES WIRE CONNECTION DATA TAG\n" " No: X Y Z LENGTH ALPHA " " BETA RADIUS I- I I+ NO:" ); for(int i = 0; i < n; i++ ) { nec_float xw1= x2[i]- x[i]; nec_float yw1= y2[i]- y[i]; nec_float zw1= z2[i]- z[i]; x[i]=( x[i]+ x2[i])*.5; y[i]=( y[i]+ y2[i])*.5; z[i]=( z[i]+ z2[i])*.5; nec_float xw2= xw1* xw1+ yw1* yw1+ zw1* zw1; nec_float yw2= sqrt( xw2); yw2=( xw2/ yw2+ yw2)*.5; segment_length[i]= yw2; cab[i]= xw1/ yw2; sab[i]= yw1/ yw2; xw2= zw1/ yw2; if ( xw2 > 1.) xw2=1.; if ( xw2 < -1.) xw2=-1.; salp[i]= xw2; xw2= rad_to_degrees(asin( xw2)); yw2= rad_to_degrees(atan2( yw1, xw1)); m_output->nec_printf( "\n" " %5d %9.4f %9.4f %9.4f %9.4f" " %9.4f %9.4f %9.4f %5d %5d %5d %5d", i+1, x[i], y[i], z[i], segment_length[i], xw2, yw2, segment_radius[i], icon1[i], i+1, icon2[i], segment_tags[i] ); in_context->plot_card.plot_segments(i,x,y,z,segment_length,xw2,yw2,segment_radius,icon1,icon2); if ( (segment_length[i] <= 1.e-20) || (segment_radius[i] <= 0.) ) { throw new nec_exception("SEGMENT DATA ERROR" ); } } /* for( i = 0; i < n; i++ ) */ } /* if ( n != 0) */ if ( m != 0) { m_output->nec_printf( "\n\n\n" " " " --------- SURFACE PATCH DATA ---------\n" " " " COORDINATES IN METERS\n\n" " PATCH COORD. OF PATCH CENTER UNIT NORMAL VECTOR " " PATCH COMPONENTS OF UNIT TANGENT VECTORS\n" " NO: X Y Z X Y Z " " AREA X1 Y1 Z1 X2 Y2 Z2" ); for(int i = 0; i < m; i++ ) { nec_float xw1=( t1y[i]* t2z[i]- t1z[i]* t2y[i])* psalp[i]; nec_float yw1=( t1z[i]* t2x[i]- t1x[i]* t2z[i])* psalp[i]; nec_float zw1=( t1x[i]* t2y[i]- t1y[i]* t2x[i])* psalp[i]; m_output->nec_printf( "\n" " %4d %10.5f %10.5f %10.5f %8.4f %8.4f %8.4f" " %10.5f %8.4f %8.4f %8.4f %8.4f %8.4f %8.4f", i+1, px[i], py[i], pz[i], xw1, yw1, zw1, pbi[i], t1x[i], t1y[i], t1z[i], t2x[i], t2y[i], t2z[i] ); } /* for( i = 0; i < m; i++ ) */ } /* if ( m == 0) */ n_plus_m = n+m; n_plus_2m = n+2*m; n_plus_3m = n+3*m; x_unscaled.resize(n); y_unscaled.resize(n); z_unscaled.resize(n); si_unscaled.resize(n); bi_unscaled.resize(n); px_unscaled.resize(m); py_unscaled.resize(m); pz_unscaled.resize(m); pbi_unscaled.resize(m); // Fill the unscaled segments... for (int i = 0; i < n; i++ ) { x_unscaled[i]= x[i]; y_unscaled[i]= y[i]; z_unscaled[i]= z[i]; si_unscaled[i]= segment_length[i]; bi_unscaled[i]= segment_radius[i]; } // Fill the unscaled patches... for (int i = 0; i < m; i++ ) { px_unscaled[i]= px[i]; py_unscaled[i]= py[i]; pz_unscaled[i]= pz[i]; pbi_unscaled[i]= pbi[i]; } } /* subroutine wire generates segment geometry */ /* data for a straight wire of segment_count segments. */ void c_geometry::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 ) { nec_float xd, yd, zd, delz, rd, fns, radz; nec_float xs1, ys1, zs1, xs2, ys2, zs2; int istart = n; n = n + segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; /* Reallocate tags buffer */ segment_tags.resize(n + m); /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); xd= xw2- xw1; yd= yw2- yw1; zd= zw2- zw1; if ( fabs(rdel-1.0) >= 1.0e-6) { delz= sqrt( xd* xd+ yd* yd+ zd* zd); xd= xd/ delz; yd= yd/ delz; zd= zd/ delz; delz= delz*(1.- rdel)/(1.- pow(rdel, segment_count) ); rd= rdel; } else { fns= segment_count; xd= xd/ fns; yd= yd/ fns; zd= zd/ fns; delz=1.0; rd=1.0; } radz= rad; xs1= xw1; ys1= yw1; zs1= zw1; for (int i = istart; i < n; i++ ) { segment_tags[i]= tag_id; xs2= xs1+ xd* delz; ys2= ys1+ yd* delz; zs2= zs1+ zd* delz; x[i]= xs1; y[i]= ys1; z[i]= zs1; x2[i]= xs2; y2[i]= ys2; z2[i]= zs2; ASSERT(0.0 != radz); segment_radius[i]= radz; delz= delz* rd; radz= radz* rrad; xs1= xs2; ys1= ys2; zs1= zs2; } x2[n-1]= xw2; y2[n-1]= yw2; z2[n-1]= zw2; } /*-----------------------------------------------------------------------*/ /* subroutine helix generates segment geometry */ /* data for a helix of segment_count segments */ void c_geometry::helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ) { int ist; nec_float turns, zinc, copy, sangle, hdia, turn, pitch, hmaj, hmin; ist= n; n += segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; turns= fabs( hl/ s); zinc= fabs( hl/ segment_count); segment_tags.resize(n+m); /*????*/ /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); z[ist]=0.; for(int i = ist; i < n; i++ ) { segment_radius[i]= rad; segment_tags[i]= tag_id; if ( i != ist ) z[i]= z[i-1]+ zinc; z2[i]= z[i]+ zinc; if ( a2 == a1) { if ( b1 == 0.) b1= a1; x[i]= a1* cos(2.* pi()* z[i]/ s); y[i]= b1* sin(2.* pi()* z[i]/ s); x2[i]= a1* cos(2.* pi()* z2[i]/ s); y2[i]= b1* sin(2.* pi()* z2[i]/ s); } else { if ( b2 == 0.) b2= a2; x[i]=( a1+( a2- a1)* z[i]/ fabs( hl))* cos(2.* pi()* z[i]/ s); y[i]=( b1+( b2- b1)* z[i]/ fabs( hl))* sin(2.* pi()* z[i]/ s); x2[i]=( a1+( a2- a1)* z2[i]/ fabs( hl))* cos(2.* pi()* z2[i]/ s); y2[i]=( b1+( b2- b1)* z2[i]/ fabs( hl))* sin(2.* pi()* z2[i]/ s); } /* if ( a2 == a1) */ if ( hl > 0.) continue; copy= x[i]; x[i]= y[i]; y[i]= copy; copy= x2[i]; x2[i]= y2[i]; y2[i]= copy; } /* for( i = ist; i < n; i++ ) */ if ( a2 != a1) { sangle= atan( a2/( fabs( hl)+( fabs( hl)* a1)/( a2- a1))); m_output->nec_printf( "\n THE CONE ANGLE OF THE SPIRAL IS %10.4f", sangle ); return; } if ( a1 == b1) { hdia=2.* a1; turn= hdia* pi(); pitch= atan( s/( pi()* hdia)); turn= turn/ cos( pitch); pitch=180.* pitch/ pi(); } else { if ( a1 >= b1) { hmaj=2.* a1; hmin=2.* b1; } else { hmaj=2.* b1; hmin=2.* a1; } hdia= sqrt(( hmaj*hmaj+ hmin*hmin)/2* hmaj); turn=2.* pi()* hdia; pitch=(180./ pi())* atan( s/( pi()* hdia)); } /* if ( a1 == b1) */ m_output->nec_printf( "\n" " THE PITCH ANGLE IS: %.4f THE LENGTH OF WIRE/TURN IS: %.4f", pitch, turn ); } /*-----------------------------------------------------------------------*/ /* subroutine move moves the structure with respect to its */ /* coordinate system or reproduces structure in new positions. */ /* structure is rotated about x,y,z axes by rox,roy,roz */ /* respectively, then shifted by xs,ys,zs */ void c_geometry::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 ) { int nrp, ix, i1, k, ir, i, ii; nec_float sps, cps, sth, cth, sph, cph, xx, xy; nec_float xz, yx, yy, yz, zx, zy, zz, xi, yi, zi; if ( fabs( rox)+ fabs( roy) > 1.0e-10) m_ipsym= m_ipsym*3; sps= sin( rox); cps= cos( rox); sth= sin( roy); cth= cos( roy); sph= sin( roz); cph= cos( roz); xx= cph* cth; xy= cph* sth* sps- sph* cps; xz= cph* sth* cps+ sph* sps; yx= sph* cth; yy= sph* sth* sps+ cph* cps; yz= sph* sth* cps- cph* sps; zx=- sth; zy= cth* sps; zz= cth* cps; if ( nrpt == 0) nrp=1; else nrp= nrpt; ix=1; if ( n > 0) { i1= get_segment_number( its, 1); if ( i1 < 1) i1= 1; ix= i1; if ( nrpt == 0) k= i1-1; else { k= n; /* Reallocate tags buffer */ segment_tags.resize(n+m + (n+1-i1)*nrpt); // mreq = n+m + (n+1-i1)*nrpt; // segment_tags.resize(mreq); /* Reallocate wire buffers */ int new_size = (n+(n+1-i1)*nrpt); x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); } for( ir = 0; ir < nrp; ir++ ) { for( i = i1-1; i < n; i++ ) { xi= x[i]; yi= y[i]; zi= z[i]; x[k]= xi* xx+ yi* xy+ zi* xz+ xs; y[k]= xi* yx+ yi* yy+ zi* yz+ ys; z[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= x2[i]; yi= y2[i]; zi= z2[i]; x2[k]= xi* xx+ yi* xy+ zi* xz+ xs; y2[k]= xi* yx+ yi* yy+ zi* yz+ ys; z2[k]= xi* zx+ yi* zy+ zi* zz+ zs; segment_radius[k]= segment_radius[i]; segment_tags[k]= segment_tags[i]; if ( segment_tags[i] != 0) segment_tags[k]= segment_tags[i]+ itgi; k++; } /* for( i = i1; i < n; i++ ) */ i1= n+1; n= k; } /* for( ir = 0; ir < nrp; ir++ ) */ } /* if ( n >= n2) */ if ( m > 0) { i1 = 0; if ( nrpt == 0) k= 0; else k = m; /* Reallocate patch buffers */ int new_size = m * (1+nrpt); px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( ii = 0; ii < nrp; ii++ ) { for( i = i1; i < m; i++ ) { xi= px[i]; yi= py[i]; zi= pz[i]; px[k]= xi* xx+ yi* xy+ zi* xz+ xs; py[k]= xi* yx+ yi* yy+ zi* yz+ ys; pz[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= t1x[i]; yi= t1y[i]; zi= t1z[i]; t1x[k]= xi* xx+ yi* xy+ zi* xz; t1y[k]= xi* yx+ yi* yy+ zi* yz; t1z[k]= xi* zx+ yi* zy+ zi* zz; xi= t2x[i]; yi= t2y[i]; zi= t2z[i]; t2x[k]= xi* xx+ yi* xy+ zi* xz; t2y[k]= xi* yx+ yi* yy+ zi* yz; t2z[k]= xi* zx+ yi* zy+ zi* zz; psalp[k]= psalp[i]; pbi[k]= pbi[i]; k++; } /* for( i = i1; i < m; i++ ) */ i1= m; m = k; } /* for( ii = 0; ii < nrp; ii++ ) */ } /* if ( m >= m2) */ if ( (nrpt == 0) && (ix == 1) ) return; np= n; mp= m; m_ipsym=0; return; } /*-----------------------------------------------------------------------*/ /* reflects partial structure along x,y, or z axes or rotates */ /* structure to complete a symmetric structure. */ void c_geometry::reflect( int ix, int iy, int iz, int itx, int nop ) { int iti, i, nx, itagi, k; nec_float e1, e2, fnop, sam, cs, ss, xk, yk; np= n; mp= m; m_ipsym=0; iti= itx; if ( ix >= 0) { if ( nop == 0) return; m_ipsym=1; /* reflect along z axis */ if ( iz != 0) { m_ipsym=2; if ( n > 0 ) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m)); /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= z[i]; e2= z2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]= x[i]; y[nx]= y[i]; z[nx]=- e1; x2[nx]= x2[i]; y2[nx]= y2[i]; z2[nx]=- e2; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } /* for( i = 0; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if ( n > 0) */ if ( m > 0 ) { /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx = i+m; if ( fabs(pz[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]= px[i]; py[nx]= py[i]; pz[nx]=- pz[i]; t1x[nx]= t1x[i]; t1y[nx]= t1y[i]; t1z[nx]=- t1z[i]; t2x[nx]= t2x[i]; t2y[nx]= t2y[i]; t2z[nx]=- t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; } /* if ( m >= m2) */ } /* if ( iz != 0) */ /* reflect along y axis */ if ( iy != 0) { if ( n > 0) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m));/*????*/ /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= y[i]; e2= y2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]= x[i]; y[nx]=- e1; z[nx]= z[i]; x2[nx]= x2[i]; y2[nx]=- e2; z2[nx]= z2[i]; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } /* for( i = n2-1; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if ( n >= n2) */ if ( m > 0 ) { /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx= i+m; if ( fabs( py[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]= px[i]; py[nx]=- py[i]; pz[nx]= pz[i]; t1x[nx]= t1x[i]; t1y[nx]=- t1y[i]; t1z[nx]= t1z[i]; t2x[nx]= t2x[i]; t2y[nx]=- t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } /* for( i = m2; i <= m; i++ ) */ m= m*2; } /* if ( m >= m2) */ } /* if ( iy != 0) */ /* reflect along x axis */ if ( ix == 0 ) return; if ( n > 0 ) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m));/*????*/ /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= x[i]; e2= x2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]=- e1; y[nx]= y[i]; z[nx]= z[i]; x2[nx]=- e2; y2[nx]= y2[i]; z2[nx]= z2[i]; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } n= n*2; } /* if ( n > 0) */ if ( m == 0 ) return; /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx= i+m; if ( fabs( px[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]=- px[i]; py[nx]= py[i]; pz[nx]= pz[i]; t1x[nx]=- t1x[i]; t1y[nx]= t1y[i]; t1z[nx]= t1z[i]; t2x[nx]=- t2x[i]; t2y[nx]= t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; return; } /* if ( ix >= 0) */ /* reproduce structure with rotation to form cylindrical structure */ fnop= (nec_float)nop; m_ipsym=-1; sam=two_pi() / fnop; cs= cos( sam); ss= sin( sam); if ( n > 0) { n *= nop; nx= np; /* Reallocate tags buffer */ segment_tags.resize(n + m); //segment_tags.resize((n+m));/*????*/ /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); for( i = nx; i < n; i++ ) { k= i- np; xk= x[k]; yk= y[k]; x[i]= xk* cs- yk* ss; y[i]= xk* ss+ yk* cs; z[i]= z[k]; xk= x2[k]; yk= y2[k]; x2[i]= xk* cs- yk* ss; y2[i]= xk* ss+ yk* cs; z2[i]= z2[k]; segment_radius[i]= segment_radius[k]; itagi= segment_tags[k]; if ( itagi == 0) segment_tags[i]=0; if ( itagi != 0) segment_tags[i]= itagi+ iti; } } /* if ( n >= n2) */ if ( m == 0 ) return; m *= nop; nx= mp; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); for( i = nx; i < m; i++ ) { k = i-mp; xk= px[k]; yk= py[k]; px[i]= xk* cs- yk* ss; py[i]= xk* ss+ yk* cs; pz[i]= pz[k]; xk= t1x[k]; yk= t1y[k]; t1x[i]= xk* cs- yk* ss; t1y[i]= xk* ss+ yk* cs; t1z[i]= t1z[k]; xk= t2x[k]; yk= t2y[k]; t2x[i]= xk* cs- yk* ss; t2y[i]= xk* ss+ yk* cs; t2z[i]= t2z[k]; psalp[i]= psalp[k]; pbi[i]= pbi[k]; } /* for( i = nx; i < m; i++ ) */ } /*-----------------------------------------------------------------------*/ /*Scale all dimensions of a structure by a constant.*/ void c_geometry::scale( nec_float xw1 ) { if ( n > 0) { for(int i = 0; i < n; i++ ) { x[i]= x[i]* xw1; y[i]= y[i]* xw1; z[i]= z[i]* xw1; x2[i]= x2[i]* xw1; y2[i]= y2[i]* xw1; z2[i]= z2[i]* xw1; segment_radius[i]= segment_radius[i]* xw1; } } /* if ( n > 0) */ if ( m > 0) { nec_float yw1= xw1* xw1; for(int i = 0; i < m; i++ ) { px[i]= px[i]* xw1; py[i]= py[i]* xw1; pz[i]= pz[i]* xw1; pbi[i]= pbi[i]* yw1; } } /* if ( m > 0) */ } /*-----------------------------------------------------------------------*/ /* connect sets up segment connection data in arrays icon1 and */ /* icon2 by searching for segment ends that are in contact. */ void c_geometry::connect_segments( int ignd ) { nscon= -1; maxcon = 1; if (n <= 1) { throw new nec_exception("GEOMETRY HAS ONE OR FEWER SEGMENTS. Please send bug report. This causes an error that we're trying to fix."); } if ( ignd != 0) { m_output->nec_printf( "\n\n GROUND PLANE SPECIFIED." ); if ( ignd > 0) m_output->nec_printf( "\n WHERE WIRE ENDS TOUCH GROUND, CURRENT WILL" " BE INTERPOLATED TO IMAGE IN GROUND PLANE.\n" ); if ( m_ipsym == 2) { np=2* np; mp=2* mp; } if ( abs( m_ipsym) > 2 ) { np= n; mp= m; } if ( np > n) { throw new nec_exception("ERROR: NP > N IN c_geometry::connect_segments()" ); } if ( (np == n) && (mp == m) ) m_ipsym=0; } /* if ( ignd != 0) */ if ( n != 0) { /* Allocate memory to connections */ icon1.resize((n+m)); icon2.resize((n+m)); for (int i = 0; i < n; i++ ) { int iz = i+1; nec_float zi1 = z[i]; nec_float zi2 = z2[i]; nec_3vector v1(x[i], y[i], z[i]); nec_3vector v2(x2[i], y2[i], z2[i]); nec_float slen = norm(v2 - v1) * SMIN; /* determine connection data for end 1 of segment. */ bool segment_on_ground = false; if ( ignd > 0) { if ( zi1 <= -slen) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("EXTENDS BELOW GROUND"); throw nex; } if ( zi1 <= slen) { icon1[i]= iz; z[i]=0.; segment_on_ground = true; } /* if ( zi1 <= slen) */ } /* if ( ignd > 0) */ if ( false == segment_on_ground ) { int ic= i; nec_float sep=0.0; for (int j = 1; j < n; j++) { ic++; if ( ic >= n) ic=0; nec_3vector vic(x[ic], y[ic], z[ic]); sep = normL1(v1 - vic); if ( sep <= slen) { icon1[i]= -(ic+1); break; } nec_3vector v2ic(x2[ic], y2[ic], z2[ic]); sep = normL1(v1 - v2ic); if ( sep <= slen) { icon1[i]= (ic+1); break; } } /* for( j = 1; j < n; j++) */ if ( ((iz > 0) || (icon1[i] <= PCHCON)) && (sep > slen) ) icon1[i]=0; } /* if ( ! jump ) */ /* determine connection data for end 2 of segment. */ if ( (ignd > 0) || segment_on_ground ) { if ( zi2 <= -slen) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("EXTENDS BELOW GROUND"); throw nex; } if ( zi2 <= slen) { if ( icon1[i] == iz ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("LIES IN GROUND PLANE"); throw nex; } icon2[i]= iz; z2[i]=0.; continue; } /* if ( zi2 <= slen) */ } /* if ( ignd > 0) */ int ic= i; nec_float sep=0.0; for (int j = 1; j < n; j++ ) { ic++; if ( ic >= n) ic=0; nec_3vector vic(x[ic], y[ic], z[ic]); sep = normL1(v2 - vic); if (sep <= slen) { icon2[i]= (ic+1); break; } nec_3vector v2ic(x2[ic], y2[ic], z2[ic]); sep = normL1(v2 - v2ic); if (sep <= slen) { icon2[i]= -(ic+1); break; } } /* for( j = 1; j < n; j++ ) */ if ( ((iz > 0) || (icon2[i] <= PCHCON)) && (sep > slen) ) icon2[i]=0; } /* for( i = 0; i < n; i++ ) */ /* find wire-surface connections for new patches */ for (int ix=0; ix nec_printf( "\n\n" " TOTAL SEGMENTS USED: %d SEGMENTS IN A" " SYMMETRIC CELL: %d SYMMETRY FLAG: %d", n, np, m_ipsym ); if ( m > 0) m_output->nec_printf( "\n" " TOTAL PATCHES USED: %d PATCHES" " IN A SYMMETRIC CELL: %d", m, mp ); if (0 == np + mp) throw new nec_exception("connect_segments Geometry has zero wires and zero patches."); int symmetry = (n+m)/(np+mp); /* was iseg */ if ( symmetry != 1) { /*** may be error condition?? ***/ if ( m_ipsym == 0 ) { nec_error_mode nem(*m_output); m_output->endl(); m_output->line("ERROR: IPSYM=0 IN connect_segments()" ); throw new nec_exception("ERROR: IPSYM=0 IN connect_segments()"); } if ( m_ipsym < 0 ) m_output->nec_printf( "\n STRUCTURE HAS %d FOLD ROTATIONAL SYMMETRY\n", symmetry ); else { int sym_planes = symmetry/2; if ( symmetry == 8) sym_planes=3; m_output->nec_printf( "\n STRUCTURE HAS %d PLANES OF SYMMETRY\n", sym_planes ); } /* if ( m_ipsym < 0 ) */ } /* if ( symmetry == 1) */ if ( n == 0) return; /* Allocate to connection buffers */ jco.resize(maxcon); /* Adjust connected seg. ends to exactly coincide. print junctions of 3 or more seg. also find old seg. connecting to new seg. */ int junction_counter = 0; // used just to print the junction number out if there are 3 or more segments bool header_printed = false; // Have we printed the header for (int j = 0; j < n; j++ ) { int jx = j+1; int iend = -1; int jend = -1; int ix= icon1[j]; int ic=1; jco[0]= -jx; nec_float xa = x[j]; nec_float ya = y[j]; nec_float za = z[j]; while( true ) { if ( (ix != 0) && (ix != (j+1)) && (ix <= PCHCON) ) { int nsflg=0; bool jump = false; do { if ( ix == 0 ) { nec_exception* nex = new nec_exception("CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT: "); nex->append(ix); throw nex; } if ( ix < 0 ) ix= -ix; else jend= -jend; jump = false; if ( ix == jx ) break; if ( ix < jx ) { jump = true; break; } /* Record max. no. of connections */ ic++; if ( ic >= maxcon ) { maxcon = ic+1; jco.resize(maxcon); } jco[ic-1]= ix* jend; if ( ix > 0) nsflg=1; int ixx = ix-1; if ( jend != 1) { xa= xa+ x[ixx]; // dies here if n == 1. ix is totally fried. ya= ya+ y[ixx]; za= za+ z[ixx]; ix= icon1[ixx]; continue; } xa= xa+ x2[ixx]; ya= ya+ y2[ixx]; za= za+ z2[ixx]; ix= icon2[ixx]; } /* do */ while( ix != 0 ); if ( jump && (iend == 1) ) break; else if ( jump ) { iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; continue; } nec_float ic_f = (nec_float)ic; xa = xa / ic_f; ya = ya / ic_f; za = za / ic_f; for (int i = 0; i < ic; i++ ) { ix= jco[i]; if ( ix <= 0) { ix=- ix; int ixx = ix-1; x[ixx]= xa; y[ixx]= ya; z[ixx]= za; continue; } int ixx = ix-1; x2[ixx]= xa; y2[ixx]= ya; z2[ixx]= za; } /* for( i = 0; i < ic; i++ ) */ if ( ic >= 3) { if ( false == header_printed ) { m_output->nec_printf( "\n\n" " ---------- MULTIPLE WIRE JUNCTIONS ----------\n" " JUNCTION SEGMENTS (- FOR END 1, + FOR END 2)" ); header_printed = true; } junction_counter++; m_output->nec_printf( "\n %5d ", junction_counter ); for (int i = 1; i <= ic; i++ ) { m_output->nec_printf( "%5d", jco[i-1] ); if ( !(i % 20) ) m_output->nec_printf( "\n " ); } } /* if ( ic >= 3) */ } /*if ( (ix != 0) && (ix != j) && (ix <= PCHCON) ) */ if ( iend == 1) break; iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; } /* while( true ) */ } /* for( j = 0; j < n; j++ ) */ ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } /* arc generates segment geometry data for an arc of segment_count segments */ void c_geometry::arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ) { int istart = n; n += segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; if ( fabs(ang2 - ang1) > 360.0) { throw new nec_exception("ERROR -- ARC ANGLE EXCEEDS 360 DEGREES"); } /* Reallocate tags buffer */ segment_tags.resize(n+m); /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); nec_float ang = degrees_to_rad(ang1); nec_float dang = degrees_to_rad(ang2- ang1) / segment_count; nec_float xs1= rada * cos(ang); nec_float zs1= rada * sin(ang); for(int i = istart; i < n; i++ ) { ang += dang; nec_float xs2 = rada * cos(ang); nec_float zs2 = rada * sin(ang); x[i]= xs1; y[i]=0.; z[i]= zs1; x2[i]= xs2; y2[i]=0.; z2[i]= zs2; xs1= xs2; zs1= zs2; segment_radius[i]= rad; segment_tags[i]= tag_id; } /* for( i = ist; i < n; i++ ) */ } /*-----------------------------------------------------------------------*/ /*! \brief patch generates and modifies patch geometry data. */ void c_geometry::patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { int mi, ntp, iy, ix; nec_float s1x=0., s1y=0., s1z=0., s2x=0., s2y=0., s2z=0., xst=0.; nec_float znv, xnv, ynv, xa, xn2, yn2, zn2, salpn, xs, ys, zs, xt, yt, zt; /* new patches. for nx=0, ny=1,2,3,4 patch is (respectively) */; /* arbitrary, rectagular, triangular, or quadrilateral. */ /* for nx and ny > 0 a rectangular surface is produced with */ /* nx by ny rectangular patches. */ m++; mi= m-1; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); if ( nx > 0) ntp=2; else ntp= ny; if ( ntp <= 1) { px[mi]= ax1; py[mi]= ay1; pz[mi]= az1; pbi[mi]= az2; znv= cos( ax2); xnv= znv* cos( ay2); ynv= znv* sin( ay2); znv= sin( ax2); xa= sqrt( xnv* xnv+ ynv* ynv); if ( xa >= 1.0e-6) { t1x[mi]=- ynv/ xa; t1y[mi]= xnv/ xa; t1z[mi]=0.; } else { t1x[mi]=1.; t1y[mi]=0.; t1z[mi]=0.; } } /* if ( ntp <= 1) */ else { s1x= ax2- ax1; s1y= ay2- ay1; s1z= az2- az1; s2x= ax3- ax2; s2y= ay3- ay2; s2z= az3- az2; if ( nx != 0) { s1x= s1x/ nx; s1y= s1y/ nx; s1z= s1z/ nx; s2x= s2x/ ny; s2y= s2y/ ny; s2z= s2z/ ny; } xnv= s1y* s2z- s1z* s2y; ynv= s1z* s2x- s1x* s2z; znv= s1x* s2y- s1y* s2x; xa= sqrt( xnv* xnv+ ynv* ynv+ znv* znv); xnv= xnv/ xa; ynv= ynv/ xa; znv= znv/ xa; xst= sqrt( s1x* s1x+ s1y* s1y+ s1z* s1z); t1x[mi]= s1x/ xst; t1y[mi]= s1y/ xst; t1z[mi]= s1z/ xst; if ( ntp <= 2) { px[mi]= ax1+.5*( s1x+ s2x); py[mi]= ay1+.5*( s1y+ s2y); pz[mi]= az1+.5*( s1z+ s2z); pbi[mi]= xa; } else { if ( ntp != 4) { px[mi]=( ax1+ ax2+ ax3)/3.; py[mi]=( ay1+ ay2+ ay3)/3.; pz[mi]=( az1+ az2+ az3)/3.; pbi[mi]=.5* xa; } else { s1x= ax3- ax1; s1y= ay3- ay1; s1z= az3- az1; s2x= ax4- ax1; s2y= ay4- ay1; s2z= az4- az1; xn2= s1y* s2z- s1z* s2y; yn2= s1z* s2x- s1x* s2z; zn2= s1x* s2y- s1y* s2x; xst= sqrt( xn2* xn2+ yn2* yn2+ zn2* zn2); salpn=1./(3.*( xa+ xst)); px[mi]=( xa*( ax1+ ax2+ ax3)+ xst*( ax1+ ax3+ ax4))* salpn; py[mi]=( xa*( ay1+ ay2+ ay3)+ xst*( ay1+ ay3+ ay4))* salpn; pz[mi]=( xa*( az1+ az2+ az3)+ xst*( az1+ az3+ az4))* salpn; pbi[mi]=.5*( xa+ xst); s1x=( xnv* xn2+ ynv* yn2+ znv* zn2)/ xst; if ( s1x <= 0.9998) { throw new nec_exception("ERROR -- CORNERS OF QUADRILATERAL PATCH DO NOT LIE IN A PLANE"); } } /* if ( ntp != 4) */ } /* if ( ntp <= 2) */ } /* if ( ntp <= 1) */ t2x[mi]= ynv* t1z[mi]- znv* t1y[mi]; t2y[mi]= znv* t1x[mi]- xnv* t1z[mi]; t2z[mi]= xnv* t1y[mi]- ynv* t1x[mi]; psalp[mi]=1.; if ( nx != 0) { m += nx*ny-1; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); xn2= px[mi]- s1x- s2x; yn2= py[mi]- s1y- s2y; zn2= pz[mi]- s1z- s2z; xs= t1x[mi]; ys= t1y[mi]; zs= t1z[mi]; xt= t2x[mi]; yt= t2y[mi]; zt= t2z[mi]; for( iy = 0; iy < ny; iy++ ) { xn2 += s2x; yn2 += s2y; zn2 += s2z; for( ix = 1; ix <= nx; ix++ ) { xst= (nec_float)ix; px[mi]= xn2+ xst* s1x; py[mi]= yn2+ xst* s1y; pz[mi]= zn2+ xst* s1z; pbi[mi]= xa; psalp[mi]=1.; t1x[mi]= xs; t1y[mi]= ys; t1z[mi]= zs; t2x[mi]= xt; t2y[mi]= yt; t2z[mi]= zt; mi++; } /* for( ix = 0; ix < nx; ix++ ) */ } /* for( iy = 0; iy < ny; iy++ ) */ } /* if ( nx != 0) */ m_ipsym=0; np= n; mp= m; } /*!\brief Divide a patch into four (was subph). Used when a patch is connected to a wire. The patch nx is divided into 4 patches that become nx, nx+1, nx+2, nx+3. The other patches are shifted to make room for the three new patches. \param nx The index of the patch to divide (starting at 1) */ void c_geometry::divide_patch(int nx) { m += 3; px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); /* Shift patches to make room for new ones */ for (int iy = m-1; iy > nx; iy--) { int old_index = iy - 3; px[iy] = px[old_index]; py[iy] = py[old_index]; pz[iy] = pz[old_index]; pbi[iy] = pbi[old_index]; psalp[iy] = psalp[old_index]; t1x[iy] = t1x[old_index]; t1y[iy] = t1y[old_index]; t1z[iy] = t1z[old_index]; t2x[iy] = t2x[old_index]; t2y[iy] = t2y[old_index]; t2z[iy] = t2z[old_index]; } /* divide patch for connection */ int patch_index = nx-1; nec_float xs = px[patch_index]; nec_float ys = py[patch_index]; nec_float zs = pz[patch_index]; nec_float xa = pbi[patch_index]/4.; nec_float xst = sqrt(xa)/2.; nec_float s1x = t1x[patch_index]; nec_float s1y = t1y[patch_index]; nec_float s1z = t1z[patch_index]; nec_float s2x = t2x[patch_index]; nec_float s2y = t2y[patch_index]; nec_float s2z = t2z[patch_index]; nec_float saln = psalp[patch_index]; nec_float xt = xst; nec_float yt = xst; int new_index = patch_index; /* Generate the four new patches */ for (int ix = 1; ix <= 4; ix++ ) { px[new_index]= xs+ xt* s1x+ yt* s2x; py[new_index]= ys+ xt* s1y+ yt* s2y; pz[new_index]= zs+ xt* s1z+ yt* s2z; pbi[new_index]= xa; t1x[new_index]= s1x; t1y[new_index]= s1y; t1z[new_index]= s1z; t2x[new_index]= s2x; t2y[new_index]= s2y; t2z[new_index]= s2z; psalp[new_index]= saln; if (2 == ix) yt = -yt; if ( (ix == 1) || (ix == 3) ) xt = -xt; new_index++; } /* Readjust the mp patch index to account for the added patches */ if (nx <= mp) mp += 3; } /*----------------------------------------------------------------------- Read Geometry Data from a Card -------------------------------------------------------------------------*/ void c_geometry::read_geometry_card(FILE* input_fp, char *gm, int *in_i1, int *in_i2, nec_float *in_x1, nec_float *in_y1, nec_float *in_z1, nec_float *in_x2, nec_float *in_y2, nec_float *in_z2, nec_float *in_rad ) { char line_buf[134]; int i, line_idx; int n_integer_params = 2, n_float_params = 7; int integer_params[2] = { 0, 0 }; nec_float real_params[7] = { 0., 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ load_line( line_buf, input_fp ); /* get line length */ int line_length = (int)strlen( line_buf ); /* abort if card's mnemonic too short or missing */ if ( line_length < 2 ) { nec_exception* nex = new nec_exception("GEOMETRY DATA CARD ERROR:"); nex->append(" CARD'S MNEMONIC CODE TOO SHORT OR MISSING."); throw nex; } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if ( strcmp( gm, "XT" ) == 0 ) { nec_exception* nex = new nec_exception("Exiting after an \"XT\" command in read_geometry_card()"); throw nex; } /* Return if only mnemonic on card */ if ( line_length == 2 ) { *in_i1 = *in_i2 = 0; *in_x1 = *in_y1 = *in_z1 = *in_x2 = *in_y2 = *in_z2 = *in_rad = 0.0; return; } /* read integers from line */ line_idx = 1; for( i = 0; i < n_integer_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if ( (line_buf[line_idx] == '\0') ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } /* read an integer from line */ integer_params[i] = atoi( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { nec_stop( "GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } } /* for( i = 0; i < n_integer_params; i++ ) */ /* read nec_floats from line */ for( i = 0; i < n_float_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if ( (line_buf[line_idx] == '\0') ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } /* read a nec_float from line */ real_params[i] = atof( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { nec_stop( "\n GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d.\n", gm, line_buf[line_idx], (line_idx+1) ); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } } /* for( i = 0; i < n_float_params; i++ ) */ *in_i1 = integer_params[0]; *in_i2 = integer_params[1]; *in_x1 = real_params[0]; *in_y1 = real_params[1]; *in_z1 = real_params[2]; *in_x2 = real_params[3]; *in_y2 = real_params[4]; *in_z2 = real_params[5]; *in_rad = real_params[6]; } /* compute basis function i */ void c_geometry::tbf( int i, int icap ) { int jcoxx, njun1=0, njun2, jsnop, jsnox; nec_float sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; jsno=0; nec_float pp = 0.0; int ix = i-1; int jcox = icon1[ix]; if ( jcox > PCHCON) jcox= i; int jend = -1; int iend = -1; nec_float _sig = -1.0; do { if ( jcox != 0 ) { if ( jcox < 0 ) jcox=- jcox; else { _sig = -_sig; jend=- jend; } jcoxx = jcox-1; jsno++; jsnox = jsno-1; jco[jsnox]= jcox; nec_float d = pi() * segment_length[jcoxx]; sdh = sin(d); cdh = cos(d); sd = 2.0 * sdh * cdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( log(1./( pi()* segment_radius[jcoxx]))-.577215664); pp= pp- omc/ sd* aj; ax[jsnox]= aj/ sd* _sig; bx[jsnox]= aj/(2.* cdh); cx[jsnox]=- aj/(2.* sdh)* _sig; if ( jcox != i) { if ( jend == 1) jcox= icon2[jcoxx]; else jcox= icon1[jcoxx]; if ( abs(jcox) != i ) { if ( jcox != 0 ) continue; else { nec_exception* nex = new nec_exception("TBF - SEGMENT CONNECTION ERROR FOR SEGMENT "); nex->append(i); throw nex; } } } /* if ( jcox != i) */ else bx[jsnox] =- bx[jsnox]; if ( iend == 1) break; } /* if ( jcox != 0 ) */ pm=- pp; pp=0.; njun1= jsno; jcox= icon2[ix]; if ( jcox > PCHCON) jcox= i; jend=1; iend=1; _sig=-1.; } /* do */ while( jcox != 0 ); njun2= jsno- njun1; jsnop= jsno; jco[jsnop]= i; nec_float d = pi()* segment_length[ix]; sdh = sin(d); cdh = cos(d); sd = 2.0 * sdh * cdh; cd= cdh*cdh - sdh*sdh; if ( d <= 0.015) { omc = 4.0* d*d; omc = ((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc = 1.0 - cd; ap=1./( log(1./( pi()* segment_radius[ix]))-.577215664); aj= ap; if ( njun1 == 0) { if ( njun2 == 0) { bx[jsnop]=0.; if ( icap == 0) xxi=0.; else { qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } cx[jsnop]=1./( cdh- xxi* sdh); jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun2 == 0) */ if ( icap == 0) xxi=0.; else { qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); d= cd- xxi* sd; bx[jsnop]=( sdh+ ap* qp*( cdh- xxi* sdh))/ d; cx[jsnop]=( cdh+ ap* qp*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun2; iend++ ) { ax[iend]=-ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun1 == 0) */ if ( njun2 == 0) { if ( icap == 0) xxi=0.; else { qm= pi()* segment_radius[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); } qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); d= cd- xxi* sd; bx[jsnop]=( aj* qm*( cdh- xxi* sdh)- sdh)/ d; cx[jsnop]=( cdh- aj* qm*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; bx[jsnop]=( aj* qm+ ap* qp)* sdh/ sd; cx[jsnop]=( aj* qm- ap* qp)* cdh/ sd; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jend= njun1; for( iend = jend; iend < jsno; iend++ ) { ax[iend]=- ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; } /* compute the components of all basis functions on segment j */ void c_geometry::trio( int j ) { int jcox, jcoxx, jsnox, jx, jend=0, iend=0; jsno=0; jx = j-1; jcox= icon1[jx]; jcoxx = jcox-1; if ( jcox <= PCHCON) { jend=-1; iend=-1; } if ( (jcox == 0) || (jcox > PCHCON) ) { jcox= icon2[jx]; jcoxx = jcox-1; if ( jcox <= PCHCON) { jend=1; iend=1; } if ( jcox == 0 || (jcox > PCHCON) ) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; return; } } /* if ( (jcox == 0) || (jcox > PCHCON) ) */ do { if ( jcox < 0 ) jcox=- jcox; else jend=- jend; jcoxx = jcox-1; if ( jcox != j) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon ); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( jcox, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= jcox; if ( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if ( jcox == 0 ) { nec_exception* nex = new nec_exception("TRIO - SEGMENT CONNENTION ERROR FOR SEGMENT "); nex->append(j); throw nex; } else continue; } /* if ( jcox != j) */ if ( iend == 1) break; jcox= icon2[jx]; if ( jcox > PCHCON) break; jend=1; iend=1; } /* do */ while( jcox != 0 ); jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon ); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; } /*! \brief compute component of basis function i on segment is. This is a version of the tbf() method that does not store the basis functions */ void c_geometry::sbf( int i, int is, nec_float *aa, nec_float *bb, nec_float *cc ) { int local_jsno; // this parameter is renamed because it shadows the member variable of the same name int ix, june, jcox, jcoxx, jend, iend, njun1=0, njun2; nec_float d, sig, pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; *aa=0.; *bb=0.; *cc=0.; june=0; local_jsno=0; pp=0.; ix=i-1; jcox= icon1[ix]; if ( jcox > PCHCON) jcox= i; jcoxx = jcox-1; jend=-1; iend=-1; sig=-1.; do { if ( jcox != 0 ) { if ( jcox < 0 ) jcox=- jcox; else { sig=- sig; jend=- jend; } jcoxx = jcox-1; local_jsno++; d= pi()* segment_length[jcoxx]; sdh= sin( d); cdh= cos( d); sd=2.* sdh* cdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( log(1./( pi()* segment_radius[jcoxx]))-.577215664); pp -= omc/ sd* aj; if ( jcox == is) { *aa= aj/ sd* sig; *bb= aj/(2.* cdh); *cc=- aj/(2.* sdh)* sig; june= iend; } if ( jcox != i ) { if ( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if ( abs(jcox) != i ) { if ( jcox == 0 ) { nec_exception* nex = new nec_exception("SBF - SEGMENT CONNECTION ERROR FOR SEGMENT "); nex->append(i); throw nex; } else continue; } } /* if ( jcox != i ) */ else if ( jcox == is) *bb=- *bb; if ( iend == 1) break; } /* if ( jcox != 0 ) */ pm=- pp; pp=0.; njun1= local_jsno; jcox= icon2[ix]; if ( jcox > PCHCON) jcox= i; jend=1; iend=1; sig=-1.; } /* do */ while( jcox != 0 ); njun2= local_jsno- njun1; d= pi()* segment_length[ix]; sdh= sin( d); cdh= cos( d); sd=2.* sdh* cdh; cd= cdh* cdh- sdh* sdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cd; ap=1./( log(1./( pi()* segment_radius[ix])) -.577215664); aj= ap; if ( njun1 == 0) { if ( njun2 == 0) { *aa =-1.; qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); *cc=1./( cdh- xxi* sdh); return; } qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); if ( june == 1) { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; if ( i != is) return; } *aa -= 1.; d = cd - xxi * sd; *bb += (sdh + ap * qp * (cdh - xxi * sdh)) / d; *cc += (cdh + ap * qp * (sdh + xxi * cdh)) / d; return; } /* if ( njun1 == 0) */ if ( njun2 == 0) { qm= pi()* segment_radius[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); if ( june == -1) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; if ( i != is) return; } *aa -= 1.; d= cd- xxi* sd; *bb += ( aj* qm*( cdh- xxi* sdh)- sdh)/ d; *cc += ( cdh- aj* qm*( sdh+ xxi* cdh))/ d; return; } /* if ( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; if ( june != 0 ) { if ( june < 0 ) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; } else { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; } if ( i != is) return; } /* if ( june != 0 ) */ *aa -= 1.; *bb += ( aj* qm+ ap* qp)* sdh/ sd; *cc += ( aj* qm- ap* qp)* cdh/ sd; } /* get_current_coefficients computes coefficients of the: constant [air, aii] sine [bir, bii] cosine [cir, cii] terms in the current interpolation functions for the current vector curx. */ void c_geometry::get_current_coefficients(nec_float wavelength, complex_array& curx, real_array& air, real_array& aii, real_array& bir, real_array& bii, real_array& cir, real_array& cii, complex_array& vqds, int nqds, int_array& iqds) { static nec_complex s_CCJ(0.0,-0.01666666667); nec_float ar, ai, sh; nec_complex cs1, cs2; air.fill(0,n,0.0); aii.fill(0,n,0.0); bir.fill(0,n,0.0); bii.fill(0,n,0.0); cir.fill(0,n,0.0); cii.fill(0,n,0.0); if ( n != 0) { for (int i = 0; i < n; i++ ) { ar= real( curx[i]); ai= imag( curx[i]); tbf( i+1, 1 ); for (int jx = 0; jx < jsno; jx++ ) { int j = jco[jx]-1; air[j] += ax[jx]* ar; aii[j] += ax[jx]* ai; bir[j] += bx[jx]* ar; bii[j] += bx[jx]* ai; cir[j] += cx[jx]* ar; cii[j] += cx[jx]* ai; } } /* for( i = 0; i < n; i++ ) */ for (int is = 0; is < nqds; is++ ) { int i= iqds[is]-1; int jx= icon1[i]; icon1[i]=0; tbf(i+1,0); icon1[i]= jx; sh = segment_length[i]*.5; nec_complex curd = s_CCJ * vqds[is]/( (log(2.* sh/ segment_radius[i])-1.)* (bx[jsno-1]* cos(two_pi() * sh)+ cx[jsno-1]* sin(two_pi() * sh))* wavelength ); ar = real( curd); ai = imag( curd); for ( jx = 0; jx < jsno; jx++ ) { int j = jco[jx]-1; air[j] += ax[jx]* ar; aii[j] += ax[jx]* ai; bir[j] += bx[jx]* ar; bii[j] += bx[jx]* ai; cir[j] += cx[jx]* ar; cii[j] += cx[jx]* ai; } } /* for( is = 0; is < nqds; is++ ) */ for (int i = 0; i < n; i++ ) curx[i]= nec_complex( air[i]+cir[i], aii[i]+cii[i] ); } /* if ( n != 0) */ if ( m == 0) return; /* convert surface currents from */ /* t1,t2 components to x,y,z components */ int jco1 = n_plus_2m; int jco2 = jco1 + m; for (int i = 1; i <= m; i++ ) { jco1 -= 2; jco2 -= 3; cs1= curx[jco1]; cs2= curx[jco1+1]; curx[jco2] = cs1* t1x[m-i]+ cs2* t2x[m-i]; curx[jco2+1]= cs1* t1y[m-i]+ cs2* t2y[m-i]; curx[jco2+2]= cs1* t1z[m-i]+ cs2* t2z[m-i]; } } void c_geometry::frequency_scale(nec_float freq_mhz) { DEBUG_TRACE("frequency_scale(" << freq_mhz << ")"); nec_float fr = freq_mhz/ CVEL; for (int i = 0; i < n; i++ ) { x[i]= x_unscaled[i]* fr; y[i]= y_unscaled[i]* fr; z[i]= z_unscaled[i]* fr; segment_length[i]= si_unscaled[i]* fr; segment_radius[i]= bi_unscaled[i]* fr; } nec_float fr2 = fr*fr; for (int i = 0; i < m; i++ ) { px[i]= px_unscaled[i]* fr; py[i]= py_unscaled[i]* fr; pz[i]= pz_unscaled[i]* fr; pbi[i]= pbi_unscaled[i]* fr2; } } void c_geometry::fflds(nec_float rox, nec_float roy, nec_float roz, complex_array& scur, nec_complex *in_ex, nec_complex *in_ey, nec_complex *in_ez ) { static nec_complex _const4(0.0,+188.365); // From FORTRAN common block // EQUIVALENCE (XS,X), (YS,Y), (ZS,Z), (S,BI), (CONS,CONSX) nec_complex ex(cplx_00()); nec_complex ey(cplx_00()); nec_complex ez(cplx_00()); for (int i = 0; i < m; i++ ) { nec_float arg = patch_angle(i,rox,roy,roz); nec_complex ct = cplx_exp(arg) * pbi[i]; int k = 3*i; ex += scur[k]* ct; ey += scur[k+1]* ct; ez += scur[k+2]* ct; } nec_complex ct = rox*ex+ roy*ey+ roz*ez; *in_ex = _const4*(ct*rox - ex); *in_ey = _const4*(ct*roy - ey); *in_ez = _const4*(ct*roz - ez); } int c_geometry::test_ek_approximation(int seg1, int seg2) { nec_float segment_ratio = segment_radius[seg2] / segment_radius[seg1]; nec_float xi = fabs(cab[seg1]*cab[seg2] + sab[seg1]*sab[seg2] + salp[seg1]*salp[seg2]); if ( (xi < 0.999999) || (fabs(segment_ratio-1.0) > 1.e-6)) return 2; else return 0; } nec_float c_geometry::patch_angle(int patch_index, nec_float in_ax, nec_float in_ay, nec_float in_az) { return two_pi()*(in_ax*px[patch_index]+ in_ay*py[patch_index]+ in_az*pz[patch_index]); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_results.h0000644000175000017500000005227210325372102021343 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_results__ #define __nec_results__ #include #include #include #include #include #include "math_util.h" using namespace std; enum RESULT_FORMAT { RESULT_FORMAT_NEC = 1, RESULT_FORMAT_XML = 2, RESULT_FORMAT_CSV = 3 }; /*!\brief A class that handles various standard output functions for the results. This class will handle format changes between various output formats. */ class output_helper { private: ostream& os; enum RESULT_FORMAT m_format; public: output_helper(ostream& in_os, enum RESULT_FORMAT in_format) : os(in_os), m_format(in_format) { } inline void separator() { switch (m_format) { case RESULT_FORMAT_CSV: os << ","; break; case RESULT_FORMAT_NEC: default: os << " "; break; } } inline void start_record() { switch (m_format) { case RESULT_FORMAT_XML: os << ""; break; default: break; } } inline void end_record() { switch (m_format) { case RESULT_FORMAT_XML: os << "" << endl; break; default: os << endl; break; } } inline void padding(char* s) { switch (m_format) { case RESULT_FORMAT_NEC: os << s; break; default: break; } } inline void section_start() { switch (m_format) { case RESULT_FORMAT_NEC: os << endl << endl << endl; break; default: os << endl << endl << endl; break; } } inline void int_out(int w, int i) { os << setw(w) << i; } inline void string_out(int w, char* s) { os << right << setw(w) << s; } inline void real_out(int w, int p, nec_float f, bool sci = true) { ios::fmtflags flags = ios::showpoint | ios::uppercase | ios::right; if (sci) flags |= ios::scientific; else flags |= ios::fixed; os.unsetf(ios::adjustfield | ios::basefield | ios::floatfield); os.setf(flags); os.precision(p); os.width(w); os << f; } inline void complex_out(int w, int p, nec_complex c, bool sci = true) { real_out(w,p,real(c),sci); separator(); real_out(w,p,imag(c),sci); } inline void polar_out(int w, int p, nec_complex c, bool sci = true) { real_out(w,p,abs(c),sci); separator(); real_out(w,p,arg_degrees(c),sci); } }; /*!\brief Used to specify the kind of results we wish to pull out of the results database. */ /*new result types added : near_field_pattern and structure_currents*/ enum nec_result_type { RESULT_NORMALIZED_RECEIVING_PATTERN = 1, RESULT_STRUCTURE_EXCITATION = 2, RESULT_ANTENNA_INPUT = 3, RESULT_RADIATION_PATTERN = 4, RESULT_NEAR_FIELD_PATTERN = 5, RESULT_STRUCTURE_CURRENTS = 6 }; /** This class contains the results of the NEC analysis. Set methods will store the results in this class, but will NOT print the results to a file */ class nec_base_result { private: bool _write_file; nec_float _frequency; protected: enum RESULT_FORMAT _result_format; public: virtual void write_to_file(ostream& os) = 0; virtual enum nec_result_type get_result_type() = 0; nec_base_result() : _write_file(true), _result_format(RESULT_FORMAT_NEC) { } virtual ~nec_base_result() { } inline bool write_file() const { return _write_file; } inline void set_write_file(bool f) { _write_file = f; } inline void set_frequency(nec_float f) { _frequency = f; } nec_float get_frequency() { return _frequency; } inline void set_result_format(enum RESULT_FORMAT f) { _result_format = f; } }; /** Normalized Receiving Pattern */ class nec_norm_rx_pattern : public nec_base_result { // Receiving Pattern nec_float _norm_factor; nec_float _eta, _axial_ratio; int _segment_number; string _type; long n_theta; long n_phi; nec_float _theta0, _theta_step; nec_float _phi0, _phi_step; real_array _mag; public: nec_norm_rx_pattern( int in_n_theta, int in_n_phi, real_array& in_mag, nec_float theta0, nec_float theta_step, nec_float phi0, nec_float phi_step, nec_float in_eta, nec_float in_axial_ratio, int in_segment_number, string in_type) { n_theta = in_n_theta; n_phi = in_n_phi; _mag.copy(in_mag); _mag.resize(n_theta, n_phi); _theta0 = theta0; _theta_step = theta_step; _phi0 = phi0; _phi_step = phi_step; _eta = in_eta; _axial_ratio = in_axial_ratio; _segment_number = in_segment_number; _type = in_type; _mag.resize(n_theta, n_phi); } virtual ~nec_norm_rx_pattern() { } virtual enum nec_result_type get_result_type() { return RESULT_NORMALIZED_RECEIVING_PATTERN; } void set_input(int theta_index, int phi_index, nec_float mag) { _mag.set(theta_index,phi_index,mag); } /*Added for the python wrapping : some basic access functions...*/ int get_n_theta() { return n_theta ; } int get_n_phi() { return n_phi ; } nec_float get_theta_start() { return _theta0; } nec_float get_phi_start() { return _phi0; } nec_float get_delta_theta() { return _theta_step; } nec_float get_delta_phi() { return _phi_step; } nec_float get_eta() { return _eta; } nec_float get_axial_ratio() { return _axial_ratio; } int get_segment_number() { return _segment_number; } string get_type() { return _type; } real_array get_mag() { return _mag; } /*End of access functions added for the wrapping*/ nec_float get_mag(int theta_index, int phi_index) { return _mag.get(theta_index, phi_index); } nec_float get_norm_factor() { return _mag.max(); } virtual void write_to_file(ostream& os) { if (n_theta == 0) return; if (n_phi == 0) return; nec_float norm_factor = get_norm_factor(); output_helper oh(os,_result_format); oh.section_start(); os << " ---- NORMALIZED RECEIVING PATTERN ----" << endl; os << " NORMALIZATION FACTOR: ";oh.real_out(11,4,norm_factor);os << endl; os << " ETA: ";oh.real_out(7,2,_eta,false); os << " DEGREES" << endl; os << " TYPE: " << _type << endl; os << " AXIAL RATIO: "; oh.real_out(6,3,_axial_ratio,false); os << endl; os << " SEGMENT No: ";oh.int_out( 5, _segment_number); os << endl << endl; os << " THETA PHI ---- PATTERN ----" << endl; os << " (DEG) (DEG) DB MAGNITUDE" << endl; nec_float theta = _theta0; for (int t=0; t _tag, _segment; vector _voltage, _current, _impedance, _admittance; vector _power; long n_items; nec_complex voli, curi; public: nec_structure_excitation() { n_items = 0; } virtual ~nec_structure_excitation() { } virtual enum nec_result_type get_result_type() { return RESULT_STRUCTURE_EXCITATION; } /*The two methods bellow have been modified to get rid of "nec_structure_excitation_data" */ /*void add(int segment_number, int segment_tag, nec_complex voltage, nec_complex current, nec_float power) { structure_excitation_data sed(segment_number, segment_tag, voltage, current, power); m_data.push_back(sed); n_items++; } virtual void write_to_file(ostream& os) { output_helper oh(os,_result_format); oh.section_start(); os << " --------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" << endl; os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " No: No: REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i = 0; i < n_items; i++ ) { m_data[i].write(oh); } }*/ void add(int segment, int tag, nec_complex voltage, nec_complex current, nec_float power) { n_items++; _tag.push_back(tag); _segment.push_back(segment); _voltage.push_back(voltage); _current.push_back(current); _impedance.push_back(voltage/current); _admittance.push_back(current/voltage); _power.push_back(power); } virtual void write_to_file(ostream& os) { output_helper oh(os,_result_format); oh.section_start(); os << " --------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" << endl; os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " No: No: REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i=0; i get_tag() { return _tag; } vector get_segment() { return _segment; } vector get_current() { return _current; } vector get_voltage() { return _voltage; } vector get_power() { return _power; } /*End of access functions added for the wrapping*/ }; /** Antenna Input Parameters */ class nec_antenna_input : public nec_base_result { // Antenna Input Parameters vector _tag, _segment; vector _power; vector _voltage, _current, _impedance, _admittance; long n_items; public: nec_antenna_input() { n_items = 0; } virtual ~nec_antenna_input() { } virtual enum nec_result_type get_result_type() { return RESULT_ANTENNA_INPUT; } void set_input(int tag, int segment, nec_complex voltage, nec_complex current, nec_complex impedance, nec_complex admittance, nec_float power) { n_items++; _tag.push_back(tag); _segment.push_back(segment); _voltage.push_back(voltage); _current.push_back(current); _impedance.push_back(impedance); _admittance.push_back(admittance); _power.push_back(power); } virtual void write_to_file(ostream& os) { if (n_items == 0) return; output_helper oh(os,_result_format); oh.section_start(); os << " --------- ANTENNA INPUT PARAMETERS ---------" << endl; os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " NO. NO. REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i=0; i get_tag() { return _tag; } vector get_segment() { return _segment; } vector get_current() { return _current; } vector get_voltage() { return _voltage; } vector get_power() { return _power; } /*End of access functions added for the wrapping*/ }; class nec_near_field_pattern : public nec_base_result { private: /*Near field pattern*/ int nfeh; vector _x, _y, _z; vector _field_x, _field_y, _field_z; long n_items; public: nec_near_field_pattern(int in_nfeh) { nfeh = in_nfeh; n_items = 0; } virtual ~nec_near_field_pattern() { } virtual enum nec_result_type get_result_type() { return RESULT_NEAR_FIELD_PATTERN; } void set_input(nec_float x, nec_float y, nec_float z, nec_complex field_x, nec_complex field_y, nec_complex field_z) { n_items++; _x.push_back(x); _y.push_back(y); _z.push_back(z); _field_x.push_back(field_x); _field_y.push_back(field_y); _field_z.push_back(field_z); } virtual void write_to_file(ostream& os) { if (n_items == 0) return; output_helper oh(os,_result_format); oh.section_start(); if ( nfeh != 1) { os << endl << endl < get_x() { return _x; } vector get_y() { return _y; } vector get_z() { return _z; } vector get_field_x() { return _field_x; } vector get_field_y() { return _field_y; } vector get_field_z() { return _field_z; } /*End of access functions added for the wrapping*/ }; class nec_radiation_pattern; class nec_structure_currents; /** Stores a whole lot of nec_result objects. This class is effectively a database of the simulation results. Usage nec_antenna_input* ai = new nec_antenna_input(); s_results.add(ai); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); */ class nec_results { vector _results; int _n; bool _file_out; public: enum RESULT_FORMAT m_result_format; nec_results() { m_result_format = RESULT_FORMAT_NEC; _n = 0; _file_out = false; } // On destruction we write to a file. ~nec_results() { // write_to_file(); for (int i=0;i<_n;i++) { delete _results[i]; _results[i] = NULL; } } void add(nec_base_result* br) { br->set_result_format(m_result_format); _results.push_back(br); _n++; } /*!\brief Get the nth result that matches the specified result type \param index The zero-based index for the result \param result_type The requested result type \return NULL if the result does not exist. \note You must NOT delete the nec_norm_rx_pattern object when finished with it. */ nec_base_result* get_result(const long index, const enum nec_result_type result_type) { long counter = 0; for (int i=0;i<_n;i++) { if (_results[i]->get_result_type() == result_type) { if (index == counter++) return _results[i]; } } return NULL; } /*!\brief Get normalized receiving pattern results \param index The zero-based index for the normalized receiving pattern. \return NULL if the result does not exist. \note You must NOT delete the nec_norm_rx_pattern object when finished with it. */ nec_norm_rx_pattern* get_norm_rx_pattern(const long index) { return (nec_norm_rx_pattern*)get_result(index, RESULT_NORMALIZED_RECEIVING_PATTERN); } /*!\brief Get radiation pattern results \param index The zero-based index for the radiation pattern. \return NULL if the result does not exist. \note You must NOT delete the nec_radiation_pattern object when finished with it. */ nec_radiation_pattern* get_radiation_pattern(const long index) { return (nec_radiation_pattern*)get_result(index, RESULT_RADIATION_PATTERN); } /*!\brief Get antenna input parameter results \param index The zero-based index for the antenna input. \return NULL if the result does not exist. \note You must NOT delete the nec_antenna_input object when finished with it. */ nec_antenna_input* get_antenna_input(const long index) { return (nec_antenna_input*)get_result(index, RESULT_ANTENNA_INPUT); } /*!\brief Get structure excitation results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_structure_excitation* get_structure_excitation(const long index) { return (nec_structure_excitation*)get_result(index, RESULT_STRUCTURE_EXCITATION); } /*!\brief Get near field pattern results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_near_field_pattern* get_near_field_pattern(const long index) { return (nec_near_field_pattern*)get_result(index, RESULT_NEAR_FIELD_PATTERN); } /*!\brief Get structure currents results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_structure_currents* get_structure_currents(const long index) { return (nec_structure_currents*)get_result(index, RESULT_STRUCTURE_CURRENTS); } void write_nec_file() { if (false == _file_out) return; for (int i=0;i<_n;i++) { if (_results[i]->write_file()) { _results[i]->write_to_file(cout); _results[i]->set_write_file(false); } } } void set_stdout(bool f) { _file_out = f; } }; #endif /* __nec_results__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_evlcom.cpp0000644000175000017500000004250210325372102021132 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_evlcom.h" #include "matrix_algebra.h" // for test() #include "nec_exception.h" using namespace std; /* What on earth is this NM thing? */ #define NM 131072 #define MAXH 20 #define CRIT 1.0E-4 #define PTP .6283185308 #define NTS 4 /* compute integration parameter xlam=lambda from parameter t. */ void c_evlcom::lambda( nec_float t, nec_complex *xlam, nec_complex *dxlam ) const { *dxlam = m_contour_b - m_contour_a; *xlam = m_contour_a + *dxlam*t; } /*! \brief gshank integrates the 6 Sommerfeld integrals from start to infinity (until convergence) in lambda. At the break point, bk, the step increment may be changed from dela to delb. Shank's algorithm to accelerate convergence of a slowly converging series is used. */ void c_evlcom::gshank( nec_complex start, nec_complex dela, complex_array& sum, int nans, complex_array& seed, int ibk, nec_complex bk, nec_complex delb ) { bool brk = false; int ibx, jm; static nec_float rbk, amg, den, denm; nec_complex a1, a2, as1, as2, del, aa; nec_complex q1[6][20], q2[6][20]; complex_array ans1(6), ans2(6); rbk=real(bk); del=dela; if (ibk == 0) ibx=1; else ibx=0; // I believe that this is a spurious generalization for this routine. Hence the // following assert. ASSERT(nans == 6); for (int i = 0; i < nans; i++ ) ans2[i]=seed[i]; m_contour_b=start; for (int intx = 1; intx <= MAXH; intx++ ) { int inx=intx-1; m_contour_a = m_contour_b; m_contour_b += del; if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=1; m_contour_b=bk; del=delb; rom1(nans,sum,2); if ( ibx != 2 ) { for (int i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for (int i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; intx = 0; continue; } /* if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) */ rom1(nans,sum,2); for (int i = 0; i < nans; i++ ) ans1[i] = ans2[i]+sum[i]; m_contour_a = m_contour_b; m_contour_b += del; if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=2; m_contour_b=bk; del=delb; rom1(nans,sum,2); if ( ibx != 2 ) { for (int i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for (int i = 0; i < nans; i++ ) ans2[i] = ans1[i]+sum[i]; intx = 0; continue; } /* if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) */ rom1(nans,sum,2); for (int i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; den=0.; for (int i = 0; i < nans; i++ ) { as1=ans1[i]; as2=ans2[i]; if (intx >= 2) { for (int j = 1; j < intx; j++ ) { jm=j-1; aa=q2[i][jm]; a1=q1[i][jm]+as1-2.*aa; if ( (real(a1) != 0.) || (imag(a1) != 0.) ) { a2=aa-q1[i][jm]; a1=q1[i][jm]-a2*a2/a1; } else a1=q1[i][jm]; a2=aa+as2-2.*as1; if ( (real(a2) != 0.) || (imag(a2) != 0.) ) a2=aa-(as1-aa)*(as1-aa)/a2; else a2=aa; q1[i][jm]=as1; q2[i][jm]=as2; as1=a1; as2=a2; } } q1[i][intx-1]=as1; q2[i][intx-1]=as2; amg=fabs(real(as2))+fabs(imag(as2)); if (amg > den) den=amg; } /* for ( i = 0; i < nans; i++ ) */ denm=1.e-3*den*CRIT; jm=intx-3; if (jm < 1) jm = 1; for (int j = jm-1; j < intx; j++ ) { brk = false; for (int i = 0; i < nans; i++ ) { a1=q2[i][j]; den=(fabs(real(a1))+fabs(imag(a1)))*CRIT; if (den < denm) den=denm; a1=q1[i][j]-a1; amg=fabs(real(a1)+fabs(imag(a1))); if (amg > den) { brk = true; break; } } /* for ( i = 0; i < nans; i++ ) */ if ( brk ) break; } /* for ( j = jm-1; j < intx; j++ ) */ if ( false == brk ) { for (int i = 0; i < nans; i++ ) sum[i]=.5*(q1[i][inx]+q2[i][inx]); return; } } /* for ( intx = 1; intx <= maxh; intx++ ) */ /* No convergence */ throw new nec_exception("No convergence in gshank() - aborting"); } /*! \brief rom1 integrates the 6 Sommerfeld integrals from m_contour_a to m_contour_b in lambda. The method of variable interval width Romberg integration is used. */ void c_evlcom::rom1( int n, complex_array& sum, int nx ) { int ns, nt; static nec_float z, ze, s, ep, zend, dz=0.0, dzot=0.0, tr, ti; static nec_complex t00, t11, t02; static complex_array g1(6), g2(6), g3(6), g4(6), g5(6), t01(6), t10(6), t20(6); ASSERT(n == 6); z = 0.0; ze = 1.0; s = 1.0; ep = s / (1.0e4 * NM); zend=ze-ep; nec_complex cmplx_zero(0.0,0.0); for (int i = 0; i < n; i++ ) sum[i]=cmplx_zero; ns=nx; nt=0; saoa(z,g1); bool jump = false; bool lstep = false; while( true ) { if ( false == jump ) { dz = s/ns; if ( (z+dz) > ze ) { dz=ze-z; if ( dz <= ep ) return; } dzot=dz*.5; saoa(z+dzot,g3); saoa(z+dz,g5); } /* if ( false == jump ) */ bool nogo = false; for (int i = 0; i < n; i++ ) { t00=(g1[i]+g5[i])*dzot; t01[i]=(t00+dz*g3[i])*.5; t10[i]=(4.*t01[i]-t00)/3.; /* test convergence of 3 point romberg result */ test( real(t01[i]), real(t10[i]), &tr, imag(t01[i]), imag(t10[i]), &ti, 0. ); if ( (tr > CRIT) || (ti > CRIT) ) nogo = true; } if ( false == nogo ) { for (int i = 0; i < n; i++ ) sum[i] += t10[i]; nt += 2; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = false; continue; } /* if ( false == nogo ) */ saoa(z+dz*.25,g2); saoa(z+dz*.75,g4); nogo = false; for (int i = 0; i < n; i++ ) { t02=(t01[i]+dzot*(g2[i]+g4[i]))*.5; t11=(4.*t02-t01[i])/3.; t20[i]=(16.*t11-t10[i])/15.; /* test convergence of 5 point Romberg result */ test( real(t11), real(t20[i]), &tr, imag(t11), imag(t20[i]), &ti, 0.0 ); if ( (tr > CRIT) || (ti > CRIT) ) nogo = true; } if ( false == nogo ) { for (int i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = false; continue; } /* if ( false == nogo ) */ nt=0; if (ns < NM) { ns *= 2; dz=s/ns; dzot=dz*.5; for (int i = 0; i < n; i++ ) { g5[i]=g3[i]; g3[i]=g2[i]; } jump = true; continue; } /* if (ns < NM) */ if ( false == lstep ) { lstep = true; lambda( z, &t00, &t11 ); } for (int i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns /= 2; nt=1; } jump = false; } /* while( TRUE ) */ } /*! \brief saoa computes the integrand for each of the 6 Sommerfeld integrals for source and observer above ground. */ void c_evlcom::saoa( nec_float t, complex_array& ans) { static nec_complex xl, dxl, cgam1, cgam2, b0, b0p, com, dgam, den1, den2; lambda(t, &xl, &dxl); if ( m_bessel_flag == true ) { /* Bessel function form */ bessel(xl*m_rho, &b0, &b0p); b0 *=2.; b0p *=2.; cgam1=sqrt(xl*xl-m_ck1sq); cgam2=sqrt(xl*xl-m_ck2sq); if (real(cgam1) == 0.0) cgam1=nec_complex(0.0,-fabs(imag(cgam1))); if (real(cgam2) == 0.) cgam2=nec_complex(0.0,-fabs(imag(cgam2))); } else { /* Hankel function form */ hankel(xl*m_rho, &b0, &b0p); com=xl-m_ck1; cgam1=sqrt(xl+m_ck1)*sqrt(com); if (real(com) < 0. && imag(com) >= 0.) cgam1=-cgam1; com=xl-m_ck2; cgam2=sqrt(xl+m_ck2)*sqrt(com); if (real(com) < 0. && imag(com) >= 0.) cgam2=-cgam2; } if (norm(xl) >= m_tsmag) { if (imag(xl) >= 0.0) { nec_float xlr = real(xl); if (xlr >= m_ck2) { if (xlr <= m_ck1r) dgam=cgam2-cgam1; else { nec_float sign =1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } } else { nec_float sign=-1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } /* if (xlr >= m_ck2) */ } /* if (imag(xl) >= 0.) */ else { nec_float sign=1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } } /* if (norm(xl) < m_tsmag) */ else { dgam=cgam2-cgam1; } #if 0 nec_float xlr = real(xl); if ( (xlr >= m_ck2) && (xlr <= m_ck1r)) { dgam=cgam2-cgam1; } else { sign = 1.0; if ((imag(xl) >= 0.0) && (xlr < m_ck2)) sign = -1.0; nec_floaf temp = 1.0/(xl*xl); dgam=sign*((m_ct3*temp+m_ct2)*temp+m_ct1)/xl; } #endif den2=m_cksm*dgam/(cgam2*(m_ck1sq*cgam2+m_ck2sq*cgam1)); den1=1./(cgam1+cgam2)-m_cksm/cgam2; com=dxl*xl*exp(-cgam2*m_zph); ans[5]=com*b0*den1/m_ck1; com *= den2; if (m_rho != 0.) { b0p=b0p/m_rho; ans[0]=-com*xl*(b0p+b0*xl); ans[3]=com*xl*b0p; } else { ans[0]=-com*xl*xl*.5; ans[3]=ans[0]; } ans[1]=com*cgam2*cgam2*b0; ans[2]=-ans[3]*cgam2*m_rho; ans[4]=com*b0; } /* evlua controls the integration contour in the complex */ /* lambda plane for evaluation of the sommerfeld integrals */ void c_evlcom::evlua( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *eph ) { static nec_float del, slope, rmis; static nec_complex cp1, cp2, cp3, bk, delta, delta2; complex_array sum(6), ans(6); del=m_zph; if ( m_rho > del ) del=m_rho; if (m_zph >= 2.*m_rho) { /* Bessel function form of Sommerfeld integrals */ m_bessel_flag=true; m_contour_a=nec_complex(0.0,0.0); del=1.0/del; if ( del > m_tkmag) { m_contour_b=nec_complex(0.1*m_tkmag,-0.1*m_tkmag); rom1(6,sum,2); m_contour_a=m_contour_b; m_contour_b=nec_complex(del,-del); rom1 (6,ans,2); for (int i = 0; i < 6; i++ ) sum[i] += ans[i]; } else { m_contour_b=nec_complex(del,-del); rom1(6,sum,2); } delta=PTP*del; gshank(m_contour_b,delta,ans,6,sum,0,m_contour_b,m_contour_b); ans[5] *= m_ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(m_ck1sq*ans[2]); *ezv=conj(m_ck1sq*(ans[1]+m_ck2sq*ans[4])); *erh=conj(m_ck2sq*(ans[0]+ans[5])); *eph=-conj(m_ck2sq*(ans[3]+ans[5])); return; } /* if (m_zph >= 2.*m_rho) */ /* Hankel function form of Sommerfeld integrals */ m_bessel_flag=false; cp1=nec_complex(0.0,.4*m_ck2); cp2=nec_complex(.6*m_ck2,-.2*m_ck2); cp3=nec_complex(1.02*m_ck2,-.2*m_ck2); m_contour_a=cp1; m_contour_b=cp2; rom1(6,sum,2); m_contour_a=cp2; m_contour_b=cp3; rom1(6,ans,2); for (int i = 0; i < 6; i++ ) sum[i]=-(sum[i]+ans[i]); /* path from imaginary axis to -infinity */ if (m_zph > .001*m_rho) slope=m_rho/m_zph; else slope=1000.; del=PTP/del; delta=nec_complex(-1.0,slope)*del/sqrt(1.+slope*slope); delta2=-conj(delta); gshank(cp1,delta,ans,6,sum,0,bk,bk); rmis=m_rho*(real(m_ck1)-m_ck2); bool jump = false; if ( (rmis >= 2.*m_ck2) && (m_rho >= 1.e-10) ) { if (m_zph >= 1.e-10) { bk=nec_complex(-m_zph,m_rho)*(m_ck1-cp3); rmis=-real(bk)/fabs(imag(bk)); if (rmis > 4.*m_rho/m_zph) jump = true; } if ( false == jump ) { /* integrate up between branch cuts, then to + infinity */ cp1=m_ck1- nec_complex(0.1,+0.2); cp2=cp1+.2; bk=nec_complex(0.,del); gshank(cp1,bk,sum,6,ans,0,bk,bk); m_contour_a=cp1; m_contour_b=cp2; rom1(6,ans,1); for (int i = 0; i < 6; i++ ) ans[i] -= sum[i]; gshank(cp3,bk,sum,6,ans,0,bk,bk); gshank(cp2,delta2,ans,6,sum,0,bk,bk); } jump = true; } /* if ( (rmis >= 2.*m_ck2) || (m_rho >= 1.e-10) ) */ else jump = false; if ( false == jump ) { /* integrate below branch points, then to + infinity */ for (int i = 0; i < 6; i++ ) sum[i]=-ans[i]; rmis=real(m_ck1)*1.01; if ( (m_ck2+1.) > rmis ) rmis=m_ck2+1.; bk=nec_complex(rmis,.99*imag(m_ck1)); delta=bk-cp3; delta *= del/abs(delta); gshank(cp3,delta,ans,6,sum,1,bk,delta2); } /* if ( false == jump ) */ ans[5] *= m_ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(m_ck1sq*ans[2]); *ezv=conj(m_ck1sq*(ans[1]+m_ck2sq*ans[4])); *erh=conj(m_ck2sq*(ans[0]+ans[5])); *eph=-conj(m_ck2sq*(ans[3]+ans[5])); } /*-----------------------------------------------------------------------*/ #define GAMMA .5772156649 #define C3 .7978845608 #define P10 .0703125 #define P20 .1121520996 #define Q10 .125 #define Q20 .0732421875 #define P11 .1171875 #define P21 .1441955566 #define Q11 .375 #define Q21 .1025390625 #define POF .7853981635 /* bessel evaluates the zero-order bessel function */ /* and its derivative for complex argument z. */ void bessel( nec_complex z, nec_complex *j0, nec_complex *j0p ) { static int m[101]; static nec_float a1[25], a2[25]; static nec_complex cplx_01(0.0,1.0); static nec_complex cplx_10(1.0,0.0); /* initialization of constants */ static bool bessel_init = false; if ( false == bessel_init ) { for (int k = 1; k <= 25; k++ ) { int index = k-1; a1[index] = -0.25/(k*k); a2[index] = 1.0/(k+1.0); } for (int i = 1; i <= 101; i++ ) { nec_float tst=1.0; int init; for (int k = 0; k < 24; k++ ) { init = k; tst *= -i*a1[k]; if ( tst < 1.0e-6 ) break; } m[i-1] = init+1; } /* for (int i = 1; i<= 101; i++ ) */ bessel_init = true; } /* if (false == bessel_init) */ nec_float zms = norm(z); if (zms <= 1.e-12) { *j0=cplx_10; *j0p=-0.5*z; return; } nec_complex j0x, j0px; int ib=0; if (zms <= 37.21) { if (zms > 36.0) ib=1; /* series expansion */ #pragma message("Some strange code below. Why use the norm of a vector as an index?") int iz = int(zms); // TCAM : conversion of nec_float to int here! // Using int() I think that this is the same as the fortran implicit coercion // but perhaps we should be doing an explicit rounding operation? int miz=m[iz]; *j0 = cplx_10; *j0p = cplx_10; nec_complex zk = cplx_10; nec_complex zi = z*z; for (int k = 0; k < miz; k++ ) { zk *= a1[k]*zi; *j0 += zk; *j0p += a2[k]*zk; } *j0p *= -0.5*z; if (ib == 0) return; j0x=*j0; j0px=*j0p; } /* asymptotic expansion */ nec_complex zi = 1.0/z; nec_complex zi2 = zi*zi; nec_complex p0z = 1.0 + (P20*zi2-P10)*zi2; nec_complex p1z = 1.0 +(P11-P21*zi2)*zi2; nec_complex q0z = (Q20*zi2-Q10)*zi; nec_complex q1z = (Q11-Q21*zi2)*zi; nec_complex zk = exp(cplx_01 * (z-POF)); zi2 = 1.0/zk; nec_complex cz = 0.5*(zk+zi2); nec_complex sz = cplx_01 * 0.5 * (zi2-zk); zk = C3*sqrt(zi); *j0 = zk*(p0z*cz-q0z*sz); *j0p = -zk*(p1z*sz+q1z*cz); if (ib == 0) return; nec_float pi_10 = pi() * 10.0; zms = cos((sqrt(zms)-6.0)*pi_10); *j0 = 0.5*(j0x*(1.0+zms)+ *j0*(1.0-zms)); *j0p = 0.5*(j0px*(1.0+zms)+ *j0p*(1.0-zms)); } #define C1 -.02457850915 #define C2 .3674669052 /* hankel evaluates hankel function of the first kind, */ /* order zero, and its derivative for complex argument z */ void hankel( nec_complex z, nec_complex *h0, nec_complex *h0p ) { static int m[101]; static nec_float a1[25], a2[25], a3[25], a4[25]; nec_complex clogz, p0z, p1z, q0z, q1z, zi, zi2, zk; static nec_complex cplx_01(0.0,1.0); static bool hankel_init = false; /* initialization of constants */ if ( ! hankel_init ) { nec_float psi=-GAMMA; for (int k = 1; k <= 25; k++ ) { int i = k-1; a1[i]=-.25/(k*k); a2[i]=1.0/(k+1.0); psi += 1.0/k; a3[i]=psi+psi; a4[i]=(psi+psi+1.0/(k+1.0))/(k+1.0); } for (int i = 1; i <= 101; i++ ) { int init; nec_float test=1.0; for (int k = 0; k < 24; k++ ) { init = k; test *= -i*a1[k]; if (test*a3[k] < 1.e-6) break; } m[i-1]=init+1; } hankel_init = true; } /* if ( ! hankel_init ) */ nec_float zms = norm(z); if (zms == 0.0) throw new nec_exception("hankel not valid for z=0."); nec_complex y0(0,0); nec_complex y0p(0,0); int ib=0; if (zms <= 16.81) { if (zms > 16.) ib=1; /* series expansion */ int iz = int(zms); // TCAM using explicit int() coercion int miz = m[iz]; nec_complex j0(1.0,0.0); nec_complex j0p(1.0,0.0); zk = j0; zi = z*z; for (int k = 0; k < miz; k++ ) { zk *= a1[k]*zi; j0 += zk; j0p += a2[k]*zk; y0 += a3[k]*zk; y0p += a4[k]*zk; } j0p *= -.5*z; clogz= log(.5*z); y0 = (2.0 * j0 * clogz-y0)/pi() + C2; y0p = (2.0/z +2.0*j0p*clogz + 0.5*y0p*z)/pi() + C1*z; *h0=j0+cplx_01*y0; *h0p=j0p+cplx_01*y0p; if (ib == 0) return; y0=*h0; y0p=*h0p; } /* if (zms <= 16.81) */ /* asymptotic expansion */ zi=1./z; zi2=zi*zi; p0z=1.+(P20*zi2-P10)*zi2; p1z=1.+(P11-P21*zi2)*zi2; q0z=(Q20*zi2-Q10)*zi; q1z=(Q11-Q21*zi2)*zi; zk=exp(cplx_01*(z-POF))*sqrt(zi)*C3; *h0=zk*(p0z+cplx_01*q0z); *h0p=cplx_01*zk*(p1z+cplx_01*q1z); if (ib == 0) return; zms=cos((sqrt(zms)-4.)*31.41592654); *h0=.5*(y0*(1.+zms)+ *h0*(1.-zms)); *h0p=.5*(y0p*(1.+zms)+ *h0p*(1.-zms)); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/RadiationInput.h0000644000175000017500000000732210325372102021743 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Radiation_Input__ #define __Radiation_Input__ #include #include "BaseInput.h" class RadiationInput : public BaseInput { public: vector theta, phi; vector power_v, power_h, power_t; vector pol_axial_ratio, pol_tilt; string pol_sense; // ignore polarization sense vector E_theta_mag, E_phi_mag; vector E_theta_phase, E_phi_phase; long n_items; RadiationInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("RADIATION PATTERNS"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("VOLTS/M",0) == string::npos) line = readline(); /* - - ANGLES - - - POWER GAINS - - - - POLARIZATION - - - - - - E(THETA) - - - - - - E(PHI) - - - THETA PHI VERT. HOR. TOTAL AXIAL TILT SENSE MAGNITUDE PHASE MAGNITUDE PHASE DEGREES DEGREES DB DB DB RATIO DEG. VOLTS/M DEGREES VOLTS/M DEGREES .00 .00 -999.99 -3.23 -3.23 .00000 -90.00 LINEAR 0.00000E+00 -81.39 7.35700E-05 -195.64 */ line = readline(); while (line != "") { stringstream ss(line); theta.push_back(read_fixed(ss)); phi.push_back(read_fixed(ss)); power_v.push_back(read_fixed(ss)); power_h.push_back(read_fixed(ss)); power_t.push_back(read_fixed(ss)); pol_axial_ratio.push_back(read_fixed(ss)); pol_tilt.push_back(read_fixed(ss)); ss >> pol_sense; E_theta_mag.push_back(read_sci(ss)); E_theta_phase.push_back(read_fixed(ss)); E_phi_mag.push_back(read_sci(ss)); E_phi_phase.push_back(read_fixed(ss)); line = readline(); n_items++; } cout << "Radiation pattern: " << n_items << " lines" << endl; } } } bool equalto(const RadiationInput& ai) { if (difference(ai) > 1e-4) return false; return true; } double difference(const RadiationInput& ai) { double ret = 0.0; // compart angles if (n_items != ai.n_items) return 1; for (long i=0; i < n_items;i++) { if (theta[i] != ai.theta[i]) return 1; if (phi[i] != ai.phi[i]) return 1; try { ret += diff(power_v[i], ai.power_v[i]); ret += diff(power_h[i], ai.power_h[i]); ret += diff(power_t[i], ai.power_t[i]); if (power_v[i] > -999.0) { ret += diff(pol_axial_ratio[i], ai.pol_axial_ratio[i]); ret += diff(pol_tilt[i], ai.pol_tilt[i]); ret += diff(deg_polar(E_theta_mag[i],E_theta_phase[i]), deg_polar(ai.E_theta_mag[i],ai.E_theta_phase[i])); ret += diff(deg_polar(E_phi_mag[i],E_phi_phase[i]), deg_polar(ai.E_phi_mag[i],ai.E_phi_phase[i])); } } catch (string message) { cout << "Diff at [" << theta[i] << "," << phi[i] << "] : " << message << endl; } } return ret; }; }; #endif /* __Radiation_Input__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/PowerBudget.h0000644000175000017500000000540010325372102021233 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PowerBudget__ #define __PowerBudget__ #include #include "BaseInput.h" /* ---------- POWER BUDGET --------- INPUT POWER = 3.3203E-05 Watts RADIATED POWER= 3.3203E-05 Watts STRUCTURE LOSS= 0.0000E+00 Watts NETWORK LOSS = 0.0000E+00 Watts EFFICIENCY = 100.00 Percent */ class PowerBudget : public BaseInput { public: vector input_power, radiated_power, structure_loss, network_loss, efficiency; long n_items; double get_power_line() { string line = readline(); if (line.length() < 2) line = readline(); // delete up to '=' character (+1 includes the = character) line.erase(0, line.find("=",0) + 1); stringstream ss(line); double ret = read_sci(ss); return ret; } PowerBudget(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("POWER BUDGET"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { // check for a blank line here. { double p = get_power_line(); input_power.push_back(p); } { double p = get_power_line(); radiated_power.push_back(p); } { double p = get_power_line(); structure_loss.push_back(p); } { double p = get_power_line(); network_loss.push_back(p); } { double p = get_power_line(); efficiency.push_back(p); } n_items++; } } } bool equalto(const PowerBudget& pb) { if (difference(pb) > 1e-4) return false; return true; } double difference(const PowerBudget& pb) { double ret = 0; if (n_items != pb.n_items) return 1.0; try { for (long i=0; i #include #include #ifdef NEC_ERROR_CHECK #include "nec_exception.h" class BoundsViol : public nec_exception { public: BoundsViol(const char* message, long index, long bound) : nec_exception(message) { m_message << "array index: " << index << " exceeds " << bound << std::endl; } }; #endif /*! \brief A Safe Array class for nec2++ that performs bounds checking if the macro NEC_ERROR_CHECK is defined at compile time. This class also includes some utility functions for handling common vector operations. \todo Modify the resize() operator so that we resize in units of _resize_chunk. This will increase efficiency. */ template class safe_array { public: safe_array() : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { } safe_array(long in_size) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { resize(in_size); } safe_array(long n_rows, long n_cols) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { resize(n_rows, n_cols); } safe_array(const safe_array& in_array) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { copy(in_array); } ~safe_array() { if (own_data_) delete[] data_; } long size() const { return len_; } void resize(long n_rows, long n_cols) { rows_ = n_rows; cols_ = n_cols; resize(rows_ * cols_); } // Copy the contents of in_array to our array // resizing as appropriate. void copy(const safe_array& in_array) { if (in_array.rows_ == 0) resize(in_array.len_); else resize(in_array.rows_,in_array.cols_); for (long i=0; i data_size_) { // We allocate resize_chunk_ more bytes than we need to avoid // resizing too often. T* new_data_ = new T[new_length + resize_chunk_]; data_size_ = new_length + resize_chunk_; if (0 != len_) memcpy(new_data_, data_, len_ * sizeof(T)); delete[] data_; data_ = new_data_; len_ = new_length; } else { len_ = new_length; } } // return the largest element of the array T max() { T ret = data_[check(0)]; for (long i = 1; i < len_; i++ ) { if ( data_[check(i)] > ret) ret = data_[check(i)]; } return ret; } // return the sum of all elements in the array T sum(long start_index, long stop_index) { T ret = data_[check(start_index)]; for (long i = start_index+1; i < stop_index; i++ ) { ret += data_[check(i)]; } return ret; } // return the sum of all elements in the array T sum() { return sum(0,len_); } // fill all elements of the array with x void fill(long start, long N, const T& x) { long stop = start + N; for (long i = start; i < stop; i++ ) { data_[check(i)] = x; } } // fill all elements of the array with x void fill(const T& x) { fill(0,len_,x); } /*! Set an element assuming that the data is stored in column major form. */ void set_col_major(int col_dim, int col, int row, const T& val) { data_[check(row*col_dim + col)] = val; } /*! Get an element assuming that the data is stored in column major form. */ T& get_col_major(int col_dim, int col, int row) { return data_[check(row*col_dim + col)]; } T& get(long row, long col) { return data_[check(row,col)]; } T get(long row, long col) const { return data_[check(row,col)]; } void set(long row, long col, const T& x) { data_[check(row,col)] = x; } const T& operator[](long i) const { return data_[check(i)]; } T& operator[](long i) { return data_[check(i)]; } // if end_index is -1, then finish at the end of the array safe_array sub_array(long start_index, long end_index = -1) { if (-1 == end_index) end_index = len_; return safe_array(*this, start_index, end_index, false); } T* get_ptr() const { return data_; } safe_array& operator=(const safe_array& in_array) { copy(in_array); return *this; } private: long len_; long rows_; long cols_; long resize_chunk_; T* data_; long data_size_; bool own_data_; // Used to constructing sub_array's safe_array(safe_array& in_array, long start_index, long end_index, bool in_copy_data) { resize_chunk_ = in_array.resize_chunk_; len_ = (end_index - start_index); rows_ = 0; cols_ = 0; if (in_copy_data) { data_ = new T[len_]; data_size_ = len_; for (long i=0; i= len_) throw new BoundsViol("safe_array: ", i, len_); #endif return i; } inline long check(long row, long col) const { #ifdef NEC_ERROR_CHECK if (row < 0 || row >= rows_) throw new BoundsViol("safe_array: ", row, rows_); if (col < 0 || col >= cols_) throw new BoundsViol("safe_array: ", col, cols_); #endif return check(row*cols_ + col); } }; #endif /* __safe_array__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_plot_card.cpp0000644000175000017500000001061110325372102021610 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_plot_card.h" #include "math_util.h" #include "math_util.h" #include #include using namespace std; c_plot_card::c_plot_card() { p1 = 0; p2 = 0; p3 = 0; p4 = 0; plot_fp = NULL; } c_plot_card::c_plot_card(const c_plot_card& p) { p1 = p.p1; p2 = p.p2; p3 = p.p3; p4 = p.p4; plot_fp = p.plot_fp; } c_plot_card::c_plot_card(int itmp1, int itmp2, int itmp3, int itmp4, string& filename) { p1 = itmp1; p2 = itmp2; p3 = itmp3; p4 = itmp4; plot_fp = NULL; /* Open plot file */ if ( (plot_fp = fopen(filename.c_str(), "w")) == NULL ) { throw 100; } } c_plot_card::~c_plot_card() { if ( plot_fp != NULL ) fclose( plot_fp ); } bool c_plot_card::is_valid() const { return (NULL != plot_fp); } bool c_plot_card::storing() const { return (p1 != 0); } bool c_plot_card::currents() const { return (p1 == 1); } bool c_plot_card::near_field() const { return (p1 == 2); } bool c_plot_card::patterns() const { return (p1 == 3); } bool c_plot_card::realimag() const { return ( ((p1 == 1) || (p1 == 2)) && (p2 == 1) ); } bool c_plot_card::magphase() const { return ( ((p1 == 1) || (p1 == 2)) && (p2 == 3) ); } void c_plot_card::set_plot_real_imag_currents() { p1 = 1; p2 = 1; } void c_plot_card::plot_endl() const { if (NULL == plot_fp) throw 100; fprintf( plot_fp, "\n"); } void c_plot_card::plot_double(double x) const { if (NULL == plot_fp) throw 100; fprintf( plot_fp, "%12.4E ", x ); } void c_plot_card::plot_complex(nec_complex x) const { if (NULL == plot_fp) throw 100; switch( p2 ) { case 2: plot_double(real(x)); plot_double(imag(x)); case 3: plot_double(abs(x)); plot_double(arg_degrees(x)); } } void c_plot_card::plot_complex_2d(nec_complex x, nec_complex y, nec_complex z) const { switch( p3 ) { case 1: plot_complex(x); break; case 2: plot_complex(y); break; case 3: plot_complex(z); break; case 4: plot_complex(x); plot_complex(y); plot_complex(z); break; } } void c_plot_card::plot_currents(nec_complex ex, nec_complex ey, nec_complex ez) const { if (false == currents()) return; plot_complex_2d(ex, ey, ez); plot_endl(); } void c_plot_card::plot_segments(int i, real_array& x, real_array& y, real_array& z, real_array& si, double xw2, double yw2, real_array& bi, int_array& icon1, int_array& icon2) const { if (false == near_field()) return; fprintf( plot_fp, "%12.4E %12.4E %12.4E " "%12.4E %12.4E %12.4E %12.4E %5d %5d %5d\n", x[i],y[i],z[i],si[i],xw2,yw2,bi[i],icon1[i],i+1,icon2[i] ); } void c_plot_card::plot_fields( nec_complex ex, nec_complex ey, nec_complex ez, double xob, double yob, double zob) { if ( p1 != 2) return; double xxx; if ( p4 < 0 ) xxx = xob; else if ( p4 == 0 ) xxx= yob; else xxx= zob; plot_double(xxx); plot_complex_2d(ex,ey,ez); plot_endl(); } void c_plot_card::plot_patterns(double theta, double phi, nec_complex e_theta, nec_complex e_phi, double g_vert, double g_horiz, double g_tot) { if ( false == patterns()) return; switch (p2) { case 1: plot_double(theta); plot_complex(e_theta); plot_endl(); break; case 2: plot_double(phi); plot_complex(e_phi); plot_endl(); break; } if ( p4 == 0 ) return; // plot gains I4(3)- 1=V, 2=H, 3=TOTAL, 4=V H T GAINS DB switch (p2) { case 1: plot_double(theta); break; case 2: plot_double(phi); break; } switch( p4 ) { case 1: plot_double(g_vert); // vertical break; case 2: plot_double(g_horiz); // horizontal break; case 3: plot_double(g_tot); // total break; case 4: plot_double(g_vert); plot_double(g_horiz); plot_double(g_tot); break; } plot_endl(); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_context.cpp0000644000175000017500000053740410325473662021703 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_context.h" #include "c_geometry.h" #include "nec_exception.h" static char* hpol[3] = { "LINEAR", "RIGHT", "LEFT" }; nec_context::nec_context() { m_output_fp=NULL; m_results.set_stdout(false); m_geometry = new c_geometry(); inc=0; isave=0; nthic=0; nphic=0; impedance_norm_factor = 0.0; // was zpnorm xpr1=0.0; xpr2=0.0; xpr3=0.0; xpr4=0.0; xpr5=0.0; xpr7=0.0; /*structure_currents is a pointer to the "nec_base_result" which takes care of storing and printing of the currents*/ structure_currents = NULL; // allocate the ground grid ggrid.initialize(); } nec_context::~nec_context() { delete m_geometry; } /*! \brief Initialize everything, called after construction so that we can tell the geometry object what nec_context object to point to. */ void nec_context::initialize() { DEBUG_TRACE("initialize()"); nthi=0; nphi=0; iflow = 1; thetis=0.0; phiss=0.0; iptag=0; iptagf=0; iptagt=0; iptaq=0; iptaqf=0; iptaqt=0; init_voltage_sources(); m_geometry->set_context(this); imat=0; // this should go away! It appears to be related to some very old code for handling out-of-core situations */ } /*! \brief Private method to initialize the voltage source buffers */ void nec_context::init_voltage_sources() { /* Free vsource buffers */ ivqd.resize(0); iqds.resize(0); vqd.resize(0); vqds.resize(0); source_segment_array.resize(0); source_voltage_array.resize(0); voltage_source_count=0; nvqd=0; iped=0; } /*! \brief After the geometry has been specified, this function prepares for calculations */ void nec_context::calc_prepare() { DEBUG_TRACE("calc_prepare()"); iflow=1; int n_plus_m = m_geometry->n_plus_m; /* Allocate some buffers */ air.resize(n_plus_m); aii.resize(n_plus_m); bir.resize(n_plus_m); bii.resize(n_plus_m); cir.resize(n_plus_m); cii.resize(n_plus_m); ip.resize(m_geometry->n_plus_2m); current_vector.resize(m_geometry->n_plus_3m); /* Matrix parameters */ if ( imat == 0) { neq= m_geometry->n_plus_2m; neq2=0; } /* default values for input parameters and flags */ npeq = m_geometry->np + 2*m_geometry->mp; processing_state=1; rkh=1.; m_use_exk=false; m_excitation_type = EXCITATION_VOLTAGE; nload=0; network_count=0; m_near=-1; ifar=-1; ncoup=0; icoup=0; freq_mhz= CVEL; ground.default_values(); nfrq=1; iptflg=-2; iptflq=-1; iped=0; } /*!\brief Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. */ nec_float nec_context::benchmark() { nec_float start_timer, stop_timer; secnds( &start_timer ); for (int i=0; i<2; i++) { { /* CMEXAMPLE 2. CENTER FED LINEAR ANTENNA. CM CURRENT SLOPE DISCONTINUITY SOURCE. CM 1. THIN PERFECTLY CONDUCTING WIRE CE 2. THIN ALUMINUM WIRE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 50. XQ LD 5 0 0 0 3.720E+07 FR 0 1 0 0 300. EX 5 0 5 0 1. GN 1 XQ EN */ nec_context nec; nec.set_results_stdout(false); nec.set_gain_only(true); nec.initialize(); c_geometry* geo = nec.get_geometry(); geo->wire(0,8, 0.0, 0.0, -0.25, 0.0, 0.0, 0.25, 0.00001, 1.0, 1.0); nec.geometry_complete(0,0); nec.fr_card(0, 3, 200.0, 50.0); nec.ex_card(EXCITATION_VOLTAGE_DISC, 0, 5, 1, 1.0, 0.0, 50.0, 0.0, 0.0, 0.0); nec.xq_card(0); nec.ld_card(5, 0, 0,0, 3.72e7, 0.0, 0.0); nec.fr_card(0, 1, 300.0, 0.0); nec.ex_card(EXCITATION_VOLTAGE_DISC, 0, 5, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec.gn_card(1, 0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0); // TODO Keep testing here... nec.xq_card(0); /* This line kills the version on Wine! Very strange! I think that the gn card is bad fixme:msvcrt:MSVCRT_signal (11 (nil)):stub err:seh:EXC_DefaultHandling Unhandled exception code c0000005 flags 0 addr 0x404e2380 Wine failed with return code 1 */ } { /* An example showing how to evaluate for maximum gain. CM GA - NEC FILE CE go blue ! GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE 0 GN -1 LD 5 0 0 0 3.720E+07 FR 0 1 0 0 2400 PT -1 EX 1 1 1 0 0 0 0 0 0 0 0 RP 0 1 1 0500 90 90 0 0 EN */ nec_context nec; nec.set_results_stdout(false); nec.set_gain_only(false); nec.initialize(); c_geometry* geo = nec.get_geometry(); geo->wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); geo->wire(0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); geo->wire(0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); geo->wire(0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); geo->wire(0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); geo->wire(0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); geo->wire(0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); geo->wire(0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); geo->wire(0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); geo->wire(0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); nec.geometry_complete(0,0); nec.gn_card(-1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); nec.ld_card(5,0,0,0,3.72e7,0.0,0.0); nec.pt_card(-1, 0, 0, 0); nec.ex_card(EXCITATION_LINEAR, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec.fr_card(0, 2, 2400.0, 100.0); nec.rp_card(0, 1, 1, 0,5,0,0, 90.0, 90.0, 0.0, 0.0, 0.0, 0.0); double g = 0; g = nec.get_maximum_gain(); } } /* time the process */ secnds( &stop_timer ); stop_timer -= start_timer; cout << endl << endl; nec_float sec = stop_timer / 1000.0; nec_float bench = 7.0 / sec; return bench; } /*! \brief Signal the end of a geometry description. This function prepares for a calculation by calling calc_prepare(). */ void nec_context::geometry_complete(int card_int_1, int card_int_2) { DEBUG_TRACE("geometry_complete()"); m_geometry->geometry_complete(this, card_int_1, card_int_2); calc_prepare(); } /*! 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 */ 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) { m_geometry->wire(tag_id, segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, rdel, rrad); } /*! 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. */ void nec_context::arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ) { m_geometry->arc(tag_id, segment_count, rada, ang1, ang2, rad); } /*! \brief Add an helix to the geometry, \remark 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::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) { m_geometry->helix(s, hl, a1, b1, a2, b2, rad, segment_count, tag_id); } /* "fr" card, frequency parameters FREQUENCY I1- O= LINEAR STEP, 1=MULTIPLICATIVE I2- NO. STEPS, BLANK=1 I3- BLANK -- not used in this function I4- BLANK -- not used in this function F1- FREQUENCY OR START FREQUENCY F2- FREQ INCREMENT, ADD OR MULTIPLY */ void nec_context::fr_card(int in_ifrq, int in_nfrq, nec_float in_freq_mhz, nec_float in_del_freq) { DEBUG_TRACE("fr_card()"); ifrq = in_ifrq; nfrq = in_nfrq; if ( nfrq == 0) nfrq=1; freq_mhz = in_freq_mhz; delfrq = in_del_freq; if ( iped == 1) impedance_norm_factor = 0.0; processing_state = 1; iflow = 1; } void nec_context::ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3) { DEBUG_TRACE("ld_card()"); if ( iflow != 3 ) { iflow=3; /* Free loading buffers */ nload=0; ldtyp.resize(0); ldtag.resize(0); ldtagf.resize(0); ldtagt.resize(0); zlr.resize(0); zli.resize(0); zlc.resize(0); if ( processing_state > 2 ) processing_state=2; if ( itmp1 == -1 ) return; // continue card input loop } /* Reallocate loading buffers */ nload++; ldtyp.resize(nload); ldtag.resize(nload); ldtagf.resize(nload); ldtagt.resize(nload); zlr.resize(nload); zli.resize(nload); zlc.resize(nload); int idx = nload-1; ldtyp[idx]= itmp1; ldtag[idx]= itmp2; if ( itmp4 == 0) itmp4= itmp3; ldtagf[idx]= itmp3; ldtagt[idx]= itmp4; if ( itmp4 < itmp3 ) { nec_stop("DATA FAULT ON LOADING CARD No: %d: ITAG " "STEP1: %d IS GREATER THAN ITAG STEP2: %d", nload, itmp3, itmp4 ); } zlr[idx]= tmp1; zli[idx]= tmp2; zlc[idx]= tmp3; } /* "gn" card, ground parameters under the antenna GN NEAR GROUND, GROUND SCREEN, ADDED GROUND I1- -1=SET FREE SPACE (A), 0=REFL COEFF, 1=IDEAL (B), 2-SOMMERFELD I2- (A) BLANK), NO WIRES IN GND SCREEN (C), 0= NO WIRES (D) I3- BLANK I4- BLANK F1- (A,B) BLANK, DIELECTRIC OF NEAR GROUND F2- (A,B) BLANK, CONDUCTIVITY OF NEAR GROUND F3- (A,B) BLANK, (C) RADIUS OF SCREEN, (D) DIELECTRIC 2ND MEDIUM F4- (A,B) BLANK, (C) RADII SCREEN WIRES, (D) CONDUCT. 2ND MEDIUM F5- (A,B) BLANK, (C) BLANK, (D) DIST TO 2ND MEDIUM, SEE RP F6- (A,B) BLANK, (C) BLANK, (D) HEIGHT 2ND MEDIUM (AS IN GD) */ 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) { DEBUG_TRACE("gn_card(" << ground_type << ")"); ground.parse_gn(ground_type, rad_wire_count, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); iflow=4; if ( processing_state > 2) processing_state=2; } /* 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) */ 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) { DEBUG_TRACE("ex_card(" << itmp1 << "," << itmp2 << "," << itmp3 << "," << itmp4 << "," << tmp1 << "," << tmp2 << "," << tmp3 << "," << tmp4 << "," << tmp5 << "," << tmp6 << ")"); if ( iflow != 5) { init_voltage_sources(); iflow=5; if ( processing_state > 3) processing_state=3; } masym = itmp4/10; ASSERT(itmp1 >= 0); m_excitation_type = itmp1; if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) // (Voltage excitation) { ntsol=0; if ( m_excitation_type == EXCITATION_VOLTAGE_DISC) // Voltage DISC. { nvqd++; ivqd.resize(nvqd ); iqds.resize(nvqd ); vqd.resize( nvqd ); vqds.resize(nvqd ); int indx = nvqd-1; ivqd[indx]= m_geometry->get_segment_number( itmp2, itmp3); vqd[indx]= nec_complex( tmp1, tmp2); if ( abs( vqd[indx]) < 1.e-20) vqd[indx] = cplx_10(); iped= itmp4- masym*10; impedance_norm_factor= tmp3; if ( (iped == 1) && (impedance_norm_factor > 0.0) ) iped=2; return; /* continue card input loop */ } /* if ( m_excitation_type == EXCITATION_VOLTAGE_DISC) */ voltage_source_count++; source_segment_array.resize(voltage_source_count ); source_voltage_array.resize(voltage_source_count ); { int indx = voltage_source_count-1; int seg_number = m_geometry->get_segment_number( itmp2, itmp3); if (seg_number > m_geometry->segment_length.size()) { nec_exception* nex = new nec_exception("CHECK DATA, PARAMETER SPECIFYING EXCITATION SOURCE SEGMENT ["); nex->append(seg_number); nex->append("] IS TOO LARGE" ); throw nex; } source_segment_array[indx] = seg_number; DEBUG_TRACE("Voltage Source: " << nec_complex( tmp1, tmp2)); source_voltage_array[indx]= nec_complex( tmp1, tmp2); if ( abs( source_voltage_array[indx]) < 1.e-20) source_voltage_array[indx] = cplx_10(); iped= itmp4- masym*10; impedance_norm_factor= tmp3; if ( (iped == 1) && (impedance_norm_factor > 0.0) ) iped = 2; return; /* continue card input loop */ } } /* if ( (m_excitation_type == 0) || (m_excitation_type == 5) ) */ nthi= itmp2; nphi= itmp3; xpr1= tmp1; xpr2= tmp2; xpr3= tmp3; xpr4= tmp4; xpr5= tmp5; xpr6= tmp6; // xpr7= tmp7; Put this in here once we are parsing NEC4 excitation stuff. voltage_source_count=0; nvqd=0; thetis= xpr1; phiss= xpr2; } /* 5: "tl" cards, network 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 */ void nec_context::tl_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float characteristic_impedance, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6) { if ( iflow != 6) { network_count=0; ntsol=0; iflow=6; if ( processing_state > 3) processing_state=3; if ( itmp2 == -1 ) return; /* continue card input loop */ } /* Re-allocate network buffers */ network_count++; ntyp.resize(network_count); iseg1.resize(network_count); iseg2.resize(network_count); x11r.resize(network_count); x11i.resize(network_count); x12r.resize(network_count); x12i.resize(network_count); x22r.resize(network_count); x22i.resize(network_count); int idx = network_count-1; ntyp[idx] = 2; // TL card iseg1[idx]= m_geometry->get_segment_number( itmp1, itmp2); iseg2[idx]= m_geometry->get_segment_number( itmp3, itmp4); x11r[idx]= characteristic_impedance; x11i[idx]= tmp2; x12r[idx]= tmp3; x12i[idx]= tmp4; x22r[idx]= tmp5; x22i[idx]= tmp6; if (characteristic_impedance <= 0.0) { // Negative characteristic impedance implies a crossed line ntyp[idx] = 3; x11r[idx] = -characteristic_impedance; } } /* 4: 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) */ 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) { if ( iflow != 6) { network_count=0; ntsol=0; iflow=6; if ( processing_state > 3) processing_state=3; if ( itmp2 == -1 ) return; /* continue card input loop */ } /* Re-allocate network buffers */ network_count++; ntyp.resize(network_count); iseg1.resize(network_count); iseg2.resize(network_count); x11r.resize(network_count); x11i.resize(network_count); x12r.resize(network_count); x12i.resize(network_count); x22r.resize(network_count); x22i.resize(network_count); int idx = network_count-1; ntyp[idx]=1; // NT card iseg1[idx]= m_geometry->get_segment_number( itmp1, itmp2); iseg2[idx]= m_geometry->get_segment_number( itmp3, itmp4); x11r[idx]= tmp1; x11i[idx]= tmp2; x12r[idx]= tmp3; x12i[idx]= tmp4; x22r[idx]= tmp5; x22i[idx]= tmp6; } /* "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 */ void nec_context::xq_card(int itmp1) { DEBUG_TRACE("xq_card(" << itmp1 << ")"); DEBUG_TRACE("iflow =" << iflow); if ( ((iflow == 10) && (itmp1 == 0)) || ((nfrq == 1) && (itmp1 == 0) && (iflow > 7)) ) return; /* continue card input loop */ if ( itmp1 == 0) { if ( iflow > 7) iflow=11; else iflow=7; } else { ifar=0; rfld=0.; ipd=0; iavp=0; m_rp_normalization=0; m_rp_output_format=0; nth=91; nph=1; thets=0.0; phis=0.0; dth=1.0; dph=0.0; if ( itmp1 == 2) phis=90.0; if ( itmp1 == 3) { nph=2; dph=90.0; } } /* if ( itmp1 == 0) */ simulate(true); } /* "gd" card, ground representation */ void nec_context::gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4) { DEBUG_TRACE("gd_card(" << tmp1 << ")"); ground.setup_cliff(tmp1, tmp2, tmp3, tmp4); iflow=9; } /*! \brief Standard radiation pattern parameters \param calc_mode \param n_theta \param n_phi \param output_format The output format (0 major axis, minor axis and total gain printed. 1 vertical, horizontal ant total gain printed.) \param normalization Controls 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. \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.
  • D = 0 power gain.
  • D = 1 directive gain.
\param 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.
\param theta0 - Initial theta angle in degrees (initial z coordinate in meters if I1 = 1). \param phi0 - Initial phi angle in degrees. \param delta_theta - Increment for theta in degrees (increment for z in meters if I1 = 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 I1 = 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 w111 be normalized to the value of gain_norm. */ 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) { DEBUG_TRACE("rp_card(" << calc_mode << ")"); ifar= calc_mode; nth = n_theta; nph = n_phi; if ( nth == 0) nth=1; if ( nph == 0) nph=1; m_rp_output_format = output_format; m_rp_normalization = normalization; ipd = D; iavp = A; DEBUG_TRACE(" xnda = (" << m_rp_output_format << m_rp_normalization << ipd << iavp << ")"); if ( m_rp_output_format != 0) m_rp_output_format=1; if ( ipd != 0) ipd=1; // sanity check. Not point normalizing if there are too few data points to normalize on if ( (nth < 2) || (nph < 2) || (ifar == 1) ) iavp=0; thets = theta0; phis = phi0; dth = delta_theta; dph = delta_phi; rfld = radial_distance; gnor = gain_norm; iflow=10; simulate(true); } /* "pt" card, print control for current */ void nec_context::pt_card(int itmp1, int itmp2, int itmp3, int itmp4) { iptflg= itmp1; iptag= itmp2; iptagf= itmp3; iptagt= itmp4; if ( (itmp3 == 0) && (iptflg != -1) ) iptflg=-2; if ( itmp4 == 0) iptagt= iptagf; } /* "pq" card, print control for charge */ void nec_context::pq_card(int itmp1, int itmp2, int itmp3, int itmp4) { iptflq= itmp1; iptaq= itmp2; iptaqf= itmp3; iptaqt= itmp4; if ( (itmp3 == 0) && (iptflq != -1) ) iptflq=-2; if ( itmp4 == 0) iptaqt= iptaqf; } /* "kh" card, matrix integration limit */ void nec_context::kh_card(nec_float tmp1) { rkh = tmp1; if ( processing_state > 2) processing_state=2; iflow=1; } 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) { ne_nh_card(0, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } 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) { ne_nh_card(1, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } /* \brief Near field calculation parameters */ void nec_context::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) { nfeh = in_nfeh; if ( (iflow == 8) && (nfrq != 1) ) { m_output.endl(2); m_output.line("WHEN MULTIPLE FREQUENCIES ARE REQUESTED, " "ONLY ONE NEAR FIELD CARD CAN BE USED -"); m_output.line(" LAST CARD READ WILL BE USED" ); } m_near= itmp1; nrx= itmp2; nry= itmp3; nrz= itmp4; xnr= tmp1; ynr= tmp2; znr= tmp3; dxnr= tmp4; dynr= tmp5; dznr= tmp6; iflow=8; if ( nfrq == 1) simulate(); } /* "ek" card, extended thin wire kernel option */ void nec_context::set_extended_thin_wire_kernel(bool ek_flag) { m_use_exk = ek_flag; if ( processing_state > 2) processing_state=2; iflow=1; } /* "cp" card, maximum coupling between antennas */ void nec_context::cp_card(int itmp1, int itmp2, int itmp3, int itmp4) { if ( iflow != 2) { ncoup=0; nctag.resize(0); ncseg.resize(0); y11a.resize(0); y12a.resize(0); } icoup=0; iflow=2; if ( itmp2 == 0) return; /* continue card input loop */ ncoup++; nctag.resize(ncoup); ncseg.resize(ncoup); nctag[ncoup-1]= itmp1; ncseg[ncoup-1]= itmp2; if ( itmp4 == 0) return; /* continue card input loop */ ncoup++; nctag.resize(ncoup); ncseg.resize(ncoup); nctag[ncoup-1]= itmp3; ncseg[ncoup-1]= itmp4; } /* "pl" card, plot flags throws int on error. */ void nec_context::pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4) { std::string fname(ploutput_filename); plot_card = c_plot_card(itmp1,itmp2,itmp3,itmp4, fname); } /*! \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 nec_context::simulate(bool far_field_flag) { DEBUG_TRACE("simulate(" << far_field_flag << ")"); /* Allocate the normalization buffer */ { int mreq1 = 0; int mreq2 = 0; if ( iped ) mreq1 = 4*nfrq; if ( iptflg >= 2 ) mreq2 = nthi*nphi; int newsize = std::max(mreq1,mreq2); fnorm.resize(newsize); } /* igox is a state variable that is used to change from one processing mode to another. The processing to be performed are as follows: 1: Memory allocation & Initialization 2: Structure segment loading 3: Excitation set up (right hand side, -e inc.) 4: ? 5: Near field calculation 6: standard far field calculation */ int igox; int mhz = 0; if ( (far_field_flag == true) && (processing_state == 5) ) igox = 6; else igox = processing_state; try { int iresrv = 0; bool in_freq_loop = false; do { switch( igox ) { case 1: /* Memory allocation for primary interacton matrix. */ if (false == in_freq_loop) { iresrv = m_geometry->n_plus_2m * (m_geometry->np+2*m_geometry->mp); cm.resize(iresrv); /* Memory allocation for symmetry array */ nop = neq/npeq; symmetry_array.resize(nop*nop); mhz = 1; /* irngf is not used (NGF function not implemented) */ if ( imat == 0) fblock( npeq, neq, iresrv, m_geometry->m_ipsym); in_freq_loop = true; } if ( mhz != 1) { if ( ifrq == 1) freq_mhz *= delfrq; else freq_mhz += delfrq; } wavelength = CVEL / freq_mhz; print_freq_int_krnl(freq_mhz, wavelength, rkh, m_use_exk); m_geometry->frequency_scale(freq_mhz); processing_state = 2; case 2: /* structure segment loading */ structure_segment_loading(); processing_state=3; ntsol=0; case 3: /* excitation set up (right hand side, -e inc.) */ nthic=1; nphic=1; inc=1; nprint=0; default: enum excitation_return ret = excitation_loop(igox, mhz, iptflg, iptflq, iptag, iptagf, iptagt, iptaq, iptaqf, iptaqt, thetis, nfrq, iflow, nthi, nphi, iped); if (FREQ_LOOP_CONTINUE == ret) { continue; // Continue frequency loop } if (FREQ_LOOP_CARD_CONTINUE == ret) { throw 1; // Continue card input } nphic = 1; /* normalized receiving pattern printed */ print_norm_rx_pattern(iptflg, nthi, nphi, thetis, phiss); xpr2 = phiss; if ( mhz == nfrq) ifar=-1; if ( nfrq == 1) { m_output.end_section(); throw 1; // Continue card input } print_input_impedance(iped, ifrq, nfrq, delfrq); nfrq=1; mhz=1; } /* switch( igox ) */ } while( (++mhz <= nfrq) ); } /* try */ catch (int excep) { ASSERT(excep == 1); // keep going on the card input. The exception // is thrown in order to continue card input. } } /* ********************************************************************************************************** */ void nec_context::print_freq_int_krnl( nec_float f, nec_float lambda, nec_float int_dist, bool using_extended_kernel) { m_output.end_section(); m_output.set_indent(31); m_output.line("--------- FREQUENCY --------"); m_output.string("FREQUENCY= "); m_output.real_out(11,4,f); m_output.line(" MHZ"); m_output.string("WAVELENGTH="); m_output.real_out(11,4,lambda); m_output.line(" METERS"); m_output.endl(2); m_output.set_indent(24); m_output.line("APPROXIMATE INTEGRATION EMPLOYED FOR SEGMENTS"); m_output.string("THAT ARE MORE THAN "); m_output.real_out(5,3,int_dist,false); m_output.line(" WAVELENGTHS APART"); if ( using_extended_kernel ) m_output.line( "THE EXTENDED THIN WIRE KERNEL WILL BE USED"); m_output.set_indent(0); } void nec_context::antenna_env(void) { m_output.end_section(); m_output.line(" -------- ANTENNA ENVIRONMENT --------" ); if ( false == ground.present()) { m_output.line(" FREE SPACE" ); return; } ground.frati=cplx_10(); if (false == ground.type_perfect()) // if ( ground.iperf != 1) { if ( ground.sig < 0.) ground.sig=- ground.sig/(59.96*wavelength); nec_complex epsc = nec_complex( ground.epsr, -ground.sig*wavelength*59.96); ground.zrati = 1.0/ sqrt( epsc); ground_wave.set_u(ground.zrati); if ( ground.radial_wire_count != 0) { ground.scrwl= ground.radial_wire_length/ wavelength; ground.scrwr= ground.radial_wire_radius/ wavelength; ground.m_t1 = cplx_01()*2367.067/ (nec_float) ground.radial_wire_count; ground.t2 = ground.scrwr * (nec_float) ground.radial_wire_count; m_output.line( " RADIAL WIRE GROUND SCREEN"); m_output.nec_printf( " %d WIRES\n" " WIRE LENGTH: %8.2f METERS\n" " WIRE RADIUS: %10.3E METERS", ground.radial_wire_count, ground.radial_wire_length, ground.radial_wire_radius ); m_output.endl(); m_output.line(" MEDIUM UNDER SCREEN -" ); } if (false == ground.type_sommerfeld_norton()) { m_output.line(" FINITE GROUND - REFLECTION COEFFICIENT APPROXIMATION" ); } else { // calculate the Sommerfeld Norton ground stuff. ggrid.sommerfeld( ground.epsr, ground.sig, freq_mhz ); ground.frati = (epsc-1.0)/(epsc+1.0); if ( abs(( ggrid.m_epscf- epsc)/ epsc) >= 1.0e-3 ) { nec_stop("ERROR IN GROUND PARAMETERS -" "\n COMPLEX DIELECTRIC CONSTANT FROM FILE IS: %12.5E%+12.5Ej" "\n REQUESTED: %12.5E%+12.5Ej", real(ggrid.m_epscf), imag(ggrid.m_epscf), real(epsc), imag(epsc) ); } m_output.line(" FINITE GROUND - SOMMERFELD SOLUTION" ); } /* if ( ground.type_sommerfeld_norton() ) */ m_output.endl(); m_output.nec_printf( " " "RELATIVE DIELECTRIC CONST: %.3f\n" " " "CONDUCTIVITY: %10.3E MHOS/METER\n" " " "COMPLEX DIELECTRIC CONSTANT: %11.4E%+11.4Ej", ground.epsr, ground.sig, real(epsc), imag(epsc) ); } else { m_output.nec_printf(" PERFECT GROUND" ); } } /*No more used...*/ void nec_context::print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq, int iptaqf, int iptaqt) { int jump; nec_float cmag, ph; nec_complex curi; nec_float fr; nec_float etha, ethm, ephm, epha; nec_complex eth, eph, ex, ey, ez; if ( m_geometry->n != 0) { if ( iptflg != -1) { if ( iptflg <= 0) { m_output.endl(3); m_output.line( " -------- CURRENTS AND LOCATION --------"); m_output.line( " DISTANCES IN WAVELENGTHS" ); m_output.endl(); m_output.line( " SEG TAG COORDINATES OF SEGM CENTER SEGM ------------- CURRENT (AMPS) -------------"); m_output.line( " No: No: X Y Z LENGTH REAL IMAGINARY MAGN PHASE"); } else if ( (iptflg != 3) && (inc <= 1) ) { m_output.endl(3); m_output.nec_printf( " -------- RECEIVING PATTERN PARAMETERS --------\n" " ETA: %7.2f DEGREES\n" " TYPE: %s\n" " AXIAL RATIO: %6.3f\n\n" " THETA PHI ----- CURRENT ---- SEG\n" " (DEG) (DEG) MAGNITUDE PHASE No:", xpr3, pattype, xpr6 ); } /* if ( iptflg <= 0) */ } /* if ( iptflg != -1) */ structure_power_loss=0.; int itmp1=0; jump= iptflg+1; for (int i = 0; i < m_geometry->n; i++ ) { curi= current_vector[i]* wavelength; cmag= abs( curi); ph= arg_degrees( curi); if ( (nload != 0) && (fabs(real(zarray[i])) >= 1.e-20) ) structure_power_loss += 0.5*cmag*cmag*real(zarray[i]) * m_geometry->segment_length[i]; if ( jump == 0) continue; if ( jump > 0 ) { if ( (iptag != 0) && (m_geometry->segment_tags[i] != iptag) ) continue; itmp1++; if ( (itmp1 < iptagf) || (itmp1 > iptagt) ) continue; if ( iptflg != 0) { if ( iptflg >= 2 ) { fnorm[inc-1]= cmag; isave = i+1; } if ( iptflg != 3) { m_output.endl(); m_output.nec_printf(" %7.2f %7.2f %11.4E %7.2f %5d", xpr1, xpr2, cmag, ph, i+1 ); continue; } } /* if ( iptflg != 0) */ else /*iptflg = 0, only the currents specified are printed*/ { m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); // added test for plot_card.is_valid() if (plot_card.is_valid() && plot_card.currents()) { plot_card.plot_complex(curi); plot_card.plot_endl(); } } } else /*iptflg = -2, all currents are printed*/ { m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); // added test for plot_card.is_valid() if (plot_card.is_valid() && plot_card.currents()) { plot_card.plot_complex(curi); plot_card.plot_endl(); } } } /* for( i = 0; i < n; i++ ) */ if ( iptflq != -1) { m_output.endl(3); m_output.nec_printf( " " "------ CHARGE DENSITIES ------\n" " " " DISTANCES IN WAVELENGTHS\n\n" " SEG TAG COORDINATES OF SEG CENTER SEG" " " " CHARGE DENSITY (COULOMBS/METER)\n" " NO: NO: X Y Z LENGTH" " " " REAL IMAGINARY MAGN PHASE" ); itmp1 = 0; fr = 1.e-6/freq_mhz; for(int i = 0; i < m_geometry->n; i++ ) { if ( iptflq != -2 ) { if ( (iptaq != 0) && (m_geometry->segment_tags[i] != iptaq) ) continue; itmp1++; if ( (itmp1 < iptaqf) || (itmp1 > iptaqt) ) continue; } /* if ( iptflq == -2) */ curi = fr * nec_complex(- bii[i], bir[i]); cmag = abs( curi); ph = arg_degrees( curi); m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %9.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); } /* for( i = 0; i < n; i++ ) */ } /* if ( iptflq != -1) */ } /* if ( n != 0) */ if ( m_geometry->m != 0) { m_output.endl(3); m_output.nec_printf( " " " --------- SURFACE PATCH CURRENTS ---------\n" " " " DISTANCE IN WAVELENGTHS\n" " " " CURRENT IN AMPS/METER\n\n" " ---------" " SURFACE COMPONENTS -------- " "---------------- RECTANGULAR COMPONENTS ----------------\n" " PCH --- PATCH CENTER --- TANGENT VECTOR 1 " " TANGENT VECTOR 2 ------- X ------ ------- Y ------" " " " ------- Z ------\n No: X Y Z MAG." " " "PHASE MAG. PHASE REAL IMAGINARY REAL " " IMAGINARY REAL IMAGINARY" ); int j = m_geometry->n-3; int itmp1 = -1; for(int i = 0; i < m_geometry->m; i++ ) { j += 3; itmp1++; ASSERT(itmp1 == i); ex= current_vector[j]; ey= current_vector[j+1]; ez= current_vector[j+2]; eth= ex* m_geometry->t1x[itmp1]+ ey* m_geometry->t1y[itmp1]+ ez* m_geometry->t1z[itmp1]; eph= ex* m_geometry->t2x[itmp1]+ ey* m_geometry->t2y[itmp1]+ ez* m_geometry->t2z[itmp1]; ethm= abs( eth); etha= arg_degrees( eth); ephm= abs( eph); epha= arg_degrees( eph); m_output.endl(); m_output.nec_printf( " %4d %7.3f %7.3f %7.3f %11.4E " "%8.2f %11.4E %8.2f" " %9.2E %9.2E %9.2E %9.2E %9.2E %9.2E", i+1, m_geometry->px[itmp1], m_geometry->py[itmp1], m_geometry->pz[itmp1], ethm, etha, ephm, epha, real(ex), imag(ex), real(ey), imag(ey), real(ez), imag(ez)); plot_card.plot_currents(ex,ey,ez); } /* for( i=0; i 1) ) return; int itmp3 = 0; int net_type = ntyp[0]; for (int i = 0; i < 2; i++ ) { if ( net_type == 3) net_type = 2; for (int j = 0; j < network_count; j++) { if ( (ntyp[j]/net_type) != 1 ) { itmp3 = ntyp[j]; // can never be zero } else { if ( (ntyp[j] >= 2) && (x11i[j] <= 0.0) ) { int idx4 = iseg1[j]-1; int idx5 = iseg2[j]-1; nec_float xx = m_geometry->x[idx5]- m_geometry->x[idx4]; nec_float yy = m_geometry->y[idx5]- m_geometry->y[idx4]; nec_float zz = m_geometry->z[idx5]- m_geometry->z[idx4]; // set the length of the transmission line to be the // straight line distance. x11i[j] = wavelength*sqrt(xx*xx + yy*yy + zz*zz); } } } if ( itmp3 == 0) // can only be zero if all the networks are the same type return; net_type = itmp3; } } /* calculate_network_data */ void nec_context::print_network_data(void) { // int i, j; int itmp1, itmp2, itmp3, itmp4, itmp5; char *pnet[3] = { " ", "STRAIGHT", " CROSSED" }; if ( (network_count != 0) && (inc <= 1) ) { m_output.nec_printf( "\n\n\n" " " "---------- NETWORK DATA ----------" ); itmp3=0; itmp1= ntyp[0]; for(int i = 0; i < 2; i++ ) { if ( itmp1 == 3) itmp1=2; if ( itmp1 == 2) { m_output.endl(); m_output.nec_printf( " -- FROM - --- TO -- " "TRANSMISSION LINE " " --------- SHUNT ADMITTANCES (MHOS) " "--------- LINE\n" " TAG SEG TAG SEG IMPEDANCE " "LENGTH " " ----- END ONE ----- " "----- END TWO ----- TYPE\n" " No: No: No: No: OHMS " "METERS REAL IMAGINARY " "REAL IMAGINARY" ); } else if (itmp1 == 1) { m_output.endl(); m_output.nec_printf( " -- FROM - --- TO -- " "--------" " ADMITTANCE MATRIX ELEMENTS (MHOS) " "---------\n" " TAG SEG TAG SEG " "----- (ONE,ONE) ------ " " ----- (ONE,TWO) ----- " "----- (TWO,TWO) -------\n" " No: No: No: No: REAL " "IMAGINARY " " REAL IMAGINARY REAL " "IMAGINARY" ); } for (int j = 0; j < network_count; j++) { itmp2= ntyp[j]; if ( (itmp2/itmp1) != 1 ) itmp3 = itmp2; else { int idx4, idx5; itmp4= iseg1[j]; itmp5= iseg2[j]; idx4 = itmp4-1; idx5 = itmp5-1; #if 0 This code has moved to calculate_network_data() if ( (itmp2 >= 2) && (x11i[j] <= 0.0) ) { nec_float xx = m_geometry->x[idx5]- m_geometry->x[idx4]; nec_float yy = m_geometry->y[idx5]- m_geometry->y[idx4]; nec_float zz = m_geometry->z[idx5]- m_geometry->z[idx4]; // set the length of the transmission line to be the // straight line distance. x11i[j]= wavelength*sqrt(xx*xx+yy*yy+zz*zz); } #endif m_output.endl(); m_output.nec_printf( " %4d %5d %4d %5d " "%11.4E %11.4E %11.4E %11.4E " "%11.4E %11.4E %s", m_geometry->segment_tags[idx4], itmp4, m_geometry->segment_tags[idx5], itmp5, x11r[j], x11i[j], x12r[j], x12i[j], x22r[j], x22i[j], pnet[itmp2-1] ); } /* if (( itmp2/ itmp1) == 1) */ } /* for( j = 0; j < network_count; j++) */ if ( itmp3 == 0) break; itmp1= itmp3; } /* for( j = 0; j < network_count; j++) */ } /* if ( (network_count != 0) && (inc <= 1) ) */ } /* print_network_data */ void nec_context::print_norm_rx_pattern(int iptflg, int nthi, int nphi, nec_float thetis, nec_float phiss) { if ((iptflg != 2)&&(iptflg != 3)) return; // do not print { // Call the new nec_results class that handles // a normalized receiving pattern. nec_float theta_step = xpr4; nec_float phi_step = xpr5; nec_float eta = xpr3; nec_float axial_ratio = xpr6; string pol_type( hpol[m_excitation_type-1]); int segment_number = isave; nec_norm_rx_pattern* rx_pattern = new nec_norm_rx_pattern(nthi, nphi, fnorm, thetis, theta_step, phiss, phi_step, eta, axial_ratio, segment_number, pol_type); rx_pattern->set_frequency(freq_mhz/(1.e-6)); m_results.add(rx_pattern); // write the restuls to our output. std::stringstream ss; rx_pattern->write_to_file(ss); m_output.line(ss.str().c_str()); } #if 0 nec_float phi = phiss; int itmp1 = nthi * nphi; nec_float norm_factor = fnorm[0]; for(int j = 1; j < itmp1; j++ ) if ( fnorm[j] > norm_factor) norm_factor = fnorm[j]; m_output.endl(3); m_output.nec_printf( " " "---- NORMALIZED RECEIVING PATTERN ----\n" " " "NORMALIZATION FACTOR: %11.4E\n" " " "ETA: %7.2f DEGREES\n" " " "TYPE: %s\n" " AXIAL RATIO: %6.3f\n" " SEGMENT No: %d\n\n" " " "THETA PHI ---- PATTERN ----\n" " " "(DEG) (DEG) DB MAGNITUDE", norm_factor, xpr3, hpol[m_excitation_type-1], xpr6, isave ); for(int j = 0; j < nphi; j++ ) { int itmp2 = nthi*j; for(int i = 0; i < nthi; i++ ) { int itmp3 = i + itmp2; if ( itmp3 < itmp1) { nec_float _tmp2 = fnorm[itmp3] / norm_factor; nec_float _tmp3 = db20( _tmp2); m_output.endl(); m_output.nec_printf(" %7.2f %7.2f %7.2f %11.4E", xpr1, phi, _tmp3, _tmp2 ); xpr1 += xpr4; } } /* for( i = 0; i < nthi; i++ ) */ xpr1= thetis; phi += xpr5; } /* for( j = 0; j < nphi; j++ ) */ #endif } void nec_context::print_power_budget(void) { if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) { nec_float radiated_power = input_power- network_power_loss - structure_power_loss; nec_float efficiency = 100.0 * radiated_power/input_power; m_output.endl(3); m_output.nec_printf( " " "---------- POWER BUDGET ---------\n" " " "INPUT POWER = %11.4E Watts\n" " " "RADIATED POWER= %11.4E Watts\n" " " "STRUCTURE LOSS= %11.4E Watts\n" " " "NETWORK LOSS = %11.4E Watts\n" " " "EFFICIENCY = %7.2f Percent", input_power, radiated_power, structure_power_loss, network_power_loss, efficiency ); } /* if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) */ } void nec_context::print_input_impedance(int iped, int ifrq, int nfrq, nec_float delfrq) { nec_float tmp1, tmp2, tmp3, tmp4, tmp5; int i, itmp1, itmp2; if ( iped != 0) { int iss; if ( nvqd > 0) iss = ivqd[nvqd-1]; else iss = source_segment_array[voltage_source_count-1]; m_output.endl(3); m_output.nec_printf( " " " -------- INPUT IMPEDANCE DATA --------\n" " " " SOURCE SEGMENT No: %d\n" " " " NORMALIZATION FACTOR:%12.5E\n\n" " ----------- UNNORMALIZED IMPEDANCE ---------- " " ------------ NORMALIZED IMPEDANCE -----------\n" " FREQ RESISTANCE REACTANCE MAGNITUDE PHASE " " RESISTANCE REACTANCE MAGNITUDE PHASE\n" " MHz OHMS OHMS OHMS DEGREES " " OHMS OHMS OHMS DEGREES", iss, impedance_norm_factor ); itmp1= nfrq; if ( 0 == ifrq ) tmp1= freq_mhz-( nfrq-1)* delfrq; else tmp1= freq_mhz/( pow(delfrq, (nfrq-1)) ); for( i = 0; i < itmp1; i++ ) { itmp2= 4*i; tmp2= fnorm[itmp2 ]/ impedance_norm_factor; tmp3= fnorm[itmp2+1]/ impedance_norm_factor; tmp4= fnorm[itmp2+2]/ impedance_norm_factor; tmp5= fnorm[itmp2+3]; m_output.endl(); m_output.nec_printf( " %9.3f %11.4E %11.4E %11.4E %7.2f " " %11.4E %11.4E %11.4E %7.2f", tmp1, fnorm[itmp2], fnorm[itmp2+1], fnorm[itmp2+2], fnorm[itmp2+3], tmp2, tmp3, tmp4, tmp5 ); if ( ifrq == 0) tmp1 += delfrq; else tmp1 *= delfrq; } /* for( i = 0; i < itmp1; i++ ) */ m_output.end_section(); } /* if ( iped != 0) */ } void nec_context::structure_segment_loading() { nec_float tim1, tim, tim2; m_output.end_section(); m_output.line(" ------ STRUCTURE IMPEDANCE LOADING ------" ); if ( nload != 0) load(); if ( nload == 0 ) { m_output.line(" THIS STRUCTURE IS NOT LOADED" ); } antenna_env(); /* fill and factor primary interaction matrix */ secnds( &tim1 ); cmset( neq, cm, rkh ); secnds( &tim2 ); tim= tim2- tim1; factrs(m_output, npeq, neq, cm, ip ); secnds( &tim1 ); tim2= tim1- tim2; m_output.end_section(); m_output.line(" ---------- MATRIX TIMING ----------"); m_output.string(" FILL= "); m_output.integer(int(tim)); m_output.string(" msec FACTOR: "); m_output.integer(int(tim2)); m_output.string(" msec"); } void nec_context::setup_excitation(int iptflg) { nec_float tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; tmp1=tmp2=tmp3=tmp4=tmp5=tmp6=0.0; if ( (m_excitation_type != 0) && (m_excitation_type != 5) ) { if ( (iptflg <= 0) || (m_excitation_type == 4) ) { m_output.endl(3); m_output.line(" ---------- EXCITATION ----------" ); } tmp5= degrees_to_rad(xpr5); tmp4= degrees_to_rad(xpr4); if ( m_excitation_type == 4) { tmp1= xpr1/ wavelength; tmp2= xpr2/ wavelength; tmp3= xpr3/ wavelength; tmp6= xpr6/( wavelength* wavelength); m_output.endl(); m_output.line( " CURRENT SOURCE"); m_output.line( " -- POSITION (METERS) -- ORIENTATION (DEG)"); m_output.line( " X Y Z ALPHA BETA DIPOLE MOMENT"); m_output.nec_printf(" %10.5f %10.5f %10.5f %7.2f %7.2f %8.3f", xpr1, xpr2, xpr3, xpr4, xpr5, xpr6 ); } else { tmp1= degrees_to_rad(xpr1); tmp2= degrees_to_rad(xpr2); tmp3= degrees_to_rad(xpr3); tmp6= xpr6; if ( iptflg <= 0) { m_output.endl(); m_output.nec_printf( "PLANE WAVE - THETA: %7.2f deg, PHI: %7.2f deg," " ETA=%7.2f DEG, TYPE - %s AXIAL RATIO: %6.3f", xpr1, xpr2, xpr3, hpol[m_excitation_type-1], xpr6 ); } } /* if ( m_excitation_type == 4) */ } nec_float incident_amplitude = 1.0; // the incident electric field amplitude... if (xpr7 != 0.0) incident_amplitude = xpr7; /* Fill E-field right-hand matrix */ etmns( tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, incident_amplitude, m_excitation_type, current_vector); } enum excitation_return nec_context::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) { int itmp1; do { if (in_freq_loop_state < 4) { setup_excitation(iptflg); /* matrix solving (netwk calls solves) */ calculate_network_data(); print_network_data(); if ( (inc > 1) && (iptflg > 0) ) nprint=1; // c_network::net_solve( cm, &cm[ib11], &cm[ic11], &cm[id11], ip, current_vector ); netwk( cm, ip, current_vector ); ntsol=1; if ( iped != 0) { itmp1= 4*( mhz-1); fnorm[itmp1 ] = real( zped); fnorm[itmp1+1] = imag( zped); fnorm[itmp1+2] = abs( zped); fnorm[itmp1+3] = arg_degrees( zped); if ( iped != 2 ) { if ( fnorm[itmp1+2] > impedance_norm_factor) impedance_norm_factor = fnorm[itmp1+2]; } } /* if ( iped != 0) */ /* printing structure currents */ /* The printing of currents is now managed by a dedicated nec_base_result : nec_structure_currents*/ /* Check that the flag for currents and charge densities don't have unexpected values */ if((iptflg <-2)||(iptflg > 3)) { printf("%s", "Warning : The print control flag for currents was uncorrect ; it has been set to -1 (no printing for currents).\n"); iptflg = -1; } if((iptflq <-2)||(iptflq > 0)) { printf("%s", "Warning : The print control flag for charge densities was uncorrect ; it has been set to -1 (no printing for charge densities).\n"); iptflq = -1; } /* Check for compatibility between the excitation type and the output format for currents */ if(m_excitation_type != 1 && m_excitation_type != 2 && m_excitation_type != 3) { if (iptflg == 2 || iptflg == 3) { printf("%s", "Warning : The output format chosen for currents was incompatible with the excitation type. No currents has been printed.\n"); iptflg = -1; } } /* Now proceed with the printing of currents */ if (iptflg != -1 || iptflq != -1) { if((iptflg < 1 || iptflg == 3 || ((iptflg == 1 || iptflg == 2) && inc <= 1)) || (iptflg == -1 && iptflq != -1)) { structure_currents = new nec_structure_currents(this, hpol[m_excitation_type-1], nload, xpr3, xpr6); if(iptflg != 3) { structure_currents->set_frequency(freq_mhz/(1.e-6)); m_results.add(structure_currents); } } structure_currents->analyze(); if(iptflg != 3) { std::stringstream ss; structure_currents->write_to_file(ss); m_output.string(ss.str().c_str(), false); } } /* if (iptflg != -1 || iptflq != -1) */ /*print_structure_currents(...) is no more used*/ /*print_structure_currents(hpol[m_excitation_type-1], iptflg, iptflq, iptag, iptagf, iptagt, iptaq, iptaqf, iptaqt);*/ print_power_budget(); processing_state = 4; if ( ncoup > 0) couple( current_vector, wavelength ); if ( iflow == 7) { if ( (m_excitation_type > 0) && (m_excitation_type < 4) ) { nthic++; inc++; xpr1 += xpr4; if ( nthic <= nthi ) continue; /* continue excitation loop */ nthic=1; xpr1= thetis; xpr2= xpr2+ xpr5; nphic++; if ( nphic <= nphi ) continue; /* continue excitation loop */ return FREQ_PRINT_NORMALIZATION; } /* if ( (m_excitation_type >= 1) && (m_excitation_type <= 3) ) */ if ( nfrq != 1) { return FREQ_LOOP_CONTINUE; /* continue the freq loop */ } m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } /*if ( iflow == 7) */ } if (in_freq_loop_state < 5) processing_state = 5; /* near field calculation */ if (in_freq_loop_state < 6) { if ( m_near != -1) { if((nrx*nry*nrz) != 0) nfpat(); if ( mhz == nfrq) m_near=-1; if ( nfrq == 1) { m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } } /* if ( near != -1) */ } /* Standard far-field calculation */ if ( ifar != -1) { nec_radiation_pattern* rad_pat = new nec_radiation_pattern(nth, nph, thets, phis, dth, dph, rfld, ground, ifar, wavelength, input_power, network_power_loss, m_rp_output_format, m_rp_normalization, ipd, iavp, gnor, plot_card); rad_pat->analyze(this); /* Here we write the largest gain to the standard output if the user has specified this on the command line. */ if (m_output_flags.get_gain_flag()) { rad_pat->write_gain_normalization(); delete rad_pat; } else { rad_pat->set_frequency(freq_mhz/(1.e-6)); m_results.add(rad_pat); // write the results to the ordinary NEC output file. std::stringstream ss; rad_pat->write_to_file(ss); m_output.line(ss.str().c_str()); // print_radiation_pattern(input_power, network_power_loss); } } if ( (m_excitation_type == 0) || (m_excitation_type >= 4) ) { if ( mhz == nfrq ) ifar=-1; if ( nfrq != 1) { return FREQ_LOOP_CONTINUE; /* continue the freq loop */ } m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } nthic++; inc++; xpr1 += xpr4; if ( nthic <= nthi ) continue; /* continue excitation loop */ nthic = 1; xpr1 = thetis; xpr2 += xpr5; nphic++; if ( nphic > nphi ) return FREQ_PRINT_NORMALIZATION; } while( true ); } /* excitation_loop */ /* load calculates the impedance of specified */ /* segments for various types of loading */ void nec_context::load() { int istep, istepx, l1, l2, ldtags, ichk; bool iwarn = false; nec_complex zt, tpcj; int n = m_geometry->n; int np = m_geometry->np; tpcj = nec_complex(0.0,1.883698955e+9); m_output.endl(); m_output.line(" LOCATION RESISTANCE INDUCTANCE CAPACITANCE IMPEDANCE (OHMS) CONDUCTIVITY CIRCUIT"); m_output.line(" ITAG FROM THRU OHMS HENRYS FARADS REAL IMAGINARY MHOS/METER TYPE"); /* Initialize impedance array, used for temporary */ /* storage of loading information. */ zarray.resize(n); zarray.fill(cplx_00()); istep = 0; /* Surely This should be rewritten as... for (int istepx=0; istepx 5 ) { m_output.nec_printf( "\n IMPROPER LOAD TYPE CHOSEN," " REQUESTED TYPE IS %d", ldtyp[istepx] ); stop(-1); } ... rest of code here } // done with loads. if ( iwarn == true ) m_output.nec_printf( "\n NOTE, SOME OF THE ABOVE SEGMENTS " "HAVE BEEN LOADED TWICE - IMPEDANCES ADDED" ); if ( nop != 1) { for( i = 0; i < np; i++ ) { zt= zarray[i]; l1= i; for( l2 = 1; l2 < nop; l2++ ) { l1 += np; zarray[l1]= zt; } } } */ /* cycle over loading cards */ while( true ) { istepx = istep; istep++; if ( istep > nload) { if ( iwarn == true ) m_output.line("NOTE, SOME OF THE ABOVE SEGMENTS HAVE BEEN LOADED TWICE - IMPEDANCES ADDED" ); if ( nop == 1) return; for(int i = 0; i < np; i++ ) { zt= zarray[i]; l1= i; for( l2 = 1; l2 < nop; l2++ ) { l1 += np; zarray[l1]= zt; } } return; } /* if ( istep > nload) */ if ( ldtyp[istepx] > 5 ) { nec_stop("IMPROPER LOAD TYPE CHOSEN," " REQUESTED TYPE IS %d", ldtyp[istepx] ); } /* search segments for proper itags */ ldtags = ldtag[istepx]; int jump = ldtyp[istepx]+1; ichk=0; l1= 1; l2= n; if ( ldtags == 0) { if ( (ldtagf[istepx] != 0) || (ldtagt[istepx] != 0) ) { l1= ldtagf[istepx]; l2= ldtagt[istepx]; } } for(int i = l1-1; i < l2; i++ ) { if ( ldtags != 0) { if ( ldtags != m_geometry->segment_tags[i]) continue; if ( ldtagf[istepx] != 0) { ichk++; if ( (ichk < ldtagf[istepx]) || (ichk > ldtagt[istepx]) ) continue; } else ichk=1; } /* if ( ldtags != 0) */ else ichk=1; ASSERT(0.0 != m_geometry->segment_length[i]); ASSERT(0.0 != m_geometry->segment_radius[i]); /* Calculation of lamda*imped. per unit length, jump to appropriate section for loading type */ switch( jump ) { case 1: zt= zlr[istepx]/ m_geometry->segment_length[i]+ tpcj* zli[istepx]/( m_geometry->segment_length[i]*wavelength); if ( fabs( zlc[istepx]) > 1.0e-20) zt += wavelength/( tpcj* m_geometry->segment_length[i]* zlc[istepx]); break; case 2: zt= tpcj* m_geometry->segment_length[i]* zlc[istepx]/ wavelength; if ( fabs( zli[istepx]) > 1.0e-20) zt += m_geometry->segment_length[i]* wavelength/( tpcj* zli[istepx]); if ( fabs( zlr[istepx]) > 1.0e-20) zt += m_geometry->segment_length[i]/ zlr[istepx]; zt=1./ zt; break; case 3: zt= zlr[istepx]* wavelength+ tpcj* zli[istepx]; if ( fabs( zlc[istepx]) > 1.0e-20) zt += 1./( tpcj* m_geometry->segment_length[i]* m_geometry->segment_length[i]* zlc[istepx]); break; case 4: zt= tpcj* m_geometry->segment_length[i]* m_geometry->segment_length[i]* zlc[istepx]; if ( fabs( zli[istepx]) > 1.0e-20) zt += 1./( tpcj* zli[istepx]); if ( fabs( zlr[istepx]) > 1.0e-20) zt += 1./( zlr[istepx]* wavelength); zt=1./ zt; break; case 5: zt= nec_complex( zlr[istepx], zli[istepx])/ m_geometry->segment_length[i]; break; case 6: { zt= zint( zlr[istepx]* wavelength, m_geometry->segment_radius[i]); } } /* switch( jump ) */ if (( fabs( real( zarray[i]))+ fabs( imag( zarray[i]))) > 1.0e-20) iwarn=true; zarray[i] += zt; } /* for( i = l1-1; i < l2; i++ ) */ if ( ichk == 0 ) { nec_exception* nex = new nec_exception("LOADING DATA CARD ERROR, NO SEGMENT HAS AN ITAG = "); nex->append(ldtags); throw nex; } /* printing the segment loading data, jump to proper print */ switch( jump ) { case 1: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.," SERIES "); break; case 2: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL"); break; case 3: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0., "SERIES (PER METER)"); break; case 4: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL (PER METER)"); break; case 5: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx],0.,0.,0., zlr[istepx], zli[istepx],0.,"FIXED IMPEDANCE "); break; case 6: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], 0.,0.,0.,0.,0., zlr[istepx]," WIRE "); } /* switch( jump ) */ } /* while( true ) */ } /* cmset sets up the complex structure matrix in the array in_cm */ void nec_context::cmset( int nrow, complex_array& in_cm, nec_float rkhx) { int mp2, iout, it, j, i1, i2, in2; int im1, im2, ist, ij, jss, jm1, jm2, jst, k, kk; complex_array scm; int np = m_geometry->np; int mp = m_geometry->mp; mp2 = 2 * mp; // = np + mp2; // neq= m_geometry->n_plus_2m; // n + 2* m; rkh= rkhx; iout=2* npblk* nrow; it= nlast; in_cm.fill(0,it*nrow,cplx_00()); i1= 1; i2= it; in2= i2; if ( in2 > np) in2= np; im1= i1- np; im2= i2- np; if ( im1 < 1) im1=1; ist=1; if ( i1 <= np) ist= np- i1+2; /* wire source loop */ int n = m_geometry->n; for( j = 1; j <= n; j++ ) { m_geometry->trio(j); for (int i = 0; i < m_geometry->jsno; i++ ) { ij = m_geometry->jco[i]; m_geometry->jco[i] = ((ij-1)/ np)* mp2+ij; } if ( i1 <= in2) cmww( j, i1, in2, in_cm, nrow, in_cm, nrow,1); if ( im1 <= im2) { complex_array temp = in_cm.sub_array((ist-1)*nrow); cmws( j, im1, im2, temp, nrow, in_cm, 1); } /* matrix elements modified by loading */ if ( nload == 0) continue; if ( j > np) continue; int ipr = j; if ( (ipr < 1) || (ipr > it) ) continue; nec_complex zaj= zarray[j-1]; for (int i = 0; i < m_geometry->jsno; i++ ) { jss = m_geometry->jco[i]; in_cm[(jss-1)+(ipr-1)*nrow] -= ( m_geometry->ax[i]+ m_geometry->cx[i])* zaj; } } /* for( j = 1; j <= n; j++ ) */ int m = m_geometry->m; if ( m != 0) { /* matrix elements for patch current sources */ jm1=1- mp; jm2=0; jst=1- mp2; for (int i = 0; i < nop; i++ ) { jm1 += mp; jm2 += mp; jst += npeq; if ( i1 <= in2) { complex_array temp = in_cm.sub_array((jst-1)); cmsw( jm1, jm2, i1, in2, temp, in_cm, 0, nrow, 1); } if ( im1 <= im2) { complex_array temp = in_cm.sub_array((jst-1)+(ist-1)*nrow); compute_matrix_ss( jm1, jm2, im1, im2, temp, nrow, 1); } } } /* if ( m != 0) */ if ( icase == 1) return; /* Allocate to scratch memory */ scm.resize(m_geometry->n_plus_2m); /* combine elements for symmetry modes */ for (int i = 0; i < it; i++ ) { int row_offset = i*nrow; for( j = 0; j < npeq; j++ ) { for( k = 0; k < nop; k++ ) { int ka = j+ k*npeq; scm[k] = in_cm[row_offset + ka]; } in_cm[row_offset + j] = scm.sum(0,nop); for( k = 1; k < nop; k++ ) { int ka = j+ k*npeq; nec_complex deter = scm[0]; for( kk = 1; kk < nop; kk++ ) { deter += scm[kk] * symmetry_array[k+kk*nop]; } in_cm[row_offset + ka] = deter; } } } scm.resize(0); } /* compute_matrix_ss computes matrix elements for surface-surface interactions. */ void nec_context::compute_matrix_ss( int j1, int j2, int im1, int im2, complex_array& in_cm, int nrow, int itrp ) { int i1, i2, icomp, ii1, i, il, ii2, jj1, jl, jj2; nec_float t1xi, t1yi, t1zi, t2xi, t2yi, t2zi, xi, yi, zi; nec_complex g11, g12, g21, g22; i1=( im1+1)/2; i2=( im2+1)/2; icomp= i1*2-3; ii1=-2; if ( icomp+2 < im1) ii1=-3; /* loop over observation patches */ il = -1; for( i = i1; i <= i2; i++ ) { il++; icomp += 2; ii1 += 2; ii2 = ii1+1; t1xi= m_geometry->t1x[il]* m_geometry->psalp[il]; t1yi= m_geometry->t1y[il]* m_geometry->psalp[il]; t1zi= m_geometry->t1z[il]* m_geometry->psalp[il]; t2xi= m_geometry->t2x[il]* m_geometry->psalp[il]; t2yi= m_geometry->t2y[il]* m_geometry->psalp[il]; t2zi= m_geometry->t2z[il]* m_geometry->psalp[il]; xi= m_geometry->px[il]; yi= m_geometry->py[il]; zi= m_geometry->pz[il]; /* loop over source patches */ jj1=-2; for(int j = j1; j <= j2; j++ ) { jl=j-1; jj1 += 2; jj2 = jj1+1; m_s= m_geometry->pbi[jl]; xj= m_geometry->px[jl]; yj= m_geometry->py[jl]; zj= m_geometry->pz[jl]; t1xj= m_geometry->t1x[jl]; t1yj= m_geometry->t1y[jl]; t1zj= m_geometry->t1z[jl]; t2xj= m_geometry->t2x[jl]; t2yj= m_geometry->t2y[jl]; t2zj= m_geometry->t2z[jl]; hintg( xi, yi, zi); g11=-( t2xi* exk+ t2yi* eyk+ t2zi* ezk); g12=-( t2xi* exs+ t2yi* eys+ t2zi* ezs); g21=-( t1xi* exk+ t1yi* eyk+ t1zi* ezk); g22=-( t1xi* exs+ t1yi* eys+ t1zi* ezs); if ( i == j ) { g11 -= .5; g22 += .5; } /* normal fill */ if ( itrp == 0) { if ( icomp >= im1 ) { in_cm[ii1+jj1*nrow]= g11; in_cm[ii1+jj2*nrow]= g12; } if ( icomp >= im2 ) continue; in_cm[ii2+jj1*nrow]= g21; in_cm[ii2+jj2*nrow]= g22; continue; } /* if ( itrp == 0) */ /* transposed fill */ if ( icomp >= im1 ) { in_cm[jj1+ii1*nrow]= g11; in_cm[jj2+ii1*nrow]= g12; } if ( icomp >= im2 ) continue; in_cm[jj1+ii2*nrow]= g21; in_cm[jj2+ii2*nrow]= g22; } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1; i <= i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* computes matrix elements for e along wires due to patch current */ void nec_context::cmsw( int j1, int j2, int i1, int i2, complex_array& in_cm, complex_array& cw, int ncw, int nrow, int itrp ) { int neqs, k, icgo, i, ipch, jl, j, js, il; int jsnox; /* -1 offset to "m_geometry->jsno" for array indexing */ nec_float xi, yi, zi, cabi, sabi, salpi, fsign=1., pyl, pxl; complex_array emel; emel.resize(9); neqs= m_geometry->n_plus_2m; jsnox = m_geometry->jsno-1; if ( itrp >= 0) { k=-1; icgo=0; /* observation loop */ for( i = i1-1; i < i2; i++ ) { k++; xi= m_geometry->x[i]; yi= m_geometry->y[i]; zi= m_geometry->z[i]; cabi= m_geometry->cab[i]; sabi= m_geometry->sab[i]; salpi= m_geometry->salp[i]; ipch=0; if ( m_geometry->icon1[i] >= PCHCON) { ipch= m_geometry->icon1[i]-PCHCON; fsign=-1.; } if ( m_geometry->icon2[i] >= PCHCON) { ipch= m_geometry->icon2[i]-PCHCON; fsign=1.; } /* source loop */ jl = -1; for( j = j1; j <= j2; j++ ) { jl += 2; js = j-1; t1xj= m_geometry->t1x[js]; t1yj= m_geometry->t1y[js]; t1zj= m_geometry->t1z[js]; t2xj= m_geometry->t2x[js]; t2yj= m_geometry->t2y[js]; t2zj= m_geometry->t2z[js]; xj= m_geometry->px[js]; yj= m_geometry->py[js]; zj= m_geometry->pz[js]; m_s = m_geometry->pbi[js]; /* ground loop */ #warning weird problem to test here. replaced loop variable called ip for (int ipgnd = 1; ipgnd <= ground.ksymp; ipgnd++ ) { if ( ((ipch == j) || (icgo != 0)) && (ipgnd != 2) ) { if ( icgo <= 0 ) { ASSERT(ipgnd != 2); pcint( xi, yi, zi, cabi, sabi, salpi, emel); pyl= pi()* m_geometry->segment_length[i]* fsign; pxl= sin( pyl); pyl= cos( pyl); exc= emel[8]* fsign; m_geometry->trio(i+1); il= i-ncw; if ( i < m_geometry->np) il += (il/m_geometry->np)*2*m_geometry->mp; if ( itrp == 0 ) cw[k+il*nrow] += exc*( m_geometry->ax[jsnox]+ m_geometry->bx[jsnox]* pxl+ m_geometry->cx[jsnox]* pyl); else cw[il+k*nrow] += exc*( m_geometry->ax[jsnox]+ m_geometry->bx[jsnox]* pxl+ m_geometry->cx[jsnox]* pyl); } /* if ( icgo <= 0 ) */ if ( itrp == 0) { in_cm[k+(jl-1)*nrow]= emel[icgo]; in_cm[k+jl*nrow] = emel[icgo+4]; } else { in_cm[(jl-1)+k*nrow]= emel[icgo]; in_cm[jl+k*nrow] = emel[icgo+4]; } icgo++; if ( icgo == 4) icgo=0; continue; } /* if ( ((ipch == (j+1)) || (icgo != 0)) && (ipgnd != 2) ) */ unere( xi, yi, zi, ipgnd == 2); /* normal fill */ if ( itrp == 0) { in_cm[k+(jl-1)*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; in_cm[k+jl*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; continue; } /* transposed fill */ in_cm[(jl-1)+k*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; in_cm[jl+k*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; } /* for( ipgnd = 1; ipgnd <= ground.ksymp; ipgnd++ ) */ } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ } /* if ( itrp >= 0) */ } /*-----------------------------------------------------------------------*/ /* cmws computes matrix elements for wire-surface interactions */ void nec_context::cmws( int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int itrp ) { int ipr, ipatch, ik, js=0, jx; nec_float xi, yi, zi, tx, ty, tz; nec_complex etk, ets, etc; j--; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; /* observation loop */ ipr= -1; for(int i = i1; i <= i2; i++ ) { ipr++; ipatch=(i+1)/2; ik= i-( i/2)*2; if ( (ik != 0) || (ipr == 0) ) { js= ipatch-1; xi= m_geometry->px[js]; yi= m_geometry->py[js]; zi= m_geometry->pz[js]; hsfld( xi, yi, zi,0.); if ( ik != 0 ) { tx= m_geometry->t2x[js]; ty= m_geometry->t2y[js]; tz= m_geometry->t2z[js]; } else { tx= m_geometry->t1x[js]; ty= m_geometry->t1y[js]; tz= m_geometry->t1z[js]; } } /* if ( (ik != 0) || (ipr == 0) ) */ else { tx= m_geometry->t1x[js]; ty= m_geometry->t1y[js]; tz= m_geometry->t1z[js]; } /* if ( (ik != 0) || (ipr == 0) ) */ etk=-( exk* tx+ eyk* ty+ ezk* tz)* m_geometry->psalp[js]; ets=-( exs* tx+ eys* ty+ ezs* tz)* m_geometry->psalp[js]; etc=-( exc* tx+ eyc* ty+ ezc* tz)* m_geometry->psalp[js]; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if ( itrp == 0) { for(int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[ipr+jx*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* if ( itrp == 0) */ /* transposed fill */ if ( itrp != 2) { for(int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* if ( itrp != 2) */ /* transposed fill - c(ws) and d(ws)prime (=cw) */ for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; if ( jx < nr) in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; else { jx -= nr; cw[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } } /* for( ij = 0; ij < m_geometry->jsno; ij++ ) */ } /* for( i = i1; i <= i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* cmww computes matrix elements for wire-wire interactions */ void nec_context::cmww( int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int nw, int itrp) { int ipr, iprx, i, jx; nec_float xi, yi, zi, ai, cabi, sabi, salpi; nec_complex etk, ets, etc; /* set source segment parameters */ jx = j; j--; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; /* Decide whether ext. t.w. approx. can be used */ if ( m_use_exk == true) { ipr = m_geometry->icon1[j]; if ( ipr < 0 ) { ipr= -ipr; iprx= ipr-1; if ( -m_geometry->icon1[iprx] != jx ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,iprx); #ifdef NEC_ERROR_CHECK int ind_test; xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.0) > 1.e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); #endif } /* if ( -m_geometry->icon1[iprx] != jx ) */ } /* if ( ipr < 0 ) */ else { iprx = ipr-1; if ( ipr == 0 ) ind1=1; else { if ( ipr != jx ) { if ( m_geometry->icon2[iprx] != jx ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,iprx); #ifdef NEC_ERROR_CHECK int ind_test; xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.0) > 1.e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); #endif } /* if ( m_geometry->icon2[iprx] != jx ) */ } /* if ( ipr != jx ) */ else if ( cabj* cabj+ sabj* sabj > 1.e-8) ind1=2; else ind1=0; } /* if ( ipr == 0 ) */ } /* if ( ipr < 0 ) */ ipr = m_geometry->icon2[j]; if ( ipr < 0 ) { ipr= -ipr; iprx = ipr-1; if ( -m_geometry->icon2[iprx] != jx ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,iprx); #ifdef NEC_ERROR_CHECK int ind_test; xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.0) > 1.e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind2); #endif } /* if ( -m_geometry->icon1[iprx] != jx ) */ } /* if ( ipr < 0 ) */ else { iprx = ipr-1; if ( ipr == 0 ) ind2=1; else { if ( ipr != jx ) { if ( m_geometry->icon1[iprx] != jx ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,iprx); #ifdef NEC_ERROR_CHECK int ind_test; xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.0) > 1.e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind2); #endif } /* if ( m_geometry->icon2[iprx] != jx ) */ } /* if ( ipr != jx ) */ else if ( cabj* cabj+ sabj* sabj > 1.e-8) ind2=2; else ind2=0; } /* if ( ipr == 0 ) */ } /* if ( ipr < 0 ) */ } /* if ( m_use_exk == true) */ /* observation loop */ ipr=-1; for( i = i1-1; i < i2; i++ ) { ipr++; xi= m_geometry->x[i]; yi= m_geometry->y[i]; zi= m_geometry->z[i]; ai= m_geometry->segment_radius[i]; cabi= m_geometry->cab[i]; sabi= m_geometry->sab[i]; salpi= m_geometry->salp[i]; efld( xi, yi, zi, ai, i != j); etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if ( itrp == 0) { for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx = m_geometry->jco[ij]-1; in_cm[ipr+jx*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* transposed fill */ if ( itrp != 2) { for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* trans. fill for c(ww) - test for elements for d(ww)prime. (=cw) */ for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; if ( jx < nr) in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; else { jx -= nr; cw[jx*ipr*nw] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } } /* for( ij = 0; ij < m_geometry->jsno; ij++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* couple computes the maximum coupling between pairs of segments. */ void nec_context::couple( complex_array& in_currents, nec_float in_wavelength ) { int j1, j2, l1, itt1, itt2, its1, its2, isg1, isg2, npm1; nec_float dbc, c, gmax; nec_complex y11, y12, y22, yl, yin, zl, zin, rho; if ( (voltage_source_count != 1) || (nvqd != 0) ) return; int seg_num = m_geometry->get_segment_number( nctag[icoup], ncseg[icoup]); if ( seg_num != source_segment_array[0] ) return; zin= source_voltage_array[0]; icoup++; y11a.resize(icoup); y11a[icoup-1]= in_currents[seg_num-1]*in_wavelength/zin; l1=(icoup-1)*(ncoup-1); for (int i = 0; i < ncoup; i++ ) { if ( (i+1) == icoup) continue; l1++; y12a.resize(l1); int k = m_geometry->get_segment_number( nctag[i], ncseg[i]); y12a[l1-1]= in_currents[k-1]* in_wavelength/ zin; } if ( icoup < ncoup) return; m_output.endl(3); m_output.nec_printf( " -----------" " ISOLATION DATA -----------\n\n" " ------- COUPLING BETWEEN ------ MAXIMUM " " ---------- FOR MAXIMUM COUPLING ----------\n" " SEG SEG COUPLING LOAD" " IMPEDANCE (2ND SEG) INPUT IMPEDANCE \n" " TAG SEG No: TAG SEG No: (DB) " " REAL IMAGINARY REAL IMAGINARY" ); npm1= ncoup-1; for (int i = 0; i < npm1; i++ ) { itt1= nctag[i]; its1= ncseg[i]; isg1= m_geometry->get_segment_number( itt1, its1); l1= i+1; for (int j = l1; j < ncoup; j++ ) { itt2= nctag[j]; its2= ncseg[j]; isg2= m_geometry->get_segment_number( itt2, its2); j1= j+ i* npm1-1; j2= i+ j* npm1; y11= y11a[i]; y22= y11a[j]; y12=.5*( y12a[j1]+ y12a[j2]); yin= y12* y12; dbc= abs( yin); c= dbc/(2.* real( y11)* real( y22)- real( yin)); if ( (c >= 0.0) && (c <= 1.0) ) { if ( c >= .01 ) gmax=(1.- sqrt(1.- c*c))/c; else gmax=.5*( c+.25* c* c* c); rho= gmax* conj( yin)/ dbc; yl=((1.- rho)/(1.+ rho)+1.)* real( y22)- y22; zl=1./ yl; yin= y11- yin/( y22+ yl); zin=1./ yin; dbc= db10( gmax); m_output.endl(); m_output.nec_printf( " %4d %4d %5d %4d %4d %5d %9.3f" " %12.5E %12.5E %12.5E %12.5E", itt1, its1, isg1, itt2, its2, isg2, dbc, real(zl), imag(zl), real(zin), imag(zin) ); continue; } /* if ( (c >= 0.0) && (c <= 1.0) ) */ m_output.endl(); m_output.nec_printf( " %4d %4d %5d %4d %4d %5d **ERROR** " "COUPLING IS NOT BETWEEN 0 AND 1. (= %12.5E)", itt1, its1, isg1, itt2, its2, isg2, c ); } /* for( j = l1; j < ncoup; j++ ) */ } /* for( i = 0; i < npm1; i++ ) */ } /*! \brief Compute near E-fields of a segment due to constant sine and cosine currents distributions. The ground effect is included. \param xi,yi,zi x,y,z components of the field evaluation point. \param ai Radius of the segment on which the field is evaluated. \param on_source_segment Flag to indicate if the field evaluation point is not on the source segment (i != j) */ void nec_context::efld( nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool not_on_source_segment) { #define txk egnd[0] #define tyk egnd[1] #define tzk egnd[2] #define txs egnd[3] #define tys egnd[4] #define tzs egnd[5] #define txc egnd[6] #define tyc egnd[7] #define tzc egnd[8] nec_float salpr, zij, zp, rhox; nec_float rhoy, rhoz, rh, r, rmag, cth, px, py; nec_float xymag, xspec, yspec, rhospc, dmin, shaf; nec_complex epx, epy, refs, refps, zrsin, zratx, zscrn; nec_complex tezs, ters, tezc, terc, tezk, terk; complex_array egnd(9); nec_float xij = xi - xj; nec_float yij = yi - yj; bool ijx = not_on_source_segment; { // calculate the direct field. salpr= salpj; zij= zi- zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh = sqrt( rhox*rhox + rhoy*rhoy + rhoz*rhoz + ai*ai); if ( rh <= 1.e-10) { rhox=0.0; rhoy=0.0; rhoz=0.0; } else { rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; } /* lumped current element approx. for large separations */ r= sqrt( zp*zp + rh*rh); if ( r >= rkh) { rmag = two_pi() * r; cth = zp/ r; px = rh/ r; txk = nec_complex( cos( rmag),- sin( rmag)); py= two_pi() * r* r; tyk= ETA* cth* txk* nec_complex(1.0,-1.0/ rmag)/ py; tzk= ETA* px* txk* nec_complex(1.0, rmag-1.0/ rmag)/(2.* py); tezk= tyk* cth- tzk* px; terk= tyk* px+ tzk* cth; rmag= sin( pi()* m_s)/ pi(); tezc= tezk* rmag; terc= terk* rmag; tezk= tezk* m_s; terk= terk* m_s; txs=cplx_00(); tys=cplx_00(); tzs=cplx_00(); } /* if ( r >= rkh) */ if ( r < rkh) { /* eksc for thin wire approx. or ekscx for extended t.w. approx. */ if ( m_use_exk == false) eksc( m_s, zp, rh, two_pi(), ijx, &tezs, &ters, &tezc, &terc, &tezk, &terk ); else ekscx( m_b, m_s, zp, rh, two_pi(), ijx, ind1, ind2, &tezs, &ters, &tezc, &terc, &tezk, &terk); txs= tezs* cabj+ ters* rhox; tys= tezs* sabj+ ters* rhoy; tzs= tezs* salpr+ ters* rhoz; } txk= tezk* cabj+ terk* rhox; tyk= tezk* sabj+ terk* rhoy; tzk= tezk* salpr+ terk* rhoz; txc= tezc* cabj+ terc* rhox; tyc= tezc* sabj+ terc* rhoy; tzc= tezc* salpr+ terc* rhoz; exk= txk; eyk= tyk; ezk= tzk; exs= txs; eys= tys; ezs= tzs; exc= txc; eyc= tyc; ezc= tzc; } if (ground.present()) { // Now do the reflected field... ijx=1; salpr= -salpj; zij= zi + zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh = sqrt( rhox*rhox + rhoy*rhoy + rhoz*rhoz + ai*ai); if ( rh <= 1.e-10) { rhox=0.0; rhoy=0.0; rhoz=0.0; } else { rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; } /* lumped current element approx. for large separations */ r= sqrt( zp*zp + rh*rh); if ( r >= rkh) { rmag = two_pi() * r; cth = zp/ r; px = rh/ r; txk = nec_complex( cos( rmag),- sin( rmag)); py= two_pi() * r* r; tyk= ETA* cth* txk* nec_complex(1.0,-1.0/ rmag)/ py; tzk= ETA* px* txk* nec_complex(1.0, rmag-1.0/ rmag)/(2.* py); tezk= tyk* cth- tzk* px; terk= tyk* px+ tzk* cth; rmag= sin( pi()* m_s)/ pi(); tezc= tezk* rmag; terc= terk* rmag; tezk= tezk* m_s; terk= terk* m_s; txs=cplx_00(); tys=cplx_00(); tzs=cplx_00(); } /* if ( r >= rkh) */ if ( r < rkh) { /* eksc for thin wire approx. or ekscx for extended t.w. approx. */ if ( m_use_exk == false) eksc( m_s, zp, rh, two_pi(), ijx, &tezs, &ters, &tezc, &terc, &tezk, &terk ); else ekscx( m_b, m_s, zp, rh, two_pi(), ijx, ind1, ind2, &tezs, &ters, &tezc, &terc, &tezk, &terk); txs= tezs* cabj+ ters* rhox; tys= tezs* sabj+ ters* rhoy; tzs= tezs* salpr+ ters* rhoz; } txk= tezk* cabj+ terk* rhox; tyk= tezk* sabj+ terk* rhoy; tzk= tezk* salpr+ terk* rhoz; txc= tezc* cabj+ terc* rhox; tyc= tezc* sabj+ terc* rhoy; tzc= tezc* salpr+ terc* rhoz; ASSERT(ground.is_valid()); if (ground.type_finite_reflection()) { zratx= ground.zrati; rmag= r; xymag= sqrt( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if ( ground.radial_wire_count != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrt( xspec*xspec + yspec*yspec + ground.t2*ground.t2); if ( rhospc <= ground.scrwl) { zscrn= ground.m_t1* rhospc* log( rhospc/ ground.t2); zratx=( zscrn* ground.zrati)/( ETA* ground.zrati+ zscrn); } } /* if ( ground.radial_wire_count != 0) */ /* Calculation of reflection coefficients when ground is specified. */ if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; zrsin=cplx_10(); } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; zrsin= sqrt(1.0 - zratx*zratx*(1.0 - cth*cth) ); } /* if ( xymag <= 1.0e-6) */ refs=( cth- zratx* zrsin)/( cth+ zratx* zrsin); refps=-( zratx* cth- zrsin)/( zratx* cth+ zrsin); refps= refps- refs; epy= px* txk+ py* tyk; epx= px* epy; epy= py* epy; txk= refs* txk+ refps* epx; tyk= refs* tyk+ refps* epy; tzk= refs* tzk; epy= px* txs+ py* tys; epx= px* epy; epy= py* epy; txs= refs* txs+ refps* epx; tys= refs* tys+ refps* epy; tzs= refs* tzs; epy= px* txc+ py* tyc; epx= px* epy; epy= py* epy; txc= refs* txc+ refps* epx; tyc= refs* tyc+ refps* epy; tzc= refs* tzc; } /* if (ground.type_finite_reflection()) */ exk -= txk* ground.frati; eyk -= tyk* ground.frati; ezk -= tzk* ground.frati; exs -= txs* ground.frati; eys -= tys* ground.frati; ezs -= tzs* ground.frati; exc -= txc* ground.frati; eyc -= tyc* ground.frati; ezc -= tzc* ground.frati; } if (false == ground.type_sommerfeld_norton()) // (ground.iperf != 2) return; /* field due to ground using Sommerfeld/Norton */ sn = norm(cabj, sabj); if ( sn >= 1.0e-5) { xsn= cabj/ sn; ysn= sabj/ sn; } else { sn=0.0; xsn=1.0; ysn=0.0; } /* displace observation point for thin wire approximation */ zij= zi+ zj; salpr=- salpj; rhox= sabj* zij- salpr* yij; rhoy= salpr* xij- cabj* zij; rhoz= cabj* yij- sabj* xij; rh = norm(rhox, rhoy, rhoz); // rhox* rhox+ rhoy* rhoy+ rhoz* rhoz; if ( rh <= 1.e-10) { xo= xi- ai* ysn; yo= yi+ ai* xsn; zo= zi; } else { rh= ai/ sqrt( rh); if ( rhoz < 0.0) rh=- rh; xo= xi+ rh* rhox; yo= yi+ rh* rhoy; zo= zi+ rh* rhoz; } /* if ( rh <= 1.e-10) */ r = xij*xij + yij*yij + zij*zij; if ( r <= .95) { /* Field from interpolation is integrated over segment */ isnor=1; dmin = norm(exk) + norm(eyk) + norm(ezk); dmin = 0.01* sqrt(dmin); shaf = 0.5* m_s; rom2(-shaf, shaf, egnd, dmin); } else { /* Norton field equations and lumped current element approximation */ isnor=2; sflds(0., egnd); } /* if ( r <= .95) */ if ( r > .95) { zp= xij* cabj+ yij* sabj+ zij* salpr; rh= r- zp* zp; if ( rh <= 1.e-10) dmin = 0.0; else dmin = sqrt( rh/( rh+ ai* ai)); if ( dmin <= .95) { px=1.- dmin; terk=( txk* cabj+ tyk* sabj+ tzk* salpr)* px; txk= dmin* txk+ terk* cabj; tyk= dmin* tyk+ terk* sabj; tzk= dmin* tzk+ terk* salpr; ters=( txs* cabj+ tys* sabj+ tzs* salpr)* px; txs= dmin* txs+ ters* cabj; tys= dmin* tys+ ters* sabj; tzs= dmin* tzs+ ters* salpr; terc=( txc* cabj+ tyc* sabj+ tzc* salpr)* px; txc= dmin* txc+ terc* cabj; tyc= dmin* tyc+ terc* sabj; tzc= dmin* tzc+ terc* salpr; } } /* if ( r > .95) */ exk= exk+ txk; eyk= eyk+ tyk; ezk= ezk+ tzk; exs= exs+ txs; eys= eys+ tys; ezs= ezs+ tzs; exc= exc+ txc; eyc= eyc+ tyc; ezc= ezc+ tzc; } /*-----------------------------------------------------------------------*/ /* Compute E-field of sine, cosine, and constant current filaments by thin wire approximation. */ void nec_context::eksc( nec_float s, nec_float z, nec_float rh, nec_float xk, int ij, nec_complex *in_ezs, nec_complex *ers, nec_complex *in_ezc, nec_complex *erc, nec_complex *in_ezk, nec_complex *erk ) { static nec_complex __const1(0.0,4.771341189); // set some global variables for the gf() method. These should be moved to parameters of gf (via intx) ija = ij; zpk = xk* z; nec_float rhk = xk * rh; rkb2 = rhk * rhk; nec_float sh =.5* s; nec_float shk = xk * sh; nec_float ss = sin(shk); nec_float cs = cos(shk); nec_float z2a = sh - z; nec_float z1a =-(sh + z); nec_complex gz1, gz2, gp1, gp2; gx( z1a, rh, xk, &gz1, &gp1); gx( z2a, rh, xk, &gz2, &gp2); nec_complex gzp1 = gp1 * z1a; nec_complex gzp2 = gp2 * z2a; *in_ezs= __const1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *in_ezc=- __const1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *erk= __const1*( gp2- gp1)* rh; nec_float cint, sint; intx(-shk, shk, rhk, ij, &cint, &sint); *in_ezk=- __const1*( gzp2- gzp1+ xk* xk* nec_complex( cint,- sint)); if ( rh >= 1.0e-10) { gzp1 = gzp1 * z1a; gzp2 = gzp2 * z2a; *ers =- __const1*(( gzp2+ gzp1+ gz2+ gz1)* ss-( z2a* gz2- z1a* gz1)* cs*xk)/ rh; *erc =- __const1*(( gzp2- gzp1+ gz2- gz1)* cs+( z2a* gz2+ z1a* gz1)* ss*xk)/ rh; return; } *ers = cplx_00(); *erc = cplx_00(); } /*-----------------------------------------------------------------------*/ /* Compute e field of sine, cosine, and constant current filaments by extended thin wire approximation. */ void nec_context::ekscx( nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk, int ij, int inx1, int inx2, nec_complex *in_ezs, nec_complex *ers, nec_complex *in_ezc, nec_complex *erc, nec_complex *in_ezk, nec_complex *erk ) { static nec_complex __const1(0.0,4.771341189); int ira; nec_float b, rh, sh, rhk, shk, ss, cs, z1a; nec_float z2a, a2, bk, bk2, cint, sint; nec_complex gz1, gz2, gzp1, gzp2, gr1, gr2; nec_complex grp1, grp2, grk1, grk2, gzz1, gzz2; if ( rhx >= bx) { rh= rhx; b= bx; ira=0; } else { rh= bx; b= rhx; ira=1; } sh=.5* s; // set some global variables for the gf() method. These should be moved to parameters of gf (via intx) ija= ij; zpk= xk* z; rhk= xk* rh; rkb2= rhk* rhk; shk= xk* sh; ss= sin( shk); cs= cos( shk); z2a= sh- z; z1a=-( sh+ z); a2= b* b; if ( inx1 != 2) gxx( z1a, rh, b, a2, xk, ira, &gz1, &gzp1, &gr1, &grp1, &grk1, &gzz1); else { gx( z1a, rhx, xk, &gz1, &grk1); gzp1= grk1* z1a; gr1= gz1/ rhx; grp1= gzp1/ rhx; grk1= grk1* rhx; gzz1= cplx_00(); } if ( inx2 != 2) gxx( z2a, rh, b, a2, xk, ira, &gz2, &gzp2, &gr2, &grp2, &grk2, &gzz2); else { gx( z2a, rhx, xk, &gz2, &grk2); gzp2= grk2* z2a; gr2= gz2/ rhx; grp2= gzp2/ rhx; grk2= grk2* rhx; gzz2= cplx_00(); } *in_ezs= __const1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *in_ezc=- __const1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *ers=- __const1*(( z2a* grp2+ z1a* grp1+ gr2+ gr1)*ss -( z2a* gr2- z1a* gr1)* cs* xk); *erc=- __const1*(( z2a* grp2- z1a* grp1+ gr2- gr1)*cs +( z2a* gr2+ z1a* gr1)* ss* xk); *erk= __const1*( grk2- grk1); intx(- shk, shk, rhk, ij, &cint, &sint); bk= b* xk; bk2= bk* bk*.25; *in_ezk=- __const1*( gzp2- gzp1+ xk* xk*(1.- bk2)* nec_complex( cint,- sint)-bk2*( gzz2- gzz1)); } /*-----------------------------------------------------------------------*/ /*!\brief Fills the array e with the negative of the electric field incident on the structure. \param e is the right hand side of the matrix equation. */ void nec_context::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 ) { nec_float cth, sth, cph, sph, cet, set, pxl, pyl, pzl, wx; nec_float wy, wz, qx, qy, qz, ds, dsh, rs, r; nec_complex er, et, ezh, erh, rrv, rrh, tt1, tt2; int n = m_geometry->n; int m = m_geometry->m; // int neq= n+2*m; ASSERT(neq == n+2*m); nqds=0; ASSERT(excite_type >= 0); /* applied field of voltage sources for transmitting case */ if ( (excite_type == EXCITATION_VOLTAGE) || (excite_type == EXCITATION_VOLTAGE_DISC) ) { e.fill(0,neq,cplx_00()); for (int i = 0; i < voltage_source_count; i++ ) { int source_index = source_segment_array[i]-1; e[source_index] = -source_voltage_array[i]/(m_geometry->segment_length[source_index]* wavelength); } if ( nvqd == 0) return; for (int i = 0; i < nvqd; i++ ) { qdsrc( ivqd[i], vqd[i], e); } return; } /* if ( (excite_type == EXCITATION_VOLTAGE) || (excite_type == EXCITATION_VOLTAGE_DISC) ) */ /* incident plane wave, linearly polarized. */ if ((excite_type == EXCITATION_LINEAR) || (excite_type == EXCITATION_CIRC_RIGHT) || (excite_type == EXCITATION_CIRC_LEFT)) { cth= cos( p1); sth= sin( p1); cph= cos( p2); sph= sin( p2); cet= cos( p3); set= sin( p3); pxl= cth* cph* cet- sph* set; pyl= cth* sph* cet+ cph* set; pzl=- sth* cet; wx=- sth* cph; wy=- sth* sph; wz=- cth; qx= wy* pzl- wz* pyl; qy= wz* pxl- wx* pzl; qz= wx* pyl- wy* pxl; if (ground.present()) { if (ground.type_perfect()) { rrv=-cplx_10(); rrh=-cplx_10(); } else { rrv= sqrt(1.0 - ground.get_zrati_sqr() * sth*sth); rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); } } if ( excite_type == EXCITATION_LINEAR) { if ( n != 0) { for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi() *( wx* m_geometry->x[i]+ wy* m_geometry->y[i]+ wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] = -(pxl*m_geometry->cab[i]+ pyl*m_geometry->sab[i]+ pzl*m_geometry->salp[i]) * e_amplitude * incident_amplitude; } if (ground.present()) { tt1=( pyl* cph- pxl* sph)*( rrh- rrv); nec_complex cx= rrv* pxl- tt1* sph; nec_complex cy= rrv* pyl+ tt1* cph; nec_complex cz=- rrv* pzl; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]- wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] -= ( cx* m_geometry->cab[i]+ cy* m_geometry->sab[i]+ cz* m_geometry->salp[i])* e_amplitude * incident_amplitude; } } } /* if ( n != 0) */ if ( m == 0) // if no surface patches we're done! return; { int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; ASSERT(is == i); i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT( arg == (- two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]+ wz* m_geometry->pz[i]))); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * RETA; e[i2]=( qx* m_geometry->t1x[i]+ qy* m_geometry->t1y[i]+ qz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]=( qx* m_geometry->t2x[i]+ qy* m_geometry->t2y[i]+ qz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } if (ground.present()) { tt1=( qy* cph- qx* sph)*( rrv- rrh); nec_complex cx=-( rrh* qx- tt1* sph); nec_complex cy=-( rrh* qy+ tt1* cph); nec_complex cz= rrh* qz; int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT((-two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]- wz* m_geometry->pz[i])) == arg); nec_complex e_amplitude = cplx_exp(arg) * m_geometry->psalp[i] * RETA; e[i2]= e[i2]+( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]= e[i1]+( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } return; } /* if ( excite_type == EXCITATION_LINEAR) */ /* incident plane wave, elliptic polarization. */ tt1=-(cplx_01())* p6; if ( excite_type == EXCITATION_CIRC_LEFT) tt1=- tt1; if ( n != 0) { nec_complex cx= pxl+ tt1* qx; nec_complex cy= pyl+ tt1* qy; nec_complex cz= pzl+ tt1* qz; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]+ wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] = -(cx* m_geometry->cab[i] + cy* m_geometry->sab[i] + cz*m_geometry->salp[i])* e_amplitude * incident_amplitude; } if (ground.present()) { tt2=( cy* cph- cx* sph)*( rrh- rrv); nec_complex ccx= rrv* cx- tt2* sph; nec_complex ccy= rrv* cy+ tt2* cph; nec_complex ccz=- rrv* cz; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]- wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] -= (ccx* m_geometry->cab[i]+ ccy* m_geometry->sab[i]+ ccz* m_geometry->salp[i]) * e_amplitude * incident_amplitude; } } } /* if ( n != 0) */ if ( m == 0) return; nec_complex cx= qx- tt1* pxl; nec_complex cy= qy- tt1* pyl; nec_complex cz= qz- tt1* pzl; { int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT(arg == -two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]+ wz* m_geometry->pz[i])); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * RETA; e[i2]=( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]=( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } if (ground.present()) { tt1=( cy* cph- cx* sph)*( rrv- rrh); cx=-( rrh* cx- tt1* sph); cy=-( rrh* cy+ tt1* cph); cz= rrh* cz; int i= -1; int i1= n-2; for (int is=0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT(arg == -two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]- wz* m_geometry->pz[i])); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * RETA; e[i2] += ( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1] += ( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } return; } /* if ( excite_type <= 3) */ ASSERT(excite_type == EXCITATION_CURRENT); /* incident field of an elementary current source. */ nec_float cosp4 = cos(p4); wx = cosp4 * cos(p5); wy = cosp4 * sin(p5); wz = sin(p4); ds = p6*59.958; dsh= p6/(2.0 * two_pi()); // TODO: Split the following loop up into two loops i=1:n and i=1:m // to loop over the patches and the segments seperately for (int i = 0; i < m_geometry->n_plus_m; i++ ) { if ( i < n ) { pxl = m_geometry->x[i] - p1; pyl = m_geometry->y[i] - p2; pzl = m_geometry->z[i] - p3; } else // patches { int patch_index = i - n; pxl = m_geometry->px[patch_index] - p1; pyl = m_geometry->py[patch_index] - p2; pzl = m_geometry->pz[patch_index] - p3; } rs = norm2(pxl,pyl,pzl); if ( rs < 1.0e-30) continue; r = sqrt(rs); pxl = pxl/r; pyl = pyl/r; pzl = pzl/r; cth = pxl*wx + pyl*wy + pzl*wz; sth = sqrt(1.0 - cth*cth); qx = pxl - wx*cth; qy = pyl - wy*cth; qz = pzl - wz*cth; nec_float arg = norm(qx,qy,qz); if ( arg >= 1.e-30) { qx = qx / arg; qy = qy / arg; qz = qz / arg; } else { qx = 1.0; qy = 0.0; qz = 0.0; } /* if ( arg >= 1.e-30) */ arg = two_pi() * r; tt1 = nec_complex(cos(arg), -sin(arg)); if ( i < n ) { tt2 = nec_complex(1.0,-1.0/arg) / rs; er = ds* tt1* tt2* cth; et = 0.5 * ds * tt1 *((cplx_01()) * two_pi()/r + tt2)* sth; ezh= er*cth - et*sth; erh= er*sth + et*cth; nec_complex cx = ezh*wx + erh*qx; nec_complex cy = ezh*wy + erh*qy; nec_complex cz = ezh*wz + erh*qz; e[i] = -(cx* m_geometry->cab[i]+ cy* m_geometry->sab[i]+ cz* m_geometry->salp[i]); } else // patches { int patch_index = i - n; int i1 = i + patch_index*2; // was i1 += 2; and starts at n-2 int i2 = i1+1; pxl = wy*qz - wz*qy; // cross product here... pyl = wz*qx - wx*qz; pzl = wx*qy - wy*qx; tt2= dsh* tt1* nec_complex(1.0/r, two_pi())/ r* sth* m_geometry->psalp[patch_index]; nec_complex cx= tt2* pxl; nec_complex cy= tt2* pyl; nec_complex cz= tt2* pzl; e[i2] = cx*m_geometry->t1x[patch_index] + cy*m_geometry->t1y[patch_index] + cz*m_geometry->t1z[patch_index]; e[i1] = cx*m_geometry->t2x[patch_index] + cy*m_geometry->t2y[patch_index] + cz*m_geometry->t2z[patch_index]; } /* if ( i < n) */ } /* for( i = 0; i < m_geometry->n_plus_m; i++ ) */ } /*!\brief Computes the integrand exp(jkr)/(kr) for numerical integration. TODO: Place the ija, rkb2, zpk = xk*z global variables as parameters (possibly also the rk parameter). */ void nec_context::gf( nec_float zk, nec_float *co, nec_float *si ) { static nec_float _gf_const0 = -1.38888889e-3; static nec_float _gf_const1 = 4.16666667e-2; nec_float zdk = zk - zpk; nec_float rk = sqrt(rkb2 + zdk*zdk); *si= sin(rk)/ rk; if ( ija != 0 ) { *co = cos(rk)/ rk; return; } if ( rk >= .2) { *co = (cos(rk) - 1.0)/rk; return; } nec_float rks = rk*rk; *co = ((_gf_const0 * rks + _gf_const1)* rks - 0.5)* rk; } /*-----------------------------------------------------------------------*/ /* integrand for h field of a wire */ void nec_context::gh( nec_float zk, nec_float *hr, nec_float *hi) { nec_float rs, r, ckr, skr, rr2, rr3; rs= zk- zpka; rs= rhks+ rs* rs; r= sqrt( rs); ckr= cos( r); skr= sin( r); rr2=1./ rs; rr3= rr2/ r; *hr= skr* rr2+ ckr* rr3; *hi= ckr* rr2- skr* rr3; } /*-----------------------------------------------------------------------*/ /* Segment end contributions for thin wire approx. This function is called a lot. We should try to optimise this if at all possible. */ void nec_context::gx( nec_float zz, nec_float rh, nec_float xk, nec_complex *gz, nec_complex *gzp) { nec_float r2 = zz*zz+ rh*rh; nec_float r = sqrt(r2); nec_float rkz = xk * r; nec_complex temp(cos(rkz),-sin(rkz)); temp /= r; *gz = temp; *gzp = -nec_complex(1.0, rkz) * temp / r2; } /*-----------------------------------------------------------------------*/ /*! \brief Segment end contributions for extended thin wire approx. */ void nec_context::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 ) { nec_float r, r2, r4, rk, rk2, rh2, t1, t2; nec_complex gz, c1, c2, c3; r2= zz* zz+ rh* rh; r= sqrt( r2); r4= r2* r2; rk= xk* r; rk2= rk* rk; rh2= rh* rh; t1=.25* a2* rh2/ r4; t2=.5* a2/ r2; c1= nec_complex(1.0, rk); c2=3.* c1- rk2; c3= nec_complex(6.0, rk)* rk2-15.* c1; gz= nec_complex( cos( rk),- sin( rk))/ r; *g2= gz*(1.+ t1* c2); *g1= *g2- t2* c1* gz; gz= gz/ r2; *g2p= gz*( t1* c3- c1); *gzp= t2* c2* gz; *g3= *g2p+ *gzp; *g1p= *g3* zz; if ( ira != 1) { *g3=( *g3+ *gzp)* rh; *gzp=- zz* c1* gz; if ( rh <= 1.0e-10) { *g2=0.; *g2p=0.; return; } *g2= *g2/ rh; *g2p= *g2p* zz/ rh; return; } /* if ( ira != 1) */ t2=.5* a; *g2=- t2* c1* gz; *g2p= t2* gz* c2/ r2; *g3= rh2* *g2p- a* gz* c1; *g2p= *g2p* zz; *gzp=- zz* c1* gz; } /*-----------------------------------------------------------------------*/ /* hfk computes the H-field of a uniform current filament by numerical integration */ void nec_context::hfk( nec_float el1, nec_float el2, nec_float rhk, nec_float zpkx, nec_float *sgr, nec_float *sgi ) { int nx = 1, nma = 65536, nts = 4; int ns, nt; bool flag = true; nec_float rx = 1.0e-4; nec_float z, ze, s, ep, zend, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; nec_float g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; nec_float g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; zpka= zpkx; rhks= rhk* rhk; z= el1; ze= el2; s= ze- z; ep= s/(10.* nma); zend= ze- ep; *sgr=0.0; *sgi=0.0; ns= nx; nt=0; gh( z, &g1r, &g1i); while( true ) { if ( flag ) { dz= s/ ns; zp= z+ dz; if ( zp > ze ) { dz= ze- z; if ( fabs(dz) <= ep ) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } } dzot= dz*.5; zp= z+ dzot; gh( zp, &g3r, &g3i); zp= z+ dz; gh( zp, &g5r, &g5i); } /* if ( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if ( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if ( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if ( nt >= nts) { if ( ns > nx) { ns= ns/2; nt=1; } } flag = true; continue; } /* if ( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gh( zp, &g2r, &g2i); zp= z+ dz*0.75; gh( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if ( (te2i > rx) || (te2r > rx) ) { nt=0; if ( ns >= nma) m_output.nec_printf( "\n STEP SIZE LIMITED AT Z= %10.5f", z ); else { ns= ns*2; dz= s/ ns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = false; continue; } } /* if ( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if ( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { ns= ns/2; nt=1; } flag = true; } /* while( true ) */ } /*-----------------------------------------------------------------------*/ /* hintg computes the h field of a patch current */ void nec_context::hintg( nec_float xi, nec_float yi, nec_float zi ) { nec_float rx, ry, rfl, xymag, pxx, pyy, cth; nec_float rz, rsq, r, rk, cr, sr, t1zr, t2zr; nec_complex gam, f1x, f1y, f1z, f2x, f2y, f2z, rrv, rrh; rx= xi- xj; ry= yi- yj; rfl=-1.; exk=cplx_00(); eyk=cplx_00(); ezk=cplx_00(); exs=cplx_00(); eys=cplx_00(); ezs=cplx_00(); for (int ground_loop = 1; ground_loop <= ground.ksymp; ground_loop++ ) { rfl=- rfl; rz = zi - zj*rfl; rsq = rx*rx + ry*ry + rz*rz; if ( rsq < 1.0e-20) continue; r = sqrt( rsq ); rk= two_pi() * r; cr= cos( rk); sr= sin( rk); gam=-( nec_complex(cr,-sr)+rk*nec_complex(sr,cr) )/( FPI*rsq*r )* m_s; exc= gam* rx; eyc= gam* ry; ezc= gam* rz; t1zr= t1zj* rfl; t2zr= t2zj* rfl; f1x= eyc* t1zr- ezc* t1yj; f1y= ezc* t1xj- exc* t1zr; f1z= exc* t1yj- eyc* t1xj; f2x= eyc* t2zr- ezc* t2yj; f2y= ezc* t2xj- exc* t2zr; f2z= exc* t2yj- eyc* t2xj; if ( ground_loop != 1) { if ( ground.type_perfect() ) //ground.iperf == 1) { f1x=- f1x; f1y=- f1y; f1z=- f1z; f2x=- f2x; f2y=- f2y; f2z=- f2z; } else { xymag= sqrt(rx*rx + ry*ry); if ( xymag <= 1.0e-6) { pxx=0.; pyy=0.; cth=1.; rrv=cplx_10(); } else { pxx=- ry/ xymag; pyy= rx/ xymag; cth= rz/ r; rrv= sqrt(1.0 - ground.get_zrati_sqr() *(1.0 - cth* cth)); } /* if ( xymag <= 1.0e-6) */ rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); gam=( f1x* pxx+ f1y* pyy)*( rrv- rrh); f1x= f1x* rrh+ gam* pxx; f1y= f1y* rrh+ gam* pyy; f1z= f1z* rrh; gam=( f2x* pxx+ f2y* pyy)*( rrv- rrh); f2x= f2x* rrh+ gam* pxx; f2y= f2y* rrh+ gam* pyy; f2z= f2z* rrh; } /* if ( ground.iperf == 1) */ } /* if ( ground_loop != 1) */ exk += f1x; eyk += f1y; ezk += f1z; exs += f2x; eys += f2y; ezs += f2z; } /* for( ground_loop = 1; ground_loop <= ground.ksymp; ground_loop++ ) */ } /*-----------------------------------------------------------------------*/ /*!\brief hsfld computes the h field for constant, sine, and cosine current on a segment including ground effects. */ void nec_context::hsfld( nec_float xi, nec_float yi, nec_float zi, nec_float ai ) { nec_float xij, yij, rfl, salpr, zij, zp, rhox, rhoy, rhoz, rh, phx; nec_float phy, phz, rmag, xymag, xspec, yspec, rhospc, px, py, cth; nec_complex hpk, hps, hpc, qx, qy, qz, rrv, rrh, zratx; xij= xi- xj; yij= yi- yj; rfl=-1.; for (int ground_loop = 0; ground_loop < ground.ksymp; ground_loop++ ) { rfl=- rfl; salpr= salpj* rfl; zij= zi- rfl* zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh= sqrt( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai); if ( rh <= 1.0e-10) { exk=0.; eyk=0.; ezk=0.; exs=0.; eys=0.; ezs=0.; exc=0.; eyc=0.; ezc=0.; continue; } rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; phx= sabj* rhoz- salpr* rhoy; phy= salpr* rhox- cabj* rhoz; phz= cabj* rhoy- sabj* rhox; hsflx( m_s, rh, zp, &hpk, &hps, &hpc); if ( ground_loop == 1 ) { if ( false == ground.type_perfect() ) { zratx= ground.zrati; rmag= sqrt( zp* zp+ rh* rh); xymag= sqrt( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if ( ground.radial_wire_count != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrt( xspec*xspec + yspec*yspec + ground.t2*ground.t2); if ( rhospc <= ground.scrwl) { rrv = ground.m_t1 * rhospc* log(rhospc/ ground.t2); zratx = ( rrv* ground.zrati)/( ETA* ground.zrati + rrv); } } /* calculation of reflection coefficients when ground is specified. */ if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=cplx_10(); } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; rrv= sqrt(1.- zratx* zratx*(1.- cth* cth)); } rrh= zratx* cth; rrh=-( rrh- rrv)/( rrh+ rrv); rrv= zratx* rrv; rrv=( cth- rrv)/( cth+ rrv); qy=( phx* px+ phy* py)*( rrv- rrh); qx= qy* px+ phx* rrh; qy= qy* py+ phy* rrh; qz= phz* rrh; exk= exk- hpk* qx; eyk= eyk- hpk* qy; ezk= ezk- hpk* qz; exs= exs- hps* qx; eys= eys- hps* qy; ezs= ezs- hps* qz; exc= exc- hpc* qx; eyc= eyc- hpc* qy; ezc= ezc- hpc* qz; continue; } /* if ( ground.iperf != 1 ) */ exk= exk- hpk* phx; eyk= eyk- hpk* phy; ezk= ezk- hpk* phz; exs= exs- hps* phx; eys= eys- hps* phy; ezs= ezs- hps* phz; exc= exc- hpc* phx; eyc= eyc- hpc* phy; ezc= ezc- hpc* phz; continue; } /* if ( ground_loop == 1 ) */ exk= hpk* phx; eyk= hpk* phy; ezk= hpk* phz; exs= hps* phx; eys= hps* phy; ezs= hps* phz; exc= hpc* phx; eyc= hpc* phy; ezc= hpc* phz; } /* for( ground_loop = 0; ground_loop < ground.ksymp; ground_loop++ ) */ } /*-----------------------------------------------------------------------*/ /* calculates h field of sine cosine, and constant current of segment */ void nec_context::hsflx( nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk, nec_complex *hps, nec_complex *hpc ) { nec_float r1, r2, zp, z2a, hss, dh, z1; nec_float rhz, dk, cdk, sdk, hkr, hki, rh2; nec_complex fjk, ekr1, ekr2, t1, t2, cons; nec_float pi8 = pi() * 8.0; fjk = -two_pi_j(); if ( rh >= 1.0e-10) { if ( zpx >= 0.0) { zp= zpx; hss=1.; } else { zp=- zpx; hss=-1.; } dh= 0.5* s; z1= zp+ dh; z2a= zp- dh; if ( z2a >= 1.0e-7) rhz= rh/ z2a; else rhz=1.; dk= two_pi() * dh; cdk= cos( dk); sdk= sin( dk); hfk(- dk, dk, rh* two_pi(), zp* two_pi(), &hkr, &hki); *hpk= nec_complex( hkr, hki); if ( rhz >= 1.0e-3) { rh2= rh* rh; r1= sqrt( rh2+ z1* z1); r2= sqrt( rh2+ z2a* z2a); ekr1= exp( fjk* r1); ekr2= exp( fjk* r2); t1= z1* ekr1/ r1; t2= z2a* ekr2/ r2; *hps=( cdk*( ekr2- ekr1)- cplx_01()* sdk*( t2+ t1))* hss; *hpc=- sdk*( ekr2+ ekr1)- cplx_01()* cdk*( t2- t1); cons=- cplx_01()/(2.0 * two_pi() * rh); *hps= cons* *hps; *hpc= cons* *hpc; return; } /* if ( rhz >= 1.0e-3) */ ekr1= nec_complex( cdk, sdk)/( z2a* z2a); ekr2= nec_complex( cdk,- sdk)/( z1* z1); t1= two_pi()*(1.0/z1 - 1.0/z2a); t2= exp( fjk* zp)* rh/ pi8; *hps= t2*( t1+( ekr1+ ekr2)* sdk)* hss; *hpc= t2*(- cplx_01()* t1+( ekr1- ekr2)* cdk); return; } /* if ( rh >= 1.0e-10) */ *hps=cplx_00(); *hpc=cplx_00(); *hpk=cplx_00(); } /* intx performs numerical integration of exp(jkr)/r by the method of variable interval width Romberg integration. The integrand value is supplied by subroutine gf. */ void nec_context::intx( nec_float el1, nec_float el2, nec_float b, int ij, nec_float *sgr, nec_float *sgi) { int ns, nt; int nx = 1, nma = 65536, nts = 4; bool flag = true; nec_float z, s, ze, fnm, ep, zend, fns, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; nec_float g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; nec_float g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; nec_float rx = 1.0e-4; z= el1; ze= el2; if ( ij == 0) ze=0.; s= ze- z; fnm= nma; ep= s/(10.* fnm); zend= ze- ep; *sgr=0.; *sgi=0.; ns= nx; nt=0; gf( z, &g1r, &g1i); while( true ) { if ( flag ) { fns= ns; dz= s/ fns; zp= z+ dz; if ( zp > ze) { dz= ze- z; if ( fabs(dz) <= ep) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } } /* if ( zp > ze) */ dzot= dz*.5; zp= z+ dzot; gf( zp, &g3r, &g3i); zp= z+ dz; gf( zp, &g5r, &g5i); } /* if ( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; /* test convergence of 3 point romberg result. */ test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if ( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if ( z >= zend) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = true; continue; } /* if ( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gf( zp, &g2r, &g2i); zp= z+ dz*0.75; gf( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; /* test convergence of 5 point romberg result. */ test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if ( (te2i > rx) || (te2r > rx) ) { nt=0; if ( ns >= nma) m_output.nec_printf( "\n STEP SIZE LIMITED AT Z= %10.5f", z ); else { /* halve step size */ ns= ns*2; fns= ns; dz= s/ fns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = false; continue; } } /* if ( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if ( z >= zend) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = true; } /* while( true ) */ } /*! \brief nefld computes the near field at specified points in space after the structure currents have been computed. \param xob,yob,zob The field evaluation points. */ void nec_context::nefld( nec_float xob, nec_float yob, nec_float zob, nec_complex *ex, nec_complex *ey, nec_complex *ez ) { int i, ix, ipr, iprx, jc; nec_float zp, ax; nec_complex acx, bcx, ccx; *ex=cplx_00(); *ey=cplx_00(); *ez=cplx_00(); ax=0.0; int n = m_geometry->n; for( i = 0; i < n; i++ ) { xj= xob- m_geometry->x[i]; yj= yob- m_geometry->y[i]; zj= zob- m_geometry->z[i]; zp= m_geometry->cab[i]* xj+ m_geometry->sab[i]* yj+ m_geometry->salp[i]* zj; if ( fabs( zp) > 0.5001* m_geometry->segment_length[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= m_geometry->segment_radius[i]; if ( zp > 0.9* xj* xj) continue; ax= xj; break; } /* for( i = 0; i < n; i++ ) */ for( i = 0; i < n; i++ ) { ix = i+1; m_s = m_geometry->segment_length[i]; m_b = m_geometry->segment_radius[i]; xj= m_geometry->x[i]; yj= m_geometry->y[i]; zj= m_geometry->z[i]; cabj= m_geometry->cab[i]; sabj= m_geometry->sab[i]; salpj= m_geometry->salp[i]; if ( m_use_exk == true) { ipr= m_geometry->icon1[i]; if ( ipr < 0 ) { ipr = -ipr; iprx = ipr-1; if ( -m_geometry->icon1[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); #ifdef NEC_ERROR_CHECK int ind_test; nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); #endif } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind1=1; else { iprx = ipr-1; if ( ipr != ix ) { if ( m_geometry->icon2[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); #ifdef NEC_ERROR_CHECK int ind_test; nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); #endif } } /* if ( ipr != ix ) */ else { if ( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= m_geometry->icon2[i]; if ( ipr < 0 ) { ipr = -ipr; iprx = ipr-1; if ( -m_geometry->icon2[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); #ifdef NEC_ERROR_CHECK int ind_test; nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); #endif } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind2=1; else { iprx = ipr-1; if ( ipr != ix ) { if ( m_geometry->icon1[iprx] != ix ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(i,iprx); #ifdef NEC_ERROR_CHECK int ind_test; nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind2); #endif } } /* if ( ipr != (i+1) ) */ else { if ( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if ( m_use_exk == true) */ efld( xob, yob, zob, ax, true); acx= nec_complex( air[i], aii[i]); bcx= nec_complex( bir[i], bii[i]); ccx= nec_complex( cir[i], cii[i]); *ex += exk* acx+ exs* bcx+ exc* ccx; *ey += eyk* acx+ eys* bcx+ eyc* ccx; *ez += ezk* acx+ ezs* bcx+ ezc* ccx; } /* for( i = 0; i < n; i++ ) */ jc= n-1; for( i = 0; i < m_geometry->m; i++ ) { m_s= m_geometry->pbi[i]; xj= m_geometry->px[i]; yj= m_geometry->py[i]; zj= m_geometry->pz[i]; t1xj= m_geometry->t1x[i]; t1yj= m_geometry->t1y[i]; t1zj= m_geometry->t1z[i]; t2xj= m_geometry->t2x[i]; t2yj= m_geometry->t2y[i]; t2zj= m_geometry->t2z[i]; jc += 3; acx= t1xj* current_vector[jc-2]+ t1yj* current_vector[jc-1]+ t1zj* current_vector[jc]; bcx= t2xj* current_vector[jc-2]+ t2yj* current_vector[jc-1]+ t2zj* current_vector[jc]; { unere( xob, yob, zob, false); *ex += acx* exk+ bcx* exs; *ey += acx* eyk+ bcx* eys; *ez += acx* ezk+ bcx* ezs; } if (ground.present()) { unere( xob, yob, zob, true); *ex += acx* exk+ bcx* exs; *ey += acx* eyk+ bcx* eys; *ez += acx* ezk+ bcx* ezs; } /* for( ipa = 0; ipa < ground.ksymp; ipa++ ) { int ipgnd= ipa+1; unere( xob, yob, zob, ipgnd == 2); *ex= *ex+ acx* exk+ bcx* exs; *ey= *ey+ acx* eyk+ bcx* eys; *ez= *ez+ acx* ezk+ bcx* ezs; } */ } /* for( i = 0; i < m; i++ ) */ } /*-----------------------------------------------------------------------*/ #include /* subroutine netwk solves for structure currents for a given */ /* excitation including the effect of non-radiating networks if */ /* present. */ void nec_context::netwk( complex_array& in_cm, int_array& in_ip, complex_array& einc ) /* The parameters cmb, cmc, cmd appear to be Numerical Green's Functions Related. N.G.F are not implemented in this version of NEC. The evidence for the above opinion is from the NEC-PC code that does implement the N.G.F. */ { /* Network buffers */ int_array ipnt, nteqa, ntsca; complex_array vsrc, rhs, cmn, rhnt, rhnx; bool jump1, jump2; int nteq=0, ntsc=0, nseg2, irow2=0; int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0; nec_float asmx, asa, y11r, y11i, y12r, y12i, y22r, y22i; nec_complex ymit, vlt, cux; neqz2= neq2; if ( neqz2 == 0) neqz2=1; input_power = 0.0; network_power_loss = 0.0; neqt= neq+ neq2; int ndimn = (2*network_count + voltage_source_count); /* Allocate network buffers */ if ( network_count > 0 ) { rhs.resize( m_geometry->n_plus_3m ); // this should probably be ndimn! rhnt.resize( ndimn ); rhnx.resize( ndimn); cmn.resize( ndimn * ndimn ); ntsca.resize( ndimn ); nteqa.resize( ndimn ); ipnt.resize( ndimn ); vsrc.resize( voltage_source_count ); } if ( ntsol == 0) { /* compute relative matrix asymmetry */ if ( masym != 0) { irow1=0; for( i = 0; i < network_count; i++ ) { nseg1= iseg1[i]; for( isc1 = 0; isc1 < 2; isc1++ ) { if ( irow1 == 0) { ipnt[irow1]= nseg1; nseg1= iseg2[i]; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } nseg1= iseg2[i]; } /* for( isc1 = 0; isc1 < 2; isc1++ ) */ } /* for( i = 0; i < network_count; i++ ) */ ASSERT(voltage_source_count >= 0); for( i = 0; i < voltage_source_count; i++ ) { nseg1= source_segment_array[i]; if ( irow1 == 0) { ipnt[irow1]= nseg1; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } } /* for( i = 0; i < voltage_source_count; i++ ) */ if ( irow1 >= 2) { for( i = 0; i < irow1; i++ ) { isc1 = ipnt[i]-1; asmx= m_geometry->segment_length[isc1]; rhs.fill(0,neqt,cplx_00()); rhs[isc1] = cplx_10(); solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < irow1; j++ ) { isc1= ipnt[j]-1; cmn[j+i*ndimn]= rhs[isc1]/ asmx; } } /* for( i = 0; i < irow1; i++ ) */ asmx=0.0; asa=0.0; for( i = 1; i < irow1; i++ ) { for (int j = 0; j < i; j++ ) { cux = cmn[i+j*ndimn]; nec_float pwr= abs(( cux- cmn[j+i*ndimn])/ cux); asa += pwr* pwr; if ( pwr >= asmx) { asmx= pwr; nteq= ipnt[i]; ntsc= ipnt[j]; } } /* for( j = 0; j < i; j++ ) */ } /* for( i = 1; i < irow1; i++ ) */ asa= sqrt( asa*2./ (nec_float)( irow1*( irow1-1))); m_output.nec_printf( "\n\n" " MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n" " MATRIX IS %10.3E FOR SEGMENTS %d AND %d\n" " RMS RELATIVE ASYMMETRY IS %10.3E", asmx, nteq, ntsc, asa ); } /* if ( irow1 >= 2) */ } /* if ( masym != 0) */ /* solution of network equations */ if ( network_count != 0) { // zero the cmn array, and the rhnx array cmn.fill(cplx_00()); rhnx.fill(cplx_00()); nteq=0; ntsc=0; /* sort network and source data and assign equation numbers to segments */ for (int j = 0; j < network_count; j++ ) { nseg1= iseg1[j]; nseg2= iseg2[j]; // Calculate the admittance yXX for this network element if ( ntyp[j] <= 1) // if not transmission line { y11r= x11r[j]; y11i= x11i[j]; y12r= x12r[j]; y12i= x12i[j]; y22r= x22r[j]; y22i= x22i[j]; } else { y22r= two_pi() * x11i[j]/ wavelength; y12r=0.; y12i=1./( x11r[j]* sin( y22r)); y11r= x12r[j]; y11i=- y12i* cos( y22r); y22r= x22r[j]; y22i= y11i+ x22i[j]; y11i= y11i+ x12i[j]; if ( ntyp[j] != 2) // ntype == 3, must be crossed element { y12r = -y12r; y12i = -y12i; } } /* if ( ntyp[j] <= 1) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg1 == source_segment_array[i]) { isc1 = i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc1=-1; for( i = 0; i < nteq; i++ ) { if ( nseg1 == nteqa[i]) { irow1 = i; jump2 = true; break; } } if ( ! jump2 ) { irow1= nteq; nteqa[nteq]= nseg1; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg1 == ntsca[i]) { irow1 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow1= ndimn- (ntsc+1); ntsca[ntsc]= nseg1; vsrc[ntsc]= source_voltage_array[isc1]; ntsc++; } } /* if ( ! jump1 ) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg2 == source_segment_array[i]) { isc2= i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc2=-1; for( i = 0; i < nteq; i++ ) { if ( nseg2 == nteqa[i]) { irow2= i; jump2 = true; break; } } if ( ! jump2 ) { irow2= nteq; nteqa[nteq]= nseg2; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg2 == ntsca[i]) { irow2 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow2= ndimn- (ntsc+1); ntsca[ntsc]= nseg2; vsrc[ntsc]= source_voltage_array[isc2]; ntsc++; } } /* if ( ! jump1 ) */ /* Fill network equation matrix and right hand side vector with network short-circuit admittance matrix coefficients. */ if ( isc1 == -1) { cmn[irow1+irow1*ndimn] -= nec_complex( y11r, y11i)* m_geometry->segment_length[nseg1-1]; cmn[irow1+irow2*ndimn] -= nec_complex( y12r, y12i)* m_geometry->segment_length[nseg1-1]; } else { rhnx[irow1] += nec_complex( y11r, y11i)* source_voltage_array[isc1]/wavelength; rhnx[irow2] += nec_complex( y12r, y12i)* source_voltage_array[isc1]/wavelength; } if ( isc2 == -1) { cmn[irow2+irow2*ndimn] -= nec_complex( y22r, y22i)* m_geometry->segment_length[nseg2-1]; cmn[irow2+irow1*ndimn] -= nec_complex( y12r, y12i)* m_geometry->segment_length[nseg2-1]; } else { rhnx[irow1] += nec_complex( y12r, y12i)* source_voltage_array[isc2]/wavelength; rhnx[irow2] += nec_complex( y22r, y22i)* source_voltage_array[isc2]/wavelength; } } /* for( j = 0; j < network_count; j++ ) */ /* add interaction matrix admittance elements to network equation matrix */ for( i = 0; i < nteq; i++ ) { rhs.fill(0,neqt,cplx_00()); irow1= nteqa[i]-1; rhs[irow1]=cplx_10(); solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < nteq; j++ ) { irow1= nteqa[j]-1; cmn[i+j*ndimn] += rhs[irow1]; } } /* for( i = 0; i < nteq; i++ ) */ /* factor network equation matrix */ lu_decompose(m_output, nteq, cmn, ipnt, ndimn); } /* if ( network_count != 0) */ } /* if ( ntsol != 0) */ if (0 == network_count) { /* solve for currents when no networks are present */ solves( in_cm, in_ip, einc, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); ntsc=0; } else // if ( network_count != 0) { /* Add to network equation right hand side the terms due to element interactions */ for (i = 0; i < neqt; i++) rhs[i]= einc[i]; solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; rhnt[i]= rhnx[i]+ rhs[irow1]; } /* solve network equations */ solve( nteq, cmn, ipnt, rhnt, ndimn); /* Add fields due to network voltages to electric fields applied to structure and solve for induced current */ for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; einc[irow1] -= rhnt[i]; } solves( in_cm, in_ip, einc, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); nec_structure_excitation* seo = new nec_structure_excitation(); for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* m_geometry->segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; int segment_tag = m_geometry->segment_tags[segment_index]; seo->add(segment_number, segment_tag, voltage, current, power); } for ( i = 0; i < ntsc; i++ ) { int segment_number = ntsca[i]; int segment_index = segment_number-1; nec_complex voltage = vsrc[i]; nec_complex current = einc[segment_index]* wavelength; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; int segment_tag = m_geometry->segment_tags[segment_index]; seo->add(segment_number, segment_tag, voltage, current, power); } /* for( i = 0; i < ntsc; i++ ) */ if ( nprint == 0) { std::stringstream ss; seo->write_to_file(ss); m_output.line(ss.str().c_str()); } seo->set_frequency(freq_mhz/(1.e-6)); m_results.add(seo); /* if ( nprint == 0) { m_output.nec_printf( "\n\n\n" " " "--------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" ); m_output.nec_printf( "\n" " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) " " IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY (WATTS)" ); } for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* m_geometry->segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; int segment_tag = m_geometry->segment_tags[segment_number]; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; if ( nprint == 0) m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_number, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } for( i = 0; i < ntsc; i++ ) { irow1= ntsca[i]-1; vlt= vsrc[i]; cux= einc[irow1]* wavelength; ymit= cux/ vlt; zped= vlt/ cux; irow2= m_geometry->segment_tags[irow1]; nec_float pwr= em::power(vlt,cux); network_power_loss= network_power_loss- pwr; if ( nprint == 0) m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, irow1+1, real(vlt), imag(vlt), real(cux), imag(cux), real(zped), imag(zped), real(ymit), imag(ymit), pwr ); } // for( i = 0; i < ntsc; i++ ) */ } // if ( network_count != 0) if ( (voltage_source_count+nvqd) == 0) return; // Create an antenna_input results object to hold the antenna input results. nec_antenna_input* antenna_input = new nec_antenna_input(); antenna_input->set_frequency(freq_mhz/(1.e-6)); m_results.add(antenna_input); /* m_output.end_section(); m_output.nec_printf( " " "--------- ANTENNA INPUT PARAMETERS ---------" ); m_output.nec_printf( "\n" " TAG SEG VOLTAGE (VOLTS) " "CURRENT (AMPS) IMPEDANCE (OHMS) " " ADMITTANCE (MHOS) POWER\n" " NO. NO. REAL IMAGINARY" " REAL IMAGINARY REAL " "IMAGINARY REAL IMAGINARY (WATTS)" ); */ for( i = 0; i < voltage_source_count; i++ ) { int segment_index = source_segment_array[i]-1; nec_complex voltage = source_voltage_array[i]; nec_complex current = einc[segment_index] * wavelength; bool add_as_network_loss = false; if( ntsc != 0) { int j = 0; for (j = 0; j < ntsc; j++ ) if (ntsca[j] == segment_index+1) break; int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; nec_complex temp = rhnx[row_index]; for (int k = 0; k < nteq; k++ ) temp -= cmn[k+row_offset]*rhnt[k]; current = (einc[segment_index] + temp) * wavelength; add_as_network_loss = true; } /* The following Code provided by Neoklis Kyriazis as a replacement for the broken code below. if( ntsc == 0) { cux= einc[isc1]* wlam; irow1=0; } else { for( j = 0; j < ntsc; j++ ) if( ntsca[j] == isc1+1) break; irow1= ndimn- (j+1); cux= rhnx[irow1]; for( j = 0; j < nteq; j++ ) cux -= cmn[j+irow1*ndimn]*rhnt[j]; cux=(einc[isc1]+ cux)* wlam; irow1++; } // if( ntsc == 0) // the following loop is completely mysterious! for (int j = 0; j < ntsc; j++ ) { // I am now almost sure that the following code is not correct. // This modifies the current, however if the inner loop is executed more // than once, then only the last current modification is kept! if ( ntsca[j] == segment_index+1) { int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; // I wish I knew what was going on here... nec_complex temp = rhnx[row_index]; // renamed current -> temp to avoid confusion for (int k = 0; k < nteq; k++ ) temp -= cmn[k + row_offset]*rhnt[k]; current = (temp + einc[segment_index])* wavelength; add_as_network_loss = true; #warning "This loop is messed up. The j is inside another j loop" // I have removed the j from the "for (int k = 0; k < nteq; k++ )" loop // and placed this"j=nteq" statement here. j = nteq; } } */ nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); if ( add_as_network_loss ) network_power_loss += power; input_power += power; int segment_tag = m_geometry->segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); /* m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); */ } /* for( i = 0; i < voltage_source_count; i++ ) */ for( i = 0; i < nvqd; i++ ) { /* isc1= ivqd[i]-1; vlt= vqd[i]; cux= cmplx( air[isc1], aii[isc1]); ymit= cmplx( bir[isc1], bii[isc1]); zped= cmplx( cir[isc1], cii[isc1]); pwr= si[isc1]* TP*.5; cux=( cux- ymit* sin( pwr)+ zped* cos( pwr))* wlam; ymit= cux/ vlt; zped= vlt/ cux; pwr=.5* creal( vlt* conj( cux)); pin= pin+ pwr; irow2= itag[isc1]; fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, isc1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux), creal(zped), cimag(zped), creal(ymit), cimag(ymit), pwr ); */ int segment_index = ivqd[i]-1; nec_complex voltage = vqd[i]; nec_complex _ai( air[segment_index], aii[segment_index]); nec_complex _bi( bir[segment_index], bii[segment_index]); nec_complex _ci( cir[segment_index], cii[segment_index]); // segment length is measured in wavelengths. The phase is therefore the length in wavelengths // multiplied by pi().// TCAM CHANGED TO pi() (from TP*.5)!! nec_float segment_length_phase = m_geometry->segment_length[segment_index] * pi(); nec_complex current = (_ai - _bi* sin(segment_length_phase) + _ci * cos(segment_length_phase)) * wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); input_power += power; int segment_tag = m_geometry->segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); /* m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); */ } /* for( i = 0; i < nvqd; i++ ) */ std::stringstream ss; antenna_input->write_to_file(ss); m_output.line(ss.str().c_str()); } /*-----------------------------------------------------------------------*/ /* compute near e or h fields over a range of points */ void nec_context::nfpat( void ) { int i, j, kk; nec_float znrt, cth=0., sth=0., ynrt, cph=0., sph=0., xnrt, xob, yob; nec_float zob, tmp1, tmp2, tmp3; /* nec_float tmp4, tmp5, tmp6; */ nec_complex ex, ey, ez; /* The printing of near fields is now managed by a dedicated nec_base_result : nec_near_field_pattern*/ /* if ( nfeh != 1) { m_output.nec_printf( "\n\n\n" " " "-------- NEAR ELECTRIC FIELDS --------\n" " ------- LOCATION ------- ------- EX ------ ------- EY ------ ------- EZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" ); } else { m_output.nec_printf( "\n\n\n" " " "-------- NEAR MAGNETIC FIELDS ---------\n\n" " ------- LOCATION ------- ------- HX ------ ------- HY ------ ------- HZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS AMPS/M DEGREES AMPS/M DEGREES AMPS/M DEGREES" ); }*/ nec_near_field_pattern* nfp = new nec_near_field_pattern(nfeh); nfp->set_frequency(freq_mhz/(1.e-6)); m_results.add(nfp); znrt= znr- dznr; for( i = 0; i < nrz; i++ ) { znrt += dznr; if ( m_near != 0) { cth= cos( degrees_to_rad(znrt) ); sth= sin( degrees_to_rad(znrt) ); } ynrt= ynr- dynr; for( j = 0; j < nry; j++ ) { ynrt += dynr; if ( m_near != 0) { cph= cos( degrees_to_rad(ynrt) ); sph= sin( degrees_to_rad(ynrt) ); } xnrt= xnr- dxnr; for( kk = 0; kk < nrx; kk++ ) { xnrt += dxnr; if ( m_near != 0) { xob= xnrt* sth* cph; yob= xnrt* sth* sph; zob= xnrt* cth; } else { xob= xnrt; yob= ynrt; zob= znrt; } tmp1= xob/ wavelength; tmp2= yob/ wavelength; tmp3= zob/ wavelength; if ( nfeh != 1) nefld( tmp1, tmp2, tmp3, &ex, &ey, &ez); else nhfld( tmp1, tmp2, tmp3, &ex, &ey, &ez); /*no more used */ /* tmp1= abs( ex); tmp2= arg_degrees( ex); tmp3= abs( ey); tmp4= arg_degrees( ey); tmp5= abs( ez); tmp6= arg_degrees( ez); m_output.nec_printf( "\n" " %9.4f %9.4f %9.4f %11.4E %7.2f %11.4E %7.2f %11.4E %7.2f", xob, yob, zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); */ nfp->set_input(xob, yob, zob, ex, ey, ez); plot_card.plot_fields(ex, ey, ez, xob, yob, zob); } /* for( kk = 0; kk < nrx; kk++ ) */ } /* for( j = 0; j < nry; j++ ) */ } /* for( i = 0; i < nrz; i++ ) */ // write the results to the ordinary NEC output file. std::stringstream ss; nfp->write_to_file(ss); m_output.line(ss.str().c_str()); } /*-----------------------------------------------------------------------*/ /*!\brief Computes the near field at specified points in space after the structure currents have been computed. */ void nec_context::nhfld( nec_float xob, nec_float yob, nec_float zob, nec_complex *hx, nec_complex *hy, nec_complex *hz ) { *hx=cplx_00(); *hy=cplx_00(); *hz=cplx_00(); nec_float ax = 0.0; int n = m_geometry->n; for (int i = 0; i < n; i++ ) { xj= xob- m_geometry->x[i]; yj= yob- m_geometry->y[i]; zj= zob- m_geometry->z[i]; nec_float zp= m_geometry->cab[i]* xj+ m_geometry->sab[i]* yj+ m_geometry->salp[i]* zj; if ( fabs( zp) > 0.5001* m_geometry->segment_length[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= m_geometry->segment_radius[i]; if ( zp > 0.9* xj* xj) continue; ax = xj; break; } for (int i = 0; i < n; i++ ) { m_s = m_geometry->segment_length[i]; m_b = m_geometry->segment_radius[i]; xj= m_geometry->x[i]; yj= m_geometry->y[i]; zj= m_geometry->z[i]; cabj= m_geometry->cab[i]; sabj= m_geometry->sab[i]; salpj= m_geometry->salp[i]; hsfld( xob, yob, zob, ax); nec_complex acx= nec_complex( air[i], aii[i]); nec_complex bcx= nec_complex( bir[i], bii[i]); nec_complex ccx= nec_complex( cir[i], cii[i]); *hx += exk* acx+ exs* bcx+ exc* ccx; *hy += eyk* acx+ eys* bcx+ eyc* ccx; *hz += ezk* acx+ ezs* bcx+ ezc* ccx; } if ( m_geometry->m == 0) return; int jc= n-1; for (int i = 0; i < m_geometry->m; i++ ) { m_s = m_geometry->pbi[i]; xj= m_geometry->px[i]; yj= m_geometry->py[i]; zj= m_geometry->pz[i]; t1xj= m_geometry->t1x[i]; t1yj= m_geometry->t1y[i]; t1zj= m_geometry->t1z[i]; t2xj= m_geometry->t2x[i]; t2yj= m_geometry->t2y[i]; t2zj= m_geometry->t2z[i]; hintg( xob, yob, zob); jc += 3; nec_complex acx= t1xj* current_vector[jc-2] + t1yj* current_vector[jc-1] + t1zj* current_vector[jc]; nec_complex bcx= t2xj* current_vector[jc-2] + t2yj* current_vector[jc-1] + t2zj* current_vector[jc]; *hx= *hx+ acx* exk+ bcx* exs; *hy= *hy+ acx* eyk+ bcx* eys; *hz= *hz+ acx* ezk+ bcx* ezs; } } /*-----------------------------------------------------------------------*/ /**\brief Integrate over patches at wire connection point */ void nec_context::pcint( nec_float xi, nec_float yi, nec_float zi, nec_float cabi, nec_float sabi, nec_float salpi, complex_array& e) { nec_float d, ds, da, gcon, fcon, xxj, xyj, xzj, xs, s1; nec_float xss, yss, zss, s2x; int nint = 10; d = sqrt(m_s)*0.5; ds=4.* d/ (nec_float) nint; da= ds* ds; gcon=1./ m_s; fcon=1./(2.* two_pi() * d); xxj= xj; xyj= yj; xzj= zj; xs = m_s; m_s = da; s1= d+ ds*.5; xss= xj+ s1*( t1xj+ t2xj); yss= yj+ s1*( t1yj+ t2yj); zss= zj+ s1*( t1zj+ t2zj); s1= s1+ d; s2x= s1; nec_complex e1=cplx_00(); nec_complex e2=cplx_00(); nec_complex e3=cplx_00(); nec_complex e4=cplx_00(); nec_complex e5=cplx_00(); nec_complex e6=cplx_00(); nec_complex e7=cplx_00(); nec_complex e8=cplx_00(); nec_complex e9=cplx_00(); for (int i1 = 0; i1 < nint; i1++ ) { s1= s1- ds; nec_float s2 = s2x; xss= xss- ds* t1xj; yss= yss- ds* t1yj; zss= zss- ds* t1zj; xj= xss; yj= yss; zj= zss; for(int i2 = 0; i2 < nint; i2++ ) { s2= s2- ds; xj= xj- ds* t2xj; yj= yj- ds* t2yj; zj= zj- ds* t2zj; unere( xi, yi, zi, false); exk= exk* cabi+ eyk* sabi+ ezk* salpi; exs= exs* cabi+ eys* sabi+ ezs* salpi; nec_float g1 = (d + s1)*(d + s2)*gcon; nec_float g2 = (d - s1)*(d + s2)*gcon; nec_float g3 = (d - s1)*(d - s2)*gcon; nec_float g4 = (d + s1)*(d - s2)*gcon; nec_float f2 = (s1*s1 + s2*s2) * two_pi(); nec_float f1= s1/f2 - (g1 - g2 - g3 + g4)*fcon; f2 = s2/f2 - (g1 + g2 - g3 - g4)*fcon; e1 += exk* g1; e2 += exk* g2; e3 += exk* g3; e4 += exk* g4; e5 += exs* g1; e6 += exs* g2; e7 += exs* g3; e8 += exs* g4; e9 += exk* f1+ exs*f2; } } /* for( i1 = 0; i1 < nint; i1++ ) */ e[0]= e1; e[1]= e2; e[2]= e3; e[3]= e4; e[4]= e5; e[5]= e6; e[6]= e7; e[7]= e8; e[8]= e9; xj= xxj; yj= xyj; zj= xzj; m_s= xs; } /*-----------------------------------------------------------------------*/ /* impedance_print sets up the print formats for impedance loading */ void nec_context::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) { /* record to be output and buffer used to make it */ std::string record; char buf[15]; int in[3], i1, i; nec_float fl[6]; in[0]= in1; in[1]= in2; in[2]= in3; fl[0]= fl1; fl[1]= fl2; fl[2]= fl3; fl[3]= fl4; fl[4]= fl5; fl[5]= fl6; /* integer format */ i1=0; record = "\n "; if ( (in1 == 0) && (in2 == 0) && (in3 == 0) ) { record += " ALL"; i1=1; } for( i = i1; i < 3; i++ ) { if ( in[i] == 0) record += " "; else { sprintf( buf, "%5d", in[i] ); record += buf; } } /* floating point format */ for( i = 0; i < 6; i++ ) { if ( fabs( fl[i]) >= 1.0e-20 ) { sprintf( buf, " %11.4E", fl[i] ); record += buf; } else record += " "; } record += " "; record += ia; m_output.string(record.c_str() ); } /*-----------------------------------------------------------------------*/ /* fill incident field array for charge discontinuity voltage source */ void nec_context::qdsrc( int is, nec_complex v, complex_array& e ) { static nec_complex s_CCJ(0.0,-0.01666666667); int i, jx, j, jp1, ipr, i1; nec_float xi, yi, zi, ai, cabi, sabi, salpi, tx, ty, tz; nec_complex curd, etk, ets, etc; is--; i= m_geometry->icon1[is]; m_geometry->icon1[is]=0; m_geometry->tbf( is+1,0); m_geometry->icon1[is]= i; m_s = m_geometry->segment_length[is]*.5; curd= s_CCJ * v/(( log(2.* m_s/ m_geometry->segment_radius[is])-1.)*( m_geometry->bx[m_geometry->jsno-1]* cos( two_pi() * m_s)+ m_geometry->cx[m_geometry->jsno-1]* sin( two_pi() * m_s))* wavelength); vqds[nqds]= v; iqds[nqds]= is+1; nqds++; for( jx = 0; jx < m_geometry->jsno; jx++ ) { j= m_geometry->jco[jx]-1; jp1 = j+1; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; if ( m_use_exk == true) { ipr= m_geometry->icon1[j]; if ( ipr < 0 ) { ipr=- ipr; ipr--; if ( -m_geometry->icon1[ipr-1] != jp1 ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind1=1; else /* ipr > 0 */ { ipr--; if ( ipr != j ) { if ( m_geometry->icon2[ipr] != jp1) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr != j ) */ else { if ( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= m_geometry->icon2[j]; if ( ipr < 0 ) { ipr = -ipr; ipr--; if ( -m_geometry->icon2[ipr] != jp1 ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind2=1; else /* ipr > 0 */ { ipr--; if ( ipr != j ) { if ( m_geometry->icon1[ipr] != jp1) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind2); } } /* if ( ipr != j )*/ else { if ( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if ( m_use_exk == true) */ int n = m_geometry->n; for( i = 0; i < n; i++ ) { xi= m_geometry->x[i]; yi= m_geometry->y[i]; zi= m_geometry->z[i]; ai= m_geometry->segment_radius[i]; efld( xi, yi, zi, ai, (i != j)); cabi= m_geometry->cab[i]; sabi= m_geometry->sab[i]; salpi= m_geometry->salp[i]; etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; e[i]= e[i]-( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx])* curd; } int m = m_geometry->m; if ( m != 0) { i1= n-1; for( i = 0; i < m; i++ ) { xi= m_geometry->px[i]; yi= m_geometry->py[i]; zi= m_geometry->pz[i]; hsfld( xi, yi, zi,0.); i1++; tx= m_geometry->t2x[i]; ty= m_geometry->t2y[i]; tz= m_geometry->t2z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx] )* curd* m_geometry->psalp[i]; i1++; tx= m_geometry->t1x[i]; ty= m_geometry->t1y[i]; tz= m_geometry->t1z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx])* curd* m_geometry->psalp[i]; } } /* if ( m != 0) */ if ( nload > 0 ) e[j] += zarray[j]* curd*(m_geometry->ax[jx]+ m_geometry->cx[jx]); } /* for( jx = 0; jx < m_geometry->jsno; jx++ ) */ } /*-----------------------------------------------------------------------*/ /*! For the Sommerfeld ground option, rom2 integrates over the source segment to obtain the total field due to ground. The method of variable interval width Romberg integration is used. There are 9 field components - the x, y, and z components due to constant, sine, and cosine current distributions. \param a lower limit of integral \param b upper limit of integral \param dmin Set in EFLD to 1% of the magnitude of the electric field */ void nec_context::rom2( nec_float a, nec_float b, complex_array& sum, nec_float dmin ) { ASSERT(sum.size() == 9); bool flag = true; static bool step_warning_issued = false; int nts = 4, nx = 1, n = 9; nec_float dz=0., dzot=0.0; nec_float rx = 1.0e-4; complex_array g1(9), g2(9), g3(9), g4(9), g5(9); complex_array t01(9), t10(9), t20(9); nec_float _z = a; nec_float ze = b; nec_float _s = b - a; if ( _s < 0.0) { throw new nec_exception("ERROR - B LESS THAN A IN ROM2"); } nec_float ep = _s/(1.0e4 * m_geometry->n_plus_m); nec_float zend = ze - ep; sum.fill(0,n,cplx_00()); int ns = nx; int nt = 0; sflds( _z, g1); while ( true ) { if ( flag ) { dz = _s / ns; if ( _z + dz >= ze) { dz = ze- _z; if ( dz <= ep) return; } dzot= dz*.5; sflds( _z + dzot, g3); sflds( _z + dz, g5); } // Evaluate 3-point Romberg result and test convergence. for (int i = 0; i < n; i++ ) { nec_complex t00 = (g1[i]+ g5[i]) * dzot; t01[i] = (t00 + dz * g3[i]) * 0.5; t10[i] = (4.0 * t01[i] - t00)/3.; } nec_float tmag1 = sqrt( norm(t01[0]) + norm(t01[1]) + norm(t01[2]) ); nec_float tmag2 = sqrt( norm(t10[0]) + norm(t10[1]) + norm(t10[2]) ); nec_float tr = test_simple( tmag1, tmag2, dmin); if ( tr <= rx) { for (int i = 0; i < n; i++ ) sum[i] += t10[i]; nt += 2; // Now we do some housekeeping before looping back _z += dz; if ( _z > zend) return; for (int i = 0; i < n; i++ ) g1[i] = g5[i]; if ( (nt >= nts) && (ns > nx) ) { ns= ns/2; nt=1; } flag = true; continue; } /* if ( tr <= rx) */ sflds( _z+ dz*.25, g2); sflds( _z+ dz*.75, g4); tmag1 = 0.0; tmag2 = 0.0; /* Evaluate 5 point Romberg result and test convergence. */ for (int i = 0; i < n; i++ ) { nec_complex t02 = (t01[i]+ dzot*( g2[i]+ g4[i]))*0.5; nec_complex t11 = (4.0 * t02- t01[i] )/3.0; t20[i] = (16.* t11- t10[i])/15.0; if (i <= 2) { tmag1 += norm(t11); tmag2 += norm(t20[i]); } } tmag1 = sqrt(tmag1); tmag2 = sqrt(tmag2); tr = test_simple( tmag1, tmag2, dmin); // check this with the FORTRAN flow, Neoklis (probably correctly) feels that it // should be if (tr > rx) // TODO test this code here on Sommerfeld Norton Conditions if ( tr > rx) { nt=0; if ( ns < m_geometry->n_plus_m ) { ns = ns*2; dz = _s/ ns; dzot = dz*.5; for (int i = 0; i < n; i++ ) { g5[i] = g3[i]; g3[i] = g2[i]; } flag=false; continue; } nec_error_mode em(m_output); m_output.string("ROM2 -- STEP SIZE LIMITED AT Z = "); m_output.real_out(12,5,_z); m_output.endl(); if (false == step_warning_issued) { m_output.line("About the above warning:"); m_output.line("Probably caused by a wire too close to the ground in the Somerfeld/"); m_output.line("Norton ground method. Execution continues but results may be inaccurate."); step_warning_issued = true; } } /* if ( tr <= rx) */ for (int i = 0; i < n; i++ ) sum[i] += t20[i]; nt = nt+1; // Now we do the same housekeeping before looping back _z = _z + dz; if ( _z > zend) return; for (int i = 0; i < n; i++ ) g1[i] = g5[i]; flag = true; if ( (nt >= nts) && (ns > nx) ) { /* Double step size */ ns = ns/2; nt = 1; } } /* while( true ) */ } /*-----------------------------------------------------------------------*/ /* sflds returns the field due to ground for a current element on the source segment at t relative to the segment center. */ void nec_context::sflds( nec_float t, complex_array& e ) { static nec_complex __const1(0.0,4.771341189); nec_float xt, yt, zt, rhx, rhy, rhs, rho, phx, phy; nec_float cph, sph, zphs, r2s, rk, sfac, thet; nec_complex erv, ezv, erh, ezh, eph; xt= xj + t* cabj; yt= yj + t* sabj; zt= zj + t* salpj; rhx= xo- xt; rhy= yo- yt; rhs= rhx* rhx+ rhy* rhy; rho= sqrt( rhs); if ( rho <= 0.0) { rhx=1.0; rhy=0.0; phx=0.0; phy=1.0; } else { rhx= rhx/ rho; rhy= rhy/ rho; phx= -rhy; phy= rhx; } cph= rhx* xsn+ rhy* ysn; sph= rhy* xsn- rhx* ysn; if ( fabs( cph) < 1.0e-10) cph=0.0; if ( fabs( sph) < 1.0e-10) sph=0.0; ground_wave.zph = zo+ zt; zphs= ground_wave.zph* ground_wave.zph; r2s= rhs+ zphs; ground_wave.r2= sqrt( r2s); rk= ground_wave.r2* two_pi(); ground_wave.xx2 = nec_complex( cos( rk),-sin( rk)); /* Use Norton approximation for field due to ground. Current is lumped at segment center with current moment for constant, sine, or cosine distribution. */ if ( isnor != 1) { ground_wave.zmh=1.0; ground_wave.r1=1.; ground_wave.xx1=0.; gwave( &erv, &ezv, &erh, &ezh, &eph, ground_wave); nec_complex et = -__const1 * ground.frati* ground_wave.xx2/( r2s* ground_wave.r2); nec_complex er = 2.* et* nec_complex(1.0, rk); et= et* nec_complex(1.0 - rk* rk, rk); nec_complex hrv = ( er+ et)* rho* ground_wave.zph/ r2s; nec_complex hzv = ( zphs* er- rhs* et)/ r2s; nec_complex hrh = ( rhs* er- zphs* et)/ r2s; erv= erv- hrv; ezv= ezv- hzv; erh= erh+ hrh; ezh= ezh+ hrv; eph= eph+ et; erv= erv* salpj; ezv= ezv* salpj; erh= erh* sn* cph; ezh= ezh* sn* cph; eph= eph* sn* sph; erh= erv+ erh; e[0]=( erh* rhx+ eph* phx)* m_s; e[1]=( erh* rhy+ eph* phy)* m_s; e[2]=( ezv+ ezh)* m_s; e[3]=0.; e[4]=0.; e[5]=0.; sfac= pi()* m_s; sfac= sin( sfac)/ sfac; e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; return; } /* if ( isnor != 1) */ /* Interpolate in Sommerfeld field tables */ if ( rho >= 1.0e-12) thet= atan( ground_wave.zph/ rho); else thet= pi_two(); /* Combine vertical and horizontal components and convert to x,y,z components. multiply by exp(-jkr)/r. */ ggrid.interpolate( ground_wave.r2, thet, &erv, &ezv, &erh, &eph ); ground_wave.xx2= ground_wave.xx2 / ground_wave.r2; sfac= sn* cph; erh= ground_wave.xx2*( salpj* erv+ sfac* erh); ezh= ground_wave.xx2*( salpj* ezv- sfac* erv); /* x,y,z fields for constant current */ eph= sn* sph* ground_wave.xx2* eph; e[0]= erh* rhx+ eph* phx; e[1]= erh* rhy+ eph* phy; e[2]= ezh; /* x,y,z fields for sine current */ rk= two_pi() * t; sfac= sin( rk); e[3]= e[0]* sfac; e[4]= e[1]* sfac; e[5]= e[2]* sfac; /* x,y,z fields for cosine current */ sfac= cos( rk); e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; } /*-----------------------------------------------------------------------*/ /*!\brief Calculates the electric field due to unit current in the t1 and t2 directions on a patch \param ground_reflection If true, then calculate the field reflected from the ground. (was ipgnd == 2) */ void nec_context::unere( nec_float xob, nec_float yob, nec_float zob, bool ground_reflection ) { nec_float px, py, cth; nec_complex rrv, rrh, edp; nec_float zr = zj; nec_float t1zr = t1zj; nec_float t2zr = t2zj; if ( ground_reflection) { zr =- zr; t1zr = -t1zr; t2zr = -t2zr; } nec_float rx = xob- xj; nec_float ry = yob- yj; nec_float rz = zob- zr; nec_float r2 = rx*rx + ry*ry + rz*rz; if ( r2 <= 1.0e-20) { exk=cplx_00(); eyk=cplx_00(); ezk=cplx_00(); exs=cplx_00(); eys=cplx_00(); ezs=cplx_00(); return; } nec_float r = sqrt(r2); nec_float tt1 = -two_pi() * r; nec_float tt2 = tt1 * tt1; nec_float rt = r2*r; nec_complex er = nec_complex( sin(tt1),-cos(tt1))*( CONST2* m_s); nec_complex q1= nec_complex(tt2 - 1.0, tt1)* er/ rt; nec_complex q2= nec_complex(3.0- tt2,-3.0*tt1)* er/( rt* r2); er = q2*( t1xj* rx+ t1yj* ry+ t1zr* rz); exk= q1* t1xj+ er* rx; eyk= q1* t1yj+ er* ry; ezk= q1* t1zr+ er* rz; er= q2*( t2xj* rx+ t2yj* ry+ t2zr* rz); exs= q1* t2xj+ er* rx; eys= q1* t2yj+ er* ry; ezs= q1* t2zr+ er* rz; if ( !ground_reflection) return; // handle the ground_reflection if ( ground.type_perfect() ) // (ground.iperf == 1) { exk=- exk; eyk=- eyk; ezk=- ezk; exs=- exs; eys=- eys; ezs=- ezs; return; } nec_float xymag = sqrt(rx*rx + ry*ry); if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=cplx_10(); } else { px=- ry/ xymag; py= rx/ xymag; cth= rz/ sqrt( xymag* xymag+ rz* rz); rrv= sqrt(1.0- ground.get_zrati_sqr() * (1.0 - cth*cth)); } rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); edp=( exk* px+ eyk* py)*( rrh- rrv); exk= exk* rrv+ edp* px; eyk= eyk* rrv+ edp* py; ezk= ezk* rrv; edp=( exs* px+ eys* py)*( rrh- rrv); exs= exs* rrv+ edp* px; eys= eys* rrv+ edp* py; ezs= ezs* rrv; } /*-----------------------------------------------------------------------*/ /* zint computes the internal impedance of a circular wire */ nec_complex zint_old( nec_float sigl, nec_float rolam ); nec_complex zint_old( nec_float sigl, nec_float rolam ) { #define cc1 nec_complex( 6.0e-7, + 1.9e-6) #define cc2 nec_complex(-3.4e-6, + 5.1e-6) #define cc3 nec_complex(-2.52e-5, + 0.0) #define cc4 nec_complex(-9.06e-5 , - 9.01e-5) #define cc5 nec_complex( 0., - 9.765e-4) #define cc6 nec_complex(.0110486, - .0110485) #define cc7 nec_complex( 0., - .3926991) #define cc8 nec_complex( 1.6e-6, - 3.2e-6) #define cc9 nec_complex( 1.17e-5, - 2.4e-6) #define cc10 nec_complex( 3.46e-5, + 3.38e-5) #define cc11 nec_complex( 5.0e-7, + 2.452e-4) #define cc12 nec_complex(-1.3813e-3, + 1.3811e-3) #define cc13 nec_complex(-6.25001e-2, - 1.0e-7) #define cc14 nec_complex(.7071068, + .7071068) #define cn cc14 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 ) #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 ) #define f(d) ( sqrt(pi_two()/(d))*exp(-cn*(d)+th(-8./x)) ) #define g(d) ( exp(cn*(d)+th(8./x))/sqrt(two_pi()*(d)) ) nec_complex br1, br2, zint; nec_float x, y, s, ber, bei; nec_float tpcmu = 2.368705e+3; nec_float cmotp = 60.00; x= sqrt( tpcmu* sigl)* rolam; if ( x <= 110.) { if ( x <= 8.) { y= x/8.; y= y* y; s= y* y; ber=((((((-9.01e-6* s+1.22552e-3)* s-.08349609)* s+ 2.6419140)* s-32.363456)* s+113.77778)* s-64.)* s+1.; bei=((((((1.1346e-4* s-.01103667)* s+.52185615)* s-10.567658)* s+72.817777)* s-113.77778)* s+16.)* y; br1= nec_complex( ber, bei); ber=(((((((-3.94e-6* s+4.5957e-4)* s-.02609253)* s+ .66047849)* s-6.0681481)* s+14.222222)* s-4.)* y)* x; bei=((((((4.609e-5* s-3.79386e-3)* s+.14677204)* s- 2.3116751)* s+11.377778)* s-10.666667)* s+.5)* x; br2= nec_complex( ber, bei); br1= br1/ br2; zint= cplx_01()* sqrt( cmotp/sigl )* br1/ rolam; return( zint ); } // if ( x <= 8.) br2= cplx_01()* f(x)/ pi(); br1= g( x)+ br2; br2= g( x)* ph(8./ x)- br2* ph(-8./ x); br1= br1/ br2; zint= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; return( zint ); } // if ( x <= 110.) br1= nec_complex(.70710678,-.70710678); zint= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; return( zint ); } /* zint computes the internal impedance of a circular wire */ nec_complex nec_context::zint( nec_float sigl, nec_float rolam ) { #define cc1 nec_complex( 6.0e-7, + 1.9e-6) #define cc2 nec_complex(-3.4e-6, + 5.1e-6) #define cc3 nec_complex(-2.52e-5, + 0.0) #define cc4 nec_complex(-9.06e-5 , - 9.01e-5) #define cc5 nec_complex( 0., - 9.765e-4) #define cc6 nec_complex(.0110486, - .0110485) #define cc7 nec_complex( 0., - .3926991) #define cc8 nec_complex( 1.6e-6, - 3.2e-6) #define cc9 nec_complex( 1.17e-5, - 2.4e-6) #define cc10 nec_complex( 3.46e-5, + 3.38e-5) #define cc11 nec_complex( 5.0e-7, + 2.452e-4) #define cc12 nec_complex(-1.3813e-3, + 1.3811e-3) #define cc13 nec_complex(-6.25001e-2, - 1.0e-7) #define cc14 nec_complex(.7071068, + .7071068) #define cn cc14 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 ) #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 ) #define f(d) ( sqrt(pi_two()/(d))*exp(-cn*(d)+th(-8./x)) ) #define g(d) ( exp(cn*(d)+th(8./x))/sqrt(two_pi()*(d)) ) static nec_float tpcmu = 2.368705e+3; static nec_float cmotp = 60.00; nec_float x = sqrt(tpcmu * sigl) * rolam; // if x is zero, then we have a zero radius! ASSERT(x != 0.0); if (x > 110.0) { nec_complex br1 = nec_complex(0.70710678, -0.70710678); nec_complex ret= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } if (x > 8.0) { nec_complex br2 = cplx_01()* f(x)/ pi(); nec_complex temp_gx = g(x); nec_complex br1 = temp_gx + br2; br2 = temp_gx * ph(8.0/x) - br2 * ph(-8.0/x); br1 = br1/ br2; nec_complex ret = cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } nec_float x8 = x / 8.0; nec_float y = x8*x8; nec_float s = y*y; nec_float ber=((((((-9.01e-6* s+1.22552e-3)* s-.08349609)* s+ 2.6419140)* s-32.363456)* s+113.77778)* s-64.)* s+1.; nec_float bei=((((((1.1346e-4* s-.01103667)* s+.52185615)* s-10.567658)* s+72.817777)* s-113.77778)* s+16.)* y; nec_complex br1= nec_complex( ber, bei); ber=(((((((-3.94e-6*s + 4.5957e-4)*s - 0.02609253)*s + 0.66047849)* s - 6.0681481)*s + 14.222222)*s - 4.0)* y)* x; bei=((((((4.609e-5* s-3.79386e-3)* s+.14677204)* s- 2.3116751)* s+11.377778)* s-10.666667)* s+.5)* x; nec_complex br2= nec_complex( ber, bei); br1= br1/ br2; nec_complex ret = cplx_01()* sqrt( cmotp/sigl )* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } /* fblock( np + 2 mp, n+2m, m_geometry->n_plus_2m * (m_geometry->np+2*m_geometry->mp), m_geometry->m_ipsym) */ /* fblock sets parameters for out-of-core */ /* solution for the primary matrix (a) */ void nec_context::fblock( int nrow, int ncol, int imax, int ipsym ) { int ka, kk; if ( nrow*ncol <= imax) { npblk= nrow; nlast= nrow; imat= nrow* ncol; if ( nrow == ncol) { icase=1; return; } else icase=2; } /* if ( nrow*ncol <= imax) */ if ( nop*nrow != ncol) { nec_stop("SYMMETRY ERROR - NROW: %d NCOL: %d", nrow, ncol ); } /* set up symmetry_array matrix for rotational symmetry. */ if ( ipsym <= 0) { nec_float phaz = two_pi()/nop; for(int i = 1; i < nop; i++ ) { for(int j= i; j < nop; j++ ) { nec_float arg = phaz * (nec_float)i * (nec_float)j; symmetry_array[i+j*nop]= nec_complex( cos( arg), sin( arg)); symmetry_array[j+i*nop]= symmetry_array[i+j*nop]; } } return; } /* if ( ipsym <= 0) */ /* set up symmetry_array matrix for plane symmetry */ kk=1; symmetry_array[0]=cplx_10(); int k_power = 2; for( ka = 1; k_power != nop; ka++ ) k_power *= 2; for(int k = 0; k < ka; k++ ) { for(int i = 0; i < kk; i++ ) { for(int j = 0; j < kk; j++ ) { nec_complex deter = symmetry_array[i+j*nop]; symmetry_array[i+(j+kk)*nop] = deter; symmetry_array[i+kk+(j+kk)*nop] =- deter; symmetry_array[i+kk+j*nop] = deter; } } kk *= 2; } /* for( k = 0; k < ka; k++ ) */ } /*! \brief gfld computes the radiated field including ground wave. \param space_only Compute only the space wave (was ksymp == 1) */ 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 ) { int i, k; nec_float b, r, thet, arg, phx, phy, rx, ry, dx, dy, dz, rix, riy, rhs, rhp; nec_float rhx, rhy, calp, cbet, sbet, cph, sph, el, rfl, riz, thx, thy, thz; nec_float rxyz, rnx, rny, rnz, omega, sill, top, bot, a, too, boo, c, rr, ri; nec_complex cix, ciy, ciz, exa, erv; nec_complex ezv, erh, eph, ezh, ex, ey; r= sqrt( rho*rho+ rz*rz ); if ( (space_only) || (abs(ground.zrati) > .5) || (r > 1.e5) ) { /* computation of space wave only */ if ( rz >= 1.0e-20) thet= atan( rho/ rz); else thet= pi()*.5; ffld(thet, phi, eth, epi, _wavelength); arg= -two_pi() * r; exa= nec_complex( cos( arg), sin( arg))/ r; *eth= *eth* exa; *epi= *epi* exa; *erd=cplx_00(); return; } /* if ( (space_only) && (abs(gound.zrati) > .5) && (r > 1.e5) ) */ /* computation of space and ground waves. */ ground_wave.set_u(ground.zrati); phx=- sin( phi); phy= cos( phi); rx= rho* phy; ry=- rho* phx; cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); /* summation of field from individual segments */ for( i = 0; i < m_geometry->n; i++ ) { dx= m_geometry->cab[i]; dy= m_geometry->sab[i]; dz= m_geometry->salp[i]; rix= rx- m_geometry->x[i]; riy= ry- m_geometry->y[i]; rhs= rix* rix+ riy* riy; rhp= sqrt( rhs); if ( rhp >= 1.0e-6) { rhx= rix/ rhp; rhy= riy/ rhp; } else { rhx=1.; rhy=0.; } calp=1.- dz* dz; if ( calp >= 1.0e-6) { calp= sqrt( calp); cbet= dx/ calp; sbet= dy/ calp; cph= rhx* cbet+ rhy* sbet; sph= rhy* cbet- rhx* sbet; } else { cph= rhx; sph= rhy; } el= pi()* m_geometry->segment_length[i]; rfl=-1.; /* Integration of (current)*(phase factor) over segment and image for constant, sine, and cosine current distributions */ for( k = 0; k < 2; k++ ) { rfl=- rfl; riz= rz- m_geometry->z[i]* rfl; rxyz= sqrt( rix* rix+ riy* riy+ riz* riz); rnx= rix/ rxyz; rny= riy/ rxyz; rnz= riz/ rxyz; omega=-( rnx* dx+ rny* dy+ rnz* dz* rfl); sill= omega* el; top= el+ sill; bot= el- sill; if ( fabs( omega) >= 1.0e-7) a=2.* sin( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if ( fabs( top) >= 1.0e-7) too= sin( top)/ top; else too=1.- top* top/6.; if ( fabs( bot) >= 1.0e-7) boo= sin( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= two_pi()*( m_geometry->x[i]* rnx+ m_geometry->y[i]* rny+ m_geometry->z[i]* rnz* rfl); exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri)/two_pi(); if ( k != 1 ) { ground_wave.xx1= exa; ground_wave.r1= rxyz; ground_wave.zmh= riz; continue; } ground_wave.xx2 = exa; ground_wave.r2= rxyz; ground_wave.zph= riz; } /* for( k = 0; k < 2; k++ ) */ /* call subroutine to compute the field */ /* of segment including ground wave. */ gwave( &erv, &ezv, &erh, &ezh, &eph, ground_wave); erh= erh* cph* calp+ erv* dz; eph= eph* sph* calp; ezh= ezh* cph* calp+ ezv* dz; ex= erh* rhx- eph* rhy; ey= erh* rhy+ eph* rhx; cix= cix+ ex; ciy= ciy+ ey; ciz= ciz+ ezh; } /* for( i = 0; i < n; i++ ) */ arg= -two_pi() * r; exa= nec_complex( cos( arg), sin( arg)); cix= cix* exa; ciy= ciy* exa; ciz= ciz* exa; rnx= rx/ r; rny= ry/ r; rnz= rz/ r; thx= rnz* phy; thy=- rnz* phx; thz=- rho/ r; *eth= cix* thx+ ciy* thy+ ciz* thz; *epi= cix* phx+ ciy* phy; *erd= cix* rnx+ ciy* rny+ ciz* rnz; } /* ffld calculates the far zone radiated electric fields, */ /* the factor exp(j*k*r)/(r/lamda) not included */ void nec_context::ffld(nec_float thet, nec_float phi, nec_complex *eth, nec_complex *eph, nec_float _wavelength ) { static nec_complex CONST3(0.0,-29.97922085); int k, i; bool jump; nec_float phx, phy, roz, rozs, thx, thy, thz, rox, roy; nec_float tthet=0., darg=0., omega, el, sill, top, bot, a; nec_float too, boo, b, c, d, rr, ri, arg, dr; nec_complex cix, ciy, ciz, exa, ccx, ccy, ccz, cdp; nec_complex zrsin, rrv, rrh, rrv1, rrh1, rrv2, rrh2; nec_complex tix, tiy, tiz, zscrn, ex, ey, ez; phx=- sin( phi); phy= cos( phi); roz= cos( thet); rozs= roz; thx= roz* phy; thy=- roz* phx; thz=- sin( thet); rox=- thz* phy; roy= thz* phx; jump = false; if ( m_geometry->n != 0) { /* loop for structure image if any */ /* calculation of reflection coeffecients */ for( k = 0; k < ground.ksymp; k++ ) { if ( k != 0 ) { /* for perfect ground */ if (ground.type_perfect()) { rrv=-cplx_10(); rrh=-cplx_10(); } else { /* for infinite planar ground */ zrsin= sqrt(1.- ground.get_zrati_sqr() * thz* thz); rrv=-( roz- ground.zrati * zrsin)/( roz+ ground.zrati* zrsin); rrh=( ground.zrati* roz- zrsin)/( ground.zrati* roz+ zrsin); } /* for the cliff problem, two reflction coefficients calculated */ if ( ifar > 1) { rrv1= rrv; rrh1= rrh; tthet= tan( thet); if ( ifar != 4) { nec_complex zrati2 = ground.get_zrati2(_wavelength); zrsin = sqrt(1.- zrati2 * zrati2 * thz* thz); rrv2 =-( roz- zrati2* zrsin)/( roz+ zrati2* zrsin); rrh2 =( zrati2* roz- zrsin)/( zrati2* roz+ zrsin); darg = -two_pi() * 2.0 * ground.get_ch(_wavelength) * roz; } } /* if ( ifar > 1) */ roz=- roz; ccx= cix; ccy= ciy; ccz= ciz; } /* if ( k != 0 ) */ cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); /* loop over structure segments */ for( i = 0; i < m_geometry->n; i++ ) { omega=-( rox* m_geometry->cab[i]+ roy* m_geometry->sab[i]+ roz* m_geometry->salp[i]); el= pi()* m_geometry->segment_length[i]; sill= omega* el; top= el+ sill; bot= el- sill; if ( fabs( omega) >= 1.0e-7) a=2.* sin( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if ( fabs( top) >= 1.0e-7) too= sin( top)/ top; else too=1.- top* top/6.; if ( fabs( bot) >= 1.0e-7) boo= sin( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= two_pi()*( m_geometry->x[i]* rox+ m_geometry->y[i]* roy+ m_geometry->z[i]* roz); if ( (k != 1) || (ifar < 2) ) { /* summation for far field integral */ exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri); cix= cix+ exa* m_geometry->cab[i]; ciy= ciy+ exa* m_geometry->sab[i]; ciz= ciz+ exa* m_geometry->salp[i]; continue; } /* calculation of image contribution */ /* in cliff and ground screen problems */ /* specular point distance */ dr= m_geometry->z[i]* tthet; d= dr* phy+ m_geometry->x[i]; if ( ifar == 2) { if (( ground.get_cl(_wavelength) - d) > 0.0) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if ( ifar == 2) */ else { d= sqrt( d*d + (m_geometry->y[i]-dr*phx)*(m_geometry->y[i]-dr*phx) ); if ( ifar == 3) { if (( ground.get_cl(_wavelength) - d) > 0.0) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if ( ifar == 3) */ else { if (( ground.scrwl- d) >= 0.0) { /* radial wire ground screen reflection coefficient */ d += ground.t2; zscrn= ground.m_t1 * d* log( d/ ground.t2); zscrn=( zscrn* ground.zrati)/( ETA* ground.zrati+ zscrn); zrsin= sqrt(1.- zscrn* zscrn* thz* thz); rrv=( roz+ zscrn* zrsin)/(- roz+ zscrn* zrsin); rrh=( zscrn* roz+ zrsin)/( zscrn* roz- zrsin); } /* if (( ground.scrwl- d) < 0.) */ else { if ( ifar == 4) { rrv= rrv1; rrh= rrh1; } /* if ( ifar == 4) */ else { if ( ifar == 5) d= dr* phy+ m_geometry->x[i]; if (( ground.get_cl(_wavelength) - d) > 0.) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } /* if (( cl- d) > 0.) */ } /* if ( ifar == 4) */ } /* if (( ground.scrwl- d) < 0.) */ } /* if ( ifar == 3) */ } /* if ( ifar == 2) */ /* contribution of each image segment modified by */ /* reflection coef, for cliff and ground screen problems */ exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri); tix= exa* m_geometry->cab[i]; tiy= exa* m_geometry->sab[i]; tiz= exa* m_geometry->salp[i]; cdp=( tix* phx+ tiy* phy)*( rrh- rrv); cix= cix+ tix* rrv+ cdp* phx; ciy= ciy+ tiy* rrv+ cdp* phy; ciz= ciz- tiz* rrv; } /* for( i = 0; i < n; i++ ) */ if ( k == 0 ) continue; /* calculation of contribution of structure image for infinite ground */ if ( ifar < 2) { cdp=( cix* phx+ ciy* phy)*( rrh- rrv); cix= ccx+ cix* rrv+ cdp* phx; ciy= ccy+ ciy* rrv+ cdp* phy; ciz= ccz- ciz* rrv; } else { cix= cix+ ccx; ciy= ciy+ ccy; ciz= ciz+ ccz; } } /* for( k=0; k < ground.ksymp; k++ ) */ if ( m_geometry->m > 0) jump = true; else { *eth=( cix* thx+ ciy* thy+ ciz* thz)* CONST3; *eph=( cix* phx+ ciy* phy)* CONST3; return; } } /* if ( n != 0) */ if ( ! jump ) { cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); } /* electric field components */ roz= rozs; { // without ground complex_array temp = current_vector.sub_array(m_geometry->n); m_geometry->fflds(rox, roy, roz, temp, &ex, &ey, &ez); } if (ground.present()) { // with ground nec_complex tempx, tempy, tempz; complex_array temp = current_vector.sub_array(m_geometry->n); m_geometry->fflds(rox, roy, -roz, temp, &tempx, &tempy, &tempz); if (ground.type_perfect()) { tempx = -tempx; tempy = -tempy; tempz = -tempz; } else { // get reflection co-efficient?? rrv= sqrt(1.0 - ground.get_zrati_sqr() * thz* thz); rrh= ground.zrati * roz; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati * rrv; rrv=-( roz- rrv)/( roz+ rrv); *eth=( tempx* phx+ tempy* phy)*( rrh- rrv); tempx= tempx* rrv+ *eth* phx; tempy= tempy* rrv+ *eth* phy; tempz= tempz* rrv; } /* if ( ground.iperf == 1) */ ex += tempx; ey += tempy; ez -= tempz; } ex += cix* CONST3; ey += ciy* CONST3; ez += ciz* CONST3; *eth= ex* thx+ ey* thy+ ez* thz; *eph= ex* phx+ ey* phy; } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_exception.cpp0000644000175000017500000000703210325372102022165 0ustar numanuma/*************************************************************************** * Copyright (C) 2004 by Tim Molteno * * tim@physics.otago.ac.nz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "nec_exception.h" #include "stdarg.h" #include "safe_array.h" using namespace std; string nec_exception::string_printf(const char* fmt, ...) { stringstream _sstream; va_list ap; /* special type for variable */ safe_array format(2048); /* argument lists */ int i, j; /* Need all these to store */ char c; /* values below in switch */ double d; unsigned u; char *s; void *v; va_start(ap, fmt); /* must be called before work */ while (*fmt) { for (j = 0; fmt[j] && fmt[j] != '%'; j++) format[j] = fmt[j]; /* not a format string */ if (j) { format[j] = '\0'; _sstream << format.get_ptr(); /* log it verbatim */ fmt += j; } else { for (j = 0; !isalpha(fmt[j]); j++) { /* find end of format specifier */ format[j] = fmt[j]; if (j && fmt[j] == '%') /* special case printing '%' */ break; } format[j] = fmt[j]; /* finish writing specifier */ format[j + 1] = '\0'; /* don't forget NULL terminator */ fmt += j + 1; switch (format[j]) { /* cases for all specifiers */ case 'd': case 'i': /* many use identical actions */ i = va_arg(ap, int); /* process the argument */ _sstream << i; /* and log it */ break; case 'o': case 'x': case 'X': case 'u': u = va_arg(ap, unsigned); _sstream << u; break; case 'c': c = (char) va_arg(ap, int); /* must cast! */ _sstream << c; break; case 's': s = va_arg(ap, char *); _sstream << s; break; case 'f': case 'e': case 'E': case 'g': case 'G': d = va_arg(ap, double); _sstream << d; break; case 'p': v = va_arg(ap, void *); _sstream << v; break; case '%': _sstream << "%%"; break; default: throw new nec_exception("Invalid format specifier in os_printf()"); } } } va_end(ap); /* clean up */ return _sstream.str(); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/XGetopt.h0000644000175000017500000000112510325372102020376 0ustar numanuma// XGetopt.h // // Author: Hans Dietrich // hdietrich2@hotmail.com // // This software is released into the public domain. // You are free to use it in any way you like. // // This software is provided "as is" with no expressed // or implied warranty. I accept no liability for any // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// #ifndef XGETOPT_H #define XGETOPT_H extern int optind, opterr; extern char *optarg; int XGetopt(int argc, char *argv[], char *optstring); #endif //XGETOPT_H necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/BaseInput.h0000644000175000017500000000411210325372102020675 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Base_Input__ #define __Base_Input__ #include "math_util.h" #include #include nec_float diff(nec_float a, nec_float b) { if (a == b) return 0; if ((a < 1e-8) && (b < 1e-8)) return 0; nec_float sub = a - b; nec_float sum = a + b; nec_float ret = sub*sub; if ((a != 0) && (b != 0)) ret /= sum*sum; ret = sqrt(ret); if (ret > 1e-2) { cout << " diff(" << a << "," << b << ") = " << ret << endl; } return ret; } nec_float diff(nec_complex a, nec_complex b) { if (a == b) return 0; if ((abs(a) < 1e-8) && (abs(b) < 1e-8)) return 0; nec_float ret = norm(a - b); nec_float sum = norm(a + b); if (sum != 0) ret /= sum; ret = sqrt(ret); if (ret > 1e-2) { stringstream ss; cout << " diff(" << a << "," << b << ") = " << ret << endl; } return ret; } class BaseInput { public: BaseInput(const std::string& filename) : m_filename(filename), m_stream(filename.c_str()) { } private: char linec[512]; protected: std::string m_filename; std::ifstream m_stream; string readline() { m_stream.getline(&linec[0],512); return string(&linec[0]); } double read_sci(std::istream& is) { double x; is.setf(ios_base::skipws); is >> x; return x; } double read_fixed(std::istream& is) { double x; is.setf(ios_base::skipws); is >> x; return x; } }; #endif /* __Base_Input__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_structure_currents.cpp0000644000175000017500000003316410325372102024161 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_structure_currents.h" #include "nec_context.h" nec_structure_currents::nec_structure_currents(nec_context * in_context, char * in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6) { m_context = in_context; m_geometry = m_context->m_geometry; pattype = in_pattype; iptflg = m_context->iptflg; iptflq = m_context->iptflq; iptag = m_context->iptag; iptagf = m_context->iptagf; iptagt = m_context->iptagt; iptaq = m_context->iptaq; iptaqf = m_context->iptaqf; iptaqt = m_context->iptaqt; nload = in_nload; xpr3 = in_xpr3; xpr6 = in_xpr6; wavelength = m_context->wavelength; freq_mhz = m_context->freq_mhz; structure_power_loss=0; current_nb_elements = 0; q_density_nb_elements = 0; patch_nb_elements = 0; } void nec_structure_currents::analyze() { int jump; nec_float cmag; nec_complex curi; nec_float fr; nec_complex eth, eph, ex, ey, ez; if (m_geometry->n != 0) { if (iptflg!= -1) { int itmp1=0; jump= iptflg+1; for (int i = 0; i < m_geometry->n; i++ ) { curi= m_context->current_vector[i]* wavelength; cmag= abs(curi); if ( (nload != 0) && (fabs(real(m_context->zarray[i])) >= 1.e-20) ) structure_power_loss += 0.5*cmag*cmag*real( m_context->zarray[i]) * m_geometry->segment_length[i]; if ( jump == 0) continue; if ( jump > 0 ) { if ( (iptag != 0) && (m_geometry->segment_tags[i] != iptag) ) continue; itmp1++; if ( (itmp1 < iptagf) || (itmp1 > iptagt) ) continue; if ( iptflg != 0) { if ( iptflg >= 2 ) { m_context->fnorm[m_context->get_inc()-1]= cmag; m_context->set_isave(i+1); } if ( iptflg != 3) { /*m_output.nec_printf(" %7.2f %7.2f %11.4E %7.2f %5d", xpr1, xpr2, cmag, ph, i+1 );*/ current_nb_elements++; _current_theta.push_back(m_context->get_xpr1()); _current_phi.push_back(m_context->get_xpr2()); _current.push_back(curi); _current_segment_number.push_back(i+1); continue; } } /* if ( iptflg != 0) */ else /* iptflg == 0, only the currents specified will be printed, using the standard format*/ { /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ current_nb_elements++; _current_segment_number.push_back(i+1); _current_segment_tag.push_back(m_geometry->segment_tags[i]); _current_segment_center_x.push_back(m_geometry->x[i]); _current_segment_center_y.push_back(m_geometry->y[i]); _current_segment_center_z.push_back(m_geometry->z[i]); _current_segment_length.push_back(m_geometry->segment_length[i]); _current.push_back(curi); // added test for plot_card.is_valid() if (m_context->plot_card.is_valid() && m_context->plot_card.currents()) { m_context->plot_card.plot_complex(curi); m_context->plot_card.plot_endl(); } } /* iptflg == 0, only the currents specified will be printed, using the standard format*/ } else /* iptflg == -2, all currents will be printed, using the standard format*/ { /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ current_nb_elements++; _current_segment_number.push_back(i+1); _current_segment_tag.push_back(m_geometry->segment_tags[i]); _current_segment_center_x.push_back(m_geometry->x[i]); _current_segment_center_y.push_back(m_geometry->y[i]); _current_segment_center_z.push_back(m_geometry->z[i]); _current_segment_length.push_back(m_geometry->segment_length[i]); _current.push_back(curi); // added test for plot_card.is_valid() if (m_context->plot_card.is_valid() && m_context->plot_card.currents()) { m_context->plot_card.plot_complex(curi); m_context->plot_card.plot_endl(); } } /* iptflg == -2, all currents will be printed, using the standard format*/ } /* for( i = 0; i < n; i++ ) */ m_context->structure_power_loss = structure_power_loss; }/* if (iptflg != -1) */ if (iptflq != -1) { int itmp1 = 0; fr = 1.e-6/(freq_mhz); for(int i = 0; i < m_geometry->n; i++ ) { if ( iptflq != -2 ) { if ( (iptaq != 0) && (m_geometry->segment_tags[i] != iptaq) ) continue; itmp1++; if ( (itmp1 < iptaqf) || (itmp1 > iptaqt) ) continue; } /* if ( iptflq == -2) */ nec_complex curi = fr * nec_complex(- m_context->bii[i], m_context->bir[i]); /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %9.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ q_density_nb_elements++; _q_density_segment_number.push_back(i+1); _q_density_segment_tag.push_back(m_geometry->segment_tags[i]); _q_density_segment_center_x.push_back(m_geometry->x[i]); _q_density_segment_center_y.push_back(m_geometry->y[i]); _q_density_segment_center_z.push_back(m_geometry->z[i]); _q_density_segment_length.push_back(m_geometry->segment_length[i]); _q_density.push_back(curi); } /* for(int i = 0; i < m_geometry->n; i++ ) */ } /* if (iptflq != -1) */ } /* if (m_geometry->n != 0) */ if (m_geometry->m != 0) { int j = m_geometry->n-3; int itmp1 = -1; for(int i = 0; i < m_geometry->m; i++ ) { j += 3; itmp1++; ASSERT(itmp1 == i); ex= m_context->current_vector[j]; ey= m_context->current_vector[j+1]; ez= m_context->current_vector[j+2]; eth= ex* m_geometry->t1x[itmp1]+ ey* m_geometry->t1y[itmp1]+ ez* m_geometry->t1z[itmp1]; eph= ex* m_geometry->t2x[itmp1]+ ey* m_geometry->t2y[itmp1]+ ez* m_geometry->t2z[itmp1]; /*m_output.nec_printf( " %4d %7.3f %7.3f %7.3f %11.4E " "%8.2f %11.4E %8.2f" " %9.2E %9.2E %9.2E %9.2E %9.2E %9.2E", i+1, m_geometry->px[itmp1], m_geometry->py[itmp1], m_geometry->pz[itmp1], ethm, etha, ephm, epha, real(ex), imag(ex), real(ey), imag(ey), real(ez), imag(ez));*/ patch_nb_elements++; _patch_number.push_back(i+1); _patch_center_x.push_back(m_geometry->px[itmp1]); _patch_center_y.push_back(m_geometry->py[itmp1]); _patch_center_z.push_back(m_geometry->pz[itmp1]); _patch_tangent_vector1.push_back(eth); _patch_tangent_vector2.push_back(eph); _patch_e_x.push_back(ex); _patch_e_y.push_back(ey); _patch_e_z.push_back(ez); m_context->plot_card.plot_currents(ex,ey,ez); } /* for( i=0; im != 0) */ } void nec_structure_currents::write_to_file_aux(ostream& os) { output_helper oh(os,_result_format); if ( m_geometry->n != 0) { if ( iptflg != -1) { if ( iptflg <= 0) { os << endl << endl << endl; os << " -------- CURRENTS AND LOCATION --------" << endl; os << " DISTANCES IN WAVELENGTHS" << endl; os << endl; os << " SEG TAG COORDINATES OF SEGM CENTER SEGM ------------- CURRENT (AMPS) -------------" << endl; os << " No: No: X Y Z LENGTH REAL IMAGINARY MAGN PHASE" << endl; for(int i=0; iget_inc() <= 1) { os << endl << endl << endl; os << " -------- RECEIVING PATTERN PARAMETERS --------" << endl; os << " ETA: "; oh.real_out(7,2,xpr3,false); os << " DEGREES" << endl; os << " TYPE: "; oh.string_out(6, pattype); os << endl; os << " AXIAL RATIO: "; oh.real_out(6,3,xpr6,false); os << endl << endl; os << " THETA PHI ----- CURRENT ---- SEG" << endl; os << " (DEG) (DEG) MAGNITUDE PHASE No:" << endl; } int i = current_nb_elements-1; oh.start_record(); oh.padding(" "); oh.real_out(7, 2, _current_theta[i], false); oh.separator(); oh.real_out(7, 2, _current_phi[i], false); oh.separator(); oh.padding(" "); oh.real_out(11,4, abs(_current[i]), true); oh.separator(); oh.padding(" "); oh.real_out(7,2, arg_degrees(_current[i]), false); oh.separator(); oh.padding(" "); oh.int_out(5, _current_segment_number[i]); oh.separator(); oh.end_record(); } /* if ( iptflg <= 0) */ } /* if ( iptflg != -1) */ if ( iptflq != -1) { os << endl << endl << endl; os << " ------ CHARGE DENSITIES ------" << endl; os << " DISTANCES IN WAVELENGTHS" << endl << endl; os << " SEG TAG COORDINATES OF SEG CENTER SEG CHARGE DENSITY (COULOMBS/METER)" << endl; os << " NO: NO: X Y Z LENGTH REAL IMAGINARY MAGN PHASE" << endl; for(int i=0; i< q_density_nb_elements; i++) { oh.start_record(); oh.padding(" "); oh.int_out(5, _q_density_segment_number[i]); oh.separator(); oh.int_out(4, _q_density_segment_tag[i]); oh.separator(); oh.real_out(9, 4,_q_density_segment_center_x[i], false); oh.separator(); oh.real_out(9, 4, _q_density_segment_center_y[i], false); oh.separator(); oh.real_out(9, 4, _q_density_segment_center_z[i], false); oh.separator(); oh.real_out(9, 5, _q_density_segment_length[i], false); oh.separator(); oh.real_out(11,4, real(_q_density[i]), true); oh.separator(); oh.real_out(11,4, imag(_q_density[i]), true); oh.separator(); oh.real_out(11,4, abs(_q_density[i]), true); oh.separator(); oh.real_out(9,3, arg_degrees(_q_density[i]), false); oh.separator(); oh.end_record(); } } } /*if ( m_geometry->n != 0) */ if ( m_geometry->m != 0) { os << endl << endl << endl; os << " --------- SURFACE PATCH CURRENTS ---------" << endl; os << " DISTANCE IN WAVELENGTHS" << endl; os << " CURRENT IN AMPS/METER" << endl << endl; os << " --------- SURFACE COMPONENTS --------"; os << " ---------------- RECTANGULAR COMPONENTS ----------------" << endl; os << " PCH --- PATCH CENTER --- TANGENT VECTOR 1 TANGENT VECTOR 2"; os << " ------- X ------ ------- Y ------ ------- Z ------" << endl; os << " No: X Y Z MAG. PHASE MAG. PHASE"; os << " REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY" << endl; for(int i=0; im != 0) */ } /* write_to_file_aux */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/matrix_algebra.h0000644000175000017500000000302010325372102021761 0ustar numanuma#ifndef __matrix_algebra__ #define __matrix_algebra__ /* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math_util.h" #include "nec_output.h" void lu_decompose(nec_output_file& s_output, int n, complex_array& a, int_array& ip, int ndim); void factrs(nec_output_file& s_output, int np, int nrow, complex_array& a, int_array& ip ); void solve( int n, complex_array& a, int_array& ip, complex_array& b, int ndim ); void solves(complex_array& a, int_array& ip, complex_array& b, int neq, int nrh, int np, int n, int mp, int m, int nop, complex_array& symmetry_array); /* Do some simple tests for integration convergence */ void test(nec_float f1r, nec_float f2r, nec_float *tr, nec_float f1i, nec_float f2i, nec_float *ti, nec_float dmin); nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin ); #endif /* __matrix_algebra__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_plot_card.h0000644000175000017500000000507610325372102021266 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_plot_card__ #define __c_plot_card__ #include "math_util.h" #include #include /*! All the logic for handling the plot card is contained in this class. There appear to be many variants of the PL card. I am using the documentation below as a guide. \verbatim PL PLOT DATA STORAGE I1- 0=NO STORE, 1=CURRENTS, 2=NEAR FIELD, 3=PATTERNS I2(1,2)- 0=NO, 1=REAL,IMAG, 3=MAG, PHASE I2(3)- 1=TH, 2=PHI, 3=RHO ANGLES I3(1)- 0=N0, 1=IX, 2=IY, 3=IZ, 4=IX IY IZ I3(2)- 0-N0, 1=X, 2=Y, 3=Z, 4=X Y Z, 5=TOTAL COMPONENT I3(3)- 0=NO, 1=TH, 2=PHI, 3=RHO E-FIELD COMPOMENT I4(1)- BLANK I4(2)- 1=X, 2=Y, 3=Z CORDINATE VALUES I4(3)- 1=V, 2=H, 3=TOTAL, 4=V H T GAINS DB \endverbatim */ class c_plot_card { public: c_plot_card(); c_plot_card(const c_plot_card& p); c_plot_card(int itmp1, int itmp2, int itmp3, int itmp4, std::string& filename); virtual ~c_plot_card(); bool is_valid() const; bool storing() const; bool currents() const; bool near_field() const ; bool patterns() const; bool realimag() const; bool magphase() const; void set_plot_real_imag_currents(); void plot_endl() const; void plot_double(double x) const; void plot_complex(nec_complex x) const; void plot_complex_2d(nec_complex x, nec_complex y, nec_complex z) const; void plot_currents(nec_complex ex, nec_complex ey, nec_complex ez) const; void plot_segments(int i, real_array& x, real_array& y, real_array& z, real_array& si, double xw2, double yw2, real_array& bi, int_array& icon1, int_array& icon2) const; void plot_fields( nec_complex ex, nec_complex ey, nec_complex ez, double xob, double yob, double zob); void plot_patterns(double theta, double phi, nec_complex e_theta, nec_complex e_phi, double g_vert, double g_horiz, double g_tot); private: int p1, p2, p3, p4; FILE* plot_fp; }; #endif /* __c_plot_card__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_ground.cpp0000644000175000017500000000753210325372102021472 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math_util.h" #include "nec_exception.h" /* \section{NEC Ground Specification} \subsection{the GN Card} The GN card 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. The parameters of the second medium can also be specified on another data card whose mnemonic is GD. With the GD card, the parameters of the second medium can be varied and only the radiated fields need to be recalculated. Furthermore, if a radial wire ground screen has been specified on the GN card, the GD card is the only way to include a second medium. See Section~\ref{sec_card_gd} for details. \subsection{"gd" card: ground representation} \label{sec_card_gd} To specify the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the fields of surface patches. < */ #include "nec_ground.h" #include "nec_output.h" #include "misc.h" // for stop() function /* Parse a GN card. The input parameters here are the fields of the GN card. GN NEAR GROUND, GROUND SCREEN, ADDED GROUND I1- -1=SET FREE SPACE (A), 0=REFL COEFF, 1=IDEAL (B), 2-SOMMERFIELD I2- (A) BLANK), NO WIRES IN GND SCREEN (C), 0= NO WIRES (D) I3- BLANK I4- BLANK F1- (A,B) BLANK, DIELECTRIC OF NEAR GROUND F2- (A,B) BLANK, CONDUCTIVITY OF NEAR GROUND F3- (A,B) BLANK, (C) RADIUS OF SCREEN, (D) DIELECTRIC 2ND MEDIUM F4- (A,B) BLANK, (C) RADII SCREEN WIRES, (D) CONDUCT. 2ND MEDIUM F5- (A,B) BLANK, (C) BLANK, (D) DIST TO 2ND MEDIUM, SEE RP F6- (A,B) BLANK, (C) BLANK, (D) HEIGHT 2ND MEDIUM (AS IN GD) */ void nec_ground::parse_gn(int itmp1, int itmp2, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6 ) { // iperf = -1 - nullifies ground parameters previously used and sets free- space condition. // The remainder of the card is left blank in this case. if ( itmp1 == -1 ) // nullify previous ground conditions. { ksymp=1; radial_wire_count=0; iperf=0; return; } iperf = itmp1; ASSERT(iperf >= 0); radial_wire_count = itmp2; ksymp = 2; epsr = tmp1; sig = tmp2; if (radial_wire_count != 0) { if ( iperf == 2) { throw new nec_exception("RADIAL WIRE G.S. APPROXIMATION MAY NOT BE USED WITH SOMMERFELD GROUND OPTION"); } radial_wire_length= tmp3; radial_wire_radius= tmp4; return; } setup_cliff(tmp3,tmp4,tmp5,tmp6); } /* Setup a cliff (two medium ground) */ void nec_ground::setup_cliff(nec_float in_eprs2, nec_float in_sig2, nec_float clt, nec_float cht) { cliff_edge_distance = clt; cliff_height = cht; epsr2 = in_eprs2; sig2 = in_sig2; } using namespace std; nec_complex nec_ground::get_zrati2(nec_float wavelength) { return sqrt(1.0 / nec_complex(epsr2,-sig2 * wavelength * 59.96)); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_radiation_pattern.h0000644000175000017500000001346010325372102023345 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_radiation_pattern__ #define __nec_radiation_pattern__ #include "nec_results.h" #include "math_util.h" #include "nec_ground.h" #include "c_plot_card.h" /** \brief The types of polarization that gain normalization should be done with */ enum polarization_norm { POL_MAJOR_AXIZ=1, POL_MINOR_AXIS=2, POL_VERTICAL=3, POL_HORIZONTAL=4, POL_TOTAL=5 }; class nec_context; class nec_radiation_pattern : public nec_base_result { public: // Radiation Pattern nec_radiation_pattern(int in_n_theta, int in_n_phi, nec_float in_theta_start, nec_float in_phi_start, nec_float in_delta_theta, nec_float in_delta_phi, nec_float in_range, nec_ground& in_ground, int in_ifar, nec_float in_wavelength, nec_float pinr, nec_float pnlr, int in_rp_output_format, int in_rp_normalization, int in_rp_ipd, int in_rp_power_average, nec_float in_gnor, c_plot_card& in_plot_card); virtual void write_to_file(ostream& os) { write_to_file_aux(os); } virtual enum nec_result_type get_result_type() { return RESULT_RADIATION_PATTERN; } void analyze(nec_context* in_context); void write_gain_normalization() { if (_ifar != 1) { nec_float norm = get_maximum_gain_db(); printf("Max Gain: %f\n",norm); } } /*Added for the python wrapping : some basic access functions...*/ real_array get_gain() { return _gain; } real_array get_gain_vert() { return _power_gain_vert; } real_array get_gain_horiz() { return _power_gain_horiz; } real_array get_gain_tot() { return _power_gain_tot; } real_array get_pol_axial_ratio() { return _polarization_axial_ratio; } real_array get_pol_tilt() { return _polarization_tilt; } int_array get_pol_sense_index() { return _polarization_sense_index; } complex_array get_e_theta() { return _e_theta; } complex_array get_e_phi() { return _e_phi; } complex_array get_e_r() { return _e_r; } nec_float get_normalization_factor() { return get_gain_normalization_factor(m_rp_gnor); } nec_float get_average_power_gain() { return _average_power_gain; } nec_float get_average_power_solid_angle() { return _average_power_solid_angle; } nec_ground get_ground() { return m_ground; } nec_float get_range() { return m_range; } nec_float get_wavelength() { return _wavelength; } nec_float get_delta_theta() { return delta_theta; } nec_float get_theta_start() { return m_theta_start; } nec_float get_delta_phi() { return delta_phi; } nec_float get_phi_start() { return m_phi_start; } int get_ifar() { return _ifar; } int get_rp_normalization() { return m_rp_normalization; } int get_rp_output_format() { return m_rp_output_format; } int get_rp_power_average() { return m_rp_power_average; } int get_rp_ipd() { return m_rp_ipd; } /*End of access functions added for the wrapping*/ nec_float get_maximum_gain_db() { return get_gain_normalization_factor(0); } /*! \brief Get the theta angle corresponding to the theta_index */ nec_float get_theta(int theta_index) const { return (m_theta_start + delta_theta*theta_index); } /*! \brief Get the number of theta angles */ int get_ntheta() const { return (n_theta); } /*! \brief Get the phi angle corresponding to the phi_index */ nec_float get_phi(int phi_index) const { return (m_phi_start + delta_phi*phi_index); } /*! \brief Get the number of phi angles */ int get_nphi() const { return (n_phi); } /*! \brief Get a total power gain from the radiation pattern */ nec_float get_power_gain(int theta_index, int phi_index) const { return _gain[get_index(theta_index, phi_index)]; } /*! \brief Get a power gain (vertical) from the radiation pattern */ nec_float get_power_gain_vert(int theta_index, int phi_index) const { return _power_gain_vert[get_index(theta_index, phi_index)]; } /*! \brief Get a power gain (horizontal) from the radiation pattern */ nec_float get_power_gain_horiz(int theta_index, int phi_index) const { return _power_gain_horiz[get_index(theta_index, phi_index)]; } private: int get_index(int theta_index, int phi_index) const; bool m_analysis_done; int n_theta, n_phi; nec_float m_theta_start, delta_theta; nec_float m_phi_start, delta_phi; int _ifar; nec_float m_range; nec_float _wavelength; nec_float _pinr; nec_float _pnlr; nec_float _average_power_gain; nec_float _average_power_solid_angle; nec_float _maximum_gain; int m_rp_normalization; int m_rp_output_format; int m_rp_power_average; int m_rp_ipd; nec_float m_rp_gnor; real_array _gain; real_array _power_gain_vert; real_array _power_gain_horiz; real_array _power_gain_tot; real_array _polarization_axial_ratio; real_array _polarization_tilt; int_array _polarization_sense_index; complex_array _e_theta; complex_array _e_phi; complex_array _e_r; void write_to_file_aux(ostream& os); nec_float get_gain_normalization_factor(nec_float gnor); void write_normalized_gain(ostream& os); nec_ground m_ground; c_plot_card m_plot_card; }; #endif /* __nec_radiation_pattern__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_exception.h0000644000175000017500000000517610325372102021641 0ustar numanuma/*************************************************************************** * Copyright (C) 2004 by Tim Molteno,,, * * tim@cyberiad * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef __nec_exception__ #define __nec_exception__ #include #include class nec_exception { public: nec_exception() { } nec_exception(const char* message) { m_message << message; } nec_exception(const char* message, int code) { m_message << message << code; } void append(const char* message) { m_message << message; } void append(const int i) { m_message << i; } std::string get_message() { std::string ret = m_message.str(); return ret; } static std::string string_printf(const char* fmt, ...); protected: std::stringstream m_message; }; #ifdef _MSC_VER /* Visual C++ does not allow macros with variable argument lists. Therefore error messages will be meaningless when this is compiled using VC++, however at least it will compile! */ inline void nec_stop(const char* __fmt, ...) { nec_exception* __nex = new nec_exception("Undefined Error"); // __nex->os_printf(__fmt, __VA_ARGS__); throw __nex; } #else #define nec_stop(__fmt, ...)\ { nec_exception* __nex = new nec_exception();\ std::string _mess = nec_exception::string_printf(__fmt, __VA_ARGS__); \ __nex->append(_mess.c_str()); \ throw __nex; \ } #endif #endif /* __nec_exception__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/libnecpp.h0000644000175000017500000003024610325372102020606 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2005 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ /*! \file libnecpp.h \brief nec++ Library Functions. \verbatim How to use libNEC. Enter the following file into test_nec.c, and compile with gcc -o test_nec test_nec.c -lnecpp #include "libnecpp.h" #include int main(int argc, char **argv) { nec_context* nec; double gain; nec = nec_create(); nec_wire(nec, 0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); nec_wire(nec, 0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); nec_wire(nec, 0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); nec_wire(nec, 0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); nec_wire(nec, 0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); nec_geometry_complete(nec, 0, 0); nec_gn_card(nec, -1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); nec_ld_card(nec, 5,0,0,0,3.72e7,0.0,0.0); nec_pt_card(nec, -1, 0, 0, 0); nec_ex_card(nec, 1, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec_fr_card(nec, 0, 2, 2400.0, 100.0); nec_rp_card(nec, 0, 1, 1, 0,5,0,0, 90.0, 90.0, 0.0, 0.0, 0.0, 0.0); gain = nec_get_maximum_gain(nec); nec_delete(nec); printf("Gain is %f",gain); return 0; } \endverbatim */ #ifndef __libnecpp__ #define __libnecpp__ /*! A Struct to represent the nec_context class.*/ #ifdef __cplusplus class nec_context; #else struct nec_context; typedef struct nec_context nec_context; #endif #ifdef __cplusplus extern "C" { #endif /*! \brief Construct and initialize an nec_context */ nec_context* nec_create(); /*!\brief Delete an nec_context object. */ long nec_delete(nec_context* in_context); /*!\brief Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. */ long nec_benchmark(); /* Geometry description functions. */ void nec_wire(nec_context* in_context, int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad); void nec_geometry_complete(nec_context* in_context, int card_int_1, int card_int_2); /* NEC card functions. */ /*! * FR crd * @param in_context The nec_context created with nec_create() * @param in_ifrq 0 is a linear range of frequencies, 1 is a log range. * @param in_nfrq The number of frequencies * @param in_freq_mhz The starting frequency in MHz. * @param in_del_freq The frequency step (in MHz for ifrq = 0) */ void nec_fr_card(nec_context* in_context, int in_ifrq, int in_nfrq, double in_freq_mhz, double in_del_freq); void nec_ld_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3); void nec_gn_card(nec_context* in_context, int itmp1, int itmp2, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_ex_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_tl_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_nt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_xq_card(nec_context* in_context, int itmp1); void nec_gd_card(nec_context* in_context, double tmp1, double tmp2, double tmp3, double tmp4); /*! \brief Standard radiation pattern parameters \param calc_mode This 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: \arg \c 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. \arg \c 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.) \arg \c 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. \arg \c 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. \arg \c 4 - radial wire ground screen centered at origin. \arg \c 5 - both radial wire ground screen and linear cliff. \arg \c 6 - both radial wire ground screen ant circular cliff. \param n_theta The number of theta angles. \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 nec_rp_card() function will cause 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 nec_rp_card() function is called. \li At a single frequency, any number of nec_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 nec_fr_card() function is greater than one), only one nec_rp_card() function will act as data inside the loop. Subsequent calls to nec_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 nec_rp_card(nec_context* in_context, int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, double theta0, double phi0, double delta_theta, double delta_phi, double radial_distance, double gain_norm); void nec_pt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_pq_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_kh_card(nec_context* in_context, double tmp1); void nec_ne_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_nh_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_ek_card(nec_context* in_context, int itmp1); void nec_cp_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_pl_card(nec_context* in_context, char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4); /* Functions for getting the results from an nec_context */ double nec_get_maximum_gain(nec_context* in_context); #ifdef __cplusplus } #endif #endif /* __libnecpp__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/c_ggrid.h0000644000175000017500000000355310325372102020411 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_ggrid__ #define __c_ggrid__ #include "math_util.h" #include "common.h" #include "misc.h" #include "c_evlcom.h" using namespace std; /** This class was the old FORTRAN common block 'ggrid'. It now contains the ground grid, and methods to do the Sommerfeld stuff. */ class c_ggrid { public: static int m_nxa[3], m_nya[3]; static nec_float m_dxa[3], m_dya[3]; static nec_float m_xsa[3], m_ysa[3]; nec_complex m_epscf; complex_array m_ar1, m_ar2, m_ar3; c_evlcom m_evlcom; void initialize() { m_ar1.resize(11*10*4); m_ar2.resize(17*5*4); m_ar3.resize(9*8*4); } void interpolate( nec_float x, nec_float y, nec_complex *f1, nec_complex *f2, nec_complex *f3, nec_complex *f4 ); void sommerfeld( nec_float epr, nec_float sig, nec_float freq_mhz ); }; class c_ground_wave { public: /* common /gwav/ */ nec_float r1, r2, zmh, zph; nec_complex u, u2, xx1, xx2; void set_u(nec_complex in_u) { u = in_u; u2 = u * u; } }; void gwave( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *ezh, nec_complex *eph, c_ground_wave& ground_wave); #define CONST4 nec_complex(0.0,+188.365) #endif necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/matrix_algebra.cpp0000644000175000017500000005200410325372102022322 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math_util.h" #include using namespace std; #include "nec_exception.h" #include "matrix_algebra.h" #include "nec_output.h" #ifdef NEC_ERROR_CHECK //#define NEC_MATRIX_CHECK #endif void to_octave(nec_complex& x); void to_octave(nec_complex& x) { cout << real(x) << " + " << imag(x) << "I"; } void to_octave(int& x); void to_octave(int& x) { cout << x; } void to_octave(nec_complex* a, int n, int ndim); void to_octave(nec_complex* a, int n, int ndim) { cout << "["; for (int row = 0; row < n; row++ ) { int row_offset = row*ndim; for (int i = 0; i < n; i++ ) { to_octave(a[i+row_offset]); if (i < n-1) cout << ", "; } if (row < n-1) cout << "; "; } cout << "];" << endl; } void to_octave(complex_array& a, int n, int ndim); void to_octave(complex_array& a, int n, int ndim) { to_octave(a.get_ptr(),n,ndim); } void to_octave(int* a, int n); void to_octave(int* a, int n) { cout << "["; for (int i = 0; i < n; i++ ) { to_octave(a[i]); if (i < n-1) cout << ", "; } cout << "];" << endl; } void to_octave(int_array& a, int n); void to_octave(int_array& a, int n) { to_octave(a.get_ptr(),n); } /* Using Octave to debug this stuff. [l,u,p] = lu(a); orig = p*l*u; diff = orig .- a; sum(sum(diff)) a = [-5.47894 + 2965.96I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -2.21543 + -0.962361I, -0.795364 + -0.113862I; -2.49805 + -1034.62I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -1.01 + -0.527357I; -1.67535 + -27.5893I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -1.21709 + -1.25704I; -1.56046 + -6.58465I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -1.40441 + -2.71197I; -1.40441 + -2.71197I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -1.56046 + -6.58465I; -1.21709 + -1.25704I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -1.67535 + -27.5892I; -1.01 + -0.527357I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -2.49805 + -1034.62I; -0.795364 + -0.113862I, -2.21543 + -0.962361I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -5.47894 + 2965.96I]; solved = [-5.47894 + 2965.96I, -0.34883 + 0.00148662I, -0.00930089 + 0.00058204I, -0.00221909 + 0.000530222I, -0.000913486 + 0.000475198I, -0.000423063 + 0.000411133I, -0.000177173 + 0.000340856I, -3.7894e-05 + 0.000268234I; -5.16779 + -1625.83I, -15.1883 + 2508.51I, -0.654113 + 0.00641696I, -0.0209388 + 0.00199762I, -0.00563214 + 0.00175056I, -0.00239586 + 0.0015366I, -0.00108368 + 0.00130452I, -0.000401231 + 0.00105952I; -3.8195 + -48.9503I, -6.57291 + -1642.9I, -25.8745 + 2000.59I, -0.829723 + 0.0150408I, -0.0290603 + 0.00375449I, -0.00826549 + 0.00315121I, -0.00352744 + 0.00270246I, -0.00152297 + 0.00224776I; -3.52843 + -12.6722I, -5.06917 + -53.3655I, -8.86623 + -1660.82I, -43.5325 + 1696.62I, -0.986053 + 0.0322509I, -0.0368356 + 0.00638373I, -0.0108087 + 0.00506807I, -0.00453205 + 0.00421639I; -3.14757 + -5.34769I, -4.63435 + -14.5329I, -6.97654 + -58.4747I, -11.9718 + -1674.55I, -16.5775 + -1687.93I, -0.842565 + -0.0540462I, 0.0398738 + -0.00709961I, 0.0120791 + -0.00628218I; -2.70084 + -2.45195I, -4.09335 + -6.19899I, -6.27227 + -16.722I, -9.38065 + -62.8562I, -11.8415 + 3073.26I, -27.0157 + -1749.13I, -0.513164 + -0.118154I, 0.049591 + -0.0125818I; -2.21543 + -0.962361I, -3.47508 + -2.78436I, -5.4597 + -7.15434I, -8.24983 + -18.5785I, -5.67188 + -1626.5I, 0.575028 + 3140.29I, -34.565 + -1761.99I, -0.095149 + -0.172344I; -0.795364 + -0.113862I, -1.28761 + -0.565893I, -2.07043 + -1.61953I, -3.17657 + -4.0337I, -1.84467 + -27.7235I, -2.29644 + -1033.56I, 7.796 + 3017.51I, -403.323 + -276.157I]; [l,u,p] = lu(a); ans = (l .- eye(size(a))) .+ u; solved .- ans atlas_a = [-5.47894 + 2965.96I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -2.21543 + -0.962361I, -0.795364 + -0.113862I; -2.49805 + -1034.62I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -1.01 + -0.527357I; -1.67535 + -27.5893I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -1.21709 + -1.25704I; -1.56046 + -6.58465I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -1.40441 + -2.71197I; -1.40441 + -2.71197I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -1.56046 + -6.58465I; -1.21709 + -1.25704I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -1.67535 + -27.5892I; -1.01 + -0.527357I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -2.49805 + -1034.62I; -0.795364 + -0.113862I, -2.21543 + -0.962361I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -5.47894 + 2965.96I]; atlas_solved = [-5.47894 + 2965.96I, -0.548157 + 0.00275496I, -0.0165016 + 0.00131826I, -0.00427032 + 0.00119753I, -0.000825012 + 0.000912136I, -0.000323087 + 0.00074755I, -3.7894e-05 + 0.000268234I, -0.00180105 + 0.00106456I; -2.49805 + -1034.62I, -15.1883 + 2508.51I, -0.65489 + 0.00658541I, -0.0212608 + 0.00214951I, -0.00246121 + 0.00164669I, -0.00110154 + 0.00139199I, -0.000222473 + 0.000514644I, -0.00578205 + 0.00188246I; -1.67535 + -27.5893I, -6.16215 + -1640.95I, -25.8745 + 2000.59I, -0.82997 + 0.0151662I, -0.00831659 + 0.00324278I, -0.00354023 + 0.00277484I, -0.00079601 + 0.0010452I, -0.0291788 + 0.00386463I; -1.56046 + -6.58465I, -4.69302 + -52.5555I, -8.62173 + -1660.32I, -43.5325 + 1696.62I, -0.0368818 + 0.00647535I, -0.0108184 + 0.00514009I, -0.00232792 + 0.00193202I, -0.98616 + 0.0323595I; -1.40441 + -2.71197I, -4.30575 + -14.1549I, -6.75926 + -58.2348I, -11.7922 + -1674.36I, -16.7274 + -1688I, 0.0398818 + -0.00716753I, 0.00624829 + -0.0028398I, -0.842524 + -0.0541183I; -1.21709 + -1.25704I, -3.81819 + -6.03339I, -6.0904 + -16.6174I, -9.22723 + -62.7739I, -11.8415 + 3073.26I, -27.2273 + -1749.16I, 0.026934 + -0.00558256I, -0.513109 + -0.118254I; -1.01 + -0.527357I, -3.25593 + -2.73825I, -5.31524 + -7.12687I, -8.12807 + -18.5589I, -5.66889 + -1626.5I, 0.685432 + 3140.3I, -15.4618 + -1109.08I, -0.152662 + -0.272982I; -0.795364 + -0.113862I, -2.65173 + -1.02258I, -4.45744 + -3.105I, -6.95632 + -7.87272I, -4.18315 + -49.2046I, -4.79308 + -1623.94I, 3.84241 + 3009.97I, -643.167 + -435.236I]; [l,u,p] = lu(atlas_a'); atlas_ans = (l .- eye(size(atlas_a))) .+ u; atlas_solved' .- ans */ #ifndef ATLAS /* Subroutine to factor a matrix into a unit lower triangular matrix and an upper triangular matrix using the Gauss-Doolittle algorithm presented on pages 411-416 of A. Ralston -- a first course in numerical analysis. Comments below refer to comments in Ralstons text. (matrix transposed.) */ void lu_decompose(nec_output_file& s_output, int n, complex_array& a, int_array& ip, int ndim) { DEBUG_TRACE("lu_decompose(" << n << "," << ndim << ")"); #ifdef NEC_MATRIX_CHECK // Debug output to try and figure out the LAPACK stuff cout << "a = "; to_octave(a,n,ndim); #endif /* Allocate scratch memory */ complex_array scm; scm.resize(n); /* Un-transpose the matrix for Gauss elimination */ for (int i = 1; i < n; i++ ) { int i_offset = i * ndim; int j_offset = 0; for (int j = 0; j < i; j++ ) { nec_complex aij = a[i+j_offset]; a[i+j_offset] = a[j+i_offset]; a[j+i_offset] = aij; j_offset += ndim; } } bool iflg=false; /* step 1 */ for (int r = 0; r < n; r++ ) { int r_offset = r*ndim; for (int k = 0; k < n; k++ ) scm[k]= a[k+r_offset]; /* steps 2 and 3 */ int rm1 = r; for (int j = 0; j < rm1; j++ ) { int pj= ip[j]-1; nec_complex arj = scm[pj]; a[j+r_offset]= arj; scm[pj]= scm[j]; int jp1 = j+1; int j_offset = j*ndim; for (int i = jp1; i < n; i++ ) scm[i] -= a[i+j_offset]* arj; } /* step 4 */ nec_float dmax = norm(scm[r]); int rp1 = r+1; ip[r]= rp1; for (int i = rp1; i < n; i++ ) { nec_float elmag = norm(scm[i]); if ( elmag >= dmax) { dmax = elmag; ip[r] = i+1; // set the permute array element } } if ( dmax < 1.e-10) iflg=true; int pr = ip[r]-1; a[r+r_offset] = scm[pr]; scm[pr] = scm[r]; /* step 5 */ if ( rp1 < n) { nec_complex arr = cplx_10() / a[r+r_offset]; for (int i = rp1; i < n; i++ ) a[i+r_offset]= scm[i]* arr; } if ( true == iflg ) { s_output.string("\n PIVOT("); s_output.integer(r); s_output.string(")= "); s_output.real(dmax); iflg=false; } } /* for( r=0; r < n; r++ ) */ #ifdef NEC_MATRIX_CHECK cout << "solved = "; to_octave(a,n,ndim); cout << "ip = "; to_octave(ip,n); #endif } #else /* ATLAS */ /* Subroutine to factor a matrix into a unit lower triangular matrix and an upper triangular matrix using ATLAS (matrix transposed.) zgetrf computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges. The factorization has the form A = P * L * U where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n), and U is upper triangular (upper trapezoidal if m < n). This is the right-looking Level 3 BLAS version of the algo- rithm. int clapack_zgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void *A, const int lda, int *ipiv); CblasRowMajor assumes we are storing A in C style CblasColMajor assume we are storing A in FORTRAN style A (input/output) On entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. ipiv (output) INTEGER array, dimension (min(M,N)) The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i). input parameters ndim actual full matrix dimension n dimension of submatrix to be factored a_in[ndim,ndim] The full input matrix ip[ndim] The pivot points */ extern "C" { #include #include } void lapack_test(); void lapack_test() { /* test_a = [1 + 0I, 2 + 0I; 3 + 0I, 4 + 0I]; test_ans = [2 + 0I, 0.5 + 0I; 4 + 0I, 1 + 0I]; piv = [1,1]; We need to use the transpose operator here since we are storing the matrix as column major [l,u,p] = lu(test_a'); ans = (l .- eye(size(test_a))) .+ u; We also compare to the transpose as the result matrix is in column major order as well test_ans' .- ans */ complex_array A(4); int_array piv(2); { A[0] = 3; A[1] = 1; A[2] = 4; A[3] = 2; cout << "test_a = "; to_octave(A,2,2); // Now call the LAPACK LU-Decomposition int info = clapack_zgetrf (CblasColMajor, 2, 2, (void*) A.get_ptr(), 2, piv.get_ptr()); std::cout << "CblasColMajor: " << info << " : " << endl; cout << "test_ans = "; to_octave(A,2,2); std::cout << "piv = "; to_octave(piv,2); } } /*! Use lapack to perform LU decomposition */ void lu_decompose(nec_output_file& s_output, int n, complex_array& a_in, int_array& ip, int ndim) { DEBUG_TRACE("factor_lapack(" << n << "," << ndim << ")"); ASSERT(n <= ndim); #ifdef NEC_MATRIX_CHECK lapack_test(); cout << "atlas_a = "; to_octave(a_in,n,ndim); #endif // copy the input matrix a_in into a temporary array. // transposing as we go... Should use cblas_zgemm... complex_array A(n,n); int_array piv(n); /* Un-transpose the matrix for Gauss elimination */ for (int row = 0; row < n; row++ ) { int row_start = row * ndim; for (int col = 0; col < n; col++ ) { A.set_col_major(n,col,row,a_in[col + row_start]); } } int lead_dim = std::max(1, n); // Now call the LAPACK LU-Decomposition int info = clapack_zgetrf (CblasColMajor, n, n, (void*) A.get_ptr(), lead_dim, piv.get_ptr()); if (0 != info) { /* The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. */ nec_exception* nex = new nec_exception("nec++: LU Decomposition Failed: "); nex->append(info); throw nex; } /* IPIV (output) INTEGER array, dimension (min(M,N)) The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i). */ for (int j = 0; j < n; j++ ) { ip[j] = piv[j] + 1; } // copy the output back into the a_in array. for (int row = 0; row < n; row++ ) { int row_start = row*ndim; for (int col = 0; col < n; col++ ) { a_in[row_start + col] = A.get_col_major(n,col,row); } } #ifdef NEC_MATRIX_CHECK cout << "atlas_solved = "; to_octave(a_in,n,ndim); cout << "atlas_ip = "; to_octave(ip,n); #endif } #endif /* ATLAS */ /*-----------------------------------------------------------------------*/ /* factrs For symmetric structure, transforms submatricies to form matricies of the symmetric modes and calls routine to LU decompose matricies. If no symmetry [nrow = np], the routine is called to LU decompose the complete matrix. */ void factrs(nec_output_file& s_output, int np, int nrow, complex_array& a, int_array& ip ) { DEBUG_TRACE("factrs(" << np << "," << nrow << ")"); if (nrow == np) // no symmetry { lu_decompose(s_output, np, a, ip, nrow ); return; } int num_symmetric_modes = nrow / np; DEBUG_TRACE("\tnum_symmetric_modes = " << num_symmetric_modes); for (int mode = 0; mode < num_symmetric_modes; mode++ ) { int mode_offset = mode * np; complex_array a_temp = a.sub_array(mode_offset); int_array ip_temp = ip.sub_array(mode_offset); lu_decompose(s_output, np, a_temp, ip_temp, nrow ); } } /*-----------------------------------------------------------------------*/ /*! \brief Subroutine to solve the matrix equation lu*x=b where l is a unit lower triangular matrix and u is an upper triangular matrix both of which are stored in a. the rhs vector b is input and the solution is returned through vector b. (matrix transposed) COMPLEX*16 A,B,Y,SUM INTEGER PI COMMON /SCRATM/ Y(2*MAXSEG) DIMENSION A(NDIM,NDIM), IP(NDIM), B(NDIM) C C FORWARD SUBSTITUTION C DO 3 I=1,N PI=IP(I) Y(I)=B(PI) B(PI)=B(I) IP1=I+1 IF (IP1.GT.N) GO TO 2 DO 1 J=IP1,N B(J)=B(J)-A(J,I)*Y(I) 1 CONTINUE 2 CONTINUE 3 CONTINUE C C BACKWARD SUBSTITUTION C DO 6 K=1,N I=N-K+1 SUM=(0.,0.) IP1=I+1 IF (IP1.GT.N) GO TO 5 DO 4 J=IP1,N SUM=SUM+A(I,J)*B(J) 4 CONTINUE 5 CONTINUE B(I)=(Y(I)-SUM)/A(I,I) 6 CONTINUE RETURN END */ void solve( int n, complex_array& a, int_array& ip, complex_array& b, int ndim ) { DEBUG_TRACE("solve(" << n << "," << ndim << ")"); /* We should use zgetrs from LAPACK to solve this. */ complex_array y(n); /* forward substitution */ for (int i = 0; i < n; i++ ) { int pivot_index = ip[i]-1; y[i]= b[pivot_index]; b[pivot_index]= b[i]; int ip1= i+1; int i_offset = i*ndim; for (int j = ip1; j < n; j++ ) b[j] -= a[j+i_offset] * y[i]; } /* backward substitution */ for (int k = 0; k < n; k++ ) { int i= n-k-1; nec_complex sum(cplx_00()); int ip1= i+1; for (int j = ip1; j < n; j++ ) sum += a[i+j*ndim]* b[j]; b[i] = (y[i]- sum) / a[i+i*ndim]; } } /* Subroutine solves, for symmetric structures, handles the transformation of the right hand side vector and solution of the matrix eq. */ void solves(complex_array& a, int_array& ip, complex_array& b, int neq, int nrh, int np, int n, int mp, int m, int nop, complex_array& symmetry_array ) { DEBUG_TRACE("solves(" << neq << "," << nrh << "," << np << "," << n << ")"); int ic, i, kk, ia, ib, j, k; nec_complex sum; /* Allocate to scratch memory */ complex_array scm; scm.resize(n + 2*m); int npeq= np+ 2*mp; nec_float fnop = nop; nec_float fnorm = 1.0/ fnop; int nrow= neq; if ( nop != 1) { for( ic = 0; ic < nrh; ic++ ) { if ( (n != 0) && (m != 0) ) { for( i = 0; i < neq; i++ ) scm[i]= b[i+ic*neq]; kk=2* mp; ia= np-1; ib= n-1; j= np-1; for( k = 0; k < nop; k++ ) { if ( k != 0 ) { for( i = 0; i < np; i++ ) { ia++; j++; b[j+ic*neq]= scm[ia]; } if ( k == (nop-1) ) continue; } /* if ( k != 0 ) */ for( i = 0; i < kk; i++ ) { ib++; j++; b[j+ic*neq]= scm[ib]; } } /* for( k = 0; k < nop; k++ ) */ } /* if ( (n != 0) && (m != 0) ) */ /* transform matrix eq. rhs vector according to symmetry modes */ for( i = 0; i < npeq; i++ ) { for( k = 0; k < nop; k++ ) { ia= i+ k* npeq; scm[k]= b[ia+ic*neq]; } sum= scm[0]; for( k = 1; k < nop; k++ ) sum += scm[k]; b[i+ic*neq]= sum* fnorm; for( k = 1; k < nop; k++ ) { ia= i+ k* npeq; sum= scm[0]; for( j = 1; j < nop; j++ ) sum += scm[j]* conj( symmetry_array[k+j*nop]); b[ia+ic*neq]= sum* fnorm; } } /* for( i = 0; i < npeq; i++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ } /* if ( nop != 1) */ /* solve each mode equation */ for( kk = 0; kk < nop; kk++ ) { ia= kk* npeq; ib= ia; for( ic = 0; ic < nrh; ic++ ) { complex_array a_sub = a.sub_array(ib); complex_array b_sub = b.sub_array(ia+ic*neq); int_array ip_sub = ip.sub_array(ia); solve( npeq, a_sub, ip_sub, b_sub, nrow ); } } /* for( kk = 0; kk < nop; kk++ ) */ if ( nop == 1) { return; } /* inverse transform the mode solutions */ for( ic = 0; ic < nrh; ic++ ) { for( i = 0; i < npeq; i++ ) { for( k = 0; k < nop; k++ ) { ia= i+ k* npeq; scm[k]= b[ia+ic*neq]; } sum= scm[0]; for( k = 1; k < nop; k++ ) sum += scm[k]; b[i+ic*neq]= sum; for( k = 1; k < nop; k++ ) { ia= i+ k* npeq; sum= scm[0]; for( j = 1; j < nop; j++ ) sum += scm[j]* symmetry_array[k+j*nop]; b[ia+ic*neq]= sum; } } /* for( i = 0; i < npeq; i++ ) */ if ( (n == 0) || (m == 0) ) continue; for( i = 0; i < neq; i++ ) scm[i]= b[i+ic*neq]; kk=2* mp; ia= np-1; ib= n-1; j= np-1; for( k = 0; k < nop; k++ ) { if ( k != 0 ) { for( i = 0; i < np; i++ ) { ia++; j++; b[ia+ic*neq]= scm[j]; } if ( k == nop) continue; } /* if ( k != 0 ) */ for( i = 0; i < kk; i++ ) { ib++; j++; b[ib+ic*neq]= scm[j]; } } /* for( k = 0; k < nop; k++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ } /*-----------------------------------------------------------------------*/ /* test for convergence in numerical integration */ void test( nec_float f1r, nec_float f2r, nec_float *tr, nec_float f1i, nec_float f2i, nec_float *ti, nec_float dmin ) { static nec_float _min_val = 1.0e-37; /* { double den; den= fabs( f2r); *tr= fabs( f2i); if( den < *tr) den= *tr; if( den < dmin) den= dmin; if( den < 1.0e-37) { *tr=0.; *ti=0.; return; } *tr= fabs(( f1r- f2r)/ den); *ti= fabs(( f1i- f2i)/ den); } */ nec_float den = fabs( f2r); nec_float temp_tr = fabs( f2i); if( den < temp_tr) den = temp_tr; if( den < dmin) den = dmin; if( den < _min_val) { *tr = 0.0; *ti = 0.0; return; } *tr= fabs((f1r - f2r)/ den); *ti= fabs((f1i - f2i)/ den); } /* Simpler test for convergence in numerical integration. This tests only one number. It is a special case of the test() function above. */ nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin ) { static nec_float _min_val = 1.0e-37; nec_float den = fabs(f2r); if( den < dmin) den = dmin; if (den < _min_val) { return 0.0; } return fabs((f1r - f2r) / den); } necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/CVS/0000755000175000017500000000000011452152141017270 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/CVS/Root0000644000175000017500000000007011452152141020133 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/CVS/Repository0000644000175000017500000000003411452152141021367 0ustar numanumanecpp/Python/PyNEC/wrap/src necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/CVS/Entries0000644000175000017500000000371211452152141020627 0ustar numanuma/AntennaInput.h/1.1/Wed Oct 19 07:22:42 2005// /BaseInput.h/1.1/Wed Oct 19 07:22:42 2005// /CurrentInput.h/1.1/Wed Oct 19 07:22:42 2005// /PowerBudget.h/1.1/Wed Oct 19 07:22:42 2005// /RadiationInput.h/1.1/Wed Oct 19 07:22:42 2005// /XGetopt.cpp/1.1/Wed Oct 19 07:22:42 2005// /XGetopt.h/1.1/Wed Oct 19 07:22:42 2005// /c_evlcom.cpp/1.1/Wed Oct 19 07:22:42 2005// /c_evlcom.h/1.1/Wed Oct 19 07:22:42 2005// /c_geometry.cpp/1.1/Wed Oct 19 07:22:42 2005// /c_geometry.h/1.1/Wed Oct 19 07:22:42 2005// /c_ggrid.cpp/1.1/Wed Oct 19 07:22:42 2005// /c_ggrid.h/1.1/Wed Oct 19 07:22:42 2005// /c_plot_card.cpp/1.1/Wed Oct 19 07:22:42 2005// /c_plot_card.h/1.1/Wed Oct 19 07:22:42 2005// /common.h/1.1/Wed Oct 19 07:22:42 2005// /electromag.h/1.1/Wed Oct 19 07:22:42 2005// /libNEC.cpp/1.1/Wed Oct 19 07:22:42 2005// /libnecpp.h/1.1/Wed Oct 19 07:22:42 2005// /math_util.h/1.1/Wed Oct 19 07:22:42 2005// /matrix_algebra.cpp/1.1/Wed Oct 19 07:22:42 2005// /matrix_algebra.h/1.1/Wed Oct 19 07:22:42 2005// /misc.cpp/1.1/Wed Oct 19 07:22:42 2005// /misc.h/1.1/Wed Oct 19 07:22:42 2005// /nec2cpp.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec2cpp.h/1.1/Wed Oct 19 07:22:42 2005// /necDiff.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_context.cpp/1.2/Wed Oct 19 16:43:30 2005// /nec_context.h/1.1/Wed Oct 19 07:22:42 2005// /nec_debug.h/1.1/Wed Oct 19 07:22:42 2005// /nec_exception.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_exception.h/1.1/Wed Oct 19 07:22:42 2005// /nec_ground.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_ground.h/1.1/Wed Oct 19 07:22:42 2005// /nec_output.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_output.h/1.1/Wed Oct 19 07:22:42 2005// /nec_radiation_pattern.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_radiation_pattern.h/1.1/Wed Oct 19 07:22:42 2005// /nec_results.h/1.1/Wed Oct 19 07:22:42 2005// /nec_structure_currents.cpp/1.1/Wed Oct 19 07:22:42 2005// /nec_structure_currents.h/1.2/Thu Oct 20 09:06:00 2005// /net_solve.cpp/1.1/Wed Oct 19 07:22:42 2005// /safe_array.h/1.1/Wed Oct 19 07:22:42 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_output.h0000644000175000017500000000446210325372102021200 0ustar numanuma#ifndef __nec_output__ #define __nec_output__ /* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "math_util.h" #include "nec_debug.h" class nec_output_flags { public: nec_output_flags() { do_gain = false; do_nec_output = true; } void set_gain_only(bool in_gain_only) { do_gain = in_gain_only; do_nec_output = !in_gain_only; } bool get_nec_flag() { return do_nec_output; } bool get_gain_flag() { return do_gain; } private: bool do_gain; bool do_nec_output; }; class nec_output_file { public: nec_output_file(); void set_file(FILE* in_fp); void endl(int n_lines = 1); void end_section(); void set_indent(int n = 0); void line(const char* in_str); void string(const char* in_str, bool require_endl = false); void real(nec_float in_nec_float); void real_out(int w, int p, nec_float f, bool sci = true); void integer(long in_integer); void set_error_mode(bool f); void nec_printf(const char* fmt, ...); FILE* get_fp() { return m_output_fp; } private: void indent(); void do_output(const char* str); FILE* m_output_fp; bool m_require_indent; int m_indent; bool m_error_mode; FILE* m_error_fp; }; /** A little class for setting up error mode, and then automatically going back to normal output mode. Usage { nec_error_mode em(s_output); s_output.line("Darn..."); } s_output.line("Normal output here"); */ class nec_error_mode { public: nec_error_mode(nec_output_file& of) : m_of(of) { of.set_error_mode(true); } ~nec_error_mode() { m_of.set_error_mode(false); } private: nec_output_file& m_of; }; #endif /* __nec_output__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/src/nec_ground.h0000644000175000017500000001256610325372102021142 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_ground__ #define __nec_ground__ #include "math_util.h" #include "nec_debug.h" /* \section{NEC Ground Specification} \subsection{the GN Card} The GN card 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. The parameters of the second medium can also be specified on another data card whose mnemonic is GD. With the GD card, the parameters of the second medium can be varied and only the radiated fields need to be recalculated. Furthermore, if a radial wire ground screen has been specified on the GN card, the GD card is the only way to include a second medium. See Section~\ref{sec_card_gd} for details. \subsection{"gd" card: ground representation} \label{sec_card_gd} To specify the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the fields of surface patches. < */ class nec_ground { public: nec_ground() { default_values(); } nec_ground(const nec_ground& in_ground) { iperf = in_ground.iperf; ksymp = in_ground.ksymp; epsr = in_ground.epsr; // relative dielectric constant sig = in_ground.sig; // Conductivity // radial wire ground radial_wire_count = in_ground.radial_wire_count; radial_wire_length = in_ground.radial_wire_length; radial_wire_radius = in_ground.radial_wire_radius; // second medium parameters cliff_edge_distance = in_ground.cliff_edge_distance; cliff_height = in_ground.cliff_height; epsr2 = in_ground.epsr2; // Relative dielectric constant sig2 = in_ground.sig2; // Conductivity in mhos/meter } void default_values() { zrati=cplx_10(); ksymp=1; radial_wire_count = 0; radial_wire_length = 0.0; radial_wire_radius = 0.0; iperf=0; /*22/09/2005 : added initialization for sig and epsr*/ epsr = 0; sig = 0; } /* Parse a GN card. The input parameters here are the fields of the GN card. */ void parse_gn(int itmp1, int itmp2, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6 ); /* Setup a cliff (two medium ground) */ void setup_cliff(nec_float in_eprs2, nec_float in_sig2, nec_float clt, nec_float cht); nec_complex get_zrati2(nec_float wavelength); nec_float get_cl(nec_float wavelength) // cliff edge in wavelengths, { return cliff_edge_distance / wavelength; } nec_float get_ch(nec_float wavelength) // cliff Height in wavelengths. { return cliff_height / wavelength; } nec_complex get_zrati_sqr() const { return zrati*zrati; } // accessors for the ground type inline bool type_finite_reflection() { return (0 == iperf); } inline bool type_perfect() { return (1 == iperf); } inline bool type_sommerfeld_norton() { return (2 == iperf); } bool is_valid() const { if (iperf < 0) return false; if (iperf > 2) return false; if (ksymp < 1) return false; if (ksymp > 2) return false; return true; } /*! \brief Return true if a ground is present */ bool present() const { ASSERT(is_valid()); if (2 == ksymp) return true; return false; } nec_float epsr; // relative dielectric constant nec_float sig; // Conductivity // radial wire ground int radial_wire_count; nec_float radial_wire_length; nec_float radial_wire_radius; // second medium parameters nec_float cliff_edge_distance; nec_float cliff_height; nec_float epsr2; // Relative dielectric constant nec_float sig2; // Conductivity in mhos/meter // MOVE THESE TO THE GROUND nec_float scrwl; // length of wires in radial-wire ground-screen in wavelengths nec_float scrwr; // radius of wires in radial-wire ground-screen in wavelengths nec_complex m_t1; nec_float t2; // constants for the radial-wire ground-screen impedance nec_complex zrati, frati; nec_float t1; // constants for the radial-wire ground-screen impedance /** Ground Flag. ==1 no ground, =2 ground present */ int ksymp; private: /* iperf: Ground-type flag. The options are: -1 - nullifies ground parameters previously used and sets free- space condition. The remainder of the card is left blank in this case. O - finite ground, reflection-coefficient approximation. 1 - perfectly conducting ground. 2 - finite ground, Sommerfeld/Norton method. */ int iperf; }; #endif /* __nec_ground__ */ necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/0000755000175000017500000000000011452152141021170 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_radiation_pattern.i0000644000175000017500000000637410327663212025716 0ustar numanuma%nodefault; class nec_radiation_pattern { public: /*! Returns the frequency in Hertz. */ nec_float get_frequency(); /*! Returns the associated ground object. */ nec_ground get_ground(); /*! Returns the radial distance in meters ( or the rho cylindrical coordinate in meters if the calculation mode chosen is mode 1 ). */ nec_float get_range(); /*! Returns the array of gains in dB used in the normalization process. */ real_array get_gain(); /*! Returns the array of vertical (or major axis, depending on the output format chosen) gains in dB. */ real_array get_gain_vert(); /*! Returns the array of horizontal (or minor axis, depending on the output format chosen) gains in dB*/ real_array get_gain_horiz(); /*! Returns the array of total gains in dB*/ real_array get_gain_tot(); /*! Returns the array of polarization axial ratios (no units). */ real_array get_pol_axial_ratio(); /*! Returns the array of polarization tilts in degrees. */ real_array get_pol_tilt(); /*! Returns the array of polarization sense indexes (no units). The relationship between the index and the actual sense is the following : 0 : linear 1 : right 2 : left */ int_array get_pol_sense_index(); /*! Returns the array of complex theta-components of electric field E in Volt/meter. */ complex_array get_e_theta(); /*! Returns the array of complex phi-components of electric field E in Volt/meter. */ complex_array get_e_phi(); /*! Returns the array of complex radial-components of electric field E in Volt/meter - only available for the calculation mode 1. */ complex_array get_e_r(); /*! Returns the normalization factors in dB provided a normalization has been requested. */ nec_float get_normalization_factor(); /*! Returns the increment for theta in degrees (or for z in meters if the calculation mode chosen is mode 1 ). */ nec_float get_delta_theta(); /*! Returns the first value of theta in degrees (or of z in meters if the calculation mode chosen is mode 1 ). */ nec_float get_theta_start(); /*! Returns the increment for phi in degrees. */ nec_float get_delta_phi(); /*! Returns the first value of phi in degrees. */ nec_float get_phi_start(); /*! Returns the number of theta angles. */ int get_ntheta() const; /*! Returns the number of phi angles. */ int get_nphi() const; /*! Returns the array of average power gains in dB, provided its computation has been requested. */ nec_float get_average_power_gain(); /*! Returns the solid angle in steradians used in the averaging process, provided the computation of an average gain has been requested. */ nec_float get_average_power_solid_angle(); /*! Returns the flag (no units) which indicates the calculation mode chosen. */ int get_ifar(); /*! Returns the flag (no units) which indicates the target of the normalization process. */ int get_rp_normalization(); /*! Returns the flag (no units) which indicates the output format chosen. */ int get_rp_output_format(); /*! Returns the flag (no units) which indicates whether the average gain will be computed or not. */ int get_rp_power_average(); /*! Returns the flag (no units) which indicates the type of gain computed : power or directive gain. */ int get_rp_ipd(); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/c_geometry.i0000644000175000017500000002116210325372102023500 0ustar numanumaclass c_geometry { public: /*! Add a wire to the geometry, All coordinates 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 */ 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); /*! Add an arc to the geometry, All coordinates are in meters and angles are in degrees. \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. */ void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); /*! Add an helix to the geometry, \remark The helix is a versatile m_geometry->element. For example, to generate a spiral printed circuit antenna, use a helix of zero height. All coordinates 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 helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ); /*! Scale all dimensions of a structure by a constant. \param xw1 All structure dimensions, including wire radius, are multiplied by xw1. */ void scale( nec_float xw1); %extend{ /*! Move the structure with respect to its coordinate system or reproduces structure in new positions, All coordinates are in meters and angles are in degrees. \param rox_deg The angle in degrees through which the structure is rotated about the X-axis. A positive angle causes a right-hand rotation. \param roy_deg The angle of rotation about Y-axis. \param roz_deg The angle of rotation about Z-axis. \param xs The x component of vector by which the structure is translated with respect to the coordinate system. \param ys The y component of vector by which the structure is translated. \param zs The z component of vector by which the structure is translated. \param its The tag number of the segments that will be moved. If its = 0 then the entire structure is moved. \param nrpt The number of new Structures to be generated. \param itgi The tag number increment. */ void move( nec_float rox_deg, nec_float roy_deg, nec_float roz_deg, nec_float xs, nec_float ys, nec_float zs, int its, int nrpt, int itgi ) { nec_float rox_rad = degrees_to_rad(rox_deg); nec_float roy_rad = degrees_to_rad(roy_deg); nec_float roz_rad = degrees_to_rad(roz_deg); return self->move( rox_rad, roy_rad, roz_rad, xs, ys, zs, its, nrpt, itgi ); } /*! Reflects partial structure along x,y, or z axes. \param ix If ix = 1 then the structure is reflected along X axis. \param iy If iy = 1 then the structure is reflected along Y axis. \param iz If iz = 1 then the structure is reflected along Z axis. \param itx The tag number increment. */ void reflect(int ix, int iy, int iz, int itx) { int nop = 100*ix + 10*iy + iz; return self->reflect(ix, iy, iz, itx, nop); } /*! Rotates structure along Z-axis to complete a symmetric structure. \param itx The tag number increment. \param nop The total number of times that the structure is to occur in the cylindrical array. */ void generate_cylindrical_structure(int itx, int nop) { return self->reflect(-1, 0, 0, itx, nop); } /*! Add a arbitrary-shaped patch to the geometry All coordinates are in meters, angles are in degrees. \param ax1 The x-coordinate of patch center. \param ay1 The y-coordinate of patch center. \param az1 The z-coordinate of patch center. \param ax2_deg The elevation angle above the X-Y plane of outward normal vector. \param ay2_deg The azimuth angle from X-axis of outward normal vector. \param az2 The patch area if ny=1. */ void arbitrary_shaped_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2_deg, nec_float ay2_deg, nec_float az2 ) { nec_float ax2_rad = degrees_to_rad(ax2_deg); nec_float ay2_rad = degrees_to_rad(ay2_deg); return self->patch( 0, 1, ax1, ay1, az1, ax2_rad, ay2_rad, az2, 0, 0, 0, 0, 0, 0 ); } /*! Add a rectangular patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. */ void rectangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) { return self->patch( 0, 2, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 ); } /*! Add a triangular patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. */ void triangular_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3 ) { return self->patch( 0, 3, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 ); } /*! Add a quadrilateral patch to the geometry All coordinates are in meters. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. */ void quadrilateral_patch( nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { return self->patch( 0, 4, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 ); } /*! Add a multiple patch to the geometry. All coordinates are in meters. \param nx The rectangular surface is divided into nx patches from corner 1 to corner 2. \param ny The rectangular surface is divided into ny patches from corner 2 to corner 3. \param ax1 The x-coordinate of corner 1. \param ay1 The y-coordinate of corner 1. \param az1 The z-coordinate of corner 1. \param ax2 The x_coordinate of corner 2. \param ay2 The y_coordinate of corner 2. \param az2 The z-coordinate of corner 2. \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. \param ax4 The x_coordinate of corner 4. \param ay4 The x_coordinate of corner 4. \param az4 The x_coordinate of corner 4. */ void multiple_patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { return self->patch( nx, ny, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 ); } } }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_antenna_input.i0000644000175000017500000000103410327663212025036 0ustar numanumaclass nec_antenna_input { public: /*! Returns the frequency in Hertz. */ nec_float get_frequency(); /*! Returns the array of segment tag numbers. */ vector get_tag(); /*! Returns the array of segment numbers. */ vector get_segment(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of complex voltages in Volt. */ vector get_voltage(); /*! Returns the array of power in Watt. */ vector get_power(); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_ground.i0000644000175000017500000000376710325372102023501 0ustar numanuma%nodefault; class nec_ground { public: %extend { /*! Returns the relative dielectric constant (no units) of the ground medium 1. */ nec_float get_relative_dielectric_constant() { return self->epsr; } /*! Returns the conductivity in Siemens/meter of the ground medium 1. */ nec_float get_conductivity() { return self->sig; } /*! Returns the number of radial wires in the ground screen approximation. If it's zero then this approximation has not been used.*/ int get_radial_wire_count() { return self->radial_wire_count; } /*! Returns the length of radial wires used in the ground screen approximation - provided this approximation has been used. */ nec_float get_radial_wire_length() { return self->radial_wire_count; } /*! Returns the radius of radial wires in the ground screen approximation - provided this approximation has been used. */ nec_float get_radial_wire_radius() { return self->radial_wire_radius; } /*! If there's a cliff problem, returns the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. */ nec_float get_cliff_edge_distance() { return self->cliff_edge_distance; } /*! If there's a cliff problem, returns the distance (positive or zero) by which the surface of medium 2 is below medium 1. */ nec_float get_cliff_height() { return self->cliff_height; } /*! If there's a cliff problem, returns the relative dielectric constant (no units) of the ground medium 2. */ nec_float get_relative_dielectric_constant2() { return self->epsr2; } /*! If there's a cliff problem, returns the conductivity in Siemens/meter of the ground medium 2. */ nec_float get_conductivity2() { return self->sig2; } } }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_context.i0000644000175000017500000006316110327626237023676 0ustar numanumaclass nec_context { int index=0; public: nec_context(); virtual ~nec_context(); /*! Must be called after construction */ void initialize(); /*! Get the associated c_geometry object */ c_geometry* get_geometry(); /*! Get the result antenna_input_parameters specified by index \param index The index of the requested result. */ inline nec_antenna_input* get_input_parameters(int index); /*! Get the result norm_rx_pattern specified by index \param index The index of the requested result. */ inline nec_norm_rx_pattern* get_norm_rx_pattern(int index); /*! Get the result radiation_pattern specified by index \param index The index of the requested result. */ inline nec_radiation_pattern* get_radiation_pattern(int index); /*! Get the result structure_excitation specified by index \param index The index of the requested result. */ inline nec_structure_excitation* get_structure_excitation(int index); /*! Get the result near_field_pattern specified by index \param index The index of the requested result. */ inline nec_near_field_pattern* get_near_field_pattern(int index); /*! Get the result structure_currents specified by index \param index The index of the requested result. */ inline nec_structure_currents* get_structure_currents(int index); %extend{ /* Indicates the end of the geometry input \param card_int_1 Geometry ground plain flag : card_int_1 = 0 : no ground plane is present. card_int_1 = 1 : indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero). card_int_1 = -1 : indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. */ void geometry_complete(int card_int_1) { return self->geometry_complete(card_int_1, 0); } /*! Frequency parameters \param ifrq Determines the type of frequency stepping : in_ifrq = 0 : linear stepping in_ifrq = 1 : mutliplicative stepping. \param nfrq The number of frequency steps. \param freq_hz The frequency first value in Herz. \param del_freq The frequency stepping increment. */ void fr_card(int ifrq, int nfrq, nec_float freq_hz, nec_float del_freq) { nec_float freq_mhz = freq_hz * 1.0e-6; return self->fr_card(ifrq, nfrq, freq_mhz, del_freq); } } /* Specifies the impedance loading on one segment or a number of segments. Series and parallel RLC circuits can be generated. In addition, a finite conductivity can be specified for segments. \param itmp1 Determines the type of loading and the expected units which are used : itmp1 = -1 : Nullifies previous loads. itmp1 = 0 : series RLC, input ohms, henries, farads. itmp1 = 1 : parallel RLC, input ohms, henries, farads. itmp1 = 2 : series RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 3 : parallel RLC, input ohms/meter, henries/meter, farads/meter. itmp1 = 4 : impedance, input resistance and reactance in ohms. itmp1 = 5 : wire conductivity, input mhos/meter. \param itmp2 The tag number of the segments to be loaded. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment to be loaded. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment to be loaded. if both itmp3 and itmp4 are zero, all segments will be loaded. \param tmp1 If itmp1 = 0, 1, 2, 3 or 4 : the resistance ; if itmp1 = 5 : the wire conductivity ; else tmp1 = 0. \param tmp2 If itmp1 = 0, 1, 2 or 3 : the inductance ; if itmp1 = 4 : the reactance ; else tmp2 = 0. \param tmp3 If itmp1 = 0, 1, 2 or 3 : the capacitance ; else tmp3 = 0. */ void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3); /*! Ground parameters under the antenna All coordinates are in meters. \param ground_type Ground-type flag : ground_type = -1 : nullifies ground parameters previously used and sets free-space condition. ground_type = 0 : finite ground, reflection coefficient approximation. ground_type = 1 : perfectly conducting ground. ground_type = 2 : finite ground, Sommerfeld/Norton method. \param rad_wire_count The number of radial wires in the ground screen approximation, O implies no ground screen. \param tmp1 Relative dielectric constant for ground in the vicinity of the antenna ; Zero in case of a perfect ground. \param tmp2 Conductivity in mhos/meter of the ground in the vicinity of the antenna ; Zero in the case of a perfect ground. If tmp2 is input as a negative number, the complex dielectric constant Ec = Er -j sigma/omega epsilon is set to EPSR - |SIG|. \param tmp3 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the ground screen ; else the relative dielectric constant of medium 2 (cliff problem). \param tmp4 Zero for the case of an infinite ground plane ; else if rad_wire >0 : the radius of the wires used in the screen ; else the conductivity of medium 2 in mhos/meter (cliff problem). \param tmp5 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp6 Zero for the case of an infinite ground plane and if rad_wire >0 ; else the distance (positive or zero) by which the surface of medium 2 is below medium 1. */ 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); /*! Specifies the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the field of surface patches All coordinates are in meters. \param tmp1 The relative dielectric constant of medium 2. \param tmp2 The conductivity of medium 2 in mhos/meter. \param tmp3 The distance from the origin of the coordinate system to join between medium 1 and 2. This distance is either the radius of the circle where the two media join or the distance from the 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. \param tmp4 The distance (positive or zero) by which the surface of medium 2 is below medium 1. */ void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4); %extend{ /*! Specifies the excitation for the structure. The excitation can be voltage sources on the structure, an elementary current source, or a plane-wave incident on the structure. All angles are in degrees. \param excitation_type Determines the type of excitation which is used : excitation_type = O - voltage source (applied-E-field source). excitation_type = 1 - incident plane wave, linear polarization. excitation_type = 2 - incident plane wave, right-hand (thumb along the incident k vector) elliptic polarization. excitation_type = 3 - incident plane wave, left-hand elliptic polarization. excitation_type = 4 - elementary current source. excitation_type = 5 - voltage source (current-slope-discontinuity). \param itmp2 If excitation_type = 0 or 5 : the tag number of the source segment (if itmp1 = 0 absolute segment numbers will be used) ; else if excitation_type = 1, 2 or 3 : number of theta angles desired for the incident plane wave ; else zero. \param itmp3 If excitation_type = 0 or 5 : the rank (among the segments the tag number of which is itmp2) or absolute segment number of the source segment ; else if excitation_type = 1, 2 or 3 : number of phi angles desired for the incident plane wave ; else zero. \param itmp4 If itmp4 = 1 the maximum relative admittance matrix asymmetry for source segment (if excitation_type = 0 or 5) and network connections (whatever excitation_type may be) will be calculated and printed. \param itmp5 If excitation_type = 0 or 5 : tmp3 will be taken under account if itmp5 = 1 ; else zero. \param tmp1 If excitation_type = 0 or 5 : the real part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of theta ; else the x-coordinate of the current source. \param tmp2 If excitation_type = 0 or 5 : the imaginary part of the voltage ; else if excitation_type = 1, 2 or 3 : the first value of phi ; else if excitation_type = 4 : the y-coordinate of the current source. \param tmp3 If excitation_type = 0 or 5 : the normalization constant for the impedance printed in the optional impedance table (if tmp3 = 0 the impedance will be normalized to their maximum value) ; else if excitation_type = 1, 2 or 3 : eta in degrees. Eta is the polarization angle defined as the angle between the theta unit vector and the direction of the electric field for linear polarization or the major ellipse axis for elliptical polarization ; else if excitation_type = 4 : the z-coordinate of the current source. \param tmp4 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : theta angle stepping increment. else if excitation_type = 4 : the angle the current source makes with the XY plane. \param tmp5 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : phi angle stepping increment. else if excitation_type = 4 : the angle the projection of the current source on the XY plane makes with the X axis. \param tmp6 If excitation_type = 0 or 5 : zero. else excitation_type = 1, 2 or 3 : ratio of minor axis to major axis for elliptic polarization (major axis field strength - 1 V/m). else if excitation_type = 4 : "Current moment" of the source (in amp meter). */ 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) { int itmp45 = 10*itmp4 + itmp5; return self->ex_card( itmp1, itmp2, itmp3, itmp45, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); } } /*! Generates a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. All coordinates are in meters. \param itmp1 Tag number of the segment to which end one of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end one of the transmission line is connected. \param itmp3 Tag number of the segment to which end two of the transmission line is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which end two of the transmission line is connected. \param tmp1 The characteristic impedance of the transmission line in ohms. A negative sign in front of the characteristic impedance will act as a flag for generating the transmission line with a 180 degree phase reversal (crossed line). \param tmp2 The length of transmission line. \param tmp3 Real part of the shunt admittance in mhos at end one. \param tmp4 Imaginary part of the shunt admittance in mhos at end one. \param tmp5 Real part of the shunt admittance in mhos at end two \param tmp6 Imaginary part of the shunt admittance in mhos at end two. */ 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); /*! Generates a two-port nonradiating, network connected between any two segments in the structure. The characteristics of the network are specified by its short-circuit admittance matrix elements. \param itmp1 Tag number of the segment to which port one of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port one of the network is connected. \param itmp3 Tag number of the segment to which port two of the network is connected. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the segment to which port two of the network is connected. \param tmp1 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp2 Real part of element (1, 1) of the short-circuit admittance matrix in mhos. \param tmp3 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp4 Real part of element (1, 2) of the short-circuit admittance matrix in mhos. \param tmp5 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. \param tmp6 Real part of element (2, 2) of the short-circuit admittance matrix in mhos. */ 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); /*! Causes program execution at points in the data stream where execution is not automatic. Options on the card also allow for automatic generation of radiation patterns in either of two vertical cuts. \param itmp1 Options controlled by itmp1 are: itmp1 = 0 : no patterns requested (normal case). itmp1 = 1 : generates a pattern cut in the XZ plane, i.e., phi = 0 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 2 : generates a pattern cut in the YZ plane, i.e., phi = 90 degrees and theta varies from 0 degrees to 90 degrees in 1 degree steps. itmp1 = 3 : generates both of the cuts described for the values 1 and 2. */ void xq_card(int itmp1); /*! Specifies radiation pattern sampling parameters and to cause program execution. Options for a field computation include a radial wire ground screen, a cliff, or surface-wave fields. All coordinates are in meters, angles are in degrees. \param calc_mode The mode of calculation for the radiated field : calc_mode = 0 : normal mode. Space-wave fields are computed. An infinite ground plane is included if it has been specified previously on a GN cart; otherwise, antenna is in free space. calc_mode = 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 cart 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.) calc_mode = 2 : linear cliff with antenna above upper level. Lower medium parameters are as specified for the second medium on the GN cart or on the GD card. calc_mode = 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. calc_mode = 4 : radial wire ground screen centered at origin. calc_mode = 5 : both radial wire ground screen and linear cliff. calc_mode = 6 : both radial wire ground screen ant circular cliff. \param n_theta If calc_mode = 1 : number of values of z ; else number of values of theta. \param n_phi Number of values of phi. \param output_format If calc_mode = 1 : zero ; else controls the output format : output_format = 0 : major axis, minor axis and total gain printed. output_format = 1 : vertical, horizontal ant total gain printed. \param normalization If calc_mode = 1 : zero ; else causes normalized gain for the specified field points to be printed after the standard gain output : normalization = 0 : no normalized gain. normalization = 1 : major axis gain normalized. normalization = 2 : minor axis gain normalized. normalization = 3 : vertical axis gain normalized. normalization = 4 : horizontal axis gain normalized. normalization = 5 : total gain normalized. \param D If calc_mode = 1 : zero else selects either power gain or directive gain for both standard printing and normalization : D = 0 : power gain. D = 1 : directive gain. \param A If calc_mode = 1 : zero else requests calculation of average power gain over the region covered by field points : A = 0 : no averaging. A = 1 : average gain computed. \param theta0 If calc_mode = 1 : initial value of z ; else initial value of theta. \param phi0 Initial value of phi. \param delta_theta If calc_mode = 1 : increment for z ; else increment for theta. \param delta_phi Increment for phi. \param radial_distance If calc_mode = 1 : cylindrical coordinate rho. It must be greater than about one wavelength ; else radial distance (R) of field point from the origin. 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. \param gain_norm Gain normalization factor if normalization has been required by the parameter normalization. If gain_norm = 0 the gain will be normalized to its maximum value. */ 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); /*! Controls the printing for currents \param itmp1 Print control flag, specifies the type of format used in printing segment currents : itmp1 = -2 : all currents printed. This it a default value for the program if the card is Omitted. itmp1 = -1 : suppress printing of all wire segment currents. itmp1 = O : current printing will be limited to the segments specified by the next three parameters. itmp1 = 1 : currents are printed by using a format designed for a receiving pattern. Only currents for the segments specified by the next three parameters are printed. itmp1 = 2 : same as for 1 above; in addition, however, the current for one segment will be normalized to its maximum, ant the normalized values along with the relative strength in dB will be printed in a table. If the currents for more than one segment are being printed, only currents from the last segment in the group appear in the normalized table. itmp1 = 3 : only normalized currents from one segment are printed for the receiving pattern case. \param itmp2 The tag number of the segments the currents on which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the current on which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the current on which will be printed. if both itmp3 and itmp4 are zero, all currents will be printed. */ void pt_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! Controls the printing for charges \param itmp1 Print control flag : itmp1 = -2 : all charge densities printed. itmp1 = -1 : suppress printing of charge densities. This is the default condition. itmp1 = 0 : print charge densities on segments speficied by the following parameters. \param itmp2 The tag number of the segments the charge densities of which will be printed. If itmp2 = 0 absolute segment numbers will be used. \param itmp3 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the first segment the charge density of which will be printed. \param itmp4 Rank (among the segments the tag number of which is itmp2) or absolute segment number of the last segment the charge density of which will be printed. if both itmp3 and itmp4 are zero, all charge densities will be printed. */ void pq_card(int itmp1, int itmp2, int itmp3, int itmp4); /*! Sets the minimum separation distance for use of a time-saving approximation in filling the interaction matrix. \param tmp1 The approximation is used for interactions over distances greater than tmp1 wavelengths. */ void kh_card(nec_float tmp1); /*! To request calculation of the near electric field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. */ 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); /*! To request calculation of the near magnetic field in the vicinity of the antenna All coordinates are in meters, angles are in degrees. \param itmp1 Coordinate system type for input : itmp1 = 0 : rectangular coordinates will be used. itmp1 = 1 : spherical coordinates will be used. \param itmp2 If itmp1 = 0 : number of points in the X direction desired. else number of point in the R direction desired. \param itmp3 If itmp1 = 0 : number of points in the Y direction desired. else number of point in the phi direction desired. \param itmp4 If itmp1 = 0 : number of points in the Z direction desired. else number of point in the theta direction desired. \param tmp1 If itmp1 = 0 : X first value. else R first value. \param tmp2 If itmp1 = 0 : Y first value. else phi first value. \param tmp3 If itmp1 = 0 : Z first value. else theta first value. \param tmp4 If itmp1 = 0 : increment for X. else increment for R. \param tmp5 If itmp1 = 0 : increment for Y. else increment for phi. \param tmp6 If itmp1 = 0 : increment for Z. else increment for theta. */ 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); /*! Controls the use of the extended thin-wire kernal approximation. \param ekflag Controls the use of the kernel : ekflag = -1 : returns to standard thin-wire kernel (the one used if there's no ek card). ekflag = 0 : initiates use of the extended thin-wire kernel. */ void set_extended_thin_wire_kernel(bool ekflag); /*! Request calculation of the maximum coupling between segments. \param itmp1 Tag number of the first segment. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp2 Rank (among the segments the tag number of which is itmp1) or absolute segment number of the first segment. \param itmp3 Tag number of the second segment. If itmp1 = 0, the segment will be identified using the absolute segment number. \param itmp4 Rank (among the segments the tag number of which is itmp3) or absolute segment number of the second segment. */ 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); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/safe_array.i0000644000175000017500000000011410325372102023451 0ustar numanumatemplate class safe_array { public: T* get_ptr() const; }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/math_util.i0000644000175000017500000000051510325372102023330 0ustar numanuma/* these typedefs can be moved to an other interface file. They have been left here to respect the structure of the original code. */ typedef double nec_float; typedef std::complex nec_complex; typedef safe_array int_array; typedef safe_array real_array; typedef safe_array complex_array; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_structure_excitation.i0000644000175000017500000000104410327663212026463 0ustar numanumaclass nec_structure_excitation { public: /*! Returns the frequency in Hertz */ nec_float get_frequency(); /*! Returns the array of segment tag numbers. */ vector get_tag(); /*! Returns the array of segment numbers. */ vector get_segment(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of complex voltages in Volt. */ vector get_voltage(); /*! Returns the array of power in Watt. */ vector get_power(); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_structure_currents.i0000644000175000017500000001046410327663212026167 0ustar numanumaclass nec_structure_currents { public: /*! Returns the frequency in Hertz. */ nec_float get_frequency(); /*! Returns the flag which controls the printing of the currents. */ int get_iptflg(); /*! Returns the flag which controls the printing of charge densities. */ int get_iptflq(); /*! Returns the number the wire segments in the geometry. */ int get_n(); /*! Returns the number of patches in the geometry. */ int get_m(); /*! Returns the array of segment numbers for the printing of currrents. */ vector get_current_segment_number(); /*! Returns the array of segment tag numbers for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_tag(); /*! Returns the array of x-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_x(); /*! Returns the array of y-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_y(); /*! Returns the array of z-coordinate of segment centers in wavelengths for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_center_z(); /*! Returns the array of segment lengths in wavelengths for the printing of currents, provided the standard output format has been requested. */ vector get_current_segment_length(); /*! Returns the array of theta angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. */ vector get_current_theta(); /*! Returns the array of phi angles in degrees for the printing of currents, provided the format designed for a receiving pattern has been requested. */ vector get_current_phi(); /*! Returns the array of complex currents in Ampere. */ vector get_current(); /*! Returns the array of segment numbers for the printing of charge densities. */ vector get_q_density_segment_number(); /*! Returns the array of segment tag numbers for the printing of charge densities. */ vector get_q_density_segment_tag(); /*! Returns the array of x-coordinate of segment centers in wavelengths for the printing of charge densities. */ vector get_q_density_segment_center_x(); /*! Returns the array of y-coordinate of segment centers in wavelengths for the printing of charge densities. */ vector get_q_density_segment_center_y(); /*! Returns the array of z-coordinate of segment centers in wavelengths for the printing of charge densities. */ vector get_q_density_segment_center_z(); /*! Returns the array of segment lengths in wavelengths for the printing of charge densities. */ vector get_q_density_segment_length(); /*! Returns the array of complex charge densities in Coulomb/meter. */ vector get_q_density(); /*! Returns the array of patch numbers. */ vector get_patch_number(); /*! Returns the array of x-coordinate in wavelengths of patch centers. */ vector get_patch_center_x(); /*! Returns the array of y-coordinate in wavelengths of patch centers. */ vector get_patch_center_y(); /*! Returns the array of z-coordinate in wavelengths of patch centers. */ vector get_patch_center_z(); /*! Returns the array of complex tangent vector 1 of the patches. */ vector get_patch_tangent_vector1(); /*! Returns the array of complex tangent vector 2 of the patches. */ vector get_patch_tangent_vector2(); /*! Returns the complex x-component of the electric field E. */ vector get_patch_e_x(); /*! Returns the complex y-component of the electric field E. */ vector get_patch_e_y(); /*! Returns the complex z-component of the electric field E. */ vector get_patch_e_z(); /*this private method won't be wrapped, but allow an error in the compilation process to be avoided.*/ private: nec_structure_currents(nec_context * in_context, char * in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_norm_rx_pattern.i0000644000175000017500000000203510327663212025416 0ustar numanuma%nodefault; class nec_norm_rx_pattern { public: /*! Returns the frequency in Hertz. */ nec_float get_frequency(); /*! Returns the number of theta angles. */ int get_n_theta(); /*! Returns the number of phi angles. */ int get_n_phi(); /*! Returns the first value of theta in degrees. */ nec_float get_theta_start(); /*! Returns the first value of phi angles in degrees. */ nec_float get_phi_start(); /*! Returns the increment for theta in degrees. */ nec_float get_delta_theta(); /*! Returns the increment for phi in degrees. */ nec_float get_delta_phi(); /*! Returns the value of eta in degrees. */ nec_float get_eta(); /*! Returns the axial ratio (no units). */ nec_float get_axial_ratio(); /*! Returns the segment number. */ int get_segment_number(); /*! Return the polarization type. */ string get_type(); /*! Returns the normalization factor in dB. */ nec_float get_norm_factor(); /*! Returns the array of receiving gains not yet normalized. */ real_array get_mag(); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/nec_near_field_pattern.i0000644000175000017500000000203110327663212026016 0ustar numanumaclass nec_near_field_pattern { public: /*! Returns the frequency in Hertz. */ nec_float get_frequency(); /*! Returns the flag indicating whether the result is a near electric or magnetic field pattern. */ int get_nfeh(); /*! Returns the array of x-coordinate in meters of field points. */ vector get_x(); /*! Returns the array of y-coordinate in meters of field points. */ vector get_y(); /*! Returns the array of z-coordinate in meters of field points. */ vector get_z(); /*! Returns the array of x_components of the electric or magnetic field. */ vector get_field_x(); /*! Returns the array of y_components of the electric or magnetic field. */ vector get_field_y(); /*! Returns the array of z_components of the electric or magnetic field. */ vector get_field_z(); /*this private method won't be wrapped, but allow an error in the compilation process to be avoided.*/ private: nec_near_field_pattern(int nfeh); }; necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/CVS/0000755000175000017500000000000011452152141021623 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/CVS/Root0000644000175000017500000000007011452152141022466 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/CVS/Repository0000644000175000017500000000005011452152141023720 0ustar numanumanecpp/Python/PyNEC/wrap/interface_files necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/interface_files/CVS/Entries0000644000175000017500000000106211452152141023156 0ustar numanuma/c_geometry.i/1.1/Wed Oct 19 07:22:42 2005// /math_util.i/1.1/Wed Oct 19 07:22:42 2005// /nec_antenna_input.i/1.2/Wed Oct 26 11:20:42 2005// /nec_context.i/1.2/Wed Oct 26 07:13:35 2005// /nec_ground.i/1.1/Wed Oct 19 07:22:42 2005// /nec_near_field_pattern.i/1.2/Wed Oct 26 11:20:42 2005// /nec_norm_rx_pattern.i/1.2/Wed Oct 26 11:20:42 2005// /nec_radiation_pattern.i/1.2/Wed Oct 26 11:20:42 2005// /nec_structure_currents.i/1.3/Wed Oct 26 11:20:42 2005// /nec_structure_excitation.i/1.2/Wed Oct 26 11:20:42 2005// /safe_array.i/1.1/Wed Oct 19 07:22:42 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/PyNEC.i0000644000175000017500000000556310330425143017146 0ustar numanuma%module PyNEC %include %include %{ #include "Python.h" #include "libnumarray.h" #include "src/math_util.h" #include "src/nec_context.h" #include "src/c_geometry.h" #include "src/nec_radiation_pattern.h" #include "src/nec_structure_currents.h" #include "src/nec_results.h" #include "src/nec_ground.h" #include "src/safe_array.h" #include "src/nec_exception.h" #include %} /*! Exception handling stuff */ %include exception.i %exception { try { $action } catch (nec_exception* nex) { SWIG_exception(SWIG_RuntimeError,nex->get_message().c_str()); } catch (const char* message){ SWIG_exception(SWIG_RuntimeError,message); } catch (...){ SWIG_exception(SWIG_RuntimeError,"Unknown exception"); } } /*! The following typemaps allow the automatic conversion of vectors and safe_arrays into numarrays */ %typemap (python, out) real_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tFloat64, nd, size)); } %typemap (python, out) int_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tInt32, nd, size)); } %typemap (python, out) complex_array { int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)($1.get_ptr()), tComplex64, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } %typemap (python, out) vector { vector::pointer ptr = &($1[0]); int nd = 1; int size = $1.size(); $result =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } /*! The two following interface files have only been created to avoid errors during the wrapping process. */ %import "interface_files/math_util.i" %include "interface_files/safe_array.i" /*! For each of the following interface files a corresponding python file has been created. The python genrated file has been used as a starting point, then it has been improved to provide a more user-friendly module. */ %include "interface_files/nec_context.i" %include "interface_files/c_geometry.i" %include "interface_files/nec_radiation_pattern.i" %include "interface_files/nec_norm_rx_pattern.i" %include "interface_files/nec_structure_excitation.i" %include "interface_files/nec_antenna_input.i" %include "interface_files/nec_near_field_pattern.i" %include "interface_files/nec_structure_currents.i" %include "interface_files/nec_ground.i" /*The function below is added to the init function of the wrapped module. It's mandatory to do so before to use the numarray API*/ %init %{ import_libnumarray(); %} necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/CVS/0000755000175000017500000000000011452152141016501 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/wrap/CVS/Entries.Log0000644000175000017500000000004411452152141020553 0ustar numanumaA D/interface_files//// A D/src//// necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/CVS/Root0000644000175000017500000000007011452152141017344 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/CVS/Repository0000644000175000017500000000003011452152141020574 0ustar numanumanecpp/Python/PyNEC/wrap necpp-1.5.0+cvs20101003/Python/PyNEC/wrap/CVS/Entries0000644000175000017500000000005211452152141020032 0ustar numanuma/PyNEC.i/1.4/Fri Oct 28 13:40:51 2005// D necpp-1.5.0+cvs20101003/Python/PyNEC/CVS/0000755000175000017500000000000011452152141015530 5ustar numanumanecpp-1.5.0+cvs20101003/Python/PyNEC/CVS/Entries.Log0000644000175000017500000000011711452152141017603 0ustar numanumaA D/python_module//// A D/test_nec_files//// A D/test_scripts//// A D/wrap//// necpp-1.5.0+cvs20101003/Python/PyNEC/CVS/Root0000644000175000017500000000007011452152141016373 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/PyNEC/CVS/Repository0000644000175000017500000000002311452152141017625 0ustar numanumanecpp/Python/PyNEC necpp-1.5.0+cvs20101003/Python/PyNEC/CVS/Entries0000644000175000017500000000012311452152141017060 0ustar numanuma/INSTALL/1.6/Wed Nov 9 15:22:05 2005// /setup.py/1.7/Wed Nov 9 15:22:05 2005// D necpp-1.5.0+cvs20101003/Python/swig_output/0000755000175000017500000000000011452152142016551 5ustar numanumanecpp-1.5.0+cvs20101003/Python/swig_output/PyNEC_wrap.cxx0000644000175000017500000063015310322432605021254 0ustar numanuma/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.25 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPYTHON #ifdef __cplusplus template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } SwigValueWrapper(const T& t) : tt(new T(t)) { } ~SwigValueWrapper() { delete tt; } SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } operator T&() const { return *tt; } T *operator&() { return tt; } private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; #endif /*********************************************************************** * * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ************************************************************************/ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) || defined(__ICC) # define SWIGUNUSED __attribute__ ((unused)) # else # define SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods for Windows DLLs */ #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # define SWIGEXPORT # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif #include /*********************************************************************** * swigrun.swg * * This file contains generic CAPI SWIG runtime support for pointer * type checking. * ************************************************************************/ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ #define SWIG_RUNTIME_VERSION "2" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE # define SWIG_QUOTE_STRING(x) #x # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) #else # define SWIG_TYPE_TABLE_NAME #endif /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the swig runtime code. In 99.9% of the cases, swig just needs to declare them as 'static'. But only do this if is strictly necessary, ie, if you have problems with your compiler or so. */ #ifndef SWIGRUNTIME # define SWIGRUNTIME SWIGINTERN #endif #ifndef SWIGRUNTIMEINLINE # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE #endif #include #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store inforomation on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ typedef struct swig_cast_info { swig_type_info *type; /* pointer to type that is equivalent to this type */ swig_converter_func converter; /* function to cast the void pointers */ struct swig_cast_info *next; /* pointer to next cast in linked list */ struct swig_cast_info *prev; /* pointer to the previous cast */ } swig_cast_info; /* Structure used to store module information * Each module generates one structure like this, and the runtime collects * all of these structures and stores them in a circularly linked list.*/ typedef struct swig_module_info { swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ size_t size; /* Number of types in this module */ struct swig_module_info *next; /* Pointer to next element in circularly linked list */ swig_type_info **type_initial; /* Array of initially generated type structures */ swig_cast_info **cast_initial; /* Array of initially generated casting structures */ void *clientdata; /* Language specific module data */ } swig_module_info; /* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. Return 0 when the two name types are equivalent, as in strncmp, but skipping ' '. */ SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2) { for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (int)(*f1 - *f2); } return (l1 - f1) - (l2 - f2); } /* Check type equivalence in a name list like ||... Return 0 if not equal, 1 if equal */ SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like ||... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCompare(const char *nb, const char *tb) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* think of this as a c++ template<> or a scheme macro */ #define SWIG_TypeCheck_Template(comparison, ty) \ if (ty) { \ swig_cast_info *iter = ty->cast; \ while (iter) { \ if (comparison) { \ if (iter == ty->cast) return iter; \ /* Move iter to the top of the linked list */ \ iter->prev->next = iter->next; \ if (iter->next) \ iter->next->prev = iter->prev; \ iter->next = ty->cast; \ iter->prev = 0; \ if (ty->cast) ty->cast->prev = iter; \ ty->cast = iter; \ return iter; \ } \ iter = iter->next; \ } \ } \ return 0 /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); } /* Same as previous function, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { SWIG_TypeCheck_Template(iter->type == from, into); } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); } /* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; while (ty && (ty->dcast)) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } return lastty; } /* Return the name associated with this type */ SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty) { return ty->name; } /* Return the pretty name associated with this type, that is an unmangled type name in a form presentable to the user. */ SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the type, separated by vertical-bar characters. We choose to print the last name, as it is often (?) the most specific. */ if (type->str != NULL) { const char *last_name = type->str; const char *s; for (s = type->str; *s; s++) if (*s == '|') last_name = s+1; return last_name; } else return type->name; } /* Set the clientdata field for a type */ SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { if (!ti->clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; while (cast) { if (!cast->converter) SWIG_TypeClientData(cast->type, clientdata); cast = cast->next; } } } /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { register size_t l = 0; register size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ register size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { register int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { r = i - 1; } else { break; } } else if (compare > 0) { l = i + 1; } } else { break; /* should never happen */ } } while (l <= r); } iter = iter->next; } while (iter != end); return 0; } /* Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); if (ret) { return ret; } else { /* STEP 2: If the type hasn't been found, do a complete search of the str field (the human readable name) */ swig_module_info *iter = start; do { register size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; } iter = iter->next; } while (iter != end); } /* neither found a match */ return 0; } /* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } /* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register unsigned char uu = 0; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } /* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { char *r = buff; if ((2*sizeof(void *) + 2) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,&ptr,sizeof(void *)); if (strlen(name) + 1 > (bsz - (r - buff))) return 0; strcpy(r,name); return buff; } SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { *ptr = (void *) 0; return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sizeof(void *)); } SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { char *r = buff; size_t lname = (name ? strlen(name) : 0); if ((2*sz + 2 + lname) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); if (lname) { strncpy(r,name,lname+1); } else { *r = 0; } return buff; } SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { memset(ptr,0,sz); return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sz); } #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * SWIG API. Portion that goes into the runtime * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * for internal method declarations * ----------------------------------------------------------------------------- */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* Exception handling in wrappers */ #define SWIG_fail goto fail #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) #define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0) #define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1) #define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj) #define SWIG_null_ref(type) SWIG_Python_NullRef(type) /* Contract support */ #define SWIG_contract_assert(expr, msg) \ if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else /* ----------------------------------------------------------------------------- * Constant declarations * ----------------------------------------------------------------------------- */ /* Constant Types */ #define SWIG_PY_INT 1 #define SWIG_PY_FLOAT 2 #define SWIG_PY_STRING 3 #define SWIG_PY_POINTER 4 #define SWIG_PY_BINARY 5 /* Constant information structure */ typedef struct swig_const_info { int type; char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; /* ----------------------------------------------------------------------------- * Alloc. memory flags * ----------------------------------------------------------------------------- */ #define SWIG_OLDOBJ 1 #define SWIG_NEWOBJ SWIG_OLDOBJ + 1 #define SWIG_PYSTR SWIG_NEWOBJ + 1 #ifdef __cplusplus } #endif /*********************************************************************** * pyrun.swg * * This file contains the runtime support for Python modules * and includes code for managing global variables and pointer * type checking. * * Author : David Beazley (beazley@cs.uchicago.edu) ************************************************************************/ /* Common SWIG API */ #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags) #define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags) #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) /* Python-specific SWIG API */ #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ /* Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent C/C++ pointers in the python side. Very useful for debugging, but not always safe. */ #if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES) # define SWIG_COBJECT_TYPES #endif /* Flags for pointer conversion */ #define SWIG_POINTER_EXCEPTION 0x1 #define SWIG_POINTER_DISOWN 0x2 /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 #define PyOS_snprintf snprintf #endif #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * Create a new pointer string * ----------------------------------------------------------------------------- */ #ifndef SWIG_BUFFER_SIZE #define SWIG_BUFFER_SIZE 1024 #endif #if defined(SWIG_COBJECT_TYPES) #if !defined(SWIG_COBJECT_PYTHON) /* ----------------------------------------------------------------------------- * Implements a simple Swig Object type, and use it instead of PyCObject * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *ptr; const char *desc; } PySwigObject; /* Declarations for objects of type PySwigObject */ SWIGRUNTIME int PySwigObject_print(PySwigObject *v, FILE *fp, int flags) { char result[SWIG_BUFFER_SIZE]; flags = flags; if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) { fputs("", fp); return 0; } else { return 1; } } SWIGRUNTIME PyObject * PySwigObject_repr(PySwigObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? PyString_FromFormat("", result) : 0; } SWIGRUNTIME PyObject * PySwigObject_str(PySwigObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? PyString_FromString(result) : 0; } SWIGRUNTIME PyObject * PySwigObject_long(PySwigObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * PySwigObject_format(const char* fmt, PySwigObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) { PyObject *ofmt = PyString_FromString(fmt); if (ofmt) { res = PyString_Format(ofmt,args); Py_DECREF(ofmt); } Py_DECREF(args); } return res; } SWIGRUNTIME PyObject * PySwigObject_oct(PySwigObject *v) { return PySwigObject_format("%o",v); } SWIGRUNTIME PyObject * PySwigObject_hex(PySwigObject *v) { return PySwigObject_format("%x",v); } SWIGRUNTIME int PySwigObject_compare(PySwigObject *v, PySwigObject *w) { int c = strcmp(v->desc, w->desc); if (c) { return (c > 0) ? 1 : -1; } else { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } } SWIGRUNTIME void PySwigObject_dealloc(PySwigObject *self) { PyObject_DEL(self); } SWIGRUNTIME PyTypeObject* PySwigObject_type(void) { static char pyswigobject_type__doc__[] = "Swig object carries a C/C++ instance pointer"; static PyNumberMethods PySwigObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ (binaryfunc)0, /*nb_divide*/ (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ (unaryfunc)0, /*nb_negative*/ (unaryfunc)0, /*nb_positive*/ (unaryfunc)0, /*nb_absolute*/ (inquiry)0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ (coercion)0, /*nb_coerce*/ (unaryfunc)PySwigObject_long, /*nb_int*/ (unaryfunc)PySwigObject_long, /*nb_long*/ (unaryfunc)0, /*nb_float*/ (unaryfunc)PySwigObject_oct, /*nb_oct*/ (unaryfunc)PySwigObject_hex, /*nb_hex*/ #if PY_VERSION_HEX >= 0x02000000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ #endif }; static PyTypeObject pyswigobject_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ (char *)"PySwigObject", /*tp_name*/ sizeof(PySwigObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)PySwigObject_dealloc, /*tp_dealloc*/ (printfunc)PySwigObject_print, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ (cmpfunc)PySwigObject_compare, /*tp_compare*/ (reprfunc)PySwigObject_repr, /*tp_repr*/ &PySwigObject_as_number, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ (hashfunc)0, /*tp_hash*/ (ternaryfunc)0, /*tp_call*/ (reprfunc)PySwigObject_str, /*tp_str*/ /* Space for future expansion */ 0,0,0,0, pyswigobject_type__doc__, /* Documentation string */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) pyswigobject_type = tmp; type_init = 1; } #endif return &pyswigobject_type; } SWIGRUNTIME PyObject * PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc) { PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type()); if (self) { self->ptr = ptr; self->desc = desc; } return (PyObject *)self; } SWIGRUNTIMEINLINE void * PySwigObject_AsVoidPtr(PyObject *self) { return ((PySwigObject *)self)->ptr; } SWIGRUNTIMEINLINE const char * PySwigObject_GetDesc(PyObject *self) { return ((PySwigObject *)self)->desc; } SWIGRUNTIMEINLINE int PySwigObject_Check(PyObject *op) { return ((op)->ob_type == PySwigObject_type()) || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); } /* ----------------------------------------------------------------------------- * Implements a simple Swig Packed type, and use it instead of string * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *pack; const char *desc; size_t size; } PySwigPacked; SWIGRUNTIME int PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags) { char result[SWIG_BUFFER_SIZE]; flags = flags; fputs("pack, v->size, 0, sizeof(result))) { fputs("at ", fp); fputs(result, fp); } fputs(v->desc,fp); fputs(">", fp); return 0; } SWIGRUNTIME PyObject * PySwigPacked_repr(PySwigPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { return PyString_FromFormat("", result, v->desc); } else { return PyString_FromFormat("", v->desc); } } SWIGRUNTIME PyObject * PySwigPacked_str(PySwigPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ return PyString_FromFormat("%s%s", result, v->desc); } else { return PyString_FromFormat("%s", v->desc); } } SWIGRUNTIME int PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) { int c = strcmp(v->desc, w->desc); if (c) { return (c > 0) ? 1 : -1; } else { size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); } } SWIGRUNTIME void PySwigPacked_dealloc(PySwigPacked *self) { free(self->pack); PyObject_DEL(self); } SWIGRUNTIME PyTypeObject* PySwigPacked_type(void) { static char pyswigpacked_type__doc__[] = "Swig object carries a C/C++ instance pointer"; static PyTypeObject pyswigpacked_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ (char *)"PySwigPacked", /*tp_name*/ sizeof(PySwigPacked), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)PySwigPacked_dealloc, /*tp_dealloc*/ (printfunc)PySwigPacked_print, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ (cmpfunc)PySwigPacked_compare, /*tp_compare*/ (reprfunc)PySwigPacked_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ (hashfunc)0, /*tp_hash*/ (ternaryfunc)0, /*tp_call*/ (reprfunc)PySwigPacked_str, /*tp_str*/ /* Space for future expansion */ 0,0,0,0, pyswigpacked_type__doc__, /* Documentation string */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) pyswigpacked_type = tmp; type_init = 1; } #endif return &pyswigpacked_type; } SWIGRUNTIME PyObject * PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc) { PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type()); if (self == NULL) { return NULL; } else { void *pack = malloc(size); if (pack) { memcpy(pack, ptr, size); self->pack = pack; self->desc = desc; self->size = size; return (PyObject *) self; } return NULL; } } SWIGRUNTIMEINLINE const char * PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { PySwigPacked *self = (PySwigPacked *)obj; if (self->size != size) return 0; memcpy(ptr, self->pack, size); return self->desc; } SWIGRUNTIMEINLINE const char * PySwigPacked_GetDesc(PyObject *self) { return ((PySwigPacked *)self)->desc; } SWIGRUNTIMEINLINE int PySwigPacked_Check(PyObject *op) { return ((op)->ob_type == PySwigPacked_type()) || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); } #else /* ----------------------------------------------------------------------------- * Use the old Python PyCObject instead of PySwigObject * ----------------------------------------------------------------------------- */ #define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj) #define PySwigObject_Check(obj) PyCObject_Check(obj) #define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj) #define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL) #endif #endif /* ----------------------------------------------------------------------------- * errors manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) if (obj && PySwigObject_Check(obj)) { const char *otype = (const char *) PySwigObject_GetDesc(obj); if (otype) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", type, otype); return; } } else #endif { const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); const char *cstr = str ? PyString_AsString(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } Py_XDECREF(str); return; } } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { PyErr_Format(PyExc_TypeError, "unexpected type is received"); } } SWIGRUNTIMEINLINE void SWIG_Python_NullRef(const char *type) { if (type) { PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type); } else { PyErr_Format(PyExc_TypeError, "null reference was received"); } } SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) { if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); } else { PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); } Py_DECREF(old_str); } return 1; } else { return 0; } } SWIGRUNTIME int SWIG_Python_ArgFail(int argnum) { if (PyErr_Occurred()) { /* add information about failing argument */ char mesg[256]; PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); return SWIG_Python_AddErrMesg(mesg, 1); } else { return 0; } } /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ /* Convert a pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { swig_cast_info *tc; const char *c = 0; static PyObject *SWIG_this = 0; int newref = 0; PyObject *pyobj = 0; void *vptr; if (!obj) return 0; if (obj == Py_None) { *ptr = 0; return 0; } #ifdef SWIG_COBJECT_TYPES if (!(PySwigObject_Check(obj))) { if (!SWIG_this) SWIG_this = PyString_FromString("this"); pyobj = obj; obj = PyObject_GetAttr(obj,SWIG_this); newref = 1; if (!obj) goto type_error; if (!PySwigObject_Check(obj)) { Py_DECREF(obj); goto type_error; } } vptr = PySwigObject_AsVoidPtr(obj); c = (const char *) PySwigObject_GetDesc(obj); if (newref) { Py_DECREF(obj); } goto type_check; #else if (!(PyString_Check(obj))) { if (!SWIG_this) SWIG_this = PyString_FromString("this"); pyobj = obj; obj = PyObject_GetAttr(obj,SWIG_this); newref = 1; if (!obj) goto type_error; if (!PyString_Check(obj)) { Py_DECREF(obj); goto type_error; } } c = PyString_AS_STRING(obj); /* Pointer values must start with leading underscore */ c = SWIG_UnpackVoidPtr(c, &vptr, ty->name); if (newref) { Py_DECREF(obj); } if (!c) goto type_error; #endif type_check: if (ty) { tc = SWIG_TypeCheck(c,ty); if (!tc) goto type_error; *ptr = SWIG_TypeCast(tc,vptr); } else { *ptr = vptr; } if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); } return 0; type_error: PyErr_Clear(); if (pyobj && !obj) { obj = pyobj; if (PyCFunction_Check(obj)) { /* here we get the method pointer for callbacks */ char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); c = doc ? strstr(doc, "swig_ptr: ") : 0; if (c) { c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0; if (!c) goto type_error; goto type_check; } } } if (flags & SWIG_POINTER_EXCEPTION) { if (ty) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); } else { SWIG_Python_TypeError("C/C++ pointer", obj); } } return -1; } /* Convert a pointer value, signal an exception on a type mismatch */ SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); if (flags & SWIG_POINTER_EXCEPTION) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } } return result; } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) { swig_cast_info *tc; const char *c = 0; #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) c = PySwigPacked_UnpackData(obj, ptr, sz); #else if ((!obj) || (!PyString_Check(obj))) goto type_error; c = PyString_AS_STRING(obj); /* Pointer values must start with leading underscore */ c = SWIG_UnpackDataName(c, ptr, sz, ty->name); #endif if (!c) goto type_error; if (ty) { tc = SWIG_TypeCheck(c,ty); if (!tc) goto type_error; } return 0; type_error: PyErr_Clear(); if (flags & SWIG_POINTER_EXCEPTION) { if (ty) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); } else { SWIG_Python_TypeError("C/C++ packed data", obj); } } return -1; } /* Create a new array object */ SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { PyObject *robj = 0; if (!type) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj"); } return robj; } if (!ptr) { Py_INCREF(Py_None); return Py_None; } #ifdef SWIG_COBJECT_TYPES robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name); #else { char result[SWIG_BUFFER_SIZE]; robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ? PyString_FromString(result) : 0; } #endif if (!robj || (robj == Py_None)) return robj; if (type->clientdata) { PyObject *inst; PyObject *args = Py_BuildValue((char*)"(O)", robj); Py_DECREF(robj); inst = PyObject_CallObject((PyObject *) type->clientdata, args); Py_DECREF(args); if (inst) { if (own) { PyObject_SetAttrString(inst,(char*)"thisown",Py_True); } robj = inst; } } return robj; } SWIGRUNTIME PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { PyObject *robj = 0; if (!ptr) { Py_INCREF(Py_None); return Py_None; } #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name); #else { char result[SWIG_BUFFER_SIZE]; robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ? PyString_FromString(result) : 0; } #endif return robj; } /* -----------------------------------------------------------------------------* * Get type list * -----------------------------------------------------------------------------*/ #ifdef SWIG_LINK_RUNTIME void *SWIG_ReturnGlobalTypeList(void *); #endif SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void) { static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; } } #endif return (swig_module_info *) type_pointer; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); } } #ifdef __cplusplus } #endif /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_c_geometry swig_types[0] #define SWIGTYPE_p_char swig_types[1] #define SWIGTYPE_p_double swig_types[2] #define SWIGTYPE_p_nec_antenna_input swig_types[3] #define SWIGTYPE_p_nec_context swig_types[4] #define SWIGTYPE_p_nec_ground swig_types[5] #define SWIGTYPE_p_nec_near_field_pattern swig_types[6] #define SWIGTYPE_p_nec_norm_rx_pattern swig_types[7] #define SWIGTYPE_p_nec_radiation_pattern swig_types[8] #define SWIGTYPE_p_nec_structure_currents swig_types[9] #define SWIGTYPE_p_nec_structure_excitation swig_types[10] #define SWIGTYPE_p_safe_arrayTdouble_t swig_types[11] #define SWIGTYPE_p_safe_arrayTint_t swig_types[12] #define SWIGTYPE_p_safe_arrayTstd__complexTdouble_t_t swig_types[13] #define SWIGTYPE_p_std__complexTdouble_t swig_types[14] #define SWIGTYPE_p_string swig_types[15] #define SWIGTYPE_ptrdiff_t swig_types[16] #define SWIGTYPE_size_t swig_types[17] #define SWIGTYPE_std__ptrdiff_t swig_types[18] #define SWIGTYPE_std__size_t swig_types[19] static swig_type_info *swig_types[20]; static swig_module_info swig_module = {swig_types, 20, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ /*----------------------------------------------- @(target):= _PyNEC.so ------------------------------------------------*/ #define SWIG_init init_PyNEC #define SWIG_name "_PyNEC" #include #include "Python.h" #include "numarray/libnumarray.h" #include "math_util.h" #include "nec_context.h" #include "c_geometry.h" #include "nec_radiation_pattern.h" #include "nec_structure_currents.h" #include "nec_results.h" #include "nec_ground.h" #include "safe_array.h" #include #include SWIGINTERN int SWIG_CheckLongInRange(long value, long min_value, long max_value, const char *errmsg) { if (value < min_value) { if (errmsg) { PyErr_Format(PyExc_OverflowError, "value %ld is less than '%s' minimum %ld", value, errmsg, min_value); } return 0; } else if (value > max_value) { if (errmsg) { PyErr_Format(PyExc_OverflowError, "value %ld is greater than '%s' maximum %ld", value, errmsg, max_value); } return 0; } return 1; } SWIGINTERN int SWIG_AsVal_long(PyObject * obj, long* val) { if (PyInt_Check(obj)) { if (val) *val = PyInt_AS_LONG(obj); return 1; } if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return 1; } else { if (!val) PyErr_Clear(); return 0; } } if (val) { SWIG_type_error("long", obj); } return 0; } #if INT_MAX != LONG_MAX SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val) { const char* errmsg = val ? "int" : (char*)0; long v; if (SWIG_AsVal_long(obj, &v)) { if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) { if (val) *val = (int)(v); return 1; } else { return 0; } } else { PyErr_Clear(); } if (val) { SWIG_type_error(errmsg, obj); } return 0; } #else SWIGINTERNINLINE int SWIG_AsVal_int(PyObject *obj, int *val) { return SWIG_AsVal_long(obj,(long*)val); } #endif SWIGINTERNINLINE int SWIG_As_int(PyObject* obj) { int v; if (!SWIG_AsVal_int(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(int)); } return v; } SWIGINTERNINLINE int SWIG_Check_int(PyObject* obj) { return SWIG_AsVal_int(obj, (int*)0); } SWIGINTERN int SWIG_AsVal_double(PyObject *obj, double *val) { if (PyFloat_Check(obj)) { if (val) *val = PyFloat_AS_DOUBLE(obj); return 1; } if (PyInt_Check(obj)) { if (val) *val = PyInt_AS_LONG(obj); return 1; } if (PyLong_Check(obj)) { double v = PyLong_AsDouble(obj); if (!PyErr_Occurred()) { if (val) *val = v; return 1; } else { if (!val) PyErr_Clear(); return 0; } } if (val) { SWIG_type_error("double", obj); } return 0; } SWIGINTERNINLINE double SWIG_As_double(PyObject* obj) { double v; if (!SWIG_AsVal_double(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(double)); } return v; } SWIGINTERNINLINE int SWIG_Check_double(PyObject* obj) { return SWIG_AsVal_double(obj, (double*)0); } SWIGINTERN int SWIG_AsVal_bool(PyObject *obj, bool *val) { if (obj == Py_True) { if (val) *val = true; return 1; } if (obj == Py_False) { if (val) *val = false; return 1; } int res = 0; if (SWIG_AsVal_int(obj, &res)) { if (val) *val = res ? true : false; return 1; } else { PyErr_Clear(); } if (val) { SWIG_type_error("bool", obj); } return 0; } SWIGINTERNINLINE bool SWIG_As_bool(PyObject* obj) { bool v; if (!SWIG_AsVal_bool(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(bool)); } return v; } SWIGINTERNINLINE int SWIG_Check_bool(PyObject* obj) { return SWIG_AsVal_bool(obj, (bool*)0); } /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */ SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize) { static swig_type_info* pchar_info = 0; char* vptr = 0; if (!pchar_info) pchar_info = SWIG_TypeQuery("char *"); if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) { if (cptr) *cptr = vptr; if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; return SWIG_OLDOBJ; } else { PyErr_Clear(); if (PyString_Check(obj)) { if (cptr) { *cptr = PyString_AS_STRING(obj); if (psize) { *psize = PyString_GET_SIZE(obj) + 1; } } return SWIG_PYSTR; } } if (cptr) { SWIG_type_error("char *", obj); } return 0; } SWIGINTERNINLINE int SWIG_AsCharPtr(PyObject *obj, char **val) { if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) { return 1; } if (val) { PyErr_Clear(); SWIG_type_error("char *", obj); } return 0; } /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/ #define SWIG_From_double PyFloat_FromDouble /*@@*/ /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/ #define SWIG_From_int PyInt_FromLong /*@@*/ static nec_float nec_ground_get_relative_dielectric_constant(nec_ground *self){ return self->epsr; } static nec_float nec_ground_get_conductivity(nec_ground *self){ return self->sig; } static int nec_ground_get_radial_wire_count(nec_ground *self){ return self->radial_wire_count; } static nec_float nec_ground_get_radial_wire_length(nec_ground *self){ return self->radial_wire_count; } static nec_float nec_ground_get_radial_wire_radius(nec_ground *self){ return self->radial_wire_radius; } static nec_float nec_ground_get_cliff_edge_distance(nec_ground *self){ return self->cliff_edge_distance; } static nec_float nec_ground_get_cliff_height(nec_ground *self){ return self->cliff_height; } static nec_float nec_ground_get_relative_dielectric_constant2(nec_ground *self){ return self->epsr2; } static nec_float nec_ground_get_conductivity2(nec_ground *self){ return self->sig2; } #ifdef __cplusplus extern "C" { #endif static PyObject *_wrap_new_nec_context(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *result; if(!PyArg_ParseTuple(args,(char *)":new_nec_context")) goto fail; result = (nec_context *)new nec_context(); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_context, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_nec_context(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_nec_context",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; delete arg1; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_initialize(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_context_initialize",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; (arg1)->initialize(); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_geometry(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; c_geometry *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_context_get_geometry",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (c_geometry *)(arg1)->get_geometry(); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_c_geometry, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_input_parameters(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_antenna_input *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_input_parameters",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_antenna_input *)(arg1)->get_input_parameters(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_antenna_input, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_norm_rx_pattern(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_norm_rx_pattern *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_norm_rx_pattern",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_norm_rx_pattern *)(arg1)->get_norm_rx_pattern(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_norm_rx_pattern, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_radiation_pattern(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_radiation_pattern *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_radiation_pattern",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_radiation_pattern *)(arg1)->get_radiation_pattern(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_radiation_pattern, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_structure_excitation(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_structure_excitation *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_structure_excitation",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_structure_excitation *)(arg1)->get_structure_excitation(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_structure_excitation, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_near_field_pattern(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_near_field_pattern *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_near_field_pattern",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_near_field_pattern *)(arg1)->get_near_field_pattern(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_near_field_pattern, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_get_structure_currents(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; nec_structure_currents *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_get_structure_currents",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } result = (nec_structure_currents *)(arg1)->get_structure_currents(arg2); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_nec_structure_currents, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_geometry_complete(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:nec_context_geometry_complete",&obj0,&obj1,&obj2)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } (arg1)->geometry_complete(arg2,arg3); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_fr_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; nec_float arg4 ; nec_float arg5 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:nec_context_fr_card",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } (arg1)->fr_card(arg2,arg3,arg4,arg5); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_ld_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOO:nec_context_ld_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } (arg1)->ld_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_gn_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:nec_context_gn_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } (arg1)->gn_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_ex_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; enum excitation_type arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:nec_context_ex_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (enum excitation_type)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } (arg1)->ex_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_tl_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:nec_context_tl_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } (arg1)->tl_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_nt_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:nec_context_nt_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } (arg1)->nt_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_xq_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_xq_card",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } (arg1)->xq_card(arg2); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_gd_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; nec_float arg2 ; nec_float arg3 ; nec_float arg4 ; nec_float arg5 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:nec_context_gd_card",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (nec_float)(SWIG_As_double(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (nec_float)(SWIG_As_double(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } (arg1)->gd_card(arg2,arg3,arg4,arg5); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_rp_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; int arg6 ; int arg7 ; int arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; nec_float arg12 ; nec_float arg13 ; nec_float arg14 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; PyObject * obj12 = 0 ; PyObject * obj13 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOO:nec_context_rp_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (int)(SWIG_As_int(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (int)(SWIG_As_int(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (int)(SWIG_As_int(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } { arg12 = (nec_float)(SWIG_As_double(obj11)); if (SWIG_arg_fail(12)) SWIG_fail; } { arg13 = (nec_float)(SWIG_As_double(obj12)); if (SWIG_arg_fail(13)) SWIG_fail; } { arg14 = (nec_float)(SWIG_As_double(obj13)); if (SWIG_arg_fail(14)) SWIG_fail; } (arg1)->rp_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_pt_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:nec_context_pt_card",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } (arg1)->pt_card(arg2,arg3,arg4,arg5); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_pq_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:nec_context_pq_card",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } (arg1)->pq_card(arg2,arg3,arg4,arg5); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_kh_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; nec_float arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_kh_card",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (nec_float)(SWIG_As_double(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } (arg1)->kh_card(arg2); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_ne_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:nec_context_ne_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } (arg1)->ne_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_nh_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:nec_context_nh_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } (arg1)->nh_card(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_set_extended_thin_wire_kernel(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; bool arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:nec_context_set_extended_thin_wire_kernel",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (bool)(SWIG_As_bool(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } (arg1)->set_extended_thin_wire_kernel(arg2); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_cp_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:nec_context_cp_card",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } (arg1)->cp_card(arg2,arg3,arg4,arg5); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_nec_context_pl_card(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_context *arg1 = (nec_context *) 0 ; char *arg2 = (char *) 0 ; int arg3 ; int arg4 ; int arg5 ; int arg6 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOO:nec_context_pl_card",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_context, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { SWIG_arg_fail(2);SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (int)(SWIG_As_int(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } (arg1)->pl_card((char const *)arg2,arg3,arg4,arg5,arg6); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * nec_context_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_context, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_c_geometry_wire(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; int arg2 ; int arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; nec_float arg12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOO:c_geometry_wire",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } { arg12 = (nec_float)(SWIG_As_double(obj11)); if (SWIG_arg_fail(12)) SWIG_fail; } (arg1)->wire(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_arc(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; int arg2 ; int arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:c_geometry_arc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } (arg1)->arc(arg2,arg3,arg4,arg5,arg6,arg7); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_helix(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; nec_float arg2 ; nec_float arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; int arg9 ; int arg10 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:c_geometry_helix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (nec_float)(SWIG_As_double(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (nec_float)(SWIG_As_double(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (int)(SWIG_As_int(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (int)(SWIG_As_int(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } (arg1)->helix(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_move(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; nec_float arg2 ; nec_float arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; int arg8 ; int arg9 ; int arg10 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:c_geometry_move",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (nec_float)(SWIG_As_double(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (nec_float)(SWIG_As_double(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (int)(SWIG_As_int(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (int)(SWIG_As_int(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (int)(SWIG_As_int(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } (arg1)->move(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_reflect(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; int arg6 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOO:c_geometry_reflect",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (int)(SWIG_As_int(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } (arg1)->reflect(arg2,arg3,arg4,arg5,arg6); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_scale(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; nec_float arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:c_geometry_scale",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (nec_float)(SWIG_As_double(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } (arg1)->scale(arg2); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_c_geometry_patch(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; int arg2 ; int arg3 ; nec_float arg4 ; nec_float arg5 ; nec_float arg6 ; nec_float arg7 ; nec_float arg8 ; nec_float arg9 ; nec_float arg10 ; nec_float arg11 ; nec_float arg12 ; nec_float arg13 ; nec_float arg14 ; nec_float arg15 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; PyObject * obj12 = 0 ; PyObject * obj13 = 0 ; PyObject * obj14 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOOO:c_geometry_patch",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (nec_float)(SWIG_As_double(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (nec_float)(SWIG_As_double(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (nec_float)(SWIG_As_double(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (nec_float)(SWIG_As_double(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (nec_float)(SWIG_As_double(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { arg9 = (nec_float)(SWIG_As_double(obj8)); if (SWIG_arg_fail(9)) SWIG_fail; } { arg10 = (nec_float)(SWIG_As_double(obj9)); if (SWIG_arg_fail(10)) SWIG_fail; } { arg11 = (nec_float)(SWIG_As_double(obj10)); if (SWIG_arg_fail(11)) SWIG_fail; } { arg12 = (nec_float)(SWIG_As_double(obj11)); if (SWIG_arg_fail(12)) SWIG_fail; } { arg13 = (nec_float)(SWIG_As_double(obj12)); if (SWIG_arg_fail(13)) SWIG_fail; } { arg14 = (nec_float)(SWIG_As_double(obj13)); if (SWIG_arg_fail(14)) SWIG_fail; } { arg15 = (nec_float)(SWIG_As_double(obj14)); if (SWIG_arg_fail(15)) SWIG_fail; } (arg1)->patch(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_new_c_geometry(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *result; if(!PyArg_ParseTuple(args,(char *)":new_c_geometry")) goto fail; result = (c_geometry *)new c_geometry(); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_c_geometry, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_c_geometry(PyObject *, PyObject *args) { PyObject *resultobj = NULL; c_geometry *arg1 = (c_geometry *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_c_geometry",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_c_geometry, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; delete arg1; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * c_geometry_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_c_geometry, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_radiation_pattern_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_gain(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_gain",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_gain(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_gain_vert(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_gain_vert",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_gain_vert(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_gain_horiz(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_gain_horiz",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_gain_horiz(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_gain_tot(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_gain_tot",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_gain_tot(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_pol_axial_ratio(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_pol_axial_ratio",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_pol_axial_ratio(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_pol_tilt(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_pol_tilt",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_pol_tilt(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_pol_sense_index(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_pol_sense_index",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_pol_sense_index(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tLong, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_e_theta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_e_theta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_e_theta(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_e_phi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_e_phi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_e_phi(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_e_r(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; SwigValueWrapper > > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_e_r",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_e_r(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_normalization_factor(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_normalization_factor",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_normalization_factor(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_maximum_gain_db(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_maximum_gain_db",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_maximum_gain_db(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_delta_theta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_delta_theta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_delta_theta(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_theta_start(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_theta_start",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_theta_start(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_delta_phi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_delta_phi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_delta_phi(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_phi_start(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_phi_start",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_phi_start(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_ntheta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_ntheta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)((nec_radiation_pattern const *)arg1)->get_ntheta(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_nphi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_nphi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)((nec_radiation_pattern const *)arg1)->get_nphi(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_average_power_gain(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_average_power_gain",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_average_power_gain(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_average_power_solid_angle(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_average_power_solid_angle",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_average_power_solid_angle(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_ground(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_ground result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_ground",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_ground(); { nec_ground * resultptr; resultptr = new nec_ground((nec_ground &)(result)); resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_nec_ground, 1); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_range(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_range",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_range(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_wavelength(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_wavelength",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_wavelength(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_ifar(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_ifar",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_ifar(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_rp_normalization(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_rp_normalization",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_rp_normalization(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_rp_output_format(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_rp_output_format",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_rp_output_format(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_rp_power_average(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_rp_power_average",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_rp_power_average(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_radiation_pattern_get_rp_ipd(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_radiation_pattern *arg1 = (nec_radiation_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_radiation_pattern_get_rp_ipd",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_radiation_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_rp_ipd(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject * nec_radiation_pattern_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_radiation_pattern, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_norm_rx_pattern_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_n_theta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_n_theta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_n_theta(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_n_phi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_n_phi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_n_phi(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_theta_start(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_theta_start",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_theta_start(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_phi_start(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_phi_start",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_phi_start(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_delta_theta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_delta_theta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_delta_theta(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_delta_phi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_delta_phi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_delta_phi(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_eta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_eta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_eta(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_axial_ratio(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_axial_ratio",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_axial_ratio(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_segment_number(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_segment_number",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_segment_number(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_type(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; string result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_type",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_type(); { string * resultptr; resultptr = new string((string &)(result)); resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_string, 1); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_norm_factor(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_norm_factor",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_norm_factor(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_norm_rx_pattern_get_mag(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_norm_rx_pattern *arg1 = (nec_norm_rx_pattern *) 0 ; SwigValueWrapper > result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_norm_rx_pattern_get_mag",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_norm_rx_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_mag(); { int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)((&result)->get_ptr()), tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject * nec_norm_rx_pattern_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_norm_rx_pattern, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_structure_excitation_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_excitation_get_tag(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_tag",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_tag(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_excitation_get_segment(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_segment",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_segment(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_excitation_get_current(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_current",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_excitation_get_voltage(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_voltage",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_voltage(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_excitation_get_power(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_excitation *arg1 = (nec_structure_excitation *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_excitation_get_power",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_excitation, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_power(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject * nec_structure_excitation_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_structure_excitation, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_antenna_input_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_antenna_input_get_tag(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_tag",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_tag(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_antenna_input_get_segment(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_segment",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_segment(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_antenna_input_get_current(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_current",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_antenna_input_get_voltage(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_voltage",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_voltage(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_antenna_input_get_power(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_antenna_input *arg1 = (nec_antenna_input *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_antenna_input_get_power",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_antenna_input, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_power(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject * nec_antenna_input_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_antenna_input, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_near_field_pattern_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_nfeh(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_nfeh",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_nfeh(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_field_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_field_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_field_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_field_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_field_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_field_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_near_field_pattern_get_field_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_near_field_pattern *arg1 = (nec_near_field_pattern *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_near_field_pattern_get_field_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_near_field_pattern, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_field_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject * nec_near_field_pattern_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_near_field_pattern, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_structure_currents_get_frequency(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_frequency",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)(arg1)->get_frequency(); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_iptflg(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_iptflg",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_iptflg(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_iptflq(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_iptflq",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_iptflq(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_n(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_n",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_n(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_m(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_m",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)(arg1)->get_m(); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_number(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_number",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_number(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_tag(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_tag",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_tag(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_center_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_center_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_center_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_center_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_center_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_center_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_center_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_center_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_center_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_segment_length(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_segment_length",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_segment_length(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_theta(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_theta",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_theta(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current_phi(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current_phi",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current_phi(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_current(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_current",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_current(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_number(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_number",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_number(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_tag(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_tag",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_tag(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_center_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_center_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_center_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_center_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_center_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_center_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_center_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_center_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_center_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density_segment_length(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density_segment_length",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density_segment_length(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_q_density(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_q_density",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_q_density(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_number(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_number",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_number(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tInt32, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_center_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_center_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_center_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_center_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_center_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_center_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_center_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_center_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_center_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tFloat64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_tangent_vector1(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_tangent_vector1",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_tangent_vector1(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_tangent_vector2(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_tangent_vector2",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_tangent_vector2(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_e_x(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_e_x",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_e_x(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_e_y(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_e_y",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_e_y(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_structure_currents_get_patch_e_z(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_structure_currents *arg1 = (nec_structure_currents *) 0 ; vector result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_structure_currents_get_patch_e_z",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_structure_currents, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (arg1)->get_patch_e_z(); { vector::pointer ptr = &(result[0]); int nd = 1; int size = (&result)->size(); resultobj =(PyObject *)(NA_NewArray((void *)ptr, tComplex64, nd, size)); } return resultobj; fail: return NULL; } static PyObject * nec_structure_currents_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_structure_currents, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_nec_ground_get_relative_dielectric_constant(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_relative_dielectric_constant",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_relative_dielectric_constant(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_conductivity(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_conductivity",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_conductivity(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_radial_wire_count(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_radial_wire_count",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int)nec_ground_get_radial_wire_count(arg1); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_radial_wire_length(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_radial_wire_length",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_radial_wire_length(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_radial_wire_radius(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_radial_wire_radius",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_radial_wire_radius(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_cliff_edge_distance(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_cliff_edge_distance",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_cliff_edge_distance(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_cliff_height(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_cliff_height",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_cliff_height(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_relative_dielectric_constant2(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_relative_dielectric_constant2",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_relative_dielectric_constant2(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_nec_ground_get_conductivity2(PyObject *, PyObject *args) { PyObject *resultobj = NULL; nec_ground *arg1 = (nec_ground *) 0 ; nec_float result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:nec_ground_get_conductivity2",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_nec_ground, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (nec_float)nec_ground_get_conductivity2(arg1); { resultobj = SWIG_From_double((double)(result)); } return resultobj; fail: return NULL; } static PyObject * nec_ground_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_nec_ground, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyMethodDef SwigMethods[] = { { (char *)"new_nec_context", _wrap_new_nec_context, METH_VARARGS, NULL}, { (char *)"delete_nec_context", _wrap_delete_nec_context, METH_VARARGS, NULL}, { (char *)"nec_context_initialize", _wrap_nec_context_initialize, METH_VARARGS, NULL}, { (char *)"nec_context_get_geometry", _wrap_nec_context_get_geometry, METH_VARARGS, NULL}, { (char *)"nec_context_get_input_parameters", _wrap_nec_context_get_input_parameters, METH_VARARGS, NULL}, { (char *)"nec_context_get_norm_rx_pattern", _wrap_nec_context_get_norm_rx_pattern, METH_VARARGS, NULL}, { (char *)"nec_context_get_radiation_pattern", _wrap_nec_context_get_radiation_pattern, METH_VARARGS, NULL}, { (char *)"nec_context_get_structure_excitation", _wrap_nec_context_get_structure_excitation, METH_VARARGS, NULL}, { (char *)"nec_context_get_near_field_pattern", _wrap_nec_context_get_near_field_pattern, METH_VARARGS, NULL}, { (char *)"nec_context_get_structure_currents", _wrap_nec_context_get_structure_currents, METH_VARARGS, NULL}, { (char *)"nec_context_geometry_complete", _wrap_nec_context_geometry_complete, METH_VARARGS, NULL}, { (char *)"nec_context_fr_card", _wrap_nec_context_fr_card, METH_VARARGS, NULL}, { (char *)"nec_context_ld_card", _wrap_nec_context_ld_card, METH_VARARGS, NULL}, { (char *)"nec_context_gn_card", _wrap_nec_context_gn_card, METH_VARARGS, NULL}, { (char *)"nec_context_ex_card", _wrap_nec_context_ex_card, METH_VARARGS, NULL}, { (char *)"nec_context_tl_card", _wrap_nec_context_tl_card, METH_VARARGS, NULL}, { (char *)"nec_context_nt_card", _wrap_nec_context_nt_card, METH_VARARGS, NULL}, { (char *)"nec_context_xq_card", _wrap_nec_context_xq_card, METH_VARARGS, NULL}, { (char *)"nec_context_gd_card", _wrap_nec_context_gd_card, METH_VARARGS, NULL}, { (char *)"nec_context_rp_card", _wrap_nec_context_rp_card, METH_VARARGS, NULL}, { (char *)"nec_context_pt_card", _wrap_nec_context_pt_card, METH_VARARGS, NULL}, { (char *)"nec_context_pq_card", _wrap_nec_context_pq_card, METH_VARARGS, NULL}, { (char *)"nec_context_kh_card", _wrap_nec_context_kh_card, METH_VARARGS, NULL}, { (char *)"nec_context_ne_card", _wrap_nec_context_ne_card, METH_VARARGS, NULL}, { (char *)"nec_context_nh_card", _wrap_nec_context_nh_card, METH_VARARGS, NULL}, { (char *)"nec_context_set_extended_thin_wire_kernel", _wrap_nec_context_set_extended_thin_wire_kernel, METH_VARARGS, NULL}, { (char *)"nec_context_cp_card", _wrap_nec_context_cp_card, METH_VARARGS, NULL}, { (char *)"nec_context_pl_card", _wrap_nec_context_pl_card, METH_VARARGS, NULL}, { (char *)"nec_context_swigregister", nec_context_swigregister, METH_VARARGS, NULL}, { (char *)"c_geometry_wire", _wrap_c_geometry_wire, METH_VARARGS, NULL}, { (char *)"c_geometry_arc", _wrap_c_geometry_arc, METH_VARARGS, NULL}, { (char *)"c_geometry_helix", _wrap_c_geometry_helix, METH_VARARGS, NULL}, { (char *)"c_geometry_move", _wrap_c_geometry_move, METH_VARARGS, NULL}, { (char *)"c_geometry_reflect", _wrap_c_geometry_reflect, METH_VARARGS, NULL}, { (char *)"c_geometry_scale", _wrap_c_geometry_scale, METH_VARARGS, NULL}, { (char *)"c_geometry_patch", _wrap_c_geometry_patch, METH_VARARGS, NULL}, { (char *)"new_c_geometry", _wrap_new_c_geometry, METH_VARARGS, NULL}, { (char *)"delete_c_geometry", _wrap_delete_c_geometry, METH_VARARGS, NULL}, { (char *)"c_geometry_swigregister", c_geometry_swigregister, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_frequency", _wrap_nec_radiation_pattern_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_gain", _wrap_nec_radiation_pattern_get_gain, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_gain_vert", _wrap_nec_radiation_pattern_get_gain_vert, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_gain_horiz", _wrap_nec_radiation_pattern_get_gain_horiz, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_gain_tot", _wrap_nec_radiation_pattern_get_gain_tot, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_pol_axial_ratio", _wrap_nec_radiation_pattern_get_pol_axial_ratio, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_pol_tilt", _wrap_nec_radiation_pattern_get_pol_tilt, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_pol_sense_index", _wrap_nec_radiation_pattern_get_pol_sense_index, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_e_theta", _wrap_nec_radiation_pattern_get_e_theta, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_e_phi", _wrap_nec_radiation_pattern_get_e_phi, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_e_r", _wrap_nec_radiation_pattern_get_e_r, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_normalization_factor", _wrap_nec_radiation_pattern_get_normalization_factor, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_maximum_gain_db", _wrap_nec_radiation_pattern_get_maximum_gain_db, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_delta_theta", _wrap_nec_radiation_pattern_get_delta_theta, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_theta_start", _wrap_nec_radiation_pattern_get_theta_start, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_delta_phi", _wrap_nec_radiation_pattern_get_delta_phi, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_phi_start", _wrap_nec_radiation_pattern_get_phi_start, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_ntheta", _wrap_nec_radiation_pattern_get_ntheta, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_nphi", _wrap_nec_radiation_pattern_get_nphi, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_average_power_gain", _wrap_nec_radiation_pattern_get_average_power_gain, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_average_power_solid_angle", _wrap_nec_radiation_pattern_get_average_power_solid_angle, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_ground", _wrap_nec_radiation_pattern_get_ground, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_range", _wrap_nec_radiation_pattern_get_range, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_wavelength", _wrap_nec_radiation_pattern_get_wavelength, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_ifar", _wrap_nec_radiation_pattern_get_ifar, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_rp_normalization", _wrap_nec_radiation_pattern_get_rp_normalization, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_rp_output_format", _wrap_nec_radiation_pattern_get_rp_output_format, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_rp_power_average", _wrap_nec_radiation_pattern_get_rp_power_average, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_get_rp_ipd", _wrap_nec_radiation_pattern_get_rp_ipd, METH_VARARGS, NULL}, { (char *)"nec_radiation_pattern_swigregister", nec_radiation_pattern_swigregister, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_frequency", _wrap_nec_norm_rx_pattern_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_n_theta", _wrap_nec_norm_rx_pattern_get_n_theta, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_n_phi", _wrap_nec_norm_rx_pattern_get_n_phi, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_theta_start", _wrap_nec_norm_rx_pattern_get_theta_start, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_phi_start", _wrap_nec_norm_rx_pattern_get_phi_start, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_delta_theta", _wrap_nec_norm_rx_pattern_get_delta_theta, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_delta_phi", _wrap_nec_norm_rx_pattern_get_delta_phi, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_eta", _wrap_nec_norm_rx_pattern_get_eta, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_axial_ratio", _wrap_nec_norm_rx_pattern_get_axial_ratio, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_segment_number", _wrap_nec_norm_rx_pattern_get_segment_number, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_type", _wrap_nec_norm_rx_pattern_get_type, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_norm_factor", _wrap_nec_norm_rx_pattern_get_norm_factor, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_get_mag", _wrap_nec_norm_rx_pattern_get_mag, METH_VARARGS, NULL}, { (char *)"nec_norm_rx_pattern_swigregister", nec_norm_rx_pattern_swigregister, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_frequency", _wrap_nec_structure_excitation_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_tag", _wrap_nec_structure_excitation_get_tag, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_segment", _wrap_nec_structure_excitation_get_segment, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_current", _wrap_nec_structure_excitation_get_current, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_voltage", _wrap_nec_structure_excitation_get_voltage, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_get_power", _wrap_nec_structure_excitation_get_power, METH_VARARGS, NULL}, { (char *)"nec_structure_excitation_swigregister", nec_structure_excitation_swigregister, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_frequency", _wrap_nec_antenna_input_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_tag", _wrap_nec_antenna_input_get_tag, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_segment", _wrap_nec_antenna_input_get_segment, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_current", _wrap_nec_antenna_input_get_current, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_voltage", _wrap_nec_antenna_input_get_voltage, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_get_power", _wrap_nec_antenna_input_get_power, METH_VARARGS, NULL}, { (char *)"nec_antenna_input_swigregister", nec_antenna_input_swigregister, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_frequency", _wrap_nec_near_field_pattern_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_nfeh", _wrap_nec_near_field_pattern_get_nfeh, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_x", _wrap_nec_near_field_pattern_get_x, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_y", _wrap_nec_near_field_pattern_get_y, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_z", _wrap_nec_near_field_pattern_get_z, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_field_x", _wrap_nec_near_field_pattern_get_field_x, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_field_y", _wrap_nec_near_field_pattern_get_field_y, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_get_field_z", _wrap_nec_near_field_pattern_get_field_z, METH_VARARGS, NULL}, { (char *)"nec_near_field_pattern_swigregister", nec_near_field_pattern_swigregister, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_frequency", _wrap_nec_structure_currents_get_frequency, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_iptflg", _wrap_nec_structure_currents_get_iptflg, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_iptflq", _wrap_nec_structure_currents_get_iptflq, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_n", _wrap_nec_structure_currents_get_n, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_m", _wrap_nec_structure_currents_get_m, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_number", _wrap_nec_structure_currents_get_current_segment_number, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_tag", _wrap_nec_structure_currents_get_current_segment_tag, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_center_x", _wrap_nec_structure_currents_get_current_segment_center_x, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_center_y", _wrap_nec_structure_currents_get_current_segment_center_y, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_center_z", _wrap_nec_structure_currents_get_current_segment_center_z, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_segment_length", _wrap_nec_structure_currents_get_current_segment_length, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_theta", _wrap_nec_structure_currents_get_current_theta, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current_phi", _wrap_nec_structure_currents_get_current_phi, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_current", _wrap_nec_structure_currents_get_current, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_number", _wrap_nec_structure_currents_get_q_density_segment_number, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_tag", _wrap_nec_structure_currents_get_q_density_segment_tag, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_center_x", _wrap_nec_structure_currents_get_q_density_segment_center_x, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_center_y", _wrap_nec_structure_currents_get_q_density_segment_center_y, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_center_z", _wrap_nec_structure_currents_get_q_density_segment_center_z, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density_segment_length", _wrap_nec_structure_currents_get_q_density_segment_length, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_q_density", _wrap_nec_structure_currents_get_q_density, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_number", _wrap_nec_structure_currents_get_patch_number, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_center_x", _wrap_nec_structure_currents_get_patch_center_x, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_center_y", _wrap_nec_structure_currents_get_patch_center_y, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_center_z", _wrap_nec_structure_currents_get_patch_center_z, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_tangent_vector1", _wrap_nec_structure_currents_get_patch_tangent_vector1, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_tangent_vector2", _wrap_nec_structure_currents_get_patch_tangent_vector2, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_e_x", _wrap_nec_structure_currents_get_patch_e_x, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_e_y", _wrap_nec_structure_currents_get_patch_e_y, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_get_patch_e_z", _wrap_nec_structure_currents_get_patch_e_z, METH_VARARGS, NULL}, { (char *)"nec_structure_currents_swigregister", nec_structure_currents_swigregister, METH_VARARGS, NULL}, { (char *)"nec_ground_get_relative_dielectric_constant", _wrap_nec_ground_get_relative_dielectric_constant, METH_VARARGS, NULL}, { (char *)"nec_ground_get_conductivity", _wrap_nec_ground_get_conductivity, METH_VARARGS, NULL}, { (char *)"nec_ground_get_radial_wire_count", _wrap_nec_ground_get_radial_wire_count, METH_VARARGS, NULL}, { (char *)"nec_ground_get_radial_wire_length", _wrap_nec_ground_get_radial_wire_length, METH_VARARGS, NULL}, { (char *)"nec_ground_get_radial_wire_radius", _wrap_nec_ground_get_radial_wire_radius, METH_VARARGS, NULL}, { (char *)"nec_ground_get_cliff_edge_distance", _wrap_nec_ground_get_cliff_edge_distance, METH_VARARGS, NULL}, { (char *)"nec_ground_get_cliff_height", _wrap_nec_ground_get_cliff_height, METH_VARARGS, NULL}, { (char *)"nec_ground_get_relative_dielectric_constant2", _wrap_nec_ground_get_relative_dielectric_constant2, METH_VARARGS, NULL}, { (char *)"nec_ground_get_conductivity2", _wrap_nec_ground_get_conductivity2, METH_VARARGS, NULL}, { (char *)"nec_ground_swigregister", nec_ground_swigregister, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_c_geometry = {"_p_c_geometry", "c_geometry *", 0, 0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *|nec_float *", 0, 0, 0}; static swig_type_info _swigt__p_nec_antenna_input = {"_p_nec_antenna_input", "nec_antenna_input *", 0, 0, 0}; static swig_type_info _swigt__p_nec_context = {"_p_nec_context", "nec_context *", 0, 0, 0}; static swig_type_info _swigt__p_nec_ground = {"_p_nec_ground", "nec_ground *", 0, 0, 0}; static swig_type_info _swigt__p_nec_near_field_pattern = {"_p_nec_near_field_pattern", "nec_near_field_pattern *", 0, 0, 0}; static swig_type_info _swigt__p_nec_norm_rx_pattern = {"_p_nec_norm_rx_pattern", "nec_norm_rx_pattern *", 0, 0, 0}; static swig_type_info _swigt__p_nec_radiation_pattern = {"_p_nec_radiation_pattern", "nec_radiation_pattern *", 0, 0, 0}; static swig_type_info _swigt__p_nec_structure_currents = {"_p_nec_structure_currents", "nec_structure_currents *", 0, 0, 0}; static swig_type_info _swigt__p_nec_structure_excitation = {"_p_nec_structure_excitation", "nec_structure_excitation *", 0, 0, 0}; static swig_type_info _swigt__p_safe_arrayTdouble_t = {"_p_safe_arrayTdouble_t", "safe_array *|real_array *", 0, 0, 0}; static swig_type_info _swigt__p_safe_arrayTint_t = {"_p_safe_arrayTint_t", "safe_array *|int_array *", 0, 0, 0}; static swig_type_info _swigt__p_safe_arrayTstd__complexTdouble_t_t = {"_p_safe_arrayTstd__complexTdouble_t_t", "safe_array > *|complex_array *", 0, 0, 0}; static swig_type_info _swigt__p_std__complexTdouble_t = {"_p_std__complexTdouble_t", "std::complex *|nec_complex *", 0, 0, 0}; static swig_type_info _swigt__p_string = {"_p_string", "string *", 0, 0, 0}; static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0}; static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0}; static swig_type_info _swigt__std__ptrdiff_t = {"_std__ptrdiff_t", "std::ptrdiff_t", 0, 0, 0}; static swig_type_info _swigt__std__size_t = {"_std__size_t", "std::size_t", 0, 0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_c_geometry, &_swigt__p_char, &_swigt__p_double, &_swigt__p_nec_antenna_input, &_swigt__p_nec_context, &_swigt__p_nec_ground, &_swigt__p_nec_near_field_pattern, &_swigt__p_nec_norm_rx_pattern, &_swigt__p_nec_radiation_pattern, &_swigt__p_nec_structure_currents, &_swigt__p_nec_structure_excitation, &_swigt__p_safe_arrayTdouble_t, &_swigt__p_safe_arrayTint_t, &_swigt__p_safe_arrayTstd__complexTdouble_t_t, &_swigt__p_std__complexTdouble_t, &_swigt__p_string, &_swigt__ptrdiff_t, &_swigt__size_t, &_swigt__std__ptrdiff_t, &_swigt__std__size_t, }; static swig_cast_info _swigc__p_c_geometry[] = { {&_swigt__p_c_geometry, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_antenna_input[] = { {&_swigt__p_nec_antenna_input, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_context[] = { {&_swigt__p_nec_context, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_ground[] = { {&_swigt__p_nec_ground, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_near_field_pattern[] = { {&_swigt__p_nec_near_field_pattern, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_norm_rx_pattern[] = { {&_swigt__p_nec_norm_rx_pattern, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_radiation_pattern[] = { {&_swigt__p_nec_radiation_pattern, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_structure_currents[] = { {&_swigt__p_nec_structure_currents, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_nec_structure_excitation[] = { {&_swigt__p_nec_structure_excitation, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_safe_arrayTdouble_t[] = { {&_swigt__p_safe_arrayTdouble_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_safe_arrayTint_t[] = { {&_swigt__p_safe_arrayTint_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_safe_arrayTstd__complexTdouble_t_t[] = { {&_swigt__p_safe_arrayTstd__complexTdouble_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__complexTdouble_t[] = { {&_swigt__p_std__complexTdouble_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_string[] = { {&_swigt__p_string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__std__ptrdiff_t[] = { {&_swigt__std__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__std__size_t[] = { {&_swigt__std__size_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_c_geometry, _swigc__p_char, _swigc__p_double, _swigc__p_nec_antenna_input, _swigc__p_nec_context, _swigc__p_nec_ground, _swigc__p_nec_near_field_pattern, _swigc__p_nec_norm_rx_pattern, _swigc__p_nec_radiation_pattern, _swigc__p_nec_structure_currents, _swigc__p_nec_structure_excitation, _swigc__p_safe_arrayTdouble_t, _swigc__p_safe_arrayTint_t, _swigc__p_safe_arrayTstd__complexTdouble_t_t, _swigc__p_std__complexTdouble_t, _swigc__p_string, _swigc__ptrdiff_t, _swigc__size_t, _swigc__std__ptrdiff_t, _swigc__std__size_t, }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_const_info swig_const_table[] = { {0, 0, 0, 0.0, 0, 0}}; #ifdef __cplusplus } #endif /************************************************************************* * Type initialization: * This problem is tough by the requirement that no dynamic * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization. * The idea is that swig generates all the structures that are needed. * The runtime then collects these partially filled structures. * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * The generated swig_type_info structures are assigned staticly to an initial * array. We just loop though that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that * swig_cast_info to the linked list (because the cast->type) pointer will * be correct. **/ #ifdef __cplusplus extern "C" { #endif SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { swig_type_info *type, *ret; swig_cast_info *cast; size_t i; swig_module_info *module_head; static int init_run = 0; clientdata = clientdata; if (init_run) return; init_run = 1; /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (module_head) { swig_module.next = module_head->next; module_head->next = &swig_module; } else { /* This is the first module loaded */ swig_module.next = &swig_module; SWIG_SetModule(clientdata, &swig_module); } /* Now work on filling in swig_module.types */ for (i = 0; i < swig_module.size; ++i) { type = 0; /* if there is another module already loaded */ if (swig_module.next != &swig_module) { type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); } if (type) { /* Overwrite clientdata field */ if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata; } else { type = swig_module.type_initial[i]; } /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { /* Don't need to add information already in the list */ ret = 0; if (swig_module.next != &swig_module) { ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); } if (ret && type == swig_module.type_initial[i]) { cast->type = ret; ret = 0; } if (!ret) { if (type->cast) { type->cast->prev = cast; cast->next = type->cast; } type->cast = cast; } cast++; } /* Set entry in modules->types array equal to the type */ swig_module.types[i] = type; } } /* This function will propagate the clientdata field of type to * any new swig_type_info structures that have been added into the list * of equivalent types. It is like calling * SWIG_TypeClientData(type, clientdata) a second time. */ SWIGRUNTIME void SWIG_PropagateClientData(void) { size_t i; swig_cast_info *equiv; static int init_run = 0; if (init_run) return; init_run = 1; for (i = 0; i < swig_module.size; i++) { if (swig_module.types[i]->clientdata) { equiv = swig_module.types[i]->cast; while (equiv) { if (!equiv->converter) { if (equiv->type && !equiv->type->clientdata) SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); } equiv = equiv->next; } } } } #ifdef __cplusplus } #endif #ifdef __cplusplus extern "C" { #endif /* Python-specific SWIG API */ #define SWIG_newvarlink() SWIG_Python_newvarlink() #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) /* ----------------------------------------------------------------------------- * global variable support code. * ----------------------------------------------------------------------------- */ typedef struct swig_globalvar { char *name; /* Name of global variable */ PyObject *(*get_attr)(void); /* Return the current value */ int (*set_attr)(PyObject *); /* Set the value */ struct swig_globalvar *next; } swig_globalvar; typedef struct swig_varlinkobject { PyObject_HEAD swig_globalvar *vars; } swig_varlinkobject; SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *v) { v = v; return PyString_FromString(""); } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { swig_globalvar *var; flags = flags; fprintf(fp,"Swig global variables { "); for (var = v->vars; var; var=var->next) { fprintf(fp,"%s", var->name); if (var->next) fprintf(fp,", "); } fprintf(fp," }\n"); return 0; } SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n) { swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { return (*var->get_attr)(); } var = var->next; } PyErr_SetString(PyExc_NameError,"Unknown C global variable"); return NULL; } SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { return (*var->set_attr)(p); } var = var->next; } PyErr_SetString(PyExc_NameError,"Unknown C global variable"); return 1; } SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; static PyTypeObject varlink_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Number of items in variable part (ob_size) */ (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ 0, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ 0, /* tp_compare */ (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ varlink__doc__, /* tp_doc */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) varlink_type = tmp; type_init = 1; } #endif return &varlink_type; } /* Create a variable linking object for use later */ SWIGINTERN PyObject * SWIG_Python_newvarlink(void) { swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); if (result) { result->vars = 0; } return ((PyObject*) result); } SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { swig_varlinkobject *v = (swig_varlinkobject *) p; swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); if (gv) { size_t size = strlen(name)+1; gv->name = (char *)malloc(size); if (gv->name) { strncpy(gv->name,name,size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; } } v->vars = gv; } /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ /* Install Constants */ SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { PyObject *obj = 0; size_t i; for (i = 0; constants[i].type; ++i) { switch(constants[i].type) { case SWIG_PY_INT: obj = PyInt_FromLong(constants[i].lvalue); break; case SWIG_PY_FLOAT: obj = PyFloat_FromDouble(constants[i].dvalue); break; case SWIG_PY_STRING: if (constants[i].pvalue) { obj = PyString_FromString((char *) constants[i].pvalue); } else { Py_INCREF(Py_None); obj = Py_None; } break; case SWIG_PY_POINTER: obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); break; case SWIG_PY_BINARY: obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); break; default: obj = 0; break; } if (obj) { PyDict_SetItemString(d,constants[i].name,obj); Py_DECREF(obj); } } } /* -----------------------------------------------------------------------------*/ /* Fix SwigMethods to carry the callback ptrs when needed */ /* -----------------------------------------------------------------------------*/ SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { char *c = methods[i].ml_doc; if (c && (c = strstr(c, "swig_ptr: "))) { int j; swig_const_info *ci = 0; char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, strlen(const_table[j].name)) == 0) { ci = &(const_table[j]); break; } } if (ci) { size_t shift = (ci->ptype) - types; swig_type_info *ty = types_initial[shift]; size_t ldoc = (c - methods[i].ml_doc); size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; if (ptr) { strncpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; strncpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; } } } } } } /* -----------------------------------------------------------------------------* * Initialize type list * -----------------------------------------------------------------------------*/ #if PY_MAJOR_VERSION < 2 /* PyModule_AddObject function was introduced in Python 2.0. The following function is copied out of Python/modsupport.c in python version 2.3.4 */ SWIGINTERN int PyModule_AddObject(PyObject *m, char *name, PyObject *o) { PyObject *dict; if (!PyModule_Check(m)) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); return -1; } if (!o) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); return -1; } dict = PyModule_GetDict(m); if (dict == NULL) { /* Internal error -- modules must have a dict! */ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", PyModule_GetName(m)); return -1; } if (PyDict_SetItemString(dict, name, o)) return -1; Py_DECREF(o); return 0; } #endif #ifdef __cplusplus } #endif /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIG_init(void) { static PyObject *SWIG_globals = 0; PyObject *m, *d; if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); m = Py_InitModule((char *) SWIG_name, SwigMethods); d = PyModule_GetDict(m); SWIG_InitializeModule(0); SWIG_InstallConstants(d,swig_const_table); import_libnumarray(); } necpp-1.5.0+cvs20101003/Python/swig_output/PyNEC_wrap.o0000644000175000017500000066743410322432605020724 0ustar numanumaELF4(U‰ĺě‹E;E td‹E;EuëZ‹E€8 u‹E;E uë˙Eëé‹E€8 u‹E;EuëŤE˙ëç‹E‹UŠ:t‹Eľ‹Uľ)ЉEüë!˙EŤE˙딋U‹E )Љ‹M‹E)Č)‰Uü‹EüÉĂU‰ĺěÇEüě ˙u čü˙˙˙ÄE ‰Eř‹E‰Eô}üuY‹Eô€8uëO‹Eô‰E‹Eô€8uë‹Eô€8|uëŤEô˙ëĺ˙uř˙u ˙uô˙uč˙˙˙Ä…Ŕ”Ŕ¶Ŕ‰Eü‹Eô€8t¨ŤEô˙롋EüÉĂU‰ĺěÇEüě ˙u čü˙˙˙ÄE ‰Eř‹E‰Eô}üuY‹Eô€8uëO‹Eô‰E‹Eô€8uë‹Eô€8|uëŤEô˙ëĺ˙uř˙u ˙uô˙uč{ţ˙˙Ä…Ŕ”Ŕ¶Ŕ‰Eü‹Eô€8t¨ŤEô˙롋EüÉĂU‰ĺě} „±‹E ‹@ ‰Eü}üuéť‹Eü‹ě˙u˙0čü˙˙˙Ä…Ŕuv‹U ‹Eü;B u‹Eü‰Eřëx‹Eü‹P ‹Eü‹@‰B‹Eüxt‹Eü‹P‹Eü‹@ ‰B ‹Uü‹E ‹@ ‰B‹EüÇ@ ‹E x t ‹E ‹P ‹Eü‰B ‹E ‹Uü‰P ‹Eü‰Eřë‹Eü‹@‰EüéX˙˙˙ÇEř‹EřÉĂU‰ĺě} „˘‹E ‹@ ‰Eü}üu鎋Eü‹;Euv‹U ‹Eü;B u‹Eü‰Eřëx‹Eü‹P ‹Eü‹@‰B‹Eüxt‹Eü‹P‹Eü‹@ ‰B ‹Uü‹E ‹@ ‰B‹EüÇ@ ‹E x t ‹E ‹P ‹Eü‰B ‹E ‹Uü‰P ‹Eü‰Eřë‹Eü‹@‰Eüég˙˙˙ÇEř‹EřÉĂU‰ĺě‹E‰Eü}t ‹Exu‹E‰Eřë:}t-‹Exuë"ě ‹E˙u ‹@˙ĐĉE}tŐ‹E‰EüëÍ‹Eü‰Eř‹EřÉĂU‰ĺě ‹Ext:‹E‹@‰Eü‹E‹@‰Eř‹Eř€8uë‹Eř€8|u‹Eř@‰EüŤEř˙ëŕ‹Eü‰Eôë‹E‹‰Eô‹EôÉĂU‰ĺě‹ExuA‹E‹@ ‰Eü‹U‹E ‰B}üuë'‹Eüxuě˙u ‹Eü˙0čľ˙˙˙Ä‹Eü‹@‰EüëŃÉĂU‰ĺě(‹E‰Eü‹Eüx„™ÇEđ‹Eü‹@H‰Eě‹EđEě‰EčŃmč‹Mü‹E荅‹‹‹‰Eř}řt_ě˙uř˙učü˙˙˙ĉEä}äu‹Mü‹E荅‹‹‰EôëJ}äy}čt"‹EčH‰Eěë }ä~‹Eč@‰Eđ‹Eě9Eđ†x˙˙˙‹Eü‹@‰Eü‹Eü;E …E˙˙˙ÇEô‹EôÉĂU‰ĺěě˙u˙u ˙uč˙˙˙ĉEü}üt ‹Eü‰Eô鍋E‰EřÇEđ‹Eř‹Uđ;Prë[‹Mř‹EđŤ…‹‹xt>ě˙u‹Mř‹EđŤ…‹‹˙pčţú˙˙Ä…Ŕt‹Mř‹EđŤ…‹‹‰Eôë˙Eđë‹Eř‹@‰Eř‹Eř;E u€ÇEô‹EôÉĂU‰ĺě‹E ‰Eü‹EüE‰Eř‹Eř9Eüuë=‹EüŠ‹E‰ÂČŕđŔč¶ŔŠ€˙E‹E‰ÂČŕ¶ŔŠ€˙E˙Eüëą‹EÉĂU‰ĺě‹E ‰Eř‹UřU‰Uô‹Eô9Eřuéś‹EŠEó˙E€}ó/~€}ó9ŠUóę0UňŔeňë$€}ó`~€}ófŠEóčWEňŔeňë ÇEüëX‹EŠEó˙E€}ó/~€}ó9 ŠEóč0Eňë €}ó`~€}óf ŠEóčWEňë ÇEüëŠUň‹Eř˙EřéW˙˙˙‹E‰Eü‹EüÉĂU‰ĺě‹E‰Eü} w ÇEřëf‹EüĆ_ŤEü˙ějŤE P˙uüčťţ˙˙ĉEüě ˙učü˙˙˙ÄŤH‹U‹Eü)Љ‹E)Đ9Áv ÇEřëě˙u˙uüčü˙˙˙Ä‹E‰Eř‹EřÉĂU‰ĺě‹E€8_t1ěh˙učü˙˙˙Ä…Ŕu‹E Ç‹E‰Eüë"ÇEüëěj˙u ˙E˙uč^ţ˙˙ĉEü‹EüÉĂU‰ĺě‹E‰Eü}tě ˙učü˙˙˙ĉEđëÇEđ‹Eđ‰Eř‹EŃŕEřŔ;Ev ÇEôëL‹EüĆ_ŤEü˙ě˙u˙u ˙uüč‰ý˙˙ĉEü}řtě‹Eř@P˙u˙uüčü˙˙˙Äë‹EüĆ‹E‰Eô‹EôÉĂU‰ĺě‹E€8_t;ěh˙učü˙˙˙Ä…Ŕuě˙uj˙u čü˙˙˙Ä‹E‰Eüë#ÇEüëě˙u˙u ˙E˙učYý˙˙ĉEü‹EüÉĂU‰ĺěh‹E˙p ‹E˙pŤ…řű˙˙Pčňý˙˙Ä…ŔtGě˙u hčü˙˙˙Äě˙u Ť…řű˙˙Pčü˙˙˙Äě˙u h'čü˙˙˙ÄÇ…ôű˙˙ë Ç…ôű˙˙‹…ôű˙˙ÉĂU‰ĺěh‹E˙p ‹E˙pŤ…řű˙˙Pčlý˙˙Ä…Ŕt썅řű˙˙Ph)čü˙˙˙ĉ…ôű˙˙ë Ç…ôű˙˙‹…ôű˙˙ÉĂU‰ĺěh‹E˙p ‹E˙pŤ…řű˙˙Pčý˙˙Ä…Ŕtě Ť…řű˙˙Pčü˙˙˙ĉ…ôű˙˙ë Ç…ôű˙˙‹…ôű˙˙ÉĂU‰ĺěě ‹E˙pčü˙˙˙ÄÉĂU‰ĺěÇEüě jčü˙˙˙ĉEř}ř„Žěě˙u č±˙˙˙Ä Pj˙uřčü˙˙˙Ä…Ŕukě ˙učü˙˙˙ĉEô}ôt4ě˙uř˙uôčü˙˙˙ĉEü‹Eô˙8tëě ‹Eô‹@˙uô‹@˙ĐÄ‹Eř˙8tëě ‹Eř‹@˙uř‹@˙ĐÄ‹EüÉĂU‰ĺěě˙uh=č0˙˙˙ÄÉĂU‰ĺěě˙uh@č˙˙˙ÄÉĂU‰ĺě‹E ‹Uě˙p ˙r čü˙˙˙ĉEü}üt}ü~ ÇEěëÇEě˙˙˙˙‹Eě‰Eđë8‹E‹@‰Eř‹E ‹@‰Eô‹Eř;Eôr‹Eř;Eô—Ŕ¶Ŕ‰EčëÇEč˙˙˙˙‹Eč‰Eđ‹EđÉĂU‰ĺěě ˙učü˙˙˙ÄÉĂU‰ĺ¸ŕÉĂU‰ĺěěěčĺ˙˙˙ÄPěčŮ˙˙˙Ä˙pčü˙˙˙ÄPčü˙˙˙ĉEü}üt‹Uü‹E‰B‹Uü‹E ‰B ‹EüÉĂU‰ĺěě˙u hPčü˙˙˙Äě hj‹E˙p‹E˙pŤ…řű˙˙Pč~ű˙˙Ä …Ŕt(ě˙u h^čü˙˙˙Äě˙u Ť…řű˙˙Pčü˙˙˙Äě˙u ‹E˙p čü˙˙˙Äě˙u h'čü˙˙˙ĸÉĂU‰ĺěě hj‹E˙p‹E˙pŤ…řű˙˙Pčőú˙˙Ä …Ŕt%ě‹E˙p Ť…řű˙˙Phbčü˙˙˙ĉ…ôű˙˙ëě‹E˙p hxčü˙˙˙ĉ…ôű˙˙‹…ôű˙˙ÉĂU‰ĺěě hj‹E˙p‹E˙pŤ…řű˙˙Pčyú˙˙Ä …Ŕt%ě‹E˙p Ť…řű˙˙Ph‰čü˙˙˙ĉ…ôű˙˙ëě‹E˙p hŽčü˙˙˙ĉ…ôű˙˙‹…ôű˙˙ÉĂU‰ĺě(‹E ‹Uě˙p ˙r čü˙˙˙ĉEü}üt}ü~ ÇEčëÇEč˙˙˙˙‹Eč‰Eěëm‹E‹@‰Eř‹E ‹@‰Eô‹Eř;Eôr‹Eř;Eô—Ŕ¶Ŕ‰EäëÇEä˙˙˙˙‹Eä‰Eđ‹Eđ‰Eŕ}đu#‹E‹@Ńŕ‹U ‹MěP˙r˙qčü˙˙˙ĉEŕ‹Eŕ‰Eě‹EěÉĂU‰ĺěě ‹E˙pčü˙˙˙Äě ˙učü˙˙˙ÄÉĂU‰ĺ¸ŕÉĂU‰ĺěěěčĺ˙˙˙ÄPěčŮ˙˙˙Ä˙pčü˙˙˙ÄPčü˙˙˙ĉEü}üu ÇEôëUě ˙u čü˙˙˙ĉEř}řt7ě˙u ˙u˙uřčü˙˙˙Ä‹Uü‹Eř‰B‹Uü‹E‰B ‹Uü‹E ‰B‹Eü‰EôëÇEô‹EôÉĂU‰ĺě}„8} tKě ˙u čQÓÄ…Ŕt9ě ˙u č3ÓĉEü}ü„ę˙uü˙uh ˙5čü˙˙˙Äéý} t‹E ‹@‹@ ‰EđëÇEđ‹Eđ‰Eü}ü„ˇě ˙u čü˙˙˙ĉEř}řtě ˙uřčü˙˙˙ĉEěëÇEě‹Eě‰Eô}ôt!ě ˙uô˙uü˙uhŕ˙5čü˙˙˙Ä ë˙uü˙uh ˙5čü˙˙˙Ä}řuëS‹Eř˙8tëGě ‹Eř‹@˙uř‹@˙ĐÄë1ě˙uhE˙5čü˙˙˙ÄëěhX˙5čü˙˙˙ÄÉĂU‰ĺěčü˙˙˙…Ŕ„ÎÇEüÇEřÇEôěŤEôPŤEřPŤEüPčü˙˙˙Ä}ř„Źě ˙uřčü˙˙˙ĉEđ}üuë‹Eü˙čü˙˙˙} t$ě ˙uđčü˙˙˙ÄP˙uht˙uüčü˙˙˙Äë"˙uě˙uđčü˙˙˙Ä Pht˙uüčü˙˙˙Ä‹Eđ˙8tëě ‹Eđ‹@˙uđ‹@˙ĐÄÇEěëÇEě‹EěÉĂU‰ĺěčü˙˙˙…Ŕt8˙uhzhŤ…řţ˙˙Pčü˙˙˙ÄějŤ…řţ˙˙PčÓţ˙˙ĉ…ôţ˙˙ë Ç…ôţ˙˙‹…ôţ˙˙ÉĂU‰ĺě(ÇEřÇEôÇEđ}u ÇEäék}u‹E ÇÇEäéMě ˙učrĐÄ…Ŕ…‡= uě hŽčü˙˙˙ÄŁ ‹E‰Eđě˙5 ˙učü˙˙˙ĉEÇEô}uéúě ˙učĐÄ…Ŕu(‹E˙8téŮě ‹E‹@˙u‹@˙ĐÄéŔě ˙uč˝ĎĉEěě ˙uč¸ĎĉEř}ôt ‹E˙8tëě ‹E‹@˙u‹@˙ĐÄ}t6ě˙u˙uřčxî˙˙ĉEü}üuëVě˙uě˙uüčĎĉ‹E ‰ë‹U ‹Eě‰}đt"‹Eŕ…Ŕtěhh“˙uđčü˙˙˙ÄÇEäéđčü˙˙˙}đ„›}…‘‹Eđ‰E‹Exu‹E‹@‹@ ‰Eč}čtěh›˙uččü˙˙˙ĉEŕëÇEŕ‹Eŕ‰Eř}řtB}t ě‹E˙0ŤEěP‹EřŔ Pčjó˙˙ĉEÜëÇEÜ‹E܉Eř}ř…ăţ˙˙éV˙˙˙‹Eŕ„Ŕt5}tě˙u˙uč:ď˙˙ÄPčÝú˙˙Äëě˙uh¦čČú˙˙ÄÇEä˙˙˙˙‹EäÉĂU‰ĺě˙u˙u ŤEüP˙učJý˙˙Äř˙u7čü˙˙˙‹Eŕ„Ŕt(ě˙u˙u čĎî˙˙ÄPčrú˙˙Äě ˙uč˛ü˙˙Ä‹EüÉĂU‰ĺěÇEřě˙u˙u ˙učřÍĉEř}řuë+}tě˙u˙uřč‚ě˙˙ĉEü}üuë ÇEôëKčü˙˙˙‹Eŕ„Ŕt5}tě˙u˙uč6î˙˙ÄPčŮů˙˙Äëě˙uh´čÄů˙˙ÄÇEô˙˙˙˙‹EôÉĂU‰ĺěÇEü} u*čü˙˙˙…Ŕuěhŕ˙5čü˙˙˙Ä‹Eü‰Eđéô}u˙ÇEđéÜě‹E ˙0˙učßő˙˙ĉEü}üt }ütë ‹Eü‰Eđ骋E x„—ě˙uühčü˙˙˙ĉEô‹Eü˙8tëě ‹Eü‹@˙uü‹@˙ĐÄě˙uô‹E ˙pčü˙˙˙ĉEř‹Eô˙8tëě ‹Eô‹@˙uô‹@˙ĐÄ}řt$}těhh“˙uřčü˙˙˙Ä‹Eř‰Eü‹Eü‰Eđ‹EđÉĂU‰ĺěÇEü}u˙ÇEřëě‹E˙0˙u ˙uč©÷˙˙ĉEü‹Eü‰Eř‹EřÉĂU‰ĺě=¤u2ěh hčü˙˙˙Ä٤čü˙˙˙…Ŕtčü˙˙˙Ǥˇ¤ÉĂU‰ĺěě hôjjh¨hčü˙˙˙Ä ‰Eüěj˙učü˙˙˙ĉEř}řt}ütě˙uřh ˙uüčü˙˙˙ÄÉĂU‰ĺě‹E;E }.}tě ˙u ˙u˙uh@˙5čü˙˙˙Ä ÇEüë=‹E;E~.}tě ˙u˙u˙uh€˙5čü˙˙˙Ä ÇEüëÇEü‹EüÉĂU‰ĺě‹Extěh‹E˙pčü˙˙˙Ä…Ŕuë} t ‹E ‹U‹R‰ÇEř鍋Extěh‹E˙pčü˙˙˙Ä…ŔuëEě ˙učü˙˙˙ĉEüčü˙˙˙…Ŕu} t‹U ‹Eü‰ÇEřë4} učü˙˙˙ÇEřë } tě˙uh«čFö˙˙ÄÇEř‹EřÉĂU‰ĺě‹Extěh‹E˙pčü˙˙˙Ä…Ŕuë#} t‹M ‹E‹P ‹@‰‰QÇEôéŘ‹Extěh‹E˙pčü˙˙˙Ä…Ŕuë} t ‹U ‹EŰ@ÝÇEôé“‹Extěh‹E˙pčü˙˙˙Ä…ŔuëKě ˙učü˙˙˙ÄÝ]řčü˙˙˙…Ŕu} t‹M ‹Eř‹Uü‰‰QÇEôë4} učü˙˙˙ÇEôë } tě˙uh°čő˙˙ÄÇEô‹EôÉĂU‰ĺě}u} t‹E ĆÇEřë{}u} t‹E ĆÇEřë]ÇEüěŤEüP˙uč°ČÄ…Ŕt} t ‹U }ü•ŔÇEřë%čü˙˙˙} tě˙uh·čsô˙˙ÄÇEř‹EřÉĂU‰ĺěÇEü=ĐuěhĽh¸h¸čę˙˙ÄŁĐj˙5ĐŤEüP˙učĹö˙˙Äř˙tN} t‹U ‹Eü‰}t1‹E‰Eô}ütě ˙uüčü˙˙˙ĉEđ˙EđëÇEđ‹Eđ‹Uô‰ÇEřëyčü˙˙˙‹Extěh‹E˙pčü˙˙˙Ä…Ŕuë,} t‹U ‹EŔ‰}t ‹E‹U‹RB‰ÇEřë } tě˙uhĽčVó˙˙ÄÇEř‹EřÉĂU‰ĺě‹E‹P‹‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P ‹@‰Eř‰UüÝEřÉĂU‰ĺ‹E‹@ÉĂU‰ĺ‹EŰ@ÉĂU‰ĺě‹E‹P ‹@‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P(‹@$‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P0‹@,‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P8‹@4‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P@‹@<‰Eř‰UüÝEřÉĂU‰ĺě(ÇEüěhĂ˙u čü˙˙˙Ä…Ŕué”ě hŕ čü˙˙˙ĉEđĆEďě ˙uđčü˙˙˙ÄĆEď‹Eđ‰Eřë.‰Eä‹Eä‰Eč€}ďtě ˙uđčü˙˙˙Ä‹Eč‰Eäě ˙uäčü˙˙˙€}ďtě ˙uđčü˙˙˙Äěj˙5˙uřčř˙˙ĉEü‹Eü‰EôëÇEô‹EôÉĂU‰ĺěÇEüÇEřÇEôěŤEôPhÔ˙u čü˙˙˙Ä…ŔuëZj˙5ŤEřP˙uôč ô˙˙Äě jčŁó˙˙Ä…Ŕtë0}řtě ‹Eř‹Ŕ˙uř‹˙ĐÄ˙ÇEü‹Eü‰EđëÇEđ‹EđÉĂU‰ĺěÇEüÇEřÇEôěŤEôPhé˙u čü˙˙˙Ä…ŔuëMj˙5ŤEřP˙uôčnó˙˙Äě jčó˙˙Ä…Ŕtë#ě ˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EđëÇEđ‹EđÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh˙u čü˙˙˙Ä…Ŕuë\j˙5ŤEřP˙uđčÜň˙˙Äě jčsň˙˙Ä…Ŕtë2ě ˙uřčü˙˙˙ĉEôěj˙5˙uôčDö˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěč1ň˙˙Äě jčČń˙˙Ä…ŔtëYě ˙učč€ĂĉEôě jč¤ń˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5 ˙uđčrő˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh`˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěč_ń˙˙Äě jčöđ˙˙Ä…ŔtëYě ˙učč®ÂĉEôě jčŇđ˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5˙uđč ô˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěčŤđ˙˙Äě jč$đ˙˙Ä…ŔtëYě ˙uččÜÁĉEôě jčđ˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5 ˙uđčÎó˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPhŕ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěč»ď˙˙Äě jčRď˙˙Ä…ŔtëYě ˙učč ÁĉEôě jč.ď˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5(˙uđčüň˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěčéî˙˙Äě jč€î˙˙Ä…ŔtëYě ˙učč8ŔĉEôě jč\î˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5˙uđč*ň˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh`˙u čü˙˙˙Ä…Ŕuéj˙5ŤEřP˙uěčî˙˙Äě jč®í˙˙Ä…ŔtëYě ˙uččfżÄ‰Eôě jčŠí˙˙Ä…Ŕtë5ě˙uô˙uřčü˙˙˙ĉEđěj˙5$˙uđčXń˙˙ĉEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě(ÇEüÇEřÇEěÇEčÇEäě ŤEäPŤEčPŤEěPh ˙u čü˙˙˙Ä …Ŕué›j˙5ŤEřP˙uěč7í˙˙Äě jčÎě˙˙Ä…Ŕtëqě ˙uč膾ĉEôě jčŞě˙˙Ä…ŔtëMě ˙uäčbľÄ‰Eđě jč†ě˙˙Ä…Ŕtë)ě˙uđ˙uô˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EŕëÇEŕ‹EŕÉĂU‰ĺě8ÇEüÇEřÇEÜÇEŘÇEÔÇEĐÇEĚěŤEĚPŤEĐPŤEÔPŤEŘPŤEÜPhÂ˙u čü˙˙˙Ä …Ŕuéőj˙5ŤEřP˙uÜč)ě˙˙Äě jčŔë˙˙Ä…ŔtéČě ˙uŘču˝Ä‰Eôě jč™ë˙˙Ä…Ŕtéˇě ˙uÔčN˝Ä‰Eđě jčrë˙˙Ä…Ŕtë}ě ˙uĐč^˝ÄÝ]čě jčNë˙˙Ä…ŔtëYě ˙uĚč:˝ÄÝ]ŕě jč*ë˙˙Ä…Ŕtë5ě˙uä˙uŕ˙uě˙uč˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EČëÇEČ‹EČÉĂU‰ĺěXÇEüÇEřÇEĚÇEČÇEÄÇEŔÇEĽÇE¸ÇE´ÇE°ěŤE°PŤE´PŤE¸PŤEĽPŤEŔPŤEÄPŤEČPŤEĚPhÜ˙u čü˙˙˙Ä0…Ŕuéyj˙5ŤEřP˙uĚč ę˙˙Äě jč7ę˙˙Ä…ŔtéLě ˙uČčě»Ä‰Eôě jčę˙˙Ä…Ŕté%ě ˙uÄčŻĉEđě jčéé˙˙Ä…Ŕtéţě ˙uŔ螻ĉEěě jčÂé˙˙Ä…Ŕté×ě ˙uĽčw»Ä‰Ečě jč›é˙˙Ä…Ŕté°ě ˙u¸č„»ÄÝ]ŕě jčté˙˙Ä…Ŕté‰ě ˙u´č]»ÄÝ]Řě jčMé˙˙Ä…Ŕtëeě ˙u°č9»ÄÝ]Đě jč)é˙˙Ä…ŔtëAě˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä0˙ÇEü‹Eü‰E¬ëÇE¬‹E¬ÉĂU‰ĺěhÇEüÇEřÇEĽÇE¸ÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśěŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´PŤE¸PŤEĽPhů˙u čü˙˙˙Ä0…Ŕué¬j˙5ŤEřP˙uĽč‡č˙˙Äě jčč˙˙Ä…Ŕtéě ˙u¸čӹĉEôě jč÷ç˙˙Ä…ŔtéXě ˙u´č¬ąÄ‰Eđě jčĐç˙˙Ä…Ŕté1ě ˙u°čąąÄÝ]čě jč©ç˙˙Ä…Ŕté ě ˙u¬č’ąÄÝ]ŕě jč‚ç˙˙Ä…Ŕtéăě ˙u¨čkąÄÝ]Řě jč[ç˙˙Ä…ŔtéĽě ˙u¤čDąÄÝ]Đě jč4ç˙˙Ä…Ŕté•ě ˙u čąÄÝ]Čě jč ç˙˙Ä…Ŕtëqě ˙uśčů¸ÄÝ]Ŕě j čéć˙˙Ä…ŔtëMě˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uđ˙uô˙uřčü˙˙˙Ä@˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚě ŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph ˙u čü˙˙˙Ä@…Ŕuéj˙5ŤEřP˙u´č%ć˙˙Äě jčĽĺ˙˙Ä…ŔtéÓě ˙u°čq·Ä‰Eôě jč•ĺ˙˙Ä…Ŕté¬ě ˙u¬čJ·Ä‰Eđě jčnĺ˙˙Ä…Ŕté…ě ˙u¨č#·Ä‰Eěě jčGĺ˙˙Ä…Ŕté^ě ˙u¤čü¶Ä‰Ečě jč ĺ˙˙Ä…Ŕté7ě ˙u č ·ÄÝ]ŕě jčůä˙˙Ä…Ŕtéě ˙uśčâ¶ÄÝ]Řě jčŇä˙˙Ä…Ŕtééě ˙uč»¶ÄÝ]Đě jč«ä˙˙Ä…ŔtéÂě ˙u”č”¶ÄÝ]Čě j č„ä˙˙Ä…Ŕté›ě ˙učm¶ÄÝ]Ŕě j č]ä˙˙Ä…Ŕtëwě ˙uŚčI¶ÄÝ]¸ě j č9ä˙˙Ä…ŔtëSě ˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚě ŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph@˙u čü˙˙˙Ä@…Ŕuéj˙5ŤEřP˙u´čoă˙˙Äě jčă˙˙Ä…ŔtéÓě ˙u°č»´Ä‰Eôě jčßâ˙˙Ä…Ŕté¬ě ˙u¬č”´Ä‰Eđě jč¸â˙˙Ä…Ŕté…ě ˙u¨čm´Ä‰Eěě jč‘â˙˙Ä…Ŕté^ě ˙u¤čF´Ä‰Ečě jčjâ˙˙Ä…Ŕté7ě ˙u čS´ÄÝ]ŕě jčCâ˙˙Ä…Ŕtéě ˙uśč,´ÄÝ]Řě jčâ˙˙Ä…Ŕtééě ˙uč´ÄÝ]Đě jčőá˙˙Ä…ŔtéÂě ˙u”čŢłÄÝ]Čě j čÎá˙˙Ä…Ŕté›ě ˙uč·łÄÝ]Ŕě j č§á˙˙Ä…Ŕtëwě ˙uŚč“łÄÝ]¸ě j čá˙˙Ä…ŔtëSě ˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚě ŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph`˙u čü˙˙˙Ä@…Ŕuéj˙5ŤEřP˙u´čąŕ˙˙Äě jčPŕ˙˙Ä…ŔtéÓě ˙u°č˛Ä‰Eôě jč)ŕ˙˙Ä…Ŕté¬ě ˙u¬čޱĉEđě jčŕ˙˙Ä…Ŕté…ě ˙u¨č·±Ä‰Eěě jčŰß˙˙Ä…Ŕté^ě ˙u¤č±Ä‰Ečě jč´ß˙˙Ä…Ŕté7ě ˙u čť±ÄÝ]ŕě jčŤß˙˙Ä…Ŕtéě ˙uśčv±ÄÝ]Řě jčfß˙˙Ä…Ŕtééě ˙učO±ÄÝ]Đě jč?ß˙˙Ä…ŔtéÂě ˙u”č(±ÄÝ]Čě j čß˙˙Ä…Ŕté›ě ˙uč±ÄÝ]Ŕě j čńŢ˙˙Ä…Ŕtëwě ˙uŚčݰÄÝ]¸ě j čÍŢ˙˙Ä…ŔtëSě ˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěÇEüÇEřÇEđÇEěŤEěPŤEđPh€˙u čü˙˙˙Ä…Ŕuëtj˙5ŤEřP˙uđčlŢ˙˙Äě jčŢ˙˙Ä…ŔtëJě ˙uě軯ĉEôě jčßÝ˙˙Ä…Ŕtë&ě˙uô˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěHÇEüÇEřÇEÔÇEĐÇEĚÇEČÇEÄěŤEÄPŤEČPŤEĚPŤEĐPŤEÔPh—˙u čü˙˙˙Ä …Ŕuéţj˙5ŤEřP˙uÔč…Ý˙˙Äě jčÝ˙˙Ä…ŔtéŃě ˙uĐčŻÄÝ]đě jčőÜ˙˙Ä…ŔtéŞě ˙uĚčŢ®ÄÝ]čě jčÎÜ˙˙Ä…Ŕtéě ˙uČč·®ÄÝ]ŕě jč§Ü˙˙Ä…Ŕtë_ě ˙uÄč“®ÄÝ]Řě jčÜ˙˙Ä…Ŕtë;ě ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uô˙uđ˙uřčü˙˙˙Ä0˙ÇEü‹Eü‰EŔëÇEŔ‹EŔÉĂU‰ĺěÇEüÇEřÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚÇEÇE„ÇE€Ç…|˙˙˙Ç…x˙˙˙Ç…t˙˙˙Ç…p˙˙˙Ť…p˙˙˙PŤ…t˙˙˙PŤ…x˙˙˙PŤ…|˙˙˙PŤE€PŤE„PŤEPŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PhŔ˙u čü˙˙˙Ä@…ŔuéŤj˙5ŤEřP˙u¤čŰ˙˙Äě jč/Ű˙˙Ä…Ŕté`ě ˙u čä¬Ä‰Eôě jčŰ˙˙Ä…Ŕté9ě ˙uśč˝¬Ä‰Eđě jčáÚ˙˙Ä…Ŕtéě ˙u薬ĉEěě jčşÚ˙˙Ä…Ŕtéëě ˙u”čo¬Ä‰Ečě jč“Ú˙˙Ä…ŔtéÄě ˙učH¬Ä‰Eäě jčlÚ˙˙Ä…Ŕtéťě ˙uŚč!¬Ä‰Eŕě jčEÚ˙˙Ä…Ŕtévě ˙učú«Ä‰EÜě jčÚ˙˙Ä…ŔtéOě ˙u„č¬ÄÝ]Đě j č÷Ů˙˙Ä…Ŕté(ě ˙u€čŕ«ÄÝ]Čě j čĐŮ˙˙Ä…Ŕtéě ˙µ|˙˙˙č¶«ÄÝ]Ŕě j č¦Ů˙˙Ä…Ŕté×ě ˙µx˙˙˙茫ÄÝ]¸ě j č|Ů˙˙Ä…Ŕté­ě ˙µt˙˙˙čb«ÄÝ]°ě j čRŮ˙˙Ä…Ŕtéě ˙µp˙˙˙č8«ÄÝ]¨ě jč(Ů˙˙Ä…Ŕtë\˙u¬˙u¨˙u´˙u°˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŕ˙uä˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰…l˙˙˙ë Ç…l˙˙˙‹…l˙˙˙ÉĂU‰ĺě8ÇEüÇEřÇEäÇEŕÇEÜÇEŘÇEÔěŤEÔPŤEŘPŤEÜPŤEŕPŤEäPhă˙u čü˙˙˙Ä …Ŕuéďj˙5ŤEřP˙uäč‘Ř˙˙Äě jč(Ř˙˙Ä…ŔtéÂě ˙uŕčݩĉEôě jčŘ˙˙Ä…Ŕté›ě ˙uÜ趩ĉEđě jčÚ×˙˙Ä…Ŕtëwě ˙uŘ蒩ĉEěě jč¶×˙˙Ä…ŔtëSě ˙uÔčn©Ä‰Ečě jč’×˙˙Ä…Ŕtë/ě ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EĐëÇEĐ‹EĐÉĂU‰ĺě8ÇEüÇEřÇEäÇEŕÇEÜÇEŘÇEÔěŤEÔPŤEŘPŤEÜPŤEŕPŤEäPhý˙u čü˙˙˙Ä …Ŕuéďj˙5ŤEřP˙uäč/×˙˙Äě jčĆÖ˙˙Ä…ŔtéÂě ˙uŕč{¨Ä‰Eôě jčźÖ˙˙Ä…Ŕté›ě ˙uÜčT¨Ä‰Eđě jčxÖ˙˙Ä…Ŕtëwě ˙uŘč0¨Ä‰Eěě jčTÖ˙˙Ä…ŔtëSě ˙uÔč ¨Ä‰Ečě jč0Ö˙˙Ä…Ŕtë/ě ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EĐëÇEĐ‹EĐÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPh˙u čü˙˙˙Ä…Ŕuëwj˙5ŤEřP˙uěčôŐ˙˙Äě jč‹Ő˙˙Ä…ŔtëMě ˙uččw§ÄÝ]đě jčgŐ˙˙Ä…Ŕtë)ě˙uô˙uđ˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚě ŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph@˙u čü˙˙˙Ä@…Ŕuéj˙5ŤEřP˙u´čÇÔ˙˙Äě jč^Ô˙˙Ä…ŔtéÓě ˙u°č¦Ä‰Eôě jč7Ô˙˙Ä…Ŕté¬ě ˙u¬čěĄÄ‰Eđě jčÔ˙˙Ä…Ŕté…ě ˙u¨čťĉEěě jčéÓ˙˙Ä…Ŕté^ě ˙u¤čžĄÄ‰Ečě jčÂÓ˙˙Ä…Ŕté7ě ˙u č«ĄÄÝ]ŕě jč›Ó˙˙Ä…Ŕtéě ˙uśč„ĄÄÝ]Řě jčtÓ˙˙Ä…Ŕtééě ˙uč]ĄÄÝ]Đě jčMÓ˙˙Ä…ŔtéÂě ˙u”č6ĄÄÝ]Čě j č&Ó˙˙Ä…Ŕté›ě ˙učĄÄÝ]Ŕě j č˙Ň˙˙Ä…Ŕtëwě ˙uŚčë¤ÄÝ]¸ě j čŰŇ˙˙Ä…ŔtëSě ˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚě ŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph`˙u čü˙˙˙Ä@…Ŕuéj˙5ŤEřP˙u´čŇ˙˙Äě jč¨Ń˙˙Ä…ŔtéÓě ˙u°č]ŁÄ‰Eôě jčŃ˙˙Ä…Ŕté¬ě ˙u¬č6ŁÄ‰Eđě jčZŃ˙˙Ä…Ŕté…ě ˙u¨čŁÄ‰Eěě jč3Ń˙˙Ä…Ŕté^ě ˙u¤čč˘Ä‰Ečě jč Ń˙˙Ä…Ŕté7ě ˙u čő˘ÄÝ]ŕě jčĺĐ˙˙Ä…Ŕtéě ˙uśč΢ÄÝ]Řě jčľĐ˙˙Ä…Ŕtééě ˙u觢ÄÝ]Đě jč—Đ˙˙Ä…ŔtéÂě ˙u”耢ÄÝ]Čě j čpĐ˙˙Ä…Ŕté›ě ˙učY˘ÄÝ]Ŕě j čIĐ˙˙Ä…Ŕtëwě ˙uŚč5˘ÄÝ]¸ě j č%Đ˙˙Ä…ŔtëSě ˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺěÇEüÇEřÇEđÇEěŤEěPŤEđPh€˙u čü˙˙˙Ä…Ŕuëvj˙5ŤEřP˙uđčÄĎ˙˙Äě jč[Ď˙˙Ä…ŔtëLě ˙uě臡ÄE÷ě jč7Ď˙˙Ä…Ŕtë(ě¶E÷P˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺě8ÇEüÇEřÇEäÇEŕÇEÜÇEŘÇEÔěŤEÔPŤEŘPŤEÜPŤEŕPŤEäPh­˙u čü˙˙˙Ä …Ŕuéďj˙5ŤEřP˙uäčŰÎ˙˙Äě jčrÎ˙˙Ä…ŔtéÂě ˙uŕč' Ä‰Eôě jčKÎ˙˙Ä…Ŕté›ě ˙uÜč Ä‰Eđě jč$Î˙˙Ä…Ŕtëwě ˙uŘčܟĉEěě jčÎ˙˙Ä…ŔtëSě ˙uÔ踟ĉEčě jčÜÍ˙˙Ä…Ŕtë/ě ˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EĐëÇEĐ‹EĐÉĂU‰ĺě8ÇEüÇEřÇEôÇEŕÇEÜÇEŘÇEÔÇEĐÇEĚŤEĚPŤEĐPŤEÔPŤEŘPŤEÜPŤEŕPhÇ˙u čü˙˙˙Ä …Ŕuéj˙5ŤEřP˙uŕčjÍ˙˙Äě jčÍ˙˙Ä…ŔtéíěŤEôP˙uÜč\źÄ…Ŕuě jčŐĚ˙˙ÄéĹě ˙uŘ莞ĉEđě jč˛Ě˙˙Ä…Ŕtéžě ˙uÔčgžÄ‰Eěě jč‹Ě˙˙Ä…Ŕtëzě ˙uĐčCžÄ‰Ečě jčgĚ˙˙Ä…ŔtëVě ˙uĚčžÄ‰Eäě jčCĚ˙˙Ä…Ŕtë2ě˙uä˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EČëÇEČ‹EČÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5čľ˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇE¤ÇE ÇEśÇEÇE”ÇEÇEŚÇEÇE„ÇE€Ç…|˙˙˙Ç…x˙˙˙썅x˙˙˙PŤ…|˙˙˙PŤE€PŤE„PŤEPŤEŚPŤEPŤE”PŤEPŤEśPŤE PŤE¤Phĺ˙u čü˙˙˙Ä@…Ŕué?j˙5ŤEřP˙u¤č%Ë˙˙Äě jčĽĘ˙˙Ä…Ŕtéě ˙u čqśÄ‰Eôě jč•Ę˙˙Ä…Ŕtéëě ˙uśčJśÄ‰Eđě jčnĘ˙˙Ä…ŔtéÄě ˙učWśÄÝ]čě jčGĘ˙˙Ä…Ŕtéťě ˙u”č0śÄÝ]ŕě jč Ę˙˙Ä…Ŕtévě ˙uč śÄÝ]Řě jčůÉ˙˙Ä…ŔtéOě ˙uŚčâ›ÄÝ]Đě jčŇÉ˙˙Ä…Ŕté(ě ˙uč»›ÄÝ]Čě jč«É˙˙Ä…Ŕtéě ˙u„č”›ÄÝ]Ŕě j č„É˙˙Ä…ŔtéÚě ˙u€čm›ÄÝ]¸ě j č]É˙˙Ä…Ŕtéłě ˙µ|˙˙˙čC›ÄÝ]°ě j č3É˙˙Ä…Ŕté‰ě ˙µx˙˙˙č›ÄÝ]¨ě j č É˙˙Ä…Ŕtëbě ˙u¬˙u¨˙u´˙u°˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uđ˙uô˙uřčü˙˙˙Ä`˙ÇEü‹Eü‰…t˙˙˙ë Ç…t˙˙˙‹…t˙˙˙ÉĂU‰ĺěXÇEüÇEřÇEĚÇEČÇEÄÇEŔÇEĽÇE¸ÇE´ě ŤE´PŤE¸PŤEĽPŤEŔPŤEÄPŤEČPŤEĚPh˙u čü˙˙˙Ä0…ŔuéRj˙5ŤEřP˙uĚčWČ˙˙Äě jčîÇ˙˙Ä…Ŕté%ě ˙uČ裙ĉEôě jčÇÇ˙˙Ä…Ŕtéţě ˙uÄč|™Ä‰Eđě jč Ç˙˙Ä…Ŕté×ě ˙uŔ艙ÄÝ]čě jčyÇ˙˙Ä…Ŕté°ě ˙uĽčb™ÄÝ]ŕě jčRÇ˙˙Ä…Ŕté‰ě ˙u¸č;™ÄÝ]Řě jč+Ç˙˙Ä…Ŕtëeě ˙u´č™ÄÝ]Đě jčÇ˙˙Ä…ŔtëAě˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uđ˙uô˙uřčü˙˙˙Ä0˙ÇEü‹Eü‰E°ëÇE°‹E°ÉĂU‰ĺěxÇEüÇEřÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ÇEŤEPŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´Ph˙u čü˙˙˙Ä0…ŔuéŮj˙5ŤEřP˙u´č]Ć˙˙Äě jčôĹ˙˙Ä…Ŕté¬ě ˙u°čÝ—ÄÝ]đě jčÍĹ˙˙Ä…Ŕté…ě ˙u¬č¶—ÄÝ]čě jč¦Ĺ˙˙Ä…Ŕté^ě ˙u¨čŹ—ÄÝ]ŕě jčĹ˙˙Ä…Ŕté7ě ˙u¤čh—ÄÝ]Řě jčXĹ˙˙Ä…Ŕtéě ˙u čA—ÄÝ]Đě jč1Ĺ˙˙Ä…Ŕtééě ˙uśč—ÄÝ]Čě jč Ĺ˙˙Ä…ŔtéÂě ˙učó–ÄÝ]Ŕě jčăÄ˙˙Ä…Ŕté›ě ˙u”č–ĉEĽě j čĽÄ˙˙Ä…Ŕtëwě ˙učt–ĉE¸ě j čÄ˙˙Ä…ŔtëSě ˙u¸˙uĽ˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uô˙uđ˙uřčü˙˙˙ÄP˙ÇEü‹Eü‰EŚëÇEŚ‹EŚÉĂU‰ĺěxÇEüÇEřÇE¸ÇE´ÇE°ÇE¬ÇE¨ÇE¤ÇE ÇEśÇEÇE”ŤE”PŤEPŤEśPŤE PŤE¤PŤE¨PŤE¬PŤE°PŤE´PŤE¸Ph5˙u čü˙˙˙Ä0…ŔuéÓj˙5ŤEřP˙u¸čÝĂ˙˙Äě jčtĂ˙˙Ä…Ŕté¦ě ˙u´č]•ÄÝ]đě jčMĂ˙˙Ä…Ŕtéě ˙u°č6•ÄÝ]čě jč&Ă˙˙Ä…ŔtéXě ˙u¬č•ÄÝ]ŕě jč˙Â˙˙Ä…Ŕté1ě ˙u¨čč”ÄÝ]Řě jčŘÂ˙˙Ä…Ŕté ě ˙u¤čÁ”ÄÝ]Đě jč±Â˙˙Ä…Ŕtéăě ˙u čš”ÄÝ]Čě jčŠÂ˙˙Ä…ŔtéĽě ˙uśč?”ĉEÄě jčcÂ˙˙Ä…Ŕté•ě ˙uč”ĉEŔě j č<Â˙˙Ä…Ŕtëqě ˙u”čô“ĉEĽě j čÂ˙˙Ä…ŔtëM˙uĽ˙uŔ˙uÄ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uô˙uđ˙uřčü˙˙˙Ä@˙ÇEü‹Eü‰EëÇE‹EÉĂU‰ĺě8ÇEüÇEřÇEŕÇEÜÇEŘÇEÔÇEĐÇEĚŤEĚPŤEĐPŤEÔPŤEŘPŤEÜPŤEŕPhP˙u čü˙˙˙Ä …Ŕuéj˙5ŤEřP˙uŕčŹÁ˙˙Äě jč&Á˙˙Ä…Ŕtéěě ˙uÜčےĉEôě jč˙Ŕ˙˙Ä…ŔtéĹě ˙uŘ贒ĉEđě jčŘŔ˙˙Ä…Ŕtéžě ˙uÔ荒ĉEěě jč±Ŕ˙˙Ä…Ŕtëzě ˙uĐči’ĉEčě jčŤŔ˙˙Ä…ŔtëVě ˙uĚčE’ĉEäě jčiŔ˙˙Ä…Ŕtë2ě˙uä˙uč˙uě˙uđ˙uô˙uřčü˙˙˙Ä ˙ÇEü‹Eü‰EČëÇEČ‹EČÉĂU‰ĺě(ÇEüÇEřÇEěÇEčŤEčPŤEěPhj˙u čü˙˙˙Ä…Ŕuëwj˙5ŤEřP˙uěč*Ŕ˙˙Äě jčÁż˙˙Ä…ŔtëMě ˙učč­‘ÄÝ]đě jčťż˙˙Ä…Ŕtë)ě˙uô˙uđ˙uřčü˙˙˙Ä˙ÇEü‹Eü‰EäëÇEä‹EäÉĂU‰ĺě¸ÇEüÇEřÇEŚÇEÇE„ÇE€Ç…|˙˙˙Ç…x˙˙˙Ç…t˙˙˙Ç…p˙˙˙Ç…l˙˙˙Ç…h˙˙˙Ç…d˙˙˙Ç…`˙˙˙Ç…\˙˙˙Ç…X˙˙˙Ç…T˙˙˙ě Ť…T˙˙˙PŤ…X˙˙˙PŤ…\˙˙˙PŤ…`˙˙˙PŤ…d˙˙˙PŤ…h˙˙˙PŤ…l˙˙˙PŤ…p˙˙˙PŤ…t˙˙˙PŤ…x˙˙˙PŤ…|˙˙˙PŤE€PŤE„PŤEPŤEŚPh€˙u čü˙˙˙ÄP…Ŕuéáj˙5ŤEřP˙uŚčŚľ˙˙Äě jč#ľ˙˙Ä…Ŕté´ě ˙uč؏ĉEôě jčü˝˙˙Ä…ŔtéŤě ˙u„豏ĉEđě jčŐ˝˙˙Ä…Ŕtéfě ˙u€čľŹÄÝ]čě jč®˝˙˙Ä…Ŕté?ě ˙µ|˙˙˙蔏ÄÝ]ŕě jč„˝˙˙Ä…Ŕtéě ˙µx˙˙˙čjŹÄÝ]Řě jčZ˝˙˙Ä…Ŕtéëě ˙µt˙˙˙č@ŹÄÝ]Đě jč0˝˙˙Ä…ŔtéÁě ˙µp˙˙˙čŹÄÝ]Čě jč˝˙˙Ä…Ŕté—ě ˙µl˙˙˙čěŽÄÝ]Ŕě j čÜĽ˙˙Ä…Ŕtémě ˙µh˙˙˙čÂŽÄÝ]¸ě j 貼˙˙Ä…ŔtéCě ˙µd˙˙˙čŽÄÝ]°ě j čĽ˙˙Ä…Ŕtéě ˙µ`˙˙˙čnŽÄÝ]¨ě j č^Ľ˙˙Ä…Ŕtéďě ˙µ\˙˙˙čDŽÄÝ] ě j č4Ľ˙˙Ä…ŔtéĹě ˙µX˙˙˙čŽÄÝ]ě jč Ľ˙˙Ä…Ŕté›ě ˙µT˙˙˙čđŤÄÝ]ě jčŕ»˙˙Ä…Ŕtëtě˙u”˙u˙uś˙u˙u¤˙u ˙u¬˙u¨˙u´˙u°˙uĽ˙u¸˙uÄ˙uŔ˙uĚ˙uČ˙uÔ˙uĐ˙uÜ˙uŘ˙uä˙uŕ˙uě˙uč˙uđ˙uô˙uřčü˙˙˙Äp˙ÇEü‹Eü‰…P˙˙˙ë Ç…P˙˙˙‹…P˙˙˙ÉĂU‰ĺě(ÇEüěhˇ˙u čü˙˙˙Ä…Ŕué”ě h\čü˙˙˙ĉEđĆEďě ˙uđčü˙˙˙ÄĆEď‹Eđ‰Eřë.‰Eä‹Eä‰Eč€}ďtě ˙uđčü˙˙˙Ä‹Eč‰Eäě ˙uäčü˙˙˙€}ďtě ˙uđčü˙˙˙Äěj˙5˙uřčźľ˙˙ĉEü‹Eü‰EôëÇEô‹EôÉĂU‰ĺěÇEüÇEřÇEôěŤEôPh±˙u čü˙˙˙Ä…Ŕuëgj˙5ŤEřP˙uôč–ş˙˙Äě jč-ş˙˙Ä…Ŕtë=‹Eř‰Eě}ětě ˙uěčü˙˙˙Äě ˙uěčü˙˙˙Ä˙ÇEü‹Eü‰EđëÇEđ‹EđÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5čű«˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uě莹˙˙Äě jč%ą˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔč߸˙˙Äě jčv¸˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPhŔ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔčE·˙˙Äě jčܶ˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔ諵˙˙Äě jčBµ˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh@ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔč´˙˙Äě j訳˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh€ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔčw˛˙˙Äě jč˛˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPhŔ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔčݰ˙˙Äě jčt°˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔčCŻ˙˙Äě jčÚ®˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤jŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh@ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔč©­˙˙Äě jč@­˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh€ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔč¬˙˙Äě j覫˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPhŔ ˙u čü˙˙˙Ä…Ŕué j˙5 ŤEđP˙uÔčuŞ˙˙Äě jč Ş˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěčî¨˙˙Äě jč…¨˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěčR¨˙˙Äě jčé§˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh` ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěč¶§˙˙Äě jčM§˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh  ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěč§˙˙Äě j豦˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěč~¦˙˙Äě jč¦˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěčâĄ˙˙Äě jčyĄ˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh` ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđčFĄ˙˙Äě jčݤ˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh  ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđ认˙˙Äě jčE¤˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěč¤˙˙Äě jč­Ł˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěčzŁ˙˙Äě jčŁ˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺWVě€ÇEôÇEđě Ť…H˙˙˙Pčü˙˙˙ÄÇ…D˙˙˙썅D˙˙˙Ph` ˙u čü˙˙˙Ä…Ŕué,j˙5 ŤEđP˙µD˙˙˙転˙˙Äě jčR˘˙˙Ä…ŔtéüŤ…ţ˙˙ě˙uđPčü˙˙˙Ä Ť˝H˙˙˙Ťµţ˙˙ü¸'‰ÁóĄě hśčü˙˙˙ĉ…Śţ˙˙Ć…‹ţ˙˙썅H˙˙˙P˙µŚţ˙˙čü˙˙˙ÄĆ…‹ţ˙˙‹…Śţ˙˙‰…”ţ˙˙ëF‰…€ţ˙˙‹…€ţ˙˙‰…„ţ˙˙€˝‹ţ˙˙tě ˙µŚţ˙˙čü˙˙˙Ä‹…„ţ˙˙‰…€ţ˙˙ě ˙µ€ţ˙˙čü˙˙˙€˝‹ţ˙˙tě ˙µŚţ˙˙čü˙˙˙Äěj˙5˙µ”ţ˙˙čYĄ˙˙ĉEô‹Eô‰…ţ˙˙ë Ç…ţ˙˙‹…ţ˙˙Ťeř^_ÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh  ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěčBˇ˙˙Äě jčŮ ˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uě覠˙˙Äě jč= ˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđč  ˙˙Äě j衟˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh`˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđčrź˙˙Äě jč ź˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđčÚž˙˙Äě jčqž˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPhŕ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđčBž˙˙Äě jčŮť˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5 ŤEřP˙uđ誝˙˙Äě jčAť˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5 č#Ź˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh`˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč¶ś˙˙Äě jčMś˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5ŤEřP˙uđčś˙˙Äě jč±›˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPhŕ˙u čü˙˙˙Ä…ŔuëTj˙5ŤEřP˙uđč‚›˙˙Äě jč›˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčęš˙˙Äě jčš˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh@˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčNš˙˙Äě jčĺ™˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh€˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uě貙˙˙Äě jčI™˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŔ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč™˙˙Äě jč­˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhä˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčz˙˙Äě jč˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčŢ—˙˙Äě jču—˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh`˙u čü˙˙˙Ä…ŔuëTj˙5ŤEřP˙uđčB—˙˙Äě jčŮ–˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺSědÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPh ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÔč—–˙˙Äě jč.–˙˙Ä…ŔtéëěŤE¸˙uđPčü˙˙˙ÄŤE¸PŤEŘPčü˙˙˙Äë‰E¬‹]¬ě ŤE¸Pčü˙˙˙ĉ]¬éĹě ŤE¸Pčü˙˙˙Äě jčü˙˙˙ĉE¨ĆE§ěŤEŘP˙u¨čü˙˙˙ÄĆE§‹E¨‰E´ë%‰E¬‹E¬‰E €}§tě ˙u¨čü˙˙˙Ä‹E ‰E¬ë_€}§tě ˙u¨čü˙˙˙Äěj˙5<˙u´čR™˙˙ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]°ë;ě ŤEŘPčü˙˙˙ÄÇE°ë#‰E¬‹]¬ě ŤEŘPčü˙˙˙ĉ]¬ě ˙u¬čü˙˙˙‹E°‹]üÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŔ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč•˙˙Äě jč›”˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺSětÇEôÇEđě ŤEŘPčü˙˙˙ÄÇEÔěŤEÔPhć˙u čü˙˙˙Ä…Ŕué j˙5ŤEđP˙uÔčU”˙˙Äě jčě“˙˙Ä…ŔtéßěŤE¨˙uđPčü˙˙˙ÄŤE¨PŤEŘPčü˙˙˙Äë‰E‹]ě ŤE¨Pčü˙˙˙ĉ]éąě ŤE¨Pčü˙˙˙ÄÇE¤ě ŤEŘPčü˙˙˙ÄPčü˙˙˙ĉE =PtˇPŔX‹‰E”ëě h`čü˙˙˙ÄÇE”˙u ˙u¤j ŤEŘPčü˙˙˙ÄPčü˙˙˙ÄP˙U”ĉEô‹]ôě ŤEŘPčü˙˙˙ĉ]śë;ě ŤEŘPčü˙˙˙ÄÇEśë#‰E‹]ě ŤEŘPčü˙˙˙ĉ]ě ˙učü˙˙˙‹Eś‹]üÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5čß„˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5(ŤEřP˙uěčr’˙˙Äě jč ’˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh`˙u čü˙˙˙Ä…Ŕuéj˙5(ŤEđP˙uÄč|‘˙˙Äě jč‘˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh ˙u čü˙˙˙Ä…Ŕuéj˙5(ŤEđP˙uÄ袏˙˙Äě jč9Ź˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŕ˙u čü˙˙˙Ä…Ŕuéj˙5(ŤEđP˙uÄčČŤ˙˙Äě jč_Ť˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh ˙u čü˙˙˙Ä…Ŕuéj˙5(ŤEđP˙uÄčî‹˙˙Äě jč…‹˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh`˙u čü˙˙˙Ä…Ŕuéj˙5(ŤEđP˙uÄčŠ˙˙Äě j諉˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5(čĄz˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5 ŤEřP˙uěč8˙˙Äě jčχ˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhÂ˙u čü˙˙˙Ä…Ŕuéj˙5 ŤEđP˙uÄčB‡˙˙Äě jčن˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŕ˙u čü˙˙˙Ä…Ŕuéj˙5 ŤEđP˙uÄčh…˙˙Äě jč˙„˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5 ŤEđP˙uÄčŽ˙˙Äě jč%˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh ˙u čü˙˙˙Ä…Ŕuéj˙5 ŤEđP˙uÄč´˙˙Äě jčK˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5 ŤEđP˙uÄčÚ˙˙Äě jčq˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5 čkp˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh`˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčţ}˙˙Äě jč•}˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5ŤEřP˙uđčb}˙˙Äě jčů|˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŕ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄčp|˙˙Äě jč|˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄč–z˙˙Äě jč-z˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄčĽx˙˙Äě jčSx˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄčâv˙˙Äě jčyv˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄču˙˙Äě jčźt˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5ŤEđP˙uÄč.s˙˙Äě jčĹr˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5čżc˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh˙u čü˙˙˙Ä…ŔuëWj˙5$ŤEřP˙uěčRq˙˙Äě jčép˙˙Ä…Ŕtë-ě ˙uřčü˙˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh@˙u čü˙˙˙Ä…ŔuëTj˙5$ŤEřP˙uđč¶p˙˙Äě jčMp˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh€˙u čü˙˙˙Ä…ŔuëTj˙5$ŤEřP˙uđčp˙˙Äě jčµo˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPhŔ˙u čü˙˙˙Ä…ŔuëTj˙5$ŤEřP˙uđč†o˙˙Äě jčo˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEđěŤEđPhŕ˙u čü˙˙˙Ä…ŔuëTj˙5$ŤEřP˙uđčîn˙˙Äě jč…n˙˙Ä…Ŕtë*ě ˙uřčü˙˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčüm˙˙Äě jč“m˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč"l˙˙Äě jčąk˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčHj˙˙Äě jčßi˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčnh˙˙Äě jčh˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč”f˙˙Äě jč+f˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčşd˙˙Äě jčQd˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčŕb˙˙Äě jčwb˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄča˙˙Äě jčť`˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč,_˙˙Äě jčĂ^˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčR]˙˙Äě jčé\˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčx[˙˙Äě jč[˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčžY˙˙Äě jč5Y˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčÄW˙˙Äě jč[W˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčęU˙˙Äě jčU˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčT˙˙Äě jč§S˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč6R˙˙Äě jčÍQ˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč\P˙˙Äě jčóO˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč‚N˙˙Äě jčN˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč¨L˙˙Äě jč?L˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčÎJ˙˙Äě jčeJ˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčôH˙˙Äě jč‹H˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh@˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčG˙˙Äě jč±F˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh€˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄč@E˙˙Äě jč×D˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPhŔ˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčfC˙˙Äě jčýB˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺSěTÇEôÇEđěěŤEČPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë#‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙ě ŤEČPčü˙˙˙ÄÇEÄěŤEÄPh˙u čü˙˙˙Ä…Ŕuéj˙5$ŤEđP˙uÄčŚA˙˙Äě jč#A˙˙Ä…Ŕté×ěŤEČ˙uđPčü˙˙˙ÄŤEČPŤEŘPčü˙˙˙Äë‰E°‹]°ě ŤEČPčü˙˙˙ĉ]°é±ě ŤEČPčü˙˙˙ÄějŤEŘPčü˙˙˙ĉEŔÇEĽě ŤEŘPčü˙˙˙ĉE¸=PtˇPŔX‹‰E¬ëě h`čü˙˙˙ÄÇE¬˙u¸˙uĽj ˙uŔ˙U¬Ä‰Eô‹]ôě ŤEŘPčü˙˙˙ĉ]´ë;ě ŤEŘPčü˙˙˙ÄÇE´ë#‰E°‹]°ě ŤEŘPčü˙˙˙ĉ]°ě ˙u°čü˙˙˙‹E´‹]üÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5$č2˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh@˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč°?˙˙Äě jčG?˙˙Ä…Ŕtë-ě ˙uřčźI˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhn˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč?˙˙Äě jč«>˙˙Ä…Ŕtë-ě ˙uřčI˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEđěŤEđPh ˙u čü˙˙˙Ä…ŔuëTj˙5ŤEřP˙uđčx>˙˙Äě jč>˙˙Ä…Ŕtë*ě ˙uřč›H˙˙ĉEôě ˙uôčü˙˙˙ĉEü‹Eü‰EěëÇEě‹EěÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŕ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčŕ=˙˙Äě jčw=˙˙Ä…Ŕtë-ě ˙uřčH˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčD=˙˙Äě jčŰ<˙˙Ä…Ŕtë-ě ˙uřčG˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh`˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč¨<˙˙Äě jč?<˙˙Ä…Ŕtë-ě ˙uřčýF˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh…˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěč <˙˙Äě jčŁ;˙˙Ä…Ŕtë-ě ˙uřč{F˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPhŔ˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčp;˙˙Äě jč;˙˙Ä…Ŕtë-ě ˙uřčůE˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěÇEüÇEřÇEěěŤEěPh˙u čü˙˙˙Ä…ŔuëWj˙5ŤEřP˙uěčÔ:˙˙Äě jčk:˙˙Ä…Ŕtë-ě ˙uřčwE˙˙ÄÝ]đě˙uô˙uđčü˙˙˙ĉEü‹Eü‰EčëÇEč‹EčÉĂU‰ĺěěŤEüPhâ˙u čü˙˙˙Ä…Ŕu ÇEřë,ě˙uü˙5čI,˙˙Ä‹Eü˙ě häčü˙˙˙ĉEř‹EřÉĂU‰ĺě= téáÇ ÇÄŔ ÇČ č?˙˙‰Eě}ět‹Eě‹@ŁŔ‹EěÇ@¸ëÇŔ¸ě h¸č ?˙˙ÄÇEđ‹Eđ;ĽrémÇEü=Ŕ¸t-ě‹EđŤ…ˇÄ‹˙0h¸˙5Ŕč¸+˙˙ĉEü}üt5‹EđŤ…ˇÄ‹xt2‹Mü‹EđŤ…ˇÄ‹‹@‰Aë‹EđŤ…ˇÄ‹‰Eü‹EđŤ…ˇČ‹‰Eô‹Eô8ué›ÇEř=Ŕ¸t ě‹Eô‹˙0h¸˙5Ŕč+˙˙ĉEř}řt'‹EđŤ …‹Ä‹Eü; u‹Uô‹Eř‰ÇEř}řu*‹Eüx t‹Eü‹P ‹Eô‰B ‹Uô‹Eü‹@ ‰B‹Uü‹Eô‰B ŤEôéX˙˙˙‹EđŤ …‹¸‹Eü‰ ŤEđ˙éţ˙˙ÉĂU‰ĺě=téŻÇÇEü‹Eü;Ľr鎋EüŤ…ˇ¸‹xtl‹EüŤ…ˇ¸‹‹@ ‰Eř}řuëL‹Eřxu8‹Eř8t0‹Eř‹xu%ě‹EüŤ…ˇ¸‹˙p‹Eř˙0č…)˙˙Ä‹Eř‹@‰Eř묍Eü˙éb˙˙˙ÉĂU‰ĺěě hU=čü˙˙˙ÄÉĂU‰ĺěěhm=˙u čü˙˙˙Ä‹E‹@‰Eü}üuë?ě‹Eü˙0hŽ˙u čü˙˙˙Ä‹Eüx těh†=˙u čü˙˙˙Ä‹Eü‹@ ‰Eüëąěh‰=˙u čü˙˙˙ĸÉĂU‰ĺě‹E‹@‰Eü}üuë/‹Eüě˙u ˙0čü˙˙˙Ä…Ŕu ‹Eü‹@˙ЉEřë(‹Eü‹@ ‰EüëÉěhŤ=˙5čü˙˙˙ÄÇEř‹EřÉĂU‰ĺě‹E‹@‰Eü}üuë8‹Eüě˙u ˙0čü˙˙˙Ä…Ŕuě ‹Eü˙u‹@˙ĐĉEřë(‹Eü‹@ ‰EüëŔěhŤ=˙5čü˙˙˙ÄÇEř‹EřÉĂU‰ĺ¸@ÉĂU‰ĺěěěčĺ˙˙˙ÄPěčŮ˙˙˙Ä˙pčü˙˙˙ÄPčü˙˙˙ĉEü}üt ‹EüÇ@‹EüÉĂU‰ĺSě‹E‰Eřě jčü˙˙˙ĉEô}ôtaě ˙u čü˙˙˙Ä@‰Eđ‹]ôě ˙uđčü˙˙˙ĉ‹Eô8t4ě˙uđ˙u ‹Eô˙0čü˙˙˙Ä‹Uô‹E‰B‹Uô‹E‰B‹Uô‹Eř‹@‰B ‹Uř‹Eô‰B‹]üÉĂU‰ĺěÇEüÇEř‹Uř‰ĐÁŕ)ĐŤ…‹E <uéę‹Uř‰ĐÁŕ)ĐÁŕ‰Eô‹E ‰Eđ‹Uô‹Mđ<‡d‹Uô‹Mđ‹Áŕ‹€´=˙ŕě ‹Uř‰ĐÁŕ)ĐŤ…‹E ˙tčü˙˙˙ĉEüé,ě‹Uř‰ĐÁŕ)ĐŤ…‹E ˙t˙t čü˙˙˙ĉEüéý‹Uř‰ĐÁŕ)ĐŤ…‹E |t+ě ‹Uř‰ĐÁŕ)ĐŤ…‹E ˙tčü˙˙˙ĉEüé·˙ÇEüéĄěj‹Uř‰ĐÁŕ)ĐŤ…‹E ‹D˙0‹Uř‰ĐÁŕ)ĐŤ…‹E ˙tčS7˙˙ĉEüëaě‹Uř‰ĐÁŕ)ĐŤ…‹E ‹D˙0‹Uř‰ĐÁŕ)ĐŤ…‹E ˙t‹Uř‰ĐÁŕ)ĐŤ…‹E ˙tč/8˙˙ĉEüëÇEü}ütIě˙uü‹Uř‰ĐÁŕ)ĐŤ…‹E ˙t˙učü˙˙˙Ä‹Eü˙8tëě ‹Eü‹@˙uü‹@˙ĐÄŤEř˙é÷ý˙˙ÉĂU‰ĺě8ÇEü‹Eü‰ÂÁâ‹E<uéü‹Eü‰ÂÁâ‹E‹D ‰Eř}ř„Öěh›˙uřčü˙˙˙ĉEř}ř„¶ÇEđ‹EřŔ ‰EěÇEô‹Uô‰ĐÁŕ)ĐŤ…‹E <uëo‹Uô‰ĐÁŕ)ĐŤ…‹E ě ˙tčü˙˙˙ĉÁ‹Uô‰ĐÁŕ)ĐŤ…‹E ěQ˙uě˙tčü˙˙˙Ä…Ŕu‹Uô‰ĐÁŕ)ĐÁŕE ‰Eđë ŤEô˙éu˙˙˙}đ„ ‹Eđ‹U‹@)ĐÁř‰Eč‹E荅‹E‹‰Eä‹Eü‰ÂÁâ‹E‹T ‹Eř)ЉEŕ‹Eäě ˙0čü˙˙˙ÄŔ ‰EÜě ‹EÜEŕŔ Pčü˙˙˙ĉEŘ}Ř„—‹E؉EÔ‹Eđ8u ‹Eđ‹@‰EĚëÇEĚ‹ẺEĐ}Đtkě˙uŕ‹Eü‰ÂÁâ‹E˙t ˙uÔčü˙˙˙Ä‹UŕŤEÔěj h›˙uÔčü˙˙˙ÄŤEÔ ˙uÜ‹Eä˙0˙uĐ˙uÔčţ%˙˙Ä‹Eü‰ÁÁá‹U‹E؉D ŤEü˙éîý˙˙ÉĂU‰ĺě=u čĚú˙˙ŁhŔ hhđhŕč¬ý˙˙Äě hôjjhŕhĚ=čü˙˙˙Ä ‰Eüě ˙uüčü˙˙˙ĉEřě jč1ö˙˙Äěhđ˙uřč:ű˙˙Äě hÓ=čü˙˙˙ĉEô}ôtdě ˙uôčü˙˙˙ĉEđěhč=˙uđčü˙˙˙ĉEě}ět!‹Eěxuě ˙uěčü˙˙˙ÄŁPëěh>˙5čü˙˙˙ÄÉĂU‰ĺě} ˙˙u-}u'ě hTčü˙˙˙ÄěhjhVäčü˙˙˙ÄÉĂU‰ĺě}t‹Extě ‹E˙u ‹@˙ĐĉEüë‹E ‰Eü‹EüÉĂU‰ĺ‹E‹@ÉĂU‰ĺ‹E‹@ ÉĂU‰ĺSěÇEř‹]čţ(˙˙9Ct‹E‹@ěhC˙p čü˙˙˙Ä…ŔuÇEř‹Eř‹]üÉĂU‰ĺě‹E‰Eü‹Eü‹@;Et ÇEřë ě˙u‹Eü˙p˙u čü˙˙˙Ä‹Eü‹@ ‰Eř‹EřÉĂU‰ĺěě˙u ˙učŘ4˙˙ÄÉĂU‰ĺěěŤEüP˙učŃ˙˙˙Ä…ŔuějjŤEüPčü˙˙˙Ä‹EüÉĂU‰ĺěěŤEřP˙učg5˙˙Ä…ŔuějjŤEřPčü˙˙˙Ä‹Eř‹Uü‰Eđ‰UôÝEđÉĂU‰ĺěěŤE˙P˙učU6˙˙Ä…ŔuějjŤE˙Pčü˙˙˙ĶE˙ÉĂU‰ĺěěj˙u ˙učÂ6˙˙Ä…Ŕt ÇEüë%} tčü˙˙˙ě˙uhĽčű*˙˙ÄÇEü‹EüÉĂU‰ĺěě hTčü˙˙˙ÄÉĂU‰ĺěěh˙˙jčĄý˙˙ÄÉĂSwig object carries a C/C++ instance pointer$ $ ř  C˛ ć0 l @Ę Swig object carries a C/C++ instance pointer‘p& ş  >  Ę/”B2YÄ€dŔ6 ŕ! Ú!` ¬"  ~#Ă P$á H%ő °& !ľ(! +1!Ŕ-E!v0Y!,3m!ě3!^5•!ŕ8©!B:˝!¤;Ń!h<ĺ!?"ÔA*"–B>"řCR"”Ek"đE{"IŠ"ŕJ›"`M«"ÚOľ"nQĎ"2Rŕ"@Vď" W#¶W #X`#®X€#HZŔ#â[$|]@$_€$°`Ŕ$Jb%äc@%~e`%g€%˛hŔ%Ni&ęi@&†j€&"kŔ&ľk'Zl@'ňl`'Šm '&nŕ'Ân (^p@(úp€(–q (.rŕ(Ćr )^s`)ös )Žtŕ)ęt *†u@*v`*¶v *Rwŕ*îw +ŠxB+&y`+Ây +^zÇ+öz,ś|$,8}@,Ň~€,.Ŕ,Ę-¤@-~€-X…Ŕ-2‡. ‰@.h‰`.Šz.Ţ‹.¸Ť¶.’ŹÔ.l‘/F“ /˘“`/>”€/Ö”ť/°–ş/Šŕ/dš 0>ś`0ž 0ňźŕ0N  1ę `1‚ˇ‚1˘ź1˛˘Ŕ1JŁ2$Ą@2ţ¦€2بŔ2˛Ş3ڬ@3f®€3@°Ŕ3˛4ôł@4ε€4¨·Ŕ4‚ą5\»@56˝€5żŔ5ęŔ6ÄÂ@6žÄ€6xĆŔ6RČ7,Ę@7Ě€7ŕÍŔ7şĎ8”Ń@8đŃl8ŚŇ 8(Óŕ8ŔÓ 9\Ô`9řÔ9”Ő 90ÖÍ9ĚÖę9h×:::Ľ%:/:D:Y:m:|:Š::Ą:ż:Ř:ď:;;6;P;i;…; ;Ŕ;ă;< <`<•<Ŕ<ć<đ<ů<====-=<=I= 4 H \ p „ ¬ Ŕ Ô č ü  $ 8 L ` t ś 4 H \ p „ ¬ Ŕ Ô č ü  $ 8 L ` t ś @`€ Ŕŕ @`€ Ŕŕ @`€Swig var link object§= šÚۆۂÚ0123456789abcdefNULL%o%xPySwigObject%s%s%sPySwigPackeda '%s' is expected, 'PySwigObject(%s)' is receiveda '%s' is expected, '%s(%s)' is receiveda '%s' is expected, '%s' is receiveda '%s' is expectedunexpected type is received%s %sargument number %d:thisthisownswig_ptr: C/C++ pointerC/C++ packed dataSwig: null type passed to NewPointerObj(O)type_pointerswig_runtime_data2value %ld is less than '%s' minimum %ldvalue %ld is greater than '%s' maximum %ldlongdoubleboolchar *:new_nec_contextO:delete_nec_contextO:nec_context_initializeO:nec_context_get_geometryOO:nec_context_get_input_parametersOO:nec_context_get_norm_rx_patternOO:nec_context_get_radiation_patternOO:nec_context_get_structure_excitationOO:nec_context_get_near_field_patternOO:nec_context_get_structure_currentsOOO:nec_context_geometry_completeOOOOO:nec_context_fr_cardOOOOOOOO:nec_context_ld_cardOOOOOOOOO:nec_context_gn_cardOOOOOOOOOOO:nec_context_ex_cardOOOOOOOOOOO:nec_context_tl_cardOOOOOOOOOOO:nec_context_nt_cardOO:nec_context_xq_cardOOOOO:nec_context_gd_cardOOOOOOOOOOOOOO:nec_context_rp_cardOOOOO:nec_context_pt_cardOOOOO:nec_context_pq_cardOO:nec_context_kh_cardOOOOOOOOOOO:nec_context_ne_cardOOOOOOOOOOO:nec_context_nh_cardOO:nec_context_set_extended_thin_wire_kernelOOOOO:nec_context_cp_cardOOOOOO:nec_context_pl_cardOOOOOOOOOOOOO:c_geometry_wireOOOOOOO:c_geometry_arcOOOOOOOOOO:c_geometry_helixOOOOOOOOOO:c_geometry_moveOOOOOO:c_geometry_reflectOO:c_geometry_scaleOOOOOOOOOOOOOOO:c_geometry_patch:new_c_geometryO:delete_c_geometryO:nec_radiation_pattern_get_frequencyO:nec_radiation_pattern_get_gainCall to API function without first calling import_libnumarray() in PyNEC_wrap.cxxO:nec_radiation_pattern_get_gain_vertO:nec_radiation_pattern_get_gain_horizO:nec_radiation_pattern_get_gain_totO:nec_radiation_pattern_get_pol_axial_ratioO:nec_radiation_pattern_get_pol_tiltO:nec_radiation_pattern_get_pol_sense_indexO:nec_radiation_pattern_get_e_thetaO:nec_radiation_pattern_get_e_phiO:nec_radiation_pattern_get_e_rO:nec_radiation_pattern_get_normalization_factorO:nec_radiation_pattern_get_maximum_gain_dbO:nec_radiation_pattern_get_delta_thetaO:nec_radiation_pattern_get_theta_startO:nec_radiation_pattern_get_delta_phiO:nec_radiation_pattern_get_phi_startO:nec_radiation_pattern_get_nthetaO:nec_radiation_pattern_get_nphiO:nec_radiation_pattern_get_average_power_gainO:nec_radiation_pattern_get_average_power_solid_angleO:nec_radiation_pattern_get_groundO:nec_radiation_pattern_get_rangeO:nec_radiation_pattern_get_wavelengthO:nec_radiation_pattern_get_ifarO:nec_radiation_pattern_get_rp_normalizationO:nec_radiation_pattern_get_rp_output_formatO:nec_radiation_pattern_get_rp_power_averageO:nec_radiation_pattern_get_rp_ipdO:nec_norm_rx_pattern_get_frequencyO:nec_norm_rx_pattern_get_n_thetaO:nec_norm_rx_pattern_get_n_phiO:nec_norm_rx_pattern_get_theta_startO:nec_norm_rx_pattern_get_phi_startO:nec_norm_rx_pattern_get_delta_thetaO:nec_norm_rx_pattern_get_delta_phiO:nec_norm_rx_pattern_get_etaO:nec_norm_rx_pattern_get_axial_ratioO:nec_norm_rx_pattern_get_segment_numberO:nec_norm_rx_pattern_get_typeO:nec_norm_rx_pattern_get_norm_factorO:nec_norm_rx_pattern_get_magO:nec_structure_excitation_get_frequencyO:nec_structure_excitation_get_tagO:nec_structure_excitation_get_segmentO:nec_structure_excitation_get_currentO:nec_structure_excitation_get_voltageO:nec_structure_excitation_get_powerO:nec_antenna_input_get_frequencyO:nec_antenna_input_get_tagO:nec_antenna_input_get_segmentO:nec_antenna_input_get_currentO:nec_antenna_input_get_voltageO:nec_antenna_input_get_powerO:nec_near_field_pattern_get_frequencyO:nec_near_field_pattern_get_nfehO:nec_near_field_pattern_get_xO:nec_near_field_pattern_get_yO:nec_near_field_pattern_get_zO:nec_near_field_pattern_get_field_xO:nec_near_field_pattern_get_field_yO:nec_near_field_pattern_get_field_zO:nec_structure_currents_get_frequencyO:nec_structure_currents_get_iptflgO:nec_structure_currents_get_iptflqO:nec_structure_currents_get_nO:nec_structure_currents_get_mO:nec_structure_currents_get_current_segment_numberO:nec_structure_currents_get_current_segment_tagO:nec_structure_currents_get_current_segment_center_xO:nec_structure_currents_get_current_segment_center_yO:nec_structure_currents_get_current_segment_center_zO:nec_structure_currents_get_current_segment_lengthO:nec_structure_currents_get_current_thetaO:nec_structure_currents_get_current_phiO:nec_structure_currents_get_currentO:nec_structure_currents_get_q_density_segment_numberO:nec_structure_currents_get_q_density_segment_tagO:nec_structure_currents_get_q_density_segment_center_xO:nec_structure_currents_get_q_density_segment_center_yO:nec_structure_currents_get_q_density_segment_center_zO:nec_structure_currents_get_q_density_segment_lengthO:nec_structure_currents_get_q_densityO:nec_structure_currents_get_patch_numberO:nec_structure_currents_get_patch_center_xO:nec_structure_currents_get_patch_center_yO:nec_structure_currents_get_patch_center_zO:nec_structure_currents_get_patch_tangent_vector1O:nec_structure_currents_get_patch_tangent_vector2O:nec_structure_currents_get_patch_e_xO:nec_structure_currents_get_patch_e_yO:nec_structure_currents_get_patch_e_zO:nec_ground_get_relative_dielectric_constantO:nec_ground_get_conductivityO:nec_ground_get_radial_wire_countO:nec_ground_get_radial_wire_lengthO:nec_ground_get_radial_wire_radiusO:nec_ground_get_cliff_edge_distanceO:nec_ground_get_cliff_heightO:nec_ground_get_relative_dielectric_constant2O:nec_ground_get_conductivity2new_nec_contextdelete_nec_contextnec_context_initializenec_context_get_geometrynec_context_get_input_parametersnec_context_get_norm_rx_patternnec_context_get_radiation_patternnec_context_get_structure_excitationnec_context_get_near_field_patternnec_context_get_structure_currentsnec_context_geometry_completenec_context_fr_cardnec_context_ld_cardnec_context_gn_cardnec_context_ex_cardnec_context_tl_cardnec_context_nt_cardnec_context_xq_cardnec_context_gd_cardnec_context_rp_cardnec_context_pt_cardnec_context_pq_cardnec_context_kh_cardnec_context_ne_cardnec_context_nh_cardnec_context_set_extended_thin_wire_kernelnec_context_cp_cardnec_context_pl_cardnec_context_swigregisterc_geometry_wirec_geometry_arcc_geometry_helixc_geometry_movec_geometry_reflectc_geometry_scalec_geometry_patchnew_c_geometrydelete_c_geometryc_geometry_swigregisternec_radiation_pattern_get_frequencynec_radiation_pattern_get_gainnec_radiation_pattern_get_gain_vertnec_radiation_pattern_get_gain_horiznec_radiation_pattern_get_gain_totnec_radiation_pattern_get_pol_axial_rationec_radiation_pattern_get_pol_tiltnec_radiation_pattern_get_pol_sense_indexnec_radiation_pattern_get_e_thetanec_radiation_pattern_get_e_phinec_radiation_pattern_get_e_rnec_radiation_pattern_get_normalization_factornec_radiation_pattern_get_maximum_gain_dbnec_radiation_pattern_get_delta_thetanec_radiation_pattern_get_theta_startnec_radiation_pattern_get_delta_phinec_radiation_pattern_get_phi_startnec_radiation_pattern_get_nthetanec_radiation_pattern_get_nphinec_radiation_pattern_get_average_power_gainnec_radiation_pattern_get_average_power_solid_anglenec_radiation_pattern_get_groundnec_radiation_pattern_get_rangenec_radiation_pattern_get_wavelengthnec_radiation_pattern_get_ifarnec_radiation_pattern_get_rp_normalizationnec_radiation_pattern_get_rp_output_formatnec_radiation_pattern_get_rp_power_averagenec_radiation_pattern_get_rp_ipdnec_radiation_pattern_swigregisternec_norm_rx_pattern_get_frequencynec_norm_rx_pattern_get_n_thetanec_norm_rx_pattern_get_n_phinec_norm_rx_pattern_get_theta_startnec_norm_rx_pattern_get_phi_startnec_norm_rx_pattern_get_delta_thetanec_norm_rx_pattern_get_delta_phinec_norm_rx_pattern_get_etanec_norm_rx_pattern_get_axial_rationec_norm_rx_pattern_get_segment_numbernec_norm_rx_pattern_get_typenec_norm_rx_pattern_get_norm_factornec_norm_rx_pattern_get_magnec_norm_rx_pattern_swigregisternec_structure_excitation_get_frequencynec_structure_excitation_get_tagnec_structure_excitation_get_segmentnec_structure_excitation_get_currentnec_structure_excitation_get_voltagenec_structure_excitation_get_powernec_structure_excitation_swigregisternec_antenna_input_get_frequencynec_antenna_input_get_tagnec_antenna_input_get_segmentnec_antenna_input_get_currentnec_antenna_input_get_voltagenec_antenna_input_get_powernec_antenna_input_swigregisternec_near_field_pattern_get_frequencynec_near_field_pattern_get_nfehnec_near_field_pattern_get_xnec_near_field_pattern_get_ynec_near_field_pattern_get_znec_near_field_pattern_get_field_xnec_near_field_pattern_get_field_ynec_near_field_pattern_get_field_znec_near_field_pattern_swigregisternec_structure_currents_get_frequencynec_structure_currents_get_iptflgnec_structure_currents_get_iptflqnec_structure_currents_get_nnec_structure_currents_get_mnec_structure_currents_get_current_segment_numbernec_structure_currents_get_current_segment_tagnec_structure_currents_get_current_segment_center_xnec_structure_currents_get_current_segment_center_ynec_structure_currents_get_current_segment_center_znec_structure_currents_get_current_segment_lengthnec_structure_currents_get_current_thetanec_structure_currents_get_current_phinec_structure_currents_get_currentnec_structure_currents_get_q_density_segment_numbernec_structure_currents_get_q_density_segment_tagnec_structure_currents_get_q_density_segment_center_xnec_structure_currents_get_q_density_segment_center_ynec_structure_currents_get_q_density_segment_center_znec_structure_currents_get_q_density_segment_lengthnec_structure_currents_get_q_densitynec_structure_currents_get_patch_numbernec_structure_currents_get_patch_center_xnec_structure_currents_get_patch_center_ynec_structure_currents_get_patch_center_znec_structure_currents_get_patch_tangent_vector1nec_structure_currents_get_patch_tangent_vector2nec_structure_currents_get_patch_e_xnec_structure_currents_get_patch_e_ynec_structure_currents_get_patch_e_znec_structure_currents_swigregisternec_ground_get_relative_dielectric_constantnec_ground_get_conductivitynec_ground_get_radial_wire_countnec_ground_get_radial_wire_lengthnec_ground_get_radial_wire_radiusnec_ground_get_cliff_edge_distancenec_ground_get_cliff_heightnec_ground_get_relative_dielectric_constant2nec_ground_get_conductivity2nec_ground_swigregister_p_c_geometryc_geometry *_p_char_p_doubledouble *|nec_float *_p_nec_antenna_inputnec_antenna_input *_p_nec_contextnec_context *_p_nec_groundnec_ground *_p_nec_near_field_patternnec_near_field_pattern *_p_nec_norm_rx_patternnec_norm_rx_pattern *_p_nec_radiation_patternnec_radiation_pattern *_p_nec_structure_currentsnec_structure_currents *_p_nec_structure_excitationnec_structure_excitation *_p_safe_arrayTdouble_tsafe_array *|real_array *_p_safe_arrayTint_tsafe_array *|int_array *_p_safe_arrayTstd__complexTdouble_t_tsafe_array > *|complex_array *_p_std__complexTdouble_tstd::complex *|nec_complex *_p_stringstring *_ptrdiff_tptrdiff_t_size_tsize_t_std__ptrdiff_tstd::ptrdiff_t_std__size_tstd::size_tSwig global variables { , } Unknown C global variableswigvarlinkťŢMÝxݧÝ˙ÝCŢ_PyNECnumarray.libnumarray_C_APICan't get API for module 'numarray.libnumarray'˙˙ FZ,˙˙ FZ,˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙:Mď’śŔzďĘŤ˙˙#ťŕýľ5˙˙+:Mű’śŔűćúÁűÖ™˙˙:Mď’śŔzďĘŤ˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙$/9WM®Ůă‡r®‰Ě˙˙ 5McŚ˙˙ 5McŚ˙˙ 5McŚ˙)9V cw˙)9V cw˙)9V cw˙8c} Šž˙˙&<Z}%­Ę˙˙&<Z}%­Ę˙˙&<Z}%­ĘU‰ĺě‹E€xt‹Extě ‹E˙pčü˙˙˙ÄÉĂU‰ĺÉĂU‰ĺÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹E˙p‹E˙0čü˙˙˙Äě ˙učü˙˙˙ÄÉĂU‰ĺÉĂU‰ĺÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹E˙p‹E˙0čü˙˙˙Äě ˙učü˙˙˙ÄÉĂU‰ĺÉĂU‰ĺÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹E˙p‹E˙0čü˙˙˙Äě ˙učü˙˙˙ÄÉĂU‰ĺSěě Ť]řě‹E ‰EôŤEôPŤEđ˙uPčü˙˙˙ÄŤEđPSčü˙˙˙ÄŤEřPčü˙˙˙Ä‹]üÉĂU‰ĺSěě Ť]řě‹E ‰EôŤEôPŤEđ˙uPčü˙˙˙ÄŤEđPSčü˙˙˙ÄŤEřPčü˙˙˙Ä‹]üÉĂU‰ĺSěě Ť]řě‹E ‰EôŤEôPŤEđ˙uPčü˙˙˙ÄŤEđPSčü˙˙˙ÄŤEřPčü˙˙˙Ä‹]üÉĂU‰ĺě‹E€xt‹Extě ‹E˙pčü˙˙˙ÄÉĂU‰ĺě‹E€xt‹Extě ‹E˙pčü˙˙˙ÄÉĂU‰ĺ‹EÇÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙ÄÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙Äě jčü˙˙˙ĉEřĆE÷ě˙u ˙uřčü˙˙˙ÄĆE÷‹Eř‹U‰ë.‰Eě‹Eě‰Eđ€}÷tě ˙uřčü˙˙˙Ä‹Uđ‰Uěě ˙uěčü˙˙˙€}÷tě ˙uřčü˙˙˙Ä‹EÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹@ÉĂU‰ĺ‹EÇÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙ÄÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙Äě jčü˙˙˙ĉEřĆE÷ě˙u ˙uřčü˙˙˙ÄĆE÷‹Eř‹U‰ë.‰Eě‹Eě‰Eđ€}÷tě ˙uřčü˙˙˙Ä‹Uđ‰Uěě ˙uěčü˙˙˙€}÷tě ˙uřčü˙˙˙Ä‹EÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹@ÉĂU‰ĺ‹EÇÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙ÄÉĂU‰ĺě‹E‹‰Eü}ütě ˙uüčü˙˙˙Äě ˙uüčü˙˙˙Äě jčü˙˙˙ĉEřĆE÷ě˙u ˙uřčü˙˙˙ÄĆE÷‹Eř‹U‰ë.‰Eě‹Eě‰Eđ€}÷tě ˙uřčü˙˙˙Ä‹Uđ‰Uěě ˙uěčü˙˙˙€}÷tě ˙uřčü˙˙˙Ä‹EÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹ÉĂU‰ĺ‹E‹@ÉĂU‰ĺSěD‹E ;E„ ě ˙u čü˙˙˙ĉEřě ˙učü˙˙˙Ä9Eř†“ŤEđě˙u Pčü˙˙˙Ä ˙uđŤEěě˙u Pčü˙˙˙Ä˙uě˙uř˙učü˙˙˙ĉEôě‹E˙p‹E˙0čü˙˙˙Äě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙Ä‹U‹Eô‰‹M‹U‹EřÁŕ‰Aé=ě ˙učü˙˙˙Ä;EřrnŤ]čŤEäě˙uPčü˙˙˙Ä ˙uäŤEŕě˙u Pčü˙˙˙Ä˙uŕŤEÜ˙u Pčü˙˙˙Ä˙uÜSčü˙˙˙Ä ěŤEŘ˙uPčü˙˙˙Ä˙uŘ‹EčPčü˙˙˙ÄéĽě‹E˙0Ť]Ôě ě˙učü˙˙˙Ä ‰EĐŤEĐPŤEĚ˙u Pčü˙˙˙ÄŤEĚPSčü˙˙˙Ä˙uÔŤEČě ˙u Pčü˙˙˙Ä˙uČčü˙˙˙Äě‹E˙pŤEÄ˙u Pčü˙˙˙Ä˙uÄŤ]Ŕěě˙učü˙˙˙Ä ‰EĽŤEĽPŤE¸˙u Pčü˙˙˙ÄŤE¸PSčü˙˙˙Ä˙uŔčü˙˙˙Ä‹M‹U‹EřÁŕ‰A‹E‹]üÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPŤEřě ˙uPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺSěD‹E ;E„ ě ˙u čü˙˙˙ĉEřě ˙učü˙˙˙Ä9Eř†“ŤEđě˙u Pčü˙˙˙Ä ˙uđŤEěě˙u Pčü˙˙˙Ä˙uě˙uř˙učü˙˙˙ĉEôě‹E˙p‹E˙0čü˙˙˙Äě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙Ä‹U‹Eô‰‹M‹U‹EřÁŕ‰Aé=ě ˙učü˙˙˙Ä;EřrnŤ]čŤEäě˙uPčü˙˙˙Ä ˙uäŤEŕě˙u Pčü˙˙˙Ä˙uŕŤEÜ˙u Pčü˙˙˙Ä˙uÜSčü˙˙˙Ä ěŤEŘ˙uPčü˙˙˙Ä˙uŘ‹EčPčü˙˙˙ÄéĽě‹E˙0Ť]Ôě ě˙učü˙˙˙Ä ‰EĐŤEĐPŤEĚ˙u Pčü˙˙˙ÄŤEĚPSčü˙˙˙Ä˙uÔŤEČě ˙u Pčü˙˙˙Ä˙uČčü˙˙˙Äě‹E˙pŤEÄ˙u Pčü˙˙˙Ä˙uÄŤ]Ŕěě˙učü˙˙˙Ä ‰EĽŤEĽPŤE¸˙u Pčü˙˙˙ÄŤE¸PSčü˙˙˙Ä˙uŔčü˙˙˙Ä‹M‹U‹EřÁŕ‰A‹E‹]üÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPŤEřě ˙uPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺSěD‹E ;E„ ě ˙u čü˙˙˙ĉEřě ˙učü˙˙˙Ä9Eř†“ŤEđě˙u Pčü˙˙˙Ä ˙uđŤEěě˙u Pčü˙˙˙Ä˙uě˙uř˙učü˙˙˙ĉEôě‹E˙p‹E˙0čü˙˙˙Äě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙Ä‹U‹Eô‰‹M‹U‹EřÁŕ‰Aé=ě ˙učü˙˙˙Ä;EřrnŤ]čŤEäě˙uPčü˙˙˙Ä ˙uäŤEŕě˙u Pčü˙˙˙Ä˙uŕŤEÜ˙u Pčü˙˙˙Ä˙uÜSčü˙˙˙Ä ěŤEŘ˙uPčü˙˙˙Ä˙uŘ‹EčPčü˙˙˙ÄéĽě‹E˙0Ť]Ôě ě˙učü˙˙˙Ä ‰EĐŤEĐPŤEĚ˙u Pčü˙˙˙ÄŤEĚPSčü˙˙˙Ä˙uÔŤEČě ˙u Pčü˙˙˙Ä˙uČčü˙˙˙Äě‹E˙pŤEÄ˙u Pčü˙˙˙Ä˙uÄŤ]Ŕěě˙učü˙˙˙Ä ‰EĽŤEĽPŤE¸˙u Pčü˙˙˙ÄŤE¸PSčü˙˙˙Ä˙uŔčü˙˙˙Ä‹M‹U‹EřÁŕ‰A‹E‹]üÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPŤEřě ˙uPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙ÄÉĂU‰ĺěěěfj˙u ˙učü˙˙˙ÄÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙ÄÉĂU‰ĺěěěfj˙u ˙učü˙˙˙ÄÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹M‹E‹‹A)ĐÁřP‹E˙0˙učü˙˙˙ÄÉĂU‰ĺěěěfj˙u ˙učü˙˙˙ÄÉĂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě˙u Sčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺ‹E‹ÉĂU‰ĺSě‹]ě˙u Sčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺ‹E‹ÉĂU‰ĺSě‹]ě˙u Sčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺ‹E‹ÉĂU‰ĺSě‹]ě‹E ‹‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ‹@‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹E ‹‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ‹@‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹E ‹‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ‹@‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPě ‹E‹@‰EôŤEôPŤEřPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺSěě˙u ˙učü˙˙˙ĉEřě˙uř‹EP‹EPčü˙˙˙Ä‹Eř‰EôëC‰Eđě ˙uđčü˙˙˙Äě˙u ˙uř˙učü˙˙˙Äčü˙˙˙‰Eđ‹]đčü˙˙˙‰]đě ˙uđčü˙˙˙‹Eô‹]üÉĂU‰ĺěě˙u˙u čü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EP‹EP‹E PSčü˙˙˙ĉ؋]üÉÂU‰ĺěěěfj‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSěě ˙učü˙˙˙ĉĂě ˙u čü˙˙˙Ä‹‹)ĐÁř‹]üÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPě ‹E‹@‰EôŤEôPŤEřPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺSěě˙u ˙učü˙˙˙ĉEřě˙uř‹EP‹EPčü˙˙˙Ä‹Eř‰EôëC‰Eđě ˙uđčü˙˙˙Äě˙u ˙uř˙učü˙˙˙Äčü˙˙˙‰Eđ‹]đčü˙˙˙‰]đě ˙uđčü˙˙˙‹Eô‹]üÉĂU‰ĺěě˙u˙u čü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EP‹EP‹E PSčü˙˙˙ĉ؋]üÉÂU‰ĺěěěfj‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSěě ˙učü˙˙˙ĉĂě ˙u čü˙˙˙Ä‹‹)ĐÁř‹]üÉĂU‰ĺěěŤEü˙uPčü˙˙˙ÄŤEüPě ‹E‹@‰EôŤEôPŤEřPčü˙˙˙ÄŤEřPčü˙˙˙ÄÉĂU‰ĺSěě˙u ˙učü˙˙˙ĉEřě˙uř‹EP‹EPčü˙˙˙Ä‹Eř‰EôëC‰Eđě ˙uđčü˙˙˙Äě˙u ˙uř˙učü˙˙˙Äčü˙˙˙‰Eđ‹]đčü˙˙˙‰]đě ˙uđčü˙˙˙‹Eô‹]üÉĂU‰ĺěě˙u˙u čü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EP‹EP‹E PSčü˙˙˙ĉ؋]üÉÂU‰ĺěěěfj‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹U ‹E‹Áŕ‰EřŤEřPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺSěě ˙učü˙˙˙ĉĂě ˙u čü˙˙˙Ä‹‹)ĐÁř‹]üÉĂU‰ĺ‹EÇ‹EÇ@‹EÇ@ÉĂU‰ĺÉĂU‰ĺ‹EÇ‹EÇ@‹EÇ@ÉĂU‰ĺě‹E;E uëě ˙učü˙˙˙ÄEëâÉĂU‰ĺ‹EÇ‹EÇ@‹EÇ@ÉĂU‰ĺÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺěě ˙u čü˙˙˙ÄÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺěě ˙u čü˙˙˙ÄÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺěě ˙u čü˙˙˙ÄÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺěě˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺSě‹E‰EřěŤE PŤEPčü˙˙˙Ä„Ŕuë5ěěŤEPčü˙˙˙ÄP˙uřčü˙˙˙Äě ŤEPčü˙˙˙ÄŤEř벋Eř‰Eôë@‰Eđě ˙uđčü˙˙˙Äě˙uř˙učü˙˙˙Äčü˙˙˙‰Eđ‹]đčü˙˙˙‰]đě ˙uđčü˙˙˙‹Eô‹]üÉĂU‰ĺ‹E‹U ‹‰ÉĂU‰ĺěě˙u‹E P‹EPčü˙˙˙ÄÉĂU‰ĺě} tě‹E ÁŕP˙učü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EPěŤEPčü˙˙˙Ä ˙0ěŤE Pčü˙˙˙Ä˙0Sčü˙˙˙ĉ؋]üÉÂU‰ĺÉĂU‰ĺěěfj˙uěŤE Pčü˙˙˙Ä˙0ŤEPčü˙˙˙Ä˙0čü˙˙˙ÄÉĂU‰ĺ‹EÉĂU‰ĺě} tě‹E ÁŕP˙učü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EPěŤEPčü˙˙˙Ä ˙0ěŤE Pčü˙˙˙Ä˙0Sčü˙˙˙ĉ؋]üÉÂU‰ĺěěŤE PŤEPčü˙˙˙Ä„Ŕuë)ě ŤEPčü˙˙˙ÄPčü˙˙˙Äě ŤEPčü˙˙˙ÄëľÉĂU‰ĺěěfj˙uěŤE Pčü˙˙˙Ä˙0ŤEPčü˙˙˙Ä˙0čü˙˙˙ÄÉĂU‰ĺ‹EÉĂU‰ĺě} tě‹E ÁŕP˙učü˙˙˙ÄÉĂU‰ĺSě‹]ě ěfj‹EPěŤEPčü˙˙˙Ä ˙0ěŤE Pčü˙˙˙Ä˙0Sčü˙˙˙ĉ؋]üÉÂU‰ĺÉĂU‰ĺěěfj˙uěŤE Pčü˙˙˙Ä˙0ŤEPčü˙˙˙Ä˙0čü˙˙˙ÄÉĂU‰ĺ‹EÉĂU‰ĺÉĂU‰ĺěÇEü}tě ‹EÁŕPčü˙˙˙ĉEü‹EüÉĂU‰ĺěÇEü}tě ‹EÁŕPčü˙˙˙ĉEü‹EüÉĂU‰ĺěÇEü}tě ‹EÁŕPčü˙˙˙ĉEü‹EüÉĂU‰ĺSěě ˙učü˙˙˙ĉĂě ˙u čü˙˙˙ĉ‹;•Ŕ¶Ŕ‹]üÉĂU‰ĺ‹E‹EÉĂU‰ĺ‹E‹ÉĂU‰ĺSě‹]ěfjěŤEPčü˙˙˙Ä ˙0˙u˙u čü˙˙˙ĉEřŤEřěPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺSě‹]ěfjěŤEPčü˙˙˙Ä ˙0˙u˙u čü˙˙˙ĉEřŤEřěPSčü˙˙˙ĉ؋]üÉÂU‰ĺSěě ˙učü˙˙˙ĉĂě ˙u čü˙˙˙ĉ‹;•Ŕ¶Ŕ‹]üÉĂU‰ĺěěfj˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺSě‹]ěfjěŤEPčü˙˙˙Ä ˙0˙u˙u čü˙˙˙ĉEřŤEřěPSčü˙˙˙ĉ؋]üÉÂU‰ĺěěfj˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺěě˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺěŤU˙ěŤEPRčü˙˙˙Ä ěfj˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺěě˙u˙u ˙učü˙˙˙ÄÉĂU‰ĺěě‹U‹E )ĐP˙u˙učü˙˙˙Ä‹U‹E )ĐEÉĂU‰ĺ‹EÉÂU‰ĺSě‹U‹E )ĐÁř‰Eř}řë-‹]‹M‹‹Q‰‰S‹A‹Q ‰C‰S EŤEŤEř˙ëË‹EÄ[ÉĂU‰ĺěě‹U‹E )ĐP˙u˙učü˙˙˙Ä‹U‹E )ĐEÉĂU‰ĺěě˙u ˙učü˙˙˙ÄÉĂU‰ĺě‹E‹P ‹@‰Eř‰UüÝEřÉĂU‰ĺ‹E‹@4ÉĂU‰ĺ‹E‹@8ÉĂU‰ĺě‹E‹P@‹@<‰Eř‰UüÝEřÉĂU‰ĺě‹E‹PP‹@L‰Eř‰UüÝEřÉĂU‰ĺě‹E‹PH‹@D‰Eř‰UüÝEřÉĂU‰ĺě‹E‹PX‹@T‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P ‹@‰Eř‰UüÝEřÉĂU‰ĺě‹E‹P(‹@$‰Eř‰UüÝEřÉĂU‰ĺ‹E‹@,ÉĂU‰ĺSě‹]ě‹E Ŕ0PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ\PSčü˙˙˙ĉ؋]üÉÂU‰ĺěě ‹EŔ\Pčü˙˙˙ÄÉĂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ8PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ,PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ\PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E ŔDPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ8PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ,PSčü˙˙˙ĉ؋]üÉÂU‰ĺ‹E‹@ÉĂU‰ĺSě‹]ě‹E ŔPSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ$PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ0PSčü˙˙˙ĉ؋]üÉÂU‰ĺSě‹]ě‹E Ŕ şA…B O.^. N.čř A…B N. A…B N.(˛ A…B I.$HŇ TA…B I.L.T. p {A…B c. a. ”> {A…B c. a.¸p'A…B L.$آ A…B I.L.T.$B`A…B Y.Ä. [.((˘íA…B t.p.Q.g. Q.T\A…B c.0těťA…B N.W.H.{.I.(¨Š\A…B P.M.X.I.(Ôć§A…B V.~.^.I.Ž6A…B g. ÄFA…B m. @ HA…B Y.M. dR^A…B Y. S.°~A…B h. $¨.ÝA…B ].d.E.$Đ .A…B ].Ż.K.$ř:¤A…B P.g.V.$ ŢA…B e.w._.HĘÉA…B U.h”žA…B g.2‘A…B g.¨Ä A…B g.ČdŇA…B o.č6 ŇA…B o.!ŇA…B o.(Ú!ŇA…B o.H¬"ŇA…B o.h~#ŇA…B o. P$řA…B }. `.$¬H%hA…B S. `.É. (Ô°& A…B t.0`.M.0(ľ(KA…B .0`.€.@(, +µA…B •.@`.Ô.P(XŔ-µA…B •.@`.Ô.P(„v0µA…B •.@`.Ô.P°,3ŔA…B o.$Đě3qA…B S. `.Ň.0(ř^5A…B Î.@`.^.P$$ŕ8bA…B S. `.Ă. $LB:bA…B S. `.Ă. t¤;ĂA…B o.(”h<µA…B •.@`.Ô.P(Ŕ?µA…B •.@`.Ô.PěÔAÂA…B o.$ –BbA…B S. `.Ă. $4řCśA…B b. `.î. \”E[A…B R.(|đEA…B Ż.@`..`(¨IŰA…B i.0`.&.0(ÔŕJ€A…B ‡.0`.­.P( `MzA…B ‡.0`.§.@$, ÚO”A…B [. `.í. T nQĂA…B o.(t 2R A…B .P`.˛.p  @VÉA…B U.Ŕ W«A…B g.ŕ ¶W[A…B R. X›A…B g.4 ®Xš"A…B DU.f.P.D.I.F.R.4X HZšEA…B DU.f.P.D.I.F.R.4 â[šhA…B DU.f.P.D.I.F.R.4Č |]š‹A…B DU.f.P.D.I.F.R.4 _š®A…B DU.f.P.D.I.F.R.48 °`šŃA…B DU.f.P.D.I.F.R.4p JbšôA…B DU.f.P.D.I.F.R.4¨ äcšA…B DU.f.P.D.I.F.R.4ŕ ~eš:A…B DU.f.P.D.I.F.R.4 gš]A…B DU.f.P.D.I.F.R.P ˛h›A…B g.p Ni›A…B g. ęi›A…B g.° †j›A…B g.Đ "k›A…B g.đ ľk›A…B g. ZlA…B g.0 ňlA…B g.P Šm›A…B g.p &n›A…B g.$ Ân›€A…B H†‡X.¸ ^p›A…B g.Ř úp›A…B g.ř –qA…B g..rA…B g.8ĆrA…B g.X^sA…B g.xösA…B g.Žt[A…B R.¸ęt›A…B g.؆uA…B g.řvA…B g.¶v›A…B g.8Rw›A…B g.Xîw›A…B g.xŠx›A…B g.&y›A…B g.¸Ây›A…B g.Ř^zA…B g.(řöz¦”A…B DU.f.P.$ś|›A…B g.4D8}šĂA…B DU.f.P.D.I.F.R.|Ň~[A…B R.ś.›A…B g.,ĽĘŮćA…B DX.P.š.P.,ě¤ŮA…B DX.P.š.P.,~Ů6A…B DX.P.š.P.,LX…Ů^A…B DX.P.š.P.,|2‡Ů†A…B DX.P.š.P.¬ ‰[A…B R.Ěh‰›A…B g.,ěŠŮ®A…B DX.P.š.P.,Ţ‹ŮÖA…B DX.P.š.P.,L¸ŤŮţA…B DX.P.š.P.,|’ŹŮ&A…B DX.P.š.P.,¬l‘ŮNA…B DX.P.š.P.ÜF“[A…B R.ü˘“›A…B g.>”A…B g.,<Ö”ŮvA…B DX.P.š.P.,l°–ŮžA…B DX.P.š.P.,śŠŮĆA…B DX.P.š.P.,ĚdšŮîA…B DX.P.š.P.,ü>śŮA…B DX.P.š.P.,,žŮ>A…B DX.P.š.P.\ňź[A…B R.|N ›A…B g.śę A…B g.Ľ‚ˇA…B g.ܢA…B g.ü˛˘A…B g.,JŁŮfA…B DX.P.š.P.,L$ĄŮŽA…B DX.P.š.P.,|ţ¦Ů¶A…B DX.P.š.P.,¬بŮŢA…B DX.P.š.P.,ܲŞŮA…B DX.P.š.P., ڬŮ.A…B DX.P.š.P.,<f®ŮVA…B DX.P.š.P.,l@°Ů~A…B DX.P.š.P.,ś˛Ů¦A…B DX.P.š.P.,ĚôłŮÎA…B DX.P.š.P.,üεŮöA…B DX.P.š.P.,,¨·ŮA…B DX.P.š.P.,\‚ąŮFA…B DX.P.š.P.,Ś\»ŮnA…B DX.P.š.P.,Ľ6˝Ů–A…B DX.P.š.P.,ěżŮľA…B DX.P.š.P.,ęŔŮćA…B DX.P.š.P.,LÄÂŮA…B DX.P.š.P.,|žÄŮ6A…B DX.P.š.P.,¬xĆŮ^A…B DX.P.š.P.,ÜRČنA…B DX.P.š.P., ,ĘŮ®A…B DX.P.š.P.,<ĚŮÖA…B DX.P.š.P.,lŕÍŮţA…B DX.P.š.P.,śşĎŮ&A…B DX.P.š.P.Ě”Ń[A…B R.ěđŃ›A…B g. ŚŇ›A…B g.,(ÓA…B g.LŔÓ›A…B g.l\Ô›A…B g.ŚřÔ›A…B g.¬”Ő›A…B g.Ě0Ö›A…B g.ěĚÖ›A…B g. h×[A…B R. ,Ä×÷A…B f. PĽŮĹA…B Ł.t‚ÚA…B K.$”ŰhA…B _.R.`.Ľ†ŰqA…B _.$ÜÜLA…B I.L.T. ŕÜA…B …. (ß!A…B G.$L"áA…B j.^. Q.tA…B L.”,A…B Q.´A…B L.Ô,A…B Q.ôA…B L.,A…B Q.(4GA…B DZ.M.L.(`GA…B DZ.M.L.(ŚGA…B DZ.M.L.¸ŞNA…B W.ŘŞ_A…B W.řŞpA…B W.T$A…B DR.A. Q.. R.L.R.O.a. V.M.U.K.X.W. V.M.K.$p<A…B M.V.L.T$A…B DR.A. Q.. R.L.R.O.a. V.M.U.K.X.W. V.M.K.$đ<A…B M.V.L.T$A…B DR.A. Q.. R.L.R.O.a. V.M.U.K.X.W. V.M.K.$p<A…B M.V.L.A…B L.¸,A…B _.ŘA…B R.řA…B L. ,A…B _.8 A…B R.X A…B L.x ,A…B _. A…B R. ¸ &A…B DN. Ü &A…B DN. !&A…B DN. $!"A…B DJ. H!3A…B D[. l!"A…B DJ. !3A…B D[. ´!"A…B DJ. Ř!3A…B D[. ü!+A…B DS. ",A…B DT.D"!A…B T. d"+A…B DS. ",A…B DT.¬"!A…B T. Ě"+A…B DS. đ",A…B DT.#!A…B T.$4#FA…B M.`.L.(\#„„A…B DI.N.Y.#A…B L. ¨#1A…B DY. Ě#!A…B T. ě#3A…B D[.$!A…B T. 0$3A…B DF.$T$FA…B M.`.L.(|$„ A…B DI.N.Y.¨$A…B L. Č$1A…B DY. ě$!A…B T. %3A…B D[.0%!A…B T. P%3A…B DF.$t%FA…B M.`.L.(ś%„ĽA…B DI.N.Y.Č%A…B L. č%1A…B DY.  &!A…B T. ,&3A…B D[.P&!A…B T. p&3A…B DF.”&'A…B T.´&A…B I.Ô&A…B I.ô&A…B I.'A…B Q.,4'«ŘA…B DQ.X.L.I.Y.d'A…B Q.„'#A…B V.(¤'KA…B DW. Q.K. $Đ'8A…B S.N.J.ř'#A…B V.((KA…B DW. Q.K. $D(KA…B O.U.I.$l(8A…B S.N.J.”(#A…B V.(´(KA…B DW. Q.K. $ŕ(8A…B S.N.J.)-A…B Z.()-A…B Z.H)-A…B Z.$h)KA…B DP. P.)A…B R.$°)KA…B DP. P. Ř)6A…B DF.ü)A…B R.$*KA…B DP. P.D*A…B R.d*A…B O.„*2A…B N.¤*A…B O.Ä*(â>A…B Z.ä*fâ6A…B ^. +&A…B DN. (+&A…B DN.L+A…B M. l+&A…B DN. +&A…B DN. ´+&A…B DN. Ř+&A…B DN. ü+&A…B DN. ,&A…B DN. D,&A…B DN. h,&A…B DN. Ś,&A…B DN. °,&A…B DN. Ô,&A…B DN. ř,&A…B DN. -&A…B DN. @-&A…B DN. d-&A…B DN. -&A…B DN. ¬-dA…B U. B.Đ-A…B U. đ-(A…B DP. .(A…B DP. 8.(A…B DP. \.(A…B DP. €.(A…B DP. ¤.(A…B DP. Č.(A…B DP. ě.(A…B DP. /(A…B DP. 4/(A…B DP.X/%A…B X. x/(A…B DP.ś/A…B M. Ľ/(A…B DP. ŕ/(A…B DP. 0(A…B DP. (0(A…B DP. L0(A…B DP. p0(A…B DP. ”0(A…B DP. ¸0(A…B DP. Ü0(A…B DP. 1(A…B DP. $1(A…B DP. H1(A…B DP. l1(A…B DP. 1(A…B DP. ´1(A…B DP. Ř1(A…B DP. ü1(A…B DP. 2(A…B DP. D2(A…B DP. h2(A…B DP. Ś2(A…B DP. °2(A…B DP. Ô2(A…B DP. ř2(A…B DP. 3(A…B DP.@3A…B R.`3A…B R.€3A…B R. 3A…B R.Ŕ3A…B R.ŕ3A…B R.4BăA…B L. 4\ă4A…B M.@4ă@A…B M.`4Đă5A…B M.$€4äPA…B N.[.P. ¨4[A…B N. Ě4[A…B N. đ4[A…B N.5VäA…B K.45A…B N.T5A…B N.t5A…B N.”5A…B N.´5A…B N.Ô5A…B N. ô5źA…B DM.$6ŽA…B E†T. @6˝A…B DK.0d6ÔôA…B DM. R.L.K.U.K.06Ô A…B DM. R.L.K.U.K.0Ě6Ô( A…B DM. R.L.K.U.K.$7‡A…B E†T.$(7śA…B E†T. P7A…B j.R.(t7üA…B Dc.q. k. 76A…B i. Ŕ7&A…B DL.ä7—A…B ^. 8"A…B DJ. (8OA…B DI. L8"A…B DJ. p8OA…B DI. ”8"A…B DJ. ¸8OA…B DI.Ü8—A…B ^.ü86A…B i. 9&A…B DL.@96A…B i. `9&A…B DL.(„9GA…B DZ.M.L. °9"A…B DJ. Ô93A…B D[.ř9näA…B M.GCC: (GNU) 3.2.3 20030502 (Red Hat Linux 3.2.3-20).symtab.strtab.shstrtab.rel.text.rel.data.bss.rel.rodata.gcc_except_table.rel.gnu.linkonce.t._ZN10safe_arrayIdED1Ev.gnu.linkonce.t._ZNSaIiEC1Ev.gnu.linkonce.t._ZNSaIiED1Ev.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEEC1ERKS0_.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEED1Ev.gnu.linkonce.t._ZNSaISt7complexIdEEC1Ev.gnu.linkonce.t._ZNSaISt7complexIdEED1Ev.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EEC1ERKS2_.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EED1Ev.gnu.linkonce.t._ZNSaIdEC1Ev.gnu.linkonce.t._ZNSaIdED1Ev.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEEC1ERKS0_.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEED1Ev.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEEixEj.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EEixEj.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEEixEj.rel.gnu.linkonce.t._ZN10safe_arrayIiED1Ev.rel.gnu.linkonce.t._ZN10safe_arrayISt7complexIdEED1Ev.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIdEEC1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIdEED1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIdEEaSERKS1_.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIdEEadEv.gnu.linkonce.t._ZNK10safe_arrayIdE4sizeEv.gnu.linkonce.t._ZNK10safe_arrayIdE7get_ptrEv.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIiEEC1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIiEED1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIiEEaSERKS1_.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayIiEEadEv.gnu.linkonce.t._ZNK10safe_arrayIiE4sizeEv.gnu.linkonce.t._ZNK10safe_arrayIiE7get_ptrEv.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayISt7complexIdEEEC1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayISt7complexIdEEED1Ev.rel.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayISt7complexIdEEEaSERKS3_.gnu.linkonce.t._ZN16SwigValueWrapperI10safe_arrayISt7complexIdEEEadEv.gnu.linkonce.t._ZNK10safe_arrayISt7complexIdEE4sizeEv.gnu.linkonce.t._ZNK10safe_arrayISt7complexIdEE7get_ptrEv.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEEaSERKS1_.rel.gnu.linkonce.t._ZNKSt6vectorIiSaIiEE4sizeEv.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EEaSERKS3_.rel.gnu.linkonce.t._ZNKSt6vectorISt7complexIdESaIS1_EE4sizeEv.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEEaSERKS1_.rel.gnu.linkonce.t._ZNKSt6vectorIdSaIdEE4sizeEv.rel.gnu.linkonce.t._ZNSt12_Vector_baseIiSaIiEEC2ERKS0_.rel.gnu.linkonce.t._ZNSt12_Vector_baseIiSaIiEED2Ev.rel.gnu.linkonce.t._ZSt8_DestroyIPiEvT_S1_.rel.gnu.linkonce.t._ZNSt12_Vector_baseISt7complexIdESaIS1_EEC2ERKS2_.rel.gnu.linkonce.t._ZNSt12_Vector_baseISt7complexIdESaIS1_EED2Ev.rel.gnu.linkonce.t._ZSt8_DestroyIPSt7complexIdEEvT_S3_.rel.gnu.linkonce.t._ZNSt12_Vector_baseIdSaIdEEC2ERKS0_.rel.gnu.linkonce.t._ZNSt12_Vector_baseIdSaIdEED2Ev.rel.gnu.linkonce.t._ZSt8_DestroyIPdEvT_S1_.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEE3endEv.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EE3endEv.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEE3endEv.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEE5beginEv.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEplERKi.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EE5beginEv.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS2_SaIS2_EEEplERKi.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS2_SaIS2_EEEdeEv.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEE5beginEv.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEplERKi.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEdeEv.rel.gnu.linkonce.t._ZNKSt6vectorIiSaIiEE5beginEv.rel.gnu.linkonce.t._ZNKSt6vectorIiSaIiEE3endEv.rel.gnu.linkonce.t._ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEPiET0_T_SA_S9_.rel.gnu.linkonce.t._ZNKSt6vectorISt7complexIdESaIS1_EE5beginEv.rel.gnu.linkonce.t._ZNKSt6vectorISt7complexIdESaIS1_EE3endEv.rel.gnu.linkonce.t._ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEEPS3_ET0_T_SC_SB_.rel.gnu.linkonce.t._ZNKSt6vectorIdSaIdEE5beginEv.rel.gnu.linkonce.t._ZNKSt6vectorIdSaIdEE3endEv.rel.gnu.linkonce.t._ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEPdET0_T_SA_S9_.rel.gnu.linkonce.t._ZNKSt6vectorIiSaIiEE8capacityEv.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKiS1_EEEEPijT_S9_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIiSaIiELb1EE13_M_deallocateEPij.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEENS1_IPiS6_EEET0_T_SB_SA_.rel.gnu.linkonce.t._ZSt8_DestroyIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEplERS1_.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEPiET0_T_SA_S9_.rel.gnu.linkonce.t._ZN9__gnu_cxxmiIPKiS2_St6vectorIiSaIiEEEENS_17__normal_iteratorIT_T1_E15difference_typeERKS9_RKNS6_IT0_S8_EE.rel.gnu.linkonce.t._ZNKSt6vectorISt7complexIdESaIS1_EE8capacityEv.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS1_S3_EEEEPS1_jT_SB_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseISt7complexIdESaIS1_ELb1EE13_M_deallocateEPS1_j.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEENS1_IPS3_S8_EEET0_T_SD_SC_.rel.gnu.linkonce.t._ZSt8_DestroyIN9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS3_SaIS3_EEEEEvT_S9_.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS2_SaIS2_EEEplERKi.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEEPS3_ET0_T_SC_SB_.rel.gnu.linkonce.t._ZN9__gnu_cxxmiIPKSt7complexIdES4_St6vectorIS2_SaIS2_EEEENS_17__normal_iteratorIT_T1_E15difference_typeERKSB_RKNS8_IT0_SA_EE.rel.gnu.linkonce.t._ZNKSt6vectorIdSaIdEE8capacityEv.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKdS1_EEEEPdjT_S9_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIdSaIdELb1EE13_M_deallocateEPdj.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEENS1_IPdS6_EEET0_T_SB_SA_.rel.gnu.linkonce.t._ZSt8_DestroyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEEvT_S7_.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplERKi.rel.gnu.linkonce.t._ZSt4copyIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEPdET0_T_SA_S9_.rel.gnu.linkonce.t._ZN9__gnu_cxxmiIPKdS2_St6vectorIdSaIdEEEENS_17__normal_iteratorIT_T1_E15difference_typeERKS9_RKNS6_IT0_S8_EE.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIiSaIiELb1EEC2ERKS0_.gnu.linkonce.t._ZSt13__destroy_auxIPiEvT_S1_11__true_type.gnu.linkonce.t._ZNSt18_Vector_alloc_baseISt7complexIdESaIS1_ELb1EEC2ERKS2_.rel.gnu.linkonce.t._ZSt13__destroy_auxIPSt7complexIdEEvT_S3_12__false_type.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIdSaIdELb1EEC2ERKS0_.gnu.linkonce.t._ZSt13__destroy_auxIPdEvT_S1_11__true_type.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEC1ERKS1_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIiSaIiELb1EE11_M_allocateEj.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS2_SaIS2_EEEC1ERKS3_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseISt7complexIdESaIS1_ELb1EE11_M_allocateEj.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEC1ERKS1_.rel.gnu.linkonce.t._ZNSt18_Vector_alloc_baseIdSaIdELb1EE11_M_allocateEj.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC1ERKS2_.rel.gnu.linkonce.t._ZSt24__uninitialized_copy_auxIN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEPiET0_T_SA_S9_11__true_type.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS2_SaIS2_EEEC1ERKS4_.rel.gnu.linkonce.t._ZSt24__uninitialized_copy_auxIN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEEPS3_ET0_T_SC_SB_12__false_type.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEC1ERKS2_.rel.gnu.linkonce.t._ZSt24__uninitialized_copy_auxIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEPdET0_T_SA_S9_11__true_type.rel.gnu.linkonce.t._ZNSt14__simple_allocIiSt24__default_alloc_templateILb1ELi0EEE10deallocateEPij.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEENS1_IPiS6_EEET0_T_SB_SA_11__true_type.gnu.linkonce.t._ZSt13__destroy_auxIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_11__true_type.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEEPiET0_T_SA_S9_11__true_type.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEE4baseEv.rel.gnu.linkonce.t._ZNSt14__simple_allocISt7complexIdESt24__default_alloc_templateILb1ELi0EEE10deallocateEPS1_j.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEENS1_IPS3_S8_EEET0_T_SD_SC_11__true_type.rel.gnu.linkonce.t._ZSt13__destroy_auxIN9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS3_SaIS3_EEEEEvT_S9_12__false_type.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS3_SaIS3_EEEEPS3_ET0_T_SC_SB_11__true_type.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS2_SaIS2_EEE4baseEv.rel.gnu.linkonce.t._ZNSt14__simple_allocIdSt24__default_alloc_templateILb1ELi0EEE10deallocateEPdj.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEENS1_IPdS6_EEET0_T_SB_SA_11__true_type.gnu.linkonce.t._ZSt13__destroy_auxIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEEvT_S7_11__true_type.rel.gnu.linkonce.t._ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEPdET0_T_SA_S9_11__true_type.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEE4baseEv.gnu.linkonce.t._ZSt8_DestroyISt7complexIdEEvPT_.rel.gnu.linkonce.t._ZNSt14__simple_allocIiSt24__default_alloc_templateILb1ELi0EEE8allocateEj.rel.gnu.linkonce.t._ZNSt14__simple_allocISt7complexIdESt24__default_alloc_templateILb1ELi0EEE8allocateEj.rel.gnu.linkonce.t._ZNSt14__simple_allocIdSt24__default_alloc_templateILb1ELi0EEE8allocateEj.rel.gnu.linkonce.t._ZN9__gnu_cxxneIPKSt7complexIdESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS2_SaIS2_EEEppEv.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPKSt7complexIdESt6vectorIS2_SaIS2_EEEdeEv.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET0_T_SA_S9_11__true_type.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKiPiET0_T_S4_S3_12__false_type.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKSt7complexIdEN9__gnu_cxx17__normal_iteratorIPS1_St6vectorIS1_SaIS1_EEEEET0_T_SC_SB_11__true_type.rel.gnu.linkonce.t._ZN9__gnu_cxxneIPSt7complexIdESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKSt7complexIdEPS1_ET0_T_S6_S5_12__false_type.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKdN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEET0_T_SA_S9_11__true_type.rel.gnu.linkonce.t._ZSt10__copy_ni2IPKdPdET0_T_S4_S3_12__false_type.rel.gnu.linkonce.t._ZSt11__copy_aux2IiEPT_PKS0_S3_S1_11__true_type.rel.gnu.linkonce.t._ZSt11__copy_aux2IPKSt7complexIdEPS1_ET0_T_S6_S5_12__false_type.rel.gnu.linkonce.t._ZSt11__copy_aux2IdEPT_PKS0_S3_S1_11__true_type.rel.gnu.linkonce.t._ZSt14__copy_trivialIiEPT_PKS0_S3_S1_.gnu.linkonce.t._ZSt19__iterator_categoryIPKSt7complexIdEENSt15iterator_traitsIT_E17iterator_categoryERKS5_.gnu.linkonce.t._ZSt6__copyIPKSt7complexIdEPS1_ET0_T_S6_S5_St26random_access_iterator_tag.rel.gnu.linkonce.t._ZSt14__copy_trivialIdEPT_PKS0_S3_S1_.rel.gnu.linkonce.t._ZSt6strstrPcPKc.gnu.linkonce.t._ZN15nec_base_result13get_frequencyEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern11get_n_thetaEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern9get_n_phiEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern15get_theta_startEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern13get_phi_startEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern15get_delta_thetaEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern13get_delta_phiEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern7get_etaEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern15get_axial_ratioEv.gnu.linkonce.t._ZN19nec_norm_rx_pattern18get_segment_numberEv.rel.gnu.linkonce.t._ZN19nec_norm_rx_pattern8get_typeEv.rel.gnu.linkonce.t._ZN19nec_norm_rx_pattern7get_magEv.rel.gnu.linkonce.t._ZN19nec_norm_rx_pattern15get_norm_factorEv.rel.gnu.linkonce.t._ZN24nec_structure_excitation7get_tagEv.rel.gnu.linkonce.t._ZN24nec_structure_excitation11get_segmentEv.rel.gnu.linkonce.t._ZN24nec_structure_excitation11get_currentEv.rel.gnu.linkonce.t._ZN24nec_structure_excitation11get_voltageEv.rel.gnu.linkonce.t._ZN24nec_structure_excitation9get_powerEv.rel.gnu.linkonce.t._ZN17nec_antenna_input7get_tagEv.rel.gnu.linkonce.t._ZN17nec_antenna_input11get_segmentEv.rel.gnu.linkonce.t._ZN17nec_antenna_input11get_currentEv.rel.gnu.linkonce.t._ZN17nec_antenna_input11get_voltageEv.rel.gnu.linkonce.t._ZN17nec_antenna_input9get_powerEv.gnu.linkonce.t._ZN22nec_near_field_pattern8get_nfehEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern5get_xEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern5get_yEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern5get_zEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern11get_field_xEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern11get_field_yEv.rel.gnu.linkonce.t._ZN22nec_near_field_pattern11get_field_zEv.rel.gnu.linkonce.t._ZN10nec_groundC1Ev.rel.gnu.linkonce.t._ZN10nec_groundC1ERKS_.rel.gnu.linkonce.t._ZN21nec_radiation_pattern8get_gainEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern13get_gain_vertEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern14get_gain_horizEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern12get_gain_totEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern19get_pol_axial_ratioEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern12get_pol_tiltEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern19get_pol_sense_indexEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern11get_e_thetaEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern9get_e_phiEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern7get_e_rEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern24get_normalization_factorEv.gnu.linkonce.t._ZN21nec_radiation_pattern22get_average_power_gainEv.gnu.linkonce.t._ZN21nec_radiation_pattern29get_average_power_solid_angleEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern10get_groundEv.gnu.linkonce.t._ZN21nec_radiation_pattern9get_rangeEv.gnu.linkonce.t._ZN21nec_radiation_pattern14get_wavelengthEv.gnu.linkonce.t._ZN21nec_radiation_pattern15get_delta_thetaEv.gnu.linkonce.t._ZN21nec_radiation_pattern15get_theta_startEv.gnu.linkonce.t._ZN21nec_radiation_pattern13get_delta_phiEv.gnu.linkonce.t._ZN21nec_radiation_pattern13get_phi_startEv.gnu.linkonce.t._ZN21nec_radiation_pattern8get_ifarEv.gnu.linkonce.t._ZN21nec_radiation_pattern20get_rp_normalizationEv.gnu.linkonce.t._ZN21nec_radiation_pattern20get_rp_output_formatEv.gnu.linkonce.t._ZN21nec_radiation_pattern20get_rp_power_averageEv.gnu.linkonce.t._ZN21nec_radiation_pattern10get_rp_ipdEv.rel.gnu.linkonce.t._ZN21nec_radiation_pattern19get_maximum_gain_dbEv.gnu.linkonce.t._ZNK21nec_radiation_pattern10get_nthetaEv.gnu.linkonce.t._ZNK21nec_radiation_pattern8get_nphiEv.rel.gnu.linkonce.t._ZN10c_geometryD1Ev.gnu.linkonce.t._ZN22nec_structure_currents10get_iptflgEv.gnu.linkonce.t._ZN22nec_structure_currents10get_iptflqEv.gnu.linkonce.t._ZN22nec_structure_currents5get_nEv.gnu.linkonce.t._ZN22nec_structure_currents5get_mEv.rel.gnu.linkonce.t._ZN22nec_structure_currents26get_current_segment_numberEv.rel.gnu.linkonce.t._ZN22nec_structure_currents23get_current_segment_tagEv.rel.gnu.linkonce.t._ZN22nec_structure_currents28get_current_segment_center_xEv.rel.gnu.linkonce.t._ZN22nec_structure_currents28get_current_segment_center_yEv.rel.gnu.linkonce.t._ZN22nec_structure_currents28get_current_segment_center_zEv.rel.gnu.linkonce.t._ZN22nec_structure_currents26get_current_segment_lengthEv.rel.gnu.linkonce.t._ZN22nec_structure_currents17get_current_thetaEv.rel.gnu.linkonce.t._ZN22nec_structure_currents15get_current_phiEv.rel.gnu.linkonce.t._ZN22nec_structure_currents11get_currentEv.rel.gnu.linkonce.t._ZN22nec_structure_currents28get_q_density_segment_numberEv.rel.gnu.linkonce.t._ZN22nec_structure_currents25get_q_density_segment_tagEv.rel.gnu.linkonce.t._ZN22nec_structure_currents30get_q_density_segment_center_xEv.rel.gnu.linkonce.t._ZN22nec_structure_currents30get_q_density_segment_center_yEv.rel.gnu.linkonce.t._ZN22nec_structure_currents30get_q_density_segment_center_zEv.rel.gnu.linkonce.t._ZN22nec_structure_currents28get_q_density_segment_lengthEv.rel.gnu.linkonce.t._ZN22nec_structure_currents13get_q_densityEv.rel.gnu.linkonce.t._ZN22nec_structure_currents16get_patch_numberEv.rel.gnu.linkonce.t._ZN22nec_structure_currents18get_patch_center_xEv.rel.gnu.linkonce.t._ZN22nec_structure_currents18get_patch_center_yEv.rel.gnu.linkonce.t._ZN22nec_structure_currents18get_patch_center_zEv.rel.gnu.linkonce.t._ZN22nec_structure_currents25get_patch_tangent_vector1Ev.rel.gnu.linkonce.t._ZN22nec_structure_currents25get_patch_tangent_vector2Ev.rel.gnu.linkonce.t._ZN22nec_structure_currents13get_patch_e_xEv.rel.gnu.linkonce.t._ZN22nec_structure_currents13get_patch_e_yEv.rel.gnu.linkonce.t._ZN22nec_structure_currents13get_patch_e_zEv.gnu.linkonce.t._ZN11nec_context12get_geometryEv.rel.gnu.linkonce.t._ZN11nec_context20get_input_parametersEi.rel.gnu.linkonce.t._ZN11nec_context19get_norm_rx_patternEi.rel.gnu.linkonce.t._ZN11nec_context21get_radiation_patternEi.rel.gnu.linkonce.t._ZN11nec_context24get_structure_excitationEi.rel.gnu.linkonce.t._ZN11nec_context22get_near_field_patternEi.rel.gnu.linkonce.t._ZN11nec_context22get_structure_currentsEi.rel.gnu.linkonce.t._ZN10safe_arrayIdEC1ERKS0_.rel.gnu.linkonce.t._ZN10safe_arrayIiEC1ERKS0_.rel.gnu.linkonce.t._ZN10safe_arrayISt7complexIdEEC1ERKS2_.rel.gnu.linkonce.t._ZSt10_ConstructISt7complexIdES1_EvPT_RKT0_.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEE4baseEv.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS2_SaIS2_EEE4baseEv.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPSt7complexIdESt6vectorIS2_SaIS2_EEEppEv.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEE4baseEv.gnu.linkonce.t._ZnwjPv.gnu.linkonce.t._ZdlPvS_.gnu.linkonce.t._ZNSt7complexIdEC1Edd.rel.gnu.linkonce.t._ZN11nec_results19get_norm_rx_patternEl.rel.gnu.linkonce.t._ZN11nec_results21get_radiation_patternEl.rel.gnu.linkonce.t._ZN11nec_results17get_antenna_inputEl.rel.gnu.linkonce.t._ZN11nec_results24get_structure_excitationEl.rel.gnu.linkonce.t._ZN11nec_results22get_near_field_patternEl.rel.gnu.linkonce.t._ZN11nec_results22get_structure_currentsEl.rel.gnu.linkonce.t._ZN10nec_ground14default_valuesEv.rel.gnu.linkonce.t._ZN10safe_arrayIdE4copyERKS0_.rel.gnu.linkonce.t._ZN10safe_arrayIdE3maxEv.rel.gnu.linkonce.t._ZNSt6vectorIiSaIiEEC1ERKS1_.rel.gnu.linkonce.t._ZNSt6vectorISt7complexIdESaIS1_EEC1ERKS3_.rel.gnu.linkonce.t._ZNSt6vectorIdSaIdEEC1ERKS1_.rel.gnu.linkonce.t._ZN10safe_arrayIiE4copyERKS0_.rel.gnu.linkonce.t._ZN10safe_arrayISt7complexIdEE4copyERKS2_.rel.gnu.linkonce.t._Z7cplx_10v.rel.gnu.linkonce.t._ZN11nec_results10get_resultEl15nec_result_type.rel.gnu.linkonce.t._ZN10safe_arrayISt7complexIdEE6resizeEl.rel.gnu.linkonce.t._ZN10safe_arrayIdE6resizeEll.rel.gnu.linkonce.t._ZNK10safe_arrayIdEixEl.rel.gnu.linkonce.t._ZN10safe_arrayIdE6resizeEl.gnu.linkonce.t._ZNK10safe_arrayIdE5checkEl.rel.gnu.linkonce.t._ZNKSt6vectorIiSaIiEE13get_allocatorEv.rel.gnu.linkonce.t._ZNSt12_Vector_baseIiSaIiEEC2EjRKS0_.rel.gnu.linkonce.t._ZNKSt6vectorISt7complexIdESaIS1_EE13get_allocatorEv.rel.gnu.linkonce.t._ZNSt12_Vector_baseISt7complexIdESaIS1_EEC2EjRKS2_.rel.gnu.linkonce.t._ZNKSt6vectorIdSaIdEE13get_allocatorEv.rel.gnu.linkonce.t._ZNSt12_Vector_baseIdSaIdEEC2EjRKS0_.rel.gnu.linkonce.t._ZN10safe_arrayIiE6resizeEl.rel.gnu.linkonce.t._ZN10safe_arrayIiE6resizeEll.rel.gnu.linkonce.t._ZNK10safe_arrayIiEixEl.rel.gnu.linkonce.t._ZN10safe_arrayISt7complexIdEE6resizeEll.rel.gnu.linkonce.t._ZNK10safe_arrayISt7complexIdEEixEl.rel.gnu.linkonce.t._ZNSt6vectorIP15nec_base_resultSaIS1_EEixEj.rel.gnu.linkonce.t._ZNKSt18_Vector_alloc_baseIiSaIiELb1EE13get_allocatorEv.rel.gnu.linkonce.t._ZNKSt18_Vector_alloc_baseISt7complexIdESaIS1_ELb1EE13get_allocatorEv.rel.gnu.linkonce.t._ZNKSt18_Vector_alloc_baseIdSaIdELb1EE13get_allocatorEv.gnu.linkonce.t._ZNK10safe_arrayIiE5checkEl.gnu.linkonce.t._ZNK10safe_arrayISt7complexIdEE5checkEl.rel.gnu.linkonce.t._ZNSt6vectorIP15nec_base_resultSaIS1_EE5beginEv.rel.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPP15nec_base_resultSt6vectorIS2_SaIS2_EEEplERKi.gnu.linkonce.t._ZNK9__gnu_cxx17__normal_iteratorIPP15nec_base_resultSt6vectorIS2_SaIS2_EEEdeEv.gnu.linkonce.t._ZN9__gnu_cxx17__normal_iteratorIPP15nec_base_resultSt6vectorIS2_SaIS2_EEEC1ERKS3_.rel.ctors.rel.eh_frame.note.GNU-stack.comment4ä Äp<)Ŕä % 4D8 /ŕöU 8ŕö0> 4 lQ0@5B VR>+R śQ }~>š„>»Š>· ¤Q ě¤>,č ¬QĐ>>Ö>kÜ>g ĽQŞö>,¦ ÄQá"?ţ(?.? ÔQPH?,L ÜQ}t?Gy ěQŞĽ?G¦ Rĺ@Gá R!L@+ 4R#=x@+9 [ę+ ěY˙2,Z[2., ôY†,Ś[‚, ZĘ,¨[-Ć, Z-Ö[ l-ŕ[SĘ-4\-Ć- Z .b\. Z %.|\[.–\ “.˘\ Č.®\/Č\>/â\z/ü\´/]ç/0]#0J] f0V]&b0 $Zž0|]&š0 ,ZŐ0˘]Ń0 4Z1Ľ]&1 05Ś`,5 ÜZ@[5 a(W5 ôZB•5Ča(‘5 üZDŐ5đa(Ń5 [F6b(6 [HU6@b(Q6 [J›6hb(—6 [LÚ6b(Ö6 $[N 7¸b(7 ,[P^7ŕb(Z7 4[R™7c(•7 <[TŇ70c%Î7 D[V8Vc^8pc®8Šc(Ş8 L[Zç8˛c9Ěc[9ćc™9d×9d:4dO:Nd …:Zd Č:fd ;tdN;‚d‹;d‡; T[gÍ;Şd <¶d B<Âdö>< \[0kf<¸g  <Äg Ú<Đg =ŢgF=đg(B= Ś\q”=h(= ”\sß=@h(Ű= ś\u/>hh(+> ¤\w>h({> ¬\yĎ>¸h(Ë> ´\{?ŕh(? Ľ\}b?i(^? Ä\Ą?0i(ˇ? Ě\ä?Xi(ŕ? Ô\4@€i(0@ Ü\…@¨i(}@ ä\‡Ó@Đi(Ď@ ě\‰%Aři(!A ô\‹wA j(sA ü\ŤÇAHj(ĂA ]ŹBpj(B ]‘LBj(HB ]“’BŔj(ŽB ]•ŘBčj(ÔB $]—Ck(C ,]™kC8k(gC 4]›¸C`k(´C <]ťůCk(őC D]ź:D°k(6D L]ˇwDŘk¬Dćk¨D T]¤éDlĺD \]¦%E&l!E d]¨cEFl_E l]ޤEfl E t]¬ăE†lßE |]®"F¦l[F „]°QFm[MF Ś]˛€F^m[|F ”]´»Fşmo·F ś]¶÷F*nEG2nŁG:nýGHnKHPncHXn|H^n=¦Hśn˘H ¬]żâH¸nŢH ´]Á IÔnI Ľ]ĂZIđnVI Ä]Ĺ›I o—I Ě]ÇÚI(oÖI Ô]ÉJDoźJ Ü]ËOJäoŽKJ ä]ÍJrp˝}J ü]Ď®J0qÔŞJ ^XŃßJrÔŰJ l^XÓKŘrÔK Ä^XŐOK¬s‡KK _×K4tś}K 4_ŮżKĐt_»K L_@ŰßK0uŰK Ś_Ý#L˛uüL ś_(ß_L®v6[L Ä_áLäv&ŚL Ě_ăĽL w—¸L Ô_ĺčL˘wMŞw"M ě_čSMĚwOOM ô_ęŚMx"M `ěŐM>xOŃM `îNŽx"N `đWN°xOSN $`ňNy—ŚN 4`ôŔNy6ĽN L`öńNÎy&íN T`řOôy6O \`úZO*z&VO d`ü’OPzGŽO l`ţŇOzÎO „`P¸zP Ś`xPŘztP ”`ŔPřzěP{(Q{"$Q ś`lQ*{3hQ ¤` ÎQ^{ .Rh{•Rx{‘R ¬` R|{:śR ´`hŞRµşRµ4ĵĂR \@@\ `śckń˙Ź"‹1‹B¨ÍQvľf4b{–VŹěRŁ>ÓżŔÔěŇaú4É ţ†„].âś@~hTć†gl ^yĘ YŠ$ ś> ş°ř Á Ň0 ç˛ ü-.@^ŕŔ‰Č ›Ň T»& ›Î {ŕ> {ńş ¶p' -MŕŔx Š˘ §B`˝´âGШâ ĺ˘íü\ 7ěťNśâ efâ6sŠ\Šć§¤üâEĽŽ6ÖÄFď¤ H/¨lR^‚PŤ¸™P©T·°~×.Ýö .:¤6BăTЊ޲üď0 N< H´bč|–S°ĘÉ—”ž°2‘ÍÄ ědŇ \ă4, 6 ŇR !Ňz Ú!ŇĄ ¬"ŇÎ ~#Ň÷ P$ř H%h5 ă@Q °& k ľ(K… +µź Ŕ-µą v0µÓ ,3Ŕí ě3q ^5! ŕ8b; B:bU ¤;Ăo h<µ‰ ?µŁ ÔAÂÓ Đă5í –Bb řCś! äP@ ”E[Y đEo IŰ„ ŕJ€› `Mz± ÚO”Ę nQĂá 2R ř @VÉ W«% ¶W[= X›g ®XšŚ HZš¶ â[šá |]š _š:°`šcJbš“äcš»~ešágš˛h›:Ni›jęi›–†j›Â"k›ěľk›Zl=ňlbŠm›•&n›ĎÂn›ö^p›úp›G–ql.rťĆrÎ^s˙ös&Žt[Ięt›q†u—v»¶v›ĺRw› îw›7Šx›_&y›Ây›«^zŘöz¦űś|›%8}šGŇ~[h.›•ĘŮĽ¤Ůç~ŮX…Ů=2‡Ůf ‰[Śh‰›˛ŠŮŇŢ‹Ůö¸ŤŮ’ŹŮ>l‘Ů`F“[˘“›Ş>”ĐÖ”Ůó°–ŮŠŮ9dšŮb>śŮ‹žŮ´ňź[ŘN ›ę +‚ˇS˘v˛˘™JŁŮŃ$ĄŮţ¦Ů@بŮz˛ŞŮ´ڬŮěf®Ů@°ŮH˛ŮqôłŮ«εŮ⨷قąŮZ\»Ů–6˝ŮĐżŮűęŔŮ)ÄÂŮYžÄىxĆŮąRČŮđ,ĘŮ'ĚŮRŕÍŮ}şĎ٨”Ń[ĚđŃ›ţŚŇ› (ÓGŔÓ›o\Ô›—řÔ›Ŕ”Ő›â0Ö›ĚÖ›8h×[Pŕ@ \ q4 €H ‘\ ­p Ă„ Ř ů¬  Ŕ 7 Ô X č { ü ™  ´ $ á 8 !L !` $!t 3! J!ś ^!Ŕ Pp!  …!@ ”!` Ą!€ Á!  ×!Ŕ ě!ŕ  " +"  K"@ l"` Ź"€ ­"  Č"Ŕ ő"ŕ # &#  8#@ G#` ^#€ r# P„#đ•# ş#Ä×÷Đ#ř#ĽŮĹ$‚Ú#$šÚ6$ŰhK$†Űq`$$@Ŕ®$řŰ Ŕ$ÜL×$NÜ’î$ŕÜ %ß!"%    !#%'(*,-./0245678:<=>?ACEGIKMOQSUWY[]_aceghjlmoqrtvxz|~€‚„†ŠŚŽ’”–šśž ˘¤¦¨Ş¬®°˛´µ¶·ąş»ĽľżÁÂÄĹÇČĘËÍĎŃŇÔŐ×ŮŰÝŢŕâăĺćçéëíďđńóő÷ůűý˙ A%(â>q%Vä  !#%')+-/12468:<>@BDFHJLNPRTVXYZ\]^_`abcdefgijkmnopqsuwy{}…‡‰‹ŤŹ‘“•—™›ťźˇŁ¤¦¨Ş¬®°˛´¶¸ąş»Ľ˝ľżÁĂĹÇÉËÍĎŃÓŐ×ŮŰÝßáăĺçčęěîđňôöřúüţ   y%näŹ%–%ť%¤%¬%ł%ą%Í%á%ô%&& &.&:&J&X&`&e&l&s&&&ť&Ż&ľ&Ę&Ö&ä&ó&''*';'B'P'd's'„'“'©'Ľ'ň˙Ô'ň˙ě'ň˙(ň˙(ň˙0(ň˙D(ň˙Z(ň˙(ň˙¤(¸(Ă(Ô(ŕ(î(ű( ))()9)?)T)[)z)"Ł›)"¤Ä)"¦ě)"¨*"ŞC*"¬n*"®™*Ŕ*Ţ*˙*!+U+y+ť+¸+Ö+ý+,9,T,x,ś,Î,ě, -.-I-i--¦-ľ-ă-÷-ö"k ." 1.D."'o.("B•.Ş"*Ä.+" Ű. ",/ "-!/// ".M/2"(x/("D¤/("FŃ/("Hü/("J.0("LY0"/„0("N¶0Ş"2ĺ0+"#ü0 "4'1 "5B1 "6`12"0‹1"7Â1("Pě1Ş":'2+"%J2 "<2 "=¨2 ">Ň22"8 3("R03("TU3%"VŚ3"gľ3"^ě3"_4"`F4"ar4 "iś4«4 "jŇ4"X5"YC5d">W5("Z€5"@—5"\ľ5"]ë5 "b6 "cD6"dw6"eŞ6"fÓ6 "ű6 " 7"L7"v7"˘7"Ě7"ď7"8 "J8T8&"x8…8Ź8ś8"Č8&"ë8" ř8" 9" "9&"J9$"?g9,"€9G"™9<"A¶9&"ă9"ü9"':"@:&"!m:$"C:,"ż:G"ć:<"E;&"#>;"K;"h;"u;&"%ź;$"GĽ;,"Ő;G"!î;<"I <&"',<&")R<&"+x<&"-ž<&"/Á< "1č<&"2 =&"40=&"6T=&"8=&":Ş=&"<Ő= "m˙= "n)> "oM>"pq>("q«>("sâ>("u?("wZ?("y–?("{Đ?("}@("0@("[@("—@("…Đ@("‡A("‰LA("‹ŠA("ŤĆA("ŹóA("‘#B("“UB("•‡B("—ąB("™ňB("›+C("ťXC("ź…C("ˇ˛CşCĘCÚCďC" D"á DD2DGDVDjD|DD"K§D"OżD,"MßD"QE"U5E,"ScE"W‡E"[źE,"YżE""cÜE3"eF "gTF""hF3"jĚF "lG""m4G3"oqG "q¬G["°ÇG["˛âG["´ HF"„*H,"tFH+"rdH„"†ÁH"úH1"ŠRI&"]mI!"Ś·I3"ŽöI!"DJ!"vˇJ3"’KF"”=K,"zgK+"x“K„"–L"KL1"šµL&"_ŢL!"ś8M3"ž†M!" ćM!"|UN3"˘ŇNF"¤óN,"€O+"~-O„"¦ŠO"¨ĂO1"ŞP&"a6P!"¬€P3"®ľP!"° Q!"‚iQ3"˛ÖQ""´R"µ/R""¶kR'"·ŁR""ąŃR"şüR"»:S"ľS"ÁĆS"ÄT"ĹuT"ÇÄT«"ČGU"ʆU"ËöU"Ľ+V=VKV[V#"ÍŞVK"ĎW"ŃsW8"ŇŐW"ÔX"żWX#"Ő´XK"×2YK"Ů Y8"ŰZ"ÝcZ"ÂZ#"ŢçZK"ŕS["â°[8"ă\"ĺQ\"ćr\-"çĽ\-"é]-"ë\]6"í·] "đ^o"¶/^"ďz^´^K"ń_"óG_K"ő»_6"÷`"ş_`"ůž`K"űa"ý1afa"¸¤a"˙Ôa"ą"b2"bb"» b"Đb-"öb "RcS"śc-" ÂcĘcâcďcüc˝"ĎdÔ"Ń2dÔ"Ó]dÔ"Őzd="ľdź"˲dîd"Ăe"żqv|pqŽ”p™q©tÚuňr vs'/qBsKSqšt¦·wxOZ_cgv~ytzy{•vą|ŐÝ}q«v>vu˘t®´pąqÓxÚxx).~eꀤ¬{Ůxŕx"'/4t=vCLejo‚‚ź§„Ń׎Üq Žq:ŹDŹO‘‰‘”¨’łtŮvó“"“-cŹmŹx¨‘˛‘˝Ń”Ütv"C€azµvĆířýV\~v•’•ťăŰă—ü™:šN–_šm·ż—ĐxxU]—n››¤x«xçď—-ś>Ź——«˙ť a i —} Ń žâ 3!;!—O!Ł!ź´!" "—!"u" †"×"ß"—ó"G#ˇX#©#±#—Ĺ#$˘*$‰$‘$—Ą$ %Ł)%x0%x—%ź%—ł%&¤‘&x&x '('—<'•(Ąž(xĄ(x9)A)—U)á*¦ę*xń*x›+Ł+—·+—-§ -x§-xQ.Y.—m.M0¨V0x]0x11—#13© 3x3xW3_3—p3Ä3ŞÍ3xÔ3x;4C4—W455«>5xE5x(606—D6®8¬·8xľ8x/979—K9:­#:x*:x‘:™:—­:|;®…;xŚ;xĎ;×;—č;?<ŻH<xO<xů<=—=ő>°ţ>x?xŻ?·?—Ë?«A±´Ax»Ax˙AB—BnB˛wBx~BxĺBíB—CĐCłŮCxŕCxVD^D—rDlE´uEx|Ex˘EŞE—ĆEŰEŕE~›FŁF—·FÓHµÜHxăHxiIqI—…I·J¶ŔJxÇJxcKkK—K8M·AMxHMxăMëM—˙M˛O¸»OxÂOx1P9P—MPFQąOQxVQx™QˇQ—˛Q RşRxRx4Sb–gbÎ}b…b—™bÍbĎÝbĐôbŃ cŃ!cŇ*cÓ6c>cPcUcĆpcŇycÔ•cŐ©cŐÇcŐŘc–dÖdd—3dgd×wdŘŽdŮĄdŮ»dÚÄdŰĐdŘdędďdĆ eÚeÜ/eÝCeÝaeÝre–›eÖ±eąe—ÍefŢfŘ(fŮ?fŮUfÚ^fŰjfrf„f‰fƤfÚ­fÜÉfÝÝfÝűfÝ g–5gÖKgSg—gg›gß«gŘÂgŮŮgŮďgÚřgŰh hh#hĆ>hÚGhÜchÝwhÝ•hݦh–ŐhÝh—îhiŕ/iżqiyi—Ši·iáËiż jj—&jSjâgjż©j±j—ÂjďjăkżEkMk—^k‹käźkżákék—úk'lĺ;lż}l…l—–lĂlćÔlçmm—.m[mčlmç­mµm—ĆmóménżInQn—bnŹnęŁnżćnëo o—oXoě~oŁoíäošp–pš&pp‰p—špÇpîŰpżq%q—6qcqďwqżąqÁq—Ňq˙qđrçQrYr—jr—rń¨rçérńr—s/sň@sçs‰s—šsÇsóŘsçt!t—2t_tôptçśt¤t—ŔtŐtÚt~ uu—&uSuľguż©u±u—ÂuďuővçAvIv—Zv‡vövçŮváv—ňvw÷3wżuw}w—Žw»wřĎwżxx—*xWxůkxż­xµx—ĆxóxúyżIyQy—byŹyűŁyżĺyíy—ţy+zü?zżz‰z—šzÇzýŘzç{ţ){1{—E{y{˙‰{ {·{Ä{Ý{|š"|š0|M|a|||–ż|Ç|—Ř|}}żU}Ŕk}s}—‡}»}Ë}Ââ}Ăů}Ă~Ä~Ĺ$~,~>~C~Ć^~Äg~Ç~Č—~ȵ~ČĆ~–ŕ~č~—~QY—j—ľ«żęú€"€–.€D€L€—`€”€¤€ »€ Ň€ 〠ü€ "'ĆT h † —–ÄÔëü–‚‚&‚—:‚n‚ ~‚ •‚ ¬‚ ˝‚ Ö‚ â‚ę‚ü‚Ć. B ` q–ž®ĹÖ–âř„—„H„X„o„†„—„°„Ľ„Ąքۄƅ…:…K…–x……ź…°…–Ľ…Ň…Ú…—î…"†2†I†`†q†І–†ž†°†µ†Ćâ†ö†‡%‡–R‡b‡y‡Ї––‡¬‡´‡—ȇü‡ #:KdpxŠŹĆĽĐî˙–‰"‰—>‰S‰X‰~‹‰“‰—¤‰щľĺ‰ż$Š4ŠKŠ\Š–hŠ~ІЗšŠΊŢŠ őŠ  ‹ ‹ 6‹ B‹J‹\‹a‹ĆŽ‹ ˘‹ Ŕ‹ Ń‹–ţ‹Ś%Ś6Ś–BŚXŚ`Ś—tŚ¨Ś ¸Ś ĎŚ ćŚ ÷Ś Ť Ť$Ť6Ť;ŤĆhŤ |Ť šŤ «Ť–ŘŤčŤ˙ŤŽ–Ž2Ž:Ž—NŽ‚Ž!’Ž©ŽŔŽŃŽęŽöŽţŽŹŹĆBŹVŹtŹ…Ź–˛ŹÂŹŮŹęŹ–öŹ —(\"lš«ÄĐŘęďĆ‘0‘N‘_‘–Ś‘ś‘ł‘Ä‘–Đ‘ć‘î‘—’6’#F’]’t’…’ž’Ş’˛’Ä’É’Ćö’ “(“9“–T“\“—x“Ť“’“~œ͓—Ţ“ ”ľ”ża”i”—z”§”$¸”çö”••.•–:•P•X•—l• •%°•Ǖޕ––.–3–Ć`–t–’–Ł––Đ–ŕ–÷–—–—*—2——F—z—&Š—ˇ—¸—É—â—î—ö— Ć:Nl}–ŞşŃâ–î™ ™— ™T™'d™{™’™Ł™Ľ™Č™Đ™â™ç™Ćš(šFšWš–„š”š«šĽš–Țޚ暗úš.›(>›U›l›}›–›˘›Ş›Ľ›Á›Ć ś1ś–^śnś…ś–ś–˘ś¸śŔś—Ôśť)ť/ťFťWťpť|ť„ť–ť›ťĆȝܝúť ž–8žHž_žpž–|ž’žšž—®žâž*ňž ź ź1źJźVź^źpźuźĆ˘ź¶źÔźĺź–  —$ 9 > ~q y —Š · ľË ż ˇˇ—&ˇSˇ+dˇçĄˇ­ˇ—ľˇëˇ,üˇç=˘E˘—V˘˘-”˘çŐ˘ݢ—.,ŁçjŁzŁ‘Ł˘Ł–®ŁÄŁĚŁ—ŕŁ¤/$¤ ;¤ R¤ c¤ |¤ ¤¤˘¤§¤ĆÔ¤ č¤ Ą Ą–DĄTĄkĄ|Ą–ĄžĄ¦Ą—şĄîĄ0ţĄ ¦ ,¦ =¦ V¦ b¦j¦|¦¦Ć®¦ ¦ ঠń¦–§.§E§V§–b§x§€§—”§ȧ1ا裡¨0¨<¨D¨V¨[¨Ć¨ś¨ş¨˨–ř¨©©0©–<©R©Z©—n©˘©2˛©É©ŕ©ń© ŞŞŞ0Ş5ŞĆbŞvŞ”ŞĄŞ–ŇŞâŞůŞ «–«,«4«—H«|«3ګ٫ş«Ë«ä«đ«ř« ¬¬Ć<¬P¬n¬¬–¬¬Ľ¬Ó¬ä¬–𬭭—"­V­4f­}­”­Ą­ľ­Ę­Ň­ä­é­Ć®*®H®Y®–†®–®­®ľ®–Ę®ŕ®č®—ü®0Ż5@ŻWŻnŻŻŻ¤Ż¬ŻľŻĂŻĆđݰ"°3°–`°p°‡°°–¤°ş°°—Ö° ±6±1±H±Y±r±~±†±±ť±Ćʱޱü± ˛–:˛J˛a˛r˛–~˛”˛ś˛—°˛ä˛7ô˛ ł"ł3łLłXł`łrłwłĆ¤ł¸łÖłçł–´$´;´L´–X´n´v´—Š´ľ´8δ ĺ´ ü´  µ &µ 2µ:µLµQµĆ~µ ’µ °µ Áµ–îµţµ¶&¶–2¶H¶P¶—d¶¶9¨¶ ż¶ Ö¶ ç¶ ·  ··&·+·ĆX· l· Š· ›·–Č·Ř·ď·¸– ¸"¸*¸—>¸r¸:‚¸™¸°¸Á¸Ú¸ć¸î¸ąąĆ2ąFądąuą–˘ą˛ąÉąÚą–ćąüąş—şLş;\şsşŠş›ş´şŔşČşÚşßşĆ » »>»O»–|»Ś»Ł»´»–Ŕ»Ö»Ţ»—ň»&Ľ<6ĽMĽdĽuĽŽĽšĽ˘Ľ´ĽąĽĆćĽúĽ˝)˝–V˝f˝}˝Ž˝–š˝°˝¸˝—Ě˝ľ=ľ'ľ>ľOľhľtľ|ľŽľ“ľĆŔľÔľňľż–0ż@żWżhż–tżŠż’ż—¦żÚż>ężŔŔ)ŔBŔNŔVŔhŔmŔĆšŔ®ŔĚŔÝŔ– ÁÁ1ÁBÁ–NÁdÁlÁ—€Á´Á?ÄÁ ŰÁ ňÁ   (Â0ÂBÂGÂĆt  ¦Â ·Â–äÂô ĂĂ–(Ă>ĂFĂ—ZĂŽĂ@žĂµĂĚĂÝĂöĂÄ ÄÄ!ÄĆNÄbĀđĖľÄÎÄĺÄöÄ–ĹĹ Ĺ—4ĹhĹAxŏŦŷĹĐĹÜĹäĹöĹűĹĆ(Ć<ĆZĆkƖƨƿĆĐĆ–ÜĆňĆúĆ—ÇBÇBRÇiǀǑǪǶǾÇĐÇŐÇĆČČ4ČEČ–rȂșȪȖ¶ČĚČÔČ—čČÉC,ÉCÉZÉkÉ„ÉÉÉŞÉŻÉĆÜÉđÉĘĘ–LĘ\ĘsʄʖʦʮʗÂĘöĘDËË4ËEË^ËjËr˄ˉËƶËĘËčËůË–&Ě6ĚMĚ^Ě–jĚ€ĚĚ—śĚĐĚEŕĚ÷ĚÍÍ8ÍDÍLÍ^ÍcÍĆͤÍÂÍÓÍ–ÎÎ'Î8ΖDÎZÎbΗvÎŞÎFşÎŃÎčÎůÎĎĎ&Ď8Ď=ĎĆjĎ~ϜϭϖÚĎęĎĐĐ–Đ4Đ<Đ—PĐ„ĐG”Đ«ĐÂĐÓĐěĐřĐŃŃŃĆDŃXŃvчі˘ŃŞŃ—ĆŃŰŃŕŃ~ŇŇ—,ŇmŇżŻŇ·Ň—ČŇ ÓżKÓSÓ—dÓ˘ÓçăÓëÓ—üÓ=ÔżÔ‡Ô—ÔŮÔżŐ#Ő—4ŐuŐż·ŐżŐ—ĐŐÖżSÖ[Ö—lÖ­ÖżďÖ÷Ö—×I׿v×~×—š×Ż×´×~Ě×Ú×ä×č×î×ň× ŘŘŘ!Ř)ŘAŘUŘYŘmŘwŘ}؝ظŘŇŘçŘŮ ŮŮ"ŮCŮĄŮÄŮŇŮćŮüŮÚSÚŚÚ‘Úc¤Ú¬ÚHÍÚŐÚHéÚńÚHŰŰHAŰ]hŰnŰIsŰJ©Ű]ŮŰßŰIäŰJüŰ&Üj/ÜkaÜnxÜ\ŤÜn­Ü_GÝiÝçÝżŢÝcďÝxöÝxĚŢKCßKßL®ß\×ßlOŕ\jŕnĂŕ_Řŕŕŕ_*á7á<áAáFáKádáiáná‚áNšá­á˛áOÉáN×áßáPőáQâR âââSâqAâFâĎQâĐXâ]âŃŮâáâ],ăo„ă`¸ă`řă`3äv>ä`äeä䌔äiěřü $8äiěřü $8¸ŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô $04@DPT`dpt€„” ¤°´ŔÄĐÔŕäđô     $ 0 4 @ D P T ` d p t € „  ”   ¤ ° ´ Ŕ Ä Đ Ô ŕ ä đ ô      $ 0 4 @ D P T ` d p t € „  ”   ¤ ° ´ Ŕ Ä Đ Ô ŕ ä đ ô      $ 0 4 @ D P T ` d p t € „  ”   ¤ ° ´ Ŕ Ä Đ Ô ŕ ä đ ô    $ 4 8 H L \ ` p t „   ś ¬ ° Ŕ Ä Ô Ř č ě ü    $ ( 8 < L P ` d t x  Ś ś   Ŕ Ä Č Ě Đ Ô Ř Ü ŕ ä č ě đ ô ř ü   @`€ Ŕŕ @`€ Ŕŕ @`€ ¤¨¬°´¸ĽŔÄČĚĐÔŘÜŕäčěDiL\`dl´=¸=Ľ=Ŕ=Ä=Č="TUV#WXY#Z[\#]"^/_;`"a/b;c"d/e;f"T"TĂ)šĂ)š6NgyšŤ–žšŃ)šŃ)š6NhyšŤ–žšŮ)šŮ)š6NiyšŤ–žš +jFk[llm…V©nŐ ď^kl"o4pCqd zl‡rśl§sżkÖ ělůrtl'k3u+vFw[xly…Y©zŐďawx"{4|C}dzx‡~śx§żwÖěxů~€x'w3+‚F[„l……\©†Őďd„"‡4C‰dz„‡Šś„§‹żÖě„ůŠŚ„'3ŤŽ#nŹ#z‘’#†“”•–”#”•#•–#–——™™š››śl1—=uť*tCžWn_źj x–ˇ!˘Ł#—¤ĄĄx1™=¦*€CžWz_źj x–§!¨©#™Ş««„1›=Ť¬*ŚCžW†_źj x–­!®Ż#›°±±˛ ł ´ µs¶1·=¸Ląmž~Y†ź‘ ź–‹şĄ0Ą;»Ą%Ą/Ľş«0«;˝ľ(c1˛@ż«%«/Ŕş±0±;Á±%±/ÂĂĂĂ««Ä(Ĺ;”ĹĆ(Ç;•ĆĆÇČ(É;–ÉĘË)ĚÍÎÎ}gŇÓÓÔÔŐÓÓÔÔŐŐŐŐÔÔÔÖ3ÖMÖ[×Ö3ÖMÖgggggghiiiŘíŘĂ'Ă;ĂOĂcĂwËßóĂÇĂŰĂďĂŃŃ+Ń?ĂSĂgĂ{ĂŹĂŁĂ·ĂËĂßĂóĂĂĂ/ĂCĂWĂkĂÓå÷ĂÉĂŰĂíŃÓÓŐŐŐŐŐŐÔÓÓŐŐŐŐÔÓŐŐŐÔÔÔÔÔŮÚŰÜÝŢRßRŕRáâcăĺĺĺĺĺĺćç9čméęRęęë' 3ěJ[–g~k“lžtşWË–í'3îJ[–g~w“xž€şZË–ď'3đJ[–g~“„žŚş]Ë–ń9ňmóô9őkö‡÷#Ö,‡2÷8÷E÷K÷.ř`ř+ů\Ö‡T»oŐT-çę"ůYosTúŽ%ťű%¦ü’%¬"ůYosT-ńý-ôţ"˙/;#$Dd„¤Äě ,LtĽÜ,Xx¬Ř$DhڬÔü$LUUlڬĚě ,LlڰŘ0\´Ôü(PxÄđ8`€¬Ř 0 X x ¤ ­ UÄ ä  $ - U\ e U” ť UĚ Ő U  U< E Ut } U¬ µ Uä í U % UT t ” ´ Ô ô  4 T t ” ť UĽ Ü ü <\|śĽÜü<\|śĽÜüU(HQU€ ŔÉUđůU )UPYU€‰U°ĐđůU )UPYU€‰U°ąUŕ @IUpyU ©UĐŮU U09U`€ Ŕŕ )UPYU€‰U°ąUŕéUU@IUpyU ©UĐŮU U09U`iU™UŔÉUđůU )UPYU€‰U°ąUŕéUU@IUpyU ©UĐđ0Pp°Đđ0TxŔŕ,Px+,¸/Ř0ř3485d67Ľ<ĹUÜBĺUüHULtMśNôOPtQśRĽSÜTüU V< W\ X| Yś ZĽ [ŕ \!](!^L!_p!a”!b¸!dÜ!e"g$"hH"ih"jŚ"k°"lĐ"mô"n#o8#p`#qi#UŚ#r¬#sĐ#tđ#u$v4$wX$x€$y‰$U¬$zĚ${đ$|%}4%~T%x%€ %©%UĚ%‚ě%&„0&…T&†t&‡&‹¸&ŹŘ&‘ř&“'•8'—A'Uh'™'š¨'›Ô'ťü'ź( H(ˇp(˘(¤¸(Ąä(§ )Ş,)«L)¬l)°”)±´)˛Ü)ł*´ *µH*¶h*·*¸¨*ąČ*č*+Ë,+ĚP+Íp+Δ+ϸ+ĐÜ+Ń,Ň$,ÓH,Ôl,Ő,Ö´,×Ř,Ůü,Ú -ŰD-Üh-ÝŚ-ް-ßÔ-ŕô-á.â<.ă`.ä„.ĺ¨.ćĚ.çđ.č/é8/ę\/ë|/î /úŔ/ä/0,0P0t00Ľ0 ŕ0 1 (1 L1 p1”1¸1Ü12$2H2l22´2Ř2ü2 3D3d3„3¤3Ä3 ä3!4$4D4d4„4¬4"Đ4#ô4$585-X5.x5/50¸51Ř52ř5364D65h66q6Uś67Ą6UĐ68Ů6U79,7:T7<x7=¤7>Ä7?č7@8B,8CP8Dt8E8FĽ8Gŕ8H9I 9JD9Kd9L9M´9SŘ9Tü9necpp-1.5.0+cvs20101003/Python/swig_output/CVS/0000755000175000017500000000000011452152142017204 5ustar numanumanecpp-1.5.0+cvs20101003/Python/swig_output/CVS/Root0000644000175000017500000000007011452152141020046 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/swig_output/CVS/Repository0000644000175000017500000000003111452152141021277 0ustar numanumanecpp/Python/swig_output necpp-1.5.0+cvs20101003/Python/swig_output/CVS/Entries0000644000175000017500000000013611452152142020540 0ustar numanuma/PyNEC_wrap.cxx/1.5/Mon Oct 10 09:33:57 2005// /PyNEC_wrap.o/1.5/Mon Oct 10 09:33:57 2005// D necpp-1.5.0+cvs20101003/Python/headers_files/0000755000175000017500000000000011452152141016754 5ustar numanumanecpp-1.5.0+cvs20101003/Python/headers_files/CVS/0000755000175000017500000000000011452152141017407 5ustar numanumanecpp-1.5.0+cvs20101003/Python/headers_files/CVS/Root0000644000175000017500000000007011452152141020252 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/headers_files/CVS/Repository0000644000175000017500000000003311452152141021505 0ustar numanumanecpp/Python/headers_files necpp-1.5.0+cvs20101003/Python/headers_files/CVS/Entries0000644000175000017500000000000211452152141020733 0ustar numanumaD necpp-1.5.0+cvs20101003/Python/CVS/0000755000175000017500000000000011452152141014612 5ustar numanumanecpp-1.5.0+cvs20101003/Python/CVS/Entries.Log0000644000175000017500000000022211452152143016664 0ustar numanumaA D/PyNEC//// A D/headers_files//// A D/interface_files//// A D/python_module//// A D/swig_output//// A D/test_nec_files//// A D/test_scripts//// necpp-1.5.0+cvs20101003/Python/CVS/Root0000644000175000017500000000007011452152141015455 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Python/CVS/Repository0000644000175000017500000000001511452152141016710 0ustar numanumanecpp/Python necpp-1.5.0+cvs20101003/Python/CVS/Entries0000644000175000017500000000005111452152141016142 0ustar numanuma/README/1.3/Wed Oct 5 15:31:29 2005// D necpp-1.5.0+cvs20101003/Makefile.am0000644000175000017500000000055410310210751014730 0ustar numanuma# not a GNU package. You can remove this line, if # have all needed files, that a GNU package needs AUTOMAKE_OPTIONS = foreign 1.4 SUBDIRS = src EXTRA_DIST = \ example \ html \ test_data \ win32 \ Makefile.test dist-hook: rm -rf `find $(distdir) -name CVS` rm -rf `find $(distdir)/test_data -name *.out*` rm -rf `find $(distdir)/test_data -name *.diff*` necpp-1.5.0+cvs20101003/c_src/0000755000175000017500000000000011452152150013767 5ustar numanumanecpp-1.5.0+cvs20101003/c_src/somnec.c0000644000175000017500000005256610310210756015434 0ustar numanuma/* last change: pgm 8 nov 2000 1:04 pm */ /* program somnec(input,output,tape21) */ /* program to generate nec interpolation grids for fields due to */ /* ground. field components are computed by numerical evaluation */ /* of modified sommerfeld integrals. */ /* somnec2d is a long double precision version of somnec for use with */ /* nec2d. an alternate version (somnec2sd) is also provided in which */ /* computation is in single precision but the output file is written */ /* in long double precision for use with nec2d. somnec2sd runs about twic */ /* as fast as the full long double precision somnec2d. the difference */ /* between nec2d results using a for021 file from this code rather */ /* than from somnec2sd was insignficant in the cases tested. */ /* changes made by j bergervoet, 31-5-95: */ /* parameter 0. --> 0.d0 in calling of routine test */ /* status of output files set to 'unknown' */ #include "nec2c.h" /* common /evlcom/ */ static int jh; static long double ck2, ck2sq, tkmag, tsmag, ck1r, zph, rho; static complex long double ct1, ct2, ct3, ck1, ck1sq, cksm; /* common /cntour/ */ static complex long double a, b; /*common /ggrid/ */ int nxa[3] = {11,17,9}, nya[3] = {10,5,8}; long double dxa[3] = {.02,.05,.1}, dya[3] = {.1745329252,.0872664626,.1745329252}; long double xsa[3] = {0.,.2,.2}, ysa[3] = {0.,0.,.3490658504}; complex long double epscf, *ar1, *ar2, *ar3; /*-----------------------------------------------------------------------*/ /* This is the "main" of somnec */ void somnec( long double epr, long double sig, long double fmhz ) { int k, nth, ith, irs, ir, nr; long double tim, wlam, tst, dr, dth, r, rk, thet, tfac1, tfac2; complex long double erv, ezv, erh, eph, cl1, cl2, con; if(sig >= 0.) { wlam=CVEL/fmhz; epscf=cmplx(epr,-sig*wlam*59.96); } else epscf=cmplx(epr,sig); secnds(&tst); ck2=TP; ck2sq=ck2*ck2; /* sommerfeld integral evaluation uses exp(-jwt), nec uses exp(+jwt), */ /* hence need conjg(epscf). conjugate of fields occurs in subroutine */ /* evlua. */ ck1sq=ck2sq*conj(epscf); ck1=csqrtl(ck1sq); ck1r=creal(ck1); tkmag=100.*cabs(ck1); tsmag=100.*ck1*conj(ck1); cksm=ck2sq/(ck1sq+ck2sq); ct1=.5*(ck1sq-ck2sq); erv=ck1sq*ck1sq; ezv=ck2sq*ck2sq; ct2=.125*(erv-ezv); erv *= ck1sq; ezv *= ck2sq; ct3=.0625*(erv-ezv); /* loop over 3 grid regions */ for( k = 0; k < 3; k++ ) { nr=nxa[k]; nth=nya[k]; dr=dxa[k]; dth=dya[k]; r=xsa[k]-dr; irs=1; if(k == 0) { r=xsa[k]; irs=2; } /* loop over r. (r=sqrtl(rho**2 + (z+h)**2)) */ for( ir = irs-1; ir < nr; ir++ ) { r += dr; thet = ysa[k]-dth; /* loop over theta. (theta=atan((z+h)/rho)) */ for( ith = 0; ith < nth; ith++ ) { thet += dth; rho=r*cosl(thet); zph=r*sinl(thet); if(rho < 1.e-7) rho=1.e-8; if(zph < 1.e-7) zph=0.; evlua( &erv, &ezv, &erh, &eph ); rk=ck2*r; con=-CONST1*r/cmplx(cosl(rk),-sinl(rk)); switch( k ) { case 0: ar1[ir+ith*11+ 0]=erv*con; ar1[ir+ith*11+110]=ezv*con; ar1[ir+ith*11+220]=erh*con; ar1[ir+ith*11+330]=eph*con; break; case 1: ar2[ir+ith*17+ 0]=erv*con; ar2[ir+ith*17+ 85]=ezv*con; ar2[ir+ith*17+170]=erh*con; ar2[ir+ith*17+255]=eph*con; break; case 2: ar3[ir+ith*9+ 0]=erv*con; ar3[ir+ith*9+ 72]=ezv*con; ar3[ir+ith*9+144]=erh*con; ar3[ir+ith*9+216]=eph*con; } /* switch( k ) */ } /* for( ith = 0; ith < nth; ith++ ) */ } /* for( ir = irs-1; ir < nr; ir++; ) */ } /* for( k = 0; k < 3; k++; ) */ /* fill grid 1 for r equal to zero. */ cl2=-CONST4*(epscf-1.)/(epscf+1.); cl1=cl2/(epscf+1.); ezv=epscf*cl1; thet=-dth; nth=nya[0]; for( ith = 0; ith < nth; ith++ ) { thet += dth; if( (ith+1) != nth ) { tfac2=cosl(thet); tfac1=(1.-sinl(thet))/tfac2; tfac2=tfac1/tfac2; erv=epscf*cl1*tfac1; erh=cl1*(tfac2-1.)+cl2; eph=cl1*tfac2-cl2; } else { erv=0.; erh=cl2-.5*cl1; eph=-erh; } ar1[0+ith*11+ 0]=erv; ar1[0+ith*11+110]=ezv; ar1[0+ith*11+220]=erh; ar1[0+ith*11+330]=eph; } secnds(&tim); tim -= tst; return; } /*-----------------------------------------------------------------------*/ /* bessel evaluates the zero-order bessel function */ /* and its derivative for complex argument z. */ void bessel( complex long double z, complex long double *j0, complex long double *j0p ) { int k, i, ib, iz, miz; static int m[101], init = FALSE; static long double a1[25], a2[25]; long double tst, zms; complex long double p0z, p1z, q0z, q1z, zi, zi2, zk, cz, sz, j0x, j0px; /* initialization of constants */ if( ! init ) { for( k = 1; k <= 25; k++ ) { i = k-1; a1[i]=-.25/(k*k); a2[i]=1.0/(k+1.0); } for( i = 1; i <= 101; i++ ) { tst=1.0; for( k = 0; k < 24; k++ ) { init = k; tst *= -i*a1[k]; if( tst < 1.0e-6 ) break; } m[i-1] = init+1; } /* for( i = 1; i<= 101; i++ ) */ init = TRUE; } /* if(init == 0) */ zms=z*conj(z); if(zms <= 1.e-12) { *j0=CPLX_10; *j0p=-.5*z; return; } ib=0; if(zms <= 37.21) { if(zms > 36.) ib=1; /* series expansion */ iz=zms; miz=m[iz]; *j0=CPLX_10; *j0p=*j0; zk=*j0; zi=z*z; for( k = 0; k < miz; k++ ) { zk *= a1[k]*zi; *j0 += zk; *j0p += a2[k]*zk; } *j0p *= -.5*z; if(ib == 0) return; j0x=*j0; j0px=*j0p; } /* asymptotic expansion */ zi=1./z; zi2=zi*zi; p0z=1.+(P20*zi2-P10)*zi2; p1z=1.+(P11-P21*zi2)*zi2; q0z=(Q20*zi2-Q10)*zi; q1z=(Q11-Q21*zi2)*zi; zk=cexp(CPLX_01*(z-POF)); zi2=1./zk; cz=.5*(zk+zi2); sz=CPLX_01*.5*(zi2-zk); zk=C3*csqrtl(zi); *j0=zk*(p0z*cz-q0z*sz); *j0p=-zk*(p1z*sz+q1z*cz); if(ib == 0) return; zms=cosl((sqrtl(zms)-6.)*PI10); *j0=.5*(j0x*(1.+zms)+ *j0*(1.-zms)); *j0p=.5*(j0px*(1.+zms)+ *j0p*(1.-zms)); return; } /*-----------------------------------------------------------------------*/ /* evlua controls the integration contour in the complex */ /* lambda plane for evaluation of the sommerfeld integrals */ void evlua( complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *eph ) { int i, jump; static long double del, slope, rmis; static complex long double cp1, cp2, cp3, bk, delta, delta2, sum[6], ans[6]; del=zph; if( rho > del ) del=rho; if(zph >= 2.*rho) { /* bessel function form of sommerfeld integrals */ jh=0; a=CPLX_00; del=1./del; if( del > tkmag) { b=cmplx(.1*tkmag,-.1*tkmag); rom1(6,sum,2); a=b; b=cmplx(del,-del); rom1 (6,ans,2); for( i = 0; i < 6; i++ ) sum[i] += ans[i]; } else { b=cmplx(del,-del); rom1(6,sum,2); } delta=PTP*del; gshank(b,delta,ans,6,sum,0,b,b); ans[5] *= ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(ck1sq*ans[2]); *ezv=conj(ck1sq*(ans[1]+ck2sq*ans[4])); *erh=conj(ck2sq*(ans[0]+ans[5])); *eph=-conj(ck2sq*(ans[3]+ans[5])); return; } /* if(zph >= 2.*rho) */ /* hankel function form of sommerfeld integrals */ jh=1; cp1=cmplx(0.0,.4*ck2); cp2=cmplx(.6*ck2,-.2*ck2); cp3=cmplx(1.02*ck2,-.2*ck2); a=cp1; b=cp2; rom1(6,sum,2); a=cp2; b=cp3; rom1(6,ans,2); for( i = 0; i < 6; i++ ) sum[i]=-(sum[i]+ans[i]); /* path from imaginary axis to -infinity */ if(zph > .001*rho) slope=rho/zph; else slope=1000.; del=PTP/del; delta=cmplx(-1.0,slope)*del/sqrtl(1.+slope*slope); delta2=-conj(delta); gshank(cp1,delta,ans,6,sum,0,bk,bk); rmis=rho*(creal(ck1)-ck2); jump = FALSE; if( (rmis >= 2.*ck2) && (rho >= 1.e-10) ) { if(zph >= 1.e-10) { bk=cmplx(-zph,rho)*(ck1-cp3); rmis=-creal(bk)/fabsl(cimag(bk)); if(rmis > 4.*rho/zph) jump = TRUE; } if( ! jump ) { /* integrate up between branch cuts, then to + infinity */ cp1=ck1-(.1+.2fj); cp2=cp1+.2; bk=cmplx(0.,del); gshank(cp1,bk,sum,6,ans,0,bk,bk); a=cp1; b=cp2; rom1(6,ans,1); for( i = 0; i < 6; i++ ) ans[i] -= sum[i]; gshank(cp3,bk,sum,6,ans,0,bk,bk); gshank(cp2,delta2,ans,6,sum,0,bk,bk); } jump = TRUE; } /* if( (rmis >= 2.*ck2) || (rho >= 1.e-10) ) */ else jump = FALSE; if( ! jump ) { /* integrate below branch points, then to + infinity */ for( i = 0; i < 6; i++ ) sum[i]=-ans[i]; rmis=creal(ck1)*1.01; if( (ck2+1.) > rmis ) rmis=ck2+1.; bk=cmplx(rmis,.99*cimag(ck1)); delta=bk-cp3; delta *= del/cabs(delta); gshank(cp3,delta,ans,6,sum,1,bk,delta2); } /* if( ! jump ) */ ans[5] *= ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(ck1sq*ans[2]); *ezv=conj(ck1sq*(ans[1]+ck2sq*ans[4])); *erh=conj(ck2sq*(ans[0]+ans[5])); *eph=-conj(ck2sq*(ans[3]+ans[5])); return; } /*-----------------------------------------------------------------------*/ /* fbar is sommerfeld attenuation function for numerical distance p */ complex long double fbar( complex long double p ) { int i, minus; long double tms, sms; complex long double z, zs, sum, pow, term, fbar; z= CPLX_01* csqrtl( p); if( cabs( z) <= 3.) { /* series expansion */ zs= z* z; sum= z; pow= z; for( i = 1; i <= 100; i++ ) { pow=- pow* zs/ (long double)i; term= pow/(2.* i+1.); sum= sum+ term; tms= creal( term* conj( term)); sms= creal( sum* conj( sum)); if( tms/sms < ACCS) break; } fbar=1.-(1.- sum* TOSP)* z* cexp( zs)* SP; return( fbar ); } /* if( cabs( z) <= 3.) */ /* asymptotic expansion */ if( creal( z) < 0.) { minus=1; z=- z; } else minus=0; zs=.5/( z* z); sum=CPLX_00; term=CPLX_10; for( i = 1; i <= 6; i++ ) { term =- term*(2.*i -1.)* zs; sum += term; } if( minus == 1) sum -= 2.* SP* z* cexp( z* z); fbar=- sum; return( fbar ); } /*-----------------------------------------------------------------------*/ /* gshank integrates the 6 sommerfeld integrals from start to */ /* infinity (until convergence) in lambda. at the break point, bk, */ /* the step increment may be changed from dela to delb. shank's */ /* algorithm to accelerate convergence of a slowly converging series */ /* is used */ void gshank( complex long double start, complex long double dela, complex long double *sum, int nans, complex long double *seed, int ibk, complex long double bk, complex long double delb ) { int ibx, j, i, jm, intx, inx, brk=0; static long double rbk, amg, den, denm; complex long double a1, a2, as1, as2, del, aa; complex long double q1[6][20], q2[6][20], ans1[6], ans2[6]; rbk=creal(bk); del=dela; if(ibk == 0) ibx=1; else ibx=0; for( i = 0; i < nans; i++ ) ans2[i]=seed[i]; b=start; for( intx = 1; intx <= MAXH; intx++ ) { inx=intx-1; a=b; b += del; if( (ibx == 0) && (creal(b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=1; b=bk; del=delb; rom1(nans,sum,2); if( ibx != 2 ) { for( i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for( i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; intx = 0; continue; } /* if( (ibx == 0) && (creal(b) >= rbk) ) */ rom1(nans,sum,2); for( i = 0; i < nans; i++ ) ans1[i] = ans2[i]+sum[i]; a=b; b += del; if( (ibx == 0) && (creal(b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=2; b=bk; del=delb; rom1(nans,sum,2); if( ibx != 2 ) { for( i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for( i = 0; i < nans; i++ ) ans2[i] = ans1[i]+sum[i]; intx = 0; continue; } /* if( (ibx == 0) && (creal(b) >= rbk) ) */ rom1(nans,sum,2); for( i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; den=0.; for( i = 0; i < nans; i++ ) { as1=ans1[i]; as2=ans2[i]; if(intx >= 2) { for( j = 1; j < intx; j++ ) { jm=j-1; aa=q2[i][jm]; a1=q1[i][jm]+as1-2.*aa; if( (creal(a1) != 0.) || (cimag(a1) != 0.) ) { a2=aa-q1[i][jm]; a1=q1[i][jm]-a2*a2/a1; } else a1=q1[i][jm]; a2=aa+as2-2.*as1; if( (creal(a2) != 0.) || (cimag(a2) != 0.) ) a2=aa-(as1-aa)*(as1-aa)/a2; else a2=aa; q1[i][jm]=as1; q2[i][jm]=as2; as1=a1; as2=a2; } /* for( j = 1; i < intx; i++ ) */ } /* if(intx >= 2) */ q1[i][intx-1]=as1; q2[i][intx-1]=as2; amg=fabsl(creal(as2))+fabsl(cimag(as2)); if(amg > den) den=amg; } /* for( i = 0; i < nans; i++ ) */ denm=1.e-3*den*CRIT; jm=intx-3; if(jm < 1) jm=1; for( j = jm-1; j < intx; j++ ) { brk = FALSE; for( i = 0; i < nans; i++ ) { a1=q2[i][j]; den=(fabsl(creal(a1))+fabsl(cimag(a1)))*CRIT; if(den < denm) den=denm; a1=q1[i][j]-a1; amg=fabsl(creal(a1)+fabsl(cimag(a1))); if(amg > den) { brk = TRUE; break; } } /* for( i = 0; i < nans; i++ ) */ if( brk ) break; } /* for( j = jm-1; j < intx; j++ ) */ if( ! brk ) { for( i = 0; i < nans; i++ ) sum[i]=.5*(q1[i][inx]+q2[i][inx]); return; } } /* for( intx = 1; intx <= maxh; intx++ ) */ /* No convergence */ abort_on_error(-6); } /*-----------------------------------------------------------------------*/ /* hankel evaluates hankel function of the first kind, */ /* order zero, and its derivative for complex argument z */ void hankel( complex long double z, complex long double *h0, complex long double *h0p ) { int i, k, ib, iz, miz; static int m[101], init = FALSE; static long double a1[25], a2[25], a3[25], a4[25], psi, tst, zms; complex long double clogz, j0, j0p, p0z, p1z, q0z, q1z, y0, y0p, zi, zi2, zk; /* initialization of constants */ if( ! init ) { psi=-GAMMA; for( k = 1; k <= 25; k++ ) { i = k-1; a1[i]=-.25/(k*k); a2[i]=1.0/(k+1.0); psi += 1.0/k; a3[i]=psi+psi; a4[i]=(psi+psi+1.0/(k+1.0))/(k+1.0); } for( i = 1; i <= 101; i++ ) { tst=1.0; for( k = 0; k < 24; k++ ) { init = k; tst *= -i*a1[k]; if(tst*a3[k] < 1.e-6) break; } m[i-1]=init+1; } init = TRUE; } /* if( ! init ) */ zms=z*conj(z); if(zms == 0.) abort_on_error(-7); ib=0; if(zms <= 16.81) { if(zms > 16.) ib=1; /* series expansion */ iz=zms; miz=m[iz]; j0=CPLX_10; j0p=j0; y0=CPLX_00; y0p=y0; zk=j0; zi=z*z; for( k = 0; k < miz; k++ ) { zk *= a1[k]*zi; j0 += zk; j0p += a2[k]*zk; y0 += a3[k]*zk; y0p += a4[k]*zk; } j0p *= -.5*z; clogz=clogl(.5*z); y0=(2.*j0*clogz-y0)/PI+C2; y0p=(2./z+2.*j0p*clogz+.5*y0p*z)/PI+C1*z; *h0=j0+CPLX_01*y0; *h0p=j0p+CPLX_01*y0p; if(ib == 0) return; y0=*h0; y0p=*h0p; } /* if(zms <= 16.81) */ /* asymptotic expansion */ zi=1./z; zi2=zi*zi; p0z=1.+(P20*zi2-P10)*zi2; p1z=1.+(P11-P21*zi2)*zi2; q0z=(Q20*zi2-Q10)*zi; q1z=(Q11-Q21*zi2)*zi; zk=cexp(CPLX_01*(z-POF))*csqrtl(zi)*C3; *h0=zk*(p0z+CPLX_01*q0z); *h0p=CPLX_01*zk*(p1z+CPLX_01*q1z); if(ib == 0) return; zms=cosl((sqrtl(zms)-4.)*31.41592654); *h0=.5*(y0*(1.+zms)+ *h0*(1.-zms)); *h0p=.5*(y0p*(1.+zms)+ *h0p*(1.-zms)); return; } /*-----------------------------------------------------------------------*/ /* compute integration parameter xlam=lambda from parameter t. */ void lambda( long double t, complex long double *xlam, complex long double *dxlam ) { *dxlam=b-a; *xlam=a+*dxlam*t; return; } /*-----------------------------------------------------------------------*/ /* rom1 integrates the 6 sommerfeld integrals from a to b in lambda. */ /* the method of variable interval width romberg integration is used. */ void rom1( int n, complex long double *sum, int nx ) { int jump, lstep, nogo, i, ns, nt; static long double z, ze, s, ep, zend, dz=0., dzot=0., tr, ti; static complex long double t00, t11, t02; static complex long double g1[6], g2[6], g3[6], g4[6], g5[6], t01[6], t10[6], t20[6]; lstep=0; z=0.; ze=1.; s=1.; ep=s/(1.e4*NM); zend=ze-ep; for( i = 0; i < n; i++ ) sum[i]=CPLX_00; ns=nx; nt=0; saoa(z,g1); jump = FALSE; while( TRUE ) { if( ! jump ) { dz=s/ns; if( (z+dz) > ze ) { dz=ze-z; if( dz <= ep ) return; } dzot=dz*.5; saoa(z+dzot,g3); saoa(z+dz,g5); } /* if( ! jump ) */ nogo=FALSE; for( i = 0; i < n; i++ ) { t00=(g1[i]+g5[i])*dzot; t01[i]=(t00+dz*g3[i])*.5; t10[i]=(4.*t01[i]-t00)/3.; /* test convergence of 3 point romberg result */ test( creal(t01[i]), creal(t10[i]), &tr, cimag(t01[i]), cimag(t10[i]), &ti, 0. ); if( (tr > CRIT) || (ti > CRIT) ) nogo = TRUE; } if( ! nogo ) { for( i = 0; i < n; i++ ) sum[i] += t10[i]; nt += 2; z += dz; if(z > zend) return; for( i = 0; i < n; i++ ) g1[i]=g5[i]; if( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = FALSE; continue; } /* if( ! nogo ) */ saoa(z+dz*.25,g2); saoa(z+dz*.75,g4); nogo=FALSE; for( i = 0; i < n; i++ ) { t02=(t01[i]+dzot*(g2[i]+g4[i]))*.5; t11=(4.*t02-t01[i])/3.; t20[i]=(16.*t11-t10[i])/15.; /* test convergence of 5 point romberg result */ test( creal(t11), creal(t20[i]), &tr, cimag(t11), cimag(t20[i]), &ti, 0. ); if( (tr > CRIT) || (ti > CRIT) ) nogo = TRUE; } if( ! nogo ) { for( i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if(z > zend) return; for( i = 0; i < n; i++ ) g1[i]=g5[i]; if( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = FALSE; continue; } /* if( ! nogo ) */ nt=0; if(ns < NM) { ns *= 2; dz=s/ns; dzot=dz*.5; for( i = 0; i < n; i++ ) { g5[i]=g3[i]; g3[i]=g2[i]; } jump = TRUE; continue; } /* if(ns < nm) */ if( ! lstep ) { lstep = TRUE; lambda( z, &t00, &t11 ); } for( i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if(z > zend) return; for( i = 0; i < n; i++ ) g1[i]=g5[i]; if( (nt >= NTS) && (ns > nx) ) { ns /= 2; nt=1; } jump = FALSE; } /* while( TRUE ) */ } /*-----------------------------------------------------------------------*/ /* saoa computes the integrand for each of the 6 sommerfeld */ /* integrals for source and observer above ground */ void saoa( long double t, complex long double *ans) { long double xlr, sign; static complex long double xl, dxl, cgam1, cgam2, b0, b0p, com, dgam, den1, den2; lambda(t, &xl, &dxl); if( jh == 0 ) { /* bessel function form */ bessel(xl*rho, &b0, &b0p); b0 *=2.; b0p *=2.; cgam1=csqrtl(xl*xl-ck1sq); cgam2=csqrtl(xl*xl-ck2sq); if(creal(cgam1) == 0.) cgam1=cmplx(0.,-fabsl(cimag(cgam1))); if(creal(cgam2) == 0.) cgam2=cmplx(0.,-fabsl(cimag(cgam2))); } else { /* hankel function form */ hankel(xl*rho, &b0, &b0p); com=xl-ck1; cgam1=csqrtl(xl+ck1)*csqrtl(com); if(creal(com) < 0. && cimag(com) >= 0.) cgam1=-cgam1; com=xl-ck2; cgam2=csqrtl(xl+ck2)*csqrtl(com); if(creal(com) < 0. && cimag(com) >= 0.) cgam2=-cgam2; } xlr=xl*conj(xl); if(xlr >= tsmag) { if(cimag(xl) >= 0.) { xlr=creal(xl); if(xlr >= ck2) { if(xlr <= ck1r) dgam=cgam2-cgam1; else { sign=1.; dgam=1./(xl*xl); dgam=sign*((ct3*dgam+ct2)*dgam+ct1)/xl; } } else { sign=-1.; dgam=1./(xl*xl); dgam=sign*((ct3*dgam+ct2)*dgam+ct1)/xl; } /* if(xlr >= ck2) */ } /* if(cimag(xl) >= 0.) */ else { sign=1.; dgam=1./(xl*xl); dgam=sign*((ct3*dgam+ct2)*dgam+ct1)/xl; } } /* if(xlr < tsmag) */ else dgam=cgam2-cgam1; den2=cksm*dgam/(cgam2*(ck1sq*cgam2+ck2sq*cgam1)); den1=1./(cgam1+cgam2)-cksm/cgam2; com=dxl*xl*cexp(-cgam2*zph); ans[5]=com*b0*den1/ck1; com *= den2; if(rho != 0.) { b0p=b0p/rho; ans[0]=-com*xl*(b0p+b0*xl); ans[3]=com*xl*b0p; } else { ans[0]=-com*xl*xl*.5; ans[3]=ans[0]; } ans[1]=com*cgam2*cgam2*b0; ans[2]=-ans[3]*cgam2*rho; ans[4]=com*b0; return; } necpp-1.5.0+cvs20101003/c_src/input.c0000644000175000017500000002471510310210755015301 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /segj/ */ extern int *jco, jsno, nscon, maxcon; /* Max. no. connections */ extern long double *ax, *bx, *cx; /* common /vsorc/ */ extern int *ivqd, *isant, *iqds, nvqd, nsant, nqds; extern complex long double *vqd, *vqds, *vsant; /* common /dataj/ */ extern int iexk, ind1, indd1, ind2, indd2, ipgnd; extern long double s, b, xj, yj, zj, cabj, sabj, salpj, rkh; extern long double t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; extern complex long double exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* common /zload/ */ extern int nload; extern complex long double *zarray; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*-------------------------------------------------------------------*/ /* fill incident field array for charge discontinuity voltage source */ void qdsrc( int is, complex long double v, complex long double *e ) { int i, jx, j, jp1, ipr, ij, i1; long double xi, yi, zi, ai, cabi, sabi, salpi, tx, ty, tz; complex long double curd, etk, ets, etc; is--; i= icon1[is]; icon1[is]=0; tbf( is+1,0); icon1[is]= i; s= si[is]*.5; curd= CCJ* v/(( logl(2.* s/ bi[is])-1.)*( bx[jsno-1]* cosl( TP* s)+ cx[jsno-1]* sinl( TP* s))* wlam); vqds[nqds]= v; iqds[nqds]= is+1; nqds++; for( jx = 0; jx < jsno; jx++ ) { j= jco[jx]-1; jp1 = j+1; s= si[j]; b= bi[j]; xj= x[j]; yj= y[j]; zj= z[j]; cabj= cab[j]; sabj= sab[j]; salpj= salp[j]; if( iexk != 0) { ipr= icon1[j]; if( ipr < 0 ) { ipr=- ipr; ipr--; if( -icon1[ipr-1] != jp1 ) ind1=2; else { xi= fabsl( cabj* cab[ipr]+ sabj* sab[ipr]+ salpj* salp[ipr]); if( (xi < 0.999999) || (fabsl(bi[ipr]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr < 0 ) */ else if( ipr == 0 ) ind1=1; else /* ipr > 0 */ { ipr--; if( ipr != j ) { if( icon2[ipr] != jp1) ind1=2; else { xi= fabsl( cabj* cab[ipr]+ sabj* sab[ipr]+ salpj* salp[ipr]); if( (xi < 0.999999) || (fabsl(bi[ipr]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr != j ) */ else { if( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= icon2[j]; if( ipr < 0 ) { ipr = -ipr; ipr--; if( -icon2[ipr] != jp1 ) ind1=2; else { xi= fabsl( cabj* cab[ipr]+ sabj* sab[ipr]+ salpj* salp[ipr]); if( (xi < 0.999999) || (fabsl(bi[ipr]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr < 0 ) */ else if( ipr == 0 ) ind2=1; else /* ipr > 0 */ { ipr--; if( ipr != j ) { if( icon1[ipr] != jp1) ind2=2; else { xi= fabsl( cabj* cab[ipr]+ sabj* sab[ipr]+ salpj* salp[ipr]); if( (xi < 0.999999) || (fabsl(bi[ipr]/b-1.) > 1.0e-6) ) ind2=2; else ind2=0; } } /* if( ipr != j )*/ else { if( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if( iexk != 0) */ for( i = 0; i < n; i++ ) { ij= i- j; xi= x[i]; yi= y[i]; zi= z[i]; ai= bi[i]; efld( xi, yi, zi, ai, ij); cabi= cab[i]; sabi= sab[i]; salpi= salp[i]; etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; e[i]= e[i]-( etk* ax[jx]+ ets* bx[jx]+ etc* cx[jx])* curd; } if( m != 0) { i1= n-1; for( i = 0; i < m; i++ ) { xi= px[i]; yi= py[i]; zi= pz[i]; hsfld( xi, yi, zi,0.); i1++; tx= t2x[i]; ty= t2y[i]; tz= t2z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* ax[jx]+ ets* bx[jx]+ etc* cx[jx] )* curd* psalp[i]; i1++; tx= t1x[i]; ty= t1y[i]; tz= t1z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* ax[jx]+ ets* bx[jx]+ etc* cx[jx])* curd* psalp[i]; } } /* if( m != 0) */ if( nload > 0 ) e[j] += zarray[j]* curd*(ax[jx]+ cx[jx]); } /* for( jx = 0; jx < jsno; jx++ ) */ return; } /*-----------------------------------------------------------------------*/ void readmn( char *gm, int *i1, int *i2, int *i3, int *i4, long double *f1, long double *f2, long double *f3, long double *f4, long double *f5, long double *f6 ) { char line_buf[134]; int nlin, i, line_idx; int nint = 4, nflt = 6; int iarr[4] = { 0, 0, 0, 0 }; long double rarr[6] = { 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ load_line( line_buf, input_fp ); /* get line length */ nlin= strlen( line_buf ); /* abort if card's mnemonic too short or missing */ if( nlin < 2 ) { fprintf( output_fp, "\n COMMAND DATA CARD ERROR:" "\n CARD'S MNEMONIC CODE TOO SHORT OR MISSING." ); stop(-1); } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if( strcmp( gm, "XT" ) == 0 ) { fprintf( stderr, "\nnec2c: Exiting after an \"XT\" command in readgm()\n" ); fprintf( output_fp, "\n\n nec2c: Exiting after an \"XT\" command in readgm()" ); stop(0); } /* Return if only mnemonic on card */ if( nlin == 2 ) { *i1 = *i2 = *i3 = *i4 = 0; *f1 = *f2 = *f3 = *f4 = *f5 = *f6 = 0.0; return; } /* read integers from line */ line_idx = 1; for( i = 0; i < nint; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if( (line_buf[line_idx] == '\0') ) { *i1= iarr[0]; *i2= iarr[1]; *i3= iarr[2]; *i4= iarr[3]; *f1= rarr[0]; *f2= rarr[1]; *f3= rarr[2]; *f4= rarr[3]; *f5= rarr[4]; *f6= rarr[5]; return; } /* read an integer from line */ iarr[i] = atoi( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); stop(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if( line_buf[line_idx] == '\0' ) { *i1= iarr[0]; *i2= iarr[1]; *i3= iarr[2]; *i4= iarr[3]; *f1= rarr[0]; *f2= rarr[1]; *f3= rarr[2]; *f4= rarr[3]; *f5= rarr[4]; *f6= rarr[5]; return; } } /* for( i = 0; i < nint; i++ ) */ /* read long doubles from line */ for( i = 0; i < nflt; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if( (line_buf[line_idx] == '\0') ) { *i1= iarr[0]; *i2= iarr[1]; *i3= iarr[2]; *i4= iarr[3]; *f1= rarr[0]; *f2= rarr[1]; *f3= rarr[2]; *f4= rarr[3]; *f5= rarr[4]; *f6= rarr[5]; return; } /* read a long double from line */ rarr[i] = atof( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); stop(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if( line_buf[line_idx] == '\0' ) { *i1= iarr[0]; *i2= iarr[1]; *i3= iarr[2]; *i4= iarr[3]; *f1= rarr[0]; *f2= rarr[1]; *f3= rarr[2]; *f4= rarr[3]; *f5= rarr[4]; *f6= rarr[5]; return; } } /* for( i = 0; i < nflt; i++ ) */ *i1= iarr[0]; *i2= iarr[1]; *i3= iarr[2]; *i4= iarr[3]; *f1= rarr[0]; *f2= rarr[1]; *f3= rarr[2]; *f4= rarr[3]; *f5= rarr[4]; *f6= rarr[5]; return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/README0000644000175000017500000001562410310210755014655 0ustar numanuma README File for nec2c 1. INTRODUCTION: nec2c is a translation of the NEC2 FORTRAN source code to the C language. The translation was performed mostly "by hand" and a lot of modifications to the original program were introduced in order to modernize the NEC2 and to remove as many built-in limitations as possible. The attendant SOMNEC program was also translated to C and incorporated in nec2c as a function so that Sommerfeld ground solutions are a part of the program. 2. CHANGES: The following is a list of the more significant changes incorporated into nec2c during translation from FORTRAN to C: * All GO TO constructs have been removed (all 961 of them!) and "spaghetti" code sections untangled as far as was possible to the author. Still, a lot of the code is not as clean and straightforward as might have been. * Obsolete memory-saving practices (such as "equivalences" of different variables) have been eliminated and memory-sharing variables have been separated so that they are independent. * All fixed-size arrays used in calculations have been replaced with buffer pointers which are allocated memory dynamically according to the needs of the program and the complexity of each structure's geometry. There is a two-fold advantage in this - there is virtually no limit to the complexity of a structure (number of segments/patches etc), and there is no wasted memory in fixed arrays. Additionally, there is no need for data storage/swapping between memory and files and therefore functions relating to this activity and also the NGF form of solution have been removed from the program. * When a Sommerfeld finite ground solution is requested, since the SOMNEC program has been incorporated in nec2c there is no need to store the ground grid data in a file and read it when running nec2c. Instead, ground grid data are calculated as needed and for each new frequency if frequency stepping is specified. * The factr() and solve() functions have been modified to handle the main matrix (cm) in untransposed form so that calculations are faster. * The parser that reads the input file allows the two characters of the mnemonic to be in lower case if preferred. It also allows comments to be inserted anywhere in the input file in Unix style, e.g. all lines beginning with a '#' are ignored. * Operationally, nec2c differs from NEC2 in not being an interactive application. Instead, nec2c is a non-interactive command-line application which accepts an input file name and optionally an output file name. If this is not specified, a name for the output file is made by stripping any extensions from the input file name and adding a ".out" extension. Furthermore, nec2c has the potential of being incorporated in another application (like a GUI) after suitable modifications, allowing the creation of a stand-alone program without the need for reading files produced separately. * My original motive for translating NEC2 into C was to make it easier to modify and modernize and to change obsolete functions and usage. As a result I have edited to some extend the format of the output file to make it more "human readable" (e.g. provided a single space between adjacent numbers to avoid a hard-to-read "chain" of numbers joined by - signs) etc. In my humble opinion these changes make the output file easier to read and possibly somewhat more presentable, although this is likely to be a problem with applications that read the output file in a rigid manner, based on the exact output format. I apologize for this change if it causes such problems but my intention is to eventually modify nec2c to be used as part of a graphical application, providing results for graphical plots directly in its buffers. 3. COMPILATION: The nec2c package is very simple at this time and compilation basically only requires a Linux platform with development tools installed (gcc, make and optionally gdb and "valgrind" for debugging). To compile the source code just type "make nec2c" in the nec2c directory and if all is well an executable binary (nec2c) should be produced. If gdb is not installed, remove the -g option from the line in Makefile the reads: CC = gcc -Wall -O3 -g These changes can also be made if debugging is not of interest, thereby reducing the size of the binary and speeding it as well. If desired, nec2c can be installed (to /usr/local/bin) with "make install". There is a double precision FORTRAN source (nec2dx.f) in this package and this can be compiled and installed by typing "make nec2dx" in the nec2c directory. It can be run by typing nec2dx and supplying an input and output file name and it may be used to check nec2c's results for bugs etc. 4. USAGE: nec2c is run as a non-interactive command-line application and is invoked in the following manner: nec2c -i [-o][-hv] -h: print this usage information and exit. -v: print nec2c version number and exit. The -i option is always needed and it specifies the name of the input file. The -o switch is optional and it specifies the output file name. If not used, a name for the output file is made by stripping any extensions from the input file name and adding a ".out" extension, e.g. nec2c -i yagi.nec will cause nec2c to read yagi.nec as the input file and produce yagi.out as the output file. 5. BUGS!! Translating such a complex and large program from FORTRAN to C and making so many changes along the way is very prone to bugs in the new program. I have fixed a lot of these by using various input files that hopefully invoke most if not all of NEC2's functions but there must still be bugs in nec2c that will surface with some specific combinations of "cards" in some input file. The best way to check nec2c's results is to run nec2dx with the same input file and compare results - there should be very close agreement between them as nec2dx is also double-precision. 6. Changes in latest (January 2005) release: I have split nec2c.c into a number of smaller files to make it easier to work on during bug-fixing or development. Lately (December 2004) I used the "valgrind" (http://valgrind.kde.org) tool to check nec2c and found two significant bugs in intrp() and subph() which I (hopefully!) have fixed. I also fixed another bug that was found by Tim Molteno in the netwk() routine. If you intend to use valgrind (recommended!) to test nec2c for bugs (mainly memory allocation/access errors) then do not use performance enhancing C flags (e.g. do not use -Ox flags etc) otherwise you will get false error reports. 7. License: nec2c is Public Domain, same as the original FORTRAN source. Please keep any software you write incorporating nec2c in Public Domain or at least use an open license like GPL or BSD. 8. AUTHOR: Neoklis Kyriazis neoklisk@cytanet.com.cy January 27 2004 necpp-1.5.0+cvs20101003/c_src/Makefile0000644000175000017500000000102610310210755015424 0ustar numanuma#Makefile for nec2c 21 Aug 2003 SHELL = /bin/sh PROJECT = nec2c BINDIR = /usr/local/bin CC = gcc -Wall -g3 objects = calculations.o fields.o geometry.o ground.o input.o \ main.o matrix.o misc.o network.o radiation.o somnec.o $(PROJECT) : $(objects) $(CC) -lm -o $(PROJECT) $(objects) $(objects) : nec2c.h nec2dx : g77 -o nec2dx nec2dx.f install -m 755 --strip nec2dx $(BINDIR) install : $(PROJECT) install -m 755 --strip $(PROJECT) $(BINDIR) .PHONY : distclean distclean : -rm -f *.o *~ $(PROJECT) nec2dx necpp-1.5.0+cvs20101003/c_src/fields.c0000644000175000017500000011454210310210755015406 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /dataj/ */ extern int iexk, ind1, indd1, ind2, indd2, ipgnd; extern long double s, b, xj, yj, zj, cabj, sabj, salpj, rkh; extern long double t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; extern complex long double exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* common /gnd/ */ extern int ksymp, ifar, iperf, nradl; extern long double t2, cl, ch, scrwl, scrwr; extern complex long double zrati, zrati2, t1, frati; /* common /incom/ */ extern int isnor; extern long double xo, yo, zo, sn, xsn, ysn; /* common /tmi/ */ extern int ija; /* changed to ija to avoid conflict */ extern long double zpk, rkb2; /*common /tmh/ */ extern long double zpka, rhks; /* common /gwav/ */ extern long double r1, r2, zmh, zph; extern complex long double u, u2, xx1, xx2; /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /crnt/ */ extern long double *air, *aii, *bir, *bii, *cir, *cii; extern complex long double *cur; /* common /fpat/ */ extern int near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp, inor, iax, ixtyp; extern long double thets, phis, dth, dph, rfld, gnor, clt, cht, epsr2, sig2; extern long double xpr6, pinr, pnlr, ploss, xnr, ynr, znr, dxnr, dynr, dznr; /* common /plot/ */ extern int iplp1, iplp2, iplp3, iplp4; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*-------------------------------------------------------------------*/ /* compute near e fields of a segment with sine, cosine, and */ /* constant currents. ground effect included. */ void efld( long double xi, long double yi, long double zi, long double ai, int ij ) { #define txk egnd[0] #define tyk egnd[1] #define tzk egnd[2] #define txs egnd[3] #define tys egnd[4] #define tzs egnd[5] #define txc egnd[6] #define tyc egnd[7] #define tzc egnd[8] int ip; long double xij, yij, ijx, rfl, salpr, zij, zp, rhox; long double rhoy, rhoz, rh, r, rmag, cth, px, py; long double xymag, xspec, yspec, rhospc, dmin, shaf; complex long double epx, epy, refs, refps, zrsin, zratx, zscrn; complex long double tezs, ters, tezc, terc, tezk, terk, egnd[9]; xij= xi- xj; yij= yi- yj; ijx= ij; rfl=-1.; for( ip = 0; ip < ksymp; ip++ ) { if( ip == 1) ijx=1; rfl=- rfl; salpr= salpj* rfl; zij= zi- rfl* zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh= sqrtl( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai); if( rh <= 1.e-10) { rhox=0.; rhoy=0.; rhoz=0.; } else { rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; } /* lumped current element approx. for large separations */ r= sqrtl( zp* zp+ rh* rh); if( r >= rkh) { rmag= TP* r; cth= zp/ r; px= rh/ r; txk= cmplx( cosl( rmag),- sinl( rmag)); py= TP* r* r; tyk= ETA* cth* txk* cmplx(1.0,-1.0/ rmag)/ py; tzk= ETA* px* txk* cmplx(1.0, rmag-1.0/ rmag)/(2.* py); tezk= tyk* cth- tzk* px; terk= tyk* px+ tzk* cth; rmag= sinl( PI* s)/ PI; tezc= tezk* rmag; terc= terk* rmag; tezk= tezk* s; terk= terk* s; txs=CPLX_00; tys=CPLX_00; tzs=CPLX_00; } /* if( r >= rkh) */ if( r < rkh) { /* eksc for thin wire approx. or ekscx for extended t.w. approx. */ if( iexk != 1) eksc( s, zp, rh, TP, ijx, &tezs, &ters, &tezc, &terc, &tezk, &terk ); else ekscx( b, s, zp, rh, TP, ijx, ind1, ind2, &tezs, &ters, &tezc, &terc, &tezk, &terk); txs= tezs* cabj+ ters* rhox; tys= tezs* sabj+ ters* rhoy; tzs= tezs* salpr+ ters* rhoz; } /* if( r < rkh) */ txk= tezk* cabj+ terk* rhox; tyk= tezk* sabj+ terk* rhoy; tzk= tezk* salpr+ terk* rhoz; txc= tezc* cabj+ terc* rhox; tyc= tezc* sabj+ terc* rhoy; tzc= tezc* salpr+ terc* rhoz; if( ip == 1) { if( iperf <= 0) { zratx= zrati; rmag= r; xymag= sqrtl( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if( nradl != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrtl( xspec* xspec+ yspec* yspec+ t2* t2); if( rhospc <= scrwl) { zscrn= t1* rhospc* logl( rhospc/ t2); zratx=( zscrn* zrati)/( ETA* zrati+ zscrn); } } /* if( nradl != 0) */ /* calculation of reflection coefficients when ground is specified. */ if( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; zrsin=CPLX_10; } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; zrsin= csqrtl(1.0 - zratx*zratx*(1.0 - cth*cth) ); } /* if( xymag <= 1.0e-6) */ refs=( cth- zratx* zrsin)/( cth+ zratx* zrsin); refps=-( zratx* cth- zrsin)/( zratx* cth+ zrsin); refps= refps- refs; epy= px* txk+ py* tyk; epx= px* epy; epy= py* epy; txk= refs* txk+ refps* epx; tyk= refs* tyk+ refps* epy; tzk= refs* tzk; epy= px* txs+ py* tys; epx= px* epy; epy= py* epy; txs= refs* txs+ refps* epx; tys= refs* tys+ refps* epy; tzs= refs* tzs; epy= px* txc+ py* tyc; epx= px* epy; epy= py* epy; txc= refs* txc+ refps* epx; tyc= refs* tyc+ refps* epy; tzc= refs* tzc; } /* if( iperf <= 0) */ exk= exk- txk* frati; eyk= eyk- tyk* frati; ezk= ezk- tzk* frati; exs= exs- txs* frati; eys= eys- tys* frati; ezs= ezs- tzs* frati; exc= exc- txc* frati; eyc= eyc- tyc* frati; ezc= ezc- tzc* frati; continue; } /* if( ip == 1) */ exk= txk; eyk= tyk; ezk= tzk; exs= txs; eys= tys; ezs= tzs; exc= txc; eyc= tyc; ezc= tzc; } /* for( ip = 0; ip < ksymp; ip++ ) */ if( iperf != 2) return; /* field due to ground using sommerfeld/norton */ sn= sqrtl( cabj* cabj+ sabj* sabj); if( sn >= 1.0e-5) { xsn= cabj/ sn; ysn= sabj/ sn; } else { sn=0.; xsn=1.; ysn=0.; } /* displace observation point for thin wire approximation */ zij= zi+ zj; salpr=- salpj; rhox= sabj* zij- salpr* yij; rhoy= salpr* xij- cabj* zij; rhoz= cabj* yij- sabj* xij; rh= rhox* rhox+ rhoy* rhoy+ rhoz* rhoz; if( rh <= 1.e-10) { xo= xi- ai* ysn; yo= yi+ ai* xsn; zo= zi; } else { rh= ai/ sqrtl( rh); if( rhoz < 0.) rh=- rh; xo= xi+ rh* rhox; yo= yi+ rh* rhoy; zo= zi+ rh* rhoz; } /* if( rh <= 1.e-10) */ r= xij* xij+ yij* yij+ zij* zij; if( r <= .95) { /* field from interpolation is integrated over segment */ isnor=1; dmin= exk* conjl( exk)+ eyk* conjl( eyk)+ ezk* conjl( ezk); dmin=.01* sqrtl( dmin); shaf=.5* s; rom2(- shaf, shaf, egnd, dmin); } else { /* norton field equations and lumped current element approximation */ isnor=2; sflds(0., egnd); } /* if( r <= .95) */ if( r > .95) { zp= xij* cabj+ yij* sabj+ zij* salpr; rh= r- zp* zp; if( rh <= 1.e-10) dmin=0.; else dmin= sqrtl( rh/( rh+ ai* ai)); if( dmin <= .95) { px=1.- dmin; terk=( txk* cabj+ tyk* sabj+ tzk* salpr)* px; txk= dmin* txk+ terk* cabj; tyk= dmin* tyk+ terk* sabj; tzk= dmin* tzk+ terk* salpr; ters=( txs* cabj+ tys* sabj+ tzs* salpr)* px; txs= dmin* txs+ ters* cabj; tys= dmin* tys+ ters* sabj; tzs= dmin* tzs+ ters* salpr; terc=( txc* cabj+ tyc* sabj+ tzc* salpr)* px; txc= dmin* txc+ terc* cabj; tyc= dmin* tyc+ terc* sabj; tzc= dmin* tzc+ terc* salpr; } /* if( dmin <= .95) */ } /* if( r > .95) */ exk= exk+ txk; eyk= eyk+ tyk; ezk= ezk+ tzk; exs= exs+ txs; eys= eys+ tys; ezs= ezs+ tzs; exc= exc+ txc; eyc= eyc+ tyc; ezc= ezc+ tzc; return; } /*-----------------------------------------------------------------------*/ /* compute e field of sine, cosine, and constant */ /* current filaments by thin wire approximation. */ void eksc( long double s, long double z, long double rh, long double xk, int ij, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk ) { long double rhk, sh, shk, ss, cs, z1a, z2a, cint, sint; complex long double gz1, gz2, gp1, gp2, gzp1, gzp2; ija= ij; zpk= xk* z; rhk= xk* rh; rkb2= rhk* rhk; sh=.5* s; shk= xk* sh; ss= sinl( shk); cs= cosl( shk); z2a= sh- z; z1a=-( sh+ z); gx( z1a, rh, xk, &gz1, &gp1); gx( z2a, rh, xk, &gz2, &gp2); gzp1= gp1* z1a; gzp2= gp2* z2a; *ezs= CONST1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *ezc=- CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *erk= CONST1*( gp2- gp1)* rh; intx(- shk, shk, rhk, ij, &cint, &sint); *ezk=- CONST1*( gzp2- gzp1+ xk* xk* cmplx( cint,- sint)); gzp1= gzp1* z1a; gzp2= gzp2* z2a; if( rh >= 1.0e-10) { *ers=- CONST1*(( gzp2+ gzp1+ gz2+ gz1)* ss-( z2a* gz2- z1a* gz1)* cs*xk)/ rh; *erc=- CONST1*(( gzp2- gzp1+ gz2- gz1)* cs+( z2a* gz2+ z1a* gz1)* ss*xk)/ rh; return; } *ers = CPLX_00; *erc = CPLX_00; return; } /*-----------------------------------------------------------------------*/ /* compute e field of sine, cosine, and constant current */ /* filaments by extended thin wire approximation. */ void ekscx( long double bx, long double s, long double z, long double rhx, long double xk, int ij, int inx1, int inx2, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk ) { int ira; long double b, rh, sh, rhk, shk, ss, cs, z1a; long double z2a, a2, bk, bk2, cint, sint; complex long double gz1, gz2, gzp1, gzp2, gr1, gr2; complex long double grp1, grp2, grk1, grk2, gzz1, gzz2; if( rhx >= bx) { rh= rhx; b= bx; ira=0; } else { rh= bx; b= rhx; ira=1; } sh=.5* s; ija= ij; zpk= xk* z; rhk= xk* rh; rkb2= rhk* rhk; shk= xk* sh; ss= sinl( shk); cs= cosl( shk); z2a= sh- z; z1a=-( sh+ z); a2= b* b; if( inx1 != 2) gxx( z1a, rh, b, a2, xk, ira, &gz1, &gzp1, &gr1, &grp1, &grk1, &gzz1); else { gx( z1a, rhx, xk, &gz1, &grk1); gzp1= grk1* z1a; gr1= gz1/ rhx; grp1= gzp1/ rhx; grk1= grk1* rhx; gzz1= CPLX_00; } if( inx2 != 2) gxx( z2a, rh, b, a2, xk, ira, &gz2, &gzp2, &gr2, &grp2, &grk2, &gzz2); else { gx( z2a, rhx, xk, &gz2, &grk2); gzp2= grk2* z2a; gr2= gz2/ rhx; grp2= gzp2/ rhx; grk2= grk2* rhx; gzz2= CPLX_00; } *ezs= CONST1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *ezc=- CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *ers=- CONST1*(( z2a* grp2+ z1a* grp1+ gr2+ gr1)*ss -( z2a* gr2- z1a* gr1)* cs* xk); *erc=- CONST1*(( z2a* grp2- z1a* grp1+ gr2- gr1)*cs +( z2a* gr2+ z1a* gr1)* ss* xk); *erk= CONST1*( grk2- grk1); intx(- shk, shk, rhk, ij, &cint, &sint); bk= b* xk; bk2= bk* bk*.25; *ezk=- CONST1*( gzp2- gzp1+ xk* xk*(1.- bk2)* cmplx( cint,- sint)-bk2*( gzz2- gzz1)); return; } /*-----------------------------------------------------------------------*/ /* integrand for h field of a wire */ void gh( long double zk, long double *hr, long double *hi) { long double rs, r, ckr, skr, rr2, rr3; rs= zk- zpka; rs= rhks+ rs* rs; r= sqrtl( rs); ckr= cosl( r); skr= sinl( r); rr2=1./ rs; rr3= rr2/ r; *hr= skr* rr2+ ckr* rr3; *hi= ckr* rr2- skr* rr3; return; } /*-----------------------------------------------------------------------*/ /* gwave computes the electric field, including ground wave, of a */ /* current element over a ground plane using formulas of k.a. norton */ /* (proc. ire, sept., 1937, pp.1203,1236.) */ void gwave( complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *ezh, complex long double *eph ) { long double sppp, sppp2, cppp2, cppp, spp, spp2, cpp2, cpp; complex long double rk1, rk2, t1, t2, t3, t4, p1, rv; complex long double omr, w, f, q1, rh, v, g, xr1, xr2; complex long double x1, x2, x3, x4, x5, x6, x7; sppp= zmh/ r1; sppp2= sppp* sppp; cppp2=1.- sppp2; if( cppp2 < 1.0e-20) cppp2=1.0e-20; cppp= sqrtl( cppp2); spp= zph/ r2; spp2= spp* spp; cpp2=1.- spp2; if( cpp2 < 1.0e-20) cpp2=1.0e-20; cpp= sqrtl( cpp2); rk1=- TPJ* r1; rk2=- TPJ* r2; t1=1. -u2* cpp2; t2= csqrtl( t1); t3=(1. -1./ rk1)/ rk1; t4=(1. -1./ rk2)/ rk2; p1= rk2* u2* t1/(2.* cpp2); rv=( spp- u* t2)/( spp+ u* t2); omr=1.- rv; w=1./ omr; w=(4.0 + 0.0fj)* p1* w* w; f= fbar( w); q1= rk2* t1/(2.* u2* cpp2); rh=( t2- u* spp)/( t2+ u* spp); v=1./(1.+ rh); v=(4.0 + 0.0fj)* q1* v* v; g= fbar( v); xr1= xx1/ r1; xr2= xx2/ r2; x1= cppp2* xr1; x2= rv* cpp2* xr2; x3= omr* cpp2* f* xr2; x4= u* t2* spp*2.* xr2/ rk2; x5= xr1* t3*(1.-3.* sppp2); x6= xr2* t4*(1.-3.* spp2); *ezv=( x1+ x2+ x3- x4- x5- x6)* (-CONST4); x1= sppp* cppp* xr1; x2= rv* spp* cpp* xr2; x3= cpp* omr* u* t2* f* xr2; x4= spp* cpp* omr* xr2/ rk2; x5=3.* sppp* cppp* t3* xr1; x6= cpp* u* t2* omr* xr2/ rk2*.5; x7=3.* spp* cpp* t4* xr2; *erv=-( x1+ x2- x3+ x4- x5+ x6- x7)* (-CONST4); *ezh=-( x1- x2+ x3- x4- x5- x6+ x7)* (-CONST4); x1= sppp2* xr1; x2= rv* spp2* xr2; x4= u2* t1* omr* f* xr2; x5= t3*(1.-3.* cppp2)* xr1; x6= t4*(1.-3.* cpp2)*(1.- u2*(1.+ rv)- u2* omr* f)* xr2; x7= u2* cpp2* omr*(1.-1./ rk2)*( f*( u2* t1- spp2-1./ rk2)+1./rk2)* xr2; *erh=( x1- x2- x4- x5+ x6+ x7)* (-CONST4); x1= xr1; x2= rh* xr2; x3=( rh+1.)* g* xr2; x4= t3* xr1; x5= t4*(1.- u2*(1.+ rv)- u2* omr* f)* xr2; x6=.5* u2* omr*( f*( u2* t1- spp2-1./ rk2)+1./ rk2)* xr2/ rk2; *eph=-( x1- x2+ x3- x4+ x5+ x6)* (-CONST4); return; } /*-----------------------------------------------------------------------*/ /* segment end contributions for thin wire approx. */ void gx( long double zz, long double rh, long double xk, complex long double *gz, complex long double *gzp) { long double r, r2, rkz; r2= zz* zz+ rh* rh; r= sqrtl( r2); rkz= xk* r; *gz= cmplx( cosl( rkz),- sinl( rkz))/ r; *gzp=- cmplx(1.0, rkz)* *gz/ r2; return; } /*-----------------------------------------------------------------------*/ /* segment end contributions for ext. thin wire approx. */ void gxx( long double zz, long double rh, long double a, long double a2, long double xk, int ira, complex long double *g1, complex long double *g1p, complex long double *g2, complex long double *g2p, complex long double *g3, complex long double *gzp ) { long double r, r2, r4, rk, rk2, rh2, t1, t2; complex long double gz, c1, c2, c3; r2= zz* zz+ rh* rh; r= sqrtl( r2); r4= r2* r2; rk= xk* r; rk2= rk* rk; rh2= rh* rh; t1=.25* a2* rh2/ r4; t2=.5* a2/ r2; c1= cmplx(1.0, rk); c2=3.* c1- rk2; c3= cmplx(6.0, rk)* rk2-15.* c1; gz= cmplx( cosl( rk),- sinl( rk))/ r; *g2= gz*(1.+ t1* c2); *g1= *g2- t2* c1* gz; gz= gz/ r2; *g2p= gz*( t1* c3- c1); *gzp= t2* c2* gz; *g3= *g2p+ *gzp; *g1p= *g3* zz; if( ira != 1) { *g3=( *g3+ *gzp)* rh; *gzp=- zz* c1* gz; if( rh <= 1.0e-10) { *g2=0.; *g2p=0.; return; } *g2= *g2/ rh; *g2p= *g2p* zz/ rh; return; } /* if( ira != 1) */ t2=.5* a; *g2=- t2* c1* gz; *g2p= t2* gz* c2/ r2; *g3= rh2* *g2p- a* gz* c1; *g2p= *g2p* zz; *gzp=- zz* c1* gz; return; } /*-----------------------------------------------------------------------*/ /* hfk computes the h field of a uniform current */ /* filament by numerical integration */ void hfk( long double el1, long double el2, long double rhk, long double zpkx, long double *sgr, long double *sgi ) { int nx = 1, nma = 65536, nts = 4; int ns, nt; int flag = TRUE; long double rx = 1.0e-4; long double z, ze, s, ep, zend, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; long double g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; long double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; zpka= zpkx; rhks= rhk* rhk; z= el1; ze= el2; s= ze- z; ep= s/(10.* nma); zend= ze- ep; *sgr=0.0; *sgi=0.0; ns= nx; nt=0; gh( z, &g1r, &g1i); while( TRUE ) { if( flag ) { dz= s/ ns; zp= z+ dz; if( zp > ze ) { dz= ze- z; if( fabsl(dz) <= ep ) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } } dzot= dz*.5; zp= z+ dzot; gh( zp, &g3r, &g3i); zp= z+ dz; gh( zp, &g5r, &g5i); } /* if( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if( nt >= nts) if( ns > nx) { ns= ns/2; nt=1; } flag = TRUE; continue; } /* if( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gh( zp, &g2r, &g2i); zp= z+ dz*0.75; gh( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if( (te2i > rx) || (te2r > rx) ) { nt=0; if( ns >= nma) fprintf( output_fp, "\n STEP SIZE LIMITED AT Z= %10.5LF", z ); else { ns= ns*2; dz= s/ ns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = FALSE; continue; } } /* if( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if( nt >= nts) if( ns > nx) { ns= ns/2; nt=1; } flag = TRUE; } /* while( TRUE ) */ } /*-----------------------------------------------------------------------*/ /* hintg computes the h field of a patch current */ void hintg( long double xi, long double yi, long double zi ) { int ip; long double rx, ry, rfl, xymag, pxx, pyy, cth; long double rz, rsq, r, rk, cr, sr, t1zr, t2zr; complex long double gam, f1x, f1y, f1z, f2x, f2y, f2z, rrv, rrh; rx= xi- xj; ry= yi- yj; rfl=-1.; exk=CPLX_00; eyk=CPLX_00; ezk=CPLX_00; exs=CPLX_00; eys=CPLX_00; ezs=CPLX_00; for( ip = 1; ip <= ksymp; ip++ ) { rfl=- rfl; rz= zi- zj* rfl; rsq= rx* rx+ ry* ry+ rz* rz; if( rsq < 1.0e-20) continue; r = sqrtl( rsq ); rk= TP* r; cr= cosl( rk); sr= sinl( rk); gam=-( cmplx(cr,-sr)+rk*cmplx(sr,cr) )/( FPI*rsq*r )* s; exc= gam* rx; eyc= gam* ry; ezc= gam* rz; t1zr= t1zj* rfl; t2zr= t2zj* rfl; f1x= eyc* t1zr- ezc* t1yj; f1y= ezc* t1xj- exc* t1zr; f1z= exc* t1yj- eyc* t1xj; f2x= eyc* t2zr- ezc* t2yj; f2y= ezc* t2xj- exc* t2zr; f2z= exc* t2yj- eyc* t2xj; if( ip != 1) { if( iperf == 1) { f1x=- f1x; f1y=- f1y; f1z=- f1z; f2x=- f2x; f2y=- f2y; f2z=- f2z; } else { xymag= sqrtl( rx* rx+ ry* ry); if( xymag <= 1.0e-6) { pxx=0.; pyy=0.; cth=1.; rrv=CPLX_10; } else { pxx=- ry/ xymag; pyy= rx/ xymag; cth= rz/ r; rrv= csqrtl(1.- zrati* zrati*(1.- cth* cth)); } /* if( xymag <= 1.0e-6) */ rrh= zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); gam=( f1x* pxx+ f1y* pyy)*( rrv- rrh); f1x= f1x* rrh+ gam* pxx; f1y= f1y* rrh+ gam* pyy; f1z= f1z* rrh; gam=( f2x* pxx+ f2y* pyy)*( rrv- rrh); f2x= f2x* rrh+ gam* pxx; f2y= f2y* rrh+ gam* pyy; f2z= f2z* rrh; } /* if( iperf == 1) */ } /* if( ip != 1) */ exk += f1x; eyk += f1y; ezk += f1z; exs += f2x; eys += f2y; ezs += f2z; } /* for( ip = 1; ip <= ksymp; ip++ ) */ return; } /*-----------------------------------------------------------------------*/ /* hsfld computes the h field for constant, sine, and */ /* cosine current on a segment including ground effects. */ void hsfld( long double xi, long double yi, long double zi, long double ai ) { int ip; long double xij, yij, rfl, salpr, zij, zp, rhox, rhoy, rhoz, rh, phx; long double phy, phz, rmag, xymag, xspec, yspec, rhospc, px, py, cth; complex long double hpk, hps, hpc, qx, qy, qz, rrv, rrh, zratx; xij= xi- xj; yij= yi- yj; rfl=-1.; for( ip = 0; ip < ksymp; ip++ ) { rfl=- rfl; salpr= salpj* rfl; zij= zi- rfl* zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh= sqrtl( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai); if( rh <= 1.0e-10) { exk=0.; eyk=0.; ezk=0.; exs=0.; eys=0.; ezs=0.; exc=0.; eyc=0.; ezc=0.; continue; } rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; phx= sabj* rhoz- salpr* rhoy; phy= salpr* rhox- cabj* rhoz; phz= cabj* rhoy- sabj* rhox; hsflx( s, rh, zp, &hpk, &hps, &hpc); if( ip == 1 ) { if( iperf != 1 ) { zratx= zrati; rmag= sqrtl( zp* zp+ rh* rh); xymag= sqrtl( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if( nradl != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrtl( xspec* xspec+ yspec* yspec+ t2* t2); if( rhospc <= scrwl) { rrv= t1* rhospc* logl( rhospc/ t2); zratx=( rrv* zrati)/( ETA* zrati+ rrv); } } /* calculation of reflection coefficients when ground is specified. */ if( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=CPLX_10; } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; rrv= csqrtl(1.- zratx* zratx*(1.- cth* cth)); } rrh= zratx* cth; rrh=-( rrh- rrv)/( rrh+ rrv); rrv= zratx* rrv; rrv=( cth- rrv)/( cth+ rrv); qy=( phx* px+ phy* py)*( rrv- rrh); qx= qy* px+ phx* rrh; qy= qy* py+ phy* rrh; qz= phz* rrh; exk= exk- hpk* qx; eyk= eyk- hpk* qy; ezk= ezk- hpk* qz; exs= exs- hps* qx; eys= eys- hps* qy; ezs= ezs- hps* qz; exc= exc- hpc* qx; eyc= eyc- hpc* qy; ezc= ezc- hpc* qz; continue; } /* if( iperf != 1 ) */ exk= exk- hpk* phx; eyk= eyk- hpk* phy; ezk= ezk- hpk* phz; exs= exs- hps* phx; eys= eys- hps* phy; ezs= ezs- hps* phz; exc= exc- hpc* phx; eyc= eyc- hpc* phy; ezc= ezc- hpc* phz; continue; } /* if( ip == 1 ) */ exk= hpk* phx; eyk= hpk* phy; ezk= hpk* phz; exs= hps* phx; eys= hps* phy; ezs= hps* phz; exc= hpc* phx; eyc= hpc* phy; ezc= hpc* phz; } /* for( ip = 0; ip < ksymp; ip++ ) */ return; } /*-----------------------------------------------------------------------*/ /* calculates h field of sine cosine, and constant current of segment */ void hsflx( long double s, long double rh, long double zpx, complex long double *hpk, complex long double *hps, complex long double *hpc ) { long double r1, r2, zp, z2a, hss, dh, z1; long double rhz, dk, cdk, sdk, hkr, hki, rh2; complex long double fjk, ekr1, ekr2, t1, t2, cons; fjk = -TPJ; if( rh >= 1.0e-10) { if( zpx >= 0.) { zp= zpx; hss=1.; } else { zp=- zpx; hss=-1.; } dh=.5* s; z1= zp+ dh; z2a= zp- dh; if( z2a >= 1.0e-7) rhz= rh/ z2a; else rhz=1.; dk= TP* dh; cdk= cosl( dk); sdk= sinl( dk); hfk(- dk, dk, rh* TP, zp* TP, &hkr, &hki); *hpk= cmplx( hkr, hki); if( rhz >= 1.0e-3) { rh2= rh* rh; r1= sqrtl( rh2+ z1* z1); r2= sqrtl( rh2+ z2a* z2a); ekr1= cexp( fjk* r1); ekr2= cexp( fjk* r2); t1= z1* ekr1/ r1; t2= z2a* ekr2/ r2; *hps=( cdk*( ekr2- ekr1)- CPLX_01* sdk*( t2+ t1))* hss; *hpc=- sdk*( ekr2+ ekr1)- CPLX_01* cdk*( t2- t1); cons=- CPLX_01/(2.* TP* rh); *hps= cons* *hps; *hpc= cons* *hpc; return; } /* if( rhz >= 1.0e-3) */ ekr1= cmplx( cdk, sdk)/( z2a* z2a); ekr2= cmplx( cdk,- sdk)/( z1* z1); t1= TP*(1./ z1-1./ z2a); t2= cexp( fjk* zp)* rh/ PI8; *hps= t2*( t1+( ekr1+ ekr2)* sdk)* hss; *hpc= t2*(- CPLX_01* t1+( ekr1- ekr2)* cdk); return; } /* if( rh >= 1.0e-10) */ *hps=CPLX_00; *hpc=CPLX_00; *hpk=CPLX_00; return; } /*-----------------------------------------------------------------------*/ /* nefld computes the near field at specified points in space after */ /* the structure currents have been computed. */ void nefld( long double xob, long double yob, long double zob, complex long double *ex, complex long double *ey, complex long double *ez ) { int i, ix, ipr, iprx, jc, ipa; long double zp, xi, ax; complex long double acx, bcx, ccx; *ex=CPLX_00; *ey=CPLX_00; *ez=CPLX_00; ax=0.; if( n != 0) { for( i = 0; i < n; i++ ) { xj= xob- x[i]; yj= yob- y[i]; zj= zob- z[i]; zp= cab[i]* xj+ sab[i]* yj+ salp[i]* zj; if( fabsl( zp) > 0.5001* si[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= bi[i]; if( zp > 0.9* xj* xj) continue; ax= xj; break; } /* for( i = 0; i < n; i++ ) */ for( i = 0; i < n; i++ ) { ix = i+1; s= si[i]; b= bi[i]; xj= x[i]; yj= y[i]; zj= z[i]; cabj= cab[i]; sabj= sab[i]; salpj= salp[i]; if( iexk != 0) { ipr= icon1[i]; if( ipr < 0 ) { ipr = -ipr; iprx = ipr-1; if( -icon1[iprx] != ix ) ind1=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr < 0 ) */ else if( ipr == 0 ) ind1=1; else { iprx = ipr-1; if( ipr != ix ) { if( icon2[iprx] != ix ) ind1=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr != ix ) */ else { if( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= icon2[i]; if( ipr < 0 ) { ipr = -ipr; iprx = ipr-1; if( -icon2[iprx] != ix ) ind1=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.0e-6) ) ind1=2; else ind1=0; } } /* if( ipr < 0 ) */ else if( ipr == 0 ) ind2=1; else { iprx = ipr-1; if( ipr != ix ) { if( icon1[iprx] != ix ) ind2=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.0e-6) ) ind2=2; else ind2=0; } } /* if( ipr != (i+1) ) */ else { if( cabj* cabj+ sabj* sabj > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if( iexk != 0) */ efld( xob, yob, zob, ax,1); acx= cmplx( air[i], aii[i]); bcx= cmplx( bir[i], bii[i]); ccx= cmplx( cir[i], cii[i]); *ex += exk* acx+ exs* bcx+ exc* ccx; *ey += eyk* acx+ eys* bcx+ eyc* ccx; *ez += ezk* acx+ ezs* bcx+ ezc* ccx; } /* for( i = 0; i < n; i++ ) */ if( m == 0) return; } /* if( n != 0) */ jc= n-1; for( i = 0; i < m; i++ ) { s= pbi[i]; xj= px[i]; yj= py[i]; zj= pz[i]; t1xj= t1x[i]; t1yj= t1y[i]; t1zj= t1z[i]; t2xj= t2x[i]; t2yj= t2y[i]; t2zj= t2z[i]; jc += 3; acx= t1xj* cur[jc-2]+ t1yj* cur[jc-1]+ t1zj* cur[jc]; bcx= t2xj* cur[jc-2]+ t2yj* cur[jc-1]+ t2zj* cur[jc]; for( ipa = 0; ipa < ksymp; ipa++ ) { ipgnd= ipa+1; unere( xob, yob, zob); *ex= *ex+ acx* exk+ bcx* exs; *ey= *ey+ acx* eyk+ bcx* eys; *ez= *ez+ acx* ezk+ bcx* ezs; } } /* for( i = 0; i < m; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* compute near e or h fields over a range of points */ void nfpat( void ) { int i, j, kk; long double znrt, cth=0., sth=0., ynrt, cph=0., sph=0., xnrt, xob, yob; long double zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, xxx; complex long double ex, ey, ez; if( nfeh != 1) { fprintf( output_fp, "\n\n\n" " " "-------- NEAR ELECTRIC FIELDS --------\n" " ------- LOCATION ------- ------- EX ------ ------- EY ------ ------- EZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" ); } else { fprintf( output_fp, "\n\n\n" " " "-------- NEAR MAGNETIC FIELDS ---------\n\n" " ------- LOCATION ------- ------- HX ------ ------- HY ------ ------- HZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS AMPS/M DEGREES AMPS/M DEGREES AMPS/M DEGREES" ); } znrt= znr- dznr; for( i = 0; i < nrz; i++ ) { znrt += dznr; if( near != 0) { cth= cosl( TA* znrt); sth= sinl( TA* znrt); } ynrt= ynr- dynr; for( j = 0; j < nry; j++ ) { ynrt += dynr; if( near != 0) { cph= cosl( TA* ynrt); sph= sinl( TA* ynrt); } xnrt= xnr- dxnr; for( kk = 0; kk < nrx; kk++ ) { xnrt += dxnr; if( near != 0) { xob= xnrt* sth* cph; yob= xnrt* sth* sph; zob= xnrt* cth; } else { xob= xnrt; yob= ynrt; zob= znrt; } tmp1= xob/ wlam; tmp2= yob/ wlam; tmp3= zob/ wlam; if( nfeh != 1) nefld( tmp1, tmp2, tmp3, &ex, &ey, &ez); else nhfld( tmp1, tmp2, tmp3, &ex, &ey, &ez); tmp1= cabsl( ex); tmp2= cang( ex); tmp3= cabsl( ey); tmp4= cang( ey); tmp5= cabsl( ez); tmp6= cang( ez); fprintf( output_fp, "\n" " %9.4LF %9.4LF %9.4LF %11.4LE %7.2LF %11.4LE %7.2LF %11.4LE %7.2LF", xob, yob, zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); if( iplp1 != 2) continue; if( iplp4 < 0 ) xxx= xob; else if( iplp4 == 0 ) xxx= yob; else xxx= zob; if( iplp2 == 2) { switch( iplp3 ) { case 1: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp1, tmp2 ); break; case 2: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp3, tmp4 ); break; case 3: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp5, tmp6 ); break; case 4: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n", xxx, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); } continue; } if( iplp2 != 1) continue; switch( iplp3 ) { case 1: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ex), cimagl(ex) ); break; case 2: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ey), cimagl(ey) ); break; case 3: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ez), cimagl(ez) ); break; case 4: fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n", xxx,creall(ex),cimagl(ex),creall(ey),cimagl(ey),creall(ez),cimagl(ez) ); } } /* for( kk = 0; kk < nrx; kk++ ) */ } /* for( j = 0; j < nry; j++ ) */ } /* for( i = 0; i < nrz; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* nhfld computes the near field at specified points in space after */ /* the structure currents have been computed. */ void nhfld( long double xob, long double yob, long double zob, complex long double *hx, complex long double *hy, complex long double *hz ) { int i, jc; long double ax, zp; complex long double acx, bcx, ccx; *hx=CPLX_00; *hy=CPLX_00; *hz=CPLX_00; ax=0.; if( n != 0) { for( i = 0; i < n; i++ ) { xj= xob- x[i]; yj= yob- y[i]; zj= zob- z[i]; zp= cab[i]* xj+ sab[i]* yj+ salp[i]* zj; if( fabsl( zp) > 0.5001* si[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= bi[i]; if( zp > 0.9* xj* xj) continue; ax= xj; break; } for( i = 0; i < n; i++ ) { s= si[i]; b= bi[i]; xj= x[i]; yj= y[i]; zj= z[i]; cabj= cab[i]; sabj= sab[i]; salpj= salp[i]; hsfld( xob, yob, zob, ax); acx= cmplx( air[i], aii[i]); bcx= cmplx( bir[i], bii[i]); ccx= cmplx( cir[i], cii[i]); *hx += exk* acx+ exs* bcx+ exc* ccx; *hy += eyk* acx+ eys* bcx+ eyc* ccx; *hz += ezk* acx+ ezs* bcx+ ezc* ccx; } if( m == 0) return; } /* if( n != 0) */ jc= n-1; for( i = 0; i < m; i++ ) { s= pbi[i]; xj= px[i]; yj= py[i]; zj= pz[i]; t1xj= t1x[i]; t1yj= t1y[i]; t1zj= t1z[i]; t2xj= t2x[i]; t2yj= t2y[i]; t2zj= t2z[i]; hintg( xob, yob, zob); jc += 3; acx= t1xj* cur[jc-2]+ t1yj* cur[jc-1]+ t1zj* cur[jc]; bcx= t2xj* cur[jc-2]+ t2yj* cur[jc-1]+ t2zj* cur[jc]; *hx= *hx+ acx* exk+ bcx* exs; *hy= *hy+ acx* eyk+ bcx* eys; *hz= *hz+ acx* ezk+ bcx* ezs; } return; } /*-----------------------------------------------------------------------*/ /* integrate over patches at wire connection point */ void pcint( long double xi, long double yi, long double zi, long double cabi, long double sabi, long double salpi, complex long double *e ) { int nint, i1, i2; long double d, ds, da, gcon, fcon, xxj, xyj, xzj, xs, s1; long double xss, yss, zss, s2x, s2, g1, g2, g3, g4, f2, f1; complex long double e1, e2, e3, e4, e5, e6, e7, e8, e9; nint = 10; d= sqrtl( s)*.5; ds=4.* d/ (long double) nint; da= ds* ds; gcon=1./ s; fcon=1./(2.* TP* d); xxj= xj; xyj= yj; xzj= zj; xs= s; s= da; s1= d+ ds*.5; xss= xj+ s1*( t1xj+ t2xj); yss= yj+ s1*( t1yj+ t2yj); zss= zj+ s1*( t1zj+ t2zj); s1= s1+ d; s2x= s1; e1=CPLX_00; e2=CPLX_00; e3=CPLX_00; e4=CPLX_00; e5=CPLX_00; e6=CPLX_00; e7=CPLX_00; e8=CPLX_00; e9=CPLX_00; for( i1 = 0; i1 < nint; i1++ ) { s1= s1- ds; s2= s2x; xss= xss- ds* t1xj; yss= yss- ds* t1yj; zss= zss- ds* t1zj; xj= xss; yj= yss; zj= zss; for( i2 = 0; i2 < nint; i2++ ) { s2= s2- ds; xj= xj- ds* t2xj; yj= yj- ds* t2yj; zj= zj- ds* t2zj; unere( xi, yi, zi); exk= exk* cabi+ eyk* sabi+ ezk* salpi; exs= exs* cabi+ eys* sabi+ ezs* salpi; g1=( d+ s1)*( d+ s2)* gcon; g2=( d- s1)*( d+ s2)* gcon; g3=( d- s1)*( d- s2)* gcon; g4=( d+ s1)*( d- s2)* gcon; f2=( s1* s1+ s2* s2)* TP; f1= s1/ f2-( g1- g2- g3+ g4)* fcon; f2= s2/ f2-( g1+ g2- g3- g4)* fcon; e1= e1+ exk* g1; e2= e2+ exk* g2; e3= e3+ exk* g3; e4= e4+ exk* g4; e5= e5+ exs* g1; e6= e6+ exs* g2; e7= e7+ exs* g3; e8= e8+ exs* g4; e9= e9+ exk* f1+ exs* f2; } /* for( i2 = 0; i2 < nint; i2++ ) */ } /* for( i1 = 0; i1 < nint; i1++ ) */ e[0]= e1; e[1]= e2; e[2]= e3; e[3]= e4; e[4]= e5; e[5]= e6; e[6]= e7; e[7]= e8; e[8]= e9; xj= xxj; yj= xyj; zj= xzj; s= xs; return; } /*-----------------------------------------------------------------------*/ /* calculates the electric field due to unit current */ /* in the t1 and t2 directions on a patch */ void unere( long double xob, long double yob, long double zob ) { long double zr, t1zr, t2zr, rx, ry, rz, r, tt1; long double tt2, rt, xymag, px, py, cth, r2; complex long double er, q1, q2, rrv, rrh, edp; zr= zj; t1zr= t1zj; t2zr= t2zj; if( ipgnd == 2) { zr=- zr; t1zr=- t1zr; t2zr=- t2zr; } rx= xob- xj; ry= yob- yj; rz= zob- zr; r2= rx* rx+ ry* ry+ rz* rz; if( r2 <= 1.0e-20) { exk=CPLX_00; eyk=CPLX_00; ezk=CPLX_00; exs=CPLX_00; eys=CPLX_00; ezs=CPLX_00; return; } r= sqrtl( r2); tt1=- TP* r; tt2= tt1* tt1; rt= r2* r; er= cmplx( sinl( tt1),- cosl( tt1))*( CONST2* s); q1= cmplx( tt2-1., tt1)* er/ rt; q2= cmplx(3.- tt2,-3.* tt1)* er/( rt* r2); er = q2*( t1xj* rx+ t1yj* ry+ t1zr* rz); exk= q1* t1xj+ er* rx; eyk= q1* t1yj+ er* ry; ezk= q1* t1zr+ er* rz; er= q2*( t2xj* rx+ t2yj* ry+ t2zr* rz); exs= q1* t2xj+ er* rx; eys= q1* t2yj+ er* ry; ezs= q1* t2zr+ er* rz; if( ipgnd == 1) return; if( iperf == 1) { exk=- exk; eyk=- eyk; ezk=- ezk; exs=- exs; eys=- eys; ezs=- ezs; return; } xymag= sqrtl( rx* rx+ ry* ry); if( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=CPLX_10; } else { px=- ry/ xymag; py= rx/ xymag; cth= rz/ sqrtl( xymag* xymag+ rz* rz); rrv= csqrtl(1.- zrati* zrati*(1.- cth* cth)); } rrh= zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); edp=( exk* px+ eyk* py)*( rrh- rrv); exk= exk* rrv+ edp* px; eyk= eyk* rrv+ edp* py; ezk= ezk* rrv; edp=( exs* px+ eys* py)*( rrh- rrv); exs= exs* rrv+ edp* px; eys= eys* rrv+ edp* py; ezs= ezs* rrv; return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/main.c0000644000175000017500000013735510310210755015073 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /*** common data are implemented as global variables ***/ /* common /data/ */ int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ int *icon1, *icon2, *itag; long double *x, *y, *z, *si, *bi; long double *x2, *y2, *z2, *cab, *sab, *salp; long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; long double *px, *py, *pz, *pbi, *psalp; long double wlam; /* common /cmb/ */ complex long double *cm; /* common /matpar/ */ int icase, npblk, nlast; int imat, nbbx, npbx, nlbx, nbbl, npbl, nlbl; /* common /save/ */ int *ip; long double epsr, sig, scrwlt, scrwrt, fmhz; /* common /crnt/ */ long double *air, *aii, *bir, *bii, *cir, *cii; complex long double *cur; /* common /gnd/ */ int ksymp, ifar, iperf, nradl; long double t2, cl, ch, scrwl, scrwr; complex long double zrati, zrati2, t1, frati; /* common /zload/ */ int nload; complex long double *zarray; /* common /yparm/ */ int ncoup, icoup, *nctag, *ncseg; complex long double *y11a, *y12a; /* common /segj/ */ int *jco, jsno, nscon, maxcon; /* Max. no. connections */ long double *ax, *bx, *cx; /* common /vsorc/ */ int *ivqd, *isant, *iqds, nvqd, nsant, nqds; complex long double *vqd, *vqds, *vsant; /* common /netcx/ */ int masym, neq, npeq, neq2, nonet, ntsol, nprint; int *iseg1, *iseg2, *ntyp; long double *x11r, *x11i, *x12r; long double *x12i, *x22r, *x22i; long double pin, pnls; complex long double zped; /* common /fpat/ */ int near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp, inor, iax, ixtyp; long double thets, phis, dth, dph, rfld, gnor, clt, cht, epsr2, sig2; long double xpr6, pinr, pnlr, ploss, xnr, ynr, znr, dxnr, dynr, dznr; /*common /ggrid/ */ extern int nxa[3], nya[3]; extern long double dxa[3], dya[3], xsa[3], ysa[3]; extern complex long double epscf, *ar1, *ar2, *ar3; /* common /gwav/ */ long double r1, r2, zmh, zph; complex long double u, u2, xx1, xx2; /* common /plot/ */ int iplp1, iplp2, iplp3, iplp4; /* common /dataj/ */ int iexk, ind1, indd1, ind2, indd2, ipgnd; long double s, b, xj, yj, zj, cabj, sabj, salpj, rkh; long double t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; complex long double exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* common /smat/ */ int nop; /* My addition */ complex long double *ssx; /* common /incom/ */ int isnor; long double xo, yo, zo, sn, xsn, ysn; /* common /tmi/ */ int ija; /* changed to ija to avoid conflict */ long double zpk, rkb2; /*common /tmh/ */ long double zpka, rhks; /* pointers to input/output files */ FILE *input_fp=NULL, *output_fp=NULL, *plot_fp=NULL; /* signal handler */ static void sig_handler( int signal ); /*-------------------------------------------------------------------*/ int main( int argc, char **argv ) { char infile[81] = "", otfile[81] = ""; char ain[3], line_buf[81]; /* input card mnemonic list */ #define NUM_CMNDS 20 char *atst[NUM_CMNDS] = { "FR", "LD", "GN", "EX", "NT", "TL", \ "XQ", "GD", "RP", "NX", "PT", "KH", \ "NE", "NH", "PQ", "EK", "CP", "PL", \ "EN", "WG" }; char *hpol[3] = { "LINEAR", "RIGHT", "LEFT" }; char *pnet[3] = { " ", "STRAIGHT", " CROSSED" }; int *ldtyp, *ldtag, *ldtagf, *ldtagt; int ifrtmw, ifrtmp, mpcnt, ib11=0, ic11=0, id11=0, ix11, igo, nfrq; int iexk, jump, iptflg, iptflq, iped, iflow, itmp1, iresrv; int itmp3, itmp2, itmp4, nthi=0, nphi=0, iptag=0, iptagf=0, iptagt=0; int iptaq=0, iptaqf=0, iptaqt=0, nphic=0, inc=0; int i, j, itmp5, nthic=0, mhz=0, ifrq=0, isave=0; int igox, /* used in place of "igo" in freq loop */ next_job, /* start next job (next sructure) flag */ idx, /* general purpose index */ ain_num, /* ain mnemonic as a number */ jmp_iloop, /* jump to input loop flag */ jmp_floop=0,/* jump to freq. loop flag */ mreq; /* Size req. for malloc's */ long double *zlr, *zli, *zlc, *fnorm; long double *xtemp, *ytemp, *ztemp, *sitemp, *bitemp; long double fmhz1, rkh, tmp1, delfrq=0., tmp2, tmp3, tmp4, tmp5, tmp6; long double xpr1=0., xpr2=0., xpr3=0., xpr4=0., xpr5=0.; long double zpnorm=0., thetis=0., phiss=0., extim; long double tim1, tim, tim2, etha, fr, fr2, cmag, ph, ethm, ephm, epha; complex long double eth, eph, curi, ex, ey, ez, epsc; /* getopt() variables */ extern char *optarg; extern int optind, opterr, optopt; int option; /*** signal handler related code ***/ /* new and old actions for sigaction() */ struct sigaction sa_new, sa_old; /* initialize new actions */ sa_new.sa_handler = sig_handler; sigemptyset( &sa_new.sa_mask ); sa_new.sa_flags = 0; /* register function to handle signals */ sigaction( SIGINT, &sa_new, &sa_old ); sigaction( SIGSEGV, &sa_new, 0 ); sigaction( SIGFPE, &sa_new, 0 ); sigaction( SIGTERM, &sa_new, 0 ); sigaction( SIGABRT, &sa_new, 0 ); /*** command line arguments handler ***/ if( argc == 1 ) { usage(); exit(-1); } /* process command line options */ while( (option = getopt(argc, argv, "i:o:hv") ) != -1 ) { switch( option ) { case 'i' : /* specify input file name */ if( strlen(optarg) > 75 ) abort_on_error(-1); strcpy( infile, optarg ); break; case 'o' : /* specify output file name */ if( strlen(optarg) > 75 ) abort_on_error(-2); strcpy( otfile, optarg ); break; case 'h' : /* print usage and exit */ usage(); exit(0); case 'v' : /* print nec2c version */ puts( version ); exit(0); default: /* print usage and exit */ usage(); exit(-1); } /* end of switch( option ) */ } /* while( (option = getopt(argc, argv, "i:o:hv") ) != -1 ) */ /*** open input file ***/ if( (input_fp = fopen(infile, "r")) == NULL ) { char mesg[88] = "nec2c: "; strcat( mesg, infile ); perror( mesg ); exit(-1); } /* make an output file name if not */ /* specified by user on invocation */ if( strlen( otfile ) == 0 ) { /* strip file name extension if there is one */ idx = 0; while( (infile[++idx] != '.') && (infile[idx] != '\0') ); infile[idx] = '\0'; /* make the output file name from input file */ strcpy( otfile, infile ); strcat( otfile, ".out" ); /* add extension */ } /* open output file */ if( (output_fp = fopen(otfile, "w")) == NULL ) { char mesg[88] = "nec2c: "; strcat( mesg, otfile ); perror( mesg ); exit(-1); } /*** here we had code to read interactively input/output ***/ /*** file names. this is done non-interactively above. ***/ secnds( &extim ); /* Null buffer pointers */ /* type int */ icon1 = icon2 = ncseg = nctag = ivqd = isant = iqds = NULL; itag = ip = ldtyp = ldtag = ldtagf = ldtagt = jco = NULL; /* type long double */ air = aii = bir = bii = cir = cii = zlr = zli = zlc = fnorm = NULL; ax = bx = cx = xtemp = ytemp = ztemp = sitemp = bitemp = NULL; x = y = z = si = bi = x2 = y2 = z2 = cab = sab = salp = NULL; t1x = t1y = t1z = t2x = t2y = t2z = px = py = pz = pbi = psalp = NULL; /* type complex long double */ ar1 = ar2 = ar3 = cur = cm = zarray = NULL; y11a = y12a = vqd = vqds = vsant = ssx = NULL; /* Allocate some buffers */ mem_alloc( (void *)&ar1, sizeof(complex long double)*11*10*4 ); mem_alloc( (void *)&ar2, sizeof(complex long double)*17*5*4 ); mem_alloc( (void *)&ar3, sizeof(complex long double)*9*8*4 ); /* l_1: */ /* main execution loop, exits at various points */ /* depending on error conditions or end of jobs */ while( TRUE ) { ifrtmw=0; ifrtmp=0; /* print the nec2c header to output file */ fprintf( output_fp, "\n\n\n" " " " __________________________________________\n" " " "| |\n" " " "| NUMERICAL ELECTROMAGNETICS CODE (nec2c) |\n" " " "| Translated to 'C' in Double Precision |\n" " " "|__________________________________________|\n" ); /* read a line from input file */ if( load_line(line_buf, input_fp) == EOF ) abort_on_error(-3); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* if its a "cm" or "ce" card start reading comments */ if( (strcmp(ain, "CM") == 0) || (strcmp(ain, "CE") == 0) ) { fprintf( output_fp, "\n\n\n" " " "---------------- COMMENTS ----------------\n" ); /* write comment to output file */ fprintf( output_fp, " %s\n", &line_buf[2] ); /* Keep reading till a non "CM" card */ while( strcmp(ain, "CM") == 0 ) { /* read a line from input file */ if( load_line(line_buf, input_fp) == EOF ) abort_on_error(-3); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* write comment to output file */ fprintf( output_fp, " %s\n", &line_buf[2] ); } /* while( strcmp(ain, "CM") == 0 ) */ /* no "ce" card at end of comments */ if( strcmp(ain, "CE") != 0 ) { fprintf( output_fp, "\n\n ERROR: INCORRECT LABEL FOR A COMMENT CARD" ); abort_on_error(-4); } } /* if( strcmp(ain, "CM") == 0 ... */ else rewind( input_fp ); /* Free some buffer pointers. * These are allocated by realloc() * so they need to be free()'d * before reallocation for a new job */ free_ptr( (void *)&itag ); free_ptr( (void *)&fnorm ); free_ptr( (void *)&ldtyp ); free_ptr( (void *)&ldtag ); free_ptr( (void *)&ldtagf ); free_ptr( (void *)&ldtagt ); free_ptr( (void *)&zlr ); free_ptr( (void *)&zli ); free_ptr( (void *)&zlc ); free_ptr( (void *)&jco ); free_ptr( (void *)&ax ); free_ptr( (void *)&bx ); free_ptr( (void *)&cx ); free_ptr( (void *)&ivqd ); free_ptr( (void *)&iqds ); free_ptr( (void *)&vqd ); free_ptr( (void *)&vqds ); free_ptr( (void *)&isant ); free_ptr( (void *)&vsant ); free_ptr( (void *)&x ); free_ptr( (void *)&y ); free_ptr( (void *)&z ); free_ptr( (void *)&x2 ); free_ptr( (void *)&y2 ); free_ptr( (void *)&z2 ); free_ptr( (void *)&px ); free_ptr( (void *)&py ); free_ptr( (void *)&pz ); free_ptr( (void *)&t1x ); free_ptr( (void *)&t1y ); free_ptr( (void *)&t1z ); free_ptr( (void *)&t2x ); free_ptr( (void *)&t2y ); free_ptr( (void *)&t2z ); free_ptr( (void *)&si ); free_ptr( (void *)&bi ); free_ptr( (void *)&cab ); free_ptr( (void *)&sab ); free_ptr( (void *)&salp ); free_ptr( (void *)&pbi ); free_ptr( (void *)&psalp ); /* initializations etc from original fortran code */ mpcnt=0; imat=0; /* set up geometry data in subroutine datagn */ datagn(); iflow=1; /* Allocate some buffers */ mreq = npm * sizeof(long double); mem_alloc( (void *)&air, mreq ); mem_alloc( (void *)&aii, mreq ); mem_alloc( (void *)&bir, mreq ); mem_alloc( (void *)&bii, mreq ); mem_alloc( (void *)&cir, mreq ); mem_alloc( (void *)&cii, mreq ); mem_alloc( (void *)&xtemp, mreq ); mem_alloc( (void *)&ytemp, mreq ); mem_alloc( (void *)&ztemp, mreq ); mem_alloc( (void *)&sitemp, mreq ); mem_alloc( (void *)&bitemp, mreq ); mreq = np2m * sizeof(int); mem_alloc( (void *)&ip, mreq ); mreq = np3m * sizeof( complex long double); mem_alloc( (void *)&cur, mreq ); /* Matrix parameters */ if( imat == 0) { neq= n+2*m; neq2=0; ib11=0; ic11=0; id11=0; ix11=0; } fprintf( output_fp, "\n\n\n" ); /* default values for input parameters and flags */ npeq= np+2*mp; iplp1=0; iplp2=0; iplp3=0; iplp4=0; igo=1; nfrq=1; rkh=1.; iexk=0; ixtyp=0; nload=0; nonet=0; near=-1; iptflg=-2; iptflq=-1; ifar=-1; zrati=CPLX_10; iped=0; ncoup=0; icoup=0; fmhz= CVEL; ksymp=1; nradl=0; iperf=0; /* l_14: */ /* main input section, exits at various points */ /* depending on error conditions or end of job */ next_job = FALSE; while( ! next_job ) { jmp_iloop = FALSE; /* main input section - standard read statement - jumps */ /* to appropriate section for specific parameter set up */ readmn( ain, &itmp1, &itmp2, &itmp3, &itmp4, &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6 ); /* If its an "XT" card, exit */ if( strcmp(ain, "XT" ) == 0 ) { fprintf( stderr, "\nnec2c: Exiting after an \"XT\" command in main()\n" ); fprintf( output_fp, "\n\n nec2c: Exiting after an \"XT\" command in main()" ); stop(0); } mpcnt++; fprintf( output_fp, "\n DATA CARD No: %3d " "%s %3d %5d %5d %5d %12.5LE %12.5LE %12.5LE %12.5LE %12.5LE %12.5LE", mpcnt, ain, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); /* identify card id mnemonic (except "ce" and "cm") */ for( ain_num = 0; ain_num < NUM_CMNDS; ain_num++ ) if( strncmp( ain, atst[ain_num], 2) == 0 ) break; /* take action according to card id mnemonic */ switch( ain_num ) { case 0: /* "fr" card, frequency parameters */ ifrq= itmp1; nfrq= itmp2; if( nfrq == 0) nfrq=1; fmhz= tmp1; delfrq= tmp2; if( iped == 1) zpnorm=0.; igo=1; iflow=1; continue; /* continue card input loop */ case 1: /* "ld" card, loading parameters */ { int idx; if( iflow != 3 ) { iflow=3; /* Free loading buffers */ nload=0; free_ptr( (void *)&ldtyp ); free_ptr( (void *)&ldtag ); free_ptr( (void *)&ldtagf ); free_ptr( (void *)&ldtagt ); free_ptr( (void *)&zlr ); free_ptr( (void *)&zli ); free_ptr( (void *)&zlc ); if( igo > 2 ) igo=2; if( itmp1 == -1 ) continue; /* continue card input loop */ } /* Reallocate loading buffers */ nload++; idx = nload * sizeof(int); mem_realloc( (void *)&ldtyp, idx ); mem_realloc( (void *)&ldtag, idx ); mem_realloc( (void *)&ldtagf, idx ); mem_realloc( (void *)&ldtagt, idx ); idx = nload * sizeof(long double); mem_realloc( (void *)&zlr, idx ); mem_realloc( (void *)&zli, idx ); mem_realloc( (void *)&zlc, idx ); idx = nload-1; ldtyp[idx]= itmp1; ldtag[idx]= itmp2; if( itmp4 == 0) itmp4= itmp3; ldtagf[idx]= itmp3; ldtagt[idx]= itmp4; if( itmp4 < itmp3 ) { fprintf( output_fp, "\n\n DATA FAULT ON LOADING CARD No: %d: ITAG " "STEP1: %d IS GREATER THAN ITAG STEP2: %d", nload, itmp3, itmp4 ); stop(-1); } zlr[idx]= tmp1; zli[idx]= tmp2; zlc[idx]= tmp3; } continue; /* continue card input loop */ case 2: /* "gn" card, ground parameters under the antenna */ iflow=4; if( igo > 2) igo=2; if( itmp1 == -1 ) { ksymp=1; nradl=0; iperf=0; continue; /* continue card input loop */ } iperf= itmp1; nradl= itmp2; ksymp=2; epsr= tmp1; sig= tmp2; if( nradl != 0) { if( iperf == 2) { fprintf( output_fp, "\n\n RADIAL WIRE G.S. APPROXIMATION MAY " "NOT BE USED WITH SOMMERFELD GROUND OPTION" ); stop(-1); } scrwlt= tmp3; scrwrt= tmp4; continue; /* continue card input loop */ } epsr2= tmp3; sig2= tmp4; clt= tmp5; cht= tmp6; continue; /* continue card input loop */ case 3: /* "ex" card, excitation parameters */ if( iflow != 5) { /* Free vsource buffers */ free_ptr( (void *)&ivqd ); free_ptr( (void *)&iqds ); free_ptr( (void *)&vqd ); free_ptr( (void *)&vqds ); free_ptr( (void *)&isant ); free_ptr( (void *)&vsant ); nsant=0; nvqd=0; iped=0; iflow=5; if( igo > 3) igo=3; } masym= itmp4/10; if( (itmp1 == 0) || (itmp1 == 5) ) { ixtyp= itmp1; ntsol=0; if( ixtyp != 0) { nvqd++; mem_realloc( (void *)&ivqd, nvqd * sizeof(int) ); mem_realloc( (void *)&iqds, nvqd * sizeof(int) ); mem_realloc( (void *)&vqd, nvqd * sizeof(complex long double) ); mem_realloc( (void *)&vqds, nvqd * sizeof(complex long double) ); { int indx = nvqd-1; ivqd[indx]= isegno( itmp2, itmp3); vqd[indx]= cmplx( tmp1, tmp2); if( cabsl( vqd[indx]) < 1.e-20) vqd[indx] = CPLX_10; iped= itmp4- masym*10; zpnorm= tmp3; if( (iped == 1) && (zpnorm > 0.0) ) iped=2; continue; /* continue card input loop */ } } /* if( ixtyp != 0) */ nsant++; mem_realloc( (void *)&isant, nsant * sizeof(int) ); mem_realloc( (void *)&vsant, nsant * sizeof(complex long double) ); { int indx = nsant-1; isant[indx]= isegno( itmp2, itmp3); vsant[indx]= cmplx( tmp1, tmp2); if( cabsl( vsant[indx]) < 1.e-20) vsant[indx] = CPLX_10; iped= itmp4- masym*10; zpnorm= tmp3; if( (iped == 1) && (zpnorm > 0.0) ) iped=2; continue; /* continue card input loop */ } } /* if( (itmp1 <= 0) || (itmp1 == 5) ) */ if( (ixtyp == 0) || (ixtyp == 5) ) ntsol=0; ixtyp= itmp1; nthi= itmp2; nphi= itmp3; xpr1= tmp1; xpr2= tmp2; xpr3= tmp3; xpr4= tmp4; xpr5= tmp5; xpr6= tmp6; nsant=0; nvqd=0; thetis= xpr1; phiss= xpr2; continue; /* continue card input loop */ case 4: case 5: /* "nt" & "tl" cards, network parameters */ { int idx; if( iflow != 6) { nonet=0; ntsol=0; iflow=6; /* Free network buffers */ free_ptr( (void *)&ntyp ); free_ptr( (void *)&iseg1 ); free_ptr( (void *)&iseg2 ); free_ptr( (void *)&x11r ); free_ptr( (void *)&x11i ); free_ptr( (void *)&x12r ); free_ptr( (void *)&x12i ); free_ptr( (void *)&x22r ); free_ptr( (void *)&x22i ); if( igo > 3) igo=3; if( itmp2 == -1 ) continue; /* continue card input loop */ } /* Re-allocate network buffers */ nonet++; idx = nonet * sizeof(int); mem_realloc( (void *)&ntyp, idx ); mem_realloc( (void *)&iseg1, idx ); mem_realloc( (void *)&iseg2, idx ); idx = nonet * sizeof(long double); mem_realloc( (void *)&x11r, idx ); mem_realloc( (void *)&x11i, idx ); mem_realloc( (void *)&x12r, idx ); mem_realloc( (void *)&x12i, idx ); mem_realloc( (void *)&x22r, idx ); mem_realloc( (void *)&x22i, idx ); idx = nonet-1; if( ain_num == 4 ) ntyp[idx]=1; else ntyp[idx]=2; iseg1[idx]= isegno( itmp1, itmp2); iseg2[idx]= isegno( itmp3, itmp4); x11r[idx]= tmp1; x11i[idx]= tmp2; x12r[idx]= tmp3; x12i[idx]= tmp4; x22r[idx]= tmp5; x22i[idx]= tmp6; if( (ntyp[idx] == 1) || (tmp1 > 0.) ) continue; /* continue card input loop */ ntyp[idx]=3; x11r[idx]=- tmp1; continue; /* continue card input loop */ } case 6: /* "xq" execute card - calc. including radiated fields */ if( ((iflow == 10) && (itmp1 == 0)) || ((nfrq == 1) && (itmp1 == 0) && (iflow > 7)) ) continue; /* continue card input loop */ if( itmp1 == 0) { if( iflow > 7) iflow=11; else iflow=7; } else { ifar=0; rfld=0.; ipd=0; iavp=0; inor=0; iax=0; nth=91; nph=1; thets=0.; phis=0.; dth=1.0; dph=0.; if( itmp1 == 2) phis=90.; if( itmp1 == 3) { nph=2; dph=90.; } } /* if( itmp1 == 0) */ break; case 7: /* "gd" card, ground representation */ epsr2= tmp1; sig2= tmp2; clt= tmp3; cht= tmp4; iflow=9; continue; /* continue card input loop */ case 8: /* "rp" card, standard observation angle parameters */ ifar= itmp1; nth= itmp2; nph= itmp3; if( nth == 0) nth=1; if( nph == 0) nph=1; ipd= itmp4/10; iavp= itmp4- ipd*10; inor= ipd/10; ipd= ipd- inor*10; iax= inor/10; inor= inor- iax*10; if( iax != 0) iax=1; if( ipd != 0) ipd=1; if( (nth < 2) || (nph < 2) || (ifar == 1) ) iavp=0; thets= tmp1; phis= tmp2; dth= tmp3; dph= tmp4; rfld= tmp5; gnor= tmp6; iflow=10; break; case 9: /* "nx" card, do next job */ next_job = TRUE; continue; /* continue card input loop */ case 10: /* "pt" card, print control for current */ iptflg= itmp1; iptag= itmp2; iptagf= itmp3; iptagt= itmp4; if( (itmp3 == 0) && (iptflg != -1) ) iptflg=-2; if( itmp4 == 0) iptagt= iptagf; continue; /* continue card input loop */ case 11: /* "kh" card, matrix integration limit */ rkh= tmp1; if( igo > 2) igo=2; iflow=1; continue; /* continue card input loop */ case 12: case 13: /* "ne"/"nh" cards, near field calculation parameters */ if( ain_num == 13 ) nfeh=1; else nfeh=0; if( (iflow == 8) && (nfrq != 1) ) { fprintf( output_fp, "\n\n WHEN MULTIPLE FREQUENCIES ARE REQUESTED, " "ONLY ONE NEAR FIELD CARD CAN BE USED -" "\n LAST CARD READ WILL BE USED" ); } near= itmp1; nrx= itmp2; nry= itmp3; nrz= itmp4; xnr= tmp1; ynr= tmp2; znr= tmp3; dxnr= tmp4; dynr= tmp5; dznr= tmp6; iflow=8; if( nfrq != 1) continue; /* continue card input loop */ break; case 14: /* "pq" card, write control for charge */ iptflq= itmp1; iptaq= itmp2; iptaqf= itmp3; iptaqt= itmp4; if( (itmp3 == 0) && (iptflq != -1) ) iptflq=-2; if( itmp4 == 0) iptaqt= iptaqf; continue; /* continue card input loop */ case 15: /* "ek" card, extended thin wire kernel option */ iexk=1; if( itmp1 == -1) iexk=0; if( igo > 2) igo=2; iflow=1; continue; /* continue card input loop */ case 16: /* "cp" card, maximum coupling between antennas */ if( iflow != 2) { ncoup=0; free_ptr( (void *)&nctag ); free_ptr( (void *)&ncseg ); free_ptr( (void *)&y11a ); free_ptr( (void *)&y12a ); } icoup=0; iflow=2; if( itmp2 == 0) continue; /* continue card input loop */ ncoup++; mem_realloc( (void *)&nctag, (ncoup) * sizeof(int) ); mem_realloc( (void *)&ncseg, (ncoup) * sizeof(int) ); nctag[ncoup-1]= itmp1; ncseg[ncoup-1]= itmp2; if( itmp4 == 0) continue; /* continue card input loop */ ncoup++; mem_realloc( (void *)&nctag, (ncoup) * sizeof(int) ); mem_realloc( (void *)&ncseg, (ncoup) * sizeof(int) ); nctag[ncoup-1]= itmp3; ncseg[ncoup-1]= itmp4; continue; /* continue card input loop */ case 17: /* "pl" card, plot flags */ iplp1= itmp1; iplp2= itmp2; iplp3= itmp3; iplp4= itmp4; if( plot_fp == NULL ) { char plotfile[81]; /* Make a plot file name */ strcpy( plotfile, infile ); strcat( plotfile, ".plt" ); /* Open plot file */ if( (plot_fp = fopen(plotfile, "w")) == NULL ) { char mesg[88] = "nec2c: "; strcat( mesg, plotfile ); perror( mesg ); exit(-1); } } continue; /* continue card input loop */ case 19: /* "wg" card, not supported */ abort_on_error(-5); default: if( ain_num != 18 ) { fprintf( output_fp, "\n\n FAULTY DATA CARD LABEL AFTER GEOMETRY SECTION" ); stop(-1); } /****************************************************** *** normal exit of nec2c when all jobs complete ok *** ******************************************************/ /* time the process */ secnds( &tmp1 ); tmp1 -= extim; fprintf( output_fp, "\n\n TOTAL RUN TIME: %d msec", (int)tmp1 ); stop(0); } /* switch( ain_num ) */ /************************************** *** end of the main input section. *** *** beginning of frequency do loop *** **************************************/ /* Allocate to normalization buffer */ { int mreq1, mreq2; mreq1 = mreq2 = 0; if( iped ) mreq1 = 4*nfrq * sizeof(long double); if( iptflg >= 2 ) mreq2 = nthi*nphi * sizeof(long double); if( (mreq1 > 0) || (mreq2 > 0) ) { if( mreq1 > mreq2 ) mem_alloc( (void *)&fnorm, mreq1 ); else mem_alloc( (void *)&fnorm, mreq2 ); } } /* igox is used in place of "igo" in the */ /* freq loop. below is a special igox case */ if( ((ain_num == 6) || (ain_num == 8)) && (igo == 5) ) igox = 6; else igox = igo; switch( igox ) { case 1: /* label 41 */ /* Memory allocation for primary interacton matrix. */ iresrv = np2m * (np+2*mp); mem_alloc( (void *)&cm, iresrv * sizeof(complex long double) ); /* Memory allocation for symmetry array */ nop = neq/npeq; mem_alloc( (void *)&ssx, nop*nop * sizeof( complex long double) ); mhz=1; if( (n != 0) && (ifrtmw != 1) ) { ifrtmw=1; for( i = 0; i < n; i++ ) { xtemp[i]= x[i]; ytemp[i]= y[i]; ztemp[i]= z[i]; sitemp[i]= si[i]; bitemp[i]= bi[i]; } } if( (m != 0) && (ifrtmp != 1) ) { ifrtmp=1; for( i = 0; i < m; i++ ) { j = i+n; xtemp[j]= px[i]; ytemp[j]= py[i]; ztemp[j]= pz[i]; bitemp[j]= pbi[i]; } } fmhz1= fmhz; /* irngf is not used (NGF function not implemented) */ if( imat == 0) fblock( npeq, neq, iresrv, ipsym); /* label 42 */ /* frequency do loop */ do { jmp_floop = FALSE; if( mhz != 1) { if( ifrq == 1) fmhz *= delfrq; else fmhz += delfrq; } fr= fmhz/ CVEL; wlam= CVEL/ fmhz; fprintf( output_fp, "\n\n\n" " " "--------- FREQUENCY --------\n" " " "FREQUENCY :%11.4LE MHz\n" " " "WAVELENGTH:%11.4LE Mtr", fmhz, wlam ); fprintf( output_fp, "\n\n" " " "APPROXIMATE INTEGRATION EMPLOYED FOR SEGMENTS \n" " " "THAT ARE MORE THAN %.3LF WAVELENGTHS APART", rkh ); if( iexk == 1) fprintf( output_fp, "\n" " " "THE EXTENDED THIN WIRE KERNEL WILL BE USED" ); /* frequency scaling of geometric parameters */ if( n != 0) { for( i = 0; i < n; i++ ) { x[i]= xtemp[i]* fr; y[i]= ytemp[i]* fr; z[i]= ztemp[i]* fr; si[i]= sitemp[i]* fr; bi[i]= bitemp[i]* fr; } } if( m != 0) { fr2= fr* fr; for( i = 0; i < m; i++ ) { j = i+n; px[i]= xtemp[j]* fr; py[i]= ytemp[j]* fr; pz[i]= ztemp[j]* fr; pbi[i]= bitemp[j]* fr2; } } igo = 2; /* label 46 */ case 2: /* structure segment loading */ fprintf( output_fp, "\n\n\n" " " "------ STRUCTURE IMPEDANCE LOADING ------" ); if( nload != 0) load( ldtyp, ldtag, ldtagf, ldtagt, zlr, zli, zlc ); if( nload == 0 ) fprintf( output_fp, "\n" " " "THIS STRUCTURE IS NOT LOADED" ); fprintf( output_fp, "\n\n\n" " " "-------- ANTENNA ENVIRONMENT --------" ); if( ksymp != 1) { frati=CPLX_10; if( iperf != 1) { if( sig < 0.) sig=- sig/(59.96*wlam); epsc= cmplx( epsr, -sig*wlam*59.96); zrati=1./ csqrtl( epsc); u= zrati; u2= u* u; if( nradl != 0) { scrwl= scrwlt/ wlam; scrwr= scrwrt/ wlam; t1= CPLX_01*2367.067/ (long double)nradl; t2= scrwr* (long double)nradl; fprintf( output_fp, "\n" " " "RADIAL WIRE GROUND SCREEN\n" " " "%d WIRES\n" " " "WIRE LENGTH: %8.2LF METERS\n" " " "WIRE RADIUS: %10.3LE METERS", nradl, scrwlt, scrwrt ); fprintf( output_fp, "\n" " " "MEDIUM UNDER SCREEN -" ); } /* if( nradl != 0) */ if( iperf != 2) fprintf( output_fp, "\n" " " "FINITE GROUND - REFLECTION COEFFICIENT APPROXIMATION" ); else { somnec( epsr, sig, fmhz ); frati=( epsc-1.)/( epsc+1.); if( cabsl(( epscf- epsc)/ epsc) >= 1.0e-3 ) { fprintf( output_fp, "\n ERROR IN GROUND PARAMETERS -" "\n COMPLEX DIELECTRIC CONSTANT FROM FILE IS: %12.5LE%+12.5LEj" "\n REQUESTED: %12.5LE%+12.5LEj", creall(epscf), cimagl(epscf), creall(epsc), cimagl(epsc) ); stop(-1); } fprintf( output_fp, "\n" " " "FINITE GROUND - SOMMERFELD SOLUTION" ); } /* if( iperf != 2) */ fprintf( output_fp, "\n" " " "RELATIVE DIELECTRIC CONST: %.3LF\n" " " "CONDUCTIVITY: %10.3LE MHOS/METER\n" " " "COMPLEX DIELECTRIC CONSTANT: %11.4LE%+11.4LEj", epsr, sig, creall(epsc), cimagl(epsc) ); } /* if( iperf != 1) */ else fprintf( output_fp, "\n" " " "PERFECT GROUND" ); } /* if( ksymp != 1) */ else fprintf( output_fp, "\n" " " "FREE SPACE" ); /* label 50 */ /* fill and factor primary interaction matrix */ secnds( &tim1 ); cmset( neq, cm, rkh, iexk ); secnds( &tim2 ); tim= tim2- tim1; factrs( npeq, neq, cm, ip ); secnds( &tim1 ); tim2= tim1- tim2; fprintf( output_fp, "\n\n\n" " " "---------- MATRIX TIMING ----------\n" " " "FILL: %d msec FACTOR: %d msec", (int)tim, (int)tim2 ); igo=3; ntsol=0; /* label 53 */ case 3: /* excitation set up (right hand side, -e inc.) */ nthic=1; nphic=1; inc=1; nprint=0; /* l_54 */ do { if( (ixtyp != 0) && (ixtyp != 5) ) { if( (iptflg <= 0) || (ixtyp == 4) ) fprintf( output_fp, "\n\n\n" " " "---------- EXCITATION ----------" ); tmp5= TA* xpr5; tmp4= TA* xpr4; if( ixtyp == 4) { tmp1= xpr1/ wlam; tmp2= xpr2/ wlam; tmp3= xpr3/ wlam; tmp6= xpr6/( wlam* wlam); fprintf( output_fp, "\n" " " " CURRENT SOURCE\n" " -- POSITION (METERS) -- " " ORIENTATION (DEG)\n" " X Y Z " " ALPHA BETA DIPOLE MOMENT\n" " %10.5LF %10.5LF %10.5LF " " %7.2LF %7.2LF %8.3LF", xpr1, xpr2, xpr3, xpr4, xpr5, xpr6 ); } else { tmp1= TA* xpr1; tmp2= TA* xpr2; tmp3= TA* xpr3; tmp6= xpr6; if( iptflg <= 0) fprintf( output_fp, "\n PLANE WAVE - THETA: %7.2LF deg, PHI: %7.2LF deg," " ETA=%7.2LF DEG, TYPE - %s AXIAL RATIO: %6.3LF", xpr1, xpr2, xpr3, hpol[ixtyp-1], xpr6 ); } /* if( ixtyp == 4) */ } /* if( (ixtyp != 0) && (ixtyp <= 4) ) */ /* fills e field right-hand matrix */ etmns( tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, ixtyp, cur); /* matrix solving (netwk calls solves) */ if( (nonet != 0) && (inc <= 1) ) { fprintf( output_fp, "\n\n\n" " " "---------- NETWORK DATA ----------" ); itmp3=0; itmp1= ntyp[0]; for( i = 0; i < 2; i++ ) { if( itmp1 == 3) itmp1=2; if( itmp1 == 2) fprintf( output_fp, "\n" " -- FROM - --- TO -- TRANSMISSION LINE " " --------- SHUNT ADMITTANCES (MHOS) --------- LINE\n" " TAG SEG TAG SEG IMPEDANCE LENGTH " " ----- END ONE ----- ----- END TWO ----- TYPE\n" " No: No: No: No: OHMS METERS " " REAL IMAGINARY REAL IMAGINARY" ); else if( itmp1 == 1) fprintf( output_fp, "\n" " -- FROM - --- TO -- --------" " ADMITTANCE MATRIX ELEMENTS (MHOS) ---------\n" " TAG SEG TAG SEG ----- (ONE,ONE) ------ " " ----- (ONE,TWO) ----- ----- (TWO,TWO) -------\n" " No: No: No: No: REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY" ); for( j = 0; j < nonet; j++) { itmp2= ntyp[j]; if( (itmp2/itmp1) != 1 ) itmp3 = itmp2; else { int idx4, idx5; itmp4= iseg1[j]; itmp5= iseg2[j]; idx4 = itmp4-1; idx5 = itmp5-1; if( (itmp2 >= 2) && (x11i[j] <= 0.) ) { long double xx, yy, zz; xx = x[idx5]- x[idx4]; yy = y[idx5]- y[idx4]; zz = z[idx5]- z[idx4]; x11i[j]= wlam* sqrtl( xx*xx + yy*yy + zz*zz ); } fprintf( output_fp, "\n" " %4d %5d %4d %5d %11.4LE %11.4LE " "%11.4LE %11.4LE %11.4LE %11.4LE %s", itag[idx4], itmp4, itag[idx5], itmp5, x11r[j], x11i[j], x12r[j], x12i[j], x22r[j], x22i[j], pnet[itmp2-1] ); } /* if(( itmp2/ itmp1) == 1) */ } /* for( j = 0; j < nonet; j++) */ if( itmp3 == 0) break; itmp1= itmp3; } /* for( j = 0; j < nonet; j++) */ } /* if( (nonet != 0) && (inc <= 1) ) */ if( (inc > 1) && (iptflg > 0) ) nprint=1; netwk( cm, &cm[ib11], &cm[ic11], &cm[id11], ip, cur ); ntsol=1; if( iped != 0) { itmp1= 4*( mhz-1); fnorm[itmp1 ]= creall( zped); fnorm[itmp1+1]= cimagl( zped); fnorm[itmp1+2]= cabsl( zped); fnorm[itmp1+3]= cang( zped); if( iped != 2 ) { if( fnorm[itmp1+2] > zpnorm) zpnorm= fnorm[itmp1+2]; } } /* if( iped != 0) */ /* printing structure currents */ if( n != 0) { if( iptflg != -1) { if( iptflg <= 0) { fprintf( output_fp, "\n\n\n" " " "-------- CURRENTS AND LOCATION --------\n" " " "DISTANCES IN WAVELENGTHS" ); fprintf( output_fp, "\n\n" " SEG TAG COORDINATES OF SEGM CENTER SEGM" " ------------- CURRENT (AMPS) -------------\n" " No: No: X Y Z LENGTH" " REAL IMAGINARY MAGN PHASE" ); } else { if( (iptflg != 3) && (inc <= 1) ) fprintf( output_fp, "\n\n\n" " -------- RECEIVING PATTERN PARAMETERS --------\n" " ETA: %7.2LF DEGREES\n" " TYPE: %s\n" " AXIAL RATIO: %6.3LF\n\n" " THETA PHI ----- CURRENT ---- SEG\n" " (DEG) (DEG) MAGNITUDE PHASE No:", xpr3, hpol[ixtyp-1], xpr6 ); } /* if( iptflg <= 0) */ } /* if( iptflg != -1) */ ploss=0.; itmp1=0; jump= iptflg+1; for( i = 0; i < n; i++ ) { curi= cur[i]* wlam; cmag= cabsl( curi); ph= cang( curi); if( (nload != 0) && (fabsl(creall(zarray[i])) >= 1.e-20) ) ploss += 0.5* cmag* cmag* creall( zarray[i])* si[i]; if( jump == 0) continue; if( jump > 0 ) { if( (iptag != 0) && (itag[i] != iptag) ) continue; itmp1++; if( (itmp1 < iptagf) || (itmp1 > iptagt) ) continue; if( iptflg != 0) { if( iptflg >= 2 ) { fnorm[inc-1]= cmag; isave= (i+1); } if( iptflg != 3) { fprintf( output_fp, "\n" " %7.2LF %7.2LF %11.4LE %7.2LF %5d", xpr1, xpr2, cmag, ph, i+1 ); continue; } } /* if( iptflg != 0) */ } /* if( jump > 0 ) */ else { fprintf( output_fp, "\n" " %5d %4d %9.4LF %9.4LF %9.4LF %9.5LF" " %11.4LE %11.4LE %11.4LE %8.3LF", i+1, itag[i], x[i], y[i], z[i], si[i], creall(curi), cimagl(curi), cmag, ph ); if( iplp1 != 1 ) continue; if( iplp2 == 1) fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(curi), cimagl(curi) ); else if( iplp2 == 2) fprintf( plot_fp, "%12.4LE %12.4LE\n", cmag, ph ); } } /* for( i = 0; i < n; i++ ) */ if( iptflq != -1) { fprintf( output_fp, "\n\n\n" " " "------ CHARGE DENSITIES ------\n" " " " DISTANCES IN WAVELENGTHS\n\n" " SEG TAG COORDINATES OF SEG CENTER SEG " " CHARGE DENSITY (COULOMBS/METER)\n" " No: No: X Y Z LENGTH " " REAL IMAGINARY MAGN PHASE" ); itmp1 = 0; fr = 1.e-6/fmhz; for( i = 0; i < n; i++ ) { if( iptflq != -2 ) { if( (iptaq != 0) && (itag[i] != iptaq) ) continue; itmp1++; if( (itmp1 < iptaqf) || (itmp1 > iptaqt) ) continue; } /* if( iptflq == -2) */ curi= fr* cmplx(- bii[i], bir[i]); cmag= cabsl( curi); ph= cang( curi); fprintf( output_fp, "\n" " %5d %4d %9.4LF %9.4LF %9.4LF %9.5LF" " %11.4LE %11.4LE %11.4LE %9.3LF", i+1, itag[i], x[i], y[i], z[i], si[i], creall(curi), cimagl(curi), cmag, ph ); } /* for( i = 0; i < n; i++ ) */ } /* if( iptflq != -1) */ } /* if( n != 0) */ if( m != 0) { fprintf( output_fp, "\n\n\n" " " " --------- SURFACE PATCH CURRENTS ---------\n" " " " DISTANCE IN WAVELENGTHS\n" " " " CURRENT IN AMPS/METER\n\n" " ---------" " SURFACE COMPONENTS -------- " " ---------------- RECTANGULAR COMPONENTS ----------------\n" " PCH --- PATCH CENTER --- TANGENT VECTOR 1 " " TANGENT VECTOR 2 ------- X ------ ------- Y ------ " " ------- Z ------\n No: X Y Z MAG. " " PHASE MAG. PHASE REAL IMAGINARY REAL " " IMAGINARY REAL IMAGINARY" ); j= n-3; itmp1= -1; for( i = 0; i < m; i++ ) { j += 3; itmp1++; ex= cur[j]; ey= cur[j+1]; ez= cur[j+2]; eth= ex* t1x[itmp1]+ ey* t1y[itmp1]+ ez* t1z[itmp1]; eph= ex* t2x[itmp1]+ ey* t2y[itmp1]+ ez* t2z[itmp1]; ethm= cabsl( eth); etha= cang( eth); ephm= cabsl( eph); epha= cang( eph); fprintf( output_fp, "\n" " %4d %7.3LF %7.3LF %7.3LF %11.4LE %8.2LF %11.4LE %8.2LF" " %9.2LE %9.2LE %9.2LE %9.2LE %9.2LE %9.2LE", i+1, px[itmp1], py[itmp1], pz[itmp1], ethm, etha, ephm, epha, creall(ex), cimagl(ex), creall(ey), cimagl(ey), creall(ez), cimagl(ez) ); if( iplp1 != 1) continue; if( iplp3 == 1) fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ex), cimagl(ex) ); if( iplp3 == 2) fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ey), cimagl(ey) ); if( iplp3 == 3) fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ez), cimagl(ez) ); if( iplp3 == 4) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n", creall(ex),cimagl(ex),creall(ey),cimagl(ey),creall(ez),cimagl(ez) ); } /* for( i=0; i 0) couple( cur, wlam ); if( iflow == 7) { if( (ixtyp > 0) && (ixtyp < 4) ) { nthic++; inc++; xpr1 += xpr4; if( nthic <= nthi ) continue; /* continue excitation loop */ nthic=1; xpr1= thetis; xpr2= xpr2+ xpr5; nphic++; if( nphic <= nphi ) continue; /* continue excitation loop */ break; } /* if( (ixtyp >= 1) && (ixtyp <= 3) ) */ if( nfrq != 1) { jmp_floop = TRUE; break; /* continue the freq loop */ } fprintf( output_fp, "\n\n\n" ); jmp_iloop = TRUE; break; /* continue card input loop */ } /*if( iflow == 7) */ case 4: /* label_71 */ igo = 5; /* label_72 */ case 5: /* near field calculation */ if( near != -1) { nfpat(); if( mhz == nfrq) near=-1; if( nfrq == 1) { fprintf( output_fp, "\n\n\n" ); jmp_iloop = TRUE; break; /* continue card input loop */ } } /* if( near != -1) */ /* label_78 */ case 6: /* standard far field calculation */ if( ifar != -1) { pinr= pin; pnlr= pnls; rdpat(); } if( (ixtyp == 0) || (ixtyp >= 4) ) { if( mhz == nfrq ) ifar=-1; if( nfrq != 1) { jmp_floop = TRUE; break; } fprintf( output_fp, "\n\n\n" ); jmp_iloop = TRUE; break; } /* if( (ixtyp == 0) || (ixtyp >= 4) ) */ nthic++; inc++; xpr1 += xpr4; if( nthic <= nthi ) continue; /* continue excitation loop */ nthic = 1; xpr1 = thetis; xpr2 += xpr5; nphic++; if( nphic > nphi ) break; } /* do (l_54) */ while( TRUE ); /* jump to freq. or input loop */ if( jmp_iloop ) break; if( jmp_floop ) continue; nphic = 1; xpr2 = phiss; /* normalized receiving pattern printed */ if( iptflg >= 2) { itmp1= nthi* nphi; tmp1= fnorm[0]; for( j = 1; j < itmp1; j++ ) if( fnorm[j] > tmp1) tmp1= fnorm[j]; fprintf( output_fp, "\n\n\n" " " "---- NORMALIZED RECEIVING PATTERN ----\n" " " "NORMALIZATION FACTOR: %11.4LE\n" " " "ETA: %7.2LF DEGREES\n" " " "TYPE: %s\n" " AXIAL RATIO: %6.3LF\n" " SEGMENT No: %d\n\n" " " "THETA PHI ---- PATTERN ----\n" " " "(DEG) (DEG) DB MAGNITUDE", tmp1, xpr3, hpol[ixtyp-1], xpr6, isave ); for( j = 0; j < nphi; j++ ) { itmp2= nthi*j; for( i = 0; i < nthi; i++ ) { itmp3= i + itmp2; if( itmp3 < itmp1) { tmp2= fnorm[itmp3]/ tmp1; tmp3= db20( tmp2); fprintf( output_fp, "\n" " %7.2LF %7.2LF %7.2LF %11.4LE", xpr1, xpr2, tmp3, tmp2 ); xpr1 += xpr4; } } /* for( i = 0; i < nthi; i++ ) */ xpr1= thetis; xpr2 += xpr5; } /* for( j = 0; j < nphi; j++ ) */ xpr2= phiss; } /* if( iptflg >= 2) */ if( mhz == nfrq) ifar=-1; if( nfrq == 1) { fprintf( output_fp, "\n\n\n" ); jmp_iloop = TRUE; break; /* continue card input loop */ } } /*** do (frequency loop) (l_42) ***/ while( (++mhz <= nfrq) ); /* Jump to card input loop */ if( jmp_iloop ) break; if( iped != 0) { int iss; if( nvqd > 0) iss = ivqd[nvqd-1]; else iss = isant[nsant-1]; fprintf( output_fp, "\n\n\n" " " " -------- INPUT IMPEDANCE DATA --------\n" " " " SOURCE SEGMENT No: %d\n" " " " NORMALIZATION FACTOR:%12.5LE\n\n" " ----------- UNNORMALIZED IMPEDANCE ---------- " " ------------ NORMALIZED IMPEDANCE -----------\n" " FREQ RESISTANCE REACTANCE MAGNITUDE PHASE " " RESISTANCE REACTANCE MAGNITUDE PHASE\n" " MHz OHMS OHMS OHMS DEGREES " " OHMS OHMS OHMS DEGREES", iss, zpnorm ); itmp1= nfrq; if( ifrq == 0) tmp1= fmhz-( nfrq-1)* delfrq; else if( ifrq == 1) tmp1= fmhz/( powl(delfrq, (nfrq-1)) ); for( i = 0; i < itmp1; i++ ) { itmp2= 4*i; tmp2= fnorm[itmp2 ]/ zpnorm; tmp3= fnorm[itmp2+1]/ zpnorm; tmp4= fnorm[itmp2+2]/ zpnorm; tmp5= fnorm[itmp2+3]; fprintf( output_fp, "\n" " %9.3LF %11.4LE %11.4LE %11.4LE %7.2LF " " %11.4LE %11.4LE %11.4LE %7.2LF", tmp1, fnorm[itmp2], fnorm[itmp2+1], fnorm[itmp2+2], fnorm[itmp2+3], tmp2, tmp3, tmp4, tmp5 ); if( ifrq == 0) tmp1 += delfrq; else if( ifrq == 1) tmp1 *= delfrq; } /* for( i = 0; i < itmp1; i++ ) */ fprintf( output_fp, "\n\n\n" ); } /* if( iped != 0) */ nfrq=1; mhz=1; } /* switch( igox ) */ } /* while( ! next_job ): Main input section (l_14) */ } /* while(TRUE): Main execution loop (l_1) */ return(0); } /* end of main() */ /*-----------------------------------------------------------------------*/ /* prnt sets up the print formats for impedance loading */ void prnt( int in1, int in2, int in3, long double fl1, long double fl2, long double fl3, long double fl4, long double fl5, long double fl6, char *ia, int ichar ) { /* record to be output and buffer used to make it */ char record[101+ichar*4], buf[15]; int in[3], i1, i; long double fl[6]; in[0]= in1; in[1]= in2; in[2]= in3; fl[0]= fl1; fl[1]= fl2; fl[2]= fl3; fl[3]= fl4; fl[4]= fl5; fl[5]= fl6; /* integer format */ i1=0; strcpy( record, "\n " ); if( (in1 == 0) && (in2 == 0) && (in3 == 0) ) { strcat( record, " ALL" ); i1=1; } for( i = i1; i < 3; i++ ) { if( in[i] == 0) strcat( record, " " ); else { sprintf( buf, "%5d", in[i] ); strcat( record, buf ); } } /* floating point format */ for( i = 0; i < 6; i++ ) { if( fabsl( fl[i]) >= 1.0e-20 ) { sprintf( buf, " %11.4LE", fl[i] ); strcat( record, buf ); } else strcat( record, " " ); } strcat( record, " " ); strcat( record, ia ); fprintf( output_fp, "%s", record ); return; } /*-----------------------------------------------------------------------*/ static void sig_handler( int signal ) { switch( signal ) { case SIGINT : fprintf( stderr, "\n%s\n", "nec2c: exiting via user interrupt" ); exit( signal ); case SIGSEGV : fprintf( stderr, "\n%s\n", "nec2c: segmentation fault" ); exit( signal ); case SIGFPE : fprintf( stderr, "\n%s\n", "nec2c: floating point exception" ); exit( signal ); case SIGABRT : fprintf( stderr, "\n%s\n", "nec2c: abort signal received" ); exit( signal ); case SIGTERM : fprintf( stderr, "\n%s\n", "nec2c: termination request received" ); stop( signal ); } } /* end of sig_handler() */ /*------------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/misc.c0000644000175000017500000001225610310210756015073 0ustar numanuma/* * Miscellaneous support functions for nec2c.c */ #include "nec2c.h" /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*------------------------------------------------------------------------*/ /* usage() * * prints usage information */ void usage(void) { fprintf( stderr, "usage: nec2c [-i] [-o]" "\n -h: print this usage information and exit." "\n -v: print nec2c version number and exit.\n"); } /* end of usage() */ /*------------------------------------------------------------------------*/ /* abort_on_error() * * prints an error message and exits */ void abort_on_error( int why ) { switch( why ) { case -1 : /* abort if input file name too long */ fprintf( stderr, "%s\n", "nec2c: input file name too long - aborting" ); break; case -2 : /* abort if output file name too long */ fprintf( stderr, "%s\n", "nec2c: output file name too long - aborting" ); break; case -3 : /* abort on input file read error */ fprintf( stderr, "%s\n", "nec2c: error reading input file - aborting" ); break; case -4 : /* Abort on malloc failure */ fprintf( stderr, "%s\n", "nec2c: A memory allocation request has failed - aborting" ); break; case -5 : /* Abort if a GF card is read */ fprintf( stderr, "%s\n", "nec2c: NGF solution option not supported - aborting" ); break; case -6: /* No convergence in gshank() */ fprintf( stderr, "%s\n", "nec2c: No convergence in gshank() - aborting" ); break; case -7: /* Error in hankel() */ fprintf( stderr, "%s\n", "nec2c: hankel not valid for z=0. - aborting" ); } /* switch( why ) */ /* clean up and quit */ stop( why ); } /* end of abort_on_error() */ /*------------------------------------------------------------------------*/ /* Returns the complex long double of the arguments */ complex long double cmplx( long double r, long double i ) { complex long double c; c = r + i*CPLX_01; return(c); } /*------------------------------------------------------------------------*/ /* Returns process time (user+system) BUT in _msec_ */ void secnds( long double *x) { struct tms buffer; times(&buffer); *x = 1000. * ( (long double)(buffer.tms_utime + buffer.tms_stime) ) / ( (long double) sysconf(_SC_CLK_TCK) ); return; } /*------------------------------------------------------------------------*/ /* Does the STOP function of fortran but with return value */ int stop( int flag ) { if( input_fp != NULL ) fclose( input_fp ); if( output_fp != NULL ) fclose( output_fp ); if( plot_fp != NULL ) fclose( plot_fp ); exit( flag ); } /*------------------------------------------------------------------*/ /* load_line() * * loads a line from a file, aborts on failure. lines beginning * with a '#' are ignored as comments. at the end of file EOF is * returned. */ int load_line( char *buff, FILE *pfile ) { int num_chr, /* number of characters read, excluding lf/cr */ eof = 0, /* EOF flag */ chr; /* character read by getc */ num_chr = 0; /* clear buffer at start */ buff[0] = '\0'; /* ignore commented lines, white spaces and eol/cr */ if( (chr = fgetc(pfile)) == EOF ) return( EOF ); while( (chr == '#') || (chr == ' ') || (chr == CR ) || (chr == LF ) ) { /* go to the end of line (look for lf or cr) */ while( (chr != CR) && (chr != LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); /* dump any cr/lf remaining */ while( (chr == CR) || (chr == LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); } /* end of while( (chr == '#') || ... */ while( num_chr < LINE_LEN ) { /* if lf/cr reached before filling buffer, return */ if( (chr == CR) || (chr == LF) ) break; /* enter new char to buffer */ buff[num_chr++] = chr; /* terminate buffer as a string on EOF */ if( (chr = fgetc(pfile)) == EOF ) { buff[num_chr] = '\0'; eof = EOF; } } /* end of while( num_chr < max_chr ) */ /* Capitalize first two characters (mnemonics) */ if( (buff[0] > 0x60) && (buff[0] < 0x79) ) buff[0] -= 0x20; if( (buff[1] > 0x60) && (buff[1] < 0x79) ) buff[1] -= 0x20; /* terminate buffer as a string */ buff[num_chr] = '\0'; return( eof ); } /* end of load_line() */ /*------------------------------------------------------------------------*/ /*** Memory allocation/freeing utils ***/ void mem_alloc( void **ptr, int req ) { free_ptr( ptr ); *ptr = malloc( req ); if( *ptr == NULL ) abort_on_error( -4 ); } /* End of void mem_alloc() */ /*------------------------------------------------------------------------*/ void mem_realloc( void **ptr, int req ) { *ptr = realloc( *ptr, req ); if( *ptr == NULL ) abort_on_error( -4 ); } /* End of void mem_realloc() */ /*------------------------------------------------------------------------*/ void free_ptr( void **ptr ) { if( *ptr != NULL ) free( *ptr ); *ptr = NULL; } /* End of void free_ptr() */ /*------------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/geometry.c0000644000175000017500000014527710310210755016004 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /segj/ */ extern int *jco, jsno, nscon, maxcon; /* Max. no. connections */ extern long double *ax, *bx, *cx; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /* common /plot/ */ extern int iplp1, iplp2, iplp3, iplp4; /*-------------------------------------------------------------------*/ /* arc generates segment geometry data for an arc of ns segments */ void arc( int itg, int ns, long double rada, long double ang1, long double ang2, long double rad ) { int ist, i, mreq; long double ang, dang, xs1, xs2, zs1, zs2; ist= n; n += ns; np= n; mp= m; ipsym=0; if( ns < 1) return; if( fabsl( ang2- ang1) < 360.00001) { /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (n+m) * sizeof(int) ); /* Reallocate wire buffers */ mreq = n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); ang= ang1* TA; dang=( ang2- ang1)* TA/ ns; xs1= rada* cosl( ang); zs1= rada* sinl( ang); for( i = ist; i < n; i++ ) { ang += dang; xs2= rada* cosl( ang); zs2= rada* sinl( ang); x[i]= xs1; y[i]=0.; z[i]= zs1; x2[i]= xs2; y2[i]=0.; z2[i]= zs2; xs1= xs2; zs1= zs2; bi[i]= rad; itag[i]= itg; } /* for( i = ist; i < n; i++ ) */ } /* if( fabsl( ang2- ang1) < 360.00001) */ else { fprintf( output_fp, "\n ERROR -- ARC ANGLE EXCEEDS 360 DEGREES"); stop(-1); } return; } /*-----------------------------------------------------------------------*/ /* connect sets up segment connection data in arrays icon1 and */ /* icon2 by searching for segment ends that are in contact. */ void conect( int ignd ) { int i, iz, ic, j, jx, ix, ixx, iseg, iend, jend, nsflg, jump, ipf; long double sep=0., xi1, yi1, zi1, xi2, yi2, zi2; long double slen, xa, ya, za, xs, ys, zs; nscon= -1; maxcon = 1; if( ignd != 0) { fprintf( output_fp, "\n\n GROUND PLANE SPECIFIED." ); if( ignd > 0) fprintf( output_fp, "\n WHERE WIRE ENDS TOUCH GROUND, CURRENT WILL" " BE INTERPOLATED TO IMAGE IN GROUND PLANE.\n" ); if( ipsym == 2) { np=2* np; mp=2* mp; } if( abs( ipsym) > 2 ) { np= n; mp= m; } /*** possibly should be error condition?? **/ if( np > n) { fprintf( output_fp, "\n ERROR: NP > N IN CONECT()" ); stop(-1); } if( (np == n) && (mp == m) ) ipsym=0; } /* if( ignd != 0) */ if( n != 0) { /* Allocate memory to connections */ mem_alloc( (void *)&icon1, (n+m) * sizeof(int) ); mem_alloc( (void *)&icon2, (n+m) * sizeof(int) ); for( i = 0; i < n; i++ ) { iz = i+1; xi1= x[i]; yi1= y[i]; zi1= z[i]; xi2= x2[i]; yi2= y2[i]; zi2= z2[i]; slen= sqrtl( (xi2- xi1)*(xi2- xi1) + (yi2- yi1) * (yi2- yi1) + (zi2- zi1)*(zi2- zi1) ) * SMIN; /* determine connection data for end 1 of segment. */ jump = FALSE; if( ignd > 0) { if( zi1 <= -slen) { fprintf( output_fp, "\n GEOMETRY DATA ERROR -- SEGMENT" " %d EXTENDS BELOW GROUND", iz ); stop(-1); } if( zi1 <= slen) { icon1[i]= iz; z[i]=0.; jump = TRUE; } /* if( zi1 <= slen) */ } /* if( ignd > 0) */ if( ! jump ) { ic= i; for( j = 1; j < n; j++) { ic++; if( ic >= n) ic=0; sep= fabsl( xi1- x[ic])+ fabsl(yi1- y[ic])+ fabsl(zi1- z[ic]); if( sep <= slen) { icon1[i]= -(ic+1); break; } sep= fabsl( xi1- x2[ic])+ fabsl(yi1- y2[ic])+ fabsl(zi1- z2[ic]); if( sep <= slen) { icon1[i]= (ic+1); break; } } /* for( j = 1; j < n; j++) */ if( ((iz > 0) || (icon1[i] <= PCHCON)) && (sep > slen) ) icon1[i]=0; } /* if( ! jump ) */ /* determine connection data for end 2 of segment. */ if( (ignd > 0) || jump ) { if( zi2 <= -slen) { fprintf( output_fp, "\n GEOMETRY DATA ERROR -- SEGMENT" " %d EXTENDS BELOW GROUND", iz ); stop(-1); } if( zi2 <= slen) { if( icon1[i] == iz ) { fprintf( output_fp, "\n GEOMETRY DATA ERROR -- SEGMENT" " %d LIES IN GROUND PLANE", iz ); stop(-1); } icon2[i]= iz; z2[i]=0.; continue; } /* if( zi2 <= slen) */ } /* if( ignd > 0) */ ic= i; for( j = 1; j < n; j++ ) { ic++; if( ic >= n) ic=0; sep= fabsl(xi2- x[ic])+ fabsl(yi2- y[ic])+ fabsl(zi2- z[ic]); if( sep <= slen) { icon2[i]= (ic+1); break; } sep= fabsl(xi2- x2[ic])+ fabsl(yi2- y2[ic])+ fabsl(zi2- z2[ic]); if( sep <= slen) { icon2[i]= -(ic+1); break; } } /* for( j = 1; j < n; j++ ) */ if( ((iz > 0) || (icon2[i] <= PCHCON)) && (sep > slen) ) icon2[i]=0; } /* for( i = 0; i < n; i++ ) */ /* find wire-surface connections for new patches */ if( m != 0) { ix = -1; i = 0; while( ++i <= m ) { ix++; xs= px[ix]; ys= py[ix]; zs= pz[ix]; for( iseg = 0; iseg < n; iseg++ ) { xi1= x[iseg]; yi1= y[iseg]; zi1= z[iseg]; xi2= x2[iseg]; yi2= y2[iseg]; zi2= z2[iseg]; /* for first end of segment */ slen=( fabsl(xi2- xi1)+ fabsl(yi2- yi1)+ fabsl(zi2- zi1))* SMIN; sep= fabsl(xi1- xs)+ fabsl(yi1- ys)+ fabsl(zi1- zs); /* connection - divide patch into 4 patches at present array loc. */ if( sep <= slen) { icon1[iseg]=PCHCON+ i; ic=0; subph( i, ic ); break; } sep= fabsl(xi2- xs)+ fabsl(yi2- ys)+ fabsl(zi2- zs); if( sep <= slen) { icon2[iseg]=PCHCON+ i; ic=0; subph( i, ic ); break; } } /* for( iseg = 0; iseg < n; iseg++ ) */ } /* while( ++i <= m ) */ } /* if( m != 0) */ } /* if( n != 0) */ fprintf( output_fp, "\n\n" " TOTAL SEGMENTS USED: %d SEGMENTS IN A" " SYMMETRIC CELL: %d SYMMETRY FLAG: %d", n, np, ipsym ); if( m > 0) fprintf( output_fp, "\n" " TOTAL PATCHES USED: %d PATCHES" " IN A SYMMETRIC CELL: %d", m, mp ); iseg=( n+ m)/( np+ mp); if( iseg != 1) { /*** may be error condition?? ***/ if( ipsym == 0 ) { fprintf( output_fp, "\n ERROR: IPSYM=0 IN CONECT()" ); stop(-1); } if( ipsym < 0 ) fprintf( output_fp, "\n STRUCTURE HAS %d FOLD ROTATIONAL SYMMETRY\n", iseg ); else { ic= iseg/2; if( iseg == 8) ic=3; fprintf( output_fp, "\n STRUCTURE HAS %d PLANES OF SYMMETRY\n", ic ); } /* if( ipsym < 0 ) */ } /* if( iseg == 1) */ if( n == 0) return; /* Allocate to connection buffers */ mem_alloc( (void *)&jco, maxcon * sizeof(int) ); /* adjust connected seg. ends to exactly coincide. print junctions */ /* of 3 or more seg. also find old seg. connecting to new seg. */ iseg = 0; ipf = FALSE; for( j = 0; j < n; j++ ) { jx = j+1; iend=-1; jend=-1; ix= icon1[j]; ic=1; jco[0]= -jx; xa= x[j]; ya= y[j]; za= z[j]; while( TRUE ) { if( (ix != 0) && (ix != (j+1)) && (ix <= PCHCON) ) { nsflg=0; do { if( ix == 0 ) { fprintf( output_fp, "\n CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT: %d", ix ); stop(-1); } if( ix < 0 ) ix= -ix; else jend= -jend; jump = FALSE; if( ix == jx ) break; if( ix < jx ) { jump = TRUE; break; } /* Record max. no. of connections */ ic++; if( ic >= maxcon ) { maxcon = ic+1; mem_realloc( (void *)&jco, maxcon * sizeof(int) ); } jco[ic-1]= ix* jend; if( ix > 0) nsflg=1; ixx = ix-1; if( jend != 1) { xa= xa+ x[ixx]; ya= ya+ y[ixx]; za= za+ z[ixx]; ix= icon1[ixx]; continue; } xa= xa+ x2[ixx]; ya= ya+ y2[ixx]; za= za+ z2[ixx]; ix= icon2[ixx]; } /* do */ while( ix != 0 ); if( jump && (iend == 1) ) break; else if( jump ) { iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; continue; } sep= (long double)ic; xa= xa/ sep; ya= ya/ sep; za= za/ sep; for( i = 0; i < ic; i++ ) { ix= jco[i]; if( ix <= 0) { ix=- ix; ixx = ix-1; x[ixx]= xa; y[ixx]= ya; z[ixx]= za; continue; } ixx = ix-1; x2[ixx]= xa; y2[ixx]= ya; z2[ixx]= za; } /* for( i = 0; i < ic; i++ ) */ if( ic >= 3) { if( ! ipf ) { fprintf( output_fp, "\n\n" " ---------- MULTIPLE WIRE JUNCTIONS ----------\n" " JUNCTION SEGMENTS (- FOR END 1, + FOR END 2)" ); ipf = TRUE; } iseg++; fprintf( output_fp, "\n %5d ", iseg ); for( i = 1; i <= ic; i++ ) { fprintf( output_fp, "%5d", jco[i-1] ); if( !(i % 20) ) fprintf( output_fp, "\n " ); } } /* if( ic >= 3) */ } /*if( (ix != 0) && (ix != j) && (ix <= PCHCON) ) */ if( iend == 1) break; iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; } /* while( TRUE ) */ } /* for( j = 0; j < n; j++ ) */ mem_alloc( (void *)&ax, maxcon * sizeof(long double) ); mem_alloc( (void *)&bx, maxcon * sizeof(long double) ); mem_alloc( (void *)&cx, maxcon * sizeof(long double) ); return; } /*-----------------------------------------------------------------------*/ /* datagn is the main routine for input of geometry data. */ void datagn( void ) { char gm[3]; char ifx[2] = {'*', 'X'}, ify[2]={'*','Y'}, ifz[2]={'*','Z'}; char ipt[4] = { 'P', 'R', 'T', 'Q' }; /* input card mnemonic list */ /* "XT" stands for "exit", added for testing */ #define GM_NUM 12 char *atst[GM_NUM] = { "GW", "GX", "GR", "GS", "GE", "GM", \ "SP", "SM", "GA", "SC", "GH", "GF" }; int nwire, isct, iphd, i1, i2, itg, iy, iz, mreq; int ix, i, ns, gm_num; /* geometry card id as a number */ long double rad, xs1, xs2, ys1, ys2, zs1, zs2, x4=0, y4=0, z4=0; long double x3=0, y3=0, z3=0, xw1, xw2, yw1, yw2, zw1, zw2; long double dummy; ipsym=0; nwire=0; n=0; np=0; m=0; mp=0; isct=0; iphd = FALSE; /* read geometry data card and branch to */ /* section for operation requested */ do { readgm( gm, &itg, &ns, &xw1, &yw1, &zw1, &xw2, &yw2, &zw2, &rad); /* identify card id mnemonic */ for( gm_num = 0; gm_num < GM_NUM; gm_num++ ) if( strncmp( gm, atst[gm_num], 2) == 0 ) break; if( iphd == FALSE ) { fprintf( output_fp, "\n\n\n" " " "-------- STRUCTURE SPECIFICATION --------\n" " " "COORDINATES MUST BE INPUT IN\n" " " "METERS OR BE SCALED TO METERS\n" " " "BEFORE STRUCTURE INPUT IS ENDED\n" ); fprintf( output_fp, "\n" " WIRE " " SEG FIRST LAST TAG\n" " No: X1 Y1 Z1 X2 " " Y2 Z2 RADIUS No: SEG SEG No:" ); iphd=1; } if( gm_num != 10 ) isct=0; switch( gm_num ) { case 0: /* "gw" card, generate segment data for straight wire. */ nwire++; i1= n+1; i2= n+ ns; fprintf( output_fp, "\n" " %5d %10.4LF %10.4LF %10.4LF %10.4LF" " %10.4LF %10.4LF %10.4LF %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, yw2, zw2, rad, ns, i1, i2, itg ); if( rad != 0) { xs1=1.; ys1=1.; } else { readgm( gm, &ix, &iy, &xs1, &ys1, &zs1, &dummy, &dummy, &dummy, &dummy); if( strcmp(gm, "GC" ) != 0 ) { fprintf( output_fp, "\n GEOMETRY DATA CARD ERROR" ); stop(-1); } fprintf( output_fp, "\n ABOVE WIRE IS TAPERED. SEGMENT LENGTH RATIO: %9.5LF\n" " " "RADIUS FROM: %9.5LF TO: %9.5LF", xs1, ys1, zs1 ); if( (ys1 == 0) || (zs1 == 0) ) { fprintf( output_fp, "\n GEOMETRY DATA CARD ERROR" ); stop(-1); } rad= ys1; ys1= powl( (zs1/ys1), (1./(ns-1.)) ); } wire( xw1, yw1, zw1, xw2, yw2, zw2, rad, xs1, ys1, ns, itg); continue; /* reflect structure along x,y, or z */ /* axes or rotate to form cylinder. */ case 1: /* "gx" card */ iy= ns/10; iz= ns- iy*10; ix= iy/10; iy= iy- ix*10; if( ix != 0) ix=1; if( iy != 0) iy=1; if( iz != 0) iz=1; fprintf( output_fp, "\n STRUCTURE REFLECTED ALONG THE AXES %c %c %c" " - TAGS INCREMENTED BY %d\n", ifx[ix], ify[iy], ifz[iz], itg ); reflc( ix, iy, iz, itg, ns); continue; case 2: /* "gr" card */ fprintf( output_fp, "\n STRUCTURE ROTATED ABOUT Z-AXIS %d TIMES" " - LABELS INCREMENTED BY %d\n", ns, itg ); ix=-1; iz = 0; reflc( ix, iy, iz, itg, ns); continue; case 3: /* "gs" card, scale structure dimensions by factor xw1. */ if( n > 0) { for( i = 0; i < n; i++ ) { x[i]= x[i]* xw1; y[i]= y[i]* xw1; z[i]= z[i]* xw1; x2[i]= x2[i]* xw1; y2[i]= y2[i]* xw1; z2[i]= z2[i]* xw1; bi[i]= bi[i]* xw1; } } /* if( n >= n2) */ if( m > 0) { yw1= xw1* xw1; for( i = 0; i < m; i++ ) { px[i]= px[i]* xw1; py[i]= py[i]* xw1; pz[i]= pz[i]* xw1; pbi[i]= pbi[i]* yw1; } } /* if( m >= m2) */ fprintf( output_fp, "\n STRUCTURE SCALED BY FACTOR: %10.5LF", xw1 ); continue; case 4: /* "ge" card, terminate structure geometry input. */ if( ns != 0) { iplp1=1; iplp2=1; } conect( itg); if( n != 0) { /* Allocate wire buffers */ mreq = n * sizeof(long double); mem_alloc( (void *)&si, mreq ); mem_alloc( (void *)&sab, mreq ); mem_alloc( (void *)&cab, mreq ); mem_alloc( (void *)&salp, mreq ); fprintf( output_fp, "\n\n\n" " " " ---------- SEGMENTATION DATA ----------\n" " " " COORDINATES IN METERS\n" " " " I+ AND I- INDICATE THE SEGMENTS BEFORE AND AFTER I\n" ); fprintf( output_fp, "\n" " SEG COORDINATES OF SEGM CENTER SEGM ORIENTATION" " ANGLES WIRE CONNECTION DATA TAG\n" " No: X Y Z LENGTH ALPHA " " BETA RADIUS I- I I+ No:" ); for( i = 0; i < n; i++ ) { xw1= x2[i]- x[i]; yw1= y2[i]- y[i]; zw1= z2[i]- z[i]; x[i]=( x[i]+ x2[i])*.5; y[i]=( y[i]+ y2[i])*.5; z[i]=( z[i]+ z2[i])*.5; xw2= xw1* xw1+ yw1* yw1+ zw1* zw1; yw2= sqrtl( xw2); yw2=( xw2/ yw2+ yw2)*.5; si[i]= yw2; cab[i]= xw1/ yw2; sab[i]= yw1/ yw2; xw2= zw1/ yw2; if( xw2 > 1.) xw2=1.; if( xw2 < -1.) xw2=-1.; salp[i]= xw2; xw2= asinl( xw2)* TD; yw2= atan2l( yw1, xw1)* TD; fprintf( output_fp, "\n" " %5d %9.4LF %9.4LF %9.4LF %9.4LF" " %9.4LF %9.4LF %9.4LF %5d %5d %5d %5d", i+1, x[i], y[i], z[i], si[i], xw2, yw2, bi[i], icon1[i], i+1, icon2[i], itag[i] ); if( iplp1 == 1) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE " "%12.4LE %12.4LE %12.4LE %12.4LE %5d %5d %5d\n", x[i],y[i],z[i],si[i],xw2,yw2,bi[i],icon1[i],i+1,icon2[i] ); if( (si[i] <= 1.e-20) || (bi[i] <= 0.) ) { fprintf( output_fp, "\n SEGMENT DATA ERROR" ); stop(-1); } } /* for( i = 0; i < n; i++ ) */ } /* if( n != 0) */ if( m != 0) { fprintf( output_fp, "\n\n\n" " " " --------- SURFACE PATCH DATA ---------\n" " " " COORDINATES IN METERS\n\n" " PATCH COORD. OF PATCH CENTER UNIT NORMAL VECTOR " " PATCH COMPONENTS OF UNIT TANGENT VECTORS\n" " No: X Y Z X Y Z " " AREA X1 Y1 Z1 X2 Y2 Z2" ); for( i = 0; i < m; i++ ) { xw1=( t1y[i]* t2z[i]- t1z[i]* t2y[i])* psalp[i]; yw1=( t1z[i]* t2x[i]- t1x[i]* t2z[i])* psalp[i]; zw1=( t1x[i]* t2y[i]- t1y[i]* t2x[i])* psalp[i]; fprintf( output_fp, "\n" " %4d %10.5LF %10.5LF %10.5LF %8.4LF %8.4LF %8.4LF" " %10.5LF %8.4LF %8.4LF %8.4LF %8.4LF %8.4LF %8.4LF", i+1, px[i], py[i], pz[i], xw1, yw1, zw1, pbi[i], t1x[i], t1y[i], t1z[i], t2x[i], t2y[i], t2z[i] ); } /* for( i = 0; i < m; i++ ) */ } /* if( m == 0) */ npm = n+m; np2m = n+2*m; np3m = n+3*m; return; /* "gm" card, move structure or reproduce */ /* original structure in new positions. */ case 5: fprintf( output_fp, "\n THE STRUCTURE HAS BEEN MOVED, MOVE DATA CARD IS:\n" " %3d %5d %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF", itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad ); xw1= xw1* TA; yw1= yw1* TA; zw1= zw1* TA; move( xw1, yw1, zw1, xw2, yw2, zw2, (int)( rad+.5), ns, itg); continue; case 6: /* "sp" card, generate single new patch */ i1= m+1; ns++; if( itg != 0) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } fprintf( output_fp, "\n" " %5d%c %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF", i1, ipt[ns-1], xw1, yw1, zw1, xw2, yw2, zw2 ); if( (ns == 2) || (ns == 4) ) isct=1; if( ns > 1) { readgm( gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if( (ns == 2) || (itg > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } fprintf( output_fp, "\n" " %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF", x3, y3, z3, x4, y4, z4 ); if( strcmp(gm, "SC") != 0 ) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } } /* if( ns > 1) */ else { xw2= xw2* TA; yw2= yw2* TA; } patch( itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 7: /* "sm" card, generate multiple-patch surface */ i1= m+1; fprintf( output_fp, "\n" " %5d%c %10.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF" " SURFACE - %d BY %d PATCHES", i1, ipt[1], xw1, yw1, zw1, xw2, yw2, zw2, itg, ns ); if( (itg < 1) || (ns < 1) ) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } readgm( gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if( (ns == 2) || (itg > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } fprintf( output_fp, "\n" " %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF", x3, y3, z3, x4, y4, z4 ); if( strcmp(gm, "SC" ) != 0 ) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } patch( itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 8: /* "ga" card, generate segment data for wire arc */ nwire++; i1= n+1; i2= n+ ns; fprintf( output_fp, "\n" " %5d ARC RADIUS: %9.5LF FROM: %8.3LF TO: %8.3LF DEGREES" " %11.5LF %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, ns, i1, i2, itg ); arc( itg, ns, xw1, yw1, zw1, xw2); continue; case 9: /* "sc" card */ if( isct == 0) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } i1= m+1; ns++; if( (itg != 0) || ((ns != 2) && (ns != 4)) ) { fprintf( output_fp, "\n PATCH DATA ERROR" ); stop(-1); } xs1= x4; ys1= y4; zs1= z4; xs2= x3; ys2= y3; zs2= z3; x3= xw1; y3= yw1; z3= zw1; if( ns == 4) { x4= xw2; y4= yw2; z4= zw2; } xw1= xs1; yw1= ys1; zw1= zs1; xw2= xs2; yw2= ys2; zw2= zs2; if( ns != 4) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } fprintf( output_fp, "\n" " %5d%c %10.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF", i1, ipt[ns-1], xw1, yw1, zw1, xw2, yw2, zw2 ); fprintf( output_fp, "\n" " %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF", x3, y3, z3, x4, y4, z4 ); patch( itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); continue; case 10: /* "gh" card, generate helix */ nwire++; i1= n+1; i2= n+ ns; fprintf( output_fp, "\n" " %5d HELIX STRUCTURE - SPACING OF TURNS: %8.3LF AXIAL" " LENGTH: %8.3LF %8.3LF %5d %5d %5d %4d\n " " RADIUS X1:%8.3LF Y1:%8.3LF X2:%8.3LF Y2:%8.3LF ", nwire, xw1, yw1, rad, ns, i1, i2, itg, zw1, xw2, yw2, zw2 ); helix( xw1, yw1, zw1, xw2, yw2, zw2, rad, ns, itg); continue; case 11: /* "gf" card, not supported */ abort_on_error(-5); default: /* error message */ fprintf( output_fp, "\n GEOMETRY DATA CARD ERROR" ); fprintf( output_fp, "\n" " %2s %3d %5d %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF", gm, itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad ); stop(-1); } /* switch( gm_num ) */ } /* do */ while( TRUE ); return; } /*-----------------------------------------------------------------------*/ /* subroutine helix generates segment geometry */ /* data for a helix of ns segments */ void helix( long double s, long double hl, long double a1, long double b1, long double a2, long double b2, long double rad, int ns, int itg ) { int ist, i, mreq; long double turns, zinc, copy, sangle, hdia, turn, pitch, hmaj, hmin; ist= n; n += ns; np= n; mp= m; ipsym=0; if( ns < 1) return; turns= fabsl( hl/ s); zinc= fabsl( hl/ ns); /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (n+m) * sizeof(int) );/*????*/ /* Reallocate wire buffers */ mreq = n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); z[ist]=0.; for( i = ist; i < n; i++ ) { bi[i]= rad; itag[i]= itg; if( i != ist ) z[i]= z[i-1]+ zinc; z2[i]= z[i]+ zinc; if( a2 == a1) { if( b1 == 0.) b1= a1; x[i]= a1* cosl(2.* PI* z[i]/ s); y[i]= b1* sinl(2.* PI* z[i]/ s); x2[i]= a1* cosl(2.* PI* z2[i]/ s); y2[i]= b1* sinl(2.* PI* z2[i]/ s); } else { if( b2 == 0.) b2= a2; x[i]=( a1+( a2- a1)* z[i]/ fabsl( hl))* cosl(2.* PI* z[i]/ s); y[i]=( b1+( b2- b1)* z[i]/ fabsl( hl))* sinl(2.* PI* z[i]/ s); x2[i]=( a1+( a2- a1)* z2[i]/ fabsl( hl))* cosl(2.* PI* z2[i]/ s); y2[i]=( b1+( b2- b1)* z2[i]/ fabsl( hl))* sinl(2.* PI* z2[i]/ s); } /* if( a2 == a1) */ if( hl > 0.) continue; copy= x[i]; x[i]= y[i]; y[i]= copy; copy= x2[i]; x2[i]= y2[i]; y2[i]= copy; } /* for( i = ist; i < n; i++ ) */ if( a2 != a1) { sangle= atanl( a2/( fabsl( hl)+( fabsl( hl)* a1)/( a2- a1))); fprintf( output_fp, "\n THE CONE ANGLE OF THE SPIRAL IS %10.4LF", sangle ); return; } if( a1 == b1) { hdia=2.* a1; turn= hdia* PI; pitch= atanl( s/( PI* hdia)); turn= turn/ cosl( pitch); pitch=180.* pitch/ PI; } else { if( a1 >= b1) { hmaj=2.* a1; hmin=2.* b1; } else { hmaj=2.* b1; hmin=2.* a1; } hdia= sqrtl(( hmaj*hmaj+ hmin*hmin)/2* hmaj); turn=2.* PI* hdia; pitch=(180./ PI)* atanl( s/( PI* hdia)); } /* if( a1 == b1) */ fprintf( output_fp, "\n" " THE PITCH ANGLE IS: %.4LF THE LENGTH OF WIRE/TURN IS: %.4LF", pitch, turn ); return; } /*-----------------------------------------------------------------------*/ /* isegno returns the segment number of the mth segment having the */ /* tag number itagi. if itagi=0 segment number m is returned. */ int isegno( int itagi, int mx) { int icnt, i, iseg; if( mx <= 0) { fprintf( output_fp, "\n CHECK DATA, PARAMETER SPECIFYING SEGMENT" " POSITION IN A GROUP OF EQUAL TAGS MUST NOT BE ZERO" ); stop(-1); } icnt=0; if( itagi == 0) { iseg = mx; return( iseg ); } if( n > 0) { for( i = 0; i < n; i++ ) { if( itag[i] != itagi ) continue; icnt++; if( icnt == mx) { iseg= i+1; return( iseg ); } } /* for( i = 0; i < n; i++ ) */ } /* if( n > 0) */ fprintf( output_fp, "\n\n" " NO SEGMENT HAS AN ITAG OF %d", itagi ); stop(-1); return(0); } /*-----------------------------------------------------------------------*/ /* subroutine move moves the structure with respect to its */ /* coordinate system or reproduces structure in new positions. */ /* structure is rotated about x,y,z axes by rox,roy,roz */ /* respectively, then shifted by xs,ys,zs */ void move( long double rox, long double roy, long double roz, long double xs, long double ys, long double zs, int its, int nrpt, int itgi ) { int nrp, ix, i1, k, ir, i, ii, mreq; long double sps, cps, sth, cth, sph, cph, xx, xy; long double xz, yx, yy, yz, zx, zy, zz, xi, yi, zi; if( fabsl( rox)+ fabsl( roy) > 1.0e-10) ipsym= ipsym*3; sps= sinl( rox); cps= cosl( rox); sth= sinl( roy); cth= cosl( roy); sph= sinl( roz); cph= cosl( roz); xx= cph* cth; xy= cph* sth* sps- sph* cps; xz= cph* sth* cps+ sph* sps; yx= sph* cth; yy= sph* sth* sps+ cph* cps; yz= sph* sth* cps- cph* sps; zx=- sth; zy= cth* sps; zz= cth* cps; if( nrpt == 0) nrp=1; else nrp= nrpt; ix=1; if( n > 0) { i1= isegno( its, 1); if( i1 < 1) i1= 1; ix= i1; if( nrpt == 0) k= i1-1; else { k= n; /* Reallocate tags buffer */ mreq = n+m + (n+1-i1)*nrpt; mem_realloc( (void *)&itag, mreq * sizeof(int) ); /* Reallocate wire buffers */ mreq = (n+(n+1-i1)*nrpt) * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); } for( ir = 0; ir < nrp; ir++ ) { for( i = i1-1; i < n; i++ ) { xi= x[i]; yi= y[i]; zi= z[i]; x[k]= xi* xx+ yi* xy+ zi* xz+ xs; y[k]= xi* yx+ yi* yy+ zi* yz+ ys; z[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= x2[i]; yi= y2[i]; zi= z2[i]; x2[k]= xi* xx+ yi* xy+ zi* xz+ xs; y2[k]= xi* yx+ yi* yy+ zi* yz+ ys; z2[k]= xi* zx+ yi* zy+ zi* zz+ zs; bi[k]= bi[i]; itag[k]= itag[i]; if( itag[i] != 0) itag[k]= itag[i]+ itgi; k++; } /* for( i = i1; i < n; i++ ) */ i1= n+1; n= k; } /* for( ir = 0; ir < nrp; ir++ ) */ } /* if( n >= n2) */ if( m > 0) { i1 = 0; if( nrpt == 0) k= 0; else k = m; /* Reallocate patch buffers */ mreq = m * (1+nrpt) * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); for( ii = 0; ii < nrp; ii++ ) { for( i = i1; i < m; i++ ) { xi= px[i]; yi= py[i]; zi= pz[i]; px[k]= xi* xx+ yi* xy+ zi* xz+ xs; py[k]= xi* yx+ yi* yy+ zi* yz+ ys; pz[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= t1x[i]; yi= t1y[i]; zi= t1z[i]; t1x[k]= xi* xx+ yi* xy+ zi* xz; t1y[k]= xi* yx+ yi* yy+ zi* yz; t1z[k]= xi* zx+ yi* zy+ zi* zz; xi= t2x[i]; yi= t2y[i]; zi= t2z[i]; t2x[k]= xi* xx+ yi* xy+ zi* xz; t2y[k]= xi* yx+ yi* yy+ zi* yz; t2z[k]= xi* zx+ yi* zy+ zi* zz; psalp[k]= psalp[i]; pbi[k]= pbi[i]; k++; } /* for( i = i1; i < m; i++ ) */ i1= m; m = k; } /* for( ii = 0; ii < nrp; ii++ ) */ } /* if( m >= m2) */ if( (nrpt == 0) && (ix == 1) ) return; np= n; mp= m; ipsym=0; return; } /*-----------------------------------------------------------------------*/ /* patch generates and modifies patch geometry data */ void patch( int nx, int ny, long double ax1, long double ay1, long double az1, long double ax2, long double ay2, long double az2, long double ax3, long double ay3, long double az3, long double ax4, long double ay4, long double az4 ) { int mi, ntp, iy, ix, mreq; long double s1x=0., s1y=0., s1z=0., s2x=0., s2y=0., s2z=0., xst=0.; long double znv, xnv, ynv, xa, xn2, yn2, zn2, salpn, xs, ys, zs, xt, yt, zt; /* new patches. for nx=0, ny=1,2,3,4 patch is (respectively) */; /* arbitrary, rectagular, triangular, or quadrilateral. */ /* for nx and ny > 0 a rectangular surface is produced with */ /* nx by ny rectangular patches. */ m++; mi= m-1; /* Reallocate patch buffers */ mreq = m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); if( nx > 0) ntp=2; else ntp= ny; if( ntp <= 1) { px[mi]= ax1; py[mi]= ay1; pz[mi]= az1; pbi[mi]= az2; znv= cosl( ax2); xnv= znv* cosl( ay2); ynv= znv* sinl( ay2); znv= sinl( ax2); xa= sqrtl( xnv* xnv+ ynv* ynv); if( xa >= 1.0e-6) { t1x[mi]=- ynv/ xa; t1y[mi]= xnv/ xa; t1z[mi]=0.; } else { t1x[mi]=1.; t1y[mi]=0.; t1z[mi]=0.; } } /* if( ntp <= 1) */ else { s1x= ax2- ax1; s1y= ay2- ay1; s1z= az2- az1; s2x= ax3- ax2; s2y= ay3- ay2; s2z= az3- az2; if( nx != 0) { s1x= s1x/ nx; s1y= s1y/ nx; s1z= s1z/ nx; s2x= s2x/ ny; s2y= s2y/ ny; s2z= s2z/ ny; } xnv= s1y* s2z- s1z* s2y; ynv= s1z* s2x- s1x* s2z; znv= s1x* s2y- s1y* s2x; xa= sqrtl( xnv* xnv+ ynv* ynv+ znv* znv); xnv= xnv/ xa; ynv= ynv/ xa; znv= znv/ xa; xst= sqrtl( s1x* s1x+ s1y* s1y+ s1z* s1z); t1x[mi]= s1x/ xst; t1y[mi]= s1y/ xst; t1z[mi]= s1z/ xst; if( ntp <= 2) { px[mi]= ax1+.5*( s1x+ s2x); py[mi]= ay1+.5*( s1y+ s2y); pz[mi]= az1+.5*( s1z+ s2z); pbi[mi]= xa; } else { if( ntp != 4) { px[mi]=( ax1+ ax2+ ax3)/3.; py[mi]=( ay1+ ay2+ ay3)/3.; pz[mi]=( az1+ az2+ az3)/3.; pbi[mi]=.5* xa; } else { s1x= ax3- ax1; s1y= ay3- ay1; s1z= az3- az1; s2x= ax4- ax1; s2y= ay4- ay1; s2z= az4- az1; xn2= s1y* s2z- s1z* s2y; yn2= s1z* s2x- s1x* s2z; zn2= s1x* s2y- s1y* s2x; xst= sqrtl( xn2* xn2+ yn2* yn2+ zn2* zn2); salpn=1./(3.*( xa+ xst)); px[mi]=( xa*( ax1+ ax2+ ax3)+ xst*( ax1+ ax3+ ax4))* salpn; py[mi]=( xa*( ay1+ ay2+ ay3)+ xst*( ay1+ ay3+ ay4))* salpn; pz[mi]=( xa*( az1+ az2+ az3)+ xst*( az1+ az3+ az4))* salpn; pbi[mi]=.5*( xa+ xst); s1x=( xnv* xn2+ ynv* yn2+ znv* zn2)/ xst; if( s1x <= 0.9998) { fprintf( output_fp, "\n ERROR -- CORNERS OF QUADRILATERAL" " PATCH DO NOT LIE IN A PLANE" ); stop(-1); } } /* if( ntp != 4) */ } /* if( ntp <= 2) */ } /* if( ntp <= 1) */ t2x[mi]= ynv* t1z[mi]- znv* t1y[mi]; t2y[mi]= znv* t1x[mi]- xnv* t1z[mi]; t2z[mi]= xnv* t1y[mi]- ynv* t1x[mi]; psalp[mi]=1.; if( nx != 0) { m += nx*ny-1; /* Reallocate patch buffers */ mreq = m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); xn2= px[mi]- s1x- s2x; yn2= py[mi]- s1y- s2y; zn2= pz[mi]- s1z- s2z; xs= t1x[mi]; ys= t1y[mi]; zs= t1z[mi]; xt= t2x[mi]; yt= t2y[mi]; zt= t2z[mi]; for( iy = 0; iy < ny; iy++ ) { xn2 += s2x; yn2 += s2y; zn2 += s2z; for( ix = 1; ix <= nx; ix++ ) { xst= (long double)ix; px[mi]= xn2+ xst* s1x; py[mi]= yn2+ xst* s1y; pz[mi]= zn2+ xst* s1z; pbi[mi]= xa; psalp[mi]=1.; t1x[mi]= xs; t1y[mi]= ys; t1z[mi]= zs; t2x[mi]= xt; t2y[mi]= yt; t2z[mi]= zt; mi++; } /* for( ix = 0; ix < nx; ix++ ) */ } /* for( iy = 0; iy < ny; iy++ ) */ } /* if( nx != 0) */ ipsym=0; np= n; mp= m; return; } /*-----------------------------------------------------------------------*/ /*** this function was an 'entry point' (part of) 'patch()' ***/ void subph( int nx, int ny ) { int mia, ix, iy, mi, mreq; long double xs, ys, zs, xa, xst, s1x, s1y, s1z, s2x, s2y, s2z, saln, xt, yt; /* Reallocate patch buffers */ if( ny == 0 ) m += 3; else m += 4; mreq = m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); /* Shift patches to make room for new ones */ if( (ny == 0) && (nx != m) ) { for( iy = m-1; iy > nx+2; iy-- ) { ix = iy-3; px[iy]= px[ix]; py[iy]= py[ix]; pz[iy]= pz[ix]; pbi[iy]= pbi[ix]; psalp[iy]= psalp[ix]; t1x[iy]= t1x[ix]; t1y[iy]= t1y[ix]; t1z[iy]= t1z[ix]; t2x[iy]= t2x[ix]; t2y[iy]= t2y[ix]; t2z[iy]= t2z[ix]; } } /* if( (ny == 0) || (nx != m) ) */ /* divide patch for connection */ mi= nx-1; xs= px[mi]; ys= py[mi]; zs= pz[mi]; xa= pbi[mi]/4.; xst= sqrtl( xa)/2.; s1x= t1x[mi]; s1y= t1y[mi]; s1z= t1z[mi]; s2x= t2x[mi]; s2y= t2y[mi]; s2z= t2z[mi]; saln= psalp[mi]; xt= xst; yt= xst; if( ny == 0) mia= mi; else { mp++; mia= m-1; } for( ix = 1; ix <= 4; ix++ ) { px[mia]= xs+ xt* s1x+ yt* s2x; py[mia]= ys+ xt* s1y+ yt* s2y; pz[mia]= zs+ xt* s1z+ yt* s2z; pbi[mia]= xa; t1x[mia]= s1x; t1y[mia]= s1y; t1z[mia]= s1z; t2x[mia]= s2x; t2y[mia]= s2y; t2z[mia]= s2z; psalp[mia]= saln; if( ix == 2) yt=- yt; if( (ix == 1) || (ix == 3) ) xt=- xt; mia++; } if( nx <= mp) mp += 3; if( ny > 0 ) pz[mi]=10000.; return; } /*-----------------------------------------------------------------------*/ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1, long double *z1, long double *x2, long double *y2, long double *z2, long double *rad ) { char line_buf[134]; int nlin, i, line_idx; int nint = 2, nflt = 7; int iarr[2] = { 0, 0 }; long double rarr[7] = { 0., 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ load_line( line_buf, input_fp ); /* get line length */ nlin= strlen( line_buf ); /* abort if card's mnemonic too short or missing */ if( nlin < 2 ) { fprintf( output_fp, "\n GEOMETRY DATA CARD ERROR:" "\n CARD'S MNEMONIC CODE TOO SHORT OR MISSING." ); stop(-1); } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if( strcmp( gm, "XT" ) == 0 ) { fprintf( stderr, "\nnec2c: Exiting after an \"XT\" command in readgm()\n" ); fprintf( output_fp, "\n\n nec2c: Exiting after an \"XT\" command in readgm()" ); stop(0); } /* Return if only mnemonic on card */ if( nlin == 2 ) { *i1 = *i2 = 0; *x1 = *y1 = *z1 = *x2 = *y2 = *z2 = *rad = 0.; return; } /* read integers from line */ line_idx = 1; for( i = 0; i < nint; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if( (line_buf[line_idx] == '\0') ) { *i1= iarr[0]; *i2= iarr[1]; *x1= rarr[0]; *y1= rarr[1]; *z1= rarr[2]; *x2= rarr[3]; *y2= rarr[4]; *z2= rarr[5]; *rad= rarr[6]; return; } /* read an integer from line */ iarr[i] = atoi( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { fprintf( output_fp, "\n GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); stop(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if( line_buf[line_idx] == '\0' ) { *i1= iarr[0]; *i2= iarr[1]; *x1= rarr[0]; *y1= rarr[1]; *z1= rarr[2]; *x2= rarr[3]; *y2= rarr[4]; *z2= rarr[5]; *rad= rarr[6]; return; } } /* for( i = 0; i < nint; i++ ) */ /* read long doubles from line */ for( i = 0; i < nflt; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if( (line_buf[line_idx] == '\0') ) { *i1= iarr[0]; *i2= iarr[1]; *x1= rarr[0]; *y1= rarr[1]; *z1= rarr[2]; *x2= rarr[3]; *y2= rarr[4]; *z2= rarr[5]; *rad= rarr[6]; return; } /* read a long double from line */ rarr[i] = atof( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { fprintf( output_fp, "\n GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d.\n", gm, line_buf[line_idx], (line_idx+1) ); stop(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if( line_buf[line_idx] == '\0' ) { *i1= iarr[0]; *i2= iarr[1]; *x1= rarr[0]; *y1= rarr[1]; *z1= rarr[2]; *x2= rarr[3]; *y2= rarr[4]; *z2= rarr[5]; *rad= rarr[6]; return; } } /* for( i = 0; i < nflt; i++ ) */ *i1 = iarr[0]; *i2 = iarr[1]; *x1 = rarr[0]; *y1 = rarr[1]; *z1 = rarr[2]; *x2 = rarr[3]; *y2 = rarr[4]; *z2 = rarr[5]; *rad = rarr[6]; return; } /*-----------------------------------------------------------------------*/ /* reflc reflects partial structure along x,y, or z axes or rotates */ /* structure to complete a symmetric structure. */ void reflc( int ix, int iy, int iz, int itx, int nop ) { int iti, i, nx, itagi, k, mreq; long double e1, e2, fnop, sam, cs, ss, xk, yk; np= n; mp= m; ipsym=0; iti= itx; if( ix >= 0) { if( nop == 0) return; ipsym=1; /* reflect along z axis */ if( iz != 0) { ipsym=2; if( n > 0 ) { /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (2*n+m) * sizeof(int) ); /* Reallocate wire buffers */ mreq = 2*n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); for( i = 0; i < n; i++ ) { nx= i+ n; e1= z[i]; e2= z2[i]; if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--SEGMENT %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } x[nx]= x[i]; y[nx]= y[i]; z[nx]=- e1; x2[nx]= x2[i]; y2[nx]= y2[i]; z2[nx]=- e2; itagi= itag[i]; if( itagi == 0) itag[nx]=0; if( itagi != 0) itag[nx]= itagi+ iti; bi[nx]= bi[i]; } /* for( i = 0; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if( n > 0) */ if( m > 0 ) { /* Reallocate patch buffers */ mreq = 2*m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); for( i = 0; i < m; i++ ) { nx = i+m; if( fabsl(pz[i]) <= 1.0e-10) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--PATCH %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } px[nx]= px[i]; py[nx]= py[i]; pz[nx]=- pz[i]; t1x[nx]= t1x[i]; t1y[nx]= t1y[i]; t1z[nx]=- t1z[i]; t2x[nx]= t2x[i]; t2y[nx]= t2y[i]; t2z[nx]=- t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; } /* if( m >= m2) */ } /* if( iz != 0) */ /* reflect along y axis */ if( iy != 0) { if( n > 0) { /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (2*n+m) * sizeof(int) );/*????*/ /* Reallocate wire buffers */ mreq = 2*n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); for( i = 0; i < n; i++ ) { nx= i+ n; e1= y[i]; e2= y2[i]; if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--SEGMENT %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } x[nx]= x[i]; y[nx]=- e1; z[nx]= z[i]; x2[nx]= x2[i]; y2[nx]=- e2; z2[nx]= z2[i]; itagi= itag[i]; if( itagi == 0) itag[nx]=0; if( itagi != 0) itag[nx]= itagi+ iti; bi[nx]= bi[i]; } /* for( i = n2-1; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if( n >= n2) */ if( m > 0 ) { /* Reallocate patch buffers */ mreq = 2*m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); for( i = 0; i < m; i++ ) { nx= i+m; if( fabsl( py[i]) <= 1.0e-10) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--PATCH %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } px[nx]= px[i]; py[nx]=- py[i]; pz[nx]= pz[i]; t1x[nx]= t1x[i]; t1y[nx]=- t1y[i]; t1z[nx]= t1z[i]; t2x[nx]= t2x[i]; t2y[nx]=- t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } /* for( i = m2; i <= m; i++ ) */ m= m*2; } /* if( m >= m2) */ } /* if( iy != 0) */ /* reflect along x axis */ if( ix == 0 ) return; if( n > 0 ) { /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (2*n+m) * sizeof(int) );/*????*/ /* Reallocate wire buffers */ mreq = 2*n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); for( i = 0; i < n; i++ ) { nx= i+ n; e1= x[i]; e2= x2[i]; if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--SEGMENT %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } x[nx]=- e1; y[nx]= y[i]; z[nx]= z[i]; x2[nx]=- e2; y2[nx]= y2[i]; z2[nx]= z2[i]; itagi= itag[i]; if( itagi == 0) itag[nx]=0; if( itagi != 0) itag[nx]= itagi+ iti; bi[nx]= bi[i]; } n= n*2; } /* if( n > 0) */ if( m == 0 ) return; /* Reallocate patch buffers */ mreq = 2*m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); for( i = 0; i < m; i++ ) { nx= i+m; if( fabsl( px[i]) <= 1.0e-10) { fprintf( output_fp, "\n GEOMETRY DATA ERROR--PATCH %d" " LIES IN PLANE OF SYMMETRY", i+1 ); stop(-1); } px[nx]=- px[i]; py[nx]= py[i]; pz[nx]= pz[i]; t1x[nx]=- t1x[i]; t1y[nx]= t1y[i]; t1z[nx]= t1z[i]; t2x[nx]=- t2x[i]; t2y[nx]= t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; return; } /* if( ix >= 0) */ /* reproduce structure with rotation to form cylindrical structure */ fnop= (long double)nop; ipsym=-1; sam=TP/ fnop; cs= cosl( sam); ss= sinl( sam); if( n > 0) { n *= nop; nx= np; /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (n+m) * sizeof(int) );/*????*/ /* Reallocate wire buffers */ mreq = n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); for( i = nx; i < n; i++ ) { k= i- np; xk= x[k]; yk= y[k]; x[i]= xk* cs- yk* ss; y[i]= xk* ss+ yk* cs; z[i]= z[k]; xk= x2[k]; yk= y2[k]; x2[i]= xk* cs- yk* ss; y2[i]= xk* ss+ yk* cs; z2[i]= z2[k]; bi[i]= bi[k]; itagi= itag[k]; if( itagi == 0) itag[i]=0; if( itagi != 0) itag[i]= itagi+ iti; } } /* if( n >= n2) */ if( m == 0 ) return; m *= nop; nx= mp; /* Reallocate patch buffers */ mreq = m * sizeof(long double); mem_realloc( (void *)&px, mreq ); mem_realloc( (void *)&py, mreq ); mem_realloc( (void *)&pz, mreq ); mem_realloc( (void *)&t1x, mreq ); mem_realloc( (void *)&t1y, mreq ); mem_realloc( (void *)&t1z, mreq ); mem_realloc( (void *)&t2x, mreq ); mem_realloc( (void *)&t2y, mreq ); mem_realloc( (void *)&t2z, mreq ); mem_realloc( (void *)&pbi, mreq ); mem_realloc( (void *)&psalp, mreq ); for( i = nx; i < m; i++ ) { k = i-mp; xk= px[k]; yk= py[k]; px[i]= xk* cs- yk* ss; py[i]= xk* ss+ yk* cs; pz[i]= pz[k]; xk= t1x[k]; yk= t1y[k]; t1x[i]= xk* cs- yk* ss; t1y[i]= xk* ss+ yk* cs; t1z[i]= t1z[k]; xk= t2x[k]; yk= t2y[k]; t2x[i]= xk* cs- yk* ss; t2y[i]= xk* ss+ yk* cs; t2z[i]= t2z[k]; psalp[i]= psalp[k]; pbi[i]= pbi[k]; } /* for( i = nx; i < m; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* subroutine wire generates segment geometry */ /* data for a straight wire of ns segments. */ void wire( long double xw1, long double yw1, long double zw1, long double xw2, long double yw2, long double zw2, long double rad, long double rdel, long double rrad, int ns, int itg ) { int ist, i, mreq; long double xd, yd, zd, delz, rd, fns, radz; long double xs1, ys1, zs1, xs2, ys2, zs2; ist= n; n= n+ ns; np= n; mp= m; ipsym=0; if( ns < 1) return; /* Reallocate tags buffer */ mem_realloc( (void *)&itag, (n+m) * sizeof(int) );/*????*/ /* Reallocate wire buffers */ mreq = n * sizeof(long double); mem_realloc( (void *)&x, mreq ); mem_realloc( (void *)&y, mreq ); mem_realloc( (void *)&z, mreq ); mem_realloc( (void *)&x2, mreq ); mem_realloc( (void *)&y2, mreq ); mem_realloc( (void *)&z2, mreq ); mem_realloc( (void *)&bi, mreq ); xd= xw2- xw1; yd= yw2- yw1; zd= zw2- zw1; if( fabsl( rdel-1.) >= 1.0e-6) { delz= sqrtl( xd* xd+ yd* yd+ zd* zd); xd= xd/ delz; yd= yd/ delz; zd= zd/ delz; delz= delz*(1.- rdel)/(1.- powl(rdel, ns) ); rd= rdel; } else { fns= ns; xd= xd/ fns; yd= yd/ fns; zd= zd/ fns; delz=1.; rd=1.; } radz= rad; xs1= xw1; ys1= yw1; zs1= zw1; for( i = ist; i < n; i++ ) { itag[i]= itg; xs2= xs1+ xd* delz; ys2= ys1+ yd* delz; zs2= zs1+ zd* delz; x[i]= xs1; y[i]= ys1; z[i]= zs1; x2[i]= xs2; y2[i]= ys2; z2[i]= zs2; bi[i]= radz; delz= delz* rd; radz= radz* rrad; xs1= xs2; ys1= ys2; zs1= zs2; } x2[n-1]= xw2; y2[n-1]= yw2; z2[n-1]= zw2; return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/matrix.c0000644000175000017500000007406010310210756015445 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /dataj/ */ extern int iexk, ind1, indd1, ind2, indd2, ipgnd; extern long double s, b, xj, yj, zj, cabj, sabj, salpj, rkh; extern long double t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; extern complex long double exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* common /matpar/ */ extern int icase, npblk, nlast; extern int imat, nbbx, npbx, nlbx, nbbl, npbl, nlbl; /* common /segj/ */ extern int *jco, jsno, nscon, maxcon; /* Max. no. connections */ extern long double *ax, *bx, *cx; /* common /zload/ */ extern int nload; extern complex long double *zarray; /* common /smat/ */ extern int nop; /* My addition */ extern complex long double *ssx; /* common /gnd/ */ extern int ksymp, ifar, iperf, nradl; extern long double t2, cl, ch, scrwl, scrwr; extern complex long double zrati, zrati2, t1, frati; /* common /vsorc/ */ extern int *ivqd, *isant, *iqds, nvqd, nsant, nqds; extern complex long double *vqd, *vqds, *vsant; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*-------------------------------------------------------------------*/ /* cmset sets up the complex structure matrix in the array cm */ void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx ) { int mp2, neq, npeq, iout, it, i, j, i1, i2, in2; int im1, im2, ist, ij, ipr, jss, jm1, jm2, jst, k, ka, kk; complex long double zaj, deter, *scm = NULL; mp2=2* mp; npeq= np+ mp2; neq= n+2* m; rkh= rkhx; iexk= iexkx; iout=2* npblk* nrow; it= nlast; for( i = 0; i < nrow; i++ ) for( j = 0; j < it; j++ ) cm[i+j*nrow]= CPLX_00; i1= 1; i2= it; in2= i2; if( in2 > np) in2= np; im1= i1- np; im2= i2- np; if( im1 < 1) im1=1; ist=1; if( i1 <= np) ist= np- i1+2; /* wire source loop */ if( n != 0) { for( j = 1; j <= n; j++ ) { trio(j); for( i = 0; i < jsno; i++ ) { ij= jco[i]; jco[i]=(( ij-1)/ np)* mp2+ ij; } if( i1 <= in2) cmww( j, i1, in2, cm, nrow, cm, nrow,1); if( im1 <= im2) cmws( j, im1, im2, &cm[(ist-1)*nrow], nrow, cm, nrow, 1); /* matrix elements modified by loading */ if( nload == 0) continue; if( j > np) continue; ipr= j; if( (ipr < 1) || (ipr > it) ) continue; zaj= zarray[j-1]; for( i = 0; i < jsno; i++ ) { jss= jco[i]; cm[(jss-1)+(ipr-1)*nrow] -= ( ax[i]+ cx[i])* zaj; } } /* for( j = 1; j <= n; j++ ) */ } /* if( n != 0) */ if( m != 0) { /* matrix elements for patch current sources */ jm1=1- mp; jm2=0; jst=1- mp2; for( i = 0; i < nop; i++ ) { jm1 += mp; jm2 += mp; jst += npeq; if( i1 <= in2) cmsw( jm1, jm2, i1, in2, &cm[(jst-1)], cm, 0, nrow, 1); if( im1 <= im2) cmss( jm1, jm2, im1, im2, &cm[(jst-1)+(ist-1)*nrow], nrow, 1); } } /* if( m != 0) */ if( icase == 1) return; /* Allocate to scratch memory */ mem_alloc( (void *)&scm, np2m * sizeof(complex long double) ); /* combine elements for symmetry modes */ for( i = 0; i < it; i++ ) { for( j = 0; j < npeq; j++ ) { for( k = 0; k < nop; k++ ) { ka= j+ k*npeq; scm[k]= cm[ka+i*nrow]; } deter= scm[0]; for( kk = 1; kk < nop; kk++ ) deter += scm[kk]; cm[j+i*nrow]= deter; for( k = 1; k < nop; k++ ) { ka= j+ k*npeq; deter= scm[0]; for( kk = 1; kk < nop; kk++ ) { deter += scm[kk]* ssx[k+kk*nop]; cm[ka+i*nrow]= deter; } } /* for( k = 1; k < nop; k++ ) */ } /* for( j = 0; j < npeq; j++ ) */ } /* for( i = 0; i < it; i++ ) */ free_ptr( (void *)&scm ); return; } /*-----------------------------------------------------------------------*/ /* cmss computes matrix elements for surface-surface interactions. */ void cmss( int j1, int j2, int im1, int im2, complex long double *cm, int nrow, int itrp ) { int i1, i2, icomp, ii1, i, il, ii2, jj1, j, jl, jj2; long double t1xi, t1yi, t1zi, t2xi, t2yi, t2zi, xi, yi, zi; complex long double g11, g12, g21, g22; i1=( im1+1)/2; i2=( im2+1)/2; icomp= i1*2-3; ii1=-2; if( icomp+2 < im1) ii1=-3; /* loop over observation patches */ il = -1; for( i = i1; i <= i2; i++ ) { il++; icomp += 2; ii1 += 2; ii2 = ii1+1; t1xi= t1x[il]* psalp[il]; t1yi= t1y[il]* psalp[il]; t1zi= t1z[il]* psalp[il]; t2xi= t2x[il]* psalp[il]; t2yi= t2y[il]* psalp[il]; t2zi= t2z[il]* psalp[il]; xi= px[il]; yi= py[il]; zi= pz[il]; /* loop over source patches */ jj1=-2; for( j = j1; j <= j2; j++ ) { jl=j-1; jj1 += 2; jj2 = jj1+1; s= pbi[jl]; xj= px[jl]; yj= py[jl]; zj= pz[jl]; t1xj= t1x[jl]; t1yj= t1y[jl]; t1zj= t1z[jl]; t2xj= t2x[jl]; t2yj= t2y[jl]; t2zj= t2z[jl]; hintg( xi, yi, zi); g11=-( t2xi* exk+ t2yi* eyk+ t2zi* ezk); g12=-( t2xi* exs+ t2yi* eys+ t2zi* ezs); g21=-( t1xi* exk+ t1yi* eyk+ t1zi* ezk); g22=-( t1xi* exs+ t1yi* eys+ t1zi* ezs); if( i == j ) { g11 -= .5; g22 += .5; } /* normal fill */ if( itrp == 0) { if( icomp >= im1 ) { cm[ii1+jj1*nrow]= g11; cm[ii1+jj2*nrow]= g12; } if( icomp >= im2 ) continue; cm[ii2+jj1*nrow]= g21; cm[ii2+jj2*nrow]= g22; continue; } /* if( itrp == 0) */ /* transposed fill */ if( icomp >= im1 ) { cm[jj1+ii1*nrow]= g11; cm[jj2+ii1*nrow]= g12; } if( icomp >= im2 ) continue; cm[jj1+ii2*nrow]= g21; cm[jj2+ii2*nrow]= g22; } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1; i <= i2; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* computes matrix elements for e along wires due to patch current */ void cmsw( int j1, int j2, int i1, int i2, complex long double *cm, complex long double *cw, int ncw, int nrow, int itrp ) { int neqs, k, icgo, i, ipch, jl, j, js, il, ip; int jsnox; /* -1 offset to "jsno" for array indexing */ long double xi, yi, zi, cabi, sabi, salpi, fsign=1., pyl, pxl; complex long double emel[9]; neqs= np2m; jsnox = jsno-1; if( itrp >= 0) { k=-1; icgo=0; /* observation loop */ for( i = i1-1; i < i2; i++ ) { k++; xi= x[i]; yi= y[i]; zi= z[i]; cabi= cab[i]; sabi= sab[i]; salpi= salp[i]; ipch=0; if( icon1[i] >= PCHCON) { ipch= icon1[i]-PCHCON; fsign=-1.; } if( icon2[i] >= PCHCON) { ipch= icon2[i]-PCHCON; fsign=1.; } /* source loop */ jl = -1; for( j = j1; j <= j2; j++ ) { jl += 2; js = j-1; t1xj= t1x[js]; t1yj= t1y[js]; t1zj= t1z[js]; t2xj= t2x[js]; t2yj= t2y[js]; t2zj= t2z[js]; xj= px[js]; yj= py[js]; zj= pz[js]; s= pbi[js]; /* ground loop */ for( ip = 1; ip <= ksymp; ip++ ) { ipgnd= ip; if( ((ipch == j) || (icgo != 0)) && (ip != 2) ) { if( icgo <= 0 ) { pcint( xi, yi, zi, cabi, sabi, salpi, emel); pyl= PI* si[i]* fsign; pxl= sinl( pyl); pyl= cosl( pyl); exc= emel[8]* fsign; trio(i+1); il= i-ncw; if( i < np) il += (il/np)*2*mp; if( itrp == 0 ) cw[k+il*nrow] += exc*( ax[jsnox]+ bx[jsnox]* pxl+ cx[jsnox]* pyl); else cw[il+k*nrow] += exc*( ax[jsnox]+ bx[jsnox]* pxl+ cx[jsnox]* pyl); } /* if( icgo <= 0 ) */ if( itrp == 0) { cm[k+(jl-1)*nrow]= emel[icgo]; cm[k+jl*nrow] = emel[icgo+4]; } else { cm[(jl-1)+k*nrow]= emel[icgo]; cm[jl+k*nrow] = emel[icgo+4]; } icgo++; if( icgo == 4) icgo=0; continue; } /* if( ((ipch == (j+1)) || (icgo != 0)) && (ip != 2) ) */ unere( xi, yi, zi); /* normal fill */ if( itrp == 0) { cm[k+(jl-1)*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; cm[k+jl*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; continue; } /* transposed fill */ cm[(jl-1)+k*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; cm[jl+k*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; } /* for( ip = 1; ip <= ksymp; ip++ ) */ } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ } /* if( itrp >= 0) */ return; } /*-----------------------------------------------------------------------*/ /* cmws computes matrix elements for wire-surface interactions */ void cmws( int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp ) { int ipr, i, ipatch, ik, js=0, ij, jx; long double xi, yi, zi, tx, ty, tz; complex long double etk, ets, etc; j--; s= si[j]; b= bi[j]; xj= x[j]; yj= y[j]; zj= z[j]; cabj= cab[j]; sabj= sab[j]; salpj= salp[j]; /* observation loop */ ipr= -1; for( i = i1; i <= i2; i++ ) { ipr++; ipatch=(i+1)/2; ik= i-( i/2)*2; if( (ik != 0) || (ipr == 0) ) { js= ipatch-1; xi= px[js]; yi= py[js]; zi= pz[js]; hsfld( xi, yi, zi,0.); if( ik != 0 ) { tx= t2x[js]; ty= t2y[js]; tz= t2z[js]; } else { tx= t1x[js]; ty= t1y[js]; tz= t1z[js]; } } /* if( (ik != 0) || (ipr == 0) ) */ else { tx= t1x[js]; ty= t1y[js]; tz= t1z[js]; } /* if( (ik != 0) || (ipr == 0) ) */ etk=-( exk* tx+ eyk* ty+ ezk* tz)* psalp[js]; ets=-( exs* tx+ eys* ty+ ezs* tz)* psalp[js]; etc=-( exc* tx+ eyc* ty+ ezc* tz)* psalp[js]; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if( itrp == 0) { for( ij = 0; ij < jsno; ij++ ) { jx= jco[ij]-1; cm[ipr+jx*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } continue; } /* if( itrp == 0) */ /* transposed fill */ if( itrp != 2) { for( ij = 0; ij < jsno; ij++ ) { jx= jco[ij]-1; cm[jx+ipr*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } continue; } /* if( itrp != 2) */ /* transposed fill - c(ws) and d(ws)prime (=cw) */ for( ij = 0; ij < jsno; ij++ ) { jx= jco[ij]-1; if( jx < nr) cm[jx+ipr*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; else { jx -= nr; cw[jx+ipr*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } } /* for( ij = 0; ij < jsno; ij++ ) */ } /* for( i = i1; i <= i2; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* cmww computes matrix elements for wire-wire interactions */ void cmww( int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp) { int ipr, iprx, i, ij, jx; long double xi, yi, zi, ai, cabi, sabi, salpi; complex long double etk, ets, etc; /* set source segment parameters */ jx = j; j--; s= si[j]; b= bi[j]; xj= x[j]; yj= y[j]; zj= z[j]; cabj= cab[j]; sabj= sab[j]; salpj= salp[j]; /* decide whether ext. t.w. approx. can be used */ if( iexk != 0) { ipr = icon1[j]; if( ipr < 0 ) { ipr= -ipr; iprx= ipr-1; if( -icon1[iprx] != jx ) ind1=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.e-6) ) ind1=2; else ind1=0; } /* if( -icon1[iprx] != jx ) */ } /* if( ipr < 0 ) */ else { iprx = ipr-1; if( ipr == 0 ) ind1=1; else { if( ipr != jx ) { if( icon2[iprx] != jx ) ind1=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.e-6) ) ind1=2; else ind1=0; } /* if( icon2[iprx] != jx ) */ } /* if( ipr != jx ) */ else if( cabj* cabj+ sabj* sabj > 1.e-8) ind1=2; else ind1=0; } /* if( ipr == 0 ) */ } /* if( ipr < 0 ) */ ipr = icon2[j]; if( ipr < 0 ) { ipr= -ipr; iprx = ipr-1; if( -icon2[iprx] != jx ) ind2=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.e-6) ) ind2=2; else ind2=0; } /* if( -icon1[iprx] != jx ) */ } /* if( ipr < 0 ) */ else { iprx = ipr-1; if( ipr == 0 ) ind2=1; else { if( ipr != jx ) { if( icon1[iprx] != jx ) ind2=2; else { xi= fabsl( cabj* cab[iprx]+ sabj* sab[iprx]+ salpj* salp[iprx]); if( (xi < 0.999999) || (fabsl(bi[iprx]/b-1.) > 1.e-6) ) ind2=2; else ind2=0; } /* if( icon2[iprx] != jx ) */ } /* if( ipr != jx ) */ else if( cabj* cabj+ sabj* sabj > 1.e-8) ind2=2; else ind2=0; } /* if( ipr == 0 ) */ } /* if( ipr < 0 ) */ } /* if( iexk != 0) */ /* observation loop */ ipr=-1; for( i = i1-1; i < i2; i++ ) { ipr++; ij= i-j; xi= x[i]; yi= y[i]; zi= z[i]; ai= bi[i]; cabi= cab[i]; sabi= sab[i]; salpi= salp[i]; efld( xi, yi, zi, ai, ij); etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if( itrp == 0) { for( ij = 0; ij < jsno; ij++ ) { jx = jco[ij]-1; cm[ipr+jx*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } continue; } /* transposed fill */ if( itrp != 2) { for( ij = 0; ij < jsno; ij++ ) { jx= jco[ij]-1; cm[jx+ipr*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } continue; } /* trans. fill for c(ww) - test for elements for d(ww)prime. (=cw) */ for( ij = 0; ij < jsno; ij++ ) { jx= jco[ij]-1; if( jx < nr) cm[jx+ipr*nr] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; else { jx -= nr; cw[jx*ipr*nw] += etk* ax[ij]+ ets* bx[ij]+ etc* cx[ij]; } } /* for( ij = 0; ij < jsno; ij++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* etmns fills the array e with the negative of the */ /* electric field incident on the structure. e is the */ /* right hand side of the matrix equation. */ void etmns( long double p1, long double p2, long double p3, long double p4, long double p5, long double p6, int ipr, complex long double *e ) { int i, is, i1, i2=0, neq; long double cth, sth, cph, sph, cet, set, pxl, pyl, pzl, wx; long double wy, wz, qx, qy, qz, arg, ds, dsh, rs, r; complex long double cx, cy, cz, er, et, ezh, erh, rrv, rrh, tt1, tt2; neq= n+2*m; nqds=0; /* applied field of voltage sources for transmitting case */ if( (ipr <= 0) || (ipr == 5) ) { for( i = 0; i < neq; i++ ) e[i]=CPLX_00; if( nsant != 0) { for( i = 0; i < nsant; i++ ) { is= isant[i]-1; e[is]= -vsant[i]/( si[is]* wlam); } } if( nvqd == 0) return; for( i = 0; i < nvqd; i++ ) { is= ivqd[i]; qdsrc( is, vqd[i], e); } return; } /* if( (ipr <= 0) || (ipr == 5) ) */ /* incident plane wave, linearly polarized. */ if( ipr <= 3) { cth= cosl( p1); sth= sinl( p1); cph= cosl( p2); sph= sinl( p2); cet= cosl( p3); set= sinl( p3); pxl= cth* cph* cet- sph* set; pyl= cth* sph* cet+ cph* set; pzl=- sth* cet; wx=- sth* cph; wy=- sth* sph; wz=- cth; qx= wy* pzl- wz* pyl; qy= wz* pxl- wx* pzl; qz= wx* pyl- wy* pxl; if( ksymp != 1) { if( iperf != 1) { rrv= csqrtl(1.- zrati* zrati* sth* sth); rrh= zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); } else { rrv=-CPLX_10; rrh=-CPLX_10; } /* if( iperf != 1) */ } /* if( ksymp != 1) */ if( ipr <= 1) { if( n != 0) { for( i = 0; i < n; i++ ) { arg=- TP*( wx* x[i]+ wy* y[i]+ wz* z[i]); e[i]=-( pxl* cab[i]+ pyl* sab[i]+ pzl* salp[i])* cmplx( cosl( arg), sinl( arg)); } if( ksymp != 1) { tt1=( pyl* cph- pxl* sph)*( rrh- rrv); cx= rrv* pxl- tt1* sph; cy= rrv* pyl+ tt1* cph; cz=- rrv* pzl; for( i = 0; i < n; i++ ) { arg=- TP*( wx* x[i]+ wy* y[i]- wz* z[i]); e[i]= e[i]-( cx* cab[i]+ cy* sab[i]+ cz* salp[i])* cmplx(cosl( arg), sinl( arg)); } } /* if( ksymp != 1) */ } /* if( n != 0) */ if( m == 0) return; i= -1; i1= n-2; for( is = 0; is < m; is++ ) { i++; i1 += 2; i2 = i1+1; arg=- TP*( wx* px[i]+ wy* py[i]+ wz* pz[i]); tt1= cmplx( cosl( arg), sinl( arg))* psalp[i]* RETA; e[i2]=( qx* t1x[i]+ qy* t1y[i]+ qz* t1z[i])* tt1; e[i1]=( qx* t2x[i]+ qy* t2y[i]+ qz* t2z[i])* tt1; } if( ksymp == 1) return; tt1=( qy* cph- qx* sph)*( rrv- rrh); cx=-( rrh* qx- tt1* sph); cy=-( rrh* qy+ tt1* cph); cz= rrh* qz; i= -1; i1= n-2; for( is = 0; is < m; is++ ) { i++; i1 += 2; i2 = i1+1; arg=- TP*( wx* px[i]+ wy* py[i]- wz* pz[i]); tt1= cmplx( cosl( arg), sinl( arg))* psalp[i]* RETA; e[i2]= e[i2]+( cx* t1x[i]+ cy* t1y[i]+ cz* t1z[i])* tt1; e[i1]= e[i1]+( cx* t2x[i]+ cy* t2y[i]+ cz* t2z[i])* tt1; } return; } /* if( ipr <= 1) */ /* incident plane wave, elliptic polarization. */ tt1=-(CPLX_01)* p6; if( ipr == 3) tt1=- tt1; if( n != 0) { cx= pxl+ tt1* qx; cy= pyl+ tt1* qy; cz= pzl+ tt1* qz; for( i = 0; i < n; i++ ) { arg=- TP*( wx* x[i]+ wy* y[i]+ wz* z[i]); e[i]=-( cx* cab[i]+ cy* sab[i]+ cz* salp[i])* cmplx( cosl( arg), sinl( arg)); } if( ksymp != 1) { tt2=( cy* cph- cx* sph)*( rrh- rrv); cx= rrv* cx- tt2* sph; cy= rrv* cy+ tt2* cph; cz=- rrv* cz; for( i = 0; i < n; i++ ) { arg=- TP*( wx* x[i]+ wy* y[i]- wz* z[i]); e[i]= e[i]-( cx* cab[i]+ cy* sab[i]+ cz* salp[i])* cmplx(cosl( arg), sinl( arg)); } } /* if( ksymp != 1) */ } /* if( n != 0) */ if( m == 0) return; cx= qx- tt1* pxl; cy= qy- tt1* pyl; cz= qz- tt1* pzl; i= -1; i1= n-2; for( is = 0; is < m; is++ ) { i++; i1 += 2; i2 = i1+1; arg=- TP*( wx* px[i]+ wy* py[i]+ wz* pz[i]); tt2= cmplx( cosl( arg), sinl( arg))* psalp[i]* RETA; e[i2]=( cx* t1x[i]+ cy* t1y[i]+ cz* t1z[i])* tt2; e[i1]=( cx* t2x[i]+ cy* t2y[i]+ cz* t2z[i])* tt2; } if( ksymp == 1) return; tt1=( cy* cph- cx* sph)*( rrv- rrh); cx=-( rrh* cx- tt1* sph); cy=-( rrh* cy+ tt1* cph); cz= rrh* cz; i= -1; i1= n-2; for( is=0; is < m; is++ ) { i++; i1 += 2; i2 = i1+1; arg=- TP*( wx* px[i]+ wy* py[i]- wz* pz[i]); tt1= cmplx( cosl( arg), sinl( arg))* psalp[i]* RETA; e[i2]= e[i2]+( cx* t1x[i]+ cy* t1y[i]+ cz* t1z[i])* tt1; e[i1]= e[i1]+( cx* t2x[i]+ cy* t2y[i]+ cz* t2z[i])* tt1; } return; } /* if( ipr <= 3) */ /* incident field of an elementary current source. */ wz= cosl( p4); wx= wz* cosl( p5); wy= wz* sinl( p5); wz= sinl( p4); ds= p6*59.958; dsh= p6/(2.* TP); is= 0; i1= n-2; for( i = 0; i < npm; i++ ) { if( i >= n ) { i1 += 2; i2 = i1+1; pxl= px[is]- p1; pyl= py[is]- p2; pzl= pz[is]- p3; is++; } pxl= x[i]- p1; pyl= y[i]- p2; pzl= z[i]- p3; rs= pxl* pxl+ pyl* pyl+ pzl* pzl; if( rs < 1.0e-30) continue; r= sqrtl( rs); pxl= pxl/ r; pyl= pyl/ r; pzl= pzl/ r; cth= pxl* wx+ pyl* wy+ pzl* wz; sth= sqrtl(1.- cth* cth); qx= pxl- wx* cth; qy= pyl- wy* cth; qz= pzl- wz* cth; arg= sqrtl( qx* qx+ qy* qy+ qz* qz); if( arg >= 1.e-30) { qx= qx/ arg; qy= qy/ arg; qz= qz/ arg; } else { qx=1.; qy=0.; qz=0.; } /* if( arg >= 1.e-30) */ arg=- TP* r; tt1= cmplx( cosl( arg), sinl( arg)); if( i < n ) { tt2= cmplx(1.0,-1.0/( r* TP))/ rs; er= ds* tt1* tt2* cth; et=.5* ds* tt1*((CPLX_01)* TP/ r+ tt2)* sth; ezh= er* cth- et* sth; erh= er* sth+ et* cth; cx= ezh* wx+ erh* qx; cy= ezh* wy+ erh* qy; cz= ezh* wz+ erh* qz; e[i]=-( cx* cab[i]+ cy* sab[i]+ cz* salp[i]); } else { pxl= wy* qz- wz* qy; pyl= wz* qx- wx* qz; pzl= wx* qy- wy* qx; tt2= dsh* tt1* cmplx(1./ r, TP)/ r* sth* psalp[is]; cx= tt2* pxl; cy= tt2* pyl; cz= tt2* pzl; e[i2]= cx* t1x[is]+ cy* t1y[is]+ cz* t1z[is]; e[i1]= cx* t2x[is]+ cy* t2y[is]+ cz* t2z[is]; } /* if( i >= n) */ } /* for( i = 0; i < npm; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* subroutine to factor a matrix into a unit lower triangular matrix */ /* and an upper triangular matrix using the gauss-doolittle algorithm */ /* presented on pages 411-416 of a. ralston--a first course in */ /* numerical analysis. comments below refer to comments in ralstons */ /* text. (matrix transposed.) */ void factr( int n, complex long double *a, int *ip, int ndim) { int r, rm1, rp1, pj, pr, iflg, k, j, jp1, i; long double dmax, elmag; complex long double arj, *scm = NULL; /* Allocate to scratch memory */ mem_alloc( (void *)&scm, np2m * sizeof(complex long double) ); /* Un-transpose the matrix for Gauss elimination */ for( i = 1; i < n; i++ ) for( j = 0; j < i; j++ ) { arj = a[i+j*ndim]; a[i+j*ndim] = a[j+i*ndim]; a[j+i*ndim] = arj; } iflg=FALSE; /* step 1 */ for( r = 0; r < n; r++ ) { for( k = 0; k < n; k++ ) scm[k]= a[k+r*ndim]; /* steps 2 and 3 */ rm1= r; if( rm1 > 0) { for( j = 0; j < rm1; j++ ) { pj= ip[j]-1; arj= scm[pj]; a[j+r*ndim]= arj; scm[pj]= scm[j]; jp1= j+1; for( i = jp1; i < n; i++ ) scm[i] -= a[i+j*ndim]* arj; } /* for( j = 0; j < rm1; j++ ) */ } /* if( rm1 >= 0.) */ /* step 4 */ dmax= creal( scm[r]*conjl(scm[r]) ); rp1= r+1; ip[r]= rp1; if( rp1 < n) { for( i = rp1; i < n; i++ ) { elmag= creal( scm[i]* conjl(scm[i]) ); if( elmag >= dmax) { dmax= elmag; ip[r]= i+1; } } } /* if( rp1 < n) */ if( dmax < 1.e-10) iflg=TRUE; pr= ip[r]-1; a[r+r*ndim]= scm[pr]; scm[pr]= scm[r]; /* step 5 */ if( rp1 < n) { arj=1./ a[r+r*ndim]; for( i = rp1; i < n; i++ ) a[i+r*ndim]= scm[i]* arj; } if( iflg == TRUE ) { fprintf( output_fp, "\n PIVOT(%d)= %16.8LE", r, dmax ); iflg=FALSE; } } /* for( r=0; r < n; r++ ) */ free_ptr( (void *)&scm ); return; } /*-----------------------------------------------------------------------*/ /* factrs, for symmetric structure, transforms submatricies to form */ /* matricies of the symmetric modes and calls routine to factor */ /* matricies. if no symmetry, the routine is called to factor the */ /* complete matrix. */ void factrs( int np, int nrow, complex long double *a, int *ip ) { int kk, ka; for( kk = 0; kk < nop; kk++ ) { ka= kk* np; factr( np, &a[ka], &ip[ka], nrow ); } return; } /*-----------------------------------------------------------------------*/ /* fblock sets parameters for out-of-core */ /* solution for the primary matrix (a) */ void fblock( int nrow, int ncol, int imax, int ipsym ) { int i, j, k, ka, kk; long double phaz, arg; complex long double deter; if( nrow*ncol <= imax) { npblk= nrow; nlast= nrow; imat= nrow* ncol; if( nrow == ncol) { icase=1; return; } else icase=2; } /* if( nrow*ncol <= imax) */ if( nop*nrow != ncol) { fprintf( output_fp, "\n SYMMETRY ERROR - NROW: %d NCOL: %d", nrow, ncol ); stop(-1); } /* set up ssx matrix for rotational symmetry. */ if( ipsym <= 0) { phaz = TP/nop; for( i = 1; i < nop; i++ ) { for( j= i; j < nop; j++ ) { arg= phaz* (long double)i * (long double)j; ssx[i+j*nop]= cmplx( cosl( arg), sinl( arg)); ssx[j+i*nop]= ssx[i+j*nop]; } } return; } /* if( ipsym <= 0) */ /* set up ssx matrix for plane symmetry */ kk=1; ssx[0]=CPLX_10; k = 2; for( ka = 1; k != nop; ka++ ) k *= 2; for( k = 0; k < ka; k++ ) { for( i = 0; i < kk; i++ ) { for( j = 0; j < kk; j++ ) { deter= ssx[i+j*nop]; ssx[i+(j+kk)*nop]= deter; ssx[i+kk+(j+kk)*nop]=- deter; ssx[i+kk+j*nop]= deter; } } kk *= 2; } /* for( k = 0; k < ka; k++ ) */ return; } /*-----------------------------------------------------------------------*/ /* subroutine to solve the matrix equation lu*x=b where l is a unit */ /* lower triangular matrix and u is an upper triangular matrix both */ /* of which are stored in a. the rhs vector b is input and the */ /* solution is returned through vector b. (matrix transposed. */ void solve( int n, complex long double *a, int *ip, complex long double *b, int ndim ) { int i, ip1, j, k, pia; complex long double sum, *scm = NULL; /* Allocate to scratch memory */ mem_alloc( (void *)&scm, np2m * sizeof(complex long double) ); /* forward substitution */ for( i = 0; i < n; i++ ) { pia= ip[i]-1; scm[i]= b[pia]; b[pia]= b[i]; ip1= i+1; if( ip1 < n) for( j = ip1; j < n; j++ ) b[j] -= a[j+i*ndim]* scm[i]; } /* backward substitution */ for( k = 0; k < n; k++ ) { i= n-k-1; sum=CPLX_00; ip1= i+1; if( ip1 < n) for( j = ip1; j < n; j++ ) sum += a[i+j*ndim]* b[j]; b[i]=( scm[i]- sum)/ a[i+i*ndim]; } free_ptr( (void *)&scm ); return; } /*-----------------------------------------------------------------------*/ /* subroutine solves, for symmetric structures, handles the */ /* transformation of the right hand side vector and solution */ /* of the matrix eq. */ void solves( complex long double *a, int *ip, complex long double *b, int neq, int nrh, int np, int n, int mp, int m) { int npeq, nrow, ic, i, kk, ia, ib, j, k; long double fnop, fnorm; complex long double sum, *scm = NULL; npeq= np+ 2*mp; fnop= nop; fnorm=1./ fnop; nrow= neq; /* Allocate to scratch memory */ mem_alloc( (void *)&scm, np2m * sizeof(complex long double) ); if( nop != 1) { for( ic = 0; ic < nrh; ic++ ) { if( (n != 0) && (m != 0) ) { for( i = 0; i < neq; i++ ) scm[i]= b[i+ic*neq]; kk=2* mp; ia= np-1; ib= n-1; j= np-1; for( k = 0; k < nop; k++ ) { if( k != 0 ) { for( i = 0; i < np; i++ ) { ia++; j++; b[j+ic*neq]= scm[ia]; } if( k == (nop-1) ) continue; } /* if( k != 0 ) */ for( i = 0; i < kk; i++ ) { ib++; j++; b[j+ic*neq]= scm[ib]; } } /* for( k = 0; k < nop; k++ ) */ } /* if( (n != 0) && (m != 0) ) */ /* transform matrix eq. rhs vector according to symmetry modes */ for( i = 0; i < npeq; i++ ) { for( k = 0; k < nop; k++ ) { ia= i+ k* npeq; scm[k]= b[ia+ic*neq]; } sum= scm[0]; for( k = 1; k < nop; k++ ) sum += scm[k]; b[i+ic*neq]= sum* fnorm; for( k = 1; k < nop; k++ ) { ia= i+ k* npeq; sum= scm[0]; for( j = 1; j < nop; j++ ) sum += scm[j]* conjl( ssx[k+j*nop]); b[ia+ic*neq]= sum* fnorm; } } /* for( i = 0; i < npeq; i++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ } /* if( nop != 1) */ /* solve each mode equation */ for( kk = 0; kk < nop; kk++ ) { ia= kk* npeq; ib= ia; for( ic = 0; ic < nrh; ic++ ) solve( npeq, &a[ib], &ip[ia], &b[ia+ic*neq], nrow ); } /* for( kk = 0; kk < nop; kk++ ) */ if( nop == 1) { free_ptr( (void *)&scm ); return; } /* inverse transform the mode solutions */ for( ic = 0; ic < nrh; ic++ ) { for( i = 0; i < npeq; i++ ) { for( k = 0; k < nop; k++ ) { ia= i+ k* npeq; scm[k]= b[ia+ic*neq]; } sum= scm[0]; for( k = 1; k < nop; k++ ) sum += scm[k]; b[i+ic*neq]= sum; for( k = 1; k < nop; k++ ) { ia= i+ k* npeq; sum= scm[0]; for( j = 1; j < nop; j++ ) sum += scm[j]* ssx[k+j*nop]; b[ia+ic*neq]= sum; } } /* for( i = 0; i < npeq; i++ ) */ if( (n == 0) || (m == 0) ) continue; for( i = 0; i < neq; i++ ) scm[i]= b[i+ic*neq]; kk=2* mp; ia= np-1; ib= n-1; j= np-1; for( k = 0; k < nop; k++ ) { if( k != 0 ) { for( i = 0; i < np; i++ ) { ia++; j++; b[ia+ic*neq]= scm[j]; } if( k == nop) continue; } /* if( k != 0 ) */ for( i = 0; i < kk; i++ ) { ib++; j++; b[ib+ic*neq]= scm[j]; } } /* for( k = 0; k < nop; k++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ free_ptr( (void *)&scm ); return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/calculations.c0000644000175000017500000010234610310210755016620 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /tmi/ */ extern int ija; /* changed to ija to avoid conflict */ extern long double zpk, rkb2; /*common /ggrid/ */ extern int nxa[3], nya[3]; extern long double dxa[3], dya[3], xsa[3], ysa[3]; extern complex long double epscf, *ar1, *ar2, *ar3; /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /crnt/ */ extern long double *air, *aii, *bir, *bii, *cir, *cii; extern complex long double *cur; /* common /vsorc/ */ extern int *ivqd, *isant, *iqds, nvqd, nsant, nqds; extern complex long double *vqd, *vqds, *vsant; /* common /segj/ */ extern int *jco, jsno, nscon, maxcon; /* Max. no. connections */ extern long double *ax, *bx, *cx; /* common /yparm/ */ extern int ncoup, icoup, *nctag, *ncseg; extern complex long double *y11a, *y12a; /* common /zload/ */ extern int nload; extern complex long double *zarray; /* common /smat/ */ extern int nop; /* My addition */ extern complex long double *ssx; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*-----------------------------------------------------------------------*/ /* cabc computes coefficients of the constant (a), sine (b), and */ /* cosine (c) terms in the current interpolation functions for the */ /* current vector cur. */ void cabc( complex long double *curx) { int i, is, j, jx, jco1, jco2; long double ar, ai, sh; complex long double curd, cs1, cs2; if( n != 0) { for( i = 0; i < n; i++ ) { air[i]=0.; aii[i]=0.; bir[i]=0.; bii[i]=0.; cir[i]=0.; cii[i]=0.; } for( i = 0; i < n; i++ ) { ar= creall( curx[i]); ai= cimagl( curx[i]); tbf( i+1, 1 ); for( jx = 0; jx < jsno; jx++ ) { j= jco[jx]-1; air[j] += ax[jx]* ar; aii[j] += ax[jx]* ai; bir[j] += bx[jx]* ar; bii[j] += bx[jx]* ai; cir[j] += cx[jx]* ar; cii[j] += cx[jx]* ai; } } /* for( i = 0; i < n; i++ ) */ if( nqds != 0) { for( is = 0; is < nqds; is++ ) { i= iqds[is]-1; jx= icon1[i]; icon1[i]=0; tbf(i+1,0); icon1[i]= jx; sh= si[i]*.5; curd= CCJ* vqds[is]/( (logl(2.* sh/ bi[i])-1.)* (bx[jsno-1]* cosl(TP* sh)+ cx[jsno-1]* sinl(TP* sh))* wlam ); ar= creall( curd); ai= cimagl( curd); for( jx = 0; jx < jsno; jx++ ) { j= jco[jx]-1; air[j]= air[j]+ ax[jx]* ar; aii[j]= aii[j]+ ax[jx]* ai; bir[j]= bir[j]+ bx[jx]* ar; bii[j]= bii[j]+ bx[jx]* ai; cir[j]= cir[j]+ cx[jx]* ar; cii[j]= cii[j]+ cx[jx]* ai; } } /* for( is = 0; is < nqds; is++ ) */ } /* if( nqds != 0) */ for( i = 0; i < n; i++ ) curx[i]= cmplx( air[i]+cir[i], aii[i]+cii[i] ); } /* if( n != 0) */ if( m == 0) return; /* convert surface currents from */ /* t1,t2 components to x,y,z components */ jco1= np2m; jco2= jco1+ m; for( i = 1; i <= m; i++ ) { jco1 -= 2; jco2 -= 3; cs1= curx[jco1]; cs2= curx[jco1+1]; curx[jco2] = cs1* t1x[m-i]+ cs2* t2x[m-i]; curx[jco2+1]= cs1* t1y[m-i]+ cs2* t2y[m-i]; curx[jco2+2]= cs1* t1z[m-i]+ cs2* t2z[m-i]; } return; } /*-----------------------------------------------------------------------*/ /* couple computes the maximum coupling between pairs of segments. */ void couple( complex long double *cur, long double wlam ) { int j, j1, j2, l1, i, k, itt1, itt2, its1, its2, isg1, isg2, npm1; long double dbc, c, gmax; complex long double y11, y12, y22, yl, yin, zl, zin, rho; if( (nsant != 1) || (nvqd != 0) ) return; j= isegno( nctag[icoup], ncseg[icoup]); if( j != isant[0] ) return; zin= vsant[0]; icoup++; mem_realloc( (void *)&y11a, icoup * sizeof( complex long double) ); y11a[icoup-1]= cur[j-1]*wlam/zin; l1=(icoup-1)*(ncoup-1); for( i = 0; i < ncoup; i++ ) { if( (i+1) == icoup) continue; l1++; mem_realloc( (void *)&y12a, l1 * sizeof( complex long double) ); k= isegno( nctag[i], ncseg[i]); y12a[l1-1]= cur[k-1]* wlam/ zin; } if( icoup < ncoup) return; fprintf( output_fp, "\n\n\n" " -----------" " ISOLATION DATA -----------\n\n" " ------- COUPLING BETWEEN ------ MAXIMUM " " ---------- FOR MAXIMUM COUPLING ----------\n" " SEG SEG COUPLING LOAD" " IMPEDANCE (2ND SEG) INPUT IMPEDANCE \n" " TAG SEG No: TAG SEG No: (DB) " " REAL IMAGINARY REAL IMAGINARY" ); npm1= ncoup-1; for( i = 0; i < npm1; i++ ) { itt1= nctag[i]; its1= ncseg[i]; isg1= isegno( itt1, its1); l1= i+1; for( j = l1; j < ncoup; j++ ) { itt2= nctag[j]; its2= ncseg[j]; isg2= isegno( itt2, its2); j1= j+ i* npm1-1; j2= i+ j* npm1; y11= y11a[i]; y22= y11a[j]; y12=.5*( y12a[j1]+ y12a[j2]); yin= y12* y12; dbc= cabsl( yin); c= dbc/(2.* creall( y11)* creall( y22)- creall( yin)); if( (c >= 0.0) && (c <= 1.0) ) { if( c >= .01 ) gmax=(1.- sqrtl(1.- c*c))/c; else gmax=.5*( c+.25* c* c* c); rho= gmax* conjl( yin)/ dbc; yl=((1.- rho)/(1.+ rho)+1.)* creall( y22)- y22; zl=1./ yl; yin= y11- yin/( y22+ yl); zin=1./ yin; dbc= db10( gmax); fprintf( output_fp, "\n" " %4d %4d %5d %4d %4d %5d %9.3LF" " %12.5LE %12.5LE %12.5LE %12.5LE", itt1, its1, isg1, itt2, its2, isg2, dbc, creall(zl), cimagl(zl), creall(zin), cimagl(zin) ); continue; } /* if( (c >= 0.0) && (c <= 1.0) ) */ fprintf( output_fp, "\n" " %4d %4d %5d %4d %4d %5d **ERROR** " "COUPLING IS NOT BETWEEN 0 AND 1. (= %12.5LE)", itt1, its1, isg1, itt2, its2, isg2, c ); } /* for( j = l1; j < ncoup; j++ ) */ } /* for( i = 0; i < npm1; i++ ) */ return; } /*-----------------------------------------------------------------------*/ /* load calculates the impedance of specified */ /* segments for various types of loading */ void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt, long double *zlr, long double *zli, long double *zlc ) { int i, iwarn, istep, istepx, l1, l2, ldtags, jump, ichk; complex long double zt, tpcj; tpcj = (0.0+1.883698955e+9fj); fprintf( output_fp, "\n" " LOCATION RESISTANCE INDUCTANCE CAPACITANCE " " IMPEDANCE (OHMS) CONDUCTIVITY CIRCUIT\n" " ITAG FROM THRU OHMS HENRYS FARADS " " REAL IMAGINARY MHOS/METER TYPE" ); /* initialize d array, used for temporary */ /* storage of loading information. */ mem_alloc( (void *)&zarray, npm * sizeof(complex long double) ); for( i = 0; i < n; i++ ) zarray[i]=CPLX_00; iwarn=FALSE; istep=0; /* cycle over loading cards */ while( TRUE ) { istepx = istep; istep++; if( istep > nload) { if( iwarn == TRUE ) fprintf( output_fp, "\n NOTE, SOME OF THE ABOVE SEGMENTS " "HAVE BEEN LOADED TWICE - IMPEDANCES ADDED" ); if( nop == 1) return; for( i = 0; i < np; i++ ) { zt= zarray[i]; l1= i; for( l2 = 1; l2 < nop; l2++ ) { l1 += np; zarray[l1]= zt; } } return; } /* if( istep > nload) */ if( ldtyp[istepx] > 5 ) { fprintf( output_fp, "\n IMPROPER LOAD TYPE CHOSEN," " REQUESTED TYPE IS %d", ldtyp[istepx] ); stop(-1); } /* search segments for proper itags */ ldtags= ldtag[istepx]; jump= ldtyp[istepx]+1; ichk=0; l1= 1; l2= n; if( ldtags == 0) { if( (ldtagf[istepx] != 0) || (ldtagt[istepx] != 0) ) { l1= ldtagf[istepx]; l2= ldtagt[istepx]; } /* if( (ldtagf[istepx] != 0) || (ldtagt[istepx] != 0) ) */ } /* if( ldtags == 0) */ for( i = l1-1; i < l2; i++ ) { if( ldtags != 0) { if( ldtags != itag[i]) continue; if( ldtagf[istepx] != 0) { ichk++; if( (ichk < ldtagf[istepx]) || (ichk > ldtagt[istepx]) ) continue; } else ichk=1; } /* if( ldtags != 0) */ else ichk=1; /* calculation of lamda*imped. per unit length, */ /* jump to appropriate section for loading type */ switch( jump ) { case 1: zt= zlr[istepx]/ si[i]+ tpcj* zli[istepx]/( si[i]* wlam); if( fabsl( zlc[istepx]) > 1.0e-20) zt += wlam/( tpcj* si[i]* zlc[istepx]); break; case 2: zt= tpcj* si[i]* zlc[istepx]/ wlam; if( fabsl( zli[istepx]) > 1.0e-20) zt += si[i]* wlam/( tpcj* zli[istepx]); if( fabsl( zlr[istepx]) > 1.0e-20) zt += si[i]/ zlr[istepx]; zt=1./ zt; break; case 3: zt= zlr[istepx]* wlam+ tpcj* zli[istepx]; if( fabsl( zlc[istepx]) > 1.0e-20) zt += 1./( tpcj* si[i]* si[i]* zlc[istepx]); break; case 4: zt= tpcj* si[i]* si[i]* zlc[istepx]; if( fabsl( zli[istepx]) > 1.0e-20) zt += 1./( tpcj* zli[istepx]); if( fabsl( zlr[istepx]) > 1.0e-20) zt += 1./( zlr[istepx]* wlam); zt=1./ zt; break; case 5: zt= cmplx( zlr[istepx], zli[istepx])/ si[i]; break; case 6: zt= zint( zlr[istepx]* wlam, bi[i]); } /* switch( jump ) */ if(( fabsl( creall( zarray[i]))+ fabsl( cimagl( zarray[i]))) > 1.0e-20) iwarn=TRUE; zarray[i] += zt; } /* for( i = l1-1; i < l2; i++ ) */ if( ichk == 0 ) { fprintf( output_fp, "\n LOADING DATA CARD ERROR," " NO SEGMENT HAS AN ITAG = %d", ldtags ); stop(-1); } /* printing the segment loading data, jump to proper print */ switch( jump ) { case 1: prnt( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.," SERIES ", 2); break; case 2: prnt( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL",2); break; case 3: prnt( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0., "SERIES (PER METER)", 5); break; case 4: prnt( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL (PER METER)",5); break; case 5: prnt( ldtags, ldtagf[istepx], ldtagt[istepx],0.,0.,0., zlr[istepx], zli[istepx],0.,"FIXED IMPEDANCE ",4); break; case 6: prnt( ldtags, ldtagf[istepx], ldtagt[istepx], 0.,0.,0.,0.,0., zlr[istepx]," WIRE ",2); } /* switch( jump ) */ } /* while( TRUE ) */ return; } /*-----------------------------------------------------------------------*/ /* gf computes the integrand exp(jkr)/(kr) for numerical integration. */ void gf( long double zk, long double *co, long double *si ) { long double zdk, rk, rks; zdk= zk- zpk; rk= sqrtl( rkb2+ zdk* zdk); *si= sinl( rk)/ rk; if( ija != 0 ) { *co= cosl( rk)/ rk; return; } if( rk >= .2) { *co=( cosl( rk)-1.)/ rk; return; } rks= rk* rk; *co=((-1.38888889e-3* rks+4.16666667e-2)* rks-.5)* rk; return; } /*-----------------------------------------------------------------------*/ /* function db10 returns db for magnitude (field) */ long double db10( long double x ) { if( x < 1.e-20 ) return( -999.99 ); return( 10. * log10l(x) ); } /*-----------------------------------------------------------------------*/ /* function db20 returns db for mag**2 (power) i */ long double db20( long double x ) { if( x < 1.e-20 ) return( -999.99 ); return( 20. * log10l(x) ); } /*-----------------------------------------------------------------------*/ /* intrp uses bivariate cubic interpolation to obtain */ /* the values of 4 functions at the point (x,y). */ void intrp( long double x, long double y, complex long double *f1, complex long double *f2, complex long double *f3, complex long double *f4 ) { static int ix, iy, ixs=-10, iys=-10, igrs=-10, ixeg=0, iyeg=0; static int nxm2, nym2, nxms, nyms, nd, ndp; int nda[3]={11,17,9}, ndpa[3]={110,85,72}; int igr, iadd, iadz, i, k, jump; static long double dx = 1., dy = 1., xs = 0., ys = 0., xz, yz; long double xx, yy; static complex long double a[4][4], b[4][4], c[4][4], d[4][4]; complex long double p1, p2, p3, p4, fx1, fx2, fx3, fx4; jump = FALSE; if( (x < xs) || (y < ys) ) jump = TRUE; else { ix= (int)(( x- xs)/ dx)+1; iy= (int)(( y- ys)/ dy)+1; } /* if point lies in same 4 by 4 point region */ /* as previous point, old values are reused. */ if( (ix < ixeg) || (iy < iyeg) || (abs(ix- ixs) >= 2) || (abs(iy- iys) >= 2) || jump ) { /* determine correct grid and grid region */ if( x <= xsa[1]) igr=0; else { if( y > ysa[2]) igr=2; else igr=1; } if( igr != igrs) { igrs= igr; dx= dxa[igrs]; dy= dya[igrs]; xs= xsa[igrs]; ys= ysa[igrs]; nxm2= nxa[igrs]-2; nym2= nya[igrs]-2; nxms=(( nxm2+1)/3)*3+1; nyms=(( nym2+1)/3)*3+1; nd= nda[igrs]; ndp= ndpa[igrs]; ix= (int)(( x- xs)/ dx)+1; iy= (int)(( y- ys)/ dy)+1; } /* if( igr != igrs) */ ixs=(( ix-1)/3)*3+2; if( ixs < 2) ixs=2; ixeg=-10000; if( ixs > nxm2) { ixs= nxm2; ixeg= nxms; } iys=(( iy-1)/3)*3+2; if( iys < 2) iys=2; iyeg=-10000; if( iys > nym2) { iys= nym2; iyeg= nyms; } /* compute coefficients of 4 cubic polynomials in x for */ /* the 4 grid values of y for each of the 4 functions */ iadz= ixs+( iys-3)* nd- ndp; for( k = 0; k < 4; k++ ) { iadz += ndp; iadd = iadz; for( i = 0; i < 4; i++ ) { iadd += nd; switch( igrs ) { case 0: p1= ar1[iadd-2]; p2= ar1[iadd-1]; p3= ar1[iadd]; p4= ar1[iadd+1]; break; case 1: p1= ar2[iadd-2]; p2= ar2[iadd-1]; p3= ar2[iadd]; p4= ar2[iadd+1]; break; case 2: p1= ar3[iadd-2]; p2= ar3[iadd-1]; p3= ar3[iadd]; p4= ar3[iadd+1]; } /* switch( igrs ) */ a[i][k]=( p4- p1+3.*( p2- p3))*.1666666667; b[i][k]=( p1-2.* p2+ p3)*.5; c[i][k]= p3-(2.* p1+3.* p2+ p4)*.1666666667; d[i][k]= p2; } /* for( i = 0; i < 4; i++ ) */ } /* for( k = 0; k < 4; k++ ) */ xz=( ixs-1)* dx+ xs; yz=( iys-1)* dy+ ys; } /* if( (abs(ix- ixs) >= 2) || */ /* evaluate polymomials in x and use cubic */ /* interpolation in y for each of the 4 functions. */ xx=( x- xz)/ dx; yy=( y- yz)/ dy; fx1=(( a[0][0]* xx+ b[0][0])* xx+ c[0][0])* xx+ d[0][0]; fx2=(( a[1][0]* xx+ b[1][0])* xx+ c[1][0])* xx+ d[1][0]; fx3=(( a[2][0]* xx+ b[2][0])* xx+ c[2][0])* xx+ d[2][0]; fx4=(( a[3][0]* xx+ b[3][0])* xx+ c[3][0])* xx+ d[3][0]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f1=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][1]* xx+ b[0][1])* xx+ c[0][1])* xx+ d[0][1]; fx2=(( a[1][1]* xx+ b[1][1])* xx+ c[1][1])* xx+ d[1][1]; fx3=(( a[2][1]* xx+ b[2][1])* xx+ c[2][1])* xx+ d[2][1]; fx4=(( a[3][1]* xx+ b[3][1])* xx+ c[3][1])* xx+ d[3][1]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f2=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][2]* xx+ b[0][2])* xx+ c[0][2])* xx+ d[0][2]; fx2=(( a[1][2]* xx+ b[1][2])* xx+ c[1][2])* xx+ d[1][2]; fx3=(( a[2][2]* xx+ b[2][2])* xx+ c[2][2])* xx+ d[2][2]; fx4=(( a[3][2]* xx+ b[3][2])* xx+ c[3][2])* xx+ d[3][2]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f3=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][3]* xx+ b[0][3])* xx+ c[0][3])* xx+ d[0][3]; fx2=(( a[1][3]* xx+ b[1][3])* xx+ c[1][3])* xx+ d[1][3]; fx3=(( a[2][3]* xx+ b[2][3])* xx+ c[2][3])* xx+ d[2][3]; fx4=(( a[3][3]* xx+ b[3][3])* xx+ c[3][3])* xx+ d[3][3]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f4=(( p1* yy+ p2)* yy+ p3)* yy*.16666666670+ fx2; return; } /*-----------------------------------------------------------------------*/ /* intx performs numerical integration of exp(jkr)/r by the method of */ /* variable interval width romberg integration. the integrand value */ /* is supplied by subroutine gf. */ void intx( long double el1, long double el2, long double b, int ij, long double *sgr, long double *sgi) { int ns, nt; int nx = 1, nma = 65536, nts = 4; int flag = TRUE; long double z, s, ze, fnm, ep, zend, fns, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; long double g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; long double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; long double rx = 1.0e-4; z= el1; ze= el2; if( ij == 0) ze=0.; s= ze- z; fnm= nma; ep= s/(10.* fnm); zend= ze- ep; *sgr=0.; *sgi=0.; ns= nx; nt=0; gf( z, &g1r, &g1i); while( TRUE ) { if( flag ) { fns= ns; dz= s/ fns; zp= z+ dz; if( zp > ze) { dz= ze- z; if( fabsl(dz) <= ep) { /* add contribution of near singularity for diagonal term */ if(ij == 0) { *sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } } /* if( zp > ze) */ dzot= dz*.5; zp= z+ dzot; gf( zp, &g3r, &g3i); zp= z+ dz; gf( zp, &g5r, &g5i); } /* if( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; /* test convergence of 3 point romberg result. */ test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if( z >= zend) { /* add contribution of near singularity for diagonal term */ if(ij == 0) { *sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if( nt >= nts) if( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = TRUE; continue; } /* if( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gf( zp, &g2r, &g2i); zp= z+ dz*0.75; gf( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; /* test convergence of 5 point romberg result. */ test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if( (te2i > rx) || (te2r > rx) ) { nt=0; if( ns >= nma) fprintf( output_fp, "\n STEP SIZE LIMITED AT Z= %10.5LF", z ); else { /* halve step size */ ns= ns*2; fns= ns; dz= s/ fns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = FALSE; continue; } } /* if( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if( z >= zend) { /* add contribution of near singularity for diagonal term */ if(ij == 0) { *sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if( nt >= nts) if( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = TRUE; } /* while( TRUE ) */ } /*-----------------------------------------------------------------------*/ /* returns smallest of two arguments */ int min( int a, int b ) { if( a < b ) return(a); else return(b); } /*-----------------------------------------------------------------------*/ /* test for convergence in numerical integration */ void test( long double f1r, long double f2r, long double *tr, long double f1i, long double f2i, long double *ti, long double dmin ) { long double den; den= fabsl( f2r); *tr= fabsl( f2i); if( den < *tr) den= *tr; if( den < dmin) den= dmin; if( den < 1.0e-37) { *tr=0.; *ti=0.; return; } *tr= fabsl(( f1r- f2r)/ den); *ti= fabsl(( f1i- f2i)/ den); return; } /*-----------------------------------------------------------------------*/ /* compute component of basis function i on segment is. */ void sbf( int i, int is, long double *aa, long double *bb, long double *cc ) { int ix, jsno, june, jcox, jcoxx, jend, iend, njun1=0, njun2; long double d, sig, pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; *aa=0.; *bb=0.; *cc=0.; june=0; jsno=0; pp=0.; ix=i-1; jcox= icon1[ix]; if( jcox > PCHCON) jcox= i; jcoxx = jcox-1; jend=-1; iend=-1; sig=-1.; do { if( jcox != 0 ) { if( jcox < 0 ) jcox=- jcox; else { sig=- sig; jend=- jend; } jcoxx = jcox-1; jsno++; d= PI* si[jcoxx]; sdh= sinl( d); cdh= cosl( d); sd=2.* sdh* cdh; if( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( logl(1./( PI* bi[jcoxx]))-.577215664); pp -= omc/ sd* aj; if( jcox == is) { *aa= aj/ sd* sig; *bb= aj/(2.* cdh); *cc=- aj/(2.* sdh)* sig; june= iend; } if( jcox != i ) { if( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if( abs(jcox) != i ) { if( jcox == 0 ) { fprintf( output_fp, "\n SBF - SEGMENT CONNECTION ERROR FOR SEGMENT %d", i); stop(-1); } else continue; } } /* if( jcox != i ) */ else if( jcox == is) *bb=- *bb; if( iend == 1) break; } /* if( jcox != 0 ) */ pm=- pp; pp=0.; njun1= jsno; jcox= icon2[ix]; if( jcox > PCHCON) jcox= i; jend=1; iend=1; sig=-1.; } /* do */ while( jcox != 0 ); njun2= jsno- njun1; d= PI* si[ix]; sdh= sinl( d); cdh= cosl( d); sd=2.* sdh* cdh; cd= cdh* cdh- sdh* sdh; if( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cd; ap=1./( logl(1./( PI* bi[ix])) -.577215664); aj= ap; if( njun1 == 0) { if( njun2 == 0) { *aa =-1.; qp= PI* bi[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); *cc=1./( cdh- xxi* sdh); return; } qp= PI* bi[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); if( june == 1) { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; if( i != is) return; } *aa -= 1.; d = cd - xxi * sd; *bb += (sdh + ap * qp * (cdh - xxi * sdh)) / d; *cc += (cdh + ap * qp * (sdh + xxi * cdh)) / d; return; } /* if( njun1 == 0) */ if( njun2 == 0) { qm= PI* bi[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); if( june == -1) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; if( i != is) return; } *aa -= 1.; d= cd- xxi* sd; *bb += ( aj* qm*( cdh- xxi* sdh)- sdh)/ d; *cc += ( cdh- aj* qm*( sdh+ xxi* cdh))/ d; return; } /* if( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; if( june != 0 ) { if( june < 0 ) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; } else { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; } if( i != is) return; } /* if( june != 0 ) */ *aa -= 1.; *bb += ( aj* qm+ ap* qp)* sdh/ sd; *cc += ( aj* qm- ap* qp)* cdh/ sd; return; } /*-----------------------------------------------------------------------*/ /* compute basis function i */ void tbf( int i, int icap ) { int ix, jcox, jcoxx, jend, iend, njun1=0, njun2, jsnop, jsnox; long double pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; long double d, sig; /*** also global ***/ jsno=0; pp=0.; ix = i-1; jcox= icon1[ix]; if( jcox > PCHCON) jcox= i; jend=-1; iend=-1; sig=-1.; do { if( jcox != 0 ) { if( jcox < 0 ) jcox=- jcox; else { sig=- sig; jend=- jend; } jcoxx = jcox-1; jsno++; jsnox = jsno-1; jco[jsnox]= jcox; d= PI* si[jcoxx]; sdh= sinl( d); cdh= cosl( d); sd=2.* sdh* cdh; if( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( logl(1./( PI* bi[jcoxx]))-.577215664); pp= pp- omc/ sd* aj; ax[jsnox]= aj/ sd* sig; bx[jsnox]= aj/(2.* cdh); cx[jsnox]=- aj/(2.* sdh)* sig; if( jcox != i) { if( jend == 1) jcox= icon2[jcoxx]; else jcox= icon1[jcoxx]; if( abs(jcox) != i ) { if( jcox != 0 ) continue; else { fprintf( output_fp, "\n TBF - SEGMENT CONNECTION ERROR FOR SEGMENT %5d", i ); stop(-1); } } } /* if( jcox != i) */ else bx[jsnox] =- bx[jsnox]; if( iend == 1) break; } /* if( jcox != 0 ) */ pm=- pp; pp=0.; njun1= jsno; jcox= icon2[ix]; if( jcox > PCHCON) jcox= i; jend=1; iend=1; sig=-1.; } /* do */ while( jcox != 0 ); njun2= jsno- njun1; jsnop= jsno; jco[jsnop]= i; d= PI* si[ix]; sdh= sinl( d); cdh= cosl( d); sd=2.* sdh* cdh; cd= cdh* cdh- sdh* sdh; if( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc=1.- cd; ap=1./( logl(1./( PI* bi[ix]))-.577215664); aj= ap; if( njun1 == 0) { if( njun2 == 0) { bx[jsnop]=0.; if( icap == 0) xxi=0.; else { qp= PI* bi[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } cx[jsnop]=1./( cdh- xxi* sdh); jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if( njun2 == 0) */ if( icap == 0) xxi=0.; else { qp= PI* bi[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); d= cd- xxi* sd; bx[jsnop]=( sdh+ ap* qp*( cdh- xxi* sdh))/ d; cx[jsnop]=( cdh+ ap* qp*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun2; iend++ ) { ax[iend]=- ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if( njun1 == 0) */ if( njun2 == 0) { if( icap == 0) xxi=0.; else { qm= PI* bi[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); } qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); d= cd- xxi* sd; bx[jsnop]=( aj* qm*( cdh- xxi* sdh)- sdh)/ d; cx[jsnop]=( cdh- aj* qm*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; bx[jsnop]=( aj* qm+ ap* qp)* sdh/ sd; cx[jsnop]=( aj* qm- ap* qp)* cdh/ sd; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jend= njun1; for( iend = jend; iend < jsno; iend++ ) { ax[iend]=- ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; } /*-----------------------------------------------------------------------*/ /* compute the components of all basis functions on segment j */ void trio( int j ) { int jcox, jcoxx, jsnox, jx, jend=0, iend=0; jsno=0; jx = j-1; jcox= icon1[jx]; jcoxx = jcox-1; if( jcox <= PCHCON) { jend=-1; iend=-1; } if( (jcox == 0) || (jcox > PCHCON) ) { jcox= icon2[jx]; jcoxx = jcox-1; if( jcox <= PCHCON) { jend=1; iend=1; } if( jcox == 0 || (jcox > PCHCON) ) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if( jsno >= maxcon ) { maxcon = jsno +1; mem_realloc( (void *)&jco, maxcon * sizeof(int) ); mem_realloc( (void *) &ax, maxcon * sizeof(long double) ); mem_realloc( (void *) &bx, maxcon * sizeof(long double) ); mem_realloc( (void *) &cx, maxcon * sizeof(long double) ); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; return; } } /* if( (jcox == 0) || (jcox > PCHCON) ) */ do { if( jcox < 0 ) jcox=- jcox; else jend=- jend; jcoxx = jcox-1; if( jcox != j) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if( jsno >= maxcon ) { maxcon = jsno +1; mem_realloc( (void *)&jco, maxcon * sizeof(int) ); mem_realloc( (void *) &ax, maxcon * sizeof(long double) ); mem_realloc( (void *) &bx, maxcon * sizeof(long double) ); mem_realloc( (void *) &cx, maxcon * sizeof(long double) ); } sbf( jcox, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= jcox; if( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if( jcox == 0 ) { fprintf( output_fp, "\n TRIO - SEGMENT CONNENTION ERROR FOR SEGMENT %5d", j ); stop(-1); } else continue; } /* if( jcox != j) */ if( iend == 1) break; jcox= icon2[jx]; if( jcox > PCHCON) break; jend=1; iend=1; } /* do */ while( jcox != 0 ); jsnox = jsno; jsno++; /* Allocate to connections buffers */ if( jsno >= maxcon ) { maxcon = jsno +1; mem_realloc( (void *)&jco, maxcon * sizeof(int) ); mem_realloc( (void *) &ax, maxcon * sizeof(long double) ); mem_realloc( (void *) &bx, maxcon * sizeof(long double) ); mem_realloc( (void *) &cx, maxcon * sizeof(long double) ); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; return; } /*-----------------------------------------------------------------------*/ /* zint computes the internal impedance of a circular wire */ complex long double zint( long double sigl, long double rolam ) { #define cc1 ( 6.0e-7 + 1.9e-6fj) #define cc2 (-3.4e-6 + 5.1e-6fj) #define cc3 (-2.52e-5 + 0.fj) #define cc4 (-9.06e-5 - 9.01e-5fj) #define cc5 ( 0. - 9.765e-4fj) #define cc6 (.0110486 - .0110485fj) #define cc7 ( 0. - .3926991fj) #define cc8 ( 1.6e-6 - 3.2e-6fj) #define cc9 ( 1.17e-5 - 2.4e-6fj) #define cc10 ( 3.46e-5 + 3.38e-5fj) #define cc11 ( 5.0e-7 + 2.452e-4fj) #define cc12 (-1.3813e-3 + 1.3811e-3fj) #define cc13 (-6.25001e-2 - 1.0e-7fj) #define cc14 (.7071068 + .7071068fj) #define cn cc14 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 ) #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 ) #define f(d) ( csqrtl(POT/(d))*cexpl(-cn*(d)+th(-8./x)) ) #define g(d) ( cexpl(cn*(d)+th(8./x))/csqrtl(TP*(d)) ) long double x, y, s, ber, bei; long double tpcmu = 2.368705e+3; long double cmotp = 60.00; complex long double zint, br1, br2; x= sqrtl( tpcmu* sigl)* rolam; if( x <= 110.) { if( x <= 8.) { y= x/8.; y= y* y; s= y* y; ber=((((((-9.01e-6* s+1.22552e-3)* s-.08349609)* s+ 2.6419140)* s-32.363456)* s+113.77778)* s-64.)* s+1.; bei=((((((1.1346e-4* s-.01103667)* s+.52185615)* s-10.567658)* s+72.817777)* s-113.77778)* s+16.)* y; br1= cmplx( ber, bei); ber=(((((((-3.94e-6* s+4.5957e-4)* s-.02609253)* s+ .66047849)* s-6.0681481)* s+14.222222)* s-4.)* y)* x; bei=((((((4.609e-5* s-3.79386e-3)* s+.14677204)* s- 2.3116751)* s+11.377778)* s-10.666667)* s+.5)* x; br2= cmplx( ber, bei); br1= br1/ br2; zint= CPLX_01* sqrtl( cmotp/sigl )* br1/ rolam; return( zint ); } /* if( x <= 8.) */ br2= CPLX_01* f(x)/ PI; br1= g( x)+ br2; br2= g( x)* ph(8./ x)- br2* ph(-8./ x); br1= br1/ br2; zint= CPLX_01* sqrtl( cmotp/ sigl)* br1/ rolam; return( zint ); } /* if( x <= 110.) */ br1= cmplx(.70710678,-.70710678); zint= CPLX_01* sqrtl( cmotp/ sigl)* br1/ rolam; return( zint ); } /*-----------------------------------------------------------------------*/ /* cang returns the phase angle of a complex number in degrees. */ long double cang( complex long double z ) { return( cargl(z)*TD ); } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/nec2c.h0000644000175000017500000002324610310210756015140 0ustar numanuma#ifndef NEC2C_H #define NEC2C_H 1 #include #include #include #include #include #include #include #include #include #include #include #include #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* commonly used complex constants */ #define CPLX_00 (0.0+0.0fj) #define CPLX_01 (0.0+1.0fj) #define CPLX_10 (1.0+0.0fj) #define CPLX_11 (1.0+1.0fj) /* common constants */ #define PI 3.141592654 #define POT 1.570796327 #define TP 6.283185308 #define PTP .6283185308 #define TPJ (0.0+6.283185308fj) #define PI8 25.13274123 #define PI10 31.41592654 #define TA 1.745329252E-02 #define TD 57.29577951 #define ETA 376.73 #define CVEL 299.8 #define RETA 2.654420938E-3 #define TOSP 1.128379167 #define ACCS 1.E-12 #define SP 1.772453851 #define FPI 12.56637062 #define CCJ (0.0-0.01666666667fj) #define CONST1 (0.0+4.771341189fj) #define CONST2 4.771341188 #define CONST3 (0.0-29.97922085fj) #define CONST4 (0.0+188.365fj) #define GAMMA .5772156649 #define C1 -.02457850915 #define C2 .3674669052 #define C3 .7978845608 #define P10 .0703125 #define P20 .1121520996 #define Q10 .125 #define Q20 .0732421875 #define P11 .1171875 #define P21 .1441955566 #define Q11 .375 #define Q21 .1025390625 #define POF .7853981635 #define MAXH 20 #define CRIT 1.0E-4 #define NM 131072 #define NTS 4 #define SMIN 1.e-3 /* Replaces the "10000" limit used to */ /* identify segment/patch connections */ #define PCHCON 100000 /* carriage return and line feed */ #define CR 0x0d #define LF 0x0a /* max length of a line read from input file */ #define LINE_LEN 132/* version of fortran source for the -v option */ #define version "nec2c v0.1" /* Function prototypes */ int main(int argc, char **argv); void arc(int itg, int ns, long double rada, long double ang1, long double ang2, long double rad); void blckot(complex long double *ar, int nunit, int ix1, int ix2, int nblks, int neof); void blckin(complex long double *ar, int nunit, int ix1, int ix2, int nblks, int neof); void cabc(complex long double *curx); void cmset(int nrow, complex long double *cm, long double rkhx, int iexkx); void cmss(int j1, int j2, int im1, int im2, complex long double *cm, int nrow, int itrp); void cmsw(int j1, int j2, int i1, int i2, complex long double *cm, complex long double *cw, int ncw, int nrow, int itrp); void cmws(int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp); void cmww(int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp); void conect(int ignd); void couple(complex long double *cur, long double wlam); void datagn(void); long double db10(long double x); long double db20(long double x); void efld(long double xi, long double yi, long double zi, long double ai, int ij); void eksc(long double s, long double z, long double rh, long double xk, int ij, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk); void ekscx(long double bx, long double s, long double z, long double rhx, long double xk, int ij, int inx1, int inx2, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk); void etmns(long double p1, long double p2, long double p3, long double p4, long double p5, long double p6, int ipr, complex long double *e); void factr(int n, complex long double *a, int *ip, int ndim); void factrs(int np, int nrow, complex long double *a, int *ip); complex long double fbar(complex long double p); void fblock(int nrow, int ncol, int imax, int ipsym); void ffld(long double thet, long double phi, complex long double *eth, complex long double *eph); void fflds(long double rox, long double roy, long double roz, complex long double *scur, complex long double *ex, complex long double *ey, complex long double *ez); void gf(long double zk, long double *co, long double *si); void gfld(long double rho, long double phi, long double rz, complex long double *eth, complex long double *epi, complex long double *erd, complex long double ux, int ksymp); void gh(long double zk, long double *hr, long double *hi); void gwave(complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *ezh, complex long double *eph); void gx(long double zz, long double rh, long double xk, complex long double *gz, complex long double *gzp); void gxx(long double zz, long double rh, long double a, long double a2, long double xk, int ira, complex long double *g1, complex long double *g1p, complex long double *g2, complex long double *g2p, complex long double *g3, complex long double *gzp); void helix(long double s, long double hl, long double a1, long double b1, long double a2,long double b2, long double rad, int ns, int itg); void hfk(long double el1, long double el2, long double rhk, long double zpkx, long double *sgr, long double *sgi); void hintg(long double xi, long double yi, long double zi); void hsfld(long double xi, long double yi, long double zi, long double ai); void hsflx(long double s, long double rh, long double zpx, complex long double *hpk, complex long double *hps, complex long double *hpc); void intrp(long double x, long double y, complex long double *f1, complex long double *f2, complex long double *f3, complex long double *f4); void intx(long double el1, long double el2, long double b, int ij, long double *sgr, long double *sgi); int isegno(int itagi, int mx); void lfactr(complex long double *a, int nrow, int ix1, int ix2, int *ip); void load(int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt, long double *zlr, long double *zli, long double *zlc); void lunscr(complex long double *a, int nrow, int nop, int *ix, int *ip, int iu2, int iu3, int iu4); void move(long double rox, long double roy, long double roz, long double xs, long double ys, long double zs, int its, int nrpt, int itgi); void nefld(long double xob, long double yob, long double zob, complex long double *ex, complex long double *ey, complex long double *ez); void netwk(complex long double *cm, complex long double *cmb, complex long double *cmc, complex long double *cmd, int *ip, complex long double *einc); void nfpat(void); void nhfld(long double xob, long double yob, long double zob, complex long double *hx, complex long double *hy, complex long double *hz); void patch(int nx, int ny, long double ax1, long double ay1, long double az1, long double ax2, long double ay2, long double az2, long double ax3, long double ay3, long double az3, long double ax4, long double ay4, long double az4); void subph(int nx, int ny); void pcint(long double xi, long double yi, long double zi, long double cabi, long double sabi, long double salpi, complex long double *e); void prnt(int in1, int in2, int in3, long double fl1, long double fl2, long double fl3, long double fl4, long double fl5, long double fl6, char *ia, int ichar); void qdsrc(int is, complex long double v, complex long double *e); void rdpat(void); void readgm(char *gm, int *i1, int *i2, long double *x1, long double *y1, long double *z1, long double *x2, long double *y2, long double *z2, long double *rad); void readmn(char *gm, int *i1, int *i2, int *i3, int *i4, long double *f1, long double *f2, long double *f3, long double *f4, long double *f5, long double *f6); void reflc(int ix, int iy, int iz, int itx, int nop); void rom2(long double a, long double b, complex long double *sum, long double dmin); void sbf(int i, int is, long double *aa, long double *bb, long double *cc); void sflds(long double t, complex long double *e); void solgf(complex long double *a, complex long double *b, complex long double *c, complex long double *d, complex long double *xy, int *ip, int np, int n1, int n, int mp, int m1, int m, int n1c, int n2c, int n2cz); void solve(int n, complex long double *a, int *ip, complex long double *b, int ndim); void solves(complex long double *a, int *ip, complex long double *b, int neq, int nrh, int np, int n, int mp, int m); void tbf(int i, int icap); void test(long double f1r, long double f2r, long double *tr, long double f1i, long double f2i, long double *ti, long double dmin); void trio(int j); void unere(long double xob, long double yob, long double zob); void wire(long double xw1, long double yw1, long double zw1, long double xw2, long double yw2, long double zw2, long double rad, long double rdel, long double rrad, int ns, int itg); complex long double zint(long double sigl, long double rolam); int min(int a, int b); void usage(void); void abort_on_error(int why); complex long double cmplx(long double a, long double j); void secnds(long double *x); int stop(int flag); int load_line(char *buff, FILE *pfile); void mem_alloc( void **ptr, int req ); void mem_realloc( void **ptr, int req ); void free_ptr( void **ptr ); void somnec(long double epr, long double sig, long double fmhz); void bessel(complex long double z, complex long double *j0, complex long double *j0p); void evlua(complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *eph); void gshank(complex long double start, complex long double dela, complex long double *sum, int nans, complex long double *seed, int ibk, complex long double bk, complex long double delb); void hankel(complex long double z, complex long double *h0, complex long double *h0p); void lambda(long double t, complex long double *xlam, complex long double *dxlam); void rom1(int n, complex long double *sum, int nx); void saoa( long double t, complex long double *ans); long double cang(complex long double z); #endif necpp-1.5.0+cvs20101003/c_src/ground.c0000644000175000017500000002024410310210755015431 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /dataj/ */ extern int iexk, ind1, indd1, ind2, indd2, ipgnd; extern long double s, b, xj, yj, zj, cabj, sabj, salpj, rkh; extern long double t1xj, t1yj, t1zj, t2xj, t2yj, t2zj; extern complex long double exk, eyk, ezk, exs, eys, ezs, exc, eyc, ezc; /* for the sommerfeld ground option, rom2 integrates over the source */ /* common /incom/ */ extern int isnor; extern long double xo, yo, zo, sn, xsn, ysn; /* common /gwav/ */ extern long double r1, r2, zmh, zph; extern complex long double u, u2, xx1, xx2; /* common /gnd/ */ extern int ksymp, ifar, iperf, nradl; extern long double t2, cl, ch, scrwl, scrwr; extern complex long double zrati, zrati2, t1, frati; /*-------------------------------------------------------------------*/ /* segment to obtain the total field due to ground. the method of */ /* variable interval width romberg integration is used. there are 9 */ /* field components - the x, y, and z components due to constant, */ /* sine, and cosine current distributions. */ void rom2( long double a, long double b, complex long double *sum, long double dmin ) { int i, ns, nt, flag=TRUE; int nts = 4, nx = 1, n = 9; long double ze, ep, zend, dz=0., dzot=0., tmag1, tmag2, tr, ti; long double z, s; /***also global***/ long double rx = 1.0e-4; complex long double g1[9], g2[9], g3[9], g4[9], g5[9]; complex long double t00, t01[9], t10[9], t02, t11, t20[9]; z= a; ze= b; s= b- a; if( s < 0.) { fprintf( output_fp, "\n ERROR - B LESS THAN A IN ROM2" ); stop(-1); } ep= s/(1.e4* npm); zend= ze- ep; for( i = 0; i < n; i++ ) sum[i]=CPLX_00; ns= nx; nt=0; sflds( z, g1); while( TRUE ) { if( flag == TRUE) { dz= s/ ns; if( z+ dz > ze) { dz= ze- z; if( dz <= ep) return; } dzot= dz*.5; sflds( z+ dzot, g3); sflds( z+ dz, g5); } /* if( flag ) */ tmag1=0.; tmag2=0.; /* evaluate 3 point romberg result and test convergence. */ for( i = 0; i < n; i++ ) { t00=( g1[i]+ g5[i])* dzot; t01[i]=( t00+ dz* g3[i])*.5; t10[i]=(4.* t01[i]- t00)/3.; if( i > 2) continue; tr= creal( t01[i]); ti= cimag( t01[i]); tmag1= tmag1+ tr* tr+ ti* ti; tr= creal( t10[i]); ti= cimag( t10[i]); tmag2= tmag2+ tr* tr+ ti* ti; } /* for( i = 0; i < n; i++ ) */ tmag1= sqrtl( tmag1); tmag2= sqrtl( tmag2); test( tmag1, tmag2, &tr, 0., 0., &ti, dmin); if( tr <= rx) { for( i = 0; i < n; i++ ) sum[i] += t10[i]; nt += 2; z += dz; if( z > zend) return; for( i = 0; i < n; i++ ) g1[i]= g5[i]; if( (nt >= nts) && (ns > nx) ) { ns= ns/2; nt=1; } flag = TRUE; continue; } /* if( tr <= rx) */ sflds( z+ dz*.25, g2); sflds( z+ dz*.75, g4); tmag1=0.; tmag2=0.; /* evaluate 5 point romberg result and test convergence. */ for( i = 0; i < n; i++ ) { t02=( t01[i]+ dzot*( g2[i]+ g4[i]))*.5; t11=( 4.0 * t02- t01[i] )/3.; t20[i]=(16.* t11- t10[i])/15.; if( i > 2) continue; tr= creal( t11); ti= cimag( t11); tmag1= tmag1+ tr* tr+ ti* ti; tr= creal( t20[i]); ti= cimag( t20[i]); tmag2= tmag2+ tr* tr+ ti* ti; } /* for( i = 0; i < n; i++ ) */ tmag1= sqrtl( tmag1); tmag2= sqrtl( tmag2); test( tmag1, tmag2, &tr, 0.,0., &ti, dmin); if( tr > rx) { nt=0; if( ns < npm ) { ns= ns*2; dz= s/ ns; dzot= dz*.5; for( i = 0; i < n; i++ ) { g5[i]= g3[i]; g3[i]= g2[i]; } flag=FALSE; continue; } /* if( ns < npm) */ fprintf( output_fp, "\n ROM2 -- STEP SIZE LIMITED AT Z = %12.5LE", z ); } /* if( tr > rx) */ for( i = 0; i < n; i++ ) sum[i]= sum[i]+ t20[i]; nt= nt+1; z= z+ dz; if( z > zend) return; for( i = 0; i < n; i++ ) g1[i]= g5[i]; flag = TRUE; if( (nt < nts) || (ns <= nx) ) continue; ns= ns/2; nt=1; } /* while( TRUE ) */ } /*-----------------------------------------------------------------------*/ /* sfldx returns the field due to ground for a current element on */ /* the source segment at t relative to the segment center. */ void sflds( long double t, complex long double *e ) { long double xt, yt, zt, rhx, rhy, rhs, rho, phx, phy; long double cph, sph, zphs, r2s, rk, sfac, thet; complex long double erv, ezv, erh, ezh, eph, er, et, hrv, hzv, hrh; xt= xj+ t* cabj; yt= yj+ t* sabj; zt= zj+ t* salpj; rhx= xo- xt; rhy= yo- yt; rhs= rhx* rhx+ rhy* rhy; rho= sqrtl( rhs); if( rho <= 0.) { rhx=1.; rhy=0.; phx=0.; phy=1.; } else { rhx= rhx/ rho; rhy= rhy/ rho; phx=- rhy; phy= rhx; } cph= rhx* xsn+ rhy* ysn; sph= rhy* xsn- rhx* ysn; if( fabsl( cph) < 1.0e-10) cph=0.; if( fabsl( sph) < 1.0e-10) sph=0.; zph= zo+ zt; zphs= zph* zph; r2s= rhs+ zphs; r2= sqrtl( r2s); rk= r2* TP; xx2= cmplx( cosl( rk),- sinl( rk)); /* use norton approximation for field due to ground. current is */ /* lumped at segment center with current moment for constant, sine, */ /* or cosine distribution. */ if( isnor != 1) { zmh=1.; r1=1.; xx1=0.; gwave( &erv, &ezv, &erh, &ezh, &eph); et=-CONST1* frati* xx2/( r2s* r2); er=2.* et* cmplx(1.0, rk); et= et* cmplx(1.0 - rk* rk, rk); hrv=( er+ et)* rho* zph/ r2s; hzv=( zphs* er- rhs* et)/ r2s; hrh=( rhs* er- zphs* et)/ r2s; erv= erv- hrv; ezv= ezv- hzv; erh= erh+ hrh; ezh= ezh+ hrv; eph= eph+ et; erv= erv* salpj; ezv= ezv* salpj; erh= erh* sn* cph; ezh= ezh* sn* cph; eph= eph* sn* sph; erh= erv+ erh; e[0]=( erh* rhx+ eph* phx)* s; e[1]=( erh* rhy+ eph* phy)* s; e[2]=( ezv+ ezh)* s; e[3]=0.; e[4]=0.; e[5]=0.; sfac= PI* s; sfac= sinl( sfac)/ sfac; e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; return; } /* if( isnor != 1) */ /* interpolate in sommerfeld field tables */ if( rho >= 1.0e-12) thet= atanl( zph/ rho); else thet= POT; /* combine vertical and horizontal components and convert */ /* to x,y,z components. multiply by exp(-jkr)/r. */ intrp( r2, thet, &erv, &ezv, &erh, &eph ); xx2= xx2/ r2; sfac= sn* cph; erh= xx2*( salpj* erv+ sfac* erh); ezh= xx2*( salpj* ezv- sfac* erv); /* x,y,z fields for constant current */ eph= sn* sph* xx2* eph; e[0]= erh* rhx+ eph* phx; e[1]= erh* rhy+ eph* phy; e[2]= ezh; /* x,y,z fields for sine current */ rk= TP* t; sfac= sinl( rk); e[3]= e[0]* sfac; e[4]= e[1]* sfac; /* x,y,z fields for cosine current */ e[5]= e[2]* sfac; sfac= cosl( rk); e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/radiation.c0000644000175000017500000006031510310210756016111 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /gnd/ */ extern int ksymp, ifar, iperf, nradl; extern long double t2, cl, ch, scrwl, scrwr; extern complex long double zrati, zrati2, t1, frati; /* common /crnt/ */ extern long double *air, *aii, *bir, *bii, *cir, *cii; extern complex long double *cur; /* common /gwav/ */ extern long double r1, r2, zmh, zph; extern complex long double u, u2, xx1, xx2; /* common /fpat/ */ extern int near, nfeh, nrx, nry, nrz, nth, nph, ipd, iavp, inor, iax, ixtyp; extern long double thets, phis, dth, dph, rfld, gnor, clt, cht, epsr2, sig2; extern long double xpr6, pinr, pnlr, ploss, xnr, ynr, znr, dxnr, dynr, dznr; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /* common /save/ */ extern int *ip; extern long double epsr, sig, scrwlt, scrwrt, fmhz; /* common /plot/ */ extern int iplp1, iplp2, iplp3, iplp4; /*-----------------------------------------------------------------------*/ /* ffld calculates the far zone radiated electric fields, */ /* the factor exp(j*k*r)/(r/lamda) not included */ void ffld( long double thet, long double phi, complex long double *eth, complex long double *eph ) { int k, i, ip, jump; long double phx, phy, roz, rozs, thx, thy, thz, rox, roy; long double tthet=0., darg=0., omega, el, sill, top, bot, a; long double too, boo, b, c, d, rr, ri, arg, dr, rfl, rrz; complex long double cix, ciy, ciz, exa, ccx, ccy, ccz, cdp; complex long double zrsin, rrv, rrh, rrv1, rrh1, rrv2, rrh2; complex long double tix, tiy, tiz, zscrn, ex, ey, ez, gx, gy, gz; phx=- sinl( phi); phy= cosl( phi); roz= cosl( thet); rozs= roz; thx= roz* phy; thy=- roz* phx; thz=- sinl( thet); rox=- thz* phy; roy= thz* phx; jump = FALSE; if( n != 0) { /* loop for structure image if any */ /* calculation of reflection coeffecients */ for( k = 0; k < ksymp; k++ ) { if( k != 0 ) { /* for perfect ground */ if( iperf == 1) { rrv=-CPLX_10; rrh=-CPLX_10; } else { /* for infinite planar ground */ zrsin= csqrtl(1.- zrati* zrati* thz* thz); rrv=-( roz- zrati* zrsin)/( roz+ zrati* zrsin); rrh=( zrati* roz- zrsin)/( zrati* roz+ zrsin); } /* if( iperf == 1) */ /* for the cliff problem, two reflction coefficients calculated */ if( ifar > 1) { rrv1= rrv; rrh1= rrh; tthet= tanl( thet); if( ifar != 4) { zrsin= csqrtl(1.- zrati2* zrati2* thz* thz); rrv2=-( roz- zrati2* zrsin)/( roz+ zrati2* zrsin); rrh2=( zrati2* roz- zrsin)/( zrati2* roz+ zrsin); darg=- TP*2.* ch* roz; } } /* if( ifar > 1) */ roz=- roz; ccx= cix; ccy= ciy; ccz= ciz; } /* if( k != 0 ) */ cix=CPLX_00; ciy=CPLX_00; ciz=CPLX_00; /* loop over structure segments */ for( i = 0; i < n; i++ ) { omega=-( rox* cab[i]+ roy* sab[i]+ roz* salp[i]); el= PI* si[i]; sill= omega* el; top= el+ sill; bot= el- sill; if( fabsl( omega) >= 1.0e-7) a=2.* sinl( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if( fabsl( top) >= 1.0e-7) too= sinl( top)/ top; else too=1.- top* top/6.; if( fabsl( bot) >= 1.0e-7) boo= sinl( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= TP*( x[i]* rox+ y[i]* roy+ z[i]* roz); if( (k != 1) || (ifar < 2) ) { /* summation for far field integral */ exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri); cix= cix+ exa* cab[i]; ciy= ciy+ exa* sab[i]; ciz= ciz+ exa* salp[i]; continue; } /* calculation of image contribution */ /* in cliff and ground screen problems */ /* specular point distance */ dr= z[i]* tthet; d= dr* phy+ x[i]; if( ifar == 2) { if(( cl- d) > 0.) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if( ifar == 2) */ else { d= sqrtl( d*d + (y[i]-dr*phx)*(y[i]-dr*phx) ); if( ifar == 3) { if(( cl- d) > 0.) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if( ifar == 3) */ else { if(( scrwl- d) >= 0.) { /* radial wire ground screen reflection coefficient */ d= d+ t2; zscrn= t1* d* logl( d/ t2); zscrn=( zscrn* zrati)/( ETA* zrati+ zscrn); zrsin= csqrtl(1.- zscrn* zscrn* thz* thz); rrv=( roz+ zscrn* zrsin)/(- roz+ zscrn* zrsin); rrh=( zscrn* roz+ zrsin)/( zscrn* roz- zrsin); } /* if(( scrwl- d) < 0.) */ else { if( ifar == 4) { rrv= rrv1; rrh= rrh1; } /* if( ifar == 4) */ else { if( ifar == 5) d= dr* phy+ x[i]; if(( cl- d) > 0.) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } /* if(( cl- d) > 0.) */ } /* if( ifar == 4) */ } /* if(( scrwl- d) < 0.) */ } /* if( ifar == 3) */ } /* if( ifar == 2) */ /* contribution of each image segment modified by */ /* reflection coef, for cliff and ground screen problems */ exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri); tix= exa* cab[i]; tiy= exa* sab[i]; tiz= exa* salp[i]; cdp=( tix* phx+ tiy* phy)*( rrh- rrv); cix= cix+ tix* rrv+ cdp* phx; ciy= ciy+ tiy* rrv+ cdp* phy; ciz= ciz- tiz* rrv; } /* for( i = 0; i < n; i++ ) */ if( k == 0 ) continue; /* calculation of contribution of structure image for infinite ground */ if( ifar < 2) { cdp=( cix* phx+ ciy* phy)*( rrh- rrv); cix= ccx+ cix* rrv+ cdp* phx; ciy= ccy+ ciy* rrv+ cdp* phy; ciz= ccz- ciz* rrv; } else { cix= cix+ ccx; ciy= ciy+ ccy; ciz= ciz+ ccz; } } /* for( k=0; k < ksymp; k++ ) */ if( m > 0) jump = TRUE; else { *eth=( cix* thx+ ciy* thy+ ciz* thz)* CONST3; *eph=( cix* phx+ ciy* phy)* CONST3; return; } } /* if( n != 0) */ if( ! jump ) { cix=CPLX_00; ciy=CPLX_00; ciz=CPLX_00; } /* electric field components */ roz= rozs; rfl=-1.; for( ip = 0; ip < ksymp; ip++ ) { rfl=- rfl; rrz= roz* rfl; fflds( rox, roy, rrz, &cur[n], &gx, &gy, &gz); if( ip != 1 ) { ex= gx; ey= gy; ez= gz; continue; } if( iperf == 1) { gx=- gx; gy=- gy; gz=- gz; } else { rrv= csqrtl(1.- zrati* zrati* thz* thz); rrh= zrati* roz; rrh=( rrh- rrv)/( rrh+ rrv); rrv= zrati* rrv; rrv=-( roz- rrv)/( roz+ rrv); *eth=( gx* phx+ gy* phy)*( rrh- rrv); gx= gx* rrv+ *eth* phx; gy= gy* rrv+ *eth* phy; gz= gz* rrv; } /* if( iperf == 1) */ ex= ex+ gx; ey= ey+ gy; ez= ez- gz; } /* for( ip = 0; ip < ksymp; ip++ ) */ ex= ex+ cix* CONST3; ey= ey+ ciy* CONST3; ez= ez+ ciz* CONST3; *eth= ex* thx+ ey* thy+ ez* thz; *eph= ex* phx+ ey* phy; return; } /*-----------------------------------------------------------------------*/ /* calculates the xyz components of the electric */ /* field due to surface currents */ void fflds( long double rox, long double roy, long double roz, complex long double *scur, complex long double *ex, complex long double *ey, complex long double *ez ) { long double *xs, *ys, *zs, *s; int j, i, k; long double arg; complex long double ct; xs = px; ys = py; zs = pz; s = pbi; *ex=CPLX_00; *ey=CPLX_00; *ez=CPLX_00; i= -1; for( j = 0; j < m; j++ ) { i++; arg= TP*( rox* xs[i]+ roy* ys[i]+ roz* zs[i]); ct= cmplx( cosl( arg)* s[i], sinl( arg)* s[i]); k=3*j; *ex += scur[k ]* ct; *ey += scur[k+1]* ct; *ez += scur[k+2]* ct; } ct= rox* *ex+ roy* *ey+ roz* *ez; *ex= CONST4*( ct* rox- *ex); *ey= CONST4*( ct* roy- *ey); *ez= CONST4*( ct* roz- *ez); return; } /*-----------------------------------------------------------------------*/ /* gfld computes the radiated field including ground wave. */ void gfld( long double rho, long double phi, long double rz, complex long double *eth, complex long double *epi, complex long double *erd, complex long double ux, int ksymp ) { int i, k; long double b, r, thet, arg, phx, phy, rx, ry, dx, dy, dz, rix, riy, rhs, rhp; long double rhx, rhy, calp, cbet, sbet, cph, sph, el, rfl, riz, thx, thy, thz; long double rxyz, rnx, rny, rnz, omega, sill, top, bot, a, too, boo, c, rr, ri; complex long double cix, ciy, ciz, exa, erv; complex long double ezv, erh, eph, ezh, ex, ey; r= sqrtl( rho*rho+ rz*rz ); if( (ksymp == 1) || (cabs(ux) > .5) || (r > 1.e5) ) { /* computation of space wave only */ if( rz >= 1.0e-20) thet= atanl( rho/ rz); else thet= PI*.5; ffld( thet, phi, eth, epi); arg=- TP* r; exa= cmplx( cosl( arg), sinl( arg))/ r; *eth= *eth* exa; *epi= *epi* exa; *erd=CPLX_00; return; } /* if( (ksymp == 1) && (cabs(ux) > .5) && (r > 1.e5) ) */ /* computation of space and ground waves. */ u= ux; u2= u* u; phx=- sinl( phi); phy= cosl( phi); rx= rho* phy; ry=- rho* phx; cix=CPLX_00; ciy=CPLX_00; ciz=CPLX_00; /* summation of field from individual segments */ for( i = 0; i < n; i++ ) { dx= cab[i]; dy= sab[i]; dz= salp[i]; rix= rx- x[i]; riy= ry- y[i]; rhs= rix* rix+ riy* riy; rhp= sqrtl( rhs); if( rhp >= 1.0e-6) { rhx= rix/ rhp; rhy= riy/ rhp; } else { rhx=1.; rhy=0.; } calp=1.- dz* dz; if( calp >= 1.0e-6) { calp= sqrtl( calp); cbet= dx/ calp; sbet= dy/ calp; cph= rhx* cbet+ rhy* sbet; sph= rhy* cbet- rhx* sbet; } else { cph= rhx; sph= rhy; } el= PI* si[i]; rfl=-1.; /* integration of (current)*(phase factor) over segment and image for */ /* constant, sine, and cosine current distributions */ for( k = 0; k < 2; k++ ) { rfl=- rfl; riz= rz- z[i]* rfl; rxyz= sqrtl( rix* rix+ riy* riy+ riz* riz); rnx= rix/ rxyz; rny= riy/ rxyz; rnz= riz/ rxyz; omega=-( rnx* dx+ rny* dy+ rnz* dz* rfl); sill= omega* el; top= el+ sill; bot= el- sill; if( fabsl( omega) >= 1.0e-7) a=2.* sinl( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if( fabsl( top) >= 1.0e-7) too= sinl( top)/ top; else too=1.- top* top/6.; if( fabsl( bot) >= 1.0e-7) boo= sinl( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= TP*( x[i]* rnx+ y[i]* rny+ z[i]* rnz* rfl); exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri)/ TP; if( k != 1 ) { xx1= exa; r1= rxyz; zmh= riz; continue; } xx2= exa; r2= rxyz; zph= riz; } /* for( k = 0; k < 2; k++ ) */ /* call subroutine to compute the field */ /* of segment including ground wave. */ gwave( &erv, &ezv, &erh, &ezh, &eph); erh= erh* cph* calp+ erv* dz; eph= eph* sph* calp; ezh= ezh* cph* calp+ ezv* dz; ex= erh* rhx- eph* rhy; ey= erh* rhy+ eph* rhx; cix= cix+ ex; ciy= ciy+ ey; ciz= ciz+ ezh; } /* for( i = 0; i < n; i++ ) */ arg=- TP* r; exa= cmplx( cosl( arg), sinl( arg)); cix= cix* exa; ciy= ciy* exa; ciz= ciz* exa; rnx= rx/ r; rny= ry/ r; rnz= rz/ r; thx= rnz* phy; thy=- rnz* phx; thz=- rho/ r; *eth= cix* thx+ ciy* thy+ ciz* thz; *epi= cix* phx+ ciy* phy; *erd= cix* rnx+ ciy* rny+ ciz* rnz; return; } /*-----------------------------------------------------------------------*/ /* compute radiation pattern, gain, normalized gain */ void rdpat( void ) { char *hpol[3] = { "LINEAR", "RIGHT ", "LEFT " }; char hcir[] = " CIRCLE"; char *igtp[2] = { "----- POWER GAINS ----- ", "--- DIRECTIVE GAINS ---" }; char *igax[4] = { " MAJOR", " MINOR", " VERTC", " HORIZ" }; char *igntp[5] = { " MAJOR AXIS", " MINOR AXIS", " VERTICAL", " HORIZONTAL", " TOTAL " }; char *hclif=NULL, *isens; int i, j, jump, itmp1, itmp2, kth, kph, itmp3, itmp4; long double exrm=0., exra=0., prad, gcon, gcop, gmax, pint, tmp1, tmp2; long double phi, pha, thet, tha, erdm=0., erda=0., ethm2, ethm, *gain = NULL; long double etha, ephm2, ephm, epha, tilta, emajr2, eminr2, axrat; long double dfaz, dfaz2, cdfaz, tstor1=0., tstor2, stilta, gnmj; long double gnmn, gnv, gnh, gtot, tmp3, tmp4, da, tmp5, tmp6; complex long double eth, eph, erd; /* Allocate memory to gain buffer */ if( inor > 0 ) mem_alloc( (void *)&gain, nth*nph * sizeof(long double) ); if( ifar >= 2) { fprintf( output_fp, "\n\n\n" " " "------ FAR FIELD GROUND PARAMETERS ------\n\n" ); jump = FALSE; if( ifar > 3) { fprintf( output_fp, "\n" " " "RADIAL WIRE GROUND SCREEN\n" " " "%5d WIRES\n" " " "WIRE LENGTH= %8.2LF METERS\n" " " "WIRE RADIUS= %10.3LE METERS", nradl, scrwlt, scrwrt ); if( ifar == 4) jump = TRUE; } /* if( ifar > 3) */ if( ! jump ) { if( (ifar == 2) || (ifar == 5) ) hclif= hpol[0]; if( (ifar == 3) || (ifar == 6) ) hclif= hcir; cl= clt/ wlam; ch= cht/ wlam; zrati2= csqrtl(1./ cmplx( epsr2,- sig2* wlam*59.96)); fprintf( output_fp, "\n" " " "%6s CLIFF\n" " " "EDGE DISTANCE= %9.2LF METERS\n" " " "HEIGHT= %8.2LF METERS\n" " " "SECOND MEDIUM -\n" " " "RELATIVE DIELECTRIC CONST.= %7.3LF\n" " " "CONDUCTIVITY= %10.3LF MHOS", hclif, clt, cht, epsr2, sig2 ); } /* if( ! jump ) */ } /* if( ifar >= 2) */ if( ifar == 1) { fprintf( output_fp, "\n\n\n" " " "------- RADIATED FIELDS NEAR GROUND --------\n\n" " ------- LOCATION ------- --- E(THETA) --- " " ---- E(PHI) ---- --- E(RADIAL) ---\n" " RHO PHI Z MAG PHASE " " MAG PHASE MAG PHASE\n" " METERS DEGREES METERS VOLTS/M DEGREES " " VOLTS/M DEGREES VOLTS/M DEGREES" ); } else { itmp1=2* iax; itmp2= itmp1+1; fprintf( output_fp, "\n\n\n" " " "---------- RADIATION PATTERNS -----------\n" ); if( rfld >= 1.0e-20) { exrm=1./ rfld; exra= rfld/ wlam; exra=-360.*( exra- floorl( exra)); fprintf( output_fp, "\n" " " "RANGE: %13.6LE METERS\n" " " "EXP(-JKR)/R: %12.5LE AT PHASE: %7.2LF DEGREES\n", rfld, exrm, exra ); } fprintf( output_fp, "\n" " ---- ANGLES ----- %23s ---- POLARIZATION ---- " " ---- E(THETA) ---- ----- E(PHI) ------\n" " THETA PHI %6s %6s TOTAL AXIAL " " TILT SENSE MAGNITUDE PHASE MAGNITUDE PHASE\n" " DEGREES DEGREES DB DB DB RATIO " " DEGREES VOLTS/M DEGREES VOLTS/M DEGREES", igtp[ipd], igax[itmp1], igax[itmp2] ); } /* if( ifar == 1) */ if( (ixtyp == 0) || (ixtyp == 5) ) { gcop= wlam* wlam*2.* PI/(376.73* pinr); prad= pinr- ploss- pnlr; gcon= gcop; if( ipd != 0) gcon= gcon* pinr/ prad; } else if( ixtyp == 4) { pinr=394.51* xpr6* xpr6* wlam* wlam; gcop= wlam* wlam*2.* PI/(376.73* pinr); prad= pinr- ploss- pnlr; gcon= gcop; if( ipd != 0) gcon= gcon* pinr/ prad; } else { prad=0.; gcon=4.* PI/(1.+ xpr6* xpr6); gcop= gcon; } i=0; gmax=-1.e+10; pint=0.; tmp1= dph* TA; tmp2=.5* dth* TA; phi= phis- dph; for( kph = 1; kph <= nph; kph++ ) { phi += dph; pha= phi* TA; thet= thets- dth; for( kth = 1; kth <= nth; kth++ ) { thet += dth; if( (ksymp == 2) && (thet > 90.01) && (ifar != 1) ) continue; tha= thet* TA; if( ifar != 1) ffld( tha, pha, ð, &eph); else { gfld( rfld/wlam, pha, thet/wlam, ð, &eph, &erd, zrati, ksymp); erdm= cabs( erd); erda= cang( erd); } ethm2= creal( eth* conjl( eth)); ethm= sqrtl( ethm2); etha= cang( eth); ephm2= creal( eph* conjl( eph)); ephm= sqrtl( ephm2); epha= cang( eph); /* elliptical polarization calc. */ if( ifar != 1) { if( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) { tilta=0.; emajr2=0.; eminr2=0.; axrat=0.; isens= " "; } else { dfaz= epha- etha; if( epha >= 0.) dfaz2= dfaz-360.; else dfaz2= dfaz+360.; if( fabsl(dfaz) > fabsl(dfaz2) ) dfaz= dfaz2; cdfaz= cosl( dfaz* TA); tstor1= ethm2- ephm2; tstor2=2.* ephm* ethm* cdfaz; tilta=.5* atan2l( tstor2, tstor1); stilta= sinl( tilta); tstor1= tstor1* stilta* stilta; tstor2= tstor2* stilta* cosl( tilta); emajr2=- tstor1+ tstor2+ ethm2; eminr2= tstor1- tstor2+ ephm2; if( eminr2 < 0.) eminr2=0.; axrat= sqrtl( eminr2/ emajr2); tilta= tilta* TD; if( axrat <= 1.0e-5) isens= hpol[0]; else if( dfaz <= 0.) isens= hpol[1]; else isens= hpol[2]; } /* if( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) */ gnmj= db10( gcon* emajr2); gnmn= db10( gcon* eminr2); gnv = db10( gcon* ethm2); gnh = db10( gcon* ephm2); gtot= db10( gcon*(ethm2+ ephm2) ); if( inor > 0) { i++; switch( inor ) { case 1: tstor1= gnmj; break; case 2: tstor1= gnmn; break; case 3: tstor1= gnv; break; case 4: tstor1= gnh; break; case 5: tstor1= gtot; } gain[i-1]= tstor1; if( tstor1 > gmax) gmax= tstor1; } /* if( inor > 0) */ if( iavp != 0) { tstor1= gcop*( ethm2+ ephm2); tmp3= tha- tmp2; tmp4= tha+ tmp2; if( kth == 1) tmp3= tha; else if( kth == nth) tmp4= tha; da= fabsl( tmp1*( cosl( tmp3)- cosl( tmp4))); if( (kph == 1) || (kph == nph) ) da *=.5; pint += tstor1* da; if( iavp == 2) continue; } if( iax != 1) { tmp5= gnmj; tmp6= gnmn; } else { tmp5= gnv; tmp6= gnh; } ethm= ethm* wlam; ephm= ephm* wlam; if( rfld >= 1.0e-20 ) { ethm= ethm* exrm; etha= etha+ exra; ephm= ephm* exrm; epha= epha+ exra; } fprintf( output_fp, "\n" " %7.2LF %9.2LF %8.2LF %8.2LF %8.2LF %11.4LF" " %9.2LF %6s %11.4LE %9.2LF %11.4LE %9.2LF", thet, phi, tmp5, tmp6, gtot, axrat, tilta, isens, ethm, etha, ephm, epha ); if( iplp1 != 3) continue; if( iplp3 != 0) { if( iplp2 == 1 ) { if( iplp3 == 1 ) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", thet, ethm, etha ); else if( iplp3 == 2 ) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", thet, ephm, epha ); } if( iplp2 == 2 ) { if( iplp3 == 1 ) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", phi, ethm, etha ); else if( iplp3 == 2 ) fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", phi, ephm, epha ); } } if( iplp4 == 0 ) continue; if( iplp2 == 1 ) { switch( iplp4 ) { case 1: fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, tmp5 ); break; case 2: fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, tmp6 ); break; case 3: fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, gtot ); } } if( iplp2 == 2 ) { switch( iplp4 ) { case 1: fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, tmp5 ); break; case 2: fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, tmp6 ); break; case 3: fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, gtot ); } } continue; } /* if( ifar != 1) */ fprintf( output_fp, "\n" " %9.2LF %7.2LF %9.2LF %11.4LE %7.2LF %11.4LE %7.2LF %11.4LE %7.2LF", rfld, phi, thet, ethm, etha, ephm, epha, erdm, erda ); } /* for( kth = 1; kth <= nth; kth++ ) */ } /* for( kph = 1; kph <= nph; kph++ ) */ if( iavp != 0) { tmp3= thets* TA; tmp4= tmp3+ dth* TA* (long double)( nth-1); tmp3= fabsl( dph* TA* (long double)( nph-1)*( cosl( tmp3)- cosl( tmp4))); pint /= tmp3; tmp3 /= PI; fprintf( output_fp, "\n\n\n" " AVERAGE POWER GAIN: %11.4LE - SOLID ANGLE" " USED IN AVERAGING: (%+7.4LF)*PI STERADIANS", pint, tmp3 ); } if( inor == 0) return; if( fabsl( gnor) > 1.0e-20) gmax= gnor; itmp1=( inor-1); fprintf( output_fp, "\n\n\n" " " " ---------- NORMALIZED GAIN ----------\n" " %6s GAIN\n" " " " NORMALIZATION FACTOR: %.2LF db\n\n" " ---- ANGLES ---- ---- ANGLES ----" " ---- ANGLES ----\n" " THETA PHI GAIN THETA PHI " " GAIN THETA PHI GAIN\n" " DEGREES DEGREES DB DEGREES DEGREES " " DB DEGREES DEGREES DB", igntp[itmp1], gmax ); itmp2= nph* nth; itmp1=( itmp2+2)/3; itmp2= itmp1*3- itmp2; itmp3= itmp1; itmp4=2* itmp1; if( itmp2 == 2) itmp4--; for( i = 0; i < itmp1; i++ ) { itmp3++; itmp4++; j= i/ nth; tmp1= thets+ (long double)( i - j*nth )* dth; tmp2= phis+ (long double)(j)* dph; j=( itmp3-1)/ nth; tmp3= thets+ (long double)( itmp3- j* nth-1)* dth; tmp4= phis+ (long double)(j)* dph; j=( itmp4-1)/ nth; tmp5= thets+ (long double)( itmp4- j* nth-1)* dth; tmp6= phis+ (long double)(j)* dph; tstor1= gain[i]- gmax; if( ((i+1) == itmp1) && (itmp2 != 0) ) { if( itmp2 != 2) { tstor2= gain[itmp3-1]- gmax; fprintf( output_fp, "\n" " %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF ", tmp1, tmp2, tstor1, tmp3, tmp4, tstor2 ); return; } fprintf( output_fp, "\n" " %9.2LF %9.2LF %9.2LF ", tmp1, tmp2, tstor1 ); return; } /* if( ((i+1) == itmp1) && (itmp2 != 0) ) */ tstor2= gain[itmp3-1]- gmax; pint= gain[itmp4-1]- gmax; fprintf( output_fp, "\n" " %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF %9.2LF", tmp1, tmp2, tstor1, tmp3, tmp4, tstor2, tmp5, tmp6, pint ); } /* for( i = 0; i < itmp1; i++ ) */ free_ptr( (void *)&gain ); return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/network.c0000644000175000017500000003437010310210756015632 0ustar numanuma/******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2c.h" /* common /netcx/ */ extern int masym, neq, npeq, neq2, nonet, ntsol, nprint; extern int *iseg1, *iseg2, *ntyp; extern long double *x11r, *x11i, *x12r; extern long double *x12i, *x22r, *x22i; extern long double pin, pnls; extern complex long double zped; /* common /vsorc/ */ extern int *ivqd, *isant, *iqds, nvqd, nsant, nqds; extern complex long double *vqd, *vqds, *vsant; /* common /data/ */ extern int n, np, m, mp, ipsym, npm, np2m, np3m; /* n+m,n+2m,n+3m */ extern int *icon1, *icon2, *itag; extern long double *x, *y, *z, *si, *bi; extern long double *x2, *y2, *z2, *cab, *sab, *salp; extern long double *t1x, *t1y, *t1z, *t2x, *t2y, *t2z; extern long double *px, *py, *pz, *pbi, *psalp; extern long double wlam; /* common /crnt/ */ extern long double *air, *aii, *bir, *bii, *cir, *cii; extern complex long double *cur; /* pointers to input/output files */ extern FILE *input_fp, *output_fp, *plot_fp; /*-------------------------------------------------------------------*/ /* subroutine netwk solves for structure currents for a given */ /* excitation including the effect of non-radiating networks if */ /* present. */ void netwk( complex long double *cm, complex long double *cmb, complex long double *cmc, complex long double *cmd, int *ip, complex long double *einc ) { int *ipnt = NULL, *nteqa = NULL, *ntsca = NULL; int jump1, jump2, nteq=0, ntsc=0, nseg2, irow2=0, j, ndimn; int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0; long double asmx, asa, pwr, y11r, y11i, y12r, y12i, y22r, y22i; complex long double *vsrc = NULL, *rhs = NULL, *cmn = NULL; complex long double *rhnt = NULL, *rhnx = NULL, ymit, vlt, cux; neqz2= neq2; if( neqz2 == 0) neqz2=1; pin=0.; pnls=0.; neqt= neq+ neq2; ndimn = j = (2*nonet + nsant); /* Allocate network buffers */ if( nonet > 0 ) { mem_alloc( (void *)&rhs, np3m * sizeof(complex long double) ); i = j * sizeof(complex long double); mem_alloc( (void *)&rhnt, i ); mem_alloc( (void *)&rhnx, i ); mem_alloc( (void *)&cmn, i * j ); i = j * sizeof(int); mem_alloc( (void *)&ntsca, i ); mem_alloc( (void *)&nteqa, i ); mem_alloc( (void *)&ipnt, i ); mem_alloc( (void *)&vsrc, nsant * sizeof(complex long double) ); } if( ntsol == 0) { /* compute relative matrix asymmetry */ if( masym != 0) { irow1=0; if( nonet != 0) { for( i = 0; i < nonet; i++ ) { nseg1= iseg1[i]; for( isc1 = 0; isc1 < 2; isc1++ ) { if( irow1 == 0) { ipnt[irow1]= nseg1; nseg1= iseg2[i]; irow1++; continue; } for( j = 0; j < irow1; j++ ) if( nseg1 == ipnt[j]) break; if( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } nseg1= iseg2[i]; } /* for( isc1 = 0; isc1 < 2; isc1++ ) */ } /* for( i = 0; i < nonet; i++ ) */ } /* if( nonet != 0) */ if( nsant != 0) { for( i = 0; i < nsant; i++ ) { nseg1= isant[i]; if( irow1 == 0) { ipnt[irow1]= nseg1; irow1++; continue; } for( j = 0; j < irow1; j++ ) if( nseg1 == ipnt[j]) break; if( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } } /* for( i = 0; i < nsant; i++ ) */ } /* if( nsant != 0) */ if( irow1 >= 2) { for( i = 0; i < irow1; i++ ) { isc1= ipnt[i]-1; asmx= si[isc1]; for( j = 0; j < neqt; j++ ) rhs[j] = CPLX_00; rhs[isc1] = CPLX_10; solves( cm, ip, rhs, neq, 1, np, n, mp, m); cabc( rhs); for( j = 0; j < irow1; j++ ) { isc1= ipnt[j]-1; cmn[j+i*ndimn]= rhs[isc1]/ asmx; } } /* for( i = 0; i < irow1; i++ ) */ asmx=0.; asa=0.; for( i = 1; i < irow1; i++ ) { isc1= i; for( j = 0; j < isc1; j++ ) { cux= cmn[i+j*ndimn]; pwr= cabsl(( cux- cmn[j+i*ndimn])/ cux); asa += pwr* pwr; if( pwr < asmx) continue; asmx= pwr; nteq= ipnt[i]; ntsc= ipnt[j]; } /* for( j = 0; j < isc1; j++ ) */ } /* for( i = 1; i < irow1; i++ ) */ asa= sqrtl( asa*2./ (long double)( irow1*( irow1-1))); fprintf( output_fp, "\n\n" " MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n" " MATRIX IS %10.3LE FOR SEGMENTS %d AND %d\n" " RMS RELATIVE ASYMMETRY IS %10.3LE", asmx, nteq, ntsc, asa ); } /* if( irow1 >= 2) */ } /* if( masym != 0) */ /* solution of network equations */ if( nonet != 0) { for( i = 0; i < ndimn; i++ ) { rhnx[i]=CPLX_00; for( j = 0; j < ndimn; j++ ) cmn[j+i*ndimn]=CPLX_00; } /* sort network and source data and */ /* assign equation numbers to segments */ nteq=0; ntsc=0; for( j = 0; j < nonet; j++ ) { nseg1= iseg1[j]; nseg2= iseg2[j]; if( ntyp[j] <= 1) { y11r= x11r[j]; y11i= x11i[j]; y12r= x12r[j]; y12i= x12i[j]; y22r= x22r[j]; y22i= x22i[j]; } else { y22r= TP* x11i[j]/ wlam; y12r=0.; y12i=1./( x11r[j]* sinl( y22r)); y11r= x12r[j]; y11i=- y12i* cosl( y22r); y22r= x22r[j]; y22i= y11i+ x22i[j]; y11i= y11i+ x12i[j]; if( ntyp[j] != 2) { y12r=- y12r; y12i=- y12i; } } /* if( ntyp[j] <= 1) */ jump1 = FALSE; if( nsant != 0) { for( i = 0; i < nsant; i++ ) if( nseg1 == isant[i]) { isc1 = i; jump1 = TRUE; break; } } /* if( nsant != 0) */ jump2 = FALSE; if( ! jump1 ) { isc1=-1; if( nteq != 0) { for( i = 0; i < nteq; i++ ) if( nseg1 == nteqa[i]) { irow1 = i; jump2 = TRUE; break; } } /* if( nteq != 0) */ if( ! jump2 ) { irow1= nteq; nteqa[nteq]= nseg1; nteq++; } } /* if( ! jump1 ) */ else { if( ntsc != 0) { for( i = 0; i < ntsc; i++ ) { if( nseg1 == ntsca[i]) { irow1 = ndimn- (i+1); jump2 = TRUE; break; } } } /* if( ntsc != 0) */ if( ! jump2 ) { irow1= ndimn- (ntsc+1); ntsca[ntsc]= nseg1; vsrc[ntsc]= vsant[isc1]; ntsc++; } } /* if( ! jump1 ) */ jump1 = FALSE; if( nsant != 0) { for( i = 0; i < nsant; i++ ) { if( nseg2 == isant[i]) { isc2= i; jump1 = TRUE; break; } } } /* if( nsant != 0) */ jump2 = FALSE; if( ! jump1 ) { isc2=-1; if( nteq != 0) { for( i = 0; i < nteq; i++ ) if( nseg2 == nteqa[i]) { irow2= i; jump2 = TRUE; break; } } /* if( nteq != 0) */ if( ! jump2 ) { irow2= nteq; nteqa[nteq]= nseg2; nteq++; } } /* if( ! jump1 ) */ else { if( ntsc != 0) { for( i = 0; i < ntsc; i++ ) if( nseg2 == ntsca[i]) { irow2 = ndimn- (i+1); jump2 = TRUE; break; } } /* if( ntsc != 0) */ if( ! jump2 ) { irow2= ndimn- (ntsc+1); ntsca[ntsc]= nseg2; vsrc[ntsc]= vsant[isc2]; ntsc++; } } /* if( ! jump1 ) */ /* fill network equation matrix and right hand side vector with */ /* network short-circuit admittance matrix coefficients. */ if( isc1 == -1) { cmn[irow1+irow1*ndimn] -= cmplx( y11r, y11i)* si[nseg1-1]; cmn[irow1+irow2*ndimn] -= cmplx( y12r, y12i)* si[nseg1-1]; } else { rhnx[irow1] += cmplx( y11r, y11i)* vsant[isc1]/wlam; rhnx[irow2] += cmplx( y12r, y12i)* vsant[isc1]/wlam; } if( isc2 == -1) { cmn[irow2+irow2*ndimn] -= cmplx( y22r, y22i)* si[nseg2-1]; cmn[irow2+irow1*ndimn] -= cmplx( y12r, y12i)* si[nseg2-1]; } else { rhnx[irow1] += cmplx( y12r, y12i)* vsant[isc2]/wlam; rhnx[irow2] += cmplx( y22r, y22i)* vsant[isc2]/wlam; } } /* for( j = 0; j < nonet; j++ ) */ /* add interaction matrix admittance */ /* elements to network equation matrix */ for( i = 0; i < nteq; i++ ) { for( j = 0; j < neqt; j++ ) rhs[j] = CPLX_00; irow1= nteqa[i]-1; rhs[irow1]=CPLX_10; solves( cm, ip, rhs, neq, 1, np, n, mp, m); cabc( rhs); for( j = 0; j < nteq; j++ ) { irow1= nteqa[j]-1; cmn[i+j*ndimn] += rhs[irow1]; } } /* for( i = 0; i < nteq; i++ ) */ /* factor network equation matrix */ factr( nteq, cmn, ipnt, ndimn); } /* if( nonet != 0) */ } /* if( ntsol != 0) */ if( nonet != 0) { /* add to network equation right hand side */ /* the terms due to element interactions */ for( i = 0; i < neqt; i++ ) rhs[i]= einc[i]; solves( cm, ip, rhs, neq, 1, np, n, mp, m); cabc( rhs); for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; rhnt[i]= rhnx[i]+ rhs[irow1]; } /* solve network equations */ solve( nteq, cmn, ipnt, rhnt, ndimn); /* add fields due to network voltages to electric fields */ /* applied to structure and solve for induced current */ for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; einc[irow1] -= rhnt[i]; } solves( cm, ip, einc, neq, 1, np, n, mp, m); cabc( einc); if( nprint == 0) { fprintf( output_fp, "\n\n\n" " " "--------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) " " IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY (WATTS)" ); } for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; vlt= rhnt[i]* si[irow1]* wlam; cux= einc[irow1]* wlam; ymit= cux/ vlt; zped= vlt/ cux; irow2= itag[irow1]; pwr=.5* creall( vlt* conjl( cux)); pnls= pnls- pwr; if( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", irow2, irow1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), creall(zped), cimagl(zped), creall(ymit), cimagl(ymit), pwr ); } if( ntsc != 0) { for( i = 0; i < ntsc; i++ ) { irow1= ntsca[i]-1; vlt= vsrc[i]; cux= einc[irow1]* wlam; ymit= cux/ vlt; zped= vlt/ cux; irow2= itag[irow1]; pwr=.5* creall( vlt* conjl( cux)); pnls= pnls- pwr; if( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", irow2, irow1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), creall(zped), cimagl(zped), creall(ymit), cimagl(ymit), pwr ); } /* for( i = 0; i < ntsc; i++ ) */ } /* if( ntsc != 0) */ } /* if( nonet != 0) */ else { /* solve for currents when no networks are present */ solves( cm, ip, einc, neq, 1, np, n, mp, m); cabc( einc); ntsc=0; } if( (nsant+nvqd) == 0) return; fprintf( output_fp, "\n\n\n" " " "--------- ANTENNA INPUT PARAMETERS ---------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) " "CURRENT (AMPS) IMPEDANCE (OHMS) " " ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY" " REAL IMAGINARY REAL " "IMAGINARY REAL IMAGINARY (WATTS)" ); if( nsant != 0) { for( i = 0; i < nsant; i++ ) { isc1= isant[i]-1; vlt= vsant[i]; if( ntsc == 0) { cux= einc[isc1]* wlam; irow1=0; } else { for( j = 0; j < ntsc; j++ ) if( ntsca[j] == isc1+1) break; irow1= ndimn- (j+1); cux= rhnx[irow1]; for( j = 0; j < nteq; j++ ) cux -= cmn[j+irow1*ndimn]*rhnt[j]; cux=(einc[isc1]+ cux)* wlam; irow1++; } /* if( ntsc == 0) */ ymit= cux/ vlt; zped= vlt/ cux; pwr=.5* creall( vlt* conjl( cux)); pin= pin+ pwr; if( irow1 != 0) pnls= pnls+ pwr; irow2= itag[isc1]; fprintf( output_fp, "\n" " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), creall(zped), cimagl(zped), creall(ymit), cimagl(ymit), pwr ); } /* for( i = 0; i < nsant; i++ ) */ } /* if( nsant != 0) */ if( nvqd == 0) return; for( i = 0; i < nvqd; i++ ) { isc1= ivqd[i]-1; vlt= vqd[i]; cux= cmplx( air[isc1], aii[isc1]); ymit= cmplx( bir[isc1], bii[isc1]); zped= cmplx( cir[isc1], cii[isc1]); pwr= si[isc1]* TP*.5; cux=( cux- ymit* sinl( pwr)+ zped* cosl( pwr))* wlam; ymit= cux/ vlt; zped= vlt/ cux; pwr=.5* creall( vlt* conjl( cux)); pin= pin+ pwr; irow2= itag[isc1]; fprintf( output_fp, "\n" " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), creall(zped), cimagl(zped), creall(ymit), cimagl(ymit), pwr ); } /* for( i = 0; i < nvqd; i++ ) */ /* Free network buffers */ free_ptr( (void *)&ipnt ); free_ptr( (void *)&nteqa ); free_ptr( (void *)&ntsca ); free_ptr( (void *)&vsrc ); free_ptr( (void *)&rhs ); free_ptr( (void *)&cmn ); free_ptr( (void *)&rhnt ); free_ptr( (void *)&rhnx ); return; } /*-----------------------------------------------------------------------*/ necpp-1.5.0+cvs20101003/c_src/CVS/0000755000175000017500000000000011452152150014422 5ustar numanumanecpp-1.5.0+cvs20101003/c_src/CVS/Root0000644000175000017500000000007011452152145015271 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/c_src/CVS/Repository0000644000175000017500000000001411452152145016523 0ustar numanumanecpp/c_src necpp-1.5.0+cvs20101003/c_src/CVS/Entries0000644000175000017500000000117411452152150015761 0ustar numanuma/Makefile/1.1.1.1/Fri Sep 9 04:39:09 2005// /README/1.1.1.1/Fri Sep 9 04:39:09 2005// /calculations.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /fields.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /geometry.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /ground.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /input.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /main.c/1.1.1.1/Fri Sep 9 04:39:09 2005// /matrix.c/1.1.1.1/Fri Sep 9 04:39:10 2005// /misc.c/1.1.1.1/Fri Sep 9 04:39:10 2005// /nec2c.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /network.c/1.1.1.1/Fri Sep 9 04:39:10 2005// /radiation.c/1.1.1.1/Fri Sep 9 04:39:10 2005// /somnec.c/1.1.1.1/Fri Sep 9 04:39:10 2005// D necpp-1.5.0+cvs20101003/example/0000755000175000017500000000000011452152150014331 5ustar numanumanecpp-1.5.0+cvs20101003/example/test_cpp.cpp0000644000175000017500000000762610374715661016707 0ustar numanuma#include using namespace std; /* An example of how to use nec2++ from within a C++ program. See the makefile target 'test_cpp' for how to compile this (as well as the nec2++) source code. Copyright (C) 2005 Timothy C.A. Molteno (tim@molteno.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_geometry.h" #include "nec_context.h" #include "nec_exception.h" #include "nec_radiation_pattern.h" int main(int argc, char **argv) { try { cout << endl << "Nec2++ C++ example. Running (takes a few minutes...)" << endl; nec_context nec; nec.set_results_stdout(false); nec.initialize(); /* CE GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE 0 GN -1 LD 5 0 0 0 3.720E+07 FR 0 1 0 0 2400 PT -1 EX 1 1 1 0 0 0 0 0 0 0 0 RP 0 10 10 0500 0 0 9 9 EN */ c_geometry* geo = nec.get_geometry(); geo->wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); geo->wire(0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); geo->wire(0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); geo->wire(0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); geo->wire(0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); geo->wire(0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); geo->wire(0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); geo->wire(0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); geo->wire(0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); geo->wire(0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); nec.geometry_complete(0,0); nec.gn_card(-1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); nec.ld_card(5,0,0,0,3.72e7,0.0,0.0); nec.pt_card(-1, 0, 0, 0); nec.ex_card(EXCITATION_LINEAR, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec.fr_card(0, 2, 2400.0, 100.0); nec.rp_card(0, 10, 10, 0,5,0,0, 0.0, 0.0, 9.0, 9.0, 0.0, 0.0); // now get the radiation pattern data. The result index is 0 since // this is the first (and only) radiation pattern. nec_radiation_pattern* rp = nec.get_radiation_pattern(0); int nth = rp->get_ntheta(); int nph = rp->get_nphi(); cout << endl << "Theta \tPhi \tHorizontal \tVertical \tTotal" << endl; for (int j=0; jget_theta(i) << " \t" << rp->get_phi(j) << " \t" << rp->get_power_gain_horiz(i,j) << " \t" << rp->get_power_gain_vert(i,j) << " \t" << rp->get_power_gain(i,j) << " \t" << rp->get_etheta_magnitude(i,j) << " \t" << rp->get_etheta_phase(i,j) << " \t" << rp->get_ephi_magnitude(i,j) << " \t" << rp->get_ephi_phase(i,j) << endl; } } } catch (nec_exception* e) { cout << e->get_message() << endl; } return 0; } necpp-1.5.0+cvs20101003/example/test_nec.nec0000644000175000017500000000013610310210756016623 0ustar numanumaGW 0 9 0. 0. 2. 0. 0. 7 .1 GE 1 FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 90 1 0500 0 90 1 0 EN necpp-1.5.0+cvs20101003/example/makefile0000755000175000017500000000372410360554170016047 0ustar numanuma##################################################################################### # # Makefile showing how to use libnecpp, the library # version of nec++. This lets you incorporate NEC2 # antenna electromagnetic modeling into your own programs # # Copyright (C) 2004-2005 Timothy C.A. Molteno # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # all: test_cpp test_static: test_nec.c gcc --static -o test_static test_nec.c -lnecpp -lstdc++ -lm test_nec: test_nec.c gcc -o test_nec test_nec.c -lnecpp ##################################################################################### # # The target below shows how to compile and use the nec2++ codebase # from within other C++ programs (GPL compatable of course!) # NECPP_SRC = ../src/c_ggrid.cpp ../src/matrix_algebra.cpp ../src/nec_ground.cpp \ ../src/c_evlcom.cpp ../src/c_plot_card.cpp ../src/misc.cpp \ ../src/nec_context.cpp ../src/nec_output.cpp ../src/c_geometry.cpp \ ../src/nec_exception.cpp ../src/nec_radiation_pattern.cpp \ ../src/nec_structure_currents.cpp NECPP_OBJS = $(NECPP_SRC:.cpp=.o) CPP_SRC = test_cpp.cpp CPP_OBJS = $(CPP_SRC:.cpp=.o) CXXFLAGS=-I ../src/ -O3 test_cpp: ${CPP_OBJS} ${NECPP_OBJS} gcc -o test_cpp ${CPP_OBJS} ${NECPP_OBJS} -lstdc++ -lm ./test_cpp cpp_clean: rm -f ${CPP_OBJS} ${NECPP_OBJS} necpp-1.5.0+cvs20101003/example/test_nec.c0000644000175000017500000000470211122667671016321 0ustar numanuma#include #include /* Enter the following file into test_nec.c, and compile with gcc -o test_nec test_nec.c -L . -lnecpp -lm -lstdc++ */ #include void seven_wire_antenna() { nec_context* nec; nec = nec_create(); nec_wire(nec, 1, 9, 0.0, 0.0, 0.0, -0.0166, 0.0045, 0.0714, 0.001, 1.0, 1.0); nec_wire(nec, 2, 7, -0.0166, 0.0045, 0.0714, -0.0318, -0.0166, 0.017, 0.001, 1.0, 1.0); nec_wire(nec, 3, 7, -0.0318, -0.0166, 0.017, -0.0318, -0.0287, 0.0775, 0.001, 1.0, 1.0); nec_wire(nec, 4, 11, -0.0318, -0.0287, 0.0775, -0.0318, 0.0439, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 5, 7, -0.0318, 0.0439, 0.014, -0.0318, 0.0045, 0.0624, 0.001, 1.0, 1.0); nec_wire(nec, 6, 5, -0.0318, 0.0045, 0.0624, -0.0106, 0.0378, 0.0866, 0.001, 1.0, 1.0); nec_wire(nec, 7, 7, -0.0106, 0.0378, 0.0866, -0.0106, 0.0257, 0.023, 0.001, 1.0, 1.0); nec_geometry_complete(nec, 1, 0); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_fr_card(nec, 0, 1, 1600.0, 0.0); nec_ex_card(nec, 0, 1, 1, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0); // nec_rp_card(nec, 0, 90, 1, 0,0,0,0, 0, 90, 1, 0, 0, 0); nec_rp_card(nec, 0, 17, 45, 0,5,0,0, 0, 0, 5, 8, 0, 0); printf("Impedance: %f, %f\n",nec_impedance_real(nec,0), nec_impedance_imag(nec,0)); printf("Gain: %f, %f +/- %f dB\n",nec_gain_max(nec,0), nec_gain_mean(nec,0), nec_gain_sd(nec,0)); printf("RHCP Gain: %f, %f +/- %f dB\n",nec_gain_rhcp_max(nec,0), nec_gain_rhcp_mean(nec,0), nec_gain_rhcp_sd(nec,0)); printf("LHCP Gain: %f, %f +/- %f dB\n",nec_gain_lhcp_max(nec,0), nec_gain_lhcp_mean(nec,0), nec_gain_lhcp_sd(nec,0)); nec_delete(nec); } void simple_example() { /* GW 0 9 0. 0. 2. 0. 0. 7 .1 GE 1 FR 0 1 0 30. EX 0 5 0 1. GN 1 RP 0 90 1 0000 0 90 1 0 */ nec_context* nec; nec = nec_create(); nec_wire(nec, 0, 9, 0, 0, 2, 0, 0, 7, 0.1, 1, 1); nec_geometry_complete(nec, 1, 0); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_fr_card(nec, 0, 1, 30, 0); nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0, 0, 0, 0, 0); nec_rp_card(nec, 0, 90, 1, 0,5,0,0, 0, 90, 1, 0, 0, 0); printf("Gain: %f, %f +/- %f dB\n",nec_gain_max(nec,0), nec_gain_mean(nec,0), nec_gain_sd(nec,0)); printf("RHCP Gain: %f, %f +/- %f dB\n",nec_gain_rhcp_max(nec,0), nec_gain_rhcp_mean(nec,0), nec_gain_rhcp_sd(nec,0)); printf("LHCP Gain: %f, %f +/- %f dB\n",nec_gain_lhcp_max(nec,0), nec_gain_lhcp_mean(nec,0), nec_gain_lhcp_sd(nec,0)); nec_delete(nec); } int main(int argc, char **argv) { simple_example(); seven_wire_antenna(); } necpp-1.5.0+cvs20101003/example/CVS/0000755000175000017500000000000011452152150014764 5ustar numanumanecpp-1.5.0+cvs20101003/example/CVS/Root0000644000175000017500000000007011452152150015627 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/example/CVS/Repository0000644000175000017500000000001611452152150017063 0ustar numanumanecpp/example necpp-1.5.0+cvs20101003/example/CVS/Entries0000644000175000017500000000026411452152150016322 0ustar numanuma/makefile/1.6/Mon Jan 9 21:41:12 2006// /test_cpp.cpp/1.7/Wed Feb 15 21:22:57 2006// /test_nec.c/1.4/Fri Dec 19 09:56:09 2008// /test_nec.nec/1.1.1.1/Fri Sep 9 04:39:10 2005// D necpp-1.5.0+cvs20101003/templates/0000755000175000017500000000000011452152157014703 5ustar numanumanecpp-1.5.0+cvs20101003/templates/h0000644000175000017500000000267010310210764015051 0ustar numanuma/*************************************************************************** * Copyright (C) 2004 by Tim Molteno,,, * * tim@cyberiad * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ necpp-1.5.0+cvs20101003/templates/cpp0000644000175000017500000000267010310210764015404 0ustar numanuma/*************************************************************************** * Copyright (C) 2004 by Tim Molteno * * tim@physics.otago.ac.nz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ necpp-1.5.0+cvs20101003/templates/CVS/0000755000175000017500000000000011452152157015336 5ustar numanumanecpp-1.5.0+cvs20101003/templates/CVS/Root0000644000175000017500000000007011452152157016201 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/templates/CVS/Repository0000644000175000017500000000002011452152157017430 0ustar numanumanecpp/templates necpp-1.5.0+cvs20101003/templates/CVS/Entries0000644000175000017500000000012011452152157016663 0ustar numanuma/cpp/1.1.1.1/Fri Sep 9 04:39:16 2005// /h/1.1.1.1/Fri Sep 9 04:39:16 2005// D necpp-1.5.0+cvs20101003/html/0000755000175000017500000000000011452152150013642 5ustar numanumanecpp-1.5.0+cvs20101003/html/CVS/0000755000175000017500000000000011452152150014275 5ustar numanumanecpp-1.5.0+cvs20101003/html/CVS/Root0000644000175000017500000000007011452152150015140 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/html/CVS/Repository0000644000175000017500000000001311452152150016371 0ustar numanumanecpp/html necpp-1.5.0+cvs20101003/html/CVS/Entries0000644000175000017500000000000211452152150015621 0ustar numanumaD necpp-1.5.0+cvs20101003/test_data/0000755000175000017500000000000011452152163014652 5ustar numanumanecpp-1.5.0+cvs20101003/test_data/ek_test.nec0000644000175000017500000000036310310210764016773 0ustar numanumaCM NEC-WIN Example CM Simple dipole antenna in Free Space CM Optimized for resonance at 300 MHz CE GW 1 9 0 -.2418 0 0 .2418 0 .0537 GS 0 0 1 GE 0 -1 0 EK 0 EX 0 1 5 0 1 0 FR 0 1 0 0 300 1 RP 0 181 1 1000 -90 0 1 1 RP 0 1 360 1000 90 0 1 1 EN necpp-1.5.0+cvs20101003/test_data/intersection.nec0000644000175000017500000000037111130554610020044 0ustar numanumaCM Test intersection CM SHOULD FAIL with nec_exception about intersecting wires CE GW 0 7 0.0 0.0 0.0 1.0 1.0 0.0 .005 GW 1 7 0.3 0.0 0.0 0.3 1.0 0.0 .005 GE EX 0 0 4 0 1. XQ LD 0 0 4 4 10. 3.000E-09 5.300E-11 PQ NE 0 1 1 15 .001 0 0 0. 0. .01786 ENnecpp-1.5.0+cvs20101003/test_data/excessive_gain.nec0000644000175000017500000000026711236461304020342 0ustar numanumaCM nec2++ -i necError.nec -g CE GW 1 11 0 0 0.0906315 0 0.131159 0.0906315 0.1 GE 0 GN 1 0 0 0 0 0 FR 0 1 0 0 1600 0 EX 0 1 1 0 1 0 0 0 0 0 RP 0 33 36 1011 -80 0 5.0 5.0 1.0 1.0 EN necpp-1.5.0+cvs20101003/test_data/ga_pjw_1.nec0000644000175000017500000000021510310210764017020 0ustar numanumaCM GA - NEC FILE CE go blue ! GW 0 640 5.79 3.58 7.21 8.99 1.74 0.8 0.54 GE 1 FR 0 1 0 0 2400 EX 0 0 5 0 1. GN 1 RP 0 90 1 0500 0 90 1 0 EN necpp-1.5.0+cvs20101003/test_data/example3.nec0000644000175000017500000000074410746477324017102 0ustar numanumaCMEXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND CM EXTENDED THIN WIRE KERNEL USED CM 1. PERFECT GROUND CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING CE PATTERN CALCULATIONS GW 0 9 0. 0. 2. 0. 0. 7. .3 GE 1 EK FR 0 1 0 0 30. EX 0 0 5 0 1. GN 1 RP 0 10 2 1301 0. 0. 10. 90. GN 0 0 0 0 6. 1.000E-03 RP 0 10 2 1301 0. 0. 10. 90. RP 1 10 1 0 1. 0. 2. 0. 1.000E+05 EX 1 10 1 0 0. 0. 0. 10. PT 2 0 5 5 XQ EN necpp-1.5.0+cvs20101003/test_data/medium_test.nec0000644000175000017500000000053710404145457017671 0ustar numanumaCMEXAMPLE 2. CENTER FED LINEAR ANTENNA. CM CURRENT SLOPE DISCONTINUITY SOURCE. CM 1. THIN PERFECTLY CONDUCTING WIRE CE 2. THIN ALUMINUM WIRE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE MP 0 0 0 0 8.854e-12 1.5e-6 FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 50. XQ LD 5 0 0 0 3.720E+07 FR 0 1 0 0 300. EX 5 0 5 0 1. XQ EN necpp-1.5.0+cvs20101003/test_data/example2.nec0000644000175000017500000000050210310210764017045 0ustar numanumaCMEXAMPLE 2. CENTER FED LINEAR ANTENNA. CM CURRENT SLOPE DISCONTINUITY SOURCE. CM 1. THIN PERFECTLY CONDUCTING WIRE CE 2. THIN ALUMINUM WIRE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 50. XQ LD 5 0 0 0 3.720E+07 FR 0 1 0 0 300. EX 5 0 5 0 1. XQ ENnecpp-1.5.0+cvs20101003/test_data/plet_helix.nec0000644000175000017500000004537010310210764017501 0ustar numanumaCM Length L in mtr. = 0.612 CM Radius R1 in cm. = 2.275 CM Radius R2 in cm. = 2.275 CM Number of turns = 19 CM Segments per turn = 16 CM Rotate X, Y, Z = 0, 0, 0 CM Move X, Y, Z = 0, 0, 0 CE GW 1 1 .0 .0 .0 .02275 .0 .0 .00125 GW 2 1 .02275 .0 .0 .021018 .008706 .002013 .00125 GW 3 1 .021018 .008706 .002013 .016087 .016087 .004026 .00125 GW 4 1 .016087 .016087 .004026 .008706 .021018 .006039 .00125 GW 5 1 .008706 .021018 .006039 .0 .02275 .008053 .00125 GW 6 1 .0 .02275 .008053 -.008706 .021018 .010066 .00125 GW 7 1 -.008706 .021018 .010066 -.016087 .016087 .012079 .00125 GW 8 1 -.016087 .016087 .012079 -.021018 .008706 .014092 .00125 GW 9 1 -.021018 .008706 .014092 -.02275 .0 .016105 .00125 GW 10 1 -.02275 .0 .016105 -.021018 -.008706 .018118 .00125 GW 11 1 -.021018 -.008706 .018118 -.016087 -.016087 .020132 .00125 GW 12 1 -.016087 -.016087 .020132 -.008706 -.021018 .022145 .00125 GW 13 1 -.008706 -.021018 .022145 .0 -.02275 .024158 .00125 GW 14 1 .0 -.02275 .024158 .008706 -.021018 .026171 .00125 GW 15 1 .008706 -.021018 .026171 .016087 -.016087 .028184 .00125 GW 16 1 .016087 -.016087 .028184 .021018 -.008706 .030197 .00125 GW 17 1 .021018 -.008706 .030197 .02275 .0 .032211 .00125 GW 18 1 .02275 .0 .032211 .021018 .008706 .034224 .00125 GW 19 1 .021018 .008706 .034224 .016087 .016087 .036237 .00125 GW 20 1 .016087 .016087 .036237 .008706 .021018 .03825 .00125 GW 21 1 .008706 .021018 .03825 .0 .02275 .040263 .00125 GW 22 1 .0 .02275 .040263 -.008706 .021018 .042276 .00125 GW 23 1 -.008706 .021018 .042276 -.016087 .016087 .044289 .00125 GW 24 1 -.016087 .016087 .044289 -.021018 .008706 .046303 .00125 GW 25 1 -.021018 .008706 .046303 -.02275 .0 .048316 .00125 GW 26 1 -.02275 .0 .048316 -.021018 -.008706 .050329 .00125 GW 27 1 -.021018 -.008706 .050329 -.016087 -.016087 .052342 .00125 GW 28 1 -.016087 -.016087 .052342 -.008706 -.021018 .054355 .00125 GW 29 1 -.008706 -.021018 .054355 .0 -.02275 .056368 .00125 GW 30 1 .0 -.02275 .056368 .008706 -.021018 .058382 .00125 GW 31 1 .008706 -.021018 .058382 .016087 -.016087 .060395 .00125 GW 32 1 .016087 -.016087 .060395 .021018 -.008706 .062408 .00125 GW 33 1 .021018 -.008706 .062408 .02275 .0 .064421 .00125 GW 34 1 .02275 .0 .064421 .021018 .008706 .066434 .00125 GW 35 1 .021018 .008706 .066434 .016087 .016087 .068447 .00125 GW 36 1 .016087 .016087 .068447 .008706 .021018 .070461 .00125 GW 37 1 .008706 .021018 .070461 .0 .02275 .072474 .00125 GW 38 1 .0 .02275 .072474 -.008706 .021018 .074487 .00125 GW 39 1 -.008706 .021018 .074487 -.016087 .016087 .0765 .00125 GW 40 1 -.016087 .016087 .0765 -.021018 .008706 .078513 .00125 GW 41 1 -.021018 .008706 .078513 -.02275 .0 .080526 .00125 GW 42 1 -.02275 .0 .080526 -.021018 -.008706 .082539 .00125 GW 43 1 -.021018 -.008706 .082539 -.016087 -.016087 .084553 .00125 GW 44 1 -.016087 -.016087 .084553 -.008706 -.021018 .086566 .00125 GW 45 1 -.008706 -.021018 .086566 .0 -.02275 .088579 .00125 GW 46 1 .0 -.02275 .088579 .008706 -.021018 .090592 .00125 GW 47 1 .008706 -.021018 .090592 .016087 -.016087 .092605 .00125 GW 48 1 .016087 -.016087 .092605 .021018 -.008706 .094618 .00125 GW 49 1 .021018 -.008706 .094618 .02275 .0 .096632 .00125 GW 50 1 .02275 .0 .096632 .021018 .008706 .098645 .00125 GW 51 1 .021018 .008706 .098645 .016087 .016087 .100658 .00125 GW 52 1 .016087 .016087 .100658 .008706 .021018 .102671 .00125 GW 53 1 .008706 .021018 .102671 .0 .02275 .104684 .00125 GW 54 1 .0 .02275 .104684 -.008706 .021018 .106697 .00125 GW 55 1 -.008706 .021018 .106697 -.016087 .016087 .108711 .00125 GW 56 1 -.016087 .016087 .108711 -.021018 .008706 .110724 .00125 GW 57 1 -.021018 .008706 .110724 -.02275 .0 .112737 .00125 GW 58 1 -.02275 .0 .112737 -.021018 -.008706 .11475 .00125 GW 59 1 -.021018 -.008706 .11475 -.016087 -.016087 .116763 .00125 GW 60 1 -.016087 -.016087 .116763 -.008706 -.021018 .118776 .00125 GW 61 1 -.008706 -.021018 .118776 .0 -.02275 .120789 .00125 GW 62 1 .0 -.02275 .120789 .008706 -.021018 .122803 .00125 GW 63 1 .008706 -.021018 .122803 .016087 -.016087 .124816 .00125 GW 64 1 .016087 -.016087 .124816 .021018 -.008706 .126829 .00125 GW 65 1 .021018 -.008706 .126829 .02275 .0 .128842 .00125 GW 66 1 .02275 .0 .128842 .021018 .008706 .130855 .00125 GW 67 1 .021018 .008706 .130855 .016087 .016087 .132868 .00125 GW 68 1 .016087 .016087 .132868 .008706 .021018 .134882 .00125 GW 69 1 .008706 .021018 .134882 .0 .02275 .136895 .00125 GW 70 1 .0 .02275 .136895 -.008706 .021018 .138908 .00125 GW 71 1 -.008706 .021018 .138908 -.016087 .016087 .140921 .00125 GW 72 1 -.016087 .016087 .140921 -.021018 .008706 .142934 .00125 GW 73 1 -.021018 .008706 .142934 -.02275 .0 .144947 .00125 GW 74 1 -.02275 .0 .144947 -.021018 -.008706 .146961 .00125 GW 75 1 -.021018 -.008706 .146961 -.016087 -.016087 .148974 .00125 GW 76 1 -.016087 -.016087 .148974 -.008706 -.021018 .150987 .00125 GW 77 1 -.008706 -.021018 .150987 .0 -.02275 .153 .00125 GW 78 1 .0 -.02275 .153 .008706 -.021018 .155013 .00125 GW 79 1 .008706 -.021018 .155013 .016087 -.016087 .157026 .00125 GW 80 1 .016087 -.016087 .157026 .021018 -.008706 .159039 .00125 GW 81 1 .021018 -.008706 .159039 .02275 .0 .161053 .00125 GW 82 1 .02275 .0 .161053 .021018 .008706 .163066 .00125 GW 83 1 .021018 .008706 .163066 .016087 .016087 .165079 .00125 GW 84 1 .016087 .016087 .165079 .008706 .021018 .167092 .00125 GW 85 1 .008706 .021018 .167092 .0 .02275 .169105 .00125 GW 86 1 .0 .02275 .169105 -.008706 .021018 .171118 .00125 GW 87 1 -.008706 .021018 .171118 -.016087 .016087 .173132 .00125 GW 88 1 -.016087 .016087 .173132 -.021018 .008706 .175145 .00125 GW 89 1 -.021018 .008706 .175145 -.02275 .0 .177158 .00125 GW 90 1 -.02275 .0 .177158 -.021018 -.008706 .179171 .00125 GW 91 1 -.021018 -.008706 .179171 -.016087 -.016087 .181184 .00125 GW 92 1 -.016087 -.016087 .181184 -.008706 -.021018 .183197 .00125 GW 93 1 -.008706 -.021018 .183197 .0 -.02275 .185211 .00125 GW 94 1 .0 -.02275 .185211 .008706 -.021018 .187224 .00125 GW 95 1 .008706 -.021018 .187224 .016087 -.016087 .189237 .00125 GW 96 1 .016087 -.016087 .189237 .021018 -.008706 .19125 .00125 GW 97 1 .021018 -.008706 .19125 .02275 .0 .193263 .00125 GW 98 1 .02275 .0 .193263 .021018 .008706 .195276 .00125 GW 99 1 .021018 .008706 .195276 .016087 .016087 .197289 .00125 GW 100 1 .016087 .016087 .197289 .008706 .021018 .199303 .00125 GW 101 1 .008706 .021018 .199303 .0 .02275 .201316 .00125 GW 102 1 .0 .02275 .201316 -.008706 .021018 .203329 .00125 GW 103 1 -.008706 .021018 .203329 -.016087 .016087 .205342 .00125 GW 104 1 -.016087 .016087 .205342 -.021018 .008706 .207355 .00125 GW 105 1 -.021018 .008706 .207355 -.02275 .0 .209368 .00125 GW 106 1 -.02275 .0 .209368 -.021018 -.008706 .211382 .00125 GW 107 1 -.021018 -.008706 .211382 -.016087 -.016087 .213395 .00125 GW 108 1 -.016087 -.016087 .213395 -.008706 -.021018 .215408 .00125 GW 109 1 -.008706 -.021018 .215408 .0 -.02275 .217421 .00125 GW 110 1 .0 -.02275 .217421 .008706 -.021018 .219434 .00125 GW 111 1 .008706 -.021018 .219434 .016087 -.016087 .221447 .00125 GW 112 1 .016087 -.016087 .221447 .021018 -.008706 .223461 .00125 GW 113 1 .021018 -.008706 .223461 .02275 .0 .225474 .00125 GW 114 1 .02275 .0 .225474 .021018 .008706 .227487 .00125 GW 115 1 .021018 .008706 .227487 .016087 .016087 .2295 .00125 GW 116 1 .016087 .016087 .2295 .008706 .021018 .231513 .00125 GW 117 1 .008706 .021018 .231513 .0 .02275 .233526 .00125 GW 118 1 .0 .02275 .233526 -.008706 .021018 .235539 .00125 GW 119 1 -.008706 .021018 .235539 -.016087 .016087 .237553 .00125 GW 120 1 -.016087 .016087 .237553 -.021018 .008706 .239566 .00125 GW 121 1 -.021018 .008706 .239566 -.02275 .0 .241579 .00125 GW 122 1 -.02275 .0 .241579 -.021018 -.008706 .243592 .00125 GW 123 1 -.021018 -.008706 .243592 -.016087 -.016087 .245605 .00125 GW 124 1 -.016087 -.016087 .245605 -.008706 -.021018 .247618 .00125 GW 125 1 -.008706 -.021018 .247618 .0 -.02275 .249632 .00125 GW 126 1 .0 -.02275 .249632 .008706 -.021018 .251645 .00125 GW 127 1 .008706 -.021018 .251645 .016087 -.016087 .253658 .00125 GW 128 1 .016087 -.016087 .253658 .021018 -.008706 .255671 .00125 GW 129 1 .021018 -.008706 .255671 .02275 .0 .257684 .00125 GW 130 1 .02275 .0 .257684 .021018 .008706 .259697 .00125 GW 131 1 .021018 .008706 .259697 .016087 .016087 .261711 .00125 GW 132 1 .016087 .016087 .261711 .008706 .021018 .263724 .00125 GW 133 1 .008706 .021018 .263724 .0 .02275 .265737 .00125 GW 134 1 .0 .02275 .265737 -.008706 .021018 .26775 .00125 GW 135 1 -.008706 .021018 .26775 -.016087 .016087 .269763 .00125 GW 136 1 -.016087 .016087 .269763 -.021018 .008706 .271776 .00125 GW 137 1 -.021018 .008706 .271776 -.02275 .0 .273789 .00125 GW 138 1 -.02275 .0 .273789 -.021018 -.008706 .275803 .00125 GW 139 1 -.021018 -.008706 .275803 -.016087 -.016087 .277816 .00125 GW 140 1 -.016087 -.016087 .277816 -.008706 -.021018 .279829 .00125 GW 141 1 -.008706 -.021018 .279829 .0 -.02275 .281842 .00125 GW 142 1 .0 -.02275 .281842 .008706 -.021018 .283855 .00125 GW 143 1 .008706 -.021018 .283855 .016087 -.016087 .285868 .00125 GW 144 1 .016087 -.016087 .285868 .021018 -.008706 .287882 .00125 GW 145 1 .021018 -.008706 .287882 .02275 .0 .289895 .00125 GW 146 1 .02275 .0 .289895 .021018 .008706 .291908 .00125 GW 147 1 .021018 .008706 .291908 .016087 .016087 .293921 .00125 GW 148 1 .016087 .016087 .293921 .008706 .021018 .295934 .00125 GW 149 1 .008706 .021018 .295934 .0 .02275 .297947 .00125 GW 150 1 .0 .02275 .297947 -.008706 .021018 .299961 .00125 GW 151 1 -.008706 .021018 .299961 -.016087 .016087 .301974 .00125 GW 152 1 -.016087 .016087 .301974 -.021018 .008706 .303987 .00125 GW 153 1 -.021018 .008706 .303987 -.02275 .0 .306 .00125 GW 154 1 -.02275 .0 .306 -.021018 -.008706 .308013 .00125 GW 155 1 -.021018 -.008706 .308013 -.016087 -.016087 .310026 .00125 GW 156 1 -.016087 -.016087 .310026 -.008706 -.021018 .312039 .00125 GW 157 1 -.008706 -.021018 .312039 .0 -.02275 .314053 .00125 GW 158 1 .0 -.02275 .314053 .008706 -.021018 .316066 .00125 GW 159 1 .008706 -.021018 .316066 .016087 -.016087 .318079 .00125 GW 160 1 .016087 -.016087 .318079 .021018 -.008706 .320092 .00125 GW 161 1 .021018 -.008706 .320092 .02275 .0 .322105 .00125 GW 162 1 .02275 .0 .322105 .021018 .008706 .324118 .00125 GW 163 1 .021018 .008706 .324118 .016087 .016087 .326132 .00125 GW 164 1 .016087 .016087 .326132 .008706 .021018 .328145 .00125 GW 165 1 .008706 .021018 .328145 .0 .02275 .330158 .00125 GW 166 1 .0 .02275 .330158 -.008706 .021018 .332171 .00125 GW 167 1 -.008706 .021018 .332171 -.016087 .016087 .334184 .00125 GW 168 1 -.016087 .016087 .334184 -.021018 .008706 .336197 .00125 GW 169 1 -.021018 .008706 .336197 -.02275 .0 .338211 .00125 GW 170 1 -.02275 .0 .338211 -.021018 -.008706 .340224 .00125 GW 171 1 -.021018 -.008706 .340224 -.016087 -.016087 .342237 .00125 GW 172 1 -.016087 -.016087 .342237 -.008706 -.021018 .34425 .00125 GW 173 1 -.008706 -.021018 .34425 .0 -.02275 .346263 .00125 GW 174 1 .0 -.02275 .346263 .008706 -.021018 .348276 .00125 GW 175 1 .008706 -.021018 .348276 .016087 -.016087 .350289 .00125 GW 176 1 .016087 -.016087 .350289 .021018 -.008706 .352303 .00125 GW 177 1 .021018 -.008706 .352303 .02275 .0 .354316 .00125 GW 178 1 .02275 .0 .354316 .021018 .008706 .356329 .00125 GW 179 1 .021018 .008706 .356329 .016087 .016087 .358342 .00125 GW 180 1 .016087 .016087 .358342 .008706 .021018 .360355 .00125 GW 181 1 .008706 .021018 .360355 .0 .02275 .362368 .00125 GW 182 1 .0 .02275 .362368 -.008706 .021018 .364382 .00125 GW 183 1 -.008706 .021018 .364382 -.016087 .016087 .366395 .00125 GW 184 1 -.016087 .016087 .366395 -.021018 .008706 .368408 .00125 GW 185 1 -.021018 .008706 .368408 -.02275 .0 .370421 .00125 GW 186 1 -.02275 .0 .370421 -.021018 -.008706 .372434 .00125 GW 187 1 -.021018 -.008706 .372434 -.016087 -.016087 .374447 .00125 GW 188 1 -.016087 -.016087 .374447 -.008706 -.021018 .376461 .00125 GW 189 1 -.008706 -.021018 .376461 .0 -.02275 .378474 .00125 GW 190 1 .0 -.02275 .378474 .008706 -.021018 .380487 .00125 GW 191 1 .008706 -.021018 .380487 .016087 -.016087 .3825 .00125 GW 192 1 .016087 -.016087 .3825 .021018 -.008706 .384513 .00125 GW 193 1 .021018 -.008706 .384513 .02275 .0 .386526 .00125 GW 194 1 .02275 .0 .386526 .021018 .008706 .388539 .00125 GW 195 1 .021018 .008706 .388539 .016087 .016087 .390553 .00125 GW 196 1 .016087 .016087 .390553 .008706 .021018 .392566 .00125 GW 197 1 .008706 .021018 .392566 .0 .02275 .394579 .00125 GW 198 1 .0 .02275 .394579 -.008706 .021018 .396592 .00125 GW 199 1 -.008706 .021018 .396592 -.016087 .016087 .398605 .00125 GW 200 1 -.016087 .016087 .398605 -.021018 .008706 .400618 .00125 GW 201 1 -.021018 .008706 .400618 -.02275 .0 .402632 .00125 GW 202 1 -.02275 .0 .402632 -.021018 -.008706 .404645 .00125 GW 203 1 -.021018 -.008706 .404645 -.016087 -.016087 .406658 .00125 GW 204 1 -.016087 -.016087 .406658 -.008706 -.021018 .408671 .00125 GW 205 1 -.008706 -.021018 .408671 .0 -.02275 .410684 .00125 GW 206 1 .0 -.02275 .410684 .008706 -.021018 .412697 .00125 GW 207 1 .008706 -.021018 .412697 .016087 -.016087 .414711 .00125 GW 208 1 .016087 -.016087 .414711 .021018 -.008706 .416724 .00125 GW 209 1 .021018 -.008706 .416724 .02275 .0 .418737 .00125 GW 210 1 .02275 .0 .418737 .021018 .008706 .42075 .00125 GW 211 1 .021018 .008706 .42075 .016087 .016087 .422763 .00125 GW 212 1 .016087 .016087 .422763 .008706 .021018 .424776 .00125 GW 213 1 .008706 .021018 .424776 .0 .02275 .426789 .00125 GW 214 1 .0 .02275 .426789 -.008706 .021018 .428803 .00125 GW 215 1 -.008706 .021018 .428803 -.016087 .016087 .430816 .00125 GW 216 1 -.016087 .016087 .430816 -.021018 .008706 .432829 .00125 GW 217 1 -.021018 .008706 .432829 -.02275 .0 .434842 .00125 GW 218 1 -.02275 .0 .434842 -.021018 -.008706 .436855 .00125 GW 219 1 -.021018 -.008706 .436855 -.016087 -.016087 .438868 .00125 GW 220 1 -.016087 -.016087 .438868 -.008706 -.021018 .440882 .00125 GW 221 1 -.008706 -.021018 .440882 .0 -.02275 .442895 .00125 GW 222 1 .0 -.02275 .442895 .008706 -.021018 .444908 .00125 GW 223 1 .008706 -.021018 .444908 .016087 -.016087 .446921 .00125 GW 224 1 .016087 -.016087 .446921 .021018 -.008706 .448934 .00125 GW 225 1 .021018 -.008706 .448934 .02275 .0 .450947 .00125 GW 226 1 .02275 .0 .450947 .021018 .008706 .452961 .00125 GW 227 1 .021018 .008706 .452961 .016087 .016087 .454974 .00125 GW 228 1 .016087 .016087 .454974 .008706 .021018 .456987 .00125 GW 229 1 .008706 .021018 .456987 .0 .02275 .459 .00125 GW 230 1 .0 .02275 .459 -.008706 .021018 .461013 .00125 GW 231 1 -.008706 .021018 .461013 -.016087 .016087 .463026 .00125 GW 232 1 -.016087 .016087 .463026 -.021018 .008706 .465039 .00125 GW 233 1 -.021018 .008706 .465039 -.02275 .0 .467053 .00125 GW 234 1 -.02275 .0 .467053 -.021018 -.008706 .469066 .00125 GW 235 1 -.021018 -.008706 .469066 -.016087 -.016087 .471079 .00125 GW 236 1 -.016087 -.016087 .471079 -.008706 -.021018 .473092 .00125 GW 237 1 -.008706 -.021018 .473092 .0 -.02275 .475105 .00125 GW 238 1 .0 -.02275 .475105 .008706 -.021018 .477118 .00125 GW 239 1 .008706 -.021018 .477118 .016087 -.016087 .479132 .00125 GW 240 1 .016087 -.016087 .479132 .021018 -.008706 .481145 .00125 GW 241 1 .021018 -.008706 .481145 .02275 .0 .483158 .00125 GW 242 1 .02275 .0 .483158 .021018 .008706 .485171 .00125 GW 243 1 .021018 .008706 .485171 .016087 .016087 .487184 .00125 GW 244 1 .016087 .016087 .487184 .008706 .021018 .489197 .00125 GW 245 1 .008706 .021018 .489197 .0 .02275 .491211 .00125 GW 246 1 .0 .02275 .491211 -.008706 .021018 .493224 .00125 GW 247 1 -.008706 .021018 .493224 -.016087 .016087 .495237 .00125 GW 248 1 -.016087 .016087 .495237 -.021018 .008706 .49725 .00125 GW 249 1 -.021018 .008706 .49725 -.02275 .0 .499263 .00125 GW 250 1 -.02275 .0 .499263 -.021018 -.008706 .501276 .00125 GW 251 1 -.021018 -.008706 .501276 -.016087 -.016087 .503289 .00125 GW 252 1 -.016087 -.016087 .503289 -.008706 -.021018 .505303 .00125 GW 253 1 -.008706 -.021018 .505303 .0 -.02275 .507316 .00125 GW 254 1 .0 -.02275 .507316 .008706 -.021018 .509329 .00125 GW 255 1 .008706 -.021018 .509329 .016087 -.016087 .511342 .00125 GW 256 1 .016087 -.016087 .511342 .021018 -.008706 .513355 .00125 GW 257 1 .021018 -.008706 .513355 .02275 .0 .515368 .00125 GW 258 1 .02275 .0 .515368 .021018 .008706 .517382 .00125 GW 259 1 .021018 .008706 .517382 .016087 .016087 .519395 .00125 GW 260 1 .016087 .016087 .519395 .008706 .021018 .521408 .00125 GW 261 1 .008706 .021018 .521408 .0 .02275 .523421 .00125 GW 262 1 .0 .02275 .523421 -.008706 .021018 .525434 .00125 GW 263 1 -.008706 .021018 .525434 -.016087 .016087 .527447 .00125 GW 264 1 -.016087 .016087 .527447 -.021018 .008706 .529461 .00125 GW 265 1 -.021018 .008706 .529461 -.02275 .0 .531474 .00125 GW 266 1 -.02275 .0 .531474 -.021018 -.008706 .533487 .00125 GW 267 1 -.021018 -.008706 .533487 -.016087 -.016087 .5355 .00125 GW 268 1 -.016087 -.016087 .5355 -.008706 -.021018 .537513 .00125 GW 269 1 -.008706 -.021018 .537513 .0 -.02275 .539526 .00125 GW 270 1 .0 -.02275 .539526 .008706 -.021018 .541539 .00125 GW 271 1 .008706 -.021018 .541539 .016087 -.016087 .543553 .00125 GW 272 1 .016087 -.016087 .543553 .021018 -.008706 .545566 .00125 GW 273 1 .021018 -.008706 .545566 .02275 .0 .547579 .00125 GW 274 1 .02275 .0 .547579 .021018 .008706 .549592 .00125 GW 275 1 .021018 .008706 .549592 .016087 .016087 .551605 .00125 GW 276 1 .016087 .016087 .551605 .008706 .021018 .553618 .00125 GW 277 1 .008706 .021018 .553618 .0 .02275 .555632 .00125 GW 278 1 .0 .02275 .555632 -.008706 .021018 .557645 .00125 GW 279 1 -.008706 .021018 .557645 -.016087 .016087 .559658 .00125 GW 280 1 -.016087 .016087 .559658 -.021018 .008706 .561671 .00125 GW 281 1 -.021018 .008706 .561671 -.02275 .0 .563684 .00125 GW 282 1 -.02275 .0 .563684 -.021018 -.008706 .565697 .00125 GW 283 1 -.021018 -.008706 .565697 -.016087 -.016087 .567711 .00125 GW 284 1 -.016087 -.016087 .567711 -.008706 -.021018 .569724 .00125 GW 285 1 -.008706 -.021018 .569724 .0 -.02275 .571737 .00125 GW 286 1 .0 -.02275 .571737 .008706 -.021018 .57375 .00125 GW 287 1 .008706 -.021018 .57375 .016087 -.016087 .575763 .00125 GW 288 1 .016087 -.016087 .575763 .021018 -.008706 .577776 .00125 GW 289 1 .021018 -.008706 .577776 .02275 .0 .579789 .00125 GW 290 1 .02275 .0 .579789 .021018 .008706 .581803 .00125 GW 291 1 .021018 .008706 .581803 .016087 .016087 .583816 .00125 GW 292 1 .016087 .016087 .583816 .008706 .021018 .585829 .00125 GW 293 1 .008706 .021018 .585829 .0 .02275 .587842 .00125 GW 294 1 .0 .02275 .587842 -.008706 .021018 .589855 .00125 GW 295 1 -.008706 .021018 .589855 -.016087 .016087 .591868 .00125 GW 296 1 -.016087 .016087 .591868 -.021018 .008706 .593882 .00125 GW 297 1 -.021018 .008706 .593882 -.02275 .0 .595895 .00125 GW 298 1 -.02275 .0 .595895 -.021018 -.008706 .597908 .00125 GW 299 1 -.021018 -.008706 .597908 -.016087 -.016087 .599921 .00125 GW 300 1 -.016087 -.016087 .599921 -.008706 -.021018 .601934 .00125 GW 301 1 -.008706 -.021018 .601934 .0 -.02275 .603947 .00125 GW 302 1 .0 -.02275 .603947 .008706 -.021018 .605961 .00125 GW 303 1 .008706 -.021018 .605961 .016087 -.016087 .607974 .00125 GW 304 1 .016087 -.016087 .607974 .021018 -.008706 .609987 .00125 GW 305 1 .021018 -.008706 .609987 .02275 .0 .612 .00125 GW 306 1 .02275 .0 .612 .0 .0 .612 .00125 GE 0 XQ EN necpp-1.5.0+cvs20101003/test_data/Yg_4x6_b.nec0000644000175000017500000000666710310210764016733 0ustar numanumaCM 4x6 elements Irradia verso X --> CM CMPP 1, 0, 0, 0, 0 CE GW 1 15 .000 -494.949 .000 .000 494.949 .000 5.000 GW 2 15 669.467 -463.206 .000 669.467 463.206 .000 5.000 GW 3 15 1406.145 -455.733 .000 1406.145 455.733 .000 5.000 GW 4 15 2024.465 -450.898 .000 2024.465 450.898 .000 5.000 GW 5 15 2952.863 -437.193 .000 2952.863 437.193 .000 5.000 GW 6 15 3649.681 -456.451 .000 3649.681 456.451 .000 5.000 GM 0 0 .000 .000 .000 .000 2040.843 1695.745 .000 GS 0 0 .001 .000 .000 .000 .000 .000 .000 GX 100 011 .000 .000 .000 .000 .000 .000 .000 GE 0 0 .000 .000 .000 .000 .000 .000 .000 FR 0 1 0 0 .1441E+03 .0000 .0000 .0000 .0000 .0000 EK 0 0 0 0 .0000E+00 .0000 .0000 .0000 .0000 .0000 LD 5 1 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 2 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 3 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 4 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 5 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 6 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 101 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 102 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 103 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 104 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 105 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 106 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 201 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 202 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 203 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 204 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 205 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 206 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 301 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 302 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 303 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 304 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 305 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 LD 5 306 0 0 .2701E+08 .0000 .0000 .0000 .0000 .0000 KH 0 0 0 0 .1500E+01 .0000 .0000 .0000 .0000 .0000 EX 0 2 8 0 .1000E+01 .0000 .0000 .0000 .0000 .0000 EX 0 102 8 0 .1000E+01 .0000 .0000 .0000 .0000 .0000 EX 0 202 8 0 -.1000E+01 .0000 .0000 .0000 .0000 .0000 EX 0 302 8 0 -.1000E+01 .0000 .0000 .0000 .0000 .0000 PT -1 RP 0, 1, 1, 1001, 90, 0, 0, 0 RP 0, 1, 1, 1001, 90,180, 0, 0 RP 0, 1, 361, 1001, 90, 0, 1, 1 RP 0, 361, 1, 1001, 0, 0, 1, 1 EN necpp-1.5.0+cvs20101003/test_data/example5.nec0000644000175000017500000000234410310210764017056 0ustar numanumaCM 12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE CM 78 SEGMENTS. SIGMA=O/L RECEIVING AND TRANS. PATTERNS. CM DIPOLE LENGTH TO DIAMETER RATIO=150. CE TAU=0.93. SIGMA=0.70. BOOM IMPEDANCE=50. OHMS. GW 1 5 0.0000 -1.0000 0.0000000 0.00000 1.0000 0.000 .00667 GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717 GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771 GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829 GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891 GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958 GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103 GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108 GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191 GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281 GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377 GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481 GE FR 0 0 0 0 46.29 0. TL 1 3 2 3 -50. 0. 0. 0. 0. 0. TL 2 3 3 3 -50. 0. 0. 0. 0. 0. TL 3 3 4 3 -50. 0. 0. 0. 0. 0. TL 4 3 5 3 -50. 0. 0. 0. 0. 0. TL 5 3 6 4 -50. 0. 0. 0. 0. 0. TL 6 4 7 4 -50. 0. 0. 0. 0. 0. TL 7 4 8 4 -50. 0. 0. 0. 0. 0. TL 8 4 9 4 -50. 0. 0. 0. 0. 0. TL 9 4 10 4 -50. 0. 0. 0. 0. 0. TL 10 4 11 5 -50. 0. 0. 0. 0. 0. TL 11 5 12 5 -50. 0. 0. 0. 0. .02 EX 0 1 3 10 1 0 RP 0 37 1 1110 90. 0. -5. 0. EN necpp-1.5.0+cvs20101003/test_data/K5332187.nec0000644000175000017500000000102210310210764016275 0ustar numanumaCM *** Richtanzenne K 5332187 *** CM *** 87.5 - 108 MHz *** CM *** GW 1 = vertikal GW 2 , 3 = horizontal *** CE GW 1,11, 0.785,-0.700, 0.790, 0.785, 0.700, 0.790, 0.020 GW 2,05, 0.000,-0.785, 0.790, 0.690,-0.785, 0.630, 0.020 GW 3,05, 0.000, 0.785, 0.790, 0.690, 0.785, 0.630, 0.020 SM 3,06, 0.000,-1.100, 0.000, 1.100,-1.100, 0.000 SC 0,00, 1.100, 1.100, 0.000, 0.000, 1.100, 0.000 GX 1,100 GE FR 0,1,0,0,100.0 EX 0,0,06,00,10.,0 EX 0,0,27,00,10.,0 LD 5,0,0,0,3.72E+07 PT -1 'PL 3,1,0,3 RP 0,361,2,1000,0.,0.,1.,90. EN necpp-1.5.0+cvs20101003/test_data/salt_ground.nec0000644000175000017500000000060610746477324017702 0ustar numanumaCM NEC-4 gives impedance at source of -61.4 + j621 CM NEC-2 reports a believable 14.8 + j105 ohms. CE GW 1,21,0.,-15.5448,15.24,0.,0.,15.24,.0008138 GW 2,21,0.,0.,15.24,0.,15.5448,15.24,.0008138 GW 3,21,0.,0.,15.24,0.,0.,.1524,.0008138 GW 4,21,0.,0.,.1524,0.,50.292,.1524,.0008138 GW 5,21,0.,0.,.1524,0.,-50.292,.1524,.0008138 GE 1 FR 0,1,0,0,1.83 GN 2,0,0,0,81.,5. EX 0,3,21,0,1.,0. XQ EN necpp-1.5.0+cvs20101003/test_data/gn2.nec0000644000175000017500000000052610310210764016024 0ustar numanumaCM 2el Yagi 12M CE GW 1 11 -9.1 0 40 9.1 0 40 .04165 GW 2 11 -8.8 -4.8 40 8.8 -4.8 40 .04165 GW 3 1 -.2 0 1 .2 0 1 2.6706E-03 GS 0 0 .3048 GE 1 GN 2 0 0 0 13 .005 0 0 0 0 EX 0 3 1 0 1 0 LD 4 2 6 6 1 100 0 LD 5 1 1 11 2.4938E7 LD 5 2 1 11 2.4938E7 LD 5 3 1 1 2.4938E7 TL 1 6 3 1 50 18.01 0 0 0 0 FR 0 1 0 0 24.95 0 RP 0 1 361 0500 76 0 1 1 EN necpp-1.5.0+cvs20101003/test_data/buoy.nec0000644000175000017500000000060710310210764016314 0ustar numanumaCM 2m Vertical antenna excited at 13.75 MHz [21.8 m] CM floating in the ocean (conductivity 4 mhos/meter, dielectric 80). Sommerfeld ground CM 1) With no loading CM 2) With RLC loading at end. CE GW 1 10 0 0 0.2 0 0 2.2 0.02 GE 1 EK FR 0 2 0 0 13.75 0.001 EX 0 1 10 0 10 0 GN 2 0 0 0 80.0 4.0 RP 0 30 30 1301 0. 0. 3. 12. XQ LD 0 1 10 10 0.1 6E-5 1E-7 LD 2 1 1 9 0.001 0 0 XQ EN necpp-1.5.0+cvs20101003/test_data/discone.nec0000644000175000017500000005040210310210764016760 0ustar numanumaCM DISCONE CE GW 1,1,0.,0.,18.288,.08473,0.,18.288,.00129 GW 2,3,.08473,0.,18.288,.4572,0.,18.288,.00129 GW 3,5,.4572,0.,18.288,1.8288,0.,18.288,.00129 GW 4,10,1.8288,0.,18.288,5.4864,0.,18.288,.00129 GW 5,8,5.4864,0.,18.288,9.144,0.,18.288,.00129 GW 6,1,0.,0.,18.288,.08311,.01653,18.288,.00129 GW 7,3,.08311,.01653,18.288,.44842,.0892,18.288,.00129 GW 8,5,.44842,.0892,18.288,1.79366,.35678,18.288,.00129 GW 9,10,1.79366,.35678,18.288,5.38098,1.07034,18.288,.00129 GW 10,8,5.38098,1.07034,18.288,8.9683,1.78391,18.288,.00129 GW 11,1,0.,0.,18.288,.07828,.03243,18.288,.00129 GW 12,3,.07828,.03243,18.288,.4224,.17496,18.288,.00129 GW 13,5,.4224,.17496,18.288,1.68959,.69985,18.288,.00129 GW 14,10,1.68959,.69985,18.288,5.06877,2.09955,18.288,.00129 GW 15,8,5.06877,2.09955,18.288,8.44795,3.49926,18.288,.00129 GW 16,1,0.,0.,18.288,.07045,.04708,18.288,.00129 GW 17,3,.07045,.04708,18.288,.38015,.25401,18.288,.00129 GW 18,5,.38015,.25401,18.288,1.52059,1.01603,18.288,.00129 GW 19,10,1.52059,1.01603,18.288,4.56177,3.04808,18.288,.00129 GW 20,8,4.56177,3.04808,18.288,7.60296,5.08013,18.288,.00129 GW 21,1,0.,0.,18.288,.05992,.05992,18.288,.00129 GW 22,3,.05992,.05992,18.288,.32329,.32329,18.288,.00129 GW 23,5,.32329,.32329,18.288,1.29316,1.29316,18.288,.00129 GW 24,10,1.29316,1.29316,18.288,3.87947,3.87947,18.288,.00129 GW 25,8,3.87947,3.87947,18.288,6.46578,6.46578,18.288,.00129 GW 26,1,0.,0.,18.288,.04708,.07045,18.288,.00129 GW 27,3,.04708,.07045,18.288,.25401,.38015,18.288,.00129 GW 28,5,.25401,.38015,18.288,1.01603,1.52059,18.288,.00129 GW 29,10,1.01603,1.52059,18.288,3.04808,4.56177,18.288,.00129 GW 30,8,3.04808,4.56177,18.288,5.08013,7.60296,18.288,.00129 GW 31,1,0.,0.,18.288,.03243,.07828,18.288,.00129 GW 32,3,.03243,.07828,18.288,.17496,.4224,18.288,.00129 GW 33,5,.17496,.4224,18.288,.69985,1.68959,18.288,.00129 GW 34,10,.69985,1.68959,18.288,2.09955,5.06877,18.288,.00129 GW 35,8,2.09955,5.06877,18.288,3.49926,8.44795,18.288,.00129 GW 36,1,0.,0.,18.288,.01653,.08311,18.288,.00129 GW 37,3,.01653,.08311,18.288,.0892,.44841,18.288,.00129 GW 38,5,.0892,.44841,18.288,.35678,1.79366,18.288,.00129 GW 39,10,.35678,1.79366,18.288,1.07034,5.38098,18.288,.00129 GW 40,8,1.07034,5.38098,18.288,1.7839,8.9683,18.288,.00129 GW 41,1,0.,0.,18.288,0.,.08473,18.288,.00129 GW 42,3,0.,.08473,18.288,0.,.4572,18.288,.00129 GW 43,5,0.,.4572,18.288,0.,1.8288,18.288,.00129 GW 44,10,0.,1.8288,18.288,0.,5.4864,18.288,.00129 GW 45,8,0.,5.4864,18.288,0.,9.144,18.288,.00129 GW 46,1,0.,0.,18.288,-.0165,.08311,18.288,.00129 GW 47,3,-.0165,.08311,18.288,-.0892,.44841,18.288,.00129 GW 48,5,-.0892,.44841,18.288,-.3567,1.79366,18.288,.00129 GW 49,10,-.3567,1.79366,18.288,-1.0703,5.38098,18.288,.00129 GW 50,8,-1.0703,5.38098,18.288,-1.7839,8.9683,18.288,.00129 GW 51,1,0.,0.,18.288,-.0324,.07828,18.288,.00129 GW 52,3,-.0324,.07828,18.288,-.1749,.4224,18.288,.00129 GW 53,5,-.1749,.4224,18.288,-.6998,1.68959,18.288,.00129 GW 54,10,-.6998,1.68959,18.288,-2.0995,5.06877,18.288,.00129 GW 55,8,-2.0995,5.06877,18.288,-3.4992,8.44795,18.288,.00129 GW 56,1,0.,0.,18.288,-.047,.07045,18.288,.00129 GW 57,3,-.047,.07045,18.288,-.254,.38015,18.288,.00129 GW 58,5,-.254,.38015,18.288,-1.016,1.52059,18.288,.00129 GW 59,10,-1.016,1.52059,18.288,-3.048,4.56177,18.288,.00129 GW 60,8,-3.048,4.56177,18.288,-5.0801,7.60296,18.288,.00129 GW 61,1,0.,0.,18.288,-.0599,.05992,18.288,.00129 GW 62,3,-.0599,.05992,18.288,-.3232,.32329,18.288,.00129 GW 63,5,-.3232,.32329,18.288,-1.2931,1.29316,18.288,.00129 GW 64,10,-1.2931,1.29316,18.288,-3.8794,3.87947,18.288,.00129 GW 65,8,-3.8794,3.87947,18.288,-6.4657,6.46578,18.288,.00129 GW 66,1,0.,0.,18.288,-.0704,.04708,18.288,.00129 GW 67,3,-.0704,.04708,18.288,-.3801,.25401,18.288,.00129 GW 68,5,-.3801,.25401,18.288,-1.5205,1.01603,18.288,.00129 GW 69,10,-1.5205,1.01603,18.288,-4.5617,3.04808,18.288,.00129 GW 70,8,-4.5617,3.04808,18.288,-7.6029,5.08013,18.288,.00129 GW 71,1,0.,0.,18.288,-.0782,.03243,18.288,.00129 GW 72,3,-.0782,.03243,18.288,-.4224,.17496,18.288,.00129 GW 73,5,-.4224,.17496,18.288,-1.6895,.69985,18.288,.00129 GW 74,10,-1.6895,.69985,18.288,-5.0687,2.09955,18.288,.00129 GW 75,8,-5.0687,2.09955,18.288,-8.4479,3.49925,18.288,.00129 GW 76,1,0.,0.,18.288,-.0831,.01653,18.288,.00129 GW 77,3,-.0831,.01653,18.288,-.4484,.0892,18.288,.00129 GW 78,5,-.4484,.0892,18.288,-1.7936,.35678,18.288,.00129 GW 79,10,-1.7936,.35678,18.288,-5.3809,1.07034,18.288,.00129 GW 80,8,-5.3809,1.07034,18.288,-8.9683,1.7839,18.288,.00129 GW 81,1,0.,0.,18.288,-.0847,0.,18.288,.00129 GW 82,3,-.0847,0.,18.288,-.4572,0.,18.288,.00129 GW 83,5,-.4572,0.,18.288,-1.8288,0.,18.288,.00129 GW 84,10,-1.8288,0.,18.288,-5.4864,0.,18.288,.00129 GW 85,8,-5.4864,0.,18.288,-9.144,0.,18.288,.00129 GW 86,1,0.,0.,18.288,-.0831,-.0165,18.288,.00129 GW 87,3,-.0831,-.0165,18.288,-.4484,-.0892,18.288,.00129 GW 88,5,-.4484,-.0892,18.288,-1.7936,-.3567,18.288,.00129 GW 89,10,-1.7936,-.3567,18.288,-5.3809,-1.0703,18.288,.00129 GW 90,8,-5.3809,-1.0703,18.288,-8.9683,-1.7839,18.288,.00129 GW 91,1,0.,0.,18.288,-.0782,-.0324,18.288,.00129 GW 92,3,-.0782,-.0324,18.288,-.4224,-.1749,18.288,.00129 GW 93,5,-.4224,-.1749,18.288,-1.6895,-.6998,18.288,.00129 GW 94,10,-1.6895,-.6998,18.288,-5.0687,-2.0995,18.288,.00129 GW 95,8,-5.0687,-2.0995,18.288,-8.4479,-3.4992,18.288,.00129 GW 96,1,0.,0.,18.288,-.0704,-.047,18.288,.00129 GW 97,3,-.0704,-.047,18.288,-.3801,-.254,18.288,.00129 GW 98,5,-.3801,-.254,18.288,-1.5205,-1.016,18.288,.00129 GW 99,10,-1.5205,-1.016,18.288,-4.5617,-3.048,18.288,.00129 GW 100,8,-4.5617,-3.048,18.288,-7.6029,-5.0801,18.288,.00129 GW 101,1,0.,0.,18.288,-.0599,-.0599,18.288,.00129 GW 102,3,-.0599,-.0599,18.288,-.3232,-.3232,18.288,.00129 GW 103,5,-.3232,-.3232,18.288,-1.2931,-1.2931,18.288,.00129 GW 104,10,-1.2931,-1.2931,18.288,-3.8794,-3.8794,18.288,.00129 GW 105,8,-3.8794,-3.8794,18.288,-6.4657,-6.4657,18.288,.00129 GW 106,1,0.,0.,18.288,-.047,-.0704,18.288,.00129 GW 107,3,-.047,-.0704,18.288,-.254,-.3801,18.288,.00129 GW 108,5,-.254,-.3801,18.288,-1.016,-1.5205,18.288,.00129 GW 109,10,-1.016,-1.5205,18.288,-3.048,-4.5617,18.288,.00129 GW 110,8,-3.048,-4.5617,18.288,-5.0801,-7.6029,18.288,.00129 GW 111,1,0.,0.,18.288,-.0324,-.0782,18.288,.00129 GW 112,3,-.0324,-.0782,18.288,-.1749,-.4224,18.288,.00129 GW 113,5,-.1749,-.4224,18.288,-.6998,-1.6895,18.288,.00129 GW 114,10,-.6998,-1.6895,18.288,-2.0995,-5.0687,18.288,.00129 GW 115,8,-2.0995,-5.0687,18.288,-3.4992,-8.4479,18.288,.00129 GW 116,1,0.,0.,18.288,-.0165,-.0831,18.288,.00129 GW 117,3,-.0165,-.0831,18.288,-.0892,-.4484,18.288,.00129 GW 118,5,-.0892,-.4484,18.288,-.3567,-1.7936,18.288,.00129 GW 119,10,-.3567,-1.7936,18.288,-1.0703,-5.3809,18.288,.00129 GW 120,8,-1.0703,-5.3809,18.288,-1.7839,-8.9683,18.288,.00129 GW 121,1,0.,0.,18.288,0.,-.0847,18.288,.00129 GW 122,3,0.,-.0847,18.288,0.,-.4572,18.288,.00129 GW 123,5,0.,-.4572,18.288,0.,-1.8288,18.288,.00129 GW 124,10,0.,-1.8288,18.288,0.,-5.4864,18.288,.00129 GW 125,8,0.,-5.4864,18.288,.00001,-9.144,18.288,.00129 GW 126,1,0.,0.,18.288,.01653,-.0831,18.288,.00129 GW 127,3,.01653,-.0831,18.288,.0892,-.4484,18.288,.00129 GW 128,5,.0892,-.4484,18.288,.35678,-1.7936,18.288,.00129 GW 129,10,.35678,-1.7936,18.288,1.07035,-5.3809,18.288,.00129 GW 130,8,1.07035,-5.3809,18.288,1.78391,-8.9683,18.288,.00129 GW 131,1,0.,0.,18.288,.03243,-.0782,18.288,.00129 GW 132,3,.03243,-.0782,18.288,.17496,-.4224,18.288,.00129 GW 133,5,.17496,-.4224,18.288,.69985,-1.6895,18.288,.00129 GW 134,10,.69985,-1.6895,18.288,2.09956,-5.0687,18.288,.00129 GW 135,8,2.09956,-5.0687,18.288,3.49926,-8.4479,18.288,.00129 GW 136,1,0.,0.,18.288,.04708,-.0704,18.288,.00129 GW 137,3,.04708,-.0704,18.288,.25401,-.3801,18.288,.00129 GW 138,5,.25401,-.3801,18.288,1.01603,-1.5205,18.288,.00129 GW 139,10,1.01603,-1.5205,18.288,3.04808,-4.5617,18.288,.00129 GW 140,8,3.04808,-4.5617,18.288,5.08014,-7.6029,18.288,.00129 GW 141,1,0.,0.,18.288,.05992,-.0599,18.288,.00129 GW 142,3,.05992,-.0599,18.288,.32329,-.3232,18.288,.00129 GW 143,5,.32329,-.3232,18.288,1.29316,-1.2931,18.288,.00129 GW 144,10,1.29316,-1.2931,18.288,3.87947,-3.8794,18.288,.00129 GW 145,8,3.87947,-3.8794,18.288,6.46579,-6.4657,18.288,.00129 GW 146,1,0.,0.,18.288,.07045,-.047,18.288,.00129 GW 147,3,.07045,-.047,18.288,.38015,-.254,18.288,.00129 GW 148,5,.38015,-.254,18.288,1.52059,-1.016,18.288,.00129 GW 149,10,1.52059,-1.016,18.288,4.56177,-3.048,18.288,.00129 GW 150,8,4.56177,-3.048,18.288,7.60296,-5.0801,18.288,.00129 GW 151,1,0.,0.,18.288,.07828,-.0324,18.288,.00129 GW 152,3,.07828,-.0324,18.288,.4224,-.1749,18.288,.00129 GW 153,5,.4224,-.1749,18.288,1.68959,-.6998,18.288,.00129 GW 154,10,1.68959,-.6998,18.288,5.06877,-2.0995,18.288,.00129 GW 155,8,5.06877,-2.0995,18.288,8.44795,-3.4992,18.288,.00129 GW 156,1,0.,0.,18.288,.08311,-.0165,18.288,.00129 GW 157,3,.08311,-.0165,18.288,.44841,-.0891,18.288,.00129 GW 158,5,.44841,-.0891,18.288,1.79366,-.3567,18.288,.00129 GW 159,10,1.79366,-.3567,18.288,5.38098,-1.0703,18.288,.00129 GW 160,8,5.38098,-1.0703,18.288,8.9683,-1.7839,18.288,.00129 GW 161,4,9.144,0.,18.288,8.9683,1.78391,18.288,.00129 GW 162,4,8.9683,1.78391,18.288,8.44795,3.49926,18.288,.00129 GW 163,4,8.44795,3.49926,18.288,7.60296,5.08013,18.288,.00129 GW 164,4,7.60296,5.08013,18.288,6.46578,6.46578,18.288,.00129 GW 165,4,6.46578,6.46578,18.288,5.08013,7.60296,18.288,.00129 GW 166,4,5.08013,7.60296,18.288,3.49926,8.44795,18.288,.00129 GW 167,4,3.49926,8.44795,18.288,1.7839,8.9683,18.288,.00129 GW 168,4,1.7839,8.9683,18.288,0.,9.144,18.288,.00129 GW 169,4,0.,9.144,18.288,-1.7839,8.9683,18.288,.00129 GW 170,4,-1.7839,8.9683,18.288,-3.4992,8.44795,18.288,.00129 GW 171,4,-3.4992,8.44795,18.288,-5.0801,7.60296,18.288,.00129 GW 172,4,-5.0801,7.60296,18.288,-6.4657,6.46578,18.288,.00129 GW 173,4,-6.4657,6.46578,18.288,-7.6029,5.08013,18.288,.00129 GW 174,4,-7.6029,5.08013,18.288,-8.4479,3.49925,18.288,.00129 GW 175,4,-8.4479,3.49925,18.288,-8.9683,1.7839,18.288,.00129 GW 176,4,-8.9683,1.7839,18.288,-9.144,0.,18.288,.00129 GW 177,4,-9.144,0.,18.288,-8.9683,-1.7839,18.288,.00129 GW 178,4,-8.9683,-1.7839,18.288,-8.4479,-3.4992,18.288,.00129 GW 179,4,-8.4479,-3.4992,18.288,-7.6029,-5.0801,18.288,.00129 GW 180,4,-7.6029,-5.0801,18.288,-6.4657,-6.4657,18.288,.00129 GW 181,4,-6.4657,-6.4657,18.288,-5.0801,-7.6029,18.288,.00129 GW 182,4,-5.0801,-7.6029,18.288,-3.4992,-8.4479,18.288,.00129 GW 183,4,-3.4992,-8.4479,18.288,-1.7839,-8.9683,18.288,.00129 GW 184,4,-1.7839,-8.9683,18.288,.00001,-9.144,18.288,.00129 GW 185,4,.00001,-9.144,18.288,1.78391,-8.9683,18.288,.00129 GW 186,4,1.78391,-8.9683,18.288,3.49926,-8.4479,18.288,.00129 GW 187,4,3.49926,-8.4479,18.288,5.08014,-7.6029,18.288,.00129 GW 188,4,5.08014,-7.6029,18.288,6.46579,-6.4657,18.288,.00129 GW 189,4,6.46579,-6.4657,18.288,7.60296,-5.0801,18.288,.00129 GW 190,4,7.60296,-5.0801,18.288,8.44795,-3.4992,18.288,.00129 GW 191,4,8.44795,-3.4992,18.288,8.9683,-1.7839,18.288,.00129 GW 192,4,8.9683,-1.7839,18.288,9.14399,.00001,18.288,.00129 GW 193,1,0.,0.,18.034,0.,0.,17.9493,.00129 GW 194,1,0.,0.,17.9493,0.,0.,17.7799,.00129 GW 195,3,0.,0.,17.7799,0.,0.,17.0172,.00129 GW 196,5,0.,0.,17.0172,0.,0.,14.7312,.00129 GW 197,29,0.,0.,14.7312,0.,0.,0.,.00129 GW 198,3,0.,0.,18.034,0.,0.,18.288,.00129 GW 199,3,0.,0.,18.034,.3048,0.,18.0341,.00129 GW 200,1,.3048,0.,18.0341,.34894,0.,17.9585,.00129 GW 201,1,.34894,0.,17.9585,.43723,0.,17.8075,.00129 GW 202,39,.43723,0.,17.8075,10.668,0.,.3048,.00129 GW 203,3,0.,0.,18.034,.29894,.05946,18.0341,.00129 GW 204,1,.29894,.05946,18.0341,.34224,.06808,17.9585,.00129 GW 205,1,.34224,.06808,17.9585,.42883,.0853,17.8075,.00129 GW 206,39,.42883,.0853,17.8075,10.463,2.08122,.3048,.00129 GW 207,3,0.,0.,18.034,.2816,.11664,18.0341,.00129 GW 208,1,.2816,.11664,18.0341,.32238,.13354,17.9585,.00129 GW 209,1,.32238,.13354,17.9585,.40395,.16732,17.8075,.00129 GW 210,39,.40395,.16732,17.8075,9.85595,4.08247,.3048,.00129 GW 211,3,0.,0.,18.034,.25343,.16934,18.0341,.00129 GW 212,1,.25343,.16934,18.0341,.29014,.19386,17.9585,.00129 GW 213,1,.29014,.19386,17.9585,.36355,.24291,17.8075,.00129 GW 214,39,.36355,.24291,17.8075,8.87012,5.92682,.3048,.00129 GW 215,3,0.,0.,18.034,.21553,.21553,18.0341,.00129 GW 216,1,.21553,.21553,18.0341,.24674,.24674,17.9585,.00129 GW 217,1,.24674,.24674,17.9585,.30917,.30917,17.8075,.00129 GW 218,39,.30917,.30917,17.8075,7.54341,7.54342,.3048,.00129 GW 219,3,0.,0.,18.034,.16934,.25343,18.0341,.00129 GW 220,1,.16934,.25343,18.0341,.19386,.29014,17.9585,.00129 GW 221,1,.19386,.29014,17.9585,.24291,.36355,17.8075,.00129 GW 222,39,.24291,.36355,17.8075,5.92682,8.87012,.3048,.00129 GW 223,3,0.,0.,18.034,.11664,.2816,18.0341,.00129 GW 224,1,.11664,.2816,18.0341,.13354,.32238,17.9585,.00129 GW 225,1,.13354,.32238,17.9585,.16732,.40395,17.8075,.00129 GW 226,39,.16732,.40395,17.8075,4.08247,9.85595,.3048,.00129 GW 227,3,0.,0.,18.034,.05946,.29894,18.0341,.00129 GW 228,1,.05946,.29894,18.0341,.06808,.34224,17.9585,.00129 GW 229,1,.06808,.34224,17.9585,.0853,.42883,17.8075,.00129 GW 230,39,.0853,.42883,17.8075,2.08122,10.463,.3048,.00129 GW 231,3,0.,0.,18.034,0.,.3048,18.0341,.00129 GW 232,1,0.,.3048,18.0341,0.,.34894,17.9585,.00129 GW 233,1,0.,.34894,17.9585,0.,.43723,17.8075,.00129 GW 234,39,0.,.43723,17.8075,0.,10.668,.3048,.00129 GW 235,3,0.,0.,18.034,-.0594,.29894,18.0341,.00129 GW 236,1,-.0594,.29894,18.0341,-.068,.34224,17.9585,.00129 GW 237,1,-.068,.34224,17.9585,-.0853,.42883,17.8075,.00129 GW 238,39,-.0853,.42883,17.8075,-2.0812,10.463,.3048,.00129 GW 239,3,0.,0.,18.034,-.1166,.2816,18.0341,.00129 GW 240,1,-.1166,.2816,18.0341,-.1335,.32238,17.9585,.00129 GW 241,1,-.1335,.32238,17.9585,-.1673,.40395,17.8075,.00129 GW 242,39,-.1673,.40395,17.8075,-4.0824,9.85594,.3048,.00129 GW 243,3,0.,0.,18.034,-.1693,.25343,18.0341,.00129 GW 244,1,-.1693,.25343,18.0341,-.1938,.29014,17.9585,.00129 GW 245,1,-.1938,.29014,17.9585,-.2429,.36355,17.8075,.00129 GW 246,39,-.2429,.36355,17.8075,-5.9268,8.87011,.3048,.00129 GW 247,3,0.,0.,18.034,-.2155,.21553,18.0341,.00129 GW 248,1,-.2155,.21553,18.0341,-.2467,.24674,17.9585,.00129 GW 249,1,-.2467,.24674,17.9585,-.3091,.30917,17.8075,.00129 GW 250,39,-.3091,.30917,17.8075,-7.5434,7.54341,.3048,.00129 GW 251,3,0.,0.,18.034,-.2534,.16934,18.0341,.00129 GW 252,1,-.2534,.16934,18.0341,-.2901,.19386,17.9585,.00129 GW 253,1,-.2901,.19386,17.9585,-.3635,.24291,17.8075,.00129 GW 254,39,-.3635,.24291,17.8075,-8.8701,5.92682,.3048,.00129 GW 255,3,0.,0.,18.034,-.2816,.11664,18.0341,.00129 GW 256,1,-.2816,.11664,18.0341,-.3223,.13354,17.9585,.00129 GW 257,1,-.3223,.13354,17.9585,-.4039,.16732,17.8075,.00129 GW 258,39,-.4039,.16732,17.8075,-9.8559,4.08246,.3048,.00129 GW 259,3,0.,0.,18.034,-.2989,.05946,18.0341,.00129 GW 260,1,-.2989,.05946,18.0341,-.3422,.06808,17.9585,.00129 GW 261,1,-.3422,.06808,17.9585,-.4288,.0853,17.8075,.00129 GW 262,39,-.4288,.0853,17.8075,-10.463,2.08122,.3048,.00129 GW 263,3,0.,0.,18.034,-.3048,0.,18.0341,.00129 GW 264,1,-.3048,0.,18.0341,-.3489,0.,17.9585,.00129 GW 265,1,-.3489,0.,17.9585,-.4372,0.,17.8075,.00129 GW 266,39,-.4372,0.,17.8075,-10.668,0.,.3048,.00129 GW 267,3,0.,0.,18.034,-.2989,-.0594,18.0341,.00129 GW 268,1,-.2989,-.0594,18.0341,-.3422,-.068,17.9585,.00129 GW 269,1,-.3422,-.068,17.9585,-.4288,-.0853,17.8075,.00129 GW 270,39,-.4288,-.0853,17.8075,-10.463,-2.0812,.3048,.00129 GW 271,3,0.,0.,18.034,-.2816,-.1166,18.0341,.00129 GW 272,1,-.2816,-.1166,18.0341,-.3223,-.1335,17.9585,.00129 GW 273,1,-.3223,-.1335,17.9585,-.4039,-.1673,17.8075,.00129 GW 274,39,-.4039,-.1673,17.8075,-9.8559,-4.0824,.3048,.00129 GW 275,3,0.,0.,18.034,-.2534,-.1693,18.0341,.00129 GW 276,1,-.2534,-.1693,18.0341,-.2901,-.1938,17.9585,.00129 GW 277,1,-.2901,-.1938,17.9585,-.3635,-.2429,17.8075,.00129 GW 278,39,-.3635,-.2429,17.8075,-8.8701,-5.9268,.3048,.00129 GW 279,3,0.,0.,18.034,-.2155,-.2155,18.0341,.00129 GW 280,1,-.2155,-.2155,18.0341,-.2467,-.2467,17.9585,.00129 GW 281,1,-.2467,-.2467,17.9585,-.3091,-.3091,17.8075,.00129 GW 282,39,-.3091,-.3091,17.8075,-7.5434,-7.5434,.3048,.00129 GW 283,3,0.,0.,18.034,-.1693,-.2534,18.0341,.00129 GW 284,1,-.1693,-.2534,18.0341,-.1938,-.2901,17.9585,.00129 GW 285,1,-.1938,-.2901,17.9585,-.2429,-.3635,17.8075,.00129 GW 286,39,-.2429,-.3635,17.8075,-5.9268,-8.8701,.3048,.00129 GW 287,3,0.,0.,18.034,-.1166,-.2816,18.0341,.00129 GW 288,1,-.1166,-.2816,18.0341,-.1335,-.3223,17.9585,.00129 GW 289,1,-.1335,-.3223,17.9585,-.1673,-.4039,17.8075,.00129 GW 290,39,-.1673,-.4039,17.8075,-4.0824,-9.8559,.3048,.00129 GW 291,3,0.,0.,18.034,-.0594,-.2989,18.0341,.00129 GW 292,1,-.0594,-.2989,18.0341,-.068,-.3422,17.9585,.00129 GW 293,1,-.068,-.3422,17.9585,-.0853,-.4288,17.8075,.00129 GW 294,39,-.0853,-.4288,17.8075,-2.0812,-10.463,.3048,.00129 GW 295,3,0.,0.,18.034,0.,-.3048,18.0341,.00129 GW 296,1,0.,-.3048,18.0341,0.,-.3489,17.9585,.00129 GW 297,1,0.,-.3489,17.9585,0.,-.4372,17.8075,.00129 GW 298,39,0.,-.4372,17.8075,.00001,-10.667,.3048,.00129 GW 299,3,0.,0.,18.034,.05946,-.2989,18.0341,.00129 GW 300,1,.05946,-.2989,18.0341,.06808,-.3422,17.9585,.00129 GW 301,1,.06808,-.3422,17.9585,.0853,-.4288,17.8075,.00129 GW 302,39,.0853,-.4288,17.8075,2.08123,-10.463,.3048,.00129 GW 303,3,0.,0.,18.034,.11664,-.2816,18.0341,.00129 GW 304,1,.11664,-.2816,18.0341,.13354,-.3223,17.9585,.00129 GW 305,1,.13354,-.3223,17.9585,.16732,-.4039,17.8075,.00129 GW 306,39,.16732,-.4039,17.8075,4.08247,-9.8559,.3048,.00129 GW 307,3,0.,0.,18.034,.16934,-.2534,18.0341,.00129 GW 308,1,.16934,-.2534,18.0341,.19386,-.2901,17.9585,.00129 GW 309,1,.19386,-.2901,17.9585,.24291,-.3635,17.8075,.00129 GW 310,39,.24291,-.3635,17.8075,5.92683,-8.8701,.3048,.00129 GW 311,3,0.,0.,18.034,.21553,-.2155,18.0341,.00129 GW 312,1,.21553,-.2155,18.0341,.24674,-.2467,17.9585,.00129 GW 313,1,.24674,-.2467,17.9585,.30917,-.3091,17.8075,.00129 GW 314,39,.30917,-.3091,17.8075,7.54342,-7.5434,.3048,.00129 GW 315,3,0.,0.,18.034,.25343,-.1693,18.0341,.00129 GW 316,1,.25343,-.1693,18.0341,.29014,-.1938,17.9585,.00129 GW 317,1,.29014,-.1938,17.9585,.36355,-.2429,17.8075,.00129 GW 318,39,.36355,-.2429,17.8075,8.87012,-5.9268,.3048,.00129 GW 319,3,0.,0.,18.034,.2816,-.1166,18.0341,.00129 GW 320,1,.2816,-.1166,18.0341,.32238,-.1335,17.9585,.00129 GW 321,1,.32238,-.1335,17.9585,.40395,-.1673,17.8075,.00129 GW 322,39,.40395,-.1673,17.8075,9.85594,-4.0824,.3048,.00129 GW 323,3,0.,0.,18.034,.29894,-.0594,18.0341,.00129 GW 324,1,.29894,-.0594,18.0341,.34224,-.068,17.9585,.00129 GW 325,1,.34224,-.068,17.9585,.42883,-.0853,17.8075,.00129 GW 326,39,.42883,-.0853,17.8075,10.463,-2.0812,.3048,.00129 GW 327,4,10.668,0.,.3048,10.463,2.08122,.3048,.00129 GW 328,4,10.463,2.08122,.3048,9.85595,4.08247,.3048,.00129 GW 329,4,9.85595,4.08247,.3048,8.87012,5.92682,.3048,.00129 GW 330,4,8.87012,5.92682,.3048,7.54341,7.54342,.3048,.00129 GW 331,4,7.54341,7.54342,.3048,5.92682,8.87012,.3048,.00129 GW 332,4,5.92682,8.87012,.3048,4.08247,9.85595,.3048,.00129 GW 333,4,4.08247,9.85595,.3048,2.08122,10.463,.3048,.00129 GW 334,4,2.08122,10.463,.3048,0.,10.668,.3048,.00129 GW 335,4,0.,10.668,.3048,-2.0812,10.463,.3048,.00129 GW 336,4,-2.0812,10.463,.3048,-4.0824,9.85594,.3048,.00129 GW 337,4,-4.0824,9.85594,.3048,-5.9268,8.87011,.3048,.00129 GW 338,4,-5.9268,8.87011,.3048,-7.5434,7.54341,.3048,.00129 GW 339,4,-7.5434,7.54341,.3048,-8.8701,5.92682,.3048,.00129 GW 340,4,-8.8701,5.92682,.3048,-9.8559,4.08246,.3048,.00129 GW 341,4,-9.8559,4.08246,.3048,-10.463,2.08122,.3048,.00129 GW 342,4,-10.463,2.08122,.3048,-10.668,0.,.3048,.00129 GW 343,4,-10.668,0.,.3048,-10.463,-2.0812,.3048,.00129 GW 344,4,-10.463,-2.0812,.3048,-9.8559,-4.0824,.3048,.00129 GW 345,4,-9.8559,-4.0824,.3048,-8.8701,-5.9268,.3048,.00129 GW 346,4,-8.8701,-5.9268,.3048,-7.5434,-7.5434,.3048,.00129 GW 347,4,-7.5434,-7.5434,.3048,-5.9268,-8.8701,.3048,.00129 GW 348,4,-5.9268,-8.8701,.3048,-4.0824,-9.8559,.3048,.00129 GW 349,4,-4.0824,-9.8559,.3048,-2.0812,-10.463,.3048,.00129 GW 350,4,-2.0812,-10.463,.3048,.00001,-10.667,.3048,.00129 GW 351,4,.00001,-10.667,.3048,2.08123,-10.463,.3048,.00129 GW 352,4,2.08123,-10.463,.3048,4.08247,-9.8559,.3048,.00129 GW 353,4,4.08247,-9.8559,.3048,5.92683,-8.8701,.3048,.00129 GW 354,4,5.92683,-8.8701,.3048,7.54342,-7.5434,.3048,.00129 GW 355,4,7.54342,-7.5434,.3048,8.87012,-5.9268,.3048,.00129 GW 356,4,8.87012,-5.9268,.3048,9.85594,-4.0824,.3048,.00129 GW 357,4,9.85594,-4.0824,.3048,10.463,-2.0812,.3048,.00129 GW 358,4,10.463,-2.0812,.3048,10.6679,.00001,.3048,.00129 GE 1 necpp-1.5.0+cvs20101003/test_data/36dip.nec0000644000175000017500000000033510310210764016261 0ustar numanumaCM Dipole antenna for 80 mtr CE GW 1 19 -19.64646 0.0 20 -0.5 0.0 20 0.001 GW 2 1 -0.5 0.0 20 0.5 0.0 20 0.001 GW 3 19 0.5 0.0 20 19.64646 0.0 20 0.001 GE 0 GN 2 0 0 0 14 .006 EX 0 2 1 01 1 0 FR 0 1 0 0 3.68 XQ necpp-1.5.0+cvs20101003/test_data/helix.nec0000644000175000017500000000114010310210764016440 0ustar numanumaCM NEC Input File Bi-Quad for 2440 MHz, Trevor Marshall, 9/1/2001 CM All data in wavelengths,will scale to 300MHz CM Square copper reflector,w/w choke,modelled as 0.05 lamda mesh CE GW 0 1 0. -0.45 -0.45 0. -0.45 -0.40 0.0082 GW 0 1 0. -0.45 -0.45 0. -0.40 -0.45 0.0082 GM 0 17 0. 0. 0. 0. 0. 0.05 GW 0 1 0. -0.45 0.45 0 -0.40 0.45 0.0082 GM 0 17 0. 0. 0. 0. 0.05 0. GW 0 18 0. 0.45 0.45 0. 0.45 -0.45 0.0082 GM 0 0 90. 90. 0. 0. .0307 GM 0 6 0. 0. 0. 0. .0 -.0307 GH 1 520 0.032 3.190 0.02 0.02 0.02 0.02 0.002 GE -1 FR 0 1 0 0 2442. 0 EX 0 1 1 0000 1.0 0 RP 0 73 73 1001 -90. 90. 5. 5. 10000. XQ EN necpp-1.5.0+cvs20101003/test_data/dipole_anim.nec0000644000175000017500000000052010310210764017610 0ustar numanumaCM Simple dipole, with calculation of currents, charges and near field. CE GW 1 21 0 -0.25 0.0 0 0.25 0.0 0.001 GE EX 0 1 11 00 1 0 PQ 0, 0 NE 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 NH 0, 1,20,20, 0,0.05,0.05, 0,0.05,0.05 RP 0, 19, 36, 1000, 0, 0, 10, 10 EN necpp-1.5.0+cvs20101003/test_data/Gs_8d_bb.nec0000644000175000017500000000154010310210764016742 0ustar numanumaCM *** Gruppenstrahler fuer 23 cm *** CM *** mit 8 Strahler + 8 Direktoren *** CM *** breitbandig Elemente 9 mm *** CM * von dieser Version wurden 2 Antennen gebaut und gemessen * CM * Antenne mit RADOM versehen (Beeintraechtigung = gering * CE GW 01,05, 0.005, 0.059, 0.059, 0.094, 0.059, 0.059, 0.0045 GW 02,05, 0.005, 0.177, 0.059, 0.094, 0.177, 0.059, 0.0045 GW 03,05, 0.008, 0.059, 0.116, 0.091, 0.059, 0.116, 0.0045 GW 04,05, 0.008, 0.177, 0.116, 0.091, 0.177, 0.116, 0.0045 SM 04,08, 0.000, 0.000, 0.000, 0.150, 0.000, 0.000 SC 00,00, 0.150, 0.250, 0.000, 0.000, 0.250, 0.000 GX 1,110 GE FR 0,1,0,0,1296. TL 0,01,0,06,-300.,0.110 TL 0,41,0,46,-300.,0.110 TL 0,21,0,26,-300.,0.110 TL 0,61,0,66,-300.,0.110 EX 0,0,01,0, 1.,0 EX 0,0,41,0,-1.,0 EX 0,0,21,0, 1.,0 EX 0,0,61,0,-1.,0 LD 5,0,0,0,3.72E+07 PT -1 'PL 3,1,0,3 RP 0,361,2,1000,0.,0.,1.,90. EN necpp-1.5.0+cvs20101003/test_data/patch_999_2.nec0000644000175000017500000015134311117153063017300 0ustar numanumaGW 1 1 9.375 -9.375 0 6.696428571428571 -9.375 0 0.05 GW 2 1 6.696428571428571 -9.375 0 4.017857142858729 -9.375 0 0.05 GW 3 1 4.017857142858729 -9.375 0 1.339285714293643 -9.375 0 0.05 GW 4 1 1.339285714293643 -9.375 0 -1.339285714274611 -9.375 0 0.05 GW 5 1 -1.339285714274611 -9.375 0 -4.01785714284604 -9.375 0 0.05 GW 6 1 -4.01785714284604 -9.375 0 -6.696428571422228 -9.375 0 0.05 GW 7 1 -6.696428571422228 -9.375 0 -9.375 -9.375 0 0.05 GW 8 1 -9.375 -9.375 0 -9.375 -6.696428571428571 0 0.05 GW 9 1 -9.375 -6.696428571428571 0 -9.375 -4.017857142858729 0 0.05 GW 10 1 -9.375 -4.017857142858729 0 -9.375 -1.339285714293643 0 0.05 GW 11 1 -9.375 -1.339285714293643 0 -9.375 1.339285714274611 0 0.05 GW 12 1 -9.375 1.339285714274611 0 -9.375 4.01785714284604 0 0.05 GW 13 1 -9.375 4.01785714284604 0 -9.375 6.696428571422228 0 0.05 GW 14 1 -9.375 6.696428571422228 0 -9.375 9.375 0 0.05 GW 15 1 -9.375 9.375 0 -6.696428571428571 9.375 0 0.05 GW 16 1 -6.696428571428571 9.375 0 -4.017857142858729 9.375 0 0.05 GW 17 1 -4.017857142858729 9.375 0 -1.339285714293643 9.375 0 0.05 GW 18 1 -1.339285714293643 9.375 0 1.339285714274611 9.375 0 0.05 GW 19 1 1.339285714274611 9.375 0 4.01785714284604 9.375 0 0.05 GW 20 1 4.01785714284604 9.375 0 6.696428571422228 9.375 0 0.05 GW 21 1 6.696428571422228 9.375 0 9.375 9.375 0 0.05 GW 22 1 9.375 9.375 0 9.375 6.696428571428571 0 0.05 GW 23 1 9.375 6.696428571428571 0 9.375 4.017857142858729 0 0.05 GW 24 1 9.375 4.017857142858729 0 9.375 1.339285714293643 0 0.05 GW 25 1 9.375 1.339285714293643 0 9.375 -1.339285714274611 0 0.05 GW 26 1 9.375 -1.339285714274611 0 9.375 -4.01785714284604 0 0.05 GW 27 1 9.375 -4.01785714284604 0 9.375 -6.696428571422228 0 0.05 GW 28 1 9.375 -6.696428571422228 0 9.375 -9.375 0 0.05 GW 29 1 7.5 -7.5 1.2 5.357142857142858 -7.5 1.2 0.05 GW 30 1 5.357142857142858 -7.5 1.2 3.214285714286508 -7.5 1.2 0.05 GW 31 1 3.214285714286508 -7.5 1.2 1.071428571432536 -7.5 1.2 0.05 GW 32 1 1.071428571432536 -7.5 1.2 -1.07142857142302 -7.5 1.2 0.05 GW 33 1 -1.07142857142302 -7.5 1.2 -3.214285714280164 -7.5 1.2 0.05 GW 34 1 -3.214285714280164 -7.5 1.2 -5.357142857139685 -7.5 1.2 0.05 GW 35 1 -5.357142857139685 -7.5 1.2 -7.5 -7.5 1.2 0.05 GW 36 1 -7.5 -7.5 1.2 -7.5 -5.357142857142858 1.2 0.05 GW 37 1 -7.5 -5.357142857142858 1.2 -7.5 -3.214285714286508 1.2 0.05 GW 38 1 -7.5 -3.214285714286508 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 39 1 -7.5 -1.071428571432536 1.2 -7.5 1.07142857142302 1.2 0.05 GW 40 1 -7.5 1.07142857142302 1.2 -7.5 3.214285714280164 1.2 0.05 GW 41 1 -7.5 3.214285714280164 1.2 -7.5 5.357142857139685 1.2 0.05 GW 42 1 -7.5 5.357142857139685 1.2 -7.5 7.5 1.2 0.05 GW 43 1 -7.5 7.5 1.2 -5.357142857142858 7.5 1.2 0.05 GW 44 1 -5.357142857142858 7.5 1.2 -3.214285714286508 7.5 1.2 0.05 GW 45 1 -3.214285714286508 7.5 1.2 -1.071428571432536 7.5 1.2 0.05 GW 46 1 -1.071428571432536 7.5 1.2 1.07142857142302 7.5 1.2 0.05 GW 47 1 1.07142857142302 7.5 1.2 3.214285714280164 7.5 1.2 0.05 GW 48 1 3.214285714280164 7.5 1.2 5.357142857139685 7.5 1.2 0.05 GW 49 1 5.357142857139685 7.5 1.2 7.5 7.5 1.2 0.05 GW 50 1 7.5 7.5 1.2 7.5 5.357142857142858 1.2 0.05 GW 51 1 7.5 5.357142857142858 1.2 7.5 3.214285714286508 1.2 0.05 GW 52 1 7.5 3.214285714286508 1.2 7.5 1.071428571432536 1.2 0.05 GW 53 1 7.5 1.071428571432536 1.2 7.5 -1.07142857142302 1.2 0.05 GW 54 1 7.5 -1.07142857142302 1.2 7.5 -3.214285714280164 1.2 0.05 GW 55 1 7.5 -3.214285714280164 1.2 7.5 -5.357142857139685 1.2 0.05 GW 56 1 7.5 -5.357142857139685 1.2 7.5 -7.5 1.2 0.05 GW 57 1 3 -3 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 58 1 8.326672684688674e-12 -3 1.2 -3 -3 1.2 0.05 GW 59 1 -3 -3 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 60 1 -3 -8.326672684688674e-12 1.2 -3 3 1.2 0.05 GW 61 1 -3 3 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 62 1 -8.326672684688674e-12 3 1.2 3 3 1.2 0.05 GW 63 1 3 3 1.2 3 8.326672684688674e-12 1.2 0.05 GW 64 1 3 8.326672684688674e-12 1.2 3 -3 1.2 0.05 GW 65 1 9.375 1.339285714293643 0 7.107750735368153 2.552791765646827 0 0.05 GW 66 1 7.107750735368153 2.552791765646827 0 9.375 4.017857142858729 0 0.05 GW 67 1 9.375 1.339285714293643 0 9.375 4.017857142858729 0 0.05 GW 68 1 -1.339285714293643 9.375 0 -3.086993814918736 6.844748159019945 0 0.05 GW 69 1 -3.086993814918736 6.844748159019945 0 -4.017857142858729 9.375 0 0.05 GW 70 1 -1.339285714293643 9.375 0 -4.017857142858729 9.375 0 0.05 GW 71 1 -9.375 -1.339285714293643 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 72 1 -7.040876594749187 -2.58217861523339 0 -9.375 -4.017857142858729 0 0.05 GW 73 1 -9.375 -1.339285714293643 0 -9.375 -4.017857142858729 0 0.05 GW 74 1 -7.040876594749187 -2.58217861523339 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 75 1 -4.422068399917589 -3.214523613654571 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 76 1 -7.040876594749187 -2.58217861523339 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 77 1 7.107750735368153 2.552791765646827 0 4.477133499339022 3.163876165159997 0 0.05 GW 78 1 4.477133499339022 3.163876165159997 0 6.689580159414997 5.10634656419997 0 0.05 GW 79 1 7.107750735368153 2.552791765646827 0 6.689580159414997 5.10634656419997 0 0.05 GW 80 1 6.962538025261316 -5.753525177529361 0 9.375 -4.01785714284604 0 0.05 GW 81 1 9.375 -4.01785714284604 0 9.375 -6.696428571422228 0 0.05 GW 82 1 6.962538025261316 -5.753525177529361 0 9.375 -6.696428571422228 0 0.05 GW 83 1 3.75241482593574 -4.765438098087474 0 6.962538025261316 -5.753525177529361 0 0.05 GW 84 1 6.962538025261316 -5.753525177529361 0 5.070790366291444 -7.364935515320116 0 0.05 GW 85 1 3.75241482593574 -4.765438098087474 0 5.070790366291444 -7.364935515320116 0 0.05 GW 86 1 -3.318106139849093 4.089524938451827 0 -1.798413501238099 2.096746902243944 0 0.05 GW 87 1 -1.798413501238099 2.096746902243944 0 -4.031556072197924 1.818807848884627 0 0.05 GW 88 1 -3.318106139849093 4.089524938451827 0 -4.031556072197924 1.818807848884627 0 0.05 GW 89 1 0.04626589405290582 -0.04428204387228096 0 2.737081140669132 -0.4665375240605305 0 0.05 GW 90 1 2.737081140669132 -0.4665375240605305 0 1.920542215495787 -2.444067826543754 0 0.05 GW 91 1 0.04626589405290582 -0.04428204387228096 0 1.920542215495787 -2.444067826543754 0 0.05 GW 92 1 2.737081140669132 -0.4665375240605305 0 0.04626589405290582 -0.04428204387228096 0 0.05 GW 93 1 0.04626589405290582 -0.04428204387228096 0 2.371953240025473 1.671042667466238 0 0.05 GW 94 1 2.737081140669132 -0.4665375240605305 0 2.371953240025473 1.671042667466238 0 0.05 GW 95 1 0.04626589405290582 -0.04428204387228096 0 -2.495989652860271 0.1076505093269847 0 0.05 GW 96 1 -2.495989652860271 0.1076505093269847 0 -1.798413501238099 2.096746902243944 0 0.05 GW 97 1 0.04626589405290582 -0.04428204387228096 0 -1.798413501238099 2.096746902243944 0 0.05 GW 98 1 -2.495989652860271 0.1076505093269847 0 -4.031556072197924 1.818807848884627 0 0.05 GW 99 1 -4.031556072197924 1.818807848884627 0 -1.798413501238099 2.096746902243944 0 0.05 GW 100 1 -2.495989652860271 0.1076505093269847 0 -1.798413501238099 2.096746902243944 0 0.05 GW 101 1 -2.495989652860271 0.1076505093269847 0 0.04626589405290582 -0.04428204387228096 0 0.05 GW 102 1 0.04626589405290582 -0.04428204387228096 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 103 1 -2.495989652860271 0.1076505093269847 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 104 1 -0.338630110356612 -2.735015319983185 0 0.04626589405290582 -0.04428204387228096 0 0.05 GW 105 1 0.04626589405290582 -0.04428204387228096 0 1.920542215495787 -2.444067826543754 0 0.05 GW 106 1 -0.338630110356612 -2.735015319983185 0 1.920542215495787 -2.444067826543754 0 0.05 GW 107 1 0.04626589405290582 -0.04428204387228096 0 -0.338630110356612 -2.735015319983185 0 0.05 GW 108 1 -0.338630110356612 -2.735015319983185 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 109 1 0.04626589405290582 -0.04428204387228096 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 110 1 0.4377855422001767 2.586535883288115 0 0.04626589405290582 -0.04428204387228096 0 0.05 GW 111 1 0.04626589405290582 -0.04428204387228096 0 -1.798413501238099 2.096746902243944 0 0.05 GW 112 1 0.4377855422001767 2.586535883288115 0 -1.798413501238099 2.096746902243944 0 0.05 GW 113 1 0.04626589405290582 -0.04428204387228096 0 0.4377855422001767 2.586535883288115 0 0.05 GW 114 1 0.4377855422001767 2.586535883288115 0 2.371953240025473 1.671042667466238 0 0.05 GW 115 1 0.04626589405290582 -0.04428204387228096 0 2.371953240025473 1.671042667466238 0 0.05 GW 116 1 6.166308673626426 -3.640777451789195 0 6.962538025261316 -5.753525177529361 0 0.05 GW 117 1 6.962538025261316 -5.753525177529361 0 3.75241482593574 -4.765438098087474 0 0.05 GW 118 1 6.166308673626426 -3.640777451789195 0 3.75241482593574 -4.765438098087474 0 0.05 GW 119 1 4.477133499339022 3.163876165159997 0 4.991271700300564 0.5928870636193028 0 0.05 GW 120 1 4.991271700300564 0.5928870636193028 0 2.371953240025473 1.671042667466238 0 0.05 GW 121 1 4.477133499339022 3.163876165159997 0 2.371953240025473 1.671042667466238 0 0.05 GW 122 1 -4.422068399917589 -3.214523613654571 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 123 1 -4.945135803440198 -0.7253315653909317 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 124 1 -4.422068399917589 -3.214523613654571 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 125 1 -3.318106139849093 4.089524938451827 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 126 1 -0.5802204548059274 4.784621367905854 0 -1.798413501238099 2.096746902243944 0 0.05 GW 127 1 -3.318106139849093 4.089524938451827 0 -1.798413501238099 2.096746902243944 0 0.05 GW 128 1 3.75241482593574 -4.765438098087474 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 129 1 0.6338814896681605 -4.653060104590379 0 1.920542215495787 -2.444067826543754 0 0.05 GW 130 1 3.75241482593574 -4.765438098087474 0 1.920542215495787 -2.444067826543754 0 0.05 GW 131 1 -1.859813274983875 -4.097556872864168 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 132 1 -4.422068399917589 -3.214523613654571 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 133 1 -1.859813274983875 -4.097556872864168 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 134 1 3.75241482593574 -4.765438098087474 0 4.438683231217083 -1.990649444109428 0 0.05 GW 135 1 4.438683231217083 -1.990649444109428 0 6.166308673626426 -3.640777451789195 0 0.05 GW 136 1 3.75241482593574 -4.765438098087474 0 6.166308673626426 -3.640777451789195 0 0.05 GW 137 1 4.438683231217083 -1.990649444109428 0 3.75241482593574 -4.765438098087474 0 0.05 GW 138 1 3.75241482593574 -4.765438098087474 0 1.920542215495787 -2.444067826543754 0 0.05 GW 139 1 4.438683231217083 -1.990649444109428 0 1.920542215495787 -2.444067826543754 0 0.05 GW 140 1 4.477133499339022 3.163876165159997 0 4.076508745742529 6.059929662954254 0 0.05 GW 141 1 4.076508745742529 6.059929662954254 0 6.689580159414997 5.10634656419997 0 0.05 GW 142 1 4.477133499339022 3.163876165159997 0 6.689580159414997 5.10634656419997 0 0.05 GW 143 1 2.105648375805295 4.129671922143112 0 4.477133499339022 3.163876165159997 0 0.05 GW 144 1 4.477133499339022 3.163876165159997 0 2.371953240025473 1.671042667466238 0 0.05 GW 145 1 2.105648375805295 4.129671922143112 0 2.371953240025473 1.671042667466238 0 0.05 GW 146 1 -4.422068399917589 -3.214523613654571 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 147 1 -4.302571336824886 -6.755567895399417 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 148 1 -4.422068399917589 -3.214523613654571 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 149 1 -0.338630110356612 -2.735015319983185 0 1.920542215495787 -2.444067826543754 0 0.05 GW 150 1 1.920542215495787 -2.444067826543754 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 151 1 -0.338630110356612 -2.735015319983185 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 152 1 1.920542215495787 -2.444067826543754 0 2.737081140669132 -0.4665375240605305 0 0.05 GW 153 1 2.737081140669132 -0.4665375240605305 0 4.438683231217083 -1.990649444109428 0 0.05 GW 154 1 1.920542215495787 -2.444067826543754 0 4.438683231217083 -1.990649444109428 0 0.05 GW 155 1 0.4377855422001767 2.586535883288115 0 -1.798413501238099 2.096746902243944 0 0.05 GW 156 1 -1.798413501238099 2.096746902243944 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 157 1 0.4377855422001767 2.586535883288115 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 158 1 -2.284574740913827 -1.749273111998205 0 -0.338630110356612 -2.735015319983185 0 0.05 GW 159 1 -0.338630110356612 -2.735015319983185 0 -1.859813274983875 -4.097556872864168 0 0.05 GW 160 1 -2.284574740913827 -1.749273111998205 0 -1.859813274983875 -4.097556872864168 0 0.05 GW 161 1 -2.495989652860271 0.1076505093269847 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 162 1 -4.945135803440198 -0.7253315653909317 0 -4.031556072197924 1.818807848884627 0 0.05 GW 163 1 -2.495989652860271 0.1076505093269847 0 -4.031556072197924 1.818807848884627 0 0.05 GW 164 1 -2.495989652860271 0.1076505093269847 0 -2.284574740913827 -1.749273111998205 0 0.05 GW 165 1 -2.284574740913827 -1.749273111998205 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 166 1 -2.495989652860271 0.1076505093269847 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 167 1 2.371953240025473 1.671042667466238 0 0.4377855422001767 2.586535883288115 0 0.05 GW 168 1 0.4377855422001767 2.586535883288115 0 2.105648375805295 4.129671922143112 0 0.05 GW 169 1 2.371953240025473 1.671042667466238 0 2.105648375805295 4.129671922143112 0 0.05 GW 170 1 2.737081140669132 -0.4665375240605305 0 2.371953240025473 1.671042667466238 0 0.05 GW 171 1 2.371953240025473 1.671042667466238 0 4.991271700300564 0.5928870636193028 0 0.05 GW 172 1 2.737081140669132 -0.4665375240605305 0 4.991271700300564 0.5928870636193028 0 0.05 GW 173 1 -1.859813274983875 -4.097556872864168 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 174 1 -4.302571336824886 -6.755567895399417 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 175 1 -1.859813274983875 -4.097556872864168 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 176 1 2.105648375805295 4.129671922143112 0 4.076508745742529 6.059929662954254 0 0.05 GW 177 1 4.076508745742529 6.059929662954254 0 4.477133499339022 3.163876165159997 0 0.05 GW 178 1 2.105648375805295 4.129671922143112 0 4.477133499339022 3.163876165159997 0 0.05 GW 179 1 9.375 4.017857142858729 0 7.107750735368153 2.552791765646827 0 0.05 GW 180 1 7.107750735368153 2.552791765646827 0 6.689580159414997 5.10634656419997 0 0.05 GW 181 1 9.375 4.017857142858729 0 6.689580159414997 5.10634656419997 0 0.05 GW 182 1 -9.375 -4.017857142858729 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 183 1 -7.040876594749187 -2.58217861523339 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 184 1 -9.375 -4.017857142858729 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 185 1 1.339285714293643 -9.375 0 -1.339285714274611 -9.375 0 0.05 GW 186 1 -1.339285714274611 -9.375 0 -0.804536687442 -7.056579277445207 0 0.05 GW 187 1 1.339285714293643 -9.375 0 -0.804536687442 -7.056579277445207 0 0.05 GW 188 1 9.375 -1.339285714274611 0 9.375 -4.01785714284604 0 0.05 GW 189 1 9.375 -4.01785714284604 0 6.923381100557132 -1.490136501556707 0 0.05 GW 190 1 9.375 -1.339285714274611 0 6.923381100557132 -1.490136501556707 0 0.05 GW 191 1 6.166308673626426 -3.640777451789195 0 9.375 -4.01785714284604 0 0.05 GW 192 1 9.375 -4.01785714284604 0 6.962538025261316 -5.753525177529361 0 0.05 GW 193 1 6.166308673626426 -3.640777451789195 0 6.962538025261316 -5.753525177529361 0 0.05 GW 194 1 6.166308673626426 -3.640777451789195 0 6.923381100557132 -1.490136501556707 0 0.05 GW 195 1 6.923381100557132 -1.490136501556707 0 9.375 -4.01785714284604 0 0.05 GW 196 1 6.166308673626426 -3.640777451789195 0 9.375 -4.01785714284604 0 0.05 GW 197 1 1.339285714274611 9.375 0 4.01785714284604 9.375 0 0.05 GW 198 1 4.01785714284604 9.375 0 1.669158199314807 6.723974746187205 0 0.05 GW 199 1 1.339285714274611 9.375 0 1.669158199314807 6.723974746187205 0 0.05 GW 200 1 -9.375 1.339285714274611 0 -9.375 4.01785714284604 0 0.05 GW 201 1 -9.375 4.01785714284604 0 -6.710698696336139 1.630506943660993 0 0.05 GW 202 1 -9.375 1.339285714274611 0 -6.710698696336139 1.630506943660993 0 0.05 GW 203 1 7.107750735368153 2.552791765646827 0 4.991271700300564 0.5928870636193028 0 0.05 GW 204 1 4.991271700300564 0.5928870636193028 0 4.477133499339022 3.163876165159997 0 0.05 GW 205 1 7.107750735368153 2.552791765646827 0 4.477133499339022 3.163876165159997 0 0.05 GW 206 1 -3.086993814918736 6.844748159019945 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 207 1 -0.5802204548059274 4.784621367905854 0 -3.318106139849093 4.089524938451827 0 0.05 GW 208 1 -3.086993814918736 6.844748159019945 0 -3.318106139849093 4.089524938451827 0 0.05 GW 209 1 -4.031556072197924 1.818807848884627 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 210 1 -4.945135803440198 -0.7253315653909317 0 -6.710698696336139 1.630506943660993 0 0.05 GW 211 1 -4.031556072197924 1.818807848884627 0 -6.710698696336139 1.630506943660993 0 0.05 GW 212 1 -7.040876594749187 -2.58217861523339 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 213 1 -4.945135803440198 -0.7253315653909317 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 214 1 -7.040876594749187 -2.58217861523339 0 -4.422068399917589 -3.214523613654571 0 0.05 GW 215 1 -9.375 -1.339285714293643 0 -7.511211570050574 -0.3329693780054978 0 0.05 GW 216 1 -7.511211570050574 -0.3329693780054978 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 217 1 -9.375 -1.339285714293643 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 218 1 -4.945135803440198 -0.7253315653909317 0 -7.511211570050574 -0.3329693780054978 0 0.05 GW 219 1 -7.511211570050574 -0.3329693780054978 0 -6.710698696336139 1.630506943660993 0 0.05 GW 220 1 -4.945135803440198 -0.7253315653909317 0 -6.710698696336139 1.630506943660993 0 0.05 GW 221 1 -7.511211570050574 -0.3329693780054978 0 -4.945135803440198 -0.7253315653909317 0 0.05 GW 222 1 -4.945135803440198 -0.7253315653909317 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 223 1 -7.511211570050574 -0.3329693780054978 0 -7.040876594749187 -2.58217861523339 0 0.05 GW 224 1 -1.339285714293643 9.375 0 -0.3183934667911458 7.391334735821045 0 0.05 GW 225 1 -0.3183934667911458 7.391334735821045 0 -3.086993814918736 6.844748159019945 0 0.05 GW 226 1 -1.339285714293643 9.375 0 -3.086993814918736 6.844748159019945 0 0.05 GW 227 1 -0.5802204548059274 4.784621367905854 0 -0.3183934667911458 7.391334735821045 0 0.05 GW 228 1 -0.3183934667911458 7.391334735821045 0 1.669158199314807 6.723974746187205 0 0.05 GW 229 1 -0.5802204548059274 4.784621367905854 0 1.669158199314807 6.723974746187205 0 0.05 GW 230 1 -0.3183934667911458 7.391334735821045 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 231 1 -0.5802204548059274 4.784621367905854 0 -3.086993814918736 6.844748159019945 0 0.05 GW 232 1 -0.3183934667911458 7.391334735821045 0 -3.086993814918736 6.844748159019945 0 0.05 GW 233 1 9.375 1.339285714293643 0 7.554480707245171 0.331108465545691 0 0.05 GW 234 1 7.554480707245171 0.331108465545691 0 7.107750735368153 2.552791765646827 0 0.05 GW 235 1 9.375 1.339285714293643 0 7.107750735368153 2.552791765646827 0 0.05 GW 236 1 4.991271700300564 0.5928870636193028 0 7.554480707245171 0.331108465545691 0 0.05 GW 237 1 7.554480707245171 0.331108465545691 0 6.923381100557132 -1.490136501556707 0 0.05 GW 238 1 4.991271700300564 0.5928870636193028 0 6.923381100557132 -1.490136501556707 0 0.05 GW 239 1 7.554480707245171 0.331108465545691 0 4.991271700300564 0.5928870636193028 0 0.05 GW 240 1 4.991271700300564 0.5928870636193028 0 7.107750735368153 2.552791765646827 0 0.05 GW 241 1 7.554480707245171 0.331108465545691 0 7.107750735368153 2.552791765646827 0 0.05 GW 242 1 0.6338814896681605 -4.653060104590379 0 2.346644145379164 -7.052691914135518 0 0.05 GW 243 1 2.346644145379164 -7.052691914135518 0 -0.804536687442 -7.056579277445207 0 0.05 GW 244 1 0.6338814896681605 -4.653060104590379 0 -0.804536687442 -7.056579277445207 0 0.05 GW 245 1 2.346644145379164 -7.052691914135518 0 1.339285714293643 -9.375 0 0.05 GW 246 1 1.339285714293643 -9.375 0 -0.804536687442 -7.056579277445207 0 0.05 GW 247 1 2.346644145379164 -7.052691914135518 0 -0.804536687442 -7.056579277445207 0 0.05 GW 248 1 1.339285714274611 9.375 0 -0.3183934667911458 7.391334735821045 0 0.05 GW 249 1 -0.3183934667911458 7.391334735821045 0 -1.339285714293643 9.375 0 0.05 GW 250 1 1.339285714274611 9.375 0 -1.339285714293643 9.375 0 0.05 GW 251 1 1.339285714274611 9.375 0 1.669158199314807 6.723974746187205 0 0.05 GW 252 1 1.669158199314807 6.723974746187205 0 -0.3183934667911458 7.391334735821045 0 0.05 GW 253 1 1.339285714274611 9.375 0 -0.3183934667911458 7.391334735821045 0 0.05 GW 254 1 -9.375 1.339285714274611 0 -7.511211570050574 -0.3329693780054978 0 0.05 GW 255 1 -7.511211570050574 -0.3329693780054978 0 -9.375 -1.339285714293643 0 0.05 GW 256 1 -9.375 1.339285714274611 0 -9.375 -1.339285714293643 0 0.05 GW 257 1 -9.375 1.339285714274611 0 -6.710698696336139 1.630506943660993 0 0.05 GW 258 1 -6.710698696336139 1.630506943660993 0 -7.511211570050574 -0.3329693780054978 0 0.05 GW 259 1 -9.375 1.339285714274611 0 -7.511211570050574 -0.3329693780054978 0 0.05 GW 260 1 9.375 -1.339285714274611 0 7.554480707245171 0.331108465545691 0 0.05 GW 261 1 7.554480707245171 0.331108465545691 0 9.375 1.339285714293643 0 0.05 GW 262 1 9.375 -1.339285714274611 0 9.375 1.339285714293643 0 0.05 GW 263 1 9.375 -1.339285714274611 0 6.923381100557132 -1.490136501556707 0 0.05 GW 264 1 6.923381100557132 -1.490136501556707 0 7.554480707245171 0.331108465545691 0 0.05 GW 265 1 9.375 -1.339285714274611 0 7.554480707245171 0.331108465545691 0 0.05 GW 266 1 2.737081140669132 -0.4665375240605305 0 4.991271700300564 0.5928870636193028 0 0.05 GW 267 1 4.991271700300564 0.5928870636193028 0 4.438683231217083 -1.990649444109428 0 0.05 GW 268 1 2.737081140669132 -0.4665375240605305 0 4.438683231217083 -1.990649444109428 0 0.05 GW 269 1 6.166308673626426 -3.640777451789195 0 4.438683231217083 -1.990649444109428 0 0.05 GW 270 1 4.438683231217083 -1.990649444109428 0 6.923381100557132 -1.490136501556707 0 0.05 GW 271 1 6.166308673626426 -3.640777451789195 0 6.923381100557132 -1.490136501556707 0 0.05 GW 272 1 4.438683231217083 -1.990649444109428 0 4.991271700300564 0.5928870636193028 0 0.05 GW 273 1 4.991271700300564 0.5928870636193028 0 6.923381100557132 -1.490136501556707 0 0.05 GW 274 1 4.438683231217083 -1.990649444109428 0 6.923381100557132 -1.490136501556707 0 0.05 GW 275 1 5.070790366291444 -7.364935515320116 0 6.696428571428571 -9.375 0 0.05 GW 276 1 6.696428571428571 -9.375 0 4.017857142858729 -9.375 0 0.05 GW 277 1 5.070790366291444 -7.364935515320116 0 4.017857142858729 -9.375 0 0.05 GW 278 1 -3.086993814918736 6.844748159019945 0 -3.318106139849093 4.089524938451827 0 0.05 GW 279 1 -3.318106139849093 4.089524938451827 0 -5.051671194577829 5.621776665969451 0 0.05 GW 280 1 -3.086993814918736 6.844748159019945 0 -5.051671194577829 5.621776665969451 0 0.05 GW 281 1 6.689580159414997 5.10634656419997 0 9.375 6.696428571428571 0 0.05 GW 282 1 9.375 6.696428571428571 0 9.375 4.017857142858729 0 0.05 GW 283 1 6.689580159414997 5.10634656419997 0 9.375 4.017857142858729 0 0.05 GW 284 1 -7.025381012372589 -5.201448794742288 0 -9.375 -6.696428571428571 0 0.05 GW 285 1 -9.375 -6.696428571428571 0 -9.375 -4.017857142858729 0 0.05 GW 286 1 -7.025381012372589 -5.201448794742288 0 -9.375 -4.017857142858729 0 0.05 GW 287 1 4.076508745742529 6.059929662954254 0 1.669158199314807 6.723974746187205 0 0.05 GW 288 1 1.669158199314807 6.723974746187205 0 4.01785714284604 9.375 0 0.05 GW 289 1 4.076508745742529 6.059929662954254 0 4.01785714284604 9.375 0 0.05 GW 290 1 0.4377855422001767 2.586535883288115 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 291 1 -0.5802204548059274 4.784621367905854 0 2.105648375805295 4.129671922143112 0 0.05 GW 292 1 0.4377855422001767 2.586535883288115 0 2.105648375805295 4.129671922143112 0 0.05 GW 293 1 2.105648375805295 4.129671922143112 0 -0.5802204548059274 4.784621367905854 0 0.05 GW 294 1 -0.5802204548059274 4.784621367905854 0 1.669158199314807 6.723974746187205 0 0.05 GW 295 1 2.105648375805295 4.129671922143112 0 1.669158199314807 6.723974746187205 0 0.05 GW 296 1 4.076508745742529 6.059929662954254 0 2.105648375805295 4.129671922143112 0 0.05 GW 297 1 2.105648375805295 4.129671922143112 0 1.669158199314807 6.723974746187205 0 0.05 GW 298 1 4.076508745742529 6.059929662954254 0 1.669158199314807 6.723974746187205 0 0.05 GW 299 1 -0.338630110356612 -2.735015319983185 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 300 1 0.6338814896681605 -4.653060104590379 0 -1.859813274983875 -4.097556872864168 0 0.05 GW 301 1 -0.338630110356612 -2.735015319983185 0 -1.859813274983875 -4.097556872864168 0 0.05 GW 302 1 -1.859813274983875 -4.097556872864168 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 303 1 0.6338814896681605 -4.653060104590379 0 -0.804536687442 -7.056579277445207 0 0.05 GW 304 1 -1.859813274983875 -4.097556872864168 0 -0.804536687442 -7.056579277445207 0 0.05 GW 305 1 -4.302571336824886 -6.755567895399417 0 -1.859813274983875 -4.097556872864168 0 0.05 GW 306 1 -1.859813274983875 -4.097556872864168 0 -0.804536687442 -7.056579277445207 0 0.05 GW 307 1 -4.302571336824886 -6.755567895399417 0 -0.804536687442 -7.056579277445207 0 0.05 GW 308 1 -4.031556072197924 1.818807848884627 0 -6.011693100500072 3.877239974862947 0 0.05 GW 309 1 -6.011693100500072 3.877239974862947 0 -3.318106139849093 4.089524938451827 0 0.05 GW 310 1 -4.031556072197924 1.818807848884627 0 -3.318106139849093 4.089524938451827 0 0.05 GW 311 1 -6.011693100500072 3.877239974862947 0 -5.051671194577829 5.621776665969451 0 0.05 GW 312 1 -5.051671194577829 5.621776665969451 0 -3.318106139849093 4.089524938451827 0 0.05 GW 313 1 -6.011693100500072 3.877239974862947 0 -3.318106139849093 4.089524938451827 0 0.05 GW 314 1 -6.696428571428571 9.375 0 -7.754970731278189 7.817519156826236 0 0.05 GW 315 1 -7.754970731278189 7.817519156826236 0 -9.375 9.375 0 0.05 GW 316 1 -6.696428571428571 9.375 0 -9.375 9.375 0 0.05 GW 317 1 -7.754970731278189 7.817519156826236 0 -9.375 6.696428571422228 0 0.05 GW 318 1 -9.375 6.696428571422228 0 -9.375 9.375 0 0.05 GW 319 1 -7.754970731278189 7.817519156826236 0 -9.375 9.375 0 0.05 GW 320 1 -7.754970731278189 7.817519156826236 0 -6.696428571428571 9.375 0 0.05 GW 321 1 -6.696428571428571 9.375 0 -5.745298584922932 7.556200903344209 0 0.05 GW 322 1 -7.754970731278189 7.817519156826236 0 -5.745298584922932 7.556200903344209 0 0.05 GW 323 1 6.696428571428571 -9.375 0 7.495951392596266 -7.712977852854341 0 0.05 GW 324 1 7.495951392596266 -7.712977852854341 0 9.375 -9.375 0 0.05 GW 325 1 6.696428571428571 -9.375 0 9.375 -9.375 0 0.05 GW 326 1 9.375 -6.696428571422228 0 7.495951392596266 -7.712977852854341 0 0.05 GW 327 1 7.495951392596266 -7.712977852854341 0 6.962538025261316 -5.753525177529361 0 0.05 GW 328 1 9.375 -6.696428571422228 0 6.962538025261316 -5.753525177529361 0 0.05 GW 329 1 7.495951392596266 -7.712977852854341 0 9.375 -6.696428571422228 0 0.05 GW 330 1 9.375 -6.696428571422228 0 9.375 -9.375 0 0.05 GW 331 1 7.495951392596266 -7.712977852854341 0 9.375 -9.375 0 0.05 GW 332 1 -5.051671194577829 5.621776665969451 0 -7.21893893521317 5.931170402545185 0 0.05 GW 333 1 -7.21893893521317 5.931170402545185 0 -5.745298584922932 7.556200903344209 0 0.05 GW 334 1 -5.051671194577829 5.621776665969451 0 -5.745298584922932 7.556200903344209 0 0.05 GW 335 1 5.070790366291444 -7.364935515320116 0 7.495951392596266 -7.712977852854341 0 0.05 GW 336 1 7.495951392596266 -7.712977852854341 0 6.696428571428571 -9.375 0 0.05 GW 337 1 5.070790366291444 -7.364935515320116 0 6.696428571428571 -9.375 0 0.05 GW 338 1 5.070790366291444 -7.364935515320116 0 6.962538025261316 -5.753525177529361 0 0.05 GW 339 1 6.962538025261316 -5.753525177529361 0 7.495951392596266 -7.712977852854341 0 0.05 GW 340 1 5.070790366291444 -7.364935515320116 0 7.495951392596266 -7.712977852854341 0 0.05 GW 341 1 -7.754970731278189 7.817519156826236 0 -7.21893893521317 5.931170402545185 0 0.05 GW 342 1 -7.21893893521317 5.931170402545185 0 -9.375 6.696428571422228 0 0.05 GW 343 1 -7.754970731278189 7.817519156826236 0 -9.375 6.696428571422228 0 0.05 GW 344 1 -7.754970731278189 7.817519156826236 0 -5.745298584922932 7.556200903344209 0 0.05 GW 345 1 -5.745298584922932 7.556200903344209 0 -7.21893893521317 5.931170402545185 0 0.05 GW 346 1 -7.754970731278189 7.817519156826236 0 -7.21893893521317 5.931170402545185 0 0.05 GW 347 1 -6.710698696336139 1.630506943660993 0 -6.011693100500072 3.877239974862947 0 0.05 GW 348 1 -6.011693100500072 3.877239974862947 0 -4.031556072197924 1.818807848884627 0 0.05 GW 349 1 -6.710698696336139 1.630506943660993 0 -4.031556072197924 1.818807848884627 0 0.05 GW 350 1 -6.011693100500072 3.877239974862947 0 -6.710698696336139 1.630506943660993 0 0.05 GW 351 1 -6.710698696336139 1.630506943660993 0 -9.375 4.01785714284604 0 0.05 GW 352 1 -6.011693100500072 3.877239974862947 0 -9.375 4.01785714284604 0 0.05 GW 353 1 -5.745298584922932 7.556200903344209 0 -4.017857142858729 9.375 0 0.05 GW 354 1 -4.017857142858729 9.375 0 -3.086993814918736 6.844748159019945 0 0.05 GW 355 1 -5.745298584922932 7.556200903344209 0 -3.086993814918736 6.844748159019945 0 0.05 GW 356 1 -4.017857142858729 9.375 0 -5.745298584922932 7.556200903344209 0 0.05 GW 357 1 -5.745298584922932 7.556200903344209 0 -6.696428571428571 9.375 0 0.05 GW 358 1 -4.017857142858729 9.375 0 -6.696428571428571 9.375 0 0.05 GW 359 1 -5.051671194577829 5.621776665969451 0 -5.745298584922932 7.556200903344209 0 0.05 GW 360 1 -5.745298584922932 7.556200903344209 0 -3.086993814918736 6.844748159019945 0 0.05 GW 361 1 -5.051671194577829 5.621776665969451 0 -3.086993814918736 6.844748159019945 0 0.05 GW 362 1 -7.21893893521317 5.931170402545185 0 -9.375 4.01785714284604 0 0.05 GW 363 1 -9.375 4.01785714284604 0 -9.375 6.696428571422228 0 0.05 GW 364 1 -7.21893893521317 5.931170402545185 0 -9.375 6.696428571422228 0 0.05 GW 365 1 -9.375 4.01785714284604 0 -7.21893893521317 5.931170402545185 0 0.05 GW 366 1 -7.21893893521317 5.931170402545185 0 -6.011693100500072 3.877239974862947 0 0.05 GW 367 1 -9.375 4.01785714284604 0 -6.011693100500072 3.877239974862947 0 0.05 GW 368 1 -7.21893893521317 5.931170402545185 0 -5.051671194577829 5.621776665969451 0 0.05 GW 369 1 -5.051671194577829 5.621776665969451 0 -6.011693100500072 3.877239974862947 0 0.05 GW 370 1 -7.21893893521317 5.931170402545185 0 -6.011693100500072 3.877239974862947 0 0.05 GW 371 1 1.339285714293643 -9.375 0 2.346644145379164 -7.052691914135518 0 0.05 GW 372 1 2.346644145379164 -7.052691914135518 0 4.017857142858729 -9.375 0 0.05 GW 373 1 1.339285714293643 -9.375 0 4.017857142858729 -9.375 0 0.05 GW 374 1 2.346644145379164 -7.052691914135518 0 3.75241482593574 -4.765438098087474 0 0.05 GW 375 1 3.75241482593574 -4.765438098087474 0 5.070790366291444 -7.364935515320116 0 0.05 GW 376 1 2.346644145379164 -7.052691914135518 0 5.070790366291444 -7.364935515320116 0 0.05 GW 377 1 4.017857142858729 -9.375 0 2.346644145379164 -7.052691914135518 0 0.05 GW 378 1 2.346644145379164 -7.052691914135518 0 5.070790366291444 -7.364935515320116 0 0.05 GW 379 1 4.017857142858729 -9.375 0 5.070790366291444 -7.364935515320116 0 0.05 GW 380 1 2.346644145379164 -7.052691914135518 0 0.6338814896681605 -4.653060104590379 0 0.05 GW 381 1 0.6338814896681605 -4.653060104590379 0 3.75241482593574 -4.765438098087474 0 0.05 GW 382 1 2.346644145379164 -7.052691914135518 0 3.75241482593574 -4.765438098087474 0 0.05 GW 383 1 6.696428571422228 9.375 0 6.481848150856152 7.441403180716179 0 0.05 GW 384 1 6.481848150856152 7.441403180716179 0 4.01785714284604 9.375 0 0.05 GW 385 1 6.696428571422228 9.375 0 4.01785714284604 9.375 0 0.05 GW 386 1 6.481848150856152 7.441403180716179 0 4.076508745742529 6.059929662954254 0 0.05 GW 387 1 4.076508745742529 6.059929662954254 0 4.01785714284604 9.375 0 0.05 GW 388 1 6.481848150856152 7.441403180716179 0 4.01785714284604 9.375 0 0.05 GW 389 1 9.375 6.696428571428571 0 7.982069180569595 8.221957938036187 0 0.05 GW 390 1 7.982069180569595 8.221957938036187 0 9.375 9.375 0 0.05 GW 391 1 9.375 6.696428571428571 0 9.375 9.375 0 0.05 GW 392 1 7.982069180569595 8.221957938036187 0 6.696428571422228 9.375 0 0.05 GW 393 1 6.696428571422228 9.375 0 9.375 9.375 0 0.05 GW 394 1 7.982069180569595 8.221957938036187 0 9.375 9.375 0 0.05 GW 395 1 -2.516326584605074 -8.117142454252349 0 -1.339285714274611 -9.375 0 0.05 GW 396 1 -1.339285714274611 -9.375 0 -4.01785714284604 -9.375 0 0.05 GW 397 1 -2.516326584605074 -8.117142454252349 0 -4.01785714284604 -9.375 0 0.05 GW 398 1 -2.516326584605074 -8.117142454252349 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 399 1 -4.302571336824886 -6.755567895399417 0 -0.804536687442 -7.056579277445207 0 0.05 GW 400 1 -2.516326584605074 -8.117142454252349 0 -0.804536687442 -7.056579277445207 0 0.05 GW 401 1 -4.302571336824886 -6.755567895399417 0 -2.516326584605074 -8.117142454252349 0 0.05 GW 402 1 -2.516326584605074 -8.117142454252349 0 -4.01785714284604 -9.375 0 0.05 GW 403 1 -4.302571336824886 -6.755567895399417 0 -4.01785714284604 -9.375 0 0.05 GW 404 1 -1.339285714274611 -9.375 0 -2.516326584605074 -8.117142454252349 0 0.05 GW 405 1 -2.516326584605074 -8.117142454252349 0 -0.804536687442 -7.056579277445207 0 0.05 GW 406 1 -1.339285714274611 -9.375 0 -0.804536687442 -7.056579277445207 0 0.05 GW 407 1 6.696428571422228 9.375 0 7.982069180569595 8.221957938036187 0 0.05 GW 408 1 7.982069180569595 8.221957938036187 0 6.481848150856152 7.441403180716179 0 0.05 GW 409 1 6.696428571422228 9.375 0 6.481848150856152 7.441403180716179 0 0.05 GW 410 1 6.481848150856152 7.441403180716179 0 6.689580159414997 5.10634656419997 0 0.05 GW 411 1 6.689580159414997 5.10634656419997 0 4.076508745742529 6.059929662954254 0 0.05 GW 412 1 6.481848150856152 7.441403180716179 0 4.076508745742529 6.059929662954254 0 0.05 GW 413 1 6.689580159414997 5.10634656419997 0 6.481848150856152 7.441403180716179 0 0.05 GW 414 1 6.481848150856152 7.441403180716179 0 9.375 6.696428571428571 0 0.05 GW 415 1 6.689580159414997 5.10634656419997 0 9.375 6.696428571428571 0 0.05 GW 416 1 7.982069180569595 8.221957938036187 0 9.375 6.696428571428571 0 0.05 GW 417 1 9.375 6.696428571428571 0 6.481848150856152 7.441403180716179 0 0.05 GW 418 1 7.982069180569595 8.221957938036187 0 6.481848150856152 7.441403180716179 0 0.05 GW 419 1 -7.354876184123941 -7.480689052314055 0 -6.696428571422228 -9.375 0 0.05 GW 420 1 -6.696428571422228 -9.375 0 -9.375 -9.375 0 0.05 GW 421 1 -7.354876184123941 -7.480689052314055 0 -9.375 -9.375 0 0.05 GW 422 1 -9.375 -6.696428571428571 0 -7.354876184123941 -7.480689052314055 0 0.05 GW 423 1 -7.354876184123941 -7.480689052314055 0 -9.375 -9.375 0 0.05 GW 424 1 -9.375 -6.696428571428571 0 -9.375 -9.375 0 0.05 GW 425 1 -7.354876184123941 -7.480689052314055 0 -7.025381012372589 -5.201448794742288 0 0.05 GW 426 1 -7.025381012372589 -5.201448794742288 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 427 1 -7.354876184123941 -7.480689052314055 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 428 1 -7.025381012372589 -5.201448794742288 0 -7.354876184123941 -7.480689052314055 0 0.05 GW 429 1 -7.354876184123941 -7.480689052314055 0 -9.375 -6.696428571428571 0 0.05 GW 430 1 -7.025381012372589 -5.201448794742288 0 -9.375 -6.696428571428571 0 0.05 GW 431 1 -6.696428571422228 -9.375 0 -4.302571336824886 -6.755567895399417 0 0.05 GW 432 1 -4.302571336824886 -6.755567895399417 0 -4.01785714284604 -9.375 0 0.05 GW 433 1 -6.696428571422228 -9.375 0 -4.01785714284604 -9.375 0 0.05 GW 434 1 -4.302571336824886 -6.755567895399417 0 -6.696428571422228 -9.375 0 0.05 GW 435 1 -6.696428571422228 -9.375 0 -7.354876184123941 -7.480689052314055 0 0.05 GW 436 1 -4.302571336824886 -6.755567895399417 0 -7.354876184123941 -7.480689052314055 0 0.05 GW 437 1 -7.5 -1.071428571432536 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 438 1 -5.798515523851522 -3.715951608107929 1.2 -7.5 -3.214285714286508 1.2 0.05 GW 439 1 -7.5 -1.071428571432536 1.2 -7.5 -3.214285714286508 1.2 0.05 GW 440 1 1.071428571432536 -7.5 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 441 1 3.715951608107929 -5.798515523851522 1.2 3.214285714286508 -7.5 1.2 0.05 GW 442 1 1.071428571432536 -7.5 1.2 3.214285714286508 -7.5 1.2 0.05 GW 443 1 -1.071428571432536 7.5 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 444 1 -3.715951608107929 5.798515523851522 1.2 -3.214285714286508 7.5 1.2 0.05 GW 445 1 -1.071428571432536 7.5 1.2 -3.214285714286508 7.5 1.2 0.05 GW 446 1 7.5 1.071428571432536 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 447 1 5.798515523851522 3.715951608107929 1.2 7.5 3.214285714286508 1.2 0.05 GW 448 1 7.5 1.071428571432536 1.2 7.5 3.214285714286508 1.2 0.05 GW 449 1 1.07142857142302 7.5 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 450 1 1.245511519270567 5.570164365222084 1.2 -1.071428571432536 7.5 1.2 0.05 GW 451 1 1.07142857142302 7.5 1.2 -1.071428571432536 7.5 1.2 0.05 GW 452 1 -1.07142857142302 -7.5 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 453 1 -1.245511519270567 -5.570164365222084 1.2 1.071428571432536 -7.5 1.2 0.05 GW 454 1 -1.07142857142302 -7.5 1.2 1.071428571432536 -7.5 1.2 0.05 GW 455 1 7.5 -1.07142857142302 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 456 1 5.570164365222084 -1.245511519270567 1.2 7.5 1.071428571432536 1.2 0.05 GW 457 1 7.5 -1.07142857142302 1.2 7.5 1.071428571432536 1.2 0.05 GW 458 1 -7.5 1.07142857142302 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 459 1 -5.570164365222084 1.245511519270567 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 460 1 -7.5 1.07142857142302 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 461 1 3 -3 1.2 5.619114566983574 -4.174004507185296 1.2 0.05 GW 462 1 5.619114566983574 -4.174004507185296 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 463 1 3 -3 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 464 1 7.5 -5.357142857139685 1.2 5.619114566983574 -4.174004507185296 1.2 0.05 GW 465 1 5.619114566983574 -4.174004507185296 1.2 7.5 -3.214285714280164 1.2 0.05 GW 466 1 7.5 -5.357142857139685 1.2 7.5 -3.214285714280164 1.2 0.05 GW 467 1 -3 -3 1.2 -4.174004507185296 -5.619114566983574 1.2 0.05 GW 468 1 -4.174004507185296 -5.619114566983574 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 469 1 -3 -3 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 470 1 -5.357142857139685 -7.5 1.2 -4.174004507185296 -5.619114566983574 1.2 0.05 GW 471 1 -4.174004507185296 -5.619114566983574 1.2 -3.214285714280164 -7.5 1.2 0.05 GW 472 1 -5.357142857139685 -7.5 1.2 -3.214285714280164 -7.5 1.2 0.05 GW 473 1 -3 3 1.2 -5.619114566983574 4.174004507185296 1.2 0.05 GW 474 1 -5.619114566983574 4.174004507185296 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 475 1 -3 3 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 476 1 -7.5 5.357142857139685 1.2 -5.619114566983574 4.174004507185296 1.2 0.05 GW 477 1 -5.619114566983574 4.174004507185296 1.2 -7.5 3.214285714280164 1.2 0.05 GW 478 1 -7.5 5.357142857139685 1.2 -7.5 3.214285714280164 1.2 0.05 GW 479 1 3 3 1.2 4.174004507185296 5.619114566983574 1.2 0.05 GW 480 1 4.174004507185296 5.619114566983574 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 481 1 3 3 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 482 1 5.357142857139685 7.5 1.2 4.174004507185296 5.619114566983574 1.2 0.05 GW 483 1 4.174004507185296 5.619114566983574 1.2 3.214285714280164 7.5 1.2 0.05 GW 484 1 5.357142857139685 7.5 1.2 3.214285714280164 7.5 1.2 0.05 GW 485 1 3 -3 1.2 3 8.326672684688674e-12 1.2 0.05 GW 486 1 3 8.326672684688674e-12 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 487 1 3 -3 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 488 1 5.619114566983574 -4.174004507185296 1.2 3 -3 1.2 0.05 GW 489 1 3 -3 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 490 1 5.619114566983574 -4.174004507185296 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 491 1 -3 -3 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 492 1 8.326672684688674e-12 -3 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 493 1 -3 -3 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 494 1 -4.174004507185296 -5.619114566983574 1.2 -3 -3 1.2 0.05 GW 495 1 -3 -3 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 496 1 -4.174004507185296 -5.619114566983574 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 497 1 3 3 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 498 1 -8.326672684688674e-12 3 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 499 1 3 3 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 500 1 4.174004507185296 5.619114566983574 1.2 3 3 1.2 0.05 GW 501 1 3 3 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 502 1 4.174004507185296 5.619114566983574 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 503 1 -3 3 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 504 1 -3 -8.326672684688674e-12 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 505 1 -3 3 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 506 1 -5.619114566983574 4.174004507185296 1.2 -3 3 1.2 0.05 GW 507 1 -3 3 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 508 1 -5.619114566983574 4.174004507185296 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 509 1 -5.570164365222084 1.245511519270567 1.2 -4.853830094495789 -1.302912223263375 1.2 0.05 GW 510 1 -4.853830094495789 -1.302912223263375 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 511 1 -5.570164365222084 1.245511519270567 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 512 1 -4.853830094495789 -1.302912223263375 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 513 1 -5.798515523851522 -3.715951608107929 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 514 1 -4.853830094495789 -1.302912223263375 1.2 -7.5 -1.071428571432536 1.2 0.05 GW 515 1 -4.853830094495789 -1.302912223263375 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 516 1 -5.570164365222084 1.245511519270567 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 517 1 -4.853830094495789 -1.302912223263375 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 518 1 -1.245511519270567 -5.570164365222084 1.2 1.302912223263375 -4.853830094495789 1.2 0.05 GW 519 1 1.302912223263375 -4.853830094495789 1.2 1.071428571432536 -7.5 1.2 0.05 GW 520 1 -1.245511519270567 -5.570164365222084 1.2 1.071428571432536 -7.5 1.2 0.05 GW 521 1 1.302912223263375 -4.853830094495789 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 522 1 3.715951608107929 -5.798515523851522 1.2 1.071428571432536 -7.5 1.2 0.05 GW 523 1 1.302912223263375 -4.853830094495789 1.2 1.071428571432536 -7.5 1.2 0.05 GW 524 1 1.302912223263375 -4.853830094495789 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 525 1 -1.245511519270567 -5.570164365222084 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 526 1 1.302912223263375 -4.853830094495789 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 527 1 1.245511519270567 5.570164365222084 1.2 -1.302912223263375 4.853830094495789 1.2 0.05 GW 528 1 -1.302912223263375 4.853830094495789 1.2 -1.071428571432536 7.5 1.2 0.05 GW 529 1 1.245511519270567 5.570164365222084 1.2 -1.071428571432536 7.5 1.2 0.05 GW 530 1 -1.302912223263375 4.853830094495789 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 531 1 -3.715951608107929 5.798515523851522 1.2 -1.071428571432536 7.5 1.2 0.05 GW 532 1 -1.302912223263375 4.853830094495789 1.2 -1.071428571432536 7.5 1.2 0.05 GW 533 1 -1.302912223263375 4.853830094495789 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 534 1 1.245511519270567 5.570164365222084 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 535 1 -1.302912223263375 4.853830094495789 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 536 1 5.570164365222084 -1.245511519270567 1.2 4.853830094495789 1.302912223263375 1.2 0.05 GW 537 1 4.853830094495789 1.302912223263375 1.2 7.5 1.071428571432536 1.2 0.05 GW 538 1 5.570164365222084 -1.245511519270567 1.2 7.5 1.071428571432536 1.2 0.05 GW 539 1 4.853830094495789 1.302912223263375 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 540 1 5.798515523851522 3.715951608107929 1.2 7.5 1.071428571432536 1.2 0.05 GW 541 1 4.853830094495789 1.302912223263375 1.2 7.5 1.071428571432536 1.2 0.05 GW 542 1 4.853830094495789 1.302912223263375 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 543 1 5.570164365222084 -1.245511519270567 1.2 3 8.326672684688674e-12 1.2 0.05 GW 544 1 4.853830094495789 1.302912223263375 1.2 3 8.326672684688674e-12 1.2 0.05 GW 545 1 -3 -3 1.2 -4.853830094495789 -1.302912223263375 1.2 0.05 GW 546 1 -4.853830094495789 -1.302912223263375 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 547 1 -3 -3 1.2 -3 -8.326672684688674e-12 1.2 0.05 GW 548 1 -3 -3 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 549 1 -5.798515523851522 -3.715951608107929 1.2 -4.853830094495789 -1.302912223263375 1.2 0.05 GW 550 1 -3 -3 1.2 -4.853830094495789 -1.302912223263375 1.2 0.05 GW 551 1 -3 3 1.2 -1.302912223263375 4.853830094495789 1.2 0.05 GW 552 1 -1.302912223263375 4.853830094495789 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 553 1 -3 3 1.2 -8.326672684688674e-12 3 1.2 0.05 GW 554 1 -3 3 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 555 1 -3.715951608107929 5.798515523851522 1.2 -1.302912223263375 4.853830094495789 1.2 0.05 GW 556 1 -3 3 1.2 -1.302912223263375 4.853830094495789 1.2 0.05 GW 557 1 3 -3 1.2 1.302912223263375 -4.853830094495789 1.2 0.05 GW 558 1 1.302912223263375 -4.853830094495789 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 559 1 3 -3 1.2 8.326672684688674e-12 -3 1.2 0.05 GW 560 1 3 -3 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 561 1 3.715951608107929 -5.798515523851522 1.2 1.302912223263375 -4.853830094495789 1.2 0.05 GW 562 1 3 -3 1.2 1.302912223263375 -4.853830094495789 1.2 0.05 GW 563 1 3 3 1.2 4.853830094495789 1.302912223263375 1.2 0.05 GW 564 1 4.853830094495789 1.302912223263375 1.2 3 8.326672684688674e-12 1.2 0.05 GW 565 1 3 3 1.2 3 8.326672684688674e-12 1.2 0.05 GW 566 1 3 3 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 567 1 5.798515523851522 3.715951608107929 1.2 4.853830094495789 1.302912223263375 1.2 0.05 GW 568 1 3 3 1.2 4.853830094495789 1.302912223263375 1.2 0.05 GW 569 1 7.5 3.214285714286508 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 570 1 5.798515523851522 3.715951608107929 1.2 7.5 5.357142857142858 1.2 0.05 GW 571 1 7.5 3.214285714286508 1.2 7.5 5.357142857142858 1.2 0.05 GW 572 1 -3.214285714286508 7.5 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 573 1 -3.715951608107929 5.798515523851522 1.2 -5.357142857142858 7.5 1.2 0.05 GW 574 1 -3.214285714286508 7.5 1.2 -5.357142857142858 7.5 1.2 0.05 GW 575 1 -7.5 -3.214285714286508 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 576 1 -5.798515523851522 -3.715951608107929 1.2 -7.5 -5.357142857142858 1.2 0.05 GW 577 1 -7.5 -3.214285714286508 1.2 -7.5 -5.357142857142858 1.2 0.05 GW 578 1 3.214285714286508 -7.5 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 579 1 3.715951608107929 -5.798515523851522 1.2 5.357142857142858 -7.5 1.2 0.05 GW 580 1 3.214285714286508 -7.5 1.2 5.357142857142858 -7.5 1.2 0.05 GW 581 1 5.357142857142858 -7.5 1.2 5.938441806446872 -6.0659325776353 1.2 0.05 GW 582 1 5.938441806446872 -6.0659325776353 1.2 7.5 -7.5 1.2 0.05 GW 583 1 5.357142857142858 -7.5 1.2 7.5 -7.5 1.2 0.05 GW 584 1 5.938441806446872 -6.0659325776353 1.2 7.5 -5.357142857139685 1.2 0.05 GW 585 1 7.5 -5.357142857139685 1.2 7.5 -7.5 1.2 0.05 GW 586 1 5.938441806446872 -6.0659325776353 1.2 7.5 -7.5 1.2 0.05 GW 587 1 -7.5 -5.357142857142858 1.2 -6.0659325776353 -5.938441806446872 1.2 0.05 GW 588 1 -6.0659325776353 -5.938441806446872 1.2 -7.5 -7.5 1.2 0.05 GW 589 1 -7.5 -5.357142857142858 1.2 -7.5 -7.5 1.2 0.05 GW 590 1 -6.0659325776353 -5.938441806446872 1.2 -5.357142857139685 -7.5 1.2 0.05 GW 591 1 -5.357142857139685 -7.5 1.2 -7.5 -7.5 1.2 0.05 GW 592 1 -6.0659325776353 -5.938441806446872 1.2 -7.5 -7.5 1.2 0.05 GW 593 1 -5.357142857142858 7.5 1.2 -5.938441806446872 6.0659325776353 1.2 0.05 GW 594 1 -5.938441806446872 6.0659325776353 1.2 -7.5 7.5 1.2 0.05 GW 595 1 -5.357142857142858 7.5 1.2 -7.5 7.5 1.2 0.05 GW 596 1 -5.938441806446872 6.0659325776353 1.2 -7.5 5.357142857139685 1.2 0.05 GW 597 1 -7.5 5.357142857139685 1.2 -7.5 7.5 1.2 0.05 GW 598 1 -5.938441806446872 6.0659325776353 1.2 -7.5 7.5 1.2 0.05 GW 599 1 7.5 5.357142857142858 1.2 6.0659325776353 5.938441806446872 1.2 0.05 GW 600 1 6.0659325776353 5.938441806446872 1.2 7.5 7.5 1.2 0.05 GW 601 1 7.5 5.357142857142858 1.2 7.5 7.5 1.2 0.05 GW 602 1 6.0659325776353 5.938441806446872 1.2 5.357142857139685 7.5 1.2 0.05 GW 603 1 5.357142857139685 7.5 1.2 7.5 7.5 1.2 0.05 GW 604 1 6.0659325776353 5.938441806446872 1.2 7.5 7.5 1.2 0.05 GW 605 1 7.5 -1.07142857142302 1.2 7.5 -3.214285714280164 1.2 0.05 GW 606 1 7.5 -3.214285714280164 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 607 1 7.5 -1.07142857142302 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 608 1 7.5 -3.214285714280164 1.2 5.619114566983574 -4.174004507185296 1.2 0.05 GW 609 1 5.619114566983574 -4.174004507185296 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 610 1 7.5 -3.214285714280164 1.2 5.570164365222084 -1.245511519270567 1.2 0.05 GW 611 1 -1.07142857142302 -7.5 1.2 -3.214285714280164 -7.5 1.2 0.05 GW 612 1 -3.214285714280164 -7.5 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 613 1 -1.07142857142302 -7.5 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 614 1 -3.214285714280164 -7.5 1.2 -4.174004507185296 -5.619114566983574 1.2 0.05 GW 615 1 -4.174004507185296 -5.619114566983574 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 616 1 -3.214285714280164 -7.5 1.2 -1.245511519270567 -5.570164365222084 1.2 0.05 GW 617 1 -7.5 1.07142857142302 1.2 -7.5 3.214285714280164 1.2 0.05 GW 618 1 -7.5 3.214285714280164 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 619 1 -7.5 1.07142857142302 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 620 1 -7.5 3.214285714280164 1.2 -5.619114566983574 4.174004507185296 1.2 0.05 GW 621 1 -5.619114566983574 4.174004507185296 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 622 1 -7.5 3.214285714280164 1.2 -5.570164365222084 1.245511519270567 1.2 0.05 GW 623 1 1.07142857142302 7.5 1.2 3.214285714280164 7.5 1.2 0.05 GW 624 1 3.214285714280164 7.5 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 625 1 1.07142857142302 7.5 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 626 1 3.214285714280164 7.5 1.2 4.174004507185296 5.619114566983574 1.2 0.05 GW 627 1 4.174004507185296 5.619114566983574 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 628 1 3.214285714280164 7.5 1.2 1.245511519270567 5.570164365222084 1.2 0.05 GW 629 1 5.938441806446872 -6.0659325776353 1.2 5.357142857142858 -7.5 1.2 0.05 GW 630 1 5.357142857142858 -7.5 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 631 1 5.938441806446872 -6.0659325776353 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 632 1 5.619114566983574 -4.174004507185296 1.2 5.938441806446872 -6.0659325776353 1.2 0.05 GW 633 1 5.938441806446872 -6.0659325776353 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 634 1 5.619114566983574 -4.174004507185296 1.2 3.715951608107929 -5.798515523851522 1.2 0.05 GW 635 1 5.938441806446872 -6.0659325776353 1.2 5.619114566983574 -4.174004507185296 1.2 0.05 GW 636 1 5.619114566983574 -4.174004507185296 1.2 7.5 -5.357142857139685 1.2 0.05 GW 637 1 5.938441806446872 -6.0659325776353 1.2 7.5 -5.357142857139685 1.2 0.05 GW 638 1 6.0659325776353 5.938441806446872 1.2 7.5 5.357142857142858 1.2 0.05 GW 639 1 7.5 5.357142857142858 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 640 1 6.0659325776353 5.938441806446872 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 641 1 4.174004507185296 5.619114566983574 1.2 6.0659325776353 5.938441806446872 1.2 0.05 GW 642 1 6.0659325776353 5.938441806446872 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 643 1 4.174004507185296 5.619114566983574 1.2 5.798515523851522 3.715951608107929 1.2 0.05 GW 644 1 6.0659325776353 5.938441806446872 1.2 4.174004507185296 5.619114566983574 1.2 0.05 GW 645 1 4.174004507185296 5.619114566983574 1.2 5.357142857139685 7.5 1.2 0.05 GW 646 1 6.0659325776353 5.938441806446872 1.2 5.357142857139685 7.5 1.2 0.05 GW 647 1 -6.0659325776353 -5.938441806446872 1.2 -7.5 -5.357142857142858 1.2 0.05 GW 648 1 -7.5 -5.357142857142858 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 649 1 -6.0659325776353 -5.938441806446872 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 650 1 -4.174004507185296 -5.619114566983574 1.2 -6.0659325776353 -5.938441806446872 1.2 0.05 GW 651 1 -6.0659325776353 -5.938441806446872 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 652 1 -4.174004507185296 -5.619114566983574 1.2 -5.798515523851522 -3.715951608107929 1.2 0.05 GW 653 1 -6.0659325776353 -5.938441806446872 1.2 -4.174004507185296 -5.619114566983574 1.2 0.05 GW 654 1 -4.174004507185296 -5.619114566983574 1.2 -5.357142857139685 -7.5 1.2 0.05 GW 655 1 -6.0659325776353 -5.938441806446872 1.2 -5.357142857139685 -7.5 1.2 0.05 GW 656 1 -5.938441806446872 6.0659325776353 1.2 -5.357142857142858 7.5 1.2 0.05 GW 657 1 -5.357142857142858 7.5 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 658 1 -5.938441806446872 6.0659325776353 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 659 1 -5.619114566983574 4.174004507185296 1.2 -5.938441806446872 6.0659325776353 1.2 0.05 GW 660 1 -5.938441806446872 6.0659325776353 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 661 1 -5.619114566983574 4.174004507185296 1.2 -3.715951608107929 5.798515523851522 1.2 0.05 GW 662 1 -5.938441806446872 6.0659325776353 1.2 -5.619114566983574 4.174004507185296 1.2 0.05 GW 663 1 -5.619114566983574 4.174004507185296 1.2 -7.5 5.357142857139685 1.2 0.05 GW 664 1 -5.938441806446872 6.0659325776353 1.2 -7.5 5.357142857139685 1.2 0.05 GW 665 1 9.0 9.0 1.2 7.5 7.5 1.2 0.05 GS 0 0 0.01 GE EX 0 665 1 0 0 0 0 0 0 FR 0 0 0 0 658.0 0 0 0 0 RP 0 61 61 1000 0 0 3 6 0 0 EN necpp-1.5.0+cvs20101003/test_data/yagi16.nec0000644000175000017500000000266210310210764016441 0ustar numanumaCM NEC Input File of a 16 element Yagi CE GW 15 7 0.00000 -0.34000 0.00000 0.00000 0.34000 0.00000 0.00250 GW 16 7 0.27300 -0.31750 0.00000 0.27300 0.31750 0.00000 0.00250 GW 1 7 0.69300 -0.30500 0.00000 0.69300 0.30500 0.00000 0.00250 GW 2 7 1.11300 -0.30500 0.00000 1.11300 0.30500 0.00000 0.00250 GW 3 7 1.53300 -0.30500 0.00000 1.53300 0.30500 0.00000 0.00250 GW 4 7 1.95300 -0.30500 0.00000 1.95300 0.30500 0.00000 0.00250 GW 5 7 2.37300 -0.30500 0.00000 2.37300 0.30500 0.00000 0.00250 GW 6 7 2.79300 -0.30500 0.00000 2.79300 0.30500 0.00000 0.00250 GW 7 7 3.21300 -0.30500 0.00000 3.21300 0.30500 0.00000 0.00250 GW 8 7 3.63300 -0.30500 0.00000 3.63300 0.30500 0.00000 0.00250 GW 9 7 4.05300 -0.30500 0.00000 4.05300 0.30500 0.00000 0.00250 GW 10 7 4.47300 -0.30500 0.00000 4.47300 0.30500 0.00000 0.00250 GW 11 7 4.89300 -0.30500 0.00000 4.89300 0.30500 0.00000 0.00250 GW 12 7 5.31300 -0.30500 0.00000 5.31300 0.30500 0.00000 0.00250 GW 13 7 5.73300 -0.30500 0.00000 5.73300 0.30500 0.00000 0.00250 GE 0 FR 0 1 0 0 2.20E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 EX 0 16 4 0 1.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 RP 0 60 120 1001 0.00E+00 0.00E+00 1.50E+00 3.00E+00 1.00E+04 0.00E+00 EN necpp-1.5.0+cvs20101003/test_data/ga_pjw_0.nec0000644000175000017500000000121010310210764017013 0ustar numanumaCM GA - NEC FILE CE go blue ! GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE 0 GN -1 LD 5 0 0 0 3.720E+07 FR 0 1 0 0 2400 PT -1 EX 1 1 1 0 0 0 0 0 0 0 0 RP 0 1 1 0500 90 90 0 0 EN necpp-1.5.0+cvs20101003/test_data/Collinear_1L.nec0000644000175000017500000000052710310210764017603 0ustar numanumaCM Example file by Dimitry Fedorov, UA3AVR CE GW 1 20 0 -10.49566 20.5 0 -0.1 20.5 0.001 GW 2 20 0 0.1 20.5 0 10.49566 20.5 0.001 GW 3 11 0 -0.1 15.27217 0 -0.1 20.5 0.001 GW 4 11 0 0.1 15.27217 0 0.1 20.5 0.001 GW 5 1 0 -0.1 15.27217 0 0.1 15.27217 0.001 GS 0 0 1.0 GE 1 EX 0 1 10 0 1.0000 0.0000 GN 2 0 0 0 30 0.001 FR 0 1 0 0 14.05 1 XQ EN necpp-1.5.0+cvs20101003/test_data/example4.nec0000644000175000017500000000044610310210764017056 0ustar numanumaCEEXAMPLE 4. T ANTENNA ON A BOX OVER PERFECT GROUND SP 0 0 .1 .05 .05 0. 0. .01 SP 0 0 .05 .1 .05 0. 90. .01 GX 0 110 SP 0 0 0. 0. .1 90. 0. .04 GW 1 4 0. 0. .1 0. 0. .3 .001 GW 2 2 0. 0. .3 .15 0. .3 .001 GW 3 2 0. 0. .3 -.15 0. .3 .001 GE 1 GN 1 EX 0 1 1 0 1. RP 0 10 4 1001 0. 0. 10. 30. EN necpp-1.5.0+cvs20101003/test_data/example6.nec0000644000175000017500000000066510310210764017063 0ustar numanumaCECYLINDER WITH ATTACHED WIRES SP 0 0 10 0 7.3333 0. 0. 38.4 SP 0 0 10 0 0. 0. 0. 38.4 SP 0 0 10 0 -7.3333 0. 0. 38.4 GM 0 1 0. 0. 30. SP 0 0 6.89 0. 11. 90. 0. 44.88 SP 0 0 6.89 0. -11. -90. 0. 44.88 GR 0 6 SP 0 0 0. 0. 11. 90. 0. 44.89 SP 0 0 0. 0. -11. -90. 0. 44.89 GW 1 4 0. 0. 11. 0. 0. 23. .1 GW 2 5 10. 0. 0. 27.6 0. 0. .2 GS 0 0 .01 GE FR 0 1 0 0 465.84 CP 1 1 2 1 EX 0 1 1 0 1. RP 0 73 1 1000 0. 0. 5. 0. EX 0 2 1 0 1. XQ EN necpp-1.5.0+cvs20101003/test_data/sommerfeld2.nec0000644000175000017500000000110010310210764017542 0ustar numanumaCM B-ant.: vertical CE GW 1,15,0.,0.,9.91937,0.,0.,9.17074,.00103 GW 2,25,0.,0.,9.17074,.74863,0.,9.91937,.00103 GW 3,25,.74863,0.,9.91937,0.,0.,10.668,.00103 GW 4,25,0.,0.,10.668,.74863,0.,11.4166,.00103 GW 5,25,.74863,0.,11.4166,0.,0.,12.1652,.00103 GW 6,15,0.,0.,12.1652,0.,0.,11.4166,.00103 GE 1 LD 5,1,0,0,5.7471E+7,1. LD 5,2,0,0,5.7471E+7,1. LD 5,3,0,0,5.7471E+7,1. LD 5,4,0,0,5.7471E+7,1. LD 5,5,0,0,5.7471E+7,1. LD 5,6,0,0,5.7471E+7,1. FR 0,1,0,0,28.5 GN 2,0,0,0,13.,.005 EX 0,3,25,0,.707107,0. EX 0,4,1,0,.707107,0. RP 0,181,1,1000,90.,0.,-1.,0.,0. EN necpp-1.5.0+cvs20101003/test_data/example1.nec0000644000175000017500000000024711130554610017054 0ustar numanumaCE EXAMPLE 1. CENTER FED LINEAR ANTENNA GW 0 7 0. 0. -.25 0. 0. .25 .001 GE EX 0 0 4 0 1. XQ LD 0 0 4 4 10. 3.000E-09 5.300E-11 PQ NE 0 1 1 15 .001 0 0 0. 0. .01786 ENnecpp-1.5.0+cvs20101003/test_data/hang.nec0000644000175000017500000000166111042612677016270 0ustar numanumaCM GA - NEC FILE CE GW 1 120 0 0 0 0.04749999940395 -0.02979999966919 0.1228000000119 0.001 GW 0 160 0.04749999940395 -0.02979999966919 0.1228000000119 0.09369999915361 0.09889999777078 0.006000000052154 0.001 GW 0 178 0.09369999915361 0.09889999777078 0.006000000052154 -0.0388000011444 -0.02030000090599 0.09640000015497 0.001 GW 0 76 -0.0388000011444 -0.02030000090599 0.09640000015497 -0.06069999933242 0.02470000088214 0.02830000035464 0.001 GW 0 58 -0.06069999933242 0.02470000088214 0.02830000035464 -0.02329999953508 -0.006899999920278 0.07109999656677 0.001 GW 0 142 -0.02329999953508 -0.006899999920278 0.07109999656677 0.0798000022768 -0.1207800060510 0.1158000007271 0.001 GW 0 142 0.0798000022768 -0.1207800060510 0.1158000007271 -0.02329999953508 -0.006880000233650 0.07109999656677 0.001 GE 1 GN 1 0 0 0 0 0 0 0 0 0 FR 0 1 0 0 1600 0 EX 0 1 1 0 1 0 0 0 0 0 RP 0 33 36 1011 -80 0 5 5 0 0 necpp-1.5.0+cvs20101003/test_data/patch_999.nec0000644000175000017500000001354411117072137017061 0ustar numanumaCM Test that fails producing -999 for all gains CE GW 1 3 5 -5 1 2.5 -5 1 0.05 GW 2 3 2.5 -5 1 0.0 -5 1 0.05 GW 3 3 0.0 -5 1 -2.5 -5 1 0.05 GW 4 3 -2.5 -5 1 -5 -5 1 0.05 GW 5 3 -5 -5 1 -5 -2.5 1 0.05 GW 6 3 -5 -2.5 1 -5 -0.0 1 0.05 GW 7 3 -5 -0.0 1 -5 2.5 1 0.05 GW 8 3 -5 2.5 1 -5 5 1 0.05 GW 9 3 -5 5 1 -2.5 5 1 0.05 GW 10 3 -2.5 5 1 -0.0 5 1 0.05 GW 11 3 -0.0 5 1 2.5 5 1 0.05 GW 12 3 2.5 5 1 5 5 1 0.05 GW 13 3 5 5 1 5 2.5 1 0.05 GW 14 3 5 2.5 1 5 0.0 1 0.05 GW 15 3 5 0.0 1 5 -2.5 1 0.05 GW 16 3 5 -2.5 1 5 -5 1 0.05 GW 17 3 1.372061 -2.8032 1 2.5 -5 1 0.05 GW 18 3 2.5 -5 1 0.0 -5 1 0.05 GW 19 3 1.372061 -2.8032 1 0.0 -5 1 0.05 GW 20 3 -3.06799 -1.28291 1 -5 -2.5 1 0.05 GW 21 3 -5 -2.5 1 -5 -0.0 1 0.05 GW 22 3 -3.06799 -1.28291 1 -5 -0.0 1 0.05 GW 23 3 2.67467 1.212 1 5 2.5 1 0.05 GW 24 3 5 2.5 1 5 0.0 1 0.05 GW 25 3 2.67467 1.212 1 5 0.0 1 0.05 GW 26 3 -1.5722 3.27474 1 -2.5 5 1 0.05 GW 27 3 -2.5 5 1 -0.0 5 1 0.05 GW 28 3 -1.5722 3.27474 1 -0.0 5 1 0.05 GW 29 3 -3.06799 -1.28291 1 -5 -0.0 1 0.05 GW 30 3 -5 -0.0 1 -2.24099 1.2168 1 0.05 GW 31 3 -3.06799 -1.28291 1 -2.24099 1.2168 1 0.05 GW 32 3 -1.5722 3.27474 1 -0.0 5 1 0.05 GW 33 3 -0.0 5 1 0.2859 2.3404 1 0.05 GW 34 3 -1.5722 3.27474 1 0.2859 2.3404 1 0.05 GW 35 3 -1.5722 3.27474 1 0.2859 2.3404 1 0.05 GW 36 3 0.2859 2.3404 1 -2.24099 1.2168 1 0.05 GW 37 3 -1.5722 3.27474 1 -2.24099 1.2168 1 0.05 GW 38 3 1.372061 -2.8032 1 0.0 -5 1 0.05 GW 39 3 0.0 -5 1 -0.6952 -2.3697 1 0.05 GW 40 3 1.372061 -2.8032 1 -0.6952 -2.3697 1 0.05 GW 41 3 2.67467 1.212 1 5 0.0 1 0.05 GW 42 3 5 0.0 1 2.9207 -1.1876 1 0.05 GW 43 3 2.67467 1.212 1 2.9207 -1.1876 1 0.05 GW 44 3 -2.24099 1.2168 1 -5 -0.0 1 0.05 GW 45 3 -5 -0.0 1 -5 2.5 1 0.05 GW 46 3 -2.24099 1.2168 1 -5 2.5 1 0.05 GW 47 3 -0.6952 -2.3697 1 0.0 -5 1 0.05 GW 48 3 0.0 -5 1 -2.5 -5 1 0.05 GW 49 3 -0.6952 -2.3697 1 -2.5 -5 1 0.05 GW 50 3 2.9207 -1.1876 1 5 0.0 1 0.05 GW 51 3 5 0.0 1 5 -2.5 1 0.05 GW 52 3 2.9207 -1.1876 1 5 -2.5 1 0.05 GW 53 3 -2.5 5 1 -3.2814 3.3521 1 0.05 GW 54 3 -3.2814 3.3521 1 -5 5 1 0.05 GW 55 3 -2.5 5 1 -5 5 1 0.05 GW 56 3 -3.2814 3.3521 1 -5 2.5 1 0.05 GW 57 3 -5 2.5 1 -5 5 1 0.05 GW 58 3 -3.2814 3.3521 1 -5 5 1 0.05 GW 59 3 -3.2814 3.3521 1 -2.5 5 1 0.05 GW 60 3 -2.5 5 1 -1.5722 3.27474 1 0.05 GW 61 3 -3.2814 3.3521 1 -1.5722 3.27474 1 0.05 GW 62 3 2.5 -5 1 3.2516 -3.3556 1 0.05 GW 63 3 3.2516 -3.3556 1 5 -5 1 0.05 GW 64 3 2.5 -5 1 5 -5 1 0.05 GW 65 3 3.2516 -3.3556 1 5 -2.5 1 0.05 GW 66 3 5 -2.5 1 5 -5 1 0.05 GW 67 3 3.2516 -3.3556 1 5 -5 1 0.05 GW 68 3 3.2516 -3.3556 1 2.5 -5 1 0.05 GW 69 3 2.5 -5 1 1.372061 -2.8032 1 0.05 GW 70 3 3.2516 -3.3556 1 1.372061 -2.8032 1 0.05 GW 71 3 -3.3636 -3.2683 1 -2.5 -5 1 0.05 GW 72 3 -2.5 -5 1 -5 -5 1 0.05 GW 73 3 -3.3636 -3.2683 1 -5 -5 1 0.05 GW 74 3 -3.3636 -3.2683 1 -5 -2.5 1 0.05 GW 75 3 -5 -2.5 1 -3.06799 -1.28291 1 0.05 GW 76 3 -3.3636 -3.2683 1 -3.06799 -1.28291 1 0.05 GW 77 3 -5 -2.5 1 -3.3636 -3.2683 1 0.05 GW 78 3 -3.3636 -3.2683 1 -5 -5 1 0.05 GW 79 3 -5 -2.5 1 -5 -5 1 0.05 GW 80 3 -3.2814 3.3521 1 -2.24099 1.2168 1 0.05 GW 81 3 -2.24099 1.2168 1 -5 2.5 1 0.05 GW 82 3 -3.2814 3.3521 1 -5 2.5 1 0.05 GW 83 3 -1.5722 3.27474 1 -2.24099 1.2168 1 0.05 GW 84 3 -2.24099 1.2168 1 -3.2814 3.3521 1 0.05 GW 85 3 -1.5722 3.27474 1 -3.2814 3.3521 1 0.05 GW 86 3 -3.3636 -3.2683 1 -0.6952 -2.3697 1 0.05 GW 87 3 -0.6952 -2.3697 1 -2.5 -5 1 0.05 GW 88 3 -3.3636 -3.2683 1 -2.5 -5 1 0.05 GW 89 3 -3.06799 -1.28291 1 -0.6952 -2.3697 1 0.05 GW 90 3 -0.6952 -2.3697 1 -3.3636 -3.2683 1 0.05 GW 91 3 -3.06799 -1.28291 1 -3.3636 -3.2683 1 0.05 GW 92 3 3.2516 -3.3556 1 2.9207 -1.1876 1 0.05 GW 93 3 2.9207 -1.1876 1 5 -2.5 1 0.05 GW 94 3 3.2516 -3.3556 1 5 -2.5 1 0.05 GW 95 3 1.372061 -2.8032 1 2.9207 -1.1876 1 0.05 GW 96 3 2.9207 -1.1876 1 3.2516 -3.3556 1 0.05 GW 97 3 1.372061 -2.8032 1 3.2516 -3.3556 1 0.05 GW 98 3 2.9207 -1.1876 1 0.2553 0.0937 1 0.05 GW 99 3 0.2553 0.0937 1 2.67467 1.212 1 0.05 GW 100 3 2.9207 -1.1876 1 2.67467 1.212 1 0.05 GW 101 3 0.2553 0.0937 1 0.2859 2.3404 1 0.05 GW 102 3 0.2859 2.3404 1 2.67467 1.212 1 0.05 GW 103 3 0.2553 0.0937 1 2.67467 1.212 1 0.05 GW 104 3 -1.4372 -0.5855 1 -0.6952 -2.3697 1 0.05 GW 105 3 -0.6952 -2.3697 1 -3.06799 -1.28291 1 0.05 GW 106 3 -1.4372 -0.5855 1 -3.06799 -1.28291 1 0.05 GW 107 3 -2.24099 1.2168 1 -1.4372 -0.5855 1 0.05 GW 108 3 -1.4372 -0.5855 1 -3.06799 -1.28291 1 0.05 GW 109 3 -2.24099 1.2168 1 -3.06799 -1.28291 1 0.05 GW 110 3 -2.24099 1.2168 1 0.2859 2.3404 1 0.05 GW 111 3 0.2859 2.3404 1 0.2553 0.0937 1 0.05 GW 112 3 -2.24099 1.2168 1 0.2553 0.0937 1 0.05 GW 113 3 -1.4372 -0.5855 1 -2.24099 1.2168 1 0.05 GW 114 3 -2.24099 1.2168 1 0.2553 0.0937 1 0.05 GW 115 3 -1.4372 -0.5855 1 0.2553 0.0937 1 0.05 GW 116 3 -0.6952 -2.3697 1 -1.4372 -0.5855 1 0.05 GW 117 3 -1.4372 -0.5855 1 0.2553 0.0937 1 0.05 GW 118 3 -0.6952 -2.3697 1 0.2553 0.0937 1 0.05 GW 119 3 0.2553 0.0937 1 1.372061 -2.8032 1 0.05 GW 120 3 1.372061 -2.8032 1 -0.6952 -2.3697 1 0.05 GW 121 3 0.2553 0.0937 1 -0.6952 -2.3697 1 0.05 GW 122 3 2.9207 -1.1876 1 1.372061 -2.8032 1 0.05 GW 123 3 1.372061 -2.8032 1 0.2553 0.0937 1 0.05 GW 124 3 2.9207 -1.1876 1 0.2553 0.0937 1 0.05 GW 125 3 2.5768 3.5101 1 2.67467 1.212 1 0.05 GW 126 3 2.67467 1.212 1 0.2859 2.3404 1 0.05 GW 127 3 2.5768 3.5101 1 0.2859 2.3404 1 0.05 GW 128 3 2.5768 3.5101 1 -0.0 5 1 0.05 GW 129 3 -0.0 5 1 2.5 5 1 0.05 GW 130 3 2.5768 3.5101 1 2.5 5 1 0.05 GW 131 3 0.2859 2.3404 1 -0.0 5 1 0.05 GW 132 3 -0.0 5 1 2.5768 3.5101 1 0.05 GW 133 3 0.2859 2.3404 1 2.5768 3.5101 1 0.05 GW 134 3 5 2.5 1 2.5768 3.5101 1 0.05 GW 135 3 2.5768 3.5101 1 5 5 1 0.05 GW 136 3 5 2.5 1 5 5 1 0.05 GW 137 3 2.5768 3.5101 1 5 2.5 1 0.05 GW 138 3 5 2.5 1 2.67467 1.212 1 0.05 GW 139 3 2.5768 3.5101 1 2.67467 1.212 1 0.05 GW 140 3 2.5768 3.5101 1 2.5 5 1 0.05 GW 141 3 2.5 5 1 5 5 1 0.05 GW 142 3 2.5768 3.5101 1 5 5 1 0.05 GW 143 3 5.0 5.0 0.25 5 5 1.0 0.05 GS 0 0 0.01 GE 1 GN 1 EX 0 143 1 0 0 0 0 0 0 FR 0 0 0 0 2400 0 0 0 0 RP 0 10 7 1000 0 0 10 60 0 0 EN necpp-1.5.0+cvs20101003/test_data/GA487.nec0000644000175000017500000000021510310210764016063 0ustar numanumaCM GA - NEC FILE CE go blue ! GW 0 2 0 0 0 0.019 0.0266 0.0034 0.001 GE 1 FR 0 1 0 0 2400 EX 0 0 5 0 1. GN 1 RP 0 360 360 0500 0 0 10 10 EN necpp-1.5.0+cvs20101003/test_data/plet_helixumts.nec0000644000175000017500000012166710310210764020416 0ustar numanumaCM Length L in mtr. = .644 CM Radius R1 in cm. = 2.275 CM Radius R2 in cm. = 2.275 CM Number of turns = 20 CM Segments per turn = 20 CM Rotate X, Y, Z = 0, 0, 0 CM Move X, Y, Z = 0, 0, 0 CM Start angle A1 = 0 CM Stop angle A2 = 360 CM Nr radial wires = 18 CM Nr circular wires = 10 CM Rotate X, Y, Z = 0, 0, 0 CM Move X, Y, Z = 0, 0, 0 CE GW 10 1 -.018405 .013372 .01288 -.021637 .00703 .01449 1.e-3 GW 11 1 -.021637 .00703 .01449 -.02275 .0 .0161 1.e-3 GW 12 1 -.02275 .0 .0161 -.021637 -.00703 .01771 1.e-3 GW 13 1 -.021637 -.00703 .01771 -.018405 -.013372 .01932 1.e-3 GW 14 1 -.018405 -.013372 .01932 -.013372 -.018405 .02093 1.e-3 GW 15 1 -.013372 -.018405 .02093 -.00703 -.021637 .02254 1.e-3 GW 16 1 -.00703 -.021637 .02254 .0 -.02275 .02415 1.e-3 GW 17 1 .0 -.02275 .02415 .00703 -.021637 .02576 1.e-3 GW 18 1 .00703 -.021637 .02576 .013372 -.018405 .02737 1.e-3 GW 19 1 .013372 -.018405 .02737 .018405 -.013372 .02898 1.e-3 GW 20 1 .018405 -.013372 .02898 .021637 -.00703 .03059 1.e-3 GW 21 1 .021637 -.00703 .03059 .02275 .0 .0322 1.e-3 GW 22 1 .02275 .0 .0322 .021637 .00703 .03381 1.e-3 GW 23 1 .021637 .00703 .03381 .018405 .013372 .03542 1.e-3 GW 24 1 .018405 .013372 .03542 .013372 .018405 .03703 1.e-3 GW 25 1 .013372 .018405 .03703 .00703 .021637 .03864 1.e-3 GW 26 1 .00703 .021637 .03864 .0 .02275 .04025 1.e-3 GW 27 1 .0 .02275 .04025 -.00703 .021637 .04186 1.e-3 GW 28 1 -.00703 .021637 .04186 -.013372 .018405 .04347 1.e-3 GW 29 1 -.013372 .018405 .04347 -.018405 .013372 .04508 1.e-3 GW 30 1 -.018405 .013372 .04508 -.021637 .00703 .04669 1.e-3 GW 31 1 -.021637 .00703 .04669 -.02275 .0 .0483 1.e-3 GW 32 1 -.02275 .0 .0483 -.021637 -.00703 .04991 1.e-3 GW 33 1 -.021637 -.00703 .04991 -.018405 -.013372 .05152 1.e-3 GW 34 1 -.018405 -.013372 .05152 -.013372 -.018405 .05313 1.e-3 GW 35 1 -.013372 -.018405 .05313 -.00703 -.021637 .05474 1.e-3 GW 36 1 -.00703 -.021637 .05474 .0 -.02275 .05635 1.e-3 GW 37 1 .0 -.02275 .05635 .00703 -.021637 .05796 1.e-3 GW 38 1 .00703 -.021637 .05796 .013372 -.018405 .05957 1.e-3 GW 39 1 .013372 -.018405 .05957 .018405 -.013372 .06118 1.e-3 GW 40 1 .018405 -.013372 .06118 .021637 -.00703 .06279 1.e-3 GW 41 1 .021637 -.00703 .06279 .02275 .0 .0644 1.e-3 GW 42 1 .02275 .0 .0644 .021637 .00703 .06601 1.e-3 GW 43 1 .021637 .00703 .06601 .018405 .013372 .06762 1.e-3 GW 44 1 .018405 .013372 .06762 .013372 .018405 .06923 1.e-3 GW 45 1 .013372 .018405 .06923 .00703 .021637 .07084 1.e-3 GW 46 1 .00703 .021637 .07084 .0 .02275 .07245 1.e-3 GW 47 1 .0 .02275 .07245 -.00703 .021637 .07406 1.e-3 GW 48 1 -.00703 .021637 .07406 -.013372 .018405 .07567 1.e-3 GW 49 1 -.013372 .018405 .07567 -.018405 .013372 .07728 1.e-3 GW 50 1 -.018405 .013372 .07728 -.021637 .00703 .07889 1.e-3 GW 51 1 -.021637 .00703 .07889 -.02275 .0 .0805 1.e-3 GW 52 1 -.02275 .0 .0805 -.021637 -.00703 .08211 1.e-3 GW 53 1 -.021637 -.00703 .08211 -.018405 -.013372 .08372 1.e-3 GW 54 1 -.018405 -.013372 .08372 -.013372 -.018405 .08533 1.e-3 GW 55 1 -.013372 -.018405 .08533 -.00703 -.021637 .08694 1.e-3 GW 56 1 -.00703 -.021637 .08694 .0 -.02275 .08855 1.e-3 GW 57 1 .0 -.02275 .08855 .00703 -.021637 .09016 1.e-3 GW 58 1 .00703 -.021637 .09016 .013372 -.018405 .09177 1.e-3 GW 59 1 .013372 -.018405 .09177 .018405 -.013372 .09338 1.e-3 GW 60 1 .018405 -.013372 .09338 .021637 -.00703 .09499 1.e-3 GW 61 1 .021637 -.00703 .09499 .02275 .0 .0966 1.e-3 GW 62 1 .02275 .0 .0966 .021637 .00703 .09821 1.e-3 GW 63 1 .021637 .00703 .09821 .018405 .013372 .09982 1.e-3 GW 64 1 .018405 .013372 .09982 .013372 .018405 .10143 1.e-3 GW 65 1 .013372 .018405 .10143 .00703 .021637 .10304 1.e-3 GW 66 1 .00703 .021637 .10304 .0 .02275 .10465 1.e-3 GW 67 1 .0 .02275 .10465 -.00703 .021637 .10626 1.e-3 GW 68 1 -.00703 .021637 .10626 -.013372 .018405 .10787 1.e-3 GW 69 1 -.013372 .018405 .10787 -.018405 .013372 .10948 1.e-3 GW 70 1 -.018405 .013372 .10948 -.021637 .00703 .11109 1.e-3 GW 71 1 -.021637 .00703 .11109 -.02275 .0 .1127 1.e-3 GW 72 1 -.02275 .0 .1127 -.021637 -.00703 .11431 1.e-3 GW 73 1 -.021637 -.00703 .11431 -.018405 -.013372 .11592 1.e-3 GW 74 1 -.018405 -.013372 .11592 -.013372 -.018405 .11753 1.e-3 GW 75 1 -.013372 -.018405 .11753 -.00703 -.021637 .11914 1.e-3 GW 76 1 -.00703 -.021637 .11914 .0 -.02275 .12075 1.e-3 GW 77 1 .0 -.02275 .12075 .00703 -.021637 .12236 1.e-3 GW 78 1 .00703 -.021637 .12236 .013372 -.018405 .12397 1.e-3 GW 79 1 .013372 -.018405 .12397 .018405 -.013372 .12558 1.e-3 GW 80 1 .018405 -.013372 .12558 .021637 -.00703 .12719 1.e-3 GW 81 1 .021637 -.00703 .12719 .02275 .0 .1288 1.e-3 GW 82 1 .02275 .0 .1288 .021637 .00703 .13041 1.e-3 GW 83 1 .021637 .00703 .13041 .018405 .013372 .13202 1.e-3 GW 84 1 .018405 .013372 .13202 .013372 .018405 .13363 1.e-3 GW 85 1 .013372 .018405 .13363 .00703 .021637 .13524 1.e-3 GW 86 1 .00703 .021637 .13524 .0 .02275 .13685 1.e-3 GW 87 1 .0 .02275 .13685 -.00703 .021637 .13846 1.e-3 GW 88 1 -.00703 .021637 .13846 -.013372 .018405 .14007 1.e-3 GW 89 1 -.013372 .018405 .14007 -.018405 .013372 .14168 1.e-3 GW 90 1 -.018405 .013372 .14168 -.021637 .00703 .14329 1.e-3 GW 91 1 -.021637 .00703 .14329 -.02275 .0 .1449 1.e-3 GW 92 1 -.02275 .0 .1449 -.021637 -.00703 .14651 1.e-3 GW 93 1 -.021637 -.00703 .14651 -.018405 -.013372 .14812 1.e-3 GW 94 1 -.018405 -.013372 .14812 -.013372 -.018405 .14973 1.e-3 GW 95 1 -.013372 -.018405 .14973 -.00703 -.021637 .15134 1.e-3 GW 96 1 -.00703 -.021637 .15134 .0 -.02275 .15295 1.e-3 GW 97 1 .0 -.02275 .15295 .00703 -.021637 .15456 1.e-3 GW 98 1 .00703 -.021637 .15456 .013372 -.018405 .15617 1.e-3 GW 99 1 .013372 -.018405 .15617 .018405 -.013372 .15778 1.e-3 GW 100 1 .018405 -.013372 .15778 .021637 -.00703 .15939 1.e-3 GW 101 1 .021637 -.00703 .15939 .02275 .0 .161 1.e-3 GW 102 1 .02275 .0 .161 .021637 .00703 .16261 1.e-3 GW 103 1 .021637 .00703 .16261 .018405 .013372 .16422 1.e-3 GW 104 1 .018405 .013372 .16422 .013372 .018405 .16583 1.e-3 GW 105 1 .013372 .018405 .16583 .00703 .021637 .16744 1.e-3 GW 106 1 .00703 .021637 .16744 .0 .02275 .16905 1.e-3 GW 107 1 .0 .02275 .16905 -.00703 .021637 .17066 1.e-3 GW 108 1 -.00703 .021637 .17066 -.013372 .018405 .17227 1.e-3 GW 109 1 -.013372 .018405 .17227 -.018405 .013372 .17388 1.e-3 GW 110 1 -.018405 .013372 .17388 -.021637 .00703 .17549 1.e-3 GW 111 1 -.021637 .00703 .17549 -.02275 .0 .1771 1.e-3 GW 112 1 -.02275 .0 .1771 -.021637 -.00703 .17871 1.e-3 GW 113 1 -.021637 -.00703 .17871 -.018405 -.013372 .18032 1.e-3 GW 114 1 -.018405 -.013372 .18032 -.013372 -.018405 .18193 1.e-3 GW 115 1 -.013372 -.018405 .18193 -.00703 -.021637 .18354 1.e-3 GW 116 1 -.00703 -.021637 .18354 .0 -.02275 .18515 1.e-3 GW 117 1 .0 -.02275 .18515 .00703 -.021637 .18676 1.e-3 GW 118 1 .00703 -.021637 .18676 .013372 -.018405 .18837 1.e-3 GW 119 1 .013372 -.018405 .18837 .018405 -.013372 .18998 1.e-3 GW 120 1 .018405 -.013372 .18998 .021637 -.00703 .19159 1.e-3 GW 121 1 .021637 -.00703 .19159 .02275 .0 .1932 1.e-3 GW 122 1 .02275 .0 .1932 .021637 .00703 .19481 1.e-3 GW 123 1 .021637 .00703 .19481 .018405 .013372 .19642 1.e-3 GW 124 1 .018405 .013372 .19642 .013372 .018405 .19803 1.e-3 GW 125 1 .013372 .018405 .19803 .00703 .021637 .19964 1.e-3 GW 126 1 .00703 .021637 .19964 .0 .02275 .20125 1.e-3 GW 127 1 .0 .02275 .20125 -.00703 .021637 .20286 1.e-3 GW 128 1 -.00703 .021637 .20286 -.013372 .018405 .20447 1.e-3 GW 129 1 -.013372 .018405 .20447 -.018405 .013372 .20608 1.e-3 GW 130 1 -.018405 .013372 .20608 -.021637 .00703 .20769 1.e-3 GW 131 1 -.021637 .00703 .20769 -.02275 .0 .2093 1.e-3 GW 132 1 -.02275 .0 .2093 -.021637 -.00703 .21091 1.e-3 GW 133 1 -.021637 -.00703 .21091 -.018405 -.013372 .21252 1.e-3 GW 134 1 -.018405 -.013372 .21252 -.013372 -.018405 .21413 1.e-3 GW 135 1 -.013372 -.018405 .21413 -.00703 -.021637 .21574 1.e-3 GW 136 1 -.00703 -.021637 .21574 .0 -.02275 .21735 1.e-3 GW 137 1 .0 -.02275 .21735 .00703 -.021637 .21896 1.e-3 GW 138 1 .00703 -.021637 .21896 .013372 -.018405 .22057 1.e-3 GW 139 1 .013372 -.018405 .22057 .018405 -.013372 .22218 1.e-3 GW 140 1 .018405 -.013372 .22218 .021637 -.00703 .22379 1.e-3 GW 141 1 .021637 -.00703 .22379 .02275 .0 .2254 1.e-3 GW 142 1 .02275 .0 .2254 .021637 .00703 .22701 1.e-3 GW 143 1 .021637 .00703 .22701 .018405 .013372 .22862 1.e-3 GW 144 1 .018405 .013372 .22862 .013372 .018405 .23023 1.e-3 GW 145 1 .013372 .018405 .23023 .00703 .021637 .23184 1.e-3 GW 146 1 .00703 .021637 .23184 .0 .02275 .23345 1.e-3 GW 147 1 .0 .02275 .23345 -.00703 .021637 .23506 1.e-3 GW 148 1 -.00703 .021637 .23506 -.013372 .018405 .23667 1.e-3 GW 149 1 -.013372 .018405 .23667 -.018405 .013372 .23828 1.e-3 GW 150 1 -.018405 .013372 .23828 -.021637 .00703 .23989 1.e-3 GW 151 1 -.021637 .00703 .23989 -.02275 .0 .2415 1.e-3 GW 152 1 -.02275 .0 .2415 -.021637 -.00703 .24311 1.e-3 GW 153 1 -.021637 -.00703 .24311 -.018405 -.013372 .24472 1.e-3 GW 154 1 -.018405 -.013372 .24472 -.013372 -.018405 .24633 1.e-3 GW 155 1 -.013372 -.018405 .24633 -.00703 -.021637 .24794 1.e-3 GW 156 1 -.00703 -.021637 .24794 .0 -.02275 .24955 1.e-3 GW 157 1 .0 -.02275 .24955 .00703 -.021637 .25116 1.e-3 GW 158 1 .00703 -.021637 .25116 .013372 -.018405 .25277 1.e-3 GW 159 1 .013372 -.018405 .25277 .018405 -.013372 .25438 1.e-3 GW 160 1 .018405 -.013372 .25438 .021637 -.00703 .25599 1.e-3 GW 161 1 .021637 -.00703 .25599 .02275 .0 .2576 1.e-3 GW 162 1 .02275 .0 .2576 .021637 .00703 .25921 1.e-3 GW 163 1 .021637 .00703 .25921 .018405 .013372 .26082 1.e-3 GW 164 1 .018405 .013372 .26082 .013372 .018405 .26243 1.e-3 GW 165 1 .013372 .018405 .26243 .00703 .021637 .26404 1.e-3 GW 166 1 .00703 .021637 .26404 .0 .02275 .26565 1.e-3 GW 167 1 .0 .02275 .26565 -.00703 .021637 .26726 1.e-3 GW 168 1 -.00703 .021637 .26726 -.013372 .018405 .26887 1.e-3 GW 169 1 -.013372 .018405 .26887 -.018405 .013372 .27048 1.e-3 GW 170 1 -.018405 .013372 .27048 -.021637 .00703 .27209 1.e-3 GW 171 1 -.021637 .00703 .27209 -.02275 .0 .2737 1.e-3 GW 172 1 -.02275 .0 .2737 -.021637 -.00703 .27531 1.e-3 GW 173 1 -.021637 -.00703 .27531 -.018405 -.013372 .27692 1.e-3 GW 174 1 -.018405 -.013372 .27692 -.013372 -.018405 .27853 1.e-3 GW 175 1 -.013372 -.018405 .27853 -.00703 -.021637 .28014 1.e-3 GW 176 1 -.00703 -.021637 .28014 .0 -.02275 .28175 1.e-3 GW 177 1 .0 -.02275 .28175 .00703 -.021637 .28336 1.e-3 GW 178 1 .00703 -.021637 .28336 .013372 -.018405 .28497 1.e-3 GW 179 1 .013372 -.018405 .28497 .018405 -.013372 .28658 1.e-3 GW 180 1 .018405 -.013372 .28658 .021637 -.00703 .28819 1.e-3 GW 181 1 .021637 -.00703 .28819 .02275 .0 .2898 1.e-3 GW 182 1 .02275 .0 .2898 .021637 .00703 .29141 1.e-3 GW 183 1 .021637 .00703 .29141 .018405 .013372 .29302 1.e-3 GW 184 1 .018405 .013372 .29302 .013372 .018405 .29463 1.e-3 GW 185 1 .013372 .018405 .29463 .00703 .021637 .29624 1.e-3 GW 186 1 .00703 .021637 .29624 .0 .02275 .29785 1.e-3 GW 187 1 .0 .02275 .29785 -.00703 .021637 .29946 1.e-3 GW 188 1 -.00703 .021637 .29946 -.013372 .018405 .30107 1.e-3 GW 189 1 -.013372 .018405 .30107 -.018405 .013372 .30268 1.e-3 GW 190 1 -.018405 .013372 .30268 -.021637 .00703 .30429 1.e-3 GW 191 1 -.021637 .00703 .30429 -.02275 .0 .3059 1.e-3 GW 192 1 -.02275 .0 .3059 -.021637 -.00703 .30751 1.e-3 GW 193 1 -.021637 -.00703 .30751 -.018405 -.013372 .30912 1.e-3 GW 194 1 -.018405 -.013372 .30912 -.013372 -.018405 .31073 1.e-3 GW 195 1 -.013372 -.018405 .31073 -.00703 -.021637 .31234 1.e-3 GW 196 1 -.00703 -.021637 .31234 .0 -.02275 .31395 1.e-3 GW 197 1 .0 -.02275 .31395 .00703 -.021637 .31556 1.e-3 GW 198 1 .00703 -.021637 .31556 .013372 -.018405 .31717 1.e-3 GW 199 1 .013372 -.018405 .31717 .018405 -.013372 .31878 1.e-3 GW 200 1 .018405 -.013372 .31878 .021637 -.00703 .32039 1.e-3 GW 201 1 .021637 -.00703 .32039 .02275 .0 .322 1.e-3 GW 202 1 .02275 .0 .322 .021637 .00703 .32361 1.e-3 GW 203 1 .021637 .00703 .32361 .018405 .013372 .32522 1.e-3 GW 204 1 .018405 .013372 .32522 .013372 .018405 .32683 1.e-3 GW 205 1 .013372 .018405 .32683 .00703 .021637 .32844 1.e-3 GW 206 1 .00703 .021637 .32844 .0 .02275 .33005 1.e-3 GW 207 1 .0 .02275 .33005 -.00703 .021637 .33166 1.e-3 GW 208 1 -.00703 .021637 .33166 -.013372 .018405 .33327 1.e-3 GW 209 1 -.013372 .018405 .33327 -.018405 .013372 .33488 1.e-3 GW 210 1 -.018405 .013372 .33488 -.021637 .00703 .33649 1.e-3 GW 211 1 -.021637 .00703 .33649 -.02275 .0 .3381 1.e-3 GW 212 1 -.02275 .0 .3381 -.021637 -.00703 .33971 1.e-3 GW 213 1 -.021637 -.00703 .33971 -.018405 -.013372 .34132 1.e-3 GW 214 1 -.018405 -.013372 .34132 -.013372 -.018405 .34293 1.e-3 GW 215 1 -.013372 -.018405 .34293 -.00703 -.021637 .34454 1.e-3 GW 216 1 -.00703 -.021637 .34454 .0 -.02275 .34615 1.e-3 GW 217 1 .0 -.02275 .34615 .00703 -.021637 .34776 1.e-3 GW 218 1 .00703 -.021637 .34776 .013372 -.018405 .34937 1.e-3 GW 219 1 .013372 -.018405 .34937 .018405 -.013372 .35098 1.e-3 GW 220 1 .018405 -.013372 .35098 .021637 -.00703 .35259 1.e-3 GW 221 1 .021637 -.00703 .35259 .02275 .0 .3542 1.e-3 GW 222 1 .02275 .0 .3542 .021637 .00703 .35581 1.e-3 GW 223 1 .021637 .00703 .35581 .018405 .013372 .35742 1.e-3 GW 224 1 .018405 .013372 .35742 .013372 .018405 .35903 1.e-3 GW 225 1 .013372 .018405 .35903 .00703 .021637 .36064 1.e-3 GW 226 1 .00703 .021637 .36064 .0 .02275 .36225 1.e-3 GW 227 1 .0 .02275 .36225 -.00703 .021637 .36386 1.e-3 GW 228 1 -.00703 .021637 .36386 -.013372 .018405 .36547 1.e-3 GW 229 1 -.013372 .018405 .36547 -.018405 .013372 .36708 1.e-3 GW 230 1 -.018405 .013372 .36708 -.021637 .00703 .36869 1.e-3 GW 231 1 -.021637 .00703 .36869 -.02275 .0 .3703 1.e-3 GW 232 1 -.02275 .0 .3703 -.021637 -.00703 .37191 1.e-3 GW 233 1 -.021637 -.00703 .37191 -.018405 -.013372 .37352 1.e-3 GW 234 1 -.018405 -.013372 .37352 -.013372 -.018405 .37513 1.e-3 GW 235 1 -.013372 -.018405 .37513 -.00703 -.021637 .37674 1.e-3 GW 236 1 -.00703 -.021637 .37674 .0 -.02275 .37835 1.e-3 GW 237 1 .0 -.02275 .37835 .00703 -.021637 .37996 1.e-3 GW 238 1 .00703 -.021637 .37996 .013372 -.018405 .38157 1.e-3 GW 239 1 .013372 -.018405 .38157 .018405 -.013372 .38318 1.e-3 GW 240 1 .018405 -.013372 .38318 .021637 -.00703 .38479 1.e-3 GW 241 1 .021637 -.00703 .38479 .02275 .0 .3864 1.e-3 GW 242 1 .02275 .0 .3864 .021637 .00703 .38801 1.e-3 GW 243 1 .021637 .00703 .38801 .018405 .013372 .38962 1.e-3 GW 244 1 .018405 .013372 .38962 .013372 .018405 .39123 1.e-3 GW 245 1 .013372 .018405 .39123 .00703 .021637 .39284 1.e-3 GW 246 1 .00703 .021637 .39284 .0 .02275 .39445 1.e-3 GW 247 1 .0 .02275 .39445 -.00703 .021637 .39606 1.e-3 GW 248 1 -.00703 .021637 .39606 -.013372 .018405 .39767 1.e-3 GW 249 1 -.013372 .018405 .39767 -.018405 .013372 .39928 1.e-3 GW 250 1 -.018405 .013372 .39928 -.021637 .00703 .40089 1.e-3 GW 251 1 -.021637 .00703 .40089 -.02275 .0 .4025 1.e-3 GW 252 1 -.02275 .0 .4025 -.021637 -.00703 .40411 1.e-3 GW 253 1 -.021637 -.00703 .40411 -.018405 -.013372 .40572 1.e-3 GW 254 1 -.018405 -.013372 .40572 -.013372 -.018405 .40733 1.e-3 GW 255 1 -.013372 -.018405 .40733 -.00703 -.021637 .40894 1.e-3 GW 256 1 -.00703 -.021637 .40894 .0 -.02275 .41055 1.e-3 GW 257 1 .0 -.02275 .41055 .00703 -.021637 .41216 1.e-3 GW 258 1 .00703 -.021637 .41216 .013372 -.018405 .41377 1.e-3 GW 259 1 .013372 -.018405 .41377 .018405 -.013372 .41538 1.e-3 GW 260 1 .018405 -.013372 .41538 .021637 -.00703 .41699 1.e-3 GW 261 1 .021637 -.00703 .41699 .02275 .0 .4186 1.e-3 GW 262 1 .02275 .0 .4186 .021637 .00703 .42021 1.e-3 GW 263 1 .021637 .00703 .42021 .018405 .013372 .42182 1.e-3 GW 264 1 .018405 .013372 .42182 .013372 .018405 .42343 1.e-3 GW 265 1 .013372 .018405 .42343 .00703 .021637 .42504 1.e-3 GW 266 1 .00703 .021637 .42504 .0 .02275 .42665 1.e-3 GW 267 1 .0 .02275 .42665 -.00703 .021637 .42826 1.e-3 GW 268 1 -.00703 .021637 .42826 -.013372 .018405 .42987 1.e-3 GW 269 1 -.013372 .018405 .42987 -.018405 .013372 .43148 1.e-3 GW 270 1 -.018405 .013372 .43148 -.021637 .00703 .43309 1.e-3 GW 271 1 -.021637 .00703 .43309 -.02275 .0 .4347 1.e-3 GW 272 1 -.02275 .0 .4347 -.021637 -.00703 .43631 1.e-3 GW 273 1 -.021637 -.00703 .43631 -.018405 -.013372 .43792 1.e-3 GW 274 1 -.018405 -.013372 .43792 -.013372 -.018405 .43953 1.e-3 GW 275 1 -.013372 -.018405 .43953 -.00703 -.021637 .44114 1.e-3 GW 276 1 -.00703 -.021637 .44114 .0 -.02275 .44275 1.e-3 GW 277 1 .0 -.02275 .44275 .00703 -.021637 .44436 1.e-3 GW 278 1 .00703 -.021637 .44436 .013372 -.018405 .44597 1.e-3 GW 279 1 .013372 -.018405 .44597 .018405 -.013372 .44758 1.e-3 GW 280 1 .018405 -.013372 .44758 .021637 -.00703 .44919 1.e-3 GW 281 1 .021637 -.00703 .44919 .02275 .0 .4508 1.e-3 GW 282 1 .02275 .0 .4508 .021637 .00703 .45241 1.e-3 GW 283 1 .021637 .00703 .45241 .018405 .013372 .45402 1.e-3 GW 284 1 .018405 .013372 .45402 .013372 .018405 .45563 1.e-3 GW 285 1 .013372 .018405 .45563 .00703 .021637 .45724 1.e-3 GW 286 1 .00703 .021637 .45724 .0 .02275 .45885 1.e-3 GW 287 1 .0 .02275 .45885 -.00703 .021637 .46046 1.e-3 GW 288 1 -.00703 .021637 .46046 -.013372 .018405 .46207 1.e-3 GW 289 1 -.013372 .018405 .46207 -.018405 .013372 .46368 1.e-3 GW 290 1 -.018405 .013372 .46368 -.021637 .00703 .46529 1.e-3 GW 291 1 -.021637 .00703 .46529 -.02275 .0 .4669 1.e-3 GW 292 1 -.02275 .0 .4669 -.021637 -.00703 .46851 1.e-3 GW 293 1 -.021637 -.00703 .46851 -.018405 -.013372 .47012 1.e-3 GW 294 1 -.018405 -.013372 .47012 -.013372 -.018405 .47173 1.e-3 GW 295 1 -.013372 -.018405 .47173 -.00703 -.021637 .47334 1.e-3 GW 296 1 -.00703 -.021637 .47334 .0 -.02275 .47495 1.e-3 GW 297 1 .0 -.02275 .47495 .00703 -.021637 .47656 1.e-3 GW 298 1 .00703 -.021637 .47656 .013372 -.018405 .47817 1.e-3 GW 299 1 .013372 -.018405 .47817 .018405 -.013372 .47978 1.e-3 GW 300 1 .018405 -.013372 .47978 .021637 -.00703 .48139 1.e-3 GW 301 1 .021637 -.00703 .48139 .02275 .0 .483 1.e-3 GW 302 1 .02275 .0 .483 .021637 .00703 .48461 1.e-3 GW 303 1 .021637 .00703 .48461 .018405 .013372 .48622 1.e-3 GW 304 1 .018405 .013372 .48622 .013372 .018405 .48783 1.e-3 GW 305 1 .013372 .018405 .48783 .00703 .021637 .48944 1.e-3 GW 306 1 .00703 .021637 .48944 .0 .02275 .49105 1.e-3 GW 307 1 .0 .02275 .49105 -.00703 .021637 .49266 1.e-3 GW 308 1 -.00703 .021637 .49266 -.013372 .018405 .49427 1.e-3 GW 309 1 -.013372 .018405 .49427 -.018405 .013372 .49588 1.e-3 GW 310 1 -.018405 .013372 .49588 -.021637 .00703 .49749 1.e-3 GW 311 1 -.021637 .00703 .49749 -.02275 .0 .4991 1.e-3 GW 312 1 -.02275 .0 .4991 -.021637 -.00703 .50071 1.e-3 GW 313 1 -.021637 -.00703 .50071 -.018405 -.013372 .50232 1.e-3 GW 314 1 -.018405 -.013372 .50232 -.013372 -.018405 .50393 1.e-3 GW 315 1 -.013372 -.018405 .50393 -.00703 -.021637 .50554 1.e-3 GW 316 1 -.00703 -.021637 .50554 .0 -.02275 .50715 1.e-3 GW 317 1 .0 -.02275 .50715 .00703 -.021637 .50876 1.e-3 GW 318 1 .00703 -.021637 .50876 .013372 -.018405 .51037 1.e-3 GW 319 1 .013372 -.018405 .51037 .018405 -.013372 .51198 1.e-3 GW 320 1 .018405 -.013372 .51198 .021637 -.00703 .51359 1.e-3 GW 321 1 .021637 -.00703 .51359 .02275 .0 .5152 1.e-3 GW 322 1 .02275 .0 .5152 .021637 .00703 .51681 1.e-3 GW 323 1 .021637 .00703 .51681 .018405 .013372 .51842 1.e-3 GW 324 1 .018405 .013372 .51842 .013372 .018405 .52003 1.e-3 GW 325 1 .013372 .018405 .52003 .00703 .021637 .52164 1.e-3 GW 326 1 .00703 .021637 .52164 .0 .02275 .52325 1.e-3 GW 327 1 .0 .02275 .52325 -.00703 .021637 .52486 1.e-3 GW 328 1 -.00703 .021637 .52486 -.013372 .018405 .52647 1.e-3 GW 329 1 -.013372 .018405 .52647 -.018405 .013372 .52808 1.e-3 GW 330 1 -.018405 .013372 .52808 -.021637 .00703 .52969 1.e-3 GW 331 1 -.021637 .00703 .52969 -.02275 .0 .5313 1.e-3 GW 332 1 -.02275 .0 .5313 -.021637 -.00703 .53291 1.e-3 GW 333 1 -.021637 -.00703 .53291 -.018405 -.013372 .53452 1.e-3 GW 334 1 -.018405 -.013372 .53452 -.013372 -.018405 .53613 1.e-3 GW 335 1 -.013372 -.018405 .53613 -.00703 -.021637 .53774 1.e-3 GW 336 1 -.00703 -.021637 .53774 .0 -.02275 .53935 1.e-3 GW 337 1 .0 -.02275 .53935 .00703 -.021637 .54096 1.e-3 GW 338 1 .00703 -.021637 .54096 .013372 -.018405 .54257 1.e-3 GW 339 1 .013372 -.018405 .54257 .018405 -.013372 .54418 1.e-3 GW 340 1 .018405 -.013372 .54418 .021637 -.00703 .54579 1.e-3 GW 341 1 .021637 -.00703 .54579 .02275 .0 .5474 1.e-3 GW 342 1 .02275 .0 .5474 .021637 .00703 .54901 1.e-3 GW 343 1 .021637 .00703 .54901 .018405 .013372 .55062 1.e-3 GW 344 1 .018405 .013372 .55062 .013372 .018405 .55223 1.e-3 GW 345 1 .013372 .018405 .55223 .00703 .021637 .55384 1.e-3 GW 346 1 .00703 .021637 .55384 .0 .02275 .55545 1.e-3 GW 347 1 .0 .02275 .55545 -.00703 .021637 .55706 1.e-3 GW 348 1 -.00703 .021637 .55706 -.013372 .018405 .55867 1.e-3 GW 349 1 -.013372 .018405 .55867 -.018405 .013372 .56028 1.e-3 GW 350 1 -.018405 .013372 .56028 -.021637 .00703 .56189 1.e-3 GW 351 1 -.021637 .00703 .56189 -.02275 .0 .5635 1.e-3 GW 352 1 -.02275 .0 .5635 -.021637 -.00703 .56511 1.e-3 GW 353 1 -.021637 -.00703 .56511 -.018405 -.013372 .56672 1.e-3 GW 354 1 -.018405 -.013372 .56672 -.013372 -.018405 .56833 1.e-3 GW 355 1 -.013372 -.018405 .56833 -.00703 -.021637 .56994 1.e-3 GW 356 1 -.00703 -.021637 .56994 .0 -.02275 .57155 1.e-3 GW 357 1 .0 -.02275 .57155 .00703 -.021637 .57316 1.e-3 GW 358 1 .00703 -.021637 .57316 .013372 -.018405 .57477 1.e-3 GW 359 1 .013372 -.018405 .57477 .018405 -.013372 .57638 1.e-3 GW 360 1 .018405 -.013372 .57638 .021637 -.00703 .57799 1.e-3 GW 361 1 .021637 -.00703 .57799 .02275 .0 .5796 1.e-3 GW 362 1 .02275 .0 .5796 .021637 .00703 .58121 1.e-3 GW 363 1 .021637 .00703 .58121 .018405 .013372 .58282 1.e-3 GW 364 1 .018405 .013372 .58282 .013372 .018405 .58443 1.e-3 GW 365 1 .013372 .018405 .58443 .00703 .021637 .58604 1.e-3 GW 366 1 .00703 .021637 .58604 .0 .02275 .58765 1.e-3 GW 367 1 .0 .02275 .58765 -.00703 .021637 .58926 1.e-3 GW 368 1 -.00703 .021637 .58926 -.013372 .018405 .59087 1.e-3 GW 369 1 -.013372 .018405 .59087 -.018405 .013372 .59248 1.e-3 GW 370 1 -.018405 .013372 .59248 -.021637 .00703 .59409 1.e-3 GW 371 1 -.021637 .00703 .59409 -.02275 .0 .5957 1.e-3 GW 372 1 -.02275 .0 .5957 -.021637 -.00703 .59731 1.e-3 GW 373 1 -.021637 -.00703 .59731 -.018405 -.013372 .59892 1.e-3 GW 374 1 -.018405 -.013372 .59892 -.013372 -.018405 .60053 1.e-3 GW 375 1 -.013372 -.018405 .60053 -.00703 -.021637 .60214 1.e-3 GW 376 1 -.00703 -.021637 .60214 .0 -.02275 .60375 1.e-3 GW 377 1 .0 -.02275 .60375 .00703 -.021637 .60536 1.e-3 GW 378 1 .00703 -.021637 .60536 .013372 -.018405 .60697 1.e-3 GW 379 1 .013372 -.018405 .60697 .018405 -.013372 .60858 1.e-3 GW 380 1 .018405 -.013372 .60858 .021637 -.00703 .61019 1.e-3 GW 381 1 .021637 -.00703 .61019 .02275 .0 .6118 1.e-3 GW 382 1 .02275 .0 .6118 .021637 .00703 .61341 1.e-3 GW 383 1 .021637 .00703 .61341 .018405 .013372 .61502 1.e-3 GW 384 1 .018405 .013372 .61502 .013372 .018405 .61663 1.e-3 GW 385 1 .013372 .018405 .61663 .00703 .021637 .61824 1.e-3 GW 386 1 .00703 .021637 .61824 .0 .02275 .61985 1.e-3 GW 387 1 .0 .02275 .61985 -.00703 .021637 .62146 1.e-3 GW 388 1 -.00703 .021637 .62146 -.013372 .018405 .62307 1.e-3 GW 389 1 -.013372 .018405 .62307 -.018405 .013372 .62468 1.e-3 GW 390 1 -.018405 .013372 .62468 -.021637 .00703 .62629 1.e-3 GW 391 1 -.021637 .00703 .62629 -.02275 .0 .6279 1.e-3 GW 392 1 -.02275 .0 .6279 -.021637 -.00703 .62951 1.e-3 GW 393 1 -.021637 -.00703 .62951 -.018405 -.013372 .63112 1.e-3 GW 394 1 -.018405 -.013372 .63112 -.013372 -.018405 .63273 1.e-3 GW 395 1 -.013372 -.018405 .63273 -.00703 -.021637 .63434 1.e-3 GW 396 1 -.00703 -.021637 .63434 .0 -.02275 .63595 1.e-3 GW 397 1 .0 -.02275 .63595 .00703 -.021637 .63756 1.e-3 GW 398 1 .00703 -.021637 .63756 .013372 -.018405 .63917 1.e-3 GW 399 1 .013372 -.018405 .63917 .018405 -.013372 .64078 1.e-3 GW 400 1 .018405 -.013372 .64078 .021637 -.00703 .64239 1.e-3 GW 401 1 .021637 -.00703 .64239 .02275 .0 .644 1.e-3 GW 402 1 .02275 .0 .644 .0 .0 .644 1.e-3 GW 403 1 .0 .0 .0 .01 .0 .0 1.e-3 GW 404 1 .01 .0 .0 .02 .0 .0 1.e-3 GW 405 1 .02 .0 .0 .03 .0 .0 1.e-3 GW 406 1 .03 .0 .0 .04 .0 .0 1.e-3 GW 407 1 .04 .0 .0 .05 .0 .0 1.e-3 GW 408 1 .05 .0 .0 .06 .0 .0 1.e-3 GW 409 1 .06 .0 .0 .07 .0 .0 1.e-3 GW 410 1 .07 .0 .0 .08 .0 .0 1.e-3 GW 411 1 .08 .0 .0 .09 .0 .0 1.e-3 GW 412 1 .09 .0 .0 .1 .0 .0 1.e-3 GW 413 1 .0 .0 .0 .009397 .00342 .0 1.e-3 GW 414 1 .009397 .00342 .0 .018794 .00684 .0 1.e-3 GW 415 1 .018794 .00684 .0 .028191 .010261 .0 1.e-3 GW 416 1 .028191 .010261 .0 .037588 .013681 .0 1.e-3 GW 417 1 .037588 .013681 .0 .046985 .017101 .0 1.e-3 GW 418 1 .046985 .017101 .0 .056382 .020521 .0 1.e-3 GW 419 1 .056382 .020521 .0 .065778 .023941 .0 1.e-3 GW 420 1 .065778 .023941 .0 .075175 .027362 .0 1.e-3 GW 421 1 .075175 .027362 .0 .084572 .030782 .0 1.e-3 GW 422 1 .084572 .030782 .0 .093969 .034202 .0 1.e-3 GW 423 1 .0 .0 .0 .00766 .006428 .0 1.e-3 GW 424 1 .00766 .006428 .0 .015321 .012856 .0 1.e-3 GW 425 1 .015321 .012856 .0 .022981 .019284 .0 1.e-3 GW 426 1 .022981 .019284 .0 .030642 .025712 .0 1.e-3 GW 427 1 .030642 .025712 .0 .038302 .032139 .0 1.e-3 GW 428 1 .038302 .032139 .0 .045963 .038567 .0 1.e-3 GW 429 1 .045963 .038567 .0 .053623 .044995 .0 1.e-3 GW 430 1 .053623 .044995 .0 .061284 .051423 .0 1.e-3 GW 431 1 .061284 .051423 .0 .068944 .057851 .0 1.e-3 GW 432 1 .068944 .057851 .0 .076604 .064279 .0 1.e-3 GW 433 1 .0 .0 .0 .005 .00866 .0 1.e-3 GW 434 1 .005 .00866 .0 .01 .017321 .0 1.e-3 GW 435 1 .01 .017321 .0 .015 .025981 .0 1.e-3 GW 436 1 .015 .025981 .0 .02 .034641 .0 1.e-3 GW 437 1 .02 .034641 .0 .025 .043301 .0 1.e-3 GW 438 1 .025 .043301 .0 .03 .051962 .0 1.e-3 GW 439 1 .03 .051962 .0 .035 .060622 .0 1.e-3 GW 440 1 .035 .060622 .0 .04 .069282 .0 1.e-3 GW 441 1 .04 .069282 .0 .045 .077942 .0 1.e-3 GW 442 1 .045 .077942 .0 .05 .086603 .0 1.e-3 GW 443 1 .0 .0 .0 .001736 .009848 .0 1.e-3 GW 444 1 .001736 .009848 .0 .003473 .019696 .0 1.e-3 GW 445 1 .003473 .019696 .0 .005209 .029544 .0 1.e-3 GW 446 1 .005209 .029544 .0 .006946 .039392 .0 1.e-3 GW 447 1 .006946 .039392 .0 .008682 .04924 .0 1.e-3 GW 448 1 .008682 .04924 .0 .010419 .059088 .0 1.e-3 GW 449 1 .010419 .059088 .0 .012155 .068937 .0 1.e-3 GW 450 1 .012155 .068937 .0 .013892 .078785 .0 1.e-3 GW 451 1 .013892 .078785 .0 .015628 .088633 .0 1.e-3 GW 452 1 .015628 .088633 .0 .017365 .098481 .0 1.e-3 GW 453 1 .0 .0 .0 -.001736 .009848 .0 1.e-3 GW 454 1 -.001736 .009848 .0 -.003473 .019696 .0 1.e-3 GW 455 1 -.003473 .019696 .0 -.005209 .029544 .0 1.e-3 GW 456 1 -.005209 .029544 .0 -.006946 .039392 .0 1.e-3 GW 457 1 -.006946 .039392 .0 -.008682 .04924 .0 1.e-3 GW 458 1 -.008682 .04924 .0 -.010419 .059088 .0 1.e-3 GW 459 1 -.010419 .059088 .0 -.012155 .068937 .0 1.e-3 GW 460 1 -.012155 .068937 .0 -.013892 .078785 .0 1.e-3 GW 461 1 -.013892 .078785 .0 -.015628 .088633 .0 1.e-3 GW 462 1 -.015628 .088633 .0 -.017365 .098481 .0 1.e-3 GW 463 1 .0 .0 .0 -.005 .00866 .0 1.e-3 GW 464 1 -.005 .00866 .0 -.01 .017321 .0 1.e-3 GW 465 1 -.01 .017321 .0 -.015 .025981 .0 1.e-3 GW 466 1 -.015 .025981 .0 -.02 .034641 .0 1.e-3 GW 467 1 -.02 .034641 .0 -.025 .043301 .0 1.e-3 GW 468 1 -.025 .043301 .0 -.03 .051962 .0 1.e-3 GW 469 1 -.03 .051962 .0 -.035 .060622 .0 1.e-3 GW 470 1 -.035 .060622 .0 -.04 .069282 .0 1.e-3 GW 471 1 -.04 .069282 .0 -.045 .077942 .0 1.e-3 GW 472 1 -.045 .077942 .0 -.05 .086603 .0 1.e-3 GW 473 1 .0 .0 .0 -.00766 .006428 .0 1.e-3 GW 474 1 -.00766 .006428 .0 -.015321 .012856 .0 1.e-3 GW 475 1 -.015321 .012856 .0 -.022981 .019284 .0 1.e-3 GW 476 1 -.022981 .019284 .0 -.030642 .025712 .0 1.e-3 GW 477 1 -.030642 .025712 .0 -.038302 .032139 .0 1.e-3 GW 478 1 -.038302 .032139 .0 -.045963 .038567 .0 1.e-3 GW 479 1 -.045963 .038567 .0 -.053623 .044995 .0 1.e-3 GW 480 1 -.053623 .044995 .0 -.061284 .051423 .0 1.e-3 GW 481 1 -.061284 .051423 .0 -.068944 .057851 .0 1.e-3 GW 482 1 -.068944 .057851 .0 -.076604 .064279 .0 1.e-3 GW 483 1 .0 .0 .0 -.009397 .00342 .0 1.e-3 GW 484 1 -.009397 .00342 .0 -.018794 .00684 .0 1.e-3 GW 485 1 -.018794 .00684 .0 -.028191 .010261 .0 1.e-3 GW 486 1 -.028191 .010261 .0 -.037588 .013681 .0 1.e-3 GW 487 1 -.037588 .013681 .0 -.046985 .017101 .0 1.e-3 GW 488 1 -.046985 .017101 .0 -.056382 .020521 .0 1.e-3 GW 489 1 -.056382 .020521 .0 -.065778 .023941 .0 1.e-3 GW 490 1 -.065778 .023941 .0 -.075175 .027362 .0 1.e-3 GW 491 1 -.075175 .027362 .0 -.084572 .030782 .0 1.e-3 GW 492 1 -.084572 .030782 .0 -.093969 .034202 .0 1.e-3 GW 493 1 .0 .0 .0 -.01 .0 .0 1.e-3 GW 494 1 -.01 .0 .0 -.02 .0 .0 1.e-3 GW 495 1 -.02 .0 .0 -.03 .0 .0 1.e-3 GW 496 1 -.03 .0 .0 -.04 .0 .0 1.e-3 GW 497 1 -.04 .0 .0 -.05 .0 .0 1.e-3 GW 498 1 -.05 .0 .0 -.06 .0 .0 1.e-3 GW 499 1 -.06 .0 .0 -.07 .0 .0 1.e-3 GW 500 1 -.07 .0 .0 -.08 .0 .0 1.e-3 GW 501 1 -.08 .0 .0 -.09 .0 .0 1.e-3 GW 502 1 -.09 .0 .0 -.1 .0 .0 1.e-3 GW 503 1 .0 .0 .0 -.009397 -.00342 .0 1.e-3 GW 504 1 -.009397 -.00342 .0 -.018794 -.00684 .0 1.e-3 GW 505 1 -.018794 -.00684 .0 -.028191 -.010261 .0 1.e-3 GW 506 1 -.028191 -.010261 .0 -.037588 -.013681 .0 1.e-3 GW 507 1 -.037588 -.013681 .0 -.046985 -.017101 .0 1.e-3 GW 508 1 -.046985 -.017101 .0 -.056382 -.020521 .0 1.e-3 GW 509 1 -.056382 -.020521 .0 -.065778 -.023941 .0 1.e-3 GW 510 1 -.065778 -.023941 .0 -.075175 -.027362 .0 1.e-3 GW 511 1 -.075175 -.027362 .0 -.084572 -.030782 .0 1.e-3 GW 512 1 -.084572 -.030782 .0 -.093969 -.034202 .0 1.e-3 GW 513 1 .0 .0 .0 -.00766 -.006428 .0 1.e-3 GW 514 1 -.00766 -.006428 .0 -.015321 -.012856 .0 1.e-3 GW 515 1 -.015321 -.012856 .0 -.022981 -.019284 .0 1.e-3 GW 516 1 -.022981 -.019284 .0 -.030642 -.025712 .0 1.e-3 GW 517 1 -.030642 -.025712 .0 -.038302 -.032139 .0 1.e-3 GW 518 1 -.038302 -.032139 .0 -.045963 -.038567 .0 1.e-3 GW 519 1 -.045963 -.038567 .0 -.053623 -.044995 .0 1.e-3 GW 520 1 -.053623 -.044995 .0 -.061284 -.051423 .0 1.e-3 GW 521 1 -.061284 -.051423 .0 -.068944 -.057851 .0 1.e-3 GW 522 1 -.068944 -.057851 .0 -.076604 -.064279 .0 1.e-3 GW 523 1 .0 .0 .0 -.005 -.00866 .0 1.e-3 GW 524 1 -.005 -.00866 .0 -.01 -.017321 .0 1.e-3 GW 525 1 -.01 -.017321 .0 -.015 -.025981 .0 1.e-3 GW 526 1 -.015 -.025981 .0 -.02 -.034641 .0 1.e-3 GW 527 1 -.02 -.034641 .0 -.025 -.043301 .0 1.e-3 GW 528 1 -.025 -.043301 .0 -.03 -.051962 .0 1.e-3 GW 529 1 -.03 -.051962 .0 -.035 -.060622 .0 1.e-3 GW 530 1 -.035 -.060622 .0 -.04 -.069282 .0 1.e-3 GW 531 1 -.04 -.069282 .0 -.045 -.077942 .0 1.e-3 GW 532 1 -.045 -.077942 .0 -.05 -.086603 .0 1.e-3 GW 533 1 .0 .0 .0 -.001736 -.009848 .0 1.e-3 GW 534 1 -.001736 -.009848 .0 -.003473 -.019696 .0 1.e-3 GW 535 1 -.003473 -.019696 .0 -.005209 -.029544 .0 1.e-3 GW 536 1 -.005209 -.029544 .0 -.006946 -.039392 .0 1.e-3 GW 537 1 -.006946 -.039392 .0 -.008682 -.04924 .0 1.e-3 GW 538 1 -.008682 -.04924 .0 -.010419 -.059088 .0 1.e-3 GW 539 1 -.010419 -.059088 .0 -.012155 -.068937 .0 1.e-3 GW 540 1 -.012155 -.068937 .0 -.013892 -.078785 .0 1.e-3 GW 541 1 -.013892 -.078785 .0 -.015628 -.088633 .0 1.e-3 GW 542 1 -.015628 -.088633 .0 -.017365 -.098481 .0 1.e-3 GW 543 1 .0 .0 .0 .001736 -.009848 .0 1.e-3 GW 544 1 .001736 -.009848 .0 .003473 -.019696 .0 1.e-3 GW 545 1 .003473 -.019696 .0 .005209 -.029544 .0 1.e-3 GW 546 1 .005209 -.029544 .0 .006946 -.039392 .0 1.e-3 GW 547 1 .006946 -.039392 .0 .008682 -.04924 .0 1.e-3 GW 548 1 .008682 -.04924 .0 .010419 -.059088 .0 1.e-3 GW 549 1 .010419 -.059088 .0 .012155 -.068937 .0 1.e-3 GW 550 1 .012155 -.068937 .0 .013892 -.078785 .0 1.e-3 GW 551 1 .013892 -.078785 .0 .015628 -.088633 .0 1.e-3 GW 552 1 .015628 -.088633 .0 .017365 -.098481 .0 1.e-3 GW 553 1 .0 .0 .0 .005 -.00866 .0 1.e-3 GW 554 1 .005 -.00866 .0 .01 -.017321 .0 1.e-3 GW 555 1 .01 -.017321 .0 .015 -.025981 .0 1.e-3 GW 556 1 .015 -.025981 .0 .02 -.034641 .0 1.e-3 GW 557 1 .02 -.034641 .0 .025 -.043301 .0 1.e-3 GW 558 1 .025 -.043301 .0 .03 -.051962 .0 1.e-3 GW 559 1 .03 -.051962 .0 .035 -.060622 .0 1.e-3 GW 560 1 .035 -.060622 .0 .04 -.069282 .0 1.e-3 GW 561 1 .04 -.069282 .0 .045 -.077942 .0 1.e-3 GW 562 1 .045 -.077942 .0 .05 -.086603 .0 1.e-3 GW 563 1 .0 .0 .0 .00766 -.006428 .0 1.e-3 GW 564 1 .00766 -.006428 .0 .015321 -.012856 .0 1.e-3 GW 565 1 .015321 -.012856 .0 .022981 -.019284 .0 1.e-3 GW 566 1 .022981 -.019284 .0 .030642 -.025712 .0 1.e-3 GW 567 1 .030642 -.025712 .0 .038302 -.032139 .0 1.e-3 GW 568 1 .038302 -.032139 .0 .045963 -.038567 .0 1.e-3 GW 569 1 .045963 -.038567 .0 .053623 -.044995 .0 1.e-3 GW 570 1 .053623 -.044995 .0 .061284 -.051423 .0 1.e-3 GW 571 1 .061284 -.051423 .0 .068944 -.057851 .0 1.e-3 GW 572 1 .068944 -.057851 .0 .076604 -.064279 .0 1.e-3 GW 573 1 .0 .0 .0 .009397 -.00342 .0 1.e-3 GW 574 1 .009397 -.00342 .0 .018794 -.00684 .0 1.e-3 GW 575 1 .018794 -.00684 .0 .028191 -.010261 .0 1.e-3 GW 576 1 .028191 -.010261 .0 .037588 -.013681 .0 1.e-3 GW 577 1 .037588 -.013681 .0 .046985 -.017101 .0 1.e-3 GW 578 1 .046985 -.017101 .0 .056382 -.020521 .0 1.e-3 GW 579 1 .056382 -.020521 .0 .065778 -.023941 .0 1.e-3 GW 580 1 .065778 -.023941 .0 .075175 -.027362 .0 1.e-3 GW 581 1 .075175 -.027362 .0 .084572 -.030782 .0 1.e-3 GW 582 1 .084572 -.030782 .0 .093969 -.034202 .0 1.e-3 GW 583 1 .01 .0 .0 .009397 .00342 .0 1.e-3 GW 584 1 .009397 .00342 .0 .00766 .006428 .0 1.e-3 GW 585 1 .00766 .006428 .0 .005 .00866 .0 1.e-3 GW 586 1 .005 .00866 .0 .001736 .009848 .0 1.e-3 GW 587 1 .001736 .009848 .0 -.001736 .009848 .0 1.e-3 GW 588 1 -.001736 .009848 .0 -.005 .00866 .0 1.e-3 GW 589 1 -.005 .00866 .0 -.00766 .006428 .0 1.e-3 GW 590 1 -.00766 .006428 .0 -.009397 .00342 .0 1.e-3 GW 591 1 -.009397 .00342 .0 -.01 .0 .0 1.e-3 GW 592 1 -.01 .0 .0 -.009397 -.00342 .0 1.e-3 GW 593 1 -.009397 -.00342 .0 -.00766 -.006428 .0 1.e-3 GW 594 1 -.00766 -.006428 .0 -.005 -.00866 .0 1.e-3 GW 595 1 -.005 -.00866 .0 -.001736 -.009848 .0 1.e-3 GW 596 1 -.001736 -.009848 .0 .001736 -.009848 .0 1.e-3 GW 597 1 .001736 -.009848 .0 .005 -.00866 .0 1.e-3 GW 598 1 .005 -.00866 .0 .00766 -.006428 .0 1.e-3 GW 599 1 .00766 -.006428 .0 .009397 -.00342 .0 1.e-3 GW 600 1 .009397 -.00342 .0 .01 .0 .0 1.e-3 GW 601 1 .02 .0 .0 .018794 .00684 .0 1.e-3 GW 602 1 .018794 .00684 .0 .015321 .012856 .0 1.e-3 GW 603 1 .015321 .012856 .0 .01 .017321 .0 1.e-3 GW 604 1 .01 .017321 .0 .003473 .019696 .0 1.e-3 GW 605 1 .003473 .019696 .0 -.003473 .019696 .0 1.e-3 GW 606 1 -.003473 .019696 .0 -.01 .017321 .0 1.e-3 GW 607 1 -.01 .017321 .0 -.015321 .012856 .0 1.e-3 GW 608 1 -.015321 .012856 .0 -.018794 .00684 .0 1.e-3 GW 609 1 -.018794 .00684 .0 -.02 .0 .0 1.e-3 GW 610 1 -.02 .0 .0 -.018794 -.00684 .0 1.e-3 GW 611 1 -.018794 -.00684 .0 -.015321 -.012856 .0 1.e-3 GW 612 1 -.015321 -.012856 .0 -.01 -.017321 .0 1.e-3 GW 613 1 -.01 -.017321 .0 -.003473 -.019696 .0 1.e-3 GW 614 1 -.003473 -.019696 .0 .003473 -.019696 .0 1.e-3 GW 615 1 .003473 -.019696 .0 .01 -.017321 .0 1.e-3 GW 616 1 .01 -.017321 .0 .015321 -.012856 .0 1.e-3 GW 617 1 .015321 -.012856 .0 .018794 -.00684 .0 1.e-3 GW 618 1 .018794 -.00684 .0 .02 .0 .0 1.e-3 GW 619 1 .03 .0 .0 .028191 .010261 .0 1.e-3 GW 620 1 .028191 .010261 .0 .022981 .019284 .0 1.e-3 GW 621 1 .022981 .019284 .0 .015 .025981 .0 1.e-3 GW 622 1 .015 .025981 .0 .005209 .029544 .0 1.e-3 GW 623 1 .005209 .029544 .0 -.005209 .029544 .0 1.e-3 GW 624 1 -.005209 .029544 .0 -.015 .025981 .0 1.e-3 GW 625 1 -.015 .025981 .0 -.022981 .019284 .0 1.e-3 GW 626 1 -.022981 .019284 .0 -.028191 .010261 .0 1.e-3 GW 627 1 -.028191 .010261 .0 -.03 .0 .0 1.e-3 GW 628 1 -.03 .0 .0 -.028191 -.010261 .0 1.e-3 GW 629 1 -.028191 -.010261 .0 -.022981 -.019284 .0 1.e-3 GW 630 1 -.022981 -.019284 .0 -.015 -.025981 .0 1.e-3 GW 631 1 -.015 -.025981 .0 -.005209 -.029544 .0 1.e-3 GW 632 1 -.005209 -.029544 .0 .005209 -.029544 .0 1.e-3 GW 633 1 .005209 -.029544 .0 .015 -.025981 .0 1.e-3 GW 634 1 .015 -.025981 .0 .022981 -.019284 .0 1.e-3 GW 635 1 .022981 -.019284 .0 .028191 -.010261 .0 1.e-3 GW 636 1 .028191 -.010261 .0 .03 .0 .0 1.e-3 GW 637 1 .04 .0 .0 .037588 .013681 .0 1.e-3 GW 638 1 .037588 .013681 .0 .030642 .025712 .0 1.e-3 GW 639 1 .030642 .025712 .0 .02 .034641 .0 1.e-3 GW 640 1 .02 .034641 .0 .006946 .039392 .0 1.e-3 GW 641 1 .006946 .039392 .0 -.006946 .039392 .0 1.e-3 GW 642 1 -.006946 .039392 .0 -.02 .034641 .0 1.e-3 GW 643 1 -.02 .034641 .0 -.030642 .025712 .0 1.e-3 GW 644 1 -.030642 .025712 .0 -.037588 .013681 .0 1.e-3 GW 645 1 -.037588 .013681 .0 -.04 .0 .0 1.e-3 GW 646 1 -.04 .0 .0 -.037588 -.013681 .0 1.e-3 GW 647 1 -.037588 -.013681 .0 -.030642 -.025712 .0 1.e-3 GW 648 1 -.030642 -.025712 .0 -.02 -.034641 .0 1.e-3 GW 649 1 -.02 -.034641 .0 -.006946 -.039392 .0 1.e-3 GW 650 1 -.006946 -.039392 .0 .006946 -.039392 .0 1.e-3 GW 651 1 .006946 -.039392 .0 .02 -.034641 .0 1.e-3 GW 652 1 .02 -.034641 .0 .030642 -.025712 .0 1.e-3 GW 653 1 .030642 -.025712 .0 .037588 -.013681 .0 1.e-3 GW 654 1 .037588 -.013681 .0 .04 .0 .0 1.e-3 GW 655 1 .05 .0 .0 .046985 .017101 .0 1.e-3 GW 656 1 .046985 .017101 .0 .038302 .032139 .0 1.e-3 GW 657 1 .038302 .032139 .0 .025 .043301 .0 1.e-3 GW 658 1 .025 .043301 .0 .008682 .04924 .0 1.e-3 GW 659 1 .008682 .04924 .0 -.008682 .04924 .0 1.e-3 GW 660 1 -.008682 .04924 .0 -.025 .043301 .0 1.e-3 GW 661 1 -.025 .043301 .0 -.038302 .032139 .0 1.e-3 GW 662 1 -.038302 .032139 .0 -.046985 .017101 .0 1.e-3 GW 663 1 -.046985 .017101 .0 -.05 .0 .0 1.e-3 GW 664 1 -.05 .0 .0 -.046985 -.017101 .0 1.e-3 GW 665 1 -.046985 -.017101 .0 -.038302 -.032139 .0 1.e-3 GW 666 1 -.038302 -.032139 .0 -.025 -.043301 .0 1.e-3 GW 667 1 -.025 -.043301 .0 -.008682 -.04924 .0 1.e-3 GW 668 1 -.008682 -.04924 .0 .008682 -.04924 .0 1.e-3 GW 669 1 .008682 -.04924 .0 .025 -.043301 .0 1.e-3 GW 670 1 .025 -.043301 .0 .038302 -.032139 .0 1.e-3 GW 671 1 .038302 -.032139 .0 .046985 -.017101 .0 1.e-3 GW 672 1 .046985 -.017101 .0 .05 .0 .0 1.e-3 GW 673 1 .06 .0 .0 .056382 .020521 .0 1.e-3 GW 674 1 .056382 .020521 .0 .045963 .038567 .0 1.e-3 GW 675 1 .045963 .038567 .0 .03 .051962 .0 1.e-3 GW 676 1 .03 .051962 .0 .010419 .059088 .0 1.e-3 GW 677 1 .010419 .059088 .0 -.010419 .059088 .0 1.e-3 GW 678 1 -.010419 .059088 .0 -.03 .051962 .0 1.e-3 GW 679 1 -.03 .051962 .0 -.045963 .038567 .0 1.e-3 GW 680 1 -.045963 .038567 .0 -.056382 .020521 .0 1.e-3 GW 681 1 -.056382 .020521 .0 -.06 .0 .0 1.e-3 GW 682 1 -.06 .0 .0 -.056382 -.020521 .0 1.e-3 GW 683 1 -.056382 -.020521 .0 -.045963 -.038567 .0 1.e-3 GW 684 1 -.045963 -.038567 .0 -.03 -.051962 .0 1.e-3 GW 685 1 -.03 -.051962 .0 -.010419 -.059088 .0 1.e-3 GW 686 1 -.010419 -.059088 .0 .010419 -.059088 .0 1.e-3 GW 687 1 .010419 -.059088 .0 .03 -.051962 .0 1.e-3 GW 688 1 .03 -.051962 .0 .045963 -.038567 .0 1.e-3 GW 689 1 .045963 -.038567 .0 .056382 -.020521 .0 1.e-3 GW 690 1 .056382 -.020521 .0 .06 .0 .0 1.e-3 GW 691 1 .07 .0 .0 .065778 .023941 .0 1.e-3 GW 692 1 .065778 .023941 .0 .053623 .044995 .0 1.e-3 GW 693 1 .053623 .044995 .0 .035 .060622 .0 1.e-3 GW 694 1 .035 .060622 .0 .012155 .068937 .0 1.e-3 GW 695 1 .012155 .068937 .0 -.012155 .068937 .0 1.e-3 GW 696 1 -.012155 .068937 .0 -.035 .060622 .0 1.e-3 GW 697 1 -.035 .060622 .0 -.053623 .044995 .0 1.e-3 GW 698 1 -.053623 .044995 .0 -.065778 .023941 .0 1.e-3 GW 699 1 -.065778 .023941 .0 -.07 .0 .0 1.e-3 GW 700 1 -.07 .0 .0 -.065778 -.023941 .0 1.e-3 GW 701 1 -.065778 -.023941 .0 -.053623 -.044995 .0 1.e-3 GW 702 1 -.053623 -.044995 .0 -.035 -.060622 .0 1.e-3 GW 703 1 -.035 -.060622 .0 -.012155 -.068937 .0 1.e-3 GW 704 1 -.012155 -.068937 .0 .012155 -.068937 .0 1.e-3 GW 705 1 .012155 -.068937 .0 .035 -.060622 .0 1.e-3 GW 706 1 .035 -.060622 .0 .053623 -.044995 .0 1.e-3 GW 707 1 .053623 -.044995 .0 .065778 -.023941 .0 1.e-3 GW 708 1 .065778 -.023941 .0 .07 .0 .0 1.e-3 GW 709 1 .08 .0 .0 .075175 .027362 .0 1.e-3 GW 710 1 .075175 .027362 .0 .061284 .051423 .0 1.e-3 GW 711 1 .061284 .051423 .0 .04 .069282 .0 1.e-3 GW 712 1 .04 .069282 .0 .013892 .078785 .0 1.e-3 GW 713 1 .013892 .078785 .0 -.013892 .078785 .0 1.e-3 GW 714 1 -.013892 .078785 .0 -.04 .069282 .0 1.e-3 GW 715 1 -.04 .069282 .0 -.061284 .051423 .0 1.e-3 GW 716 1 -.061284 .051423 .0 -.075175 .027362 .0 1.e-3 GW 717 1 -.075175 .027362 .0 -.08 .0 .0 1.e-3 GW 718 1 -.08 .0 .0 -.075175 -.027362 .0 1.e-3 GW 719 1 -.075175 -.027362 .0 -.061284 -.051423 .0 1.e-3 GW 720 1 -.061284 -.051423 .0 -.04 -.069282 .0 1.e-3 GW 721 1 -.04 -.069282 .0 -.013892 -.078785 .0 1.e-3 GW 722 1 -.013892 -.078785 .0 .013892 -.078785 .0 1.e-3 GW 723 1 .013892 -.078785 .0 .04 -.069282 .0 1.e-3 GW 724 1 .04 -.069282 .0 .061284 -.051423 .0 1.e-3 GW 725 1 .061284 -.051423 .0 .075175 -.027362 .0 1.e-3 GW 726 1 .075175 -.027362 .0 .08 .0 .0 1.e-3 GW 727 1 .09 .0 .0 .084572 .030782 .0 1.e-3 GW 728 1 .084572 .030782 .0 .068944 .057851 .0 1.e-3 GW 729 1 .068944 .057851 .0 .045 .077942 .0 1.e-3 GW 730 1 .045 .077942 .0 .015628 .088633 .0 1.e-3 GW 731 1 .015628 .088633 .0 -.015628 .088633 .0 1.e-3 GW 732 1 -.015628 .088633 .0 -.045 .077942 .0 1.e-3 GW 733 1 -.045 .077942 .0 -.068944 .057851 .0 1.e-3 GW 734 1 -.068944 .057851 .0 -.084572 .030782 .0 1.e-3 GW 735 1 -.084572 .030782 .0 -.09 .0 .0 1.e-3 GW 736 1 -.09 .0 .0 -.084572 -.030782 .0 1.e-3 GW 737 1 -.084572 -.030782 .0 -.068944 -.057851 .0 1.e-3 GW 738 1 -.068944 -.057851 .0 -.045 -.077942 .0 1.e-3 GW 739 1 -.045 -.077942 .0 -.015628 -.088633 .0 1.e-3 GW 740 1 -.015628 -.088633 .0 .015628 -.088633 .0 1.e-3 GW 741 1 .015628 -.088633 .0 .045 -.077942 .0 1.e-3 GW 742 1 .045 -.077942 .0 .068944 -.057851 .0 1.e-3 GW 743 1 .068944 -.057851 .0 .084572 -.030782 .0 1.e-3 GW 744 1 .084572 -.030782 .0 .09 .0 .0 1.e-3 GW 745 1 .1 .0 .0 .093969 .034202 .0 1.e-3 GW 746 1 .093969 .034202 .0 .076604 .064279 .0 1.e-3 GW 747 1 .076604 .064279 .0 .05 .086603 .0 1.e-3 GW 748 1 .05 .086603 .0 .017365 .098481 .0 1.e-3 GW 749 1 .017365 .098481 .0 -.017365 .098481 .0 1.e-3 GW 750 1 -.017365 .098481 .0 -.05 .086603 .0 1.e-3 GW 751 1 -.05 .086603 .0 -.076604 .064279 .0 1.e-3 GW 752 1 -.076604 .064279 .0 -.093969 .034202 .0 1.e-3 GW 753 1 -.093969 .034202 .0 -.1 .0 .0 1.e-3 GW 754 1 -.1 .0 .0 -.093969 -.034202 .0 1.e-3 GW 755 1 -.093969 -.034202 .0 -.076604 -.064279 .0 1.e-3 GW 756 1 -.076604 -.064279 .0 -.05 -.086603 .0 1.e-3 GW 757 1 -.05 -.086603 .0 -.017365 -.098481 .0 1.e-3 GW 758 1 -.017365 -.098481 .0 .017365 -.098481 .0 1.e-3 GW 759 1 .017365 -.098481 .0 .05 -.086603 .0 1.e-3 GW 760 1 .05 -.086603 .0 .076604 -.064279 .0 1.e-3 GW 761 1 .076604 -.064279 .0 .093969 -.034202 .0 1.e-3 GW 762 1 .093969 -.034202 .0 .1 .0 .0 1.e-3 GW 763 1 -.018405 .013372 .01288 -.021637 .00703 .01449 1.e-3 GE 0 EX 0 10 1 0 1 0 FR 0 1 0 0 1900 XQ EN necpp-1.5.0+cvs20101003/test_data/passive_test1.nec0000644000175000017500000000122210310210764020122 0ustar numanumaCM GA - NEC FILE CE go blue ! GW 0 52 0 0 0 0.017 0.042 -0.047 0.001 GW 0 27 0.013 -0.015 0.039 -0.008 0.012 0.044 0.001 GW 0 47 -0.008 0.012 0.044 -0.023 0.047 -0.002 0.001 GW 0 68 0.013 -0.015 0.039 0.039 0.017 -0.036 0.001 GW 0 94 0.039 0.017 -0.036 -0.041 0.035 0.049 0.001 GW 0 68 0.039 0.017 -0.036 0.036 0.01 0.049 0.001 GW 0 46 -0.003 -0.016 -0.039 -0.045 -0.029 -0.001 0.001 GW 0 41 -0.003 -0.016 -0.039 0.012 0.031 -0.023 0.001 GW 0 36 0.012 0.031 -0.023 0.013 0.043 0.021 0.001 GW 0 85 -0.048 -0.025 0.043 0.017 -0.034 -0.042 0.001 GE 0 GN -1 LD 5 0 0 0 3.720E+07 FR 0 1 0 0 2400 PT -1 EX 1 1 1 0 90 22.5 0 0 0 0 0 RP 0 1 1 0500 90 157.5 0 0 EN necpp-1.5.0+cvs20101003/test_data/yagi.nec0000644000175000017500000000335010310210764016265 0ustar numanumaCM NEC Input File for log-periodic CM PT control card supresses printing of element currents CM TL control card specs transmission line in terms of Z,length,and shunt Y CE GW 3 7 -9.66700 -2.14200 0.00000 -9.66700 2.14200 0.00000 0.00429 GW 4 7 -11.10700 -2.46300 0.00000 -11.10700 2.46300 0.00000 0.00493 GW 5 7 -12.76800 -2.83200 0.00000 -12.76800 2.83200 0.00000 0.00566 GW 6 9 -14.67500 -3.25500 0.00000 -14.67500 3.25500 0.00000 0.00651 GW 7 9 -16.86500 -3.74100 0.00000 -16.86500 3.74100 0.00000 0.00750 GW 8 9 -19.38300 -4.29900 0.00000 -19.38300 4.29900 0.00000 0.00860 GW 9 11 -22.27700 -4.94400 0.00000 -22.27700 4.94400 0.00000 0.00988 GW 10 11 -25.60300 -5.68200 0.00000 -25.60300 5.68200 0.00000 0.01136 GW 11 11 -29.42500 -6.53100 0.00000 -29.42500 6.53100 0.00000 0.01305 GE 0 FR 0 2 0 0 1.20E+01 4.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 3 4 4 4 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 4 4 5 4 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 5 4 6 5 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 6 5 7 5 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 7 5 8 5 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 8 5 9 6 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 9 6 10 6 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 TL 10 6 11 6 -4.50E+02 0.00E+00 0.00E+00 0.00E+00 0.00E+00 -2.20E-03 EX 0 3 4 0 1.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 0.00E+00 PT -1 RP 0 37 37 1001 0.00E+00 0.00E+00 5.00E+00 1.00E+01 0.00E+00 0.00E+00 EN necpp-1.5.0+cvs20101003/test_data/neoklis_bug.nec0000644000175000017500000000055610521216340017642 0ustar numanumaCM --- NEC2 Input File created by xnec2c 0.9-beta --- CE --- End Comments --- GW 1 8 0.0 0.0 0.0 0.0 0.0 1.0 .003 SM 3 3 0.5 0.5 0.0 0.5 -0.5 0.0 0.0 SC 0 0 -0.5 -0.5 0.0 0.0 0.0 0.0 0.0 GE 0 0 0 0 0 0 0 0 0 EX 0 1 1 0 1.0 0.0 0.0 0.0 0.0 0.0 EK 0 FR 0 11 0 0 50.0 5.0 0.0 0.0 0.0 0.0 XQ 0 0 0 0 0 0 0 0 0 0 EN 0 0 0 0 0 0 0 0 0 0 necpp-1.5.0+cvs20101003/test_data/sommerfield1.nec0000644000175000017500000000031611117073437017734 0ustar numanumaCM Copper #12 Dipole CM Average Ground CE GW 1 17 0 -100 420 0 100 420 0.0404331 GS 0 0 .02540 GE 1 -1 0 GN 2 0 0 0 13 .005 EX 0 1 9 0 1 0 LD 5 1 1 41 5.8001E7 FR 0 1 0 0 28.5 1 RP 0 19 73 1002 -90 0 5 5 ENnecpp-1.5.0+cvs20101003/test_data/test299.nec0000644000175000017500000000031410310210764016554 0ustar numanumaCM Center feed Horizontal Half-Wave Dipole over excellent ground CE GW 1,299,-139.,0, 6.,+139.,0, 6., .001, GE 0, GN 1, FR 0,0,0,0, 0.54, EX 0, 1,150,0,1., 0., RP 1, 1, 1,0000, 1.5, 0., 0., 0., 1000., EN necpp-1.5.0+cvs20101003/test_data/CVS/0000755000175000017500000000000011452152163015305 5ustar numanumanecpp-1.5.0+cvs20101003/test_data/CVS/Root0000644000175000017500000000007011452152157016153 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/test_data/CVS/Repository0000644000175000017500000000002011452152157017402 0ustar numanumanecpp/test_data necpp-1.5.0+cvs20101003/test_data/CVS/Entries0000644000175000017500000000345311452152163016646 0ustar numanuma/36dip.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /Collinear_1L.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /GA487.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /Gs_8d_bb.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /K5332187.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /Yg_4x6_b.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /buoy.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /dipole_anim.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /discone.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /ek_test.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /example1.nec/1.3/Tue Jan 6 04:09:44 2009// /example2.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /example3.nec/1.2/Sat Jan 26 00:29:08 2008// /example4.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /example5.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /example6.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /excessive_gain.nec/1.1/Thu Aug 6 04:57:40 2009// /ga_pjw_0.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /ga_pjw_1.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /gn2.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /hang.nec/1.1/Sat Jul 26 12:17:03 2008// /helix.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /intersection.nec/1.1/Tue Jan 6 04:09:44 2009// /medium_test.nec/1.1/Fri Mar 10 00:41:19 2006// /neoklis_bug.nec/1.1/Sun Oct 29 21:28:00 2006// /passive_test1.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /patch_999.nec/1.1/Mon Dec 8 01:11:59 2008// /patch_999_2.nec/1.1/Mon Dec 8 08:09:23 2008// /plane.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /plet_helix.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /plet_helixumts.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /salt_ground.nec/1.1/Sat Jan 26 00:29:08 2008// /sommerfeld2.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /sommerfeld3.nec/1.1/Sat Sep 17 02:35:49 2005// /sommerfield1.nec/1.2/Mon Dec 8 01:23:43 2008// /test299.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /yagi.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// /yagi16.nec/1.1.1.1/Fri Sep 9 04:39:16 2005// D necpp-1.5.0+cvs20101003/test_data/plane.nec0000644000175000017500000004102010310210764016427 0ustar numanumaCE EA6 GW1,1,7.697031,-0.305237,1.518194, 7.697031,0.000007,1.518194,1 GW2,1,12.867005,0.166028,2.997150, 12.869524,0.0,2.997012,1 GW3,1,16.907021,0.0,2.775780, 12.867005,0.166028,2.997150,1 GW4,1,15.046280,0.206341,2.774999, 16.907021,0.0,2.775780,1 GW5,1,16.907021,0.0,2.775780, 12.872238,0.447423,2.416148,1 GW6,1,16.907021,0.0,2.775780, 12.847273,0.139100,2.099673,1 GW7,1,12.847273,0.139100,2.099673, 12.847273,-0.139100,2.099673,1 GW8,1,11.228731,0.233354,3.086919, 11.228731,-0.233354,3.086919,1 GW9,1,11.234509,0.191124,1.917587, 11.234509,-0.191124,1.917587,1 GW10,1,9.525351,0.303356,3.180255, 9.525351,-0.303356,3.180255,1 GW11,1,7.696480,0.378515,3.280467, 7.696480,-0.378515,3.280467,1 GW12,1,9.528062,-0.246171,1.724923, 9.528062,0.246171,1.724923,1 GW13,1,6.309062,-0.350010,1.361488, 6.309062,0.350010,1.361488,1 GW14,1,6.304720,0.378515,3.479290, 6.304720,-0.378515,3.479290,1 GW15,1,5.421552,-0.378515,3.605456, 5.421552,0.378515,3.605456,1 GW16,1,4.163669,-0.378515,3.785154, 4.163669,0.378515,3.785154,1 GW17,1,5.425387,0.378515,1.261718, 5.425387,-0.378515,1.261718,1 GW18,1,4.163669,-0.378515,1.261718, 4.163669,0.378515,1.261718,1 GW19,1,2.775780,-0.315430,3.658982, 2.775780,0.315430,3.658982,1 GW20,1,3.406639,0.378515,1.261718, 3.406639,-0.378515,1.261718,1 GW21,1,2.081835,0.252344,1.387890, 2.081835,-0.252344,1.387890,1 GW22,1,0.757031,0.126172,1.514062, 0.757031,-0.126172,1.514062,1 GW23,1,1.766405,-0.252344,3.028123, 1.766405,0.252344,3.028123,1 GW24,1,0.757031,0.189258,2.775780, 0.757031,-0.189258,2.775780,1 GW25,1,0.0,0.126172,2.018749, 0.0,-0.126172,2.018749,1 GW26,1,16.907021,0.0,2.775780, 12.872238,-0.447423,2.416148,1 GW27,1,16.907021,0.0,2.775780, 12.847273,-0.139100,2.099673,1 GW28,1,12.872238,-0.447423,2.416148, 12.879502,-0.446618,2.774090,1 GW29,1,11.218050,-0.630859,2.268706, 11.218050,-0.630859,2.773393,1 GW30,1,9.525985,-0.717719,2.784489, 9.526194,-0.717708,2.149527,1 GW31,1,7.696366,-0.811639,2.796486, 7.699116,-0.811498,2.020822,1 GW32,1,6.302275,-0.883203,2.805627, 6.302275,-0.883203,1.922425,1 GW33,1,5.425745,-0.883203,1.908983, 5.425798,-0.844875,2.806284,1 GW34,1,4.159502,-0.883203,1.889566, 4.160086,-0.812425,2.806269,1 GW35,1,3.218618,-0.883203,2.576767, 3.217775,-0.883203,1.875124,1 GW36,1,0.630228,-0.630859,2.299312, 0.757031,-0.189258,2.775780,1 GW37,1,2.016728,-0.883203,2.487565, 0.630228,-0.630859,2.299312,1 GW38,1,2.016728,-0.883203,1.856706, 2.016728,-0.883203,2.487565,1 GW39,1,0.0,-0.126172,2.018749, 0.757031,-0.189258,2.775780,1 GW40,1,4.159502,-0.883203,1.889566, 5.425745,-0.883203,1.908983,1 GW41,1,5.425387,-0.378515,1.261718, 4.163669,-0.378515,1.261718,1 GW42,1,4.163669,-0.378515,1.261718, 4.159502,-0.883203,1.889566,1 GW43,1,3.406639,-0.378515,1.261718, 3.217775,-0.883203,1.875124,1 GW44,1,2.016728,-0.883203,1.856706, 2.081835,-0.252344,1.387890,1 GW45,1,0.757031,-0.126172,1.514062, 0.630228,-0.630859,1.920796,1 GW46,1,0.757031,-0.126172,1.514062, 0.0,-0.126172,2.018749,1 GW47,1,3.406639,-0.378515,1.261718, 2.081835,-0.252344,1.387890,1 GW48,1,3.406639,-0.378515,1.261718, 4.163669,-0.378515,1.261718,1 GW49,1,2.081835,-0.252344,1.387890, 0.757031,-0.126172,1.514062,1 GW50,1,0.630228,-0.630859,2.299312, 0.630228,-0.630859,1.920796,1 GW51,1,0.630228,-0.630859,1.920796, 0.0,-0.126172,2.018749,1 GW52,1,0.630228,-0.630859,1.920796, 2.016728,-0.883203,1.856706,1 GW53,1,3.217775,-0.883203,1.875124, 2.016728,-0.883203,1.856706,1 GW54,1,3.217775,-0.883203,1.875124, 4.159502,-0.883203,1.889566,1 GW55,1,0.0,-0.126172,2.018749, 0.630228,-0.630859,2.299312,1 GW56,1,7.697031,-0.305237,1.518194, 9.528062,-0.246171,1.724923,1 GW57,1,7.699116,-0.811498,2.020822, 7.697031,-0.305237,1.518194,1 GW58,1,6.309062,-0.350010,1.361488, 6.302275,-0.883203,1.922425,1 GW59,1,5.425745,-0.883203,1.908983, 5.425387,-0.378515,1.261718,1 GW60,1,5.425387,-0.378515,1.261718, 6.309062,-0.350010,1.361488,1 GW61,1,7.697031,-0.305237,1.518194, 6.309062,-0.350010,1.361488,1 GW62,1,11.234509,-0.191124,1.917587, 12.847273,-0.139100,2.099673,1 GW63,1,11.234509,-0.191124,1.917587, 11.218050,-0.630859,2.268706,1 GW64,1,9.526194,-0.717708,2.149527, 9.528062,-0.246171,1.724923,1 GW65,1,6.302275,-0.883203,1.922425, 7.699116,-0.811498,2.020822,1 GW66,1,11.234509,-0.191124,1.917587, 9.528062,-0.246171,1.724923,1 GW67,1,6.302275,-0.883203,1.922425, 5.425745,-0.883203,1.908983,1 GW68,1,9.526194,-0.717708,2.149527, 11.218050,-0.630859,2.268706,1 GW69,1,7.699116,-0.811498,2.020822, 9.526194,-0.717708,2.149527,1 GW70,1,12.847273,-0.139100,2.099673, 12.872238,-0.447423,2.416148,1 GW71,1,12.872238,-0.447423,2.416148, 11.218050,-0.630859,2.268706,1 GW72,1,14.954804,0.0,4.142302, 15.014444,0.0,5.268105,1 GW73,1,16.574039,0.0,4.157878, 16.276161,0.0,5.394277,1 GW74,1,13.941984,0.0,4.132559, 15.014444,0.0,5.268105,1 GW75,1,5.414862,-3.086705,2.806269, 4.160086,-0.812425,2.806269,1 GW76,1,5.425798,-0.844875,2.806284, 4.160086,-0.812425,2.806269,1 GW77,1,5.421552,-0.378515,3.605456, 4.163669,-0.378515,3.785154,1 GW78,1,4.160086,-0.812425,2.806269, 4.163669,-0.378515,3.785154,1 GW79,1,1.766405,-0.252344,3.028123, 2.775780,-0.315430,3.658982,1 GW80,1,2.016728,-0.883203,2.487565, 1.766405,-0.252344,3.028123,1 GW81,1,0.757031,-0.189258,2.775780, 1.766405,-0.252344,3.028123,1 GW82,1,3.218618,-0.883203,2.576767, 4.160086,-0.812425,2.806269,1 GW83,1,2.016728,-0.883203,2.487565, 3.218618,-0.883203,2.576767,1 GW84,1,4.163669,-0.378515,3.785154, 2.775780,-0.315430,3.658982,1 GW85,1,14.888272,0.0,2.886396, 14.954804,0.0,4.142302,1 GW86,1,16.574039,0.0,4.157878, 16.907021,0.0,2.775780,1 GW87,1,12.869524,0.0,2.997012, 13.941984,0.0,4.132559,1 GW88,1,7.696480,-0.378515,3.280467, 6.304720,-0.378515,3.479290,1 GW89,1,6.302275,-0.883203,2.805627, 6.304720,-0.378515,3.479290,1 GW90,1,5.425798,-0.844875,2.806284, 5.421552,-0.378515,3.605456,1 GW91,1,14.888272,0.0,2.886396, 16.907021,0.0,2.775780,1 GW92,1,15.046280,-0.206341,2.774999, 16.907021,0.0,2.775780,1 GW93,1,16.907021,0.0,2.775780, 12.867005,-0.166028,2.997150,1 GW94,1,12.869524,0.0,2.997012, 14.888272,0.0,2.886396,1 GW95,1,12.879502,-0.446618,2.774090, 12.867005,-0.166028,2.997150,1 GW96,1,11.218050,-0.630859,2.773393, 11.228731,-0.233354,3.086919,1 GW97,1,9.525351,-0.303356,3.180255, 9.525985,-0.717719,2.784489,1 GW98,1,7.696366,-0.811639,2.796486, 7.696480,-0.378515,3.280467,1 GW99,1,11.218050,-0.630859,2.773393, 9.525985,-0.717719,2.784489,1 GW100,1,9.067292,-4.674313,2.806269, 9.059924,-7.191902,2.806269,1 GW101,1,9.537165,-7.194540,2.806269, 9.067292,-4.674313,2.806269,1 GW102,1,7.675575,-7.184248,2.806269, 6.284840,-4.663540,2.806269,1 GW103,1,7.683841,-4.650679,2.802379, 7.675575,-7.184248,2.806269,1 GW104,1,9.057177,-8.130389,2.806269, 9.711645,-8.130389,2.806269,1 GW105,1,9.059924,-7.191902,2.806269, 9.537165,-7.194540,2.806269,1 GW106,1,9.059924,-7.191902,2.806269, 9.057177,-8.130389,2.806269,1 GW107,1,8.197584,-8.130389,2.806269, 7.675575,-7.184248,2.806269,1 GW108,1,7.675575,-7.184248,2.806269, 9.059924,-7.191902,2.806269,1 GW109,1,8.197584,-8.130389,2.806269, 9.057177,-8.130389,2.806269,1 GW110,1,9.711645,-8.130389,2.806269, 9.537165,-7.194540,2.806269,1 GW111,1,7.683841,-4.650679,2.802379, 6.284840,-4.663540,2.806269,1 GW112,1,7.688913,-3.095979,2.799993, 6.327823,-3.086190,2.806269,1 GW113,1,6.302275,-0.883203,2.805627, 7.696366,-0.811639,2.796486,1 GW114,1,6.302275,-0.883203,2.805627, 6.327823,-3.086190,2.806269,1 GW115,1,5.425798,-0.844875,2.806284, 5.414862,-3.086705,2.806269,1 GW116,1,6.327823,-3.086190,2.806269, 5.414862,-3.086705,2.806269,1 GW117,1,5.414862,-3.086705,2.806269, 6.327823,-3.086190,2.806269,1 GW118,1,6.284840,-4.663540,2.806269, 5.414862,-3.086705,2.806269,1 GW119,1,6.327823,-3.086190,2.806269, 6.284840,-4.663540,2.806269,1 GW120,1,6.302275,-0.883203,2.805627, 5.425798,-0.844875,2.806284,1 GW121,1,7.696366,-0.811639,2.796486, 7.688913,-3.095979,2.799993,1 GW122,1,8.770945,-3.084812,2.806269, 8.342397,-0.786238,2.806269,1 GW123,1,7.683841,-4.650679,2.802379, 7.688913,-3.095979,2.799993,1 GW124,1,9.067292,-4.674313,2.806269, 8.770945,-3.084812,2.806269,1 GW125,1,7.688913,-3.095979,2.799993, 8.770945,-3.084812,2.806269,1 GW126,1,7.683841,-4.650679,2.802379, 9.067292,-4.674313,2.806269,1 GW127,1,8.342397,-0.786238,2.806269, 9.525985,-0.717719,2.784489,1 GW128,1,8.342397,-0.786238,2.806269, 7.696366,-0.811639,2.796486,1 GW129,1,14.053729,-0.316406,2.774583, 12.879502,-0.446618,2.774090,1 GW130,1,12.879502,-0.446618,2.774090, 13.679027,-1.645905,2.774090,1 GW131,1,11.218050,-0.630859,2.773393, 12.879502,-0.446618,2.774090,1 GW132,1,15.350781,-1.651283,2.774545, 15.655282,-3.096226,2.774090,1 GW133,1,14.645907,-3.096226,2.774090, 14.361111,-1.648099,2.774276,1 GW134,1,13.679027,-1.645905,2.774090, 14.645907,-3.096226,2.774090,1 GW135,1,14.645907,-3.096226,2.774090, 15.655282,-3.096226,2.774090,1 GW136,1,15.350781,-1.651283,2.774545, 14.361111,-1.648099,2.774276,1 GW137,1,14.053729,-0.316406,2.774583, 15.046280,-0.206341,2.774999,1 GW138,1,14.361111,-1.648099,2.774276, 13.679027,-1.645905,2.774090,1 GW139,1,14.361111,-1.648099,2.774276, 14.053729,-0.316406,2.774583,1 GW140,1,15.350781,-1.651283,2.774545, 15.046280,-0.206341,2.774999,1 GW141,1,11.228731,-0.233354,3.086919, 9.525351,-0.303356,3.180255,1 GW142,1,9.525351,-0.303356,3.180255, 7.696480,-0.378515,3.280467,1 GW143,1,11.228731,-0.233354,3.086919, 12.867005,-0.166028,2.997150,1 GW144,1,12.867005,-0.166028,2.997150, 12.869524,0.0,2.997012,1 GW145,1,14.954804,0.0,4.142302, 16.574039,0.0,4.157878,1 GW146,1,6.304720,-0.378515,3.479290, 5.421552,-0.378515,3.605456,1 GW147,1,14.954804,0.0,4.142302, 13.941984,0.0,4.132559,1 GW148,1,15.014444,0.0,5.268105, 16.276161,0.0,5.394277,1 GW149,1,11.218050,0.630859,2.268706, 11.218050,0.630859,2.773393,1 GW150,1,9.525985,0.717719,2.784489, 9.526194,0.717708,2.149527,1 GW151,1,12.872238,0.447423,2.416148, 12.879502,0.446618,2.774090,1 GW152,1,2.016728,0.883203,2.487565, 0.630228,0.630859,2.299312,1 GW153,1,3.218618,0.883203,2.576767, 3.217775,0.883203,1.875124,1 GW154,1,2.016728,0.883203,1.856706, 2.016728,0.883203,2.487565,1 GW155,1,6.302275,0.883203,2.805627, 6.302275,0.883203,1.922425,1 GW156,1,4.159502,0.883203,1.889566, 4.160086,0.812425,2.806269,1 GW157,1,5.425745,0.883203,1.908983, 5.425798,0.844875,2.806284,1 GW158,1,0.0,0.126172,2.018749, 0.757031,0.189258,2.775780,1 GW159,1,0.630228,0.630859,2.299312, 0.757031,0.189258,2.775780,1 GW160,1,7.696366,0.811639,2.796486, 7.699116,0.811498,2.020822,1 GW161,1,4.159502,0.883203,1.889566, 5.425745,0.883203,1.908983,1 GW162,1,5.425387,0.378515,1.261718, 4.163669,0.378515,1.261718,1 GW163,1,4.163669,0.378515,1.261718, 4.159502,0.883203,1.889566,1 GW164,1,0.757031,0.126172,1.514062, 0.0,0.126172,2.018749,1 GW165,1,3.406639,0.378515,1.261718, 3.217775,0.883203,1.875124,1 GW166,1,2.016728,0.883203,1.856706, 2.081835,0.252344,1.387890,1 GW167,1,0.757031,0.126172,1.514062, 0.630228,0.630859,1.920796,1 GW168,1,3.406639,0.378515,1.261718, 2.081835,0.252344,1.387890,1 GW169,1,3.406639,0.378515,1.261718, 4.163669,0.378515,1.261718,1 GW170,1,2.081835,0.252344,1.387890, 0.757031,0.126172,1.514062,1 GW171,1,0.630228,0.630859,2.299312, 0.630228,0.630859,1.920796,1 GW172,1,0.630228,0.630859,1.920796, 0.0,0.126172,2.018749,1 GW173,1,0.630228,0.630859,1.920796, 2.016728,0.883203,1.856706,1 GW174,1,3.217775,0.883203,1.875124, 2.016728,0.883203,1.856706,1 GW175,1,3.217775,0.883203,1.875124, 4.159502,0.883203,1.889566,1 GW176,1,0.0,0.126172,2.018749, 0.630228,0.630859,2.299312,1 GW177,1,7.699116,0.811498,2.020822, 7.697031,0.305237,1.518194,1 GW178,1,6.309062,0.350010,1.361488, 6.302275,0.883203,1.922425,1 GW179,1,5.425745,0.883203,1.908983, 5.425387,0.378515,1.261718,1 GW180,1,7.697031,0.305237,1.518194, 9.528062,0.246171,1.724923,1 GW181,1,5.425387,0.378515,1.261718, 6.309062,0.350010,1.361488,1 GW182,1,7.697031,0.305237,1.518194, 6.309062,0.350010,1.361488,1 GW183,1,7.697031,0.305237,1.518194, 7.697031,0.000007,1.518194,1 GW184,1,11.234509,0.191124,1.917587, 11.218050,0.630859,2.268706,1 GW185,1,11.234509,0.191124,1.917587, 12.847273,0.139100,2.099673,1 GW186,1,9.526194,0.717708,2.149527, 9.528062,0.246171,1.724923,1 GW187,1,6.302275,0.883203,1.922425, 7.699116,0.811498,2.020822,1 GW188,1,11.234509,0.191124,1.917587, 9.528062,0.246171,1.724923,1 GW189,1,6.302275,0.883203,1.922425, 5.425745,0.883203,1.908983,1 GW190,1,9.526194,0.717708,2.149527, 11.218050,0.630859,2.268706,1 GW191,1,7.699116,0.811498,2.020822, 9.526194,0.717708,2.149527,1 GW192,1,12.847273,0.139100,2.099673, 12.872238,0.447423,2.416148,1 GW193,1,12.872238,0.447423,2.416148, 11.218050,0.630859,2.268706,1 GW194,1,5.421552,0.378515,3.605456, 4.163669,0.378515,3.785154,1 GW195,1,5.425798,0.844875,2.806284, 4.160086,0.812425,2.806269,1 GW196,1,5.414862,3.086705,2.806269, 4.160086,0.812425,2.806269,1 GW197,1,4.160086,0.812425,2.806269, 4.163669,0.378515,3.785154,1 GW198,1,1.766405,0.252344,3.028123, 2.775780,0.315430,3.658982,1 GW199,1,0.757031,0.189258,2.775780, 1.766405,0.252344,3.028123,1 GW200,1,2.016728,0.883203,2.487565, 1.766405,0.252344,3.028123,1 GW201,1,3.218618,0.883203,2.576767, 4.160086,0.812425,2.806269,1 GW202,1,2.016728,0.883203,2.487565, 3.218618,0.883203,2.576767,1 GW203,1,4.163669,0.378515,3.785154, 2.775780,0.315430,3.658982,1 GW204,1,6.302275,0.883203,2.805627, 6.304720,0.378515,3.479290,1 GW205,1,5.425798,0.844875,2.806284, 5.421552,0.378515,3.605456,1 GW206,1,7.696480,0.378515,3.280467, 6.304720,0.378515,3.479290,1 GW207,1,12.879502,0.446618,2.774090, 12.867005,0.166028,2.997150,1 GW208,1,9.525351,0.303356,3.180255, 9.525985,0.717719,2.784489,1 GW209,1,11.218050,0.630859,2.773393, 11.228731,0.233354,3.086919,1 GW210,1,7.696366,0.811639,2.796486, 7.696480,0.378515,3.280467,1 GW211,1,11.218050,0.630859,2.773393, 9.525985,0.717719,2.784489,1 GW212,1,7.676066,4.668927,2.806269, 7.675575,7.184248,2.806269,1 GW213,1,7.675575,7.184248,2.806269, 6.284840,4.663540,2.806269,1 GW214,1,9.067292,4.674313,2.806269, 9.059924,7.191902,2.806269,1 GW215,1,9.537165,7.194540,2.806269, 9.067292,4.674313,2.806269,1 GW216,1,7.691803,3.085421,2.806269, 6.289961,3.086212,2.806269,1 GW217,1,6.302275,0.883203,2.805627, 7.696366,0.811639,2.796486,1 GW218,1,6.284840,4.663540,2.806269, 7.676066,4.668927,2.806269,1 GW219,1,5.425798,0.844875,2.806284, 5.414862,3.086705,2.806269,1 GW220,1,6.302275,0.883203,2.805627, 6.289961,3.086212,2.806269,1 GW221,1,6.302275,0.883203,2.805627, 5.425798,0.844875,2.806284,1 GW222,1,6.289961,3.086212,2.806269, 5.414862,3.086705,2.806269,1 GW223,1,6.284840,4.663540,2.806269, 5.414862,3.086705,2.806269,1 GW224,1,6.289961,3.086212,2.806269, 6.284840,4.663540,2.806269,1 GW225,1,7.691803,3.085421,2.806269, 7.696366,0.811639,2.796486,1 GW226,1,8.770945,3.084812,2.806269, 8.342397,0.786238,2.806269,1 GW227,1,8.342397,0.786238,2.806269, 9.525985,0.717719,2.784489,1 GW228,1,8.342397,0.786238,2.806269, 7.696366,0.811639,2.796486,1 GW229,1,7.676066,4.668927,2.806269, 9.067292,4.674313,2.806269,1 GW230,1,7.691803,3.085421,2.806269, 7.676066,4.668927,2.806269,1 GW231,1,9.067292,4.674313,2.806269, 8.770945,3.084812,2.806269,1 GW232,1,7.691803,3.085421,2.806269, 8.770945,3.084812,2.806269,1 GW233,1,9.059924,7.191902,2.806269, 9.537165,7.194540,2.806269,1 GW234,1,9.057177,8.130389,2.806269, 9.711645,8.130389,2.806269,1 GW235,1,8.197584,8.130389,2.806269, 9.057177,8.130389,2.806269,1 GW236,1,9.059924,7.191902,2.806269, 9.057177,8.130389,2.806269,1 GW237,1,8.197584,8.130389,2.806269, 7.675575,7.184248,2.806269,1 GW238,1,7.675575,7.184248,2.806269, 9.059924,7.191902,2.806269,1 GW239,1,9.711645,8.130389,2.806269, 9.537165,7.194540,2.806269,1 GW240,1,12.879502,0.446618,2.774090, 13.679027,1.645905,2.774090,1 GW241,1,14.053729,0.316406,2.774583, 12.879502,0.446618,2.774090,1 GW242,1,11.218050,0.630859,2.773393, 12.879502,0.446618,2.774090,1 GW243,1,13.679027,1.645905,2.774090, 14.645907,3.096226,2.774090,1 GW244,1,14.645907,3.096226,2.774090, 14.361111,1.648099,2.774276,1 GW245,1,15.350781,1.651283,2.774545, 15.655282,3.096226,2.774090,1 GW246,1,14.053729,0.316406,2.774583, 15.046280,0.206341,2.774999,1 GW247,1,15.350781,1.651283,2.774545, 14.361111,1.648099,2.774276,1 GW248,1,14.361111,1.648099,2.774276, 14.053729,0.316406,2.774583,1 GW249,1,14.361111,1.648099,2.774276, 13.679027,1.645905,2.774090,1 GW250,1,15.350781,1.651283,2.774545, 15.046280,0.206341,2.774999,1 GW251,1,14.645907,3.096226,2.774090, 15.655282,3.096226,2.774090,1 GW252,1,11.228731,0.233354,3.086919, 9.525351,0.303356,3.180255,1 GW253,1,9.525351,0.303356,3.180255, 7.696480,0.378515,3.280467,1 GW254,1,11.228731,0.233354,3.086919, 12.867005,0.166028,2.997150,1 GW255,1,6.304720,0.378515,3.479290, 5.421552,0.378515,3.605456,1 GE necpp-1.5.0+cvs20101003/test_data/sommerfeld3.nec0000644000175000017500000000043410312700405017552 0ustar numanumaCMCentre Fed IV Dipole (20m EDZ) CM CMExtended thin wire kernel used CM CEPATTERN CALCULATIONS GW 1 15 0 -12.6 6 0 -0.1 10 0.001 GW 2 1 0 -0.1 10 0 0.1 10 0.001 GW 3 15 0 0.1 10 0 12.6 6 0.001 GE 0 EK LD 5 0 0 0 5.8E+07 FR 0 1 0 0 2.4 0 GN 2 0 0 0 13. 50.000E-03 EX 0 2 1 0 1. XQ EN necpp-1.5.0+cvs20101003/src/0000755000175000017500000000000011452152157013474 5ustar numanumanecpp-1.5.0+cvs20101003/src/nec_context.h0000644000175000017500000010164111125371773016165 0ustar numanuma#ifndef __nec_context__ #define __nec_context__ /* Copyright (C) 2004-2008 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "common.h" #include "c_ggrid.h" #include "math_util.h" #include "matrix_algebra.h" #include "electromag.h" #include "nec_radiation_pattern.h" #include "nec_results.h" #include "nec_structure_currents.h" #include "nec_output.h" #include "nec_ground.h" #include "c_plot_card.h" class c_geometry; enum excitation_return { FREQ_PRINT_NORMALIZATION = 0, FREQ_LOOP_CONTINUE = 1, FREQ_LOOP_CARD_CONTINUE = 2 }; /*! A 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. */ class nec_context { public: nec_context(); virtual ~nec_context(); // Called after construction... void initialize(); void calc_prepare(); inline c_geometry* get_geometry() { return m_geometry; } /*! \brief Get the maximum gain in dB. This function requires a previous rp_card() method to have been called (with gain normalization requested) \return The maximum gain in dB or -999.0 if no radiation pattern had been previously requested. */ double get_gain_max(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_max(); } double get_gain_min(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_min(); } double get_gain_mean(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_mean(); } double get_gain_sd(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_sd(); } /********************** RHCP ********************************/ double get_gain_rhcp_max(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_rhcp_max(); } double get_gain_rhcp_min(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_rhcp_min(); } double get_gain_rhcp_mean(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_rhcp_mean(); } double get_gain_rhcp_sd(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_rhcp_sd(); } /********************** LHCP ********************************/ double get_gain_lhcp_max(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_lhcp_max(); } double get_gain_lhcp_min(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_lhcp_min(); } double get_gain_lhcp_mean(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_lhcp_mean(); } double get_gain_lhcp_sd(int freq_index = 0) { nec_radiation_pattern* rp = get_radiation_pattern(freq_index); if (NULL == rp) return -999.0; return rp->get_gain_lhcp_sd(); } /****************** IMPEDANCE CHARACTERISTICS *********************/ /*! \brief Impedance: Real Part */ double get_impedance_real(int freq_index = 0) { nec_antenna_input* ipt = get_input_parameters(freq_index); if (NULL == ipt) return -999.0; vector& imp(ipt->get_impedance()); return imp[0].real(); } /*! \brief Impedance: Imaginary Part */ double get_impedance_imag(int freq_index = 0) { nec_antenna_input* ipt = get_input_parameters(freq_index); if (NULL == ipt) return -999.0; vector& imp(ipt->get_impedance()); return imp[0].imag(); } /*! \brief Get Antenna Input Parameter Results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_antenna_input* get_input_parameters(int index) { return m_results.get_antenna_input(index); } /*! \brief Get Normalized Receiving Pattern Results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_norm_rx_pattern* get_norm_rx_pattern(int index) { return m_results.get_norm_rx_pattern(index); } /*! \brief Get Radiation Pattern results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_radiation_pattern* get_radiation_pattern(int index) { return m_results.get_radiation_pattern(index); } /*! \brief Get structure excitation results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_structure_excitation* get_structure_excitation(int index) { return m_results.get_structure_excitation(index); } /*! \brief Get near field pattern results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_near_field_pattern* get_near_field_pattern(int index) { return m_results.get_near_field_pattern(index); } /*! \brief Get structure currents results \param index The zero-based index for the result (simulations can return more than one set of results). \return 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. */ inline nec_structure_currents* get_structure_currents(int index) { return m_results.get_structure_currents(index); } /* added for the python wrapping : some access functions */ void set_isave(int in_isave) { isave = in_isave; } int get_inc() { return inc; } nec_float get_xpr1() { return xpr1; } nec_float get_xpr2() { return xpr2; } /* end of functions added for the python wrapping */ inline void set_output(nec_output_file in_output, nec_output_flags in_output_flags) { m_output = in_output; m_output_flags = in_output_flags; m_output_fp = m_output.get_fp(); } inline void set_results_format(enum RESULT_FORMAT result_format) { m_results.m_result_format = result_format; } inline void set_gain_only(bool flag) { m_output_flags.set_gain_only(flag); } /*!\brief Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. */ static nec_float benchmark(); /*! \brief Signal the end of a geometry description. This function prepares for a calculation by calling calc_prepare(). */ void geometry_complete(int card_int_1, int card_int_2); /*! 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. */ void medium_parameters(nec_float permittivity, nec_float permeability) { em::constants::permittivity = permittivity; em::constants::permeability = permeability; } /*! 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 */ 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); /*! 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. */ void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); /*! \brief Add an helix to the geometry, \remark 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. */ 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); /*! "fr" card, frequency parameters \verbatim FREQUENCY I1- O= LINEAR STEP, 1=MULTIPLICATIVE I2- NO. STEPS, BLANK=1 F1- FREQUENCY OR START FREQUENCY F2- FREQ INCREMENT, ADD OR MULTIPLY \endverbatim */ void fr_card(int in_ifrq, int in_nfrq, nec_float in_freq_mhz, nec_float in_del_freq); /*! 1: "ld" card, loading parameters \verbatim 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 \endverbatim */ void ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3); /*! \brief Ground parameters under the antenna \remark 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. \param ground_type (was IPERF) Ground-type flag. The options are: \arg \c -1 - Nullifies ground parameters previously used and sets free-space condition. The remainder of the parameters should be zero in this case. \arg \c O - Finite ground, reflection-coefficient approximation. \arg \c 1 - Perfectly conducting ground. \arg \c 2 - Finite ground, Sommerfeld/Norton method. \param rad_wire_count (was NRADL) - Number of radial wires in the ground screen approximation; Set to zero implies no ground screen. \param EPSE (F1) - Relative dielectric constant for ground in the vicinity of the antenna. Set to zero in case of a perfect ground. \param 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|. \remark Options for Remaining Floating Point Fields (F3-F6): \li a. For an infinite ground plane, F3 through F6 are blank. \li 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. \li 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. */ 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); /*! "ex" card, excitation parameters \verbatim 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) \endverbatim */ 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); /*! 5: "tl" card, transmission line parameters \remark To generate a transmission line between any two points on the structure. Characteristic impedance, length, and shunt admittance are the defining parameters. \verbatim 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 \endverbatim */ 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); /*! 4: "nt" card, network parameters \verbatim 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) \endverbatim */ 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); /*! "xq" execute card - calc. including radiated fields \verbatim 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 \endverbatim */ void xq_card(int itmp1); /*! "gd" card, ground representation */ void gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4); /*! \brief Standard radiation pattern parameters \param calc_mode This 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: \arg \c 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. \arg \c 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.) \arg \c 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. \arg \c 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. \arg \c 4 - radial wire ground screen centered at origin. \arg \c 5 - both radial wire ground screen and linear cliff. \arg \c 6 - both radial wire ground screen ant circular cliff. \param n_theta The number of theta angles. \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 *** ******************************************************/ void all_jobs_completed() { } void write_results(ostream& os) { m_results.write(os); } /*! \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); /*no more used */ 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(); void print_input_impedance(); void print_power_budget(void); void structure_segment_loading(); enum excitation_return excitation_loop(int in_freq_loop_state, int mhz); void setup_excitation(); /* 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; nec_structure_currents* structure_currents; 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, const 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(const 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__ */ necpp-1.5.0+cvs20101003/src/c_ggrid.cpp0000644000175000017500000003047011106432011015564 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_ggrid.h" #include "common.h" #include "nec_output.h" // for DEBUG_TRACE() #include //#define CONST4 nec_complex(0.0,em::impedance() / 2.0) int c_ggrid::m_nxa[3] = {11,17,9}; int c_ggrid::m_nya[3] = {10,5,8}; nec_float c_ggrid::m_dxa[3] = {.02,.05,.1}; nec_float c_ggrid::m_dya[3] = {.1745329252,.0872664626,.1745329252}; nec_float c_ggrid::m_xsa[3] = {0.,.2,.2}; nec_float c_ggrid::m_ysa[3] = {0.,0.,.3490658504}; /*! \brief interpolate (was intrp) uses bivariate cubic interpolation to obtain the values of 4 functions at the point (x,y). */ void c_ggrid::interpolate( nec_float x, nec_float y, nec_complex *f1, nec_complex *f2, nec_complex *f3, nec_complex *f4 ) { static int ix, iy, ixs=-10, iys=-10, igrs=-10, ixeg=0, iyeg=0; static int nxm2, nym2, nxms, nyms, nd, ndp; static nec_float dx = 1., dy = 1., xs = 0., ys = 0., xz, yz; static nec_complex a[4][4], b[4][4], c[4][4], d[4][4]; static int nda[3] = {11,17,9}, ndpa[3] = {110, 85, 72}; nec_complex p1, p2, p3, p4, fx1, fx2, fx3, fx4; bool skip_recalculation = false; if( (x < xs) || (y < ys) ) skip_recalculation = true; else { ix = (int)((x-xs) / dx)+1; iy = (int)((y-ys) / dy)+1; } /* if point lies in same 4 by 4 point region */ /* as previous point, old values are reused. */ if( (ix < ixeg) || (iy < iyeg) || (std::abs(ix - ixs) >= 2) || (std::abs(iy - iys) >= 2) || (skip_recalculation == false) ) { /* determine correct grid and grid region */ int igr; if( x <= m_xsa[1]) igr=0; else { if( y > m_ysa[2]) igr=2; else igr=1; } if( igr != igrs) { igrs= igr; dx= m_dxa[igrs]; dy= m_dya[igrs]; xs= m_xsa[igrs]; ys= m_ysa[igrs]; nxm2= m_nxa[igrs]-2; nym2= m_nya[igrs]-2; nxms=(( nxm2+1)/3)*3+1; nyms=(( nym2+1)/3)*3+1; nd= nda[igrs]; ndp= ndpa[igrs]; ix= (int)(( x- xs)/ dx)+1; iy= (int)(( y- ys)/ dy)+1; } /* if( igr != igrs) */ ixs=(( ix-1)/3)*3+2; if( ixs < 2) ixs=2; ixeg=-10000; if( ixs > nxm2) { ixs= nxm2; ixeg= nxms; } iys=(( iy-1)/3)*3+2; if( iys < 2) iys=2; iyeg=-10000; if( iys > nym2) { iys= nym2; iyeg= nyms; } /* compute coefficients of 4 cubic polynomials in x for */ /* the 4 grid values of y for each of the 4 functions */ int iadz= ixs+( iys-3)* nd- ndp; for (int k = 0; k < 4; k++ ) { iadz += ndp; int iadd = iadz; for (int i = 0; i < 4; i++ ) { iadd += nd; switch( igrs ) { case 0: p1= m_ar1[iadd-2]; p2= m_ar1[iadd-1]; p3= m_ar1[iadd]; p4= m_ar1[iadd+1]; break; case 1: p1= m_ar2[iadd-2]; p2= m_ar2[iadd-1]; p3= m_ar2[iadd]; p4= m_ar2[iadd+1]; break; case 2: p1= m_ar3[iadd-2]; p2= m_ar3[iadd-1]; p3= m_ar3[iadd]; p4= m_ar3[iadd+1]; } /* switch( igrs ) */ a[i][k]=( p4- p1+3.*( p2- p3))*.1666666667; b[i][k]=( p1-2.* p2+ p3)*.5; c[i][k]= p3-(2.* p1+3.* p2+ p4)*.1666666667; d[i][k]= p2; } /* for ( i = 0; i < 4; i++ ) */ } /* for ( k = 0; k < 4; k++ ) */ xz=( ixs-1)* dx+ xs; yz=( iys-1)* dy+ ys; } /* if( (abs(ix- ixs) >= 2) || */ /* evaluate polymomials in x and use cubic */ /* interpolation in y for each of the 4 functions. */ nec_float xx=( x- xz)/ dx; nec_float yy=( y- yz)/ dy; fx1=(( a[0][0]* xx+ b[0][0])* xx+ c[0][0])* xx+ d[0][0]; fx2=(( a[1][0]* xx+ b[1][0])* xx+ c[1][0])* xx+ d[1][0]; fx3=(( a[2][0]* xx+ b[2][0])* xx+ c[2][0])* xx+ d[2][0]; fx4=(( a[3][0]* xx+ b[3][0])* xx+ c[3][0])* xx+ d[3][0]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f1=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][1]* xx+ b[0][1])* xx+ c[0][1])* xx+ d[0][1]; fx2=(( a[1][1]* xx+ b[1][1])* xx+ c[1][1])* xx+ d[1][1]; fx3=(( a[2][1]* xx+ b[2][1])* xx+ c[2][1])* xx+ d[2][1]; fx4=(( a[3][1]* xx+ b[3][1])* xx+ c[3][1])* xx+ d[3][1]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f2=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][2]* xx+ b[0][2])* xx+ c[0][2])* xx+ d[0][2]; fx2=(( a[1][2]* xx+ b[1][2])* xx+ c[1][2])* xx+ d[1][2]; fx3=(( a[2][2]* xx+ b[2][2])* xx+ c[2][2])* xx+ d[2][2]; fx4=(( a[3][2]* xx+ b[3][2])* xx+ c[3][2])* xx+ d[3][2]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f3=(( p1* yy+ p2)* yy+ p3)* yy*.1666666667+ fx2; fx1=(( a[0][3]* xx+ b[0][3])* xx+ c[0][3])* xx+ d[0][3]; fx2=(( a[1][3]* xx+ b[1][3])* xx+ c[1][3])* xx+ d[1][3]; fx3=(( a[2][3]* xx+ b[2][3])* xx+ c[2][3])* xx+ d[2][3]; fx4=(( a[3][3]* xx+ b[3][3])* xx+ c[3][3])* xx+ d[3][3]; p1= fx4- fx1+3.*( fx2- fx3); p2=3.*( fx1-2.* fx2+ fx3); p3=6.* fx3-2.* fx1-3.* fx2- fx4; *f4=(( p1* yy+ p2)* yy+ p3)* yy*.16666666670+ fx2; } #include "electromag.h" /*! was SOMNEC in the original NEC-2 source code */ void c_ggrid::sommerfeld( nec_float epr, nec_float sig, nec_float freq_mhz ) { static nec_complex const1_neg = - nec_complex(0.0,4.771341189); static nec_complex CONST4(0.0, em::impedance() / 2.0); nec_float wavelength, dr, dth, r, rk, thet, tfac1, tfac2; nec_complex erv, ezv, erh, eph, cl1, cl2, con; if(sig >= 0.0) { wavelength = em::speed_of_light() / (1.0e6 * freq_mhz); m_epscf = nec_complex(epr,-sig*wavelength*em::impedance_over_2pi()); } else m_epscf=nec_complex(epr,sig); m_evlcom.m_ck2 = two_pi(); m_evlcom.m_ck2sq = m_evlcom.m_ck2*m_evlcom.m_ck2; /* Sommerfeld integral evaluation uses exp(-jwt), NEC uses exp(+jwt), hence need conjg(epscf). Conjugate of fields occurs in subroutine evlua. */ m_evlcom.m_ck1sq=m_evlcom.m_ck2sq*conj(m_epscf); m_evlcom.m_ck1=sqrt(m_evlcom.m_ck1sq); m_evlcom.m_ck1r=real(m_evlcom.m_ck1); m_evlcom.m_tkmag=100.0*abs(m_evlcom.m_ck1); m_evlcom.m_tsmag=100.0*norm(m_evlcom.m_ck1); // TCAM changed from previous line m_evlcom.m_cksm=m_evlcom.m_ck2sq/(m_evlcom.m_ck1sq+m_evlcom.m_ck2sq); m_evlcom.m_ct1=.5*(m_evlcom.m_ck1sq-m_evlcom.m_ck2sq); erv=m_evlcom.m_ck1sq*m_evlcom.m_ck1sq; ezv=m_evlcom.m_ck2sq*m_evlcom.m_ck2sq; m_evlcom.m_ct2=.125*(erv-ezv); erv *= m_evlcom.m_ck1sq; ezv *= m_evlcom.m_ck2sq; m_evlcom.m_ct3=.0625*(erv-ezv); /* loop over 3 grid regions */ for (int k = 0; k < 3; k++ ) { int nr = m_nxa[k]; int nth = m_nya[k]; dr = m_dxa[k]; dth = m_dya[k]; r = m_xsa[k]-dr; int irs=1; if(k == 0) { r=m_xsa[k]; irs=2; } /* loop over r. (r=sqrt(m_evlcom.m_rho**2 + (z+h)**2)) */ for (int ir = irs-1; ir < nr; ir++ ) { r += dr; thet = m_ysa[k]-dth; /* loop over theta. (theta=atan((z+h)/m_evlcom.m_rho)) */ for (int ith = 0; ith < nth; ith++ ) { thet += dth; m_evlcom.m_rho=r*cos(thet); m_evlcom.m_zph=r*sin(thet); if(m_evlcom.m_rho < 1.e-7) m_evlcom.m_rho=1.e-8; if(m_evlcom.m_zph < 1.e-7) m_evlcom.m_zph=0.; m_evlcom.evlua( &erv, &ezv, &erh, &eph ); rk=m_evlcom.m_ck2*r; con=const1_neg*r/nec_complex(cos(rk),-sin(rk)); switch( k ) { case 0: m_ar1[ir+ith*11+ 0]=erv*con; m_ar1[ir+ith*11+110]=ezv*con; m_ar1[ir+ith*11+220]=erh*con; m_ar1[ir+ith*11+330]=eph*con; break; case 1: m_ar2[ir+ith*17+ 0]=erv*con; m_ar2[ir+ith*17+ 85]=ezv*con; m_ar2[ir+ith*17+170]=erh*con; m_ar2[ir+ith*17+255]=eph*con; break; case 2: m_ar3[ir+ith*9+ 0]=erv*con; m_ar3[ir+ith*9+ 72]=ezv*con; m_ar3[ir+ith*9+144]=erh*con; m_ar3[ir+ith*9+216]=eph*con; } /* switch( k ) */ } /* for ( ith = 0; ith < nth; ith++ ) */ } /* for ( ir = irs-1; ir < nr; ir++; ) */ } /* for ( k = 0; k < 3; k++; ) */ /* fill grid 1 for r equal to zero. */ cl2 = -CONST4*(m_epscf-1.)/(m_epscf+1.); cl1 = cl2/(m_epscf+1.); ezv = m_epscf*cl1; thet=-dth; int nth = m_nya[0]; for (int ith = 0; ith < nth; ith++ ) { thet += dth; if( (ith+1) != nth ) { tfac2=cos(thet); tfac1=(1.-sin(thet))/tfac2; tfac2=tfac1/tfac2; erv=m_epscf*cl1*tfac1; erh=cl1*(tfac2-1.)+cl2; eph=cl1*tfac2-cl2; } else { erv=0.; erh=cl2-.5*cl1; eph=-erh; } m_ar1[0+ith*11+ 0]=erv; m_ar1[0+ith*11+110]=ezv; m_ar1[0+ith*11+220]=erh; m_ar1[0+ith*11+330]=eph; } } /* fbar is the Sommerfeld attenuation function for numerical distance . */ nec_complex fbar(const nec_complex& p ); nec_complex fbar(const nec_complex& p ) { static nec_float TOSP = 2.0 / sqrt_pi(); int minus; nec_float tms, sms; nec_complex z, zs, sum, pow, term, fbar; z= cplx_01()* sqrt( p); if ( abs( z) <= 3.) { /* series expansion */ zs= z* z; sum= z; pow= z; for (int i = 1; i <= 100; i++ ) { pow=- pow* zs/ (nec_float)i; term= pow/(2.* i+1.); sum = sum + term; tms = norm(term); sms = norm(sum); if ( tms/sms < ACCS) break; } fbar=1.-(1.- sum* TOSP)* z* exp( zs)* sqrt_pi(); return( fbar ); } /* if ( abs( z) <= 3.) */ /* asymptotic expansion */ if ( real( z) < 0.) { minus=1; z=- z; } else minus=0; zs=.5/( z* z); sum=cplx_00(); term=cplx_10(); for (int i = 1; i <= 6; i++ ) { term =- term*(2.*i -1.)* zs; sum += term; } if ( minus == 1) sum -= 2.0 * sqrt_pi() * z* exp( z* z); fbar=- sum; return( fbar ); } /* gwave computes the electric field, including ground wave, of a */ /* current element over a ground plane using formulas of k.a. norton */ /* (proc. ire, sept., 1937, pp.1203,1236.) */ void gwave(nec_complex& erv, nec_complex& ezv, nec_complex& erh, nec_complex& ezh, nec_complex& eph, c_ground_wave& ground_wave) { static nec_complex CONST4(0.0,em::impedance() / 2.0); nec_float sppp, sppp2, cppp2, cppp, spp, spp2, cpp2, cpp; nec_complex rk1, rk2, t1, t2, t3, t4, p1, rv; nec_complex omr, w, f, q1, rh, v, g, xr1, xr2; nec_complex x1, x2, x3, x4, x5, x6, x7; sppp= ground_wave.zmh/ ground_wave.r1; sppp2= sppp* sppp; cppp2=1.- sppp2; if ( cppp2 < 1.0e-20) cppp2=1.0e-20; cppp= sqrt( cppp2); spp= ground_wave.zph/ ground_wave.r2; spp2= spp* spp; cpp2=1.- spp2; if ( cpp2 < 1.0e-20) cpp2=1.0e-20; cpp= sqrt( cpp2); rk1=- two_pi_j()* ground_wave.r1; rk2=- two_pi_j()* ground_wave.r2; t1=1. -ground_wave.u2* cpp2; t2= sqrt( t1); t3=(1. -1./ rk1)/ rk1; t4=(1. -1./ rk2)/ rk2; p1= rk2* ground_wave.u2* t1/(2.* cpp2); rv=( spp- ground_wave.u* t2)/( spp+ ground_wave.u* t2); omr=1.- rv; w=1./ omr; w= nec_complex(4.0,0.0)* p1* w* w; f= fbar( w); q1= rk2* t1/(2.* ground_wave.u2* cpp2); rh=( t2- ground_wave.u* spp)/( t2+ ground_wave.u* spp); v=1./(1.+ rh); v=nec_complex(4.0,0.0)* q1* v* v; g= fbar( v); xr1= ground_wave.xx1/ ground_wave.r1; xr2= ground_wave.xx2/ ground_wave.r2; x1= cppp2* xr1; x2= rv* cpp2* xr2; x3= omr* cpp2* f* xr2; x4= ground_wave.u* t2* spp*2.* xr2/ rk2; x5= xr1* t3*(1.-3.* sppp2); x6= xr2* t4*(1.-3.* spp2); ezv=( x1+ x2+ x3- x4- x5- x6)* (-CONST4); x1= sppp* cppp* xr1; x2= rv* spp* cpp* xr2; x3= cpp* omr* ground_wave.u* t2* f* xr2; x4= spp* cpp* omr* xr2/ rk2; x5=3.* sppp* cppp* t3* xr1; x6= cpp* ground_wave.u* t2* omr* xr2/ rk2*.5; x7=3.* spp* cpp* t4* xr2; erv=-( x1+ x2- x3+ x4- x5+ x6- x7)* (-CONST4); ezh=-( x1- x2+ x3- x4- x5- x6+ x7)* (-CONST4); x1= sppp2* xr1; x2= rv* spp2* xr2; x4= ground_wave.u2* t1* omr* f* xr2; x5= t3*(1.-3.* cppp2)* xr1; x6= t4*(1.-3.* cpp2)*(1.- ground_wave.u2*(1.+ rv)- ground_wave.u2* omr* f)* xr2; x7= ground_wave.u2* cpp2* omr*(1.-1./ rk2)*( f*( ground_wave.u2* t1- spp2-1./ rk2)+1./rk2)* xr2; erh=( x1- x2- x4- x5+ x6+ x7)* (-CONST4); x1= xr1; x2= rh* xr2; x3=( rh+1.)* g* xr2; x4= t3* xr1; x5= t4*(1.- ground_wave.u2*(1.+ rv)- ground_wave.u2* omr* f)* xr2; x6=.5* ground_wave.u2* omr*( f*( ground_wave.u2* t1- spp2-1./ rk2)+1./ rk2)* xr2/ rk2; eph=-( x1- x2+ x3- x4+ x5+ x6)* (-CONST4); } necpp-1.5.0+cvs20101003/src/common.h0000644000175000017500000000367011451606231015137 0ustar numanuma#ifndef __common__ #define __common__ /* Various Definitions for nec2++ Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include /*! \brief Change basic type used by nec2++ This typedef allows us to use nec2++ with a different complex number precision. For example float, or long double. */ typedef double nec_float; typedef std::complex nec_complex; /* Version information */ #define nec_version_major "1" #define nec_version_minor "5" #define nec_version_build "0" #ifndef nec_build_date #define nec_build_date "2010-10-02" #endif #ifndef build_version #define nec_version nec_version_major "." nec_version_minor "." nec_version_build " [" nec_build_date "]" #else #define nec_version build_version " [" nec_build_date "]" #endif /* These are some common constants that should be moved into more appropriate locations */ #define ACCS 1.E-12 #define CONST2 4.771341188 #define SMIN 1.e-3 /** 0=E VOLTAGE (A), 1=LINEAR WAVE (B), 2= R CIRC WAVE (B) 3=L CIRC WAVE (B), 4= CURRENT (C), 5= VOLTAGE DISC. */ enum excitation_type { EXCITATION_VOLTAGE = 0, EXCITATION_LINEAR = 1, EXCITATION_CIRC_RIGHT = 2, EXCITATION_CIRC_LEFT = 3, EXCITATION_CURRENT = 4, EXCITATION_VOLTAGE_DISC = 5 }; #endif /* __common__ */ necpp-1.5.0+cvs20101003/src/AntennaInput.h0000644000175000017500000000644610310210756016253 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Antenna_Input__ #define __Antenna_Input__ #include #include "BaseInput.h" /* - - - ANTENNA INPUT PARAMETERS - - - TAG SEG. VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER NO. NO. REAL IMAG. REAL IMAG. REAL IMAG. REAL IMAG. (WATTS) 0 * 5 1.00000E+00 0.00000E+00 6.64451E-03-3.86651E-03 1.12429E+02 6.54238E+01 6.64451E-03-3.86651E-03 3.32225E-03 --------- ANTENNA INPUT PARAMETERS --------- TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER NO. NO. REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS) 0 5 1.0000E+00 0.0000E+00 6.6443E-03 -3.8666E-03 1.1243E+02 6.5428E+01 6.6443E-03 -3.8666E-03 3.3222E-03 */ class AntennaInput : public BaseInput { public: vector tag, seg, vRe, vIm, iRe, iIm, zRe, zIm, power; long n_items; AntennaInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("ANTENNA INPUT PARAMETERS"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("(WATTS)",0) == string::npos) line = readline(); line = readline(); // get rid of '*' characters if (line.find("*",0) != string::npos) { line.erase(line.find("*",0),1); } stringstream ss(line); tag.push_back(read_fixed(ss)); seg.push_back(read_fixed(ss)); vRe.push_back(read_fixed(ss)); vIm.push_back(read_fixed(ss)); iRe.push_back(read_fixed(ss)); iIm.push_back(read_fixed(ss)); zRe.push_back(read_fixed(ss)); zIm.push_back(read_fixed(ss)); power.push_back(read_fixed(ss)); cout << "Impedance : " << zRe[n_items] << " " << zIm[n_items] << endl; n_items++; } } } bool equalto(const AntennaInput& ai) { if (difference(ai) > 1e-4) return false; return true; } double difference(const AntennaInput& ai) { double ret = 0; if (n_items != ai.n_items) return 1.0; try { for (long i=0; i #include /* ---------------------------------------------------------------------*/ nec_output_file::nec_output_file() { set_file(NULL); set_error_mode(false); } void nec_output_file::set_file(FILE* in_fp) { m_output_fp = in_fp; set_indent(0); } void nec_output_file::set_error_mode(bool f) { m_error_mode = f; } /* private */ void nec_output_file::do_output(const char* str) { if (NULL == m_output_fp) return; fprintf(m_output_fp, str); if (m_error_mode) fprintf(stderr,str); } void nec_output_file::endl(int n_lines) { for (int i=0; i < n_lines; i++) do_output("\n"); m_require_indent = true; } void nec_output_file::end_section() { endl(3); } void nec_output_file::set_indent(int n) { m_indent = n; m_require_indent = true; indent(); } void nec_output_file::indent() { if (m_require_indent) { for (int i=0; i< m_indent; i++) do_output(" "); m_require_indent = false; } } void nec_output_file::line(const char* in_str) { string(in_str,true); } void nec_output_file::string(const char* in_str, bool require_endl) { indent(); do_output(in_str); if (require_endl) endl(); } void nec_output_file::real(nec_float in_nec_float) { real_out(11,4,in_nec_float,true); } void nec_output_file::integer(long in_integer) { if (NULL == m_output_fp) return; fprintf(m_output_fp,"%ld",in_integer); if (m_error_mode) fprintf(stderr,"%ld",in_integer); } void nec_output_file::real_out(int w, int p, nec_float f, bool sci) { if (NULL == m_output_fp) return; std::stringstream ss; ss << "%" << w << "." << p; if (sci) ss << "E"; else ss << "f"; std::string s = ss.str(); const char* fmt = s.c_str(); fprintf(m_output_fp,fmt,f); if (m_error_mode) fprintf(stderr,fmt,f); } #include "stdarg.h" #include "safe_array.h" void nec_output_file::nec_printf(const char* fmt, ...) { if (NULL == m_output_fp) return; { va_list ap; /* special type for variable */ safe_array format(2048); /* argument lists */ int count = 0; int i, j; /* Need all these to store */ char c; /* values below in switch */ double d; unsigned u; char *s; void *v; va_start(ap, fmt); /* must be called before work */ while (*fmt) { for (j = 0; fmt[j] && fmt[j] != '%'; j++) format[j] = fmt[j]; /* not a format string */ if (j) { format[j] = '\0'; count += fprintf(m_output_fp, format.data()); /* log it verbatim */ fmt += j; } else { for (j = 0; !isalpha(fmt[j]); j++) { /* find end of format specifier */ format[j] = fmt[j]; if (j && fmt[j] == '%') /* special case printing '%' */ break; } format[j] = fmt[j]; /* finish writing specifier */ format[j + 1] = '\0'; /* don't forget NULL terminator */ fmt += j + 1; switch (format[j]) { /* cases for all specifiers */ case 'd': case 'i': /* many use identical actions */ i = va_arg(ap, int); /* process the argument */ count += fprintf(m_output_fp, format.data(), i); /* and log it */ break; case 'o': case 'x': case 'X': case 'u': u = va_arg(ap, unsigned); count += fprintf(m_output_fp, format.data(), u); break; case 'c': c = (char) va_arg(ap, int); /* must cast! */ count += fprintf(m_output_fp, format.data(), c); break; case 's': s = va_arg(ap, char *); count += fprintf(m_output_fp, format.data(), s); break; case 'f': case 'e': case 'E': case 'g': case 'G': d = va_arg(ap, double); count += fprintf(m_output_fp, format.data(), d); break; case 'p': v = va_arg(ap, void *); count += fprintf(m_output_fp, format.data(), v); break; case 'n': count += fprintf(m_output_fp, "%d", count); break; case '%': count += fprintf(m_output_fp, "%%"); break; default: throw new nec_exception("Invalid format specifier in nec_printf()"); } } } va_end(ap); /* clean up */ } } necpp-1.5.0+cvs20101003/src/net_solve.cpp0000644000175000017500000004162211121076315016175 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This class is not fully functional yet. It will perform the network solution when done! */ #include "matrix_algebra.h" #include "electromag.h" #include "nec_ground.h" #include "c_geometry.h" #include #include "nec_results.h" extern nec_results s_results; #include "nec_output.h" extern nec_output_file s_output; extern nec_output_flags s_output_flags; extern nec_float wavelength; extern int nop; extern complex_array symmetry_array; /* subroutine netwk solves for structure currents for a given */ /* excitation including the effect of non-radiating networks if */ /* present. */ class c_network { public: c_network(); void net_solve( complex_array& cm, nec_complex *cmb, nec_complex *cmc, nec_complex *cmd, int_array& ip, complex_array& einc ); private: FILE *output_fp; c_geometry geometry; nec_ground ground; /* 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 /* 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; }; void c_network::net_solve( complex_array& cm, nec_complex *cmb, nec_complex *cmc, nec_complex *cmd, int_array& ip, complex_array& einc ) { /* Network buffers */ int_array ipnt, nteqa, ntsca; complex_array vsrc, rhs, cmn, rhnt, rhnx; bool jump1, jump2; int nteq=0, ntsc=0, nseg2, irow2=0; int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0; nec_float asmx, asa, y11r, y11i, y12r, y12i, y22r, y22i; nec_complex ymit, vlt, cux; neqz2= neq2; if ( neqz2 == 0) neqz2=1; input_power = 0.0; network_power_loss = 0.0; neqt= neq+ neq2; int ndimn = (2*network_count + voltage_source_count); /* Allocate network buffers */ if ( network_count > 0 ) { rhs.resize( geometry.n_plus_3m ); // this should probably be ndimn! rhnt.resize( ndimn ); rhnx.resize( ndimn); cmn.resize( ndimn * ndimn ); ntsca.resize( ndimn ); nteqa.resize( ndimn ); ipnt.resize( ndimn ); vsrc.resize( voltage_source_count ); } if ( ntsol == 0) { /* compute relative matrix asymmetry */ if ( masym != 0) { irow1=0; for( i = 0; i < network_count; i++ ) { nseg1= iseg1[i]; for( isc1 = 0; isc1 < 2; isc1++ ) { if ( irow1 == 0) { ipnt[irow1]= nseg1; nseg1= iseg2[i]; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } nseg1= iseg2[i]; } /* for( isc1 = 0; isc1 < 2; isc1++ ) */ } /* for( i = 0; i < network_count; i++ ) */ ASSERT(voltage_source_count >= 0); for( i = 0; i < voltage_source_count; i++ ) { nseg1= source_segment_array[i]; if ( irow1 == 0) { ipnt[irow1]= nseg1; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } } /* for( i = 0; i < voltage_source_count; i++ ) */ if ( irow1 >= 2) { for( i = 0; i < irow1; i++ ) { isc1 = ipnt[i]-1; asmx= geometry.segment_length[isc1]; for (int j = 0; j < neqt; j++ ) rhs[j] = cplx_00(); rhs[isc1] = cplx_10(); solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < irow1; j++ ) { isc1= ipnt[j]-1; cmn[j+i*ndimn]= rhs[isc1]/ asmx; } } /* for( i = 0; i < irow1; i++ ) */ asmx=0.0; asa=0.0; for( i = 1; i < irow1; i++ ) { for (int j = 0; j < i; j++ ) { cux = cmn[i+j*ndimn]; nec_float pwr= abs(( cux- cmn[j+i*ndimn])/ cux); asa += pwr* pwr; if ( pwr >= asmx) { asmx= pwr; nteq= ipnt[i]; ntsc= ipnt[j]; } } /* for( j = 0; j < i; j++ ) */ } /* for( i = 1; i < irow1; i++ ) */ asa= sqrt( asa*2./ (nec_float)( irow1*( irow1-1))); fprintf( output_fp, "\n\n" " MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n" " MATRIX IS %10.3E FOR SEGMENTS %d AND %d\n" " RMS RELATIVE ASYMMETRY IS %10.3E", asmx, nteq, ntsc, asa ); } /* if ( irow1 >= 2) */ } /* if ( masym != 0) */ /* solution of network equations */ if ( network_count != 0) { // zero the cmn array, and the rhnx array cmn.fill(cplx_00()); rhnx.fill(cplx_00()); /* for( i = 0; i < ndimn; i++ ) { rhnx[i]=cplx_00(); for (int j = 0; j < ndimn; j++ ) cmn[j+i*ndimn]=cplx_00(); } */ nteq=0; ntsc=0; /* sort network and source data and assign equation numbers to segments */ for (int j = 0; j < network_count; j++ ) { nseg1= iseg1[j]; nseg2= iseg2[j]; if ( ntyp[j] <= 1) { y11r= x11r[j]; y11i= x11i[j]; y12r= x12r[j]; y12i= x12i[j]; y22r= x22r[j]; y22i= x22i[j]; } else { y22r= two_pi() * x11i[j]/ wavelength; y12r=0.; y12i=1./( x11r[j]* sin( y22r)); y11r= x12r[j]; y11i=- y12i* cos( y22r); y22r= x22r[j]; y22i= y11i+ x22i[j]; y11i= y11i+ x12i[j]; if ( ntyp[j] != 2) { y12r=- y12r; y12i=- y12i; } } /* if ( ntyp[j] <= 1) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg1 == source_segment_array[i]) { isc1 = i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc1=-1; for( i = 0; i < nteq; i++ ) { if ( nseg1 == nteqa[i]) { irow1 = i; jump2 = true; break; } } if ( ! jump2 ) { irow1= nteq; nteqa[nteq]= nseg1; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg1 == ntsca[i]) { irow1 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow1= ndimn- (ntsc+1); ntsca[ntsc]= nseg1; vsrc[ntsc]= source_voltage_array[isc1]; ntsc++; } } /* if ( ! jump1 ) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg2 == source_segment_array[i]) { isc2= i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc2=-1; for( i = 0; i < nteq; i++ ) { if ( nseg2 == nteqa[i]) { irow2= i; jump2 = true; break; } } if ( ! jump2 ) { irow2= nteq; nteqa[nteq]= nseg2; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg2 == ntsca[i]) { irow2 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow2= ndimn- (ntsc+1); ntsca[ntsc]= nseg2; vsrc[ntsc]= source_voltage_array[isc2]; ntsc++; } } /* if ( ! jump1 ) */ /* fill network equation matrix and right hand side vector with */ /* network short-circuit admittance matrix coefficients. */ if ( isc1 == -1) { cmn[irow1+irow1*ndimn] -= nec_complex( y11r, y11i)* geometry.segment_length[nseg1-1]; cmn[irow1+irow2*ndimn] -= nec_complex( y12r, y12i)* geometry.segment_length[nseg1-1]; } else { rhnx[irow1] += nec_complex( y11r, y11i)* source_voltage_array[isc1]/wavelength; rhnx[irow2] += nec_complex( y12r, y12i)* source_voltage_array[isc1]/wavelength; } if ( isc2 == -1) { cmn[irow2+irow2*ndimn] -= nec_complex( y22r, y22i)* geometry.segment_length[nseg2-1]; cmn[irow2+irow1*ndimn] -= nec_complex( y12r, y12i)* geometry.segment_length[nseg2-1]; } else { rhnx[irow1] += nec_complex( y12r, y12i)* source_voltage_array[isc2]/wavelength; rhnx[irow2] += nec_complex( y22r, y22i)* source_voltage_array[isc2]/wavelength; } } /* for( j = 0; j < network_count; j++ ) */ /* add interaction matrix admittance elements to network equation matrix */ for( i = 0; i < nteq; i++ ) { for (int j = 0; j < neqt; j++ ) rhs[j] = cplx_00(); irow1= nteqa[i]-1; rhs[irow1]=cplx_10(); solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < nteq; j++ ) { irow1= nteqa[j]-1; cmn[i+j*ndimn] += rhs[irow1]; } } /* for( i = 0; i < nteq; i++ ) */ /* factor network equation matrix */ lu_decompose( nteq, cmn, ipnt, ndimn); } /* if ( network_count != 0) */ } /* if ( ntsol != 0) */ if (0 == network_count) { /* solve for currents when no networks are present */ solves( cm, ip, einc, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); ntsc=0; } else // if ( network_count != 0) { /* add to network equation right hand side */ /* the terms due to element interactions */ for( i = 0; i < neqt; i++ ) rhs[i]= einc[i]; solves( cm, ip, rhs, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; rhnt[i]= rhnx[i]+ rhs[irow1]; } /* solve network equations */ solve( nteq, cmn, ipnt, rhnt, ndimn); /* add fields due to network voltages to electric fields */ /* applied to structure and solve for induced current */ for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; einc[irow1] -= rhnt[i]; } solves( cm, ip, einc, neq, 1, geometry.np, geometry.n, geometry.mp, geometry.m, nop, symmetry_array); geometry.get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); if ( nprint == 0) { fprintf( output_fp, "\n\n\n" " " "--------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) " " IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY (WATTS)" ); } for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* geometry.segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; int segment_tag = geometry.segment_tags[irow1]; nec_float power = em::power(voltage,current); network_power_loss= network_power_loss - power; if ( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_number, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } for( i = 0; i < ntsc; i++ ) { irow1= ntsca[i]-1; vlt= vsrc[i]; cux= einc[irow1]* wavelength; ymit= cux/ vlt; zped= vlt/ cux; irow2= geometry.segment_tags[irow1]; nec_float pwr= em::power(vlt,cux); network_power_loss= network_power_loss- pwr; if ( nprint == 0) fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, irow1+1, real(vlt), imag(vlt), real(cux), imag(cux), real(zped), imag(zped), real(ymit), imag(ymit), pwr ); } /* for( i = 0; i < ntsc; i++ ) */ } /* if ( network_count != 0) */ if ( (voltage_source_count+nvqd) == 0) return; nec_antenna_input* antenna_input = new nec_antenna_input(); s_results.add(antenna_input); s_output.end_section(); fprintf( output_fp, " " "--------- ANTENNA INPUT PARAMETERS ---------" ); fprintf( output_fp, "\n" " TAG SEG VOLTAGE (VOLTS) " "CURRENT (AMPS) IMPEDANCE (OHMS) " " ADMITTANCE (MHOS) POWER\n" " NO. NO. REAL IMAGINARY" " REAL IMAGINARY REAL " "IMAGINARY REAL IMAGINARY (WATTS)" ); for( i = 0; i < voltage_source_count; i++ ) { int segment_index = source_segment_array[i]-1; nec_complex voltage = source_voltage_array[i]; nec_complex current = einc[segment_index] * wavelength; bool add_as_network_loss = false; // the following loop is completely mysterious! for (int j = 0; j < ntsc; j++ ) { // I am now almost sure that the following code is not correct. // This modifies the current, however if the inner loop is executed more // than once, then only the last current modification is kept! if ( ntsca[j] == segment_index+1) { int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; // I wish I knew what was going on here... nec_complex temp = rhnx[row_index]; // renamed current -> temp to avoid confusion for (int k = 0; k < nteq; k++ ) temp -= cmn[k + row_offset]*rhnt[k]; current = (temp + einc[segment_index])* wavelength; add_as_network_loss = true; #warning "This loop is messed up. The j is inside another j loop" // I have removed the j from the "for (int k = 0; k < nteq; k++ )" loop // and placed this"j=nteq" statement here. j = nteq; } } nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); if ( add_as_network_loss ) network_power_loss += power; input_power += power; int segment_tag = geometry.segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } /* for( i = 0; i < voltage_source_count; i++ ) */ for( i = 0; i < nvqd; i++ ) { int segment_index = ivqd[i]-1; nec_complex voltage = vqd[i]; nec_complex _ai( air[segment_index], aii[segment_index]); nec_complex _bi( bir[segment_index], bii[segment_index]); nec_complex _ci( cir[segment_index], cii[segment_index]); // segment length is measured in wavelengths. The pase is therefore the length in wavelengths // multiplied by pi(). nec_float segment_length_phase = geometry.segment_length[segment_index] * pi(); // TCAM CHANGED TO pi() (from TP*.5)!! nec_complex current = ( _ai - _bi* sin(segment_length_phase)+ _ci * cos(segment_length_phase)) * wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); input_power += power; int segment_tag = geometry.segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } /* for( i = 0; i < nvqd; i++ ) */ } flerf necpp-1.5.0+cvs20101003/src/nec_structure_currents.h0000644000175000017500000001145111130554610020452 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_structure_currents__ #define __nec_structure_currents__ #include "nec_results.h" #include "math_util.h" #include "nec_context.h" class nec_context; class c_geometry; class nec_structure_currents : public nec_base_result { public: /*Structure currents*/ nec_structure_currents(nec_context * in_context, enum excitation_type in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6); static std::string hpol(enum excitation_type e); void analyze(); virtual ~nec_structure_currents() { } virtual void write_to_file(ostream& os) { write_to_file_aux(os); } virtual enum nec_result_type get_result_type() { return RESULT_STRUCTURE_CURRENTS; } int get_iptflg() { return iptflg; } int get_iptflq() { return iptflq; } int get_n(); int get_m(); vector get_current_segment_number() { return _current_segment_number; } vector get_current_segment_tag() { return _current_segment_tag; } vector get_current_segment_center_x() { return _current_segment_center_x; } vector get_current_segment_center_y() { return _current_segment_center_y; } vector get_current_segment_center_z() { return _current_segment_center_z; } vector get_current_segment_length() { return _current_segment_length; } vector get_current_theta() { return _current_theta; } vector get_current_phi() { return _current_phi; } vector get_current() { return _current; } vector get_q_density_segment_number() { return _q_density_segment_number; } vector get_q_density_segment_tag() { return _q_density_segment_tag; } vector get_q_density_segment_center_x() { return _q_density_segment_center_x; } vector get_q_density_segment_center_y() { return _q_density_segment_center_y; } vector get_q_density_segment_center_z() { return _q_density_segment_center_z; } vector get_q_density_segment_length() { return _q_density_segment_length; } vector get_q_density() { return _q_density; } vector get_patch_number() { return _patch_number; } vector get_patch_center_x() { return _patch_center_x; } vector get_patch_center_y() { return _patch_center_y; } vector get_patch_center_z() { return _patch_center_z; } vector get_patch_tangent_vector1() { return _patch_tangent_vector1; } vector get_patch_tangent_vector2() { return _patch_tangent_vector2; } vector get_patch_e_x() { return _patch_e_x; } vector get_patch_e_y() { return _patch_e_y; } vector get_patch_e_z() { return _patch_e_z; } private: nec_context *m_context; c_geometry * m_geometry; enum excitation_type pattype; int iptflg; int iptag, iptagf, iptagt; int iptflq; int iptaq, iptaqf, iptaqt; int nload; nec_float xpr3, xpr6; nec_float wavelength; nec_float freq_mhz; nec_float structure_power_loss; int current_nb_elements; int q_density_nb_elements; int q_density_last_printed; int patch_nb_elements; complex_array zarray; real_array fnorm; vector _current_segment_number; vector _current_segment_tag; vector _current_segment_center_x, _current_segment_center_y, _current_segment_center_z; vector _current_segment_length; vector _current_theta, _current_phi; vector _current; vector _q_density_segment_number; vector _q_density_segment_tag; vector _q_density_segment_center_x, _q_density_segment_center_y, _q_density_segment_center_z; vector _q_density_segment_length; vector _q_density; vector _patch_number; vector _patch_center_x, _patch_center_y, _patch_center_z; vector _patch_tangent_vector1, _patch_tangent_vector2; vector _patch_e_x, _patch_e_y, _patch_e_z; void write_to_file_aux(ostream& os); }; #endif necpp-1.5.0+cvs20101003/src/libNEC.cpp0000644000175000017500000002312111450075235015272 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2008 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "libnecpp.h" #include "nec_context.h" #include "nec_exception.h" #define NEC_ERROR_HANDLE(__x) { try { __x; } catch (nec_exception* ex) { return 1; }} #define NEC_VOID_HANDLE(__x) { try { __x; } catch (nec_exception* ex) { }} /*! \brief Create an nec_context and initialize it. Note: Do NOT delete or free the nec_context yourself, rather call nec_delete() to free memory associated with the nec simulation. */ nec_context* nec_create() { nec_context* ret = new nec_context(); ret->initialize(); return ret; } /*! \brief Delete an nec_context. */ long nec_delete(nec_context* in_context) { NEC_ERROR_HANDLE(delete in_context); return 0; } long nec_benchmark() { return long(100.0*nec_context::benchmark()); } void nec_wire(nec_context* in_context, int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad) { in_context->wire(tag_id, segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, rdel, rrad); } void nec_geometry_complete(nec_context* in_context, int card_int_1, int card_int_2) { in_context->geometry_complete(card_int_1, card_int_2); } /* Statistics about the Gain distribution */ double nec_gain_max(nec_context* in_context, int freq_index) { return in_context->get_gain_max(freq_index); } double nec_gain_min(nec_context* in_context, int freq_index) { return in_context->get_gain_min(freq_index); } double nec_gain_mean(nec_context* in_context, int freq_index) { return in_context->get_gain_mean(freq_index); } double nec_gain_sd(nec_context* in_context, int freq_index) { return in_context->get_gain_sd(freq_index); } /********************** RHCP ********************************/ double nec_gain_rhcp_max(nec_context* in_context, int freq_index) { return in_context->get_gain_rhcp_max(freq_index); } double nec_gain_rhcp_min(nec_context* in_context, int freq_index) { return in_context->get_gain_rhcp_min(freq_index); } double nec_gain_rhcp_mean(nec_context* in_context, int freq_index) { return in_context->get_gain_rhcp_mean(freq_index); } double nec_gain_rhcp_sd(nec_context* in_context, int freq_index) { return in_context->get_gain_rhcp_sd(freq_index); } /********************** LHCP ********************************/ double nec_gain_lhcp_max(nec_context* in_context, int freq_index) { return in_context->get_gain_lhcp_max(freq_index); } double nec_gain_lhcp_min(nec_context* in_context, int freq_index) { return in_context->get_gain_lhcp_min(freq_index); } double nec_gain_lhcp_mean(nec_context* in_context, int freq_index) { return in_context->get_gain_lhcp_mean(freq_index); } double nec_gain_lhcp_sd(nec_context* in_context, int freq_index) { return in_context->get_gain_lhcp_sd(freq_index); } /****************** IMPEDANCE CHARACTERISTICS *********************/ /*! \brief Impedance: Real Part */ double nec_impedance_real(nec_context* in_context, int freq_index) { return in_context->get_impedance_real(freq_index); } /*! \brief Impedance: Imaginary Part */ double nec_impedance_imag(nec_context* in_context, int freq_index) { return in_context->get_impedance_imag(freq_index); } /** * FR crd * @param in_context The nec_context created with nec_create() * @param in_ifrq 0 is a linear range of frequencies, 1 is a log range. * @param in_nfrq The number of frequencies * @param in_freq_mhz The starting frequency in MHz. * @param in_del_freq The frequency step (in MHz for ifrq = 0) */ void nec_fr_card(nec_context* in_context, int in_ifrq, int in_nfrq, double in_freq_mhz, double in_del_freq) { in_context->fr_card(in_ifrq, in_nfrq, in_freq_mhz, in_del_freq); } /*! * LD card (Loading) * @param in_context The nec_context created with nec_create() * @param ldtyp Type of loading (5 = segment conductivity) * @param ldtag Tag (zero for absolute segment numbers, or in conjunction with 0 for next parameter, for all segments) * @param ldtagf Equal to m specifies the mth segment of the set of segments whose tag numbers equal the tag number specified in the previous parameter. If the previous parameter (LDTAG) is zero, LDTAGF then specifies an absolute segment number. If both LDTAG and LDTAGF are zero, all segments will be loaded. * @param ldtagt Equal to n specifies the nth segment of the set of segments whose tag numbers equal the tag number specified in the parameter LDTAG. This parameter must be greater than or equal to the previous param- eter. The loading specified is applied to each of the mth through nth segments of the set of segments having tags equal to LDTAG. Again if LDTAG is zero, these parameters refer to absolute segment numbers. If LDTAGT is left blank, it is set equal to the previous parameter (LDTAGF). Floating Point Input for the Various Load Types: */ void nec_ld_card(nec_context* in_context, int ldtyp, int ldtag, int ldtagf, int ldtagt, double tmp1, double tmp2, double tmp3) { in_context->ld_card(ldtyp, ldtag, ldtagf, ldtagt, tmp1, tmp2, tmp3); } /* "gn" card, ground parameters under the antenna */ void nec_gn_card(nec_context* in_context, int itmp1, int itmp2, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->gn_card(itmp1, itmp2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_ex_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->ex_card((enum excitation_type)itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_tl_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->tl_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_nt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->nt_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_xq_card(nec_context* in_context, int itmp1) { in_context->xq_card(itmp1); } /* "gd" card, ground representation */ void nec_gd_card(nec_context* in_context, double tmp1, double tmp2, double tmp3, double tmp4) { in_context->gd_card(tmp1, tmp2, tmp3, tmp4); } /* "rp" card, standard observation angle parameters */ void nec_rp_card(nec_context* in_context, int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, double theta0, double phi0, double delta_theta, double delta_phi, double radial_distance, double gain_norm) { in_context->rp_card(calc_mode, n_theta, n_phi, output_format, normalization, D, A, theta0, phi0, delta_theta, delta_phi, radial_distance, gain_norm); } /* "pt" card, print control for current */ void nec_pt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pt_card(itmp1, itmp2, itmp3, itmp4); } /* "pq" card, print control for charge */ void nec_pq_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pq_card(itmp1, itmp2, itmp3, itmp4); } /* "kh" card, matrix integration limit */ void nec_kh_card(nec_context* in_context, double tmp1); void nec_ne_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->ne_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } void nec_nh_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6) { in_context->nh_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } /* "ek" card, extended thin wire kernel option */ void nec_ek_card(nec_context* in_context, int itmp1) { in_context->set_extended_thin_wire_kernel(-1 != itmp1); } /* "cp" card, maximum coupling between antennas */ void nec_cp_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->cp_card(itmp1, itmp2, itmp3, itmp4); } /* "pl" card, plot flags throws int on error. */ void nec_pl_card(nec_context* in_context, char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4) { in_context->pl_card(ploutput_filename, itmp1, itmp2, itmp3, itmp4); } necpp-1.5.0+cvs20101003/src/nec_debug.h0000644000175000017500000000404110310210757015550 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2005 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef __nec_debug__ #define __nec_debug__ #include #include #include #ifdef NEC_ERROR_CHECK #define DEBUG_TRACE(__x) {std::cout << __x << std::endl;} #define ASSERT(__x) \ { if (false == (__x))\ { std::stringstream __ss; \ __ss << "assert in file " << __FILE__ << " at line " << __LINE__;\ std::string __s = __ss.str(); \ throw __s.c_str(); \ } \ } #define ASSERT_EQUAL(__x, __y) ASSERT(fabs((__x) - (__y)) < 1e-15) #else #define DEBUG_TRACE(__x) #define ASSERT(__x) #define ASSERT_EQUAL(__x, __y) #endif /* NEC_ERROR_CHECK */ #endif /* __nec_debug__ */ necpp-1.5.0+cvs20101003/src/atlas_check.cpp0000644000175000017500000004316610741570022016446 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Routines for checking the LU decomposition in NEC. Goal is to get it going using LAPACK. a = { {3 + 0I, 3 + 0I, 2 + 0I, -2 + 0I}, {1 + 0I, 1 + 0I, 13 + 0I, 3 + 0I}, {-4 + 0I, 0 + 0I, -1 + 0I, -1 + 0I}, { 2 + 0I, 2 + 0I, 0 + 0I, 4 + 0I}} FORTRAN output 3.00000000000000 1.00000000000000 0.666666666666667 0.666666666666667 1.00000000000000 12.3333333333333 0.00000000000000 0.297297297297297 0.00000000000000 1.00000000000000 4.00000000000000 0.175675675675676 2.00000000000000 1.33333333333333 0.00000000000000 5.72972972972973 2 3 3 4 test_a = [3 + 0I, 1 + 0I, -4 + 0I, 2 + 0I; 3 + 0I, 1 + 0I, 0 + 0I, 2 + 0I; 2 + 0I, 13 + 0I, -1 + 0I, 0 + 0I; -2 + 0I, 3 + 0I, -1 + 0I, 4 + 0I]; test_ans = [-4 + 0I, -0.75 + -0I, -0.25 + -0I, -0.5 + -0I; 0 + 0I, 3 + 0I, 0.333333 + 0I, 0.666667 + 0I; -1 + 0I, 1.25 + 0I, 12.3333 + -0I, -0.108108 + -0I; -1 + 0I, -2.75 + 0I, 3.66667 + 0I, 5.72973 + -0I]; piv = [2, 2, 2, 3]; lu_dcpse_old = [3 + 0I, 1 + 0I, 0.666667 + 0I, -0.666667 + 0I; 1 + 0I, 12.3333 + 0I, 0 + 0I, 0.297297 + 0I; 0 + 0I, -1 + 0I, -4 + 0I, 0.175676 + 0I; 2 + 0I, -1.33333 + 0I, 0 + 0I, 5.72973 + 0I]; piv = [2, 3, 3, 4]; lu_dcpse_bke = [3 + 0I, 1 + 0I, 0.666667 + 0I, -0.666667 + 0I; 1 + 0I, 12.3333 + 0I, 0 + 0I, 0.297297 + 0I; 0 + 0I, -1 + 0I, -4 + 0I, 0.175676 + 0I; 2 + 0I, -1.33333 + 0I, 0 + 0I, 5.72973 + 0I]; piv = [2, 3, 3, 4]; lu_decompose = [3 + 0I, 1 + 0I, -4 + 0I, 2 + 0I; 0.666667 + 0I, 12.3333 + -0I, 1.66667 + 0I, -1.33333 + 0I; -0.666667 + 0I, 0.297297 + -0I, -4.16216 + -0I, 5.72973 + 0I; 1 + 0I, -0 + -0I, -0.961039 + 0I, 5.50649 + -0I]; piv = [1, 3, 4, 4]; function [l u p]=aprt(a) l = eye(size(a)) .+ tril(a,-1); u = triu(a); p = 1:length(a); endfunction test_a [l u p] = lu(test_a) l * u / test_a > 0.001 [l,u,pp] = aprt(lu_dcpse_bke) l * u / test_a > 0.001 [l,u,pp] = aprt(lu_decompose) l * u / test_a > 0.001 [l,u,pp] = aprt(lu_dcpse_old) l * u / test_a > 0.001 */ #define NEC_ERROR_CHECK #include "math_util.h" #include using namespace std; /* Various Routines for sending matrices out to the console in a form that can be pasted into OCTAVE (http://www.octave.org) */ void to_octave(nec_complex& x); void to_octave(nec_complex& x) { cout << real(x);// << " + " << imag(x) << "I"; } void to_octave(int& x); void to_octave(int& x) { cout << x; } void to_octave(nec_complex* a, int n, int ndim); void to_octave(nec_complex* a, int n, int ndim) { cout << "["; for (int row = 0; row < n; row++ ) { int row_offset = row*ndim; for (int i = 0; i < n; i++ ) { to_octave(a[i+row_offset]); if (i < n-1) cout << ", "; } if (row < n-1) cout << "; "; } cout << "];" << endl; } void to_octave(complex_array& a, int n, int ndim); void to_octave(complex_array& a, int n, int ndim) { to_octave(a.get_ptr(),n,ndim); } void to_octave(int* a, int n); void to_octave(int* a, int n) { cout << "["; for (int i = 0; i < n; i++ ) { to_octave(a[i]); if (i < n-1) cout << ", "; } cout << "];" << endl; } void to_octave(int_array& a, int n); void to_octave(int_array& a, int n) { to_octave(a.get_ptr(),n); } /* Using Octave to debug this stuff. [l,u,p] = lu(a); orig = p*l*u; diff = orig .- a; sum(sum(diff)) a = [-5.47894 + 2965.96I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -2.21543 + -0.962361I, -0.795364 + -0.113862I; -2.49805 + -1034.62I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -1.01 + -0.527357I; -1.67535 + -27.5893I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -1.21709 + -1.25704I; -1.56046 + -6.58465I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -1.40441 + -2.71197I; -1.40441 + -2.71197I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -1.56046 + -6.58465I; -1.21709 + -1.25704I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -1.67535 + -27.5892I; -1.01 + -0.527357I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -2.49805 + -1034.62I; -0.795364 + -0.113862I, -2.21543 + -0.962361I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -5.47894 + 2965.96I]; solved = [-5.47894 + 2965.96I, -0.34883 + 0.00148662I, -0.00930089 + 0.00058204I, -0.00221909 + 0.000530222I, -0.000913486 + 0.000475198I, -0.000423063 + 0.000411133I, -0.000177173 + 0.000340856I, -3.7894e-05 + 0.000268234I; -5.16779 + -1625.83I, -15.1883 + 2508.51I, -0.654113 + 0.00641696I, -0.0209388 + 0.00199762I, -0.00563214 + 0.00175056I, -0.00239586 + 0.0015366I, -0.00108368 + 0.00130452I, -0.000401231 + 0.00105952I; -3.8195 + -48.9503I, -6.57291 + -1642.9I, -25.8745 + 2000.59I, -0.829723 + 0.0150408I, -0.0290603 + 0.00375449I, -0.00826549 + 0.00315121I, -0.00352744 + 0.00270246I, -0.00152297 + 0.00224776I; -3.52843 + -12.6722I, -5.06917 + -53.3655I, -8.86623 + -1660.82I, -43.5325 + 1696.62I, -0.986053 + 0.0322509I, -0.0368356 + 0.00638373I, -0.0108087 + 0.00506807I, -0.00453205 + 0.00421639I; -3.14757 + -5.34769I, -4.63435 + -14.5329I, -6.97654 + -58.4747I, -11.9718 + -1674.55I, -16.5775 + -1687.93I, -0.842565 + -0.0540462I, 0.0398738 + -0.00709961I, 0.0120791 + -0.00628218I; -2.70084 + -2.45195I, -4.09335 + -6.19899I, -6.27227 + -16.722I, -9.38065 + -62.8562I, -11.8415 + 3073.26I, -27.0157 + -1749.13I, -0.513164 + -0.118154I, 0.049591 + -0.0125818I; -2.21543 + -0.962361I, -3.47508 + -2.78436I, -5.4597 + -7.15434I, -8.24983 + -18.5785I, -5.67188 + -1626.5I, 0.575028 + 3140.29I, -34.565 + -1761.99I, -0.095149 + -0.172344I; -0.795364 + -0.113862I, -1.28761 + -0.565893I, -2.07043 + -1.61953I, -3.17657 + -4.0337I, -1.84467 + -27.7235I, -2.29644 + -1033.56I, 7.796 + 3017.51I, -403.323 + -276.157I]; [l,u,p] = lu(a); ans = (l .- eye(size(a))) .+ u; solved .- ans atlas_a = [-5.47894 + 2965.96I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -2.21543 + -0.962361I, -0.795364 + -0.113862I; -2.49805 + -1034.62I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -2.70084 + -2.45195I, -1.01 + -0.527357I; -1.67535 + -27.5893I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -3.14757 + -5.34769I, -1.21709 + -1.25704I; -1.56046 + -6.58465I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -3.52843 + -12.6722I, -1.40441 + -2.71197I; -1.40441 + -2.71197I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -3.8195 + -48.9503I, -1.56046 + -6.58465I; -1.21709 + -1.25704I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -5.16779 + -1625.83I, -1.67535 + -27.5892I; -1.01 + -0.527357I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -10.9686 + 3075.64I, -2.49805 + -1034.62I; -0.795364 + -0.113862I, -2.21543 + -0.962361I, -2.70084 + -2.45195I, -3.14757 + -5.34769I, -3.52843 + -12.6722I, -3.8195 + -48.9504I, -5.16779 + -1625.83I, -5.47894 + 2965.96I]; atlas_solved = [-5.47894 + 2965.96I, -0.548157 + 0.00275496I, -0.0165016 + 0.00131826I, -0.00427032 + 0.00119753I, -0.000825012 + 0.000912136I, -0.000323087 + 0.00074755I, -3.7894e-05 + 0.000268234I, -0.00180105 + 0.00106456I; -2.49805 + -1034.62I, -15.1883 + 2508.51I, -0.65489 + 0.00658541I, -0.0212608 + 0.00214951I, -0.00246121 + 0.00164669I, -0.00110154 + 0.00139199I, -0.000222473 + 0.000514644I, -0.00578205 + 0.00188246I; -1.67535 + -27.5893I, -6.16215 + -1640.95I, -25.8745 + 2000.59I, -0.82997 + 0.0151662I, -0.00831659 + 0.00324278I, -0.00354023 + 0.00277484I, -0.00079601 + 0.0010452I, -0.0291788 + 0.00386463I; -1.56046 + -6.58465I, -4.69302 + -52.5555I, -8.62173 + -1660.32I, -43.5325 + 1696.62I, -0.0368818 + 0.00647535I, -0.0108184 + 0.00514009I, -0.00232792 + 0.00193202I, -0.98616 + 0.0323595I; -1.40441 + -2.71197I, -4.30575 + -14.1549I, -6.75926 + -58.2348I, -11.7922 + -1674.36I, -16.7274 + -1688I, 0.0398818 + -0.00716753I, 0.00624829 + -0.0028398I, -0.842524 + -0.0541183I; -1.21709 + -1.25704I, -3.81819 + -6.03339I, -6.0904 + -16.6174I, -9.22723 + -62.7739I, -11.8415 + 3073.26I, -27.2273 + -1749.16I, 0.026934 + -0.00558256I, -0.513109 + -0.118254I; -1.01 + -0.527357I, -3.25593 + -2.73825I, -5.31524 + -7.12687I, -8.12807 + -18.5589I, -5.66889 + -1626.5I, 0.685432 + 3140.3I, -15.4618 + -1109.08I, -0.152662 + -0.272982I; -0.795364 + -0.113862I, -2.65173 + -1.02258I, -4.45744 + -3.105I, -6.95632 + -7.87272I, -4.18315 + -49.2046I, -4.79308 + -1623.94I, 3.84241 + 3009.97I, -643.167 + -435.236I]; [l,u,p] = lu(atlas_a'); atlas_ans = (l .- eye(size(atlas_a))) .+ u; atlas_solved' .- ans */ /*! \brief Solve The system of equations using Gaussian Elimination. Subroutine to factor a matrix into a unit lower triangular matrix and an upper triangular matrix using the Gauss-Doolittle algorithm presented on pages 411-416 of A. Ralston -- a first course in numerical analysis. Comments below refer to comments in Ralstons text. (matrix transposed.) */ void lu_decompose_old(int n, complex_array& a, int_array& ip, int ndim); void lu_decompose_old(int n, complex_array& a, int_array& ip, int ndim) { // Debug output to try and figure out the LAPACK stuff /* Allocate scratch memory */ complex_array scm; scm.resize(n); /* Un-transpose the matrix for Gauss elimination */ /* for (int i = 1; i < n; i++ ) { for (int j = 0; j < i; j++ ) std::swap(a.get(i,j),a.get(j,i)); }*/ bool iflg=false; for (int r = 0; r < n; r++ ) { int r_offset = r*ndim; /* step 1 */ for (int k = 0; k < n; k++ ) scm[k]= a[k+r_offset]; /* steps 2 and 3 */ for (int j = 0; j < r; j++ ) { int pj= ip[j]-1; nec_complex arj = scm[pj]; a[j+r_offset]= arj; scm[pj]= scm[j]; int jp1 = j+1; int j_offset = j*ndim; for (int i = jp1; i < n; i++ ) scm[i] -= a[i+j_offset]* arj; } /* step 4 */ nec_float dmax = norm(scm[r]); int rp1 = r+1; ip[r]= rp1; for (int i = rp1; i < n; i++ ) { nec_float elmag = norm(scm[i]); if ( elmag >= dmax) { dmax = elmag; ip[r] = i+1; // set the permute array element } } if ( dmax < 1.e-10) iflg=true; int pr = ip[r]-1; a[r+r_offset] = scm[pr]; scm[pr] = scm[r]; /* step 5 */ if ( rp1 < n) { nec_complex arr = cplx_10() / a[r+r_offset]; for (int i = rp1; i < n; i++ ) { a[i+r_offset]= scm[i]* arr; } } if ( true == iflg ) { cout << "\n PIVOT(" << r << ")= " << dmax; iflg=false; } } /* for( r=0; r < n; r++ ) */ /* cout << "solved = "; to_octave(a,n,ndim); cout << "ip = "; to_octave(ip,n); */ } void lu_decompose_burke(int n, complex_array& a, int_array& ip, int ndim); void lu_decompose_burke(int n, complex_array& a, int_array& ip, int ndim) { /*C C Un-transpose the matrix for Gauss elimination C DO 12 I=2,N DO 11 J=1,I-1 ARJ=A(I,J) A(I,J)=A(J,I) A(J,I)=ARJ 11 CONTINUE 12 CONTINUE */ // for (int i = 1; i < n; i++ ) // { // for (int j = 0; j < i; j++ ) // std::swap(a.get(i,j),a.get(j,i)); // } /* IFLG=0 DO 9 R=1,N */ complex_array d(n); for (int r = 0; r < n; r++ ) { bool iflg=false; /*C C STEP 1 C DO 1 K=1,N D(K)=A(K,R) 1 CONTINUE*/ for (int k = 0; k < n; k++ ) d[k]= a.get(k,r); /* C C STEPS 2 AND 3 C RM1=R-1 IF (RM1.LT.1) GO TO 4 DO 3 J=1,RM1 PJ=IP(J) ARJ=D(PJ) A(J,R)=ARJ D(PJ)=D(J) JP1=J+1 DO 2 I=JP1,N D(I)=D(I)-A(I,J)*ARJ 2 CONTINUE 3 CONTINUE 4 CONTINUE */ int rm1 = r - 1; if (rm1 >= 0) { for (int j=0; j < r; j++) { int pj = ip[j]; nec_complex arj = d[pj]; a.set(j,r,arj); d[pj] = d[j]; int jp1 = j + 1; for (int i=jp1;i= dmax) { dmax = elmag; ip[r] = i; } } } if (dmax < 1e-10) iflg = true; int pr = ip[r]; a.set(r,r,d[pr]); d[pr] = d[r]; /* C C STEP 5 C IF (RP1.GT.N) GO TO 8 ARJ=1./A(R,R) DO 7 I=RP1,N A(I,R)=D(I)*ARJ 7 CONTINUE 8 CONTINUE */ if (rp1 < n) { nec_complex arj = cplx_10() / a.get(r,r); for (int i=rp1; i #include } /*! Use lapack to perform LU decomposition */ void lu_decompose(int n, complex_array& a_in, int_array& ip, int ndim); void lu_decompose(int n, complex_array& a_in, int_array& ip, int ndim) { /* cout << "atlas_a = "; to_octave(a_in,n,ndim); */ // copy the input matrix a_in into a temporary array (transposing as we go) // complex_array A(n,n); int_array piv(n); /* for (int row = 0; row < n; row++ ) { int col_index = row * ndim; for (int col = 0; col < n; col++ ) { A.set(row,col,a_in[col_index++]); } }*/ int info = clapack_zgetrf (CblasColMajor, n, n, (void*) a_in.get_ptr(), ndim, piv.get_ptr()); if (0 != info) { /* The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. */ cout << "nec++: LU Decomposition Failed: " << info; } /* IPIV (output) INTEGER array, dimension (min(M,N)) The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i). */ for (int j = 0; j < n; j++ ) { ip[j] = piv[j] + 1; } // copy the output back into the a_in array. /* for (int row = 0; row < n; row++ ) { int col_index = row*ndim; for (int col = 0; col < n; col++ ) { a_in[col_index++] = A.get(row,col); } }*/ /* cout << "atlas_solved = "; to_octave(a_in,n,ndim); cout << "atlas_ip = "; to_octave(ip,n);*/ } void matrix_setup(complex_array& A); void matrix_setup(complex_array& A) { int n = 4; A.get(0,0) = 3.0; A.get(0,1) =1.0; A.get(0,2) =-4.0; A.get(0,3) =2.0; A.get(1,0) =3.0; A.get(1,1) =1.0; A.get(1,2) =0.0; A.get(1,3) =2.0; A.get(2,0) =2.0; A.get(2,1) =13.0; A.get(2,2) =-1.0; A.get(2,3) =0.0; A.get(3,0) =-2.0; A.get(3,1) =3.0; A.get(3,2) =-1.0; A.get(3,3) =4.0; for (int i = 1; i < n; i++ ) { for (int j = 0; j < i; j++ ) std::swap(A.get(i,j),A.get(j,i)); } } int main() { /* test_a = [1 + 0I, 2 + 0I; 3 + 0I, 4 + 0I]; test_ans = [2 + 0I, 0.5 + 0I; 4 + 0I, 1 + 0I]; piv = [1,1]; We need to use the transpose operator here since we are storing the matrix as column major [l,u,p] = lu(test_a'); ret = (l .- eye(size(test_a))) .+ u; We also compare to the transpose as the result matrix is in column major order as well test_ans' .- ret */ int N = 4; { complex_array A(N,N); int_array piv(N); matrix_setup(A); cout << "test_a = "; to_octave(A,N,N); // Now call the LAPACK LU-Decomposition int info = clapack_zgetrf (CblasColMajor, N, N, (void*) A.get_ptr(), N, piv.get_ptr()); // std::cout << "CblasColMajor: " << info << " : " << endl; cout << "test_ans = "; to_octave(A,N,N); std::cout << "piv = "; to_octave(piv,N); // info = clapack_zgetrs (CblasColMajor, 2, 2, (void*) A.get_ptr(), 2, piv.get_ptr()); // cout << "test_ans = "; // to_octave(A,2,2); } { complex_array A(N,N); int_array piv(N); matrix_setup(A); lu_decompose_old(N, A, piv, N); cout << "lu_dcpse_old = "; to_octave(A,N,N); std::cout << "piv = "; to_octave(piv,N); } { complex_array A(N,N); int_array piv(N); matrix_setup(A); lu_decompose_burke(N, A, piv, N); cout << "lu_dcpse_bke = "; to_octave(A,N,N); std::cout << "piv = "; to_octave(piv,N); } { complex_array A(N,N); int_array piv(N); matrix_setup(A); lu_decompose(N, A, piv, N); cout << "lu_decompose = "; to_octave(A,N,N); std::cout << "piv = "; to_octave(piv,N); } return 0; } necpp-1.5.0+cvs20101003/src/CurrentInput.h0000644000175000017500000000427110310210756016303 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Current_Input__ #define __Current_Input__ #include "math_util.h" #include #include "BaseInput.h" class segment { public: int number; int tag; nec_float x,y,z; nec_float length; nec_complex current; // Read the segment data from a NEC-2 output file segment(istream& m_stream) { } }; class CurrentInput : public BaseInput { public: vector segments; long n_items; CurrentInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("CURRENTS AND LOCATION"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("PHASE",0) == string::npos) line = readline(); line = readline(); while (line != "") { stringstream ss(line); segment s(ss); segments.push_back(s); line = readline(); n_items++; } cout << "Currents and Location: " << n_items << " lines" << endl; } } } bool equalto(const CurrentInput& ai) { if (difference(ai) > 1e-5) return false; return true; } nec_float difference(const CurrentInput& ai) { nec_float ret = 0.0; if (n_items != ai.n_items) return 1; for (long i=0; i < n_items;i++) { try { ret += segments[i].diff(ai.segments[i]); } catch (string message) { cout << "Diff at segment [" << i << "] : " << message << endl; } } return ret; }; }; #endif /* __Current_Input__ */ necpp-1.5.0+cvs20101003/src/math_util.h0000644000175000017500000001663511122565402015641 0ustar numanuma#ifndef __math_util__ #define __math_util__ /* Various Useful Math Utilities for nec2++ Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "common.h" #include "safe_array.h" typedef safe_array int_array; typedef safe_array real_array; #define USING_EIGEN_ARRAY 0 #define USING_EIGEN_3VECT 0 #if USING_EIGEN_ARRAY #include #include // import most common Eigen types USING_PART_OF_NAMESPACE_EIGEN // typedef Matrix int_array; // typedef Matrix real_array; typedef Matrix complex_array; // typedef Matrix real_matrix; #else typedef safe_array complex_array; #endif inline nec_complex cplx_00() { static nec_complex _cplx00(0.0,0.0); return _cplx00; } inline nec_complex cplx_01() { static nec_complex _cplx01(0.0,1.0); return _cplx01; } inline nec_complex cplx_10() { static nec_complex _cplx10(1.0,0.0); return _cplx10; } inline nec_complex cplx_11() { static nec_complex _cplx11(1.0,1.0); return _cplx11; } inline nec_complex cplx_exp(nec_float x) { return nec_complex(cos(x),sin(x)); } inline nec_float pi() { static nec_float _pi = 3.1415926536; return _pi; } inline nec_float two_pi() { static nec_float _tmp = 2.0 * pi(); return _tmp; } inline nec_float four_pi() { static nec_float _tmp = 4.0 * pi(); return _tmp; } inline nec_float pi_two() { static nec_float _tmp = pi() / 2.0; return _tmp; } inline nec_float sqrt_pi() // was SP from common.h { static nec_float _tmp = sqrt(pi()); return _tmp; } inline nec_complex two_pi_j() { static nec_complex _tmp(0.0,two_pi()); return _tmp; } inline nec_float rad_to_degrees(nec_float in_radians) { static nec_float _rad_to_deg = 360.0 / (2 * pi()); // 57.29577951 return in_radians * _rad_to_deg; } inline nec_float degrees_to_rad(nec_float in_degrees) { static nec_float _deg_to_rad = (2 * pi()) / 360.0; return in_degrees * _deg_to_rad; } /*! \brief Create a complex number from a magnitude and an angle in degrees. */ inline nec_complex deg_polar(nec_float r, nec_float theta) { return std::polar(r, degrees_to_rad(theta)); } /*! \brief Get the angle of a complex number in degrees. */ inline nec_float arg_degrees(nec_complex z) { return rad_to_degrees(std::arg(z)); } /*!\brief arctangent modified to return 0 when x=y=0. */ inline nec_float atgn2( nec_float x, nec_float y) { if ((0.0 == y) && (0.0 == x)) return 0.0; return( std::atan2(y, x) ); } /*! \brief Decibel dB for magnitude (field) */ inline nec_float db10( nec_float x ) { if ( x < 1.0e-20 ) return( -999.99 ); return( 10.0 * log10(x) ); } /*! \brief magnitude from Decibel dB */ inline nec_float from_db10( nec_float x ) { if ( x < -99.9 ) return( 0.0 ); return( std::pow(10,x / 10.0)); } /*! \brief Decibel dB for mag**2 (power) */ inline nec_float db20( nec_float x ) { if ( x < 1.0e-20 ) return( -999.99 ); return( 20.0 * log10(x) ); } inline nec_float norm(const nec_float x, const nec_float y) { return std::sqrt(x*x + y*y); } inline nec_float norm(const nec_float x, const nec_float y, const nec_float z) { return std::sqrt(x*x + y*y + z*z); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1(const nec_float x, const nec_float y, const nec_float z) { return std::fabs(x) + std::fabs(y) + std::fabs(z); } inline nec_float norm2(const nec_float x, const nec_float y, const nec_float z) { return (x*x + y*y + z*z); } #if USING_EIGEN_3VECT #include #include USING_PART_OF_NAMESPACE_EIGEN typedef Matrix nec_3vector; typedef Matrix nec_c3vector; #else /** \brief A Class for handling 3 dimensional vectors */ class nec_3vector { public: nec_3vector(const nec_float& in_x, const nec_float& in_y, const nec_float& in_z) { _v[0] = in_x; _v[1] = in_y; _v[2] = in_z; } /* nec_3vector(const nec_3vector& copy) : _v[0](copy._v[0]), _v[1](copy._v[1]), _v[2](copy._v[2]) { };*/ /**!\brief The Euclidian norm */ inline nec_float norm() const { return ::norm(_v[0], _v[1], _v[2]); } inline nec_float norm2() const { return ::norm2(_v[0], _v[1], _v[2]); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1() const { return ::normL1(_v[0], _v[1], _v[2]); } inline nec_3vector& operator=(const nec_3vector& copy) { _v[0] = copy._v[0]; _v[1] = copy._v[1]; _v[2] = copy._v[2]; return *this; } inline int operator==(const nec_3vector& copy) const { if (_v[0] != copy._v[0]) return 0; if (_v[1] != copy._v[1]) return 0; if (_v[2] != copy._v[2]) return 0; return 1; } inline nec_3vector& operator+=(const nec_3vector& a) { _v[0] += a._v[0]; _v[1] += a._v[1]; _v[2] += a._v[2]; return *this; } inline nec_3vector operator+(nec_float a) const { return nec_3vector(_v[0] + a, _v[1] + a, _v[2] + a); } inline nec_3vector operator+(const nec_3vector& a) const { return nec_3vector(_v[0] + a._v[0], _v[1] + a._v[1], _v[2] + a._v[2]); } inline nec_3vector& operator-=(const nec_3vector& a) { _v[0] -= a._v[0]; _v[1] -= a._v[1]; _v[2] -= a._v[2]; return *this; } inline nec_3vector operator-(const nec_3vector& a) const { return nec_3vector(_v[0] - a._v[0], _v[1] - a._v[1], _v[2] - a._v[2]); } inline nec_3vector& operator/=(const nec_float& a) { _v[0] /= a; _v[1] /= a; _v[2] /= a; return *this; } inline nec_3vector operator/(nec_float a) const { return nec_3vector(_v[0] / a, _v[1] / a, _v[2] / a); } inline nec_float dot(const nec_3vector& a) const { return (_v[0] * a._v[0]) + (_v[1] * a._v[1]) + (_v[2] * a._v[2]); } inline nec_3vector& operator*=(const nec_float& a) { _v[0] *= a; _v[1] *= a; _v[2] *= a; return *this; } inline nec_3vector operator*(nec_float a) const { return nec_3vector(_v[0] * a, _v[1] * a, _v[2] * a); } inline nec_float& operator()(int i) { return _v[i]; } inline const nec_float& operator()(int i) const { return _v[i]; } /**\brief Cross-product */ nec_3vector operator*(const nec_3vector& a) const { return nec_3vector( _v[1]*a._v[2] - _v[2]*a._v[1], _v[2]*a._v[0] - _v[0]*a._v[2], _v[0]*a._v[1] - _v[1]*a._v[0] ); } inline nec_float x() const { return _v[0]; } inline nec_float y() const { return _v[1]; } inline nec_float z() const { return _v[2]; } private: nec_float _v[3]; }; #endif /**!\brief The Euclidian norm */ inline nec_float norm(const nec_3vector& v) { return v.norm(); } /**!\brief The L1-distance (often called the Manhattan norm) */ inline nec_float normL1(const nec_3vector& v) { return normL1(v(0), v(1), v(2)); } #endif /* __math_util__ */ necpp-1.5.0+cvs20101003/src/nec2cpp.h0000644000175000017500000000031410310210756015165 0ustar numanuma/* * nec2cpp.h - header file for nec2 c++ */ #include "math_util.h" using namespace std; int main(int argc, char **argv); void fblock(int nrow, int ncol, int imax, int ipsym); #include "misc.h" necpp-1.5.0+cvs20101003/src/c_evlcom.h0000644000175000017500000000462710310210756015435 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_evlcom__ #define __c_evlcom__ #include "math_util.h" void bessel(nec_complex z, nec_complex *j0, nec_complex *j0p); void hankel(nec_complex z, nec_complex *h0, nec_complex *h0p); class c_evlcom { public: nec_float m_ck2, m_ck2sq, m_tkmag, m_tsmag, m_ck1r, m_zph, m_rho; nec_complex m_ct1, m_ct2, m_ct3, m_ck1, m_ck1sq, m_cksm; nec_complex m_contour_a, m_contour_b; /*! \brief Compute integration parameter xlam=lambda from parameter t. */ void lambda( nec_float t, nec_complex *xlam, nec_complex *dxlam ) const; /*! \brief gshank integrates the 6 Sommerfeld integrals from start to infinity (until convergence) in lambda. At the break point, bk, the step increment may be changed from dela to delb. Shank's algorithm to accelerate convergence of a slowly converging series is used. */ void gshank( nec_complex start, nec_complex dela, complex_array& sum, int nans, complex_array& seed, int ibk, nec_complex bk, nec_complex delb ); /*! \brief rom1 integrates the 6 Sommerfeld integrals from m_contour_a to m_contour_b in lambda. The method of variable interval width Romberg integration is used. */ void rom1( int n, complex_array& sum, int nx ); /*! \brief saoa computes the integrand for each of the 6 Sommerfeld integrals for source and observer above ground. */ void saoa( nec_float t, complex_array& ans); /*! \brief evlua controls the integration contour in the complex lambda plane for evaluation of the Sommerfeld integrals. */ void evlua( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *eph ); private: /*! \brief Flag to select Bessel or Hankel function form (was jh) */ bool m_bessel_flag; }; #endif /* __c_evlcom__ */ necpp-1.5.0+cvs20101003/src/misc.h0000644000175000017500000000113310310210756014566 0ustar numanuma#ifndef __MISC__ #define __MISC__ #include #include "math_util.h" /* carriage return and line feed */ #define CR 0x0d #define LF 0x0a /* max length of a line read from input file */ #define LINE_LEN 132 /* usage() * * prints usage information */ void usage(void); /* Returns process time (user+system) BUT in _msec_ */ void secnds( nec_float *x); /* load_line() * * Loads a line from a file, aborts on failure. Lines beginning * with a '#' are ignored as comments. At the end of file EOF is * returned. */ int load_line( char *buff, FILE *pfile ); #endif /* __MISC__ */ necpp-1.5.0+cvs20101003/src/nec_wire.h0000644000175000017500000001666411450075244015454 0ustar numanuma/* Copyright (C) 2008 Timothy C.A. Molteno tim@physics.otago.ac.nz This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_wire__ #define __nec_wire__ #include "math_util.h" /*!\brief A class to handle properties of wires. */ class nec_wire { public: nec_wire(const nec_3vector& a, const nec_3vector& b, nec_float in_radius) : x0(a), x1(b), radius(in_radius) { } nec_3vector parametrize(nec_float s) const { nec_3vector ret = x0; ret += (x1 - x0)*s; return ret; } nec_float distance(const nec_3vector& a, const nec_3vector& b) const { return (a - b).norm(); } nec_float length() const { return distance(x0, x1); } /*!\brief Calculate whether two wires intersect. \return A list of the wires that should be created. */ std::vector intersect(nec_wire& b) { nec_float d2,sa,sb; int_solve(x0,x1, b.x0, b.x1, d2,sa,sb); nec_float epsa = b.radius / length(); // Set by the radius of the other wires nec_float epsb = radius / b.length(); // Set by the radius of the other wires std::vector ret; if (d2 > (radius + b.radius)) return ret; if ((sa >= -epsa) && (sa <= 1.0 + epsa) && (sb >= -epsb) && (sb <= 1.0 + epsb)) { nec_3vector a_pt = parametrize(sa); nec_3vector b_pt = b.parametrize(sb); if (sa > epsa) ret.push_back(nec_wire(x0, a_pt, radius)); if (sa < 1.0 - epsa) ret.push_back(nec_wire(a_pt, x1, radius)); if (sb > epsb) ret.push_back(nec_wire(b.x0, b_pt, b.radius)); if (sb < 1.0 - epsb) ret.push_back(nec_wire(b_pt, b.x1, b.radius)); } return ret; } /*!\brief Calculate whether the point is inside the wire \return true if the point x is inside the wire */ bool intersect(nec_3vector& b0) { nec_float a0x = x0.x(); nec_float a0y = x0.y(); nec_float a0z = x0.z(); nec_float a1x = x1.x(); nec_float a1y = x1.y(); nec_float a1z = x1.z(); nec_float b0x = b0.x(); nec_float b0y = b0.y(); nec_float b0z = b0.z(); /* # # Do the expression for intersection of a cylinder and a point # # aptitude install python-sympy # # from sympy import * from sympy.matrices import Matrix a0x = Symbol('a0x') a1x = Symbol('a1x') a0y = Symbol('a0y') a1y = Symbol('a1y') a0z = Symbol('a0z') a1z = Symbol('a1z') b0x = Symbol('b0x') b0y = Symbol('b0y') b0z = Symbol('b0z') a0 = Matrix([a0x,a0y,a0z]) b0 = Matrix([b0x,b0y,b0z]) a1 = Matrix([a1x,a1y,a1z]) # Each wire is parametrized by sa and sb sa = Symbol('sa') a = a0 + sa*(a1 - a0) b = b0 # Distance between the two wires is d2 delta = (b-a) d2 = delta.dot(delta) print "Distance =" print_python(d2) # Closest point is the set of parameters (sa,sb) that minimize d2 # subject to the constraint that sa and sb are in the range [0,1] eqn1 = diff(d2, sa) equations = [Eq(eqn1,0)] print "diff(d2,sa) = " print eqn1 solution = solve(equations,[sa]) print solution */ nec_float sa = (a1x*b0x + a1y*b0y + a1z*b0z - a0x*a1x - a0x*b0x - a0y*a1y - a0y*b0y - a0z*a1z - a0z*b0z + a0x*a0x + a0y*a0y + a0z*a0z)/ (-2.0*a0x*a1x - 2*a0y*a1y - 2.0*a0z*a1z + a0x*a0x + a0y*a0y + a0z*a0z + a1x*a1x + a1y*a1y + a1z*a1z); if (sa < 0) sa = 0.0; if (sa > 1.0) sa = 1.0; nec_3vector a_pt = parametrize(sa); if (distance(a_pt, b0) > radius) return false; return true; } bool similar(nec_wire& b) { // Check if the wires share two endpoints nec_float d1 = distance(x0, b.x0); nec_float d2 = distance(x0, b.x1); nec_float da = std::min(d1,d2); nec_float d3 = distance(x1, b.x1); nec_float d4 = distance(x1, b.x0); nec_float db = std::min(d3,d4); if ((std::abs(da) < radius) && (std::abs(db) < radius)) return true; else return false; } /*! We use the following Mathematica expression to get the solution for the intersection of two cylinders. We set up the distance between the two center lines as d2 The equations are derived from sympy in the file intersections.py d2 = (a0x - b0x + sa*(a1x - a0x) - sb*(b1x - b0x))^2 + (a0z - b0z + sa*(a1z - a0z) - sb*(b1z - b0z))^2 + (a0y - b0y + sa*(a1y - a0y) - sb*(b1y - b0y))^2; soln = Solve[{D[d2,sa] == 0, D[d2,sb] == 0}, {sa,sb}]; Simplify[soln] sa -> (2*a0x*(a0x - a1x) + 2*a0y*(a0y - a1y) + 2*a0z*(a0z - a1z) + 2*(-a0x \ + a1x)*b0x + 2*(-a0y + a1y)*b0y + 2*(-a0z + a1z)*b0z + ((-4*(a0x^2 + a0y^2 + \ a1x*b0x - a0x*(a1x + b0x) + a1y*b0y - a0y*(a1y + b0y) + (a0z - a1z)*(a0z - \ b0z))*((a0x - a1x)*(b0x - b1x) + (a0y - a1y)*(b0y - b1y) + (a0z - a1z)*(b0z \ - b1z)) + 4*((a0x - a1x)^2 + (a0y - a1y)^2 + (a0z - a1z)^2)*((a0x - \ b0x)*(b0x - b1x) + (a0y - b0y)*(b0y - b1y) + (a0z - b0z)*(b0z - \ b1z)))*(-2*(a0x - a1x)*(b0x - b1x) - 2*(a0y - a1y)*(b0y - b1y) - 2*(a0z - \ a1z)*(b0z - b1z)))/(-4*((a0x - a1x)*(b0x - b1x) + (a0y - a1y)*(b0y - b1y) + \ (a0z - a1z)*(b0z - b1z))^2 + 4*((a0x - a1x)^2 + (a0y - a1y)^2 + (a0z - \ a1z)^2)*((b0x - b1x)^2 + (b0y - b1y)^2 + (b0z - b1z)^2)))/(2*((a0x - a1x)^2 \ + (a0y - a1y)^2 + (a0z - a1z)^2)) sb -> -((-4*(a0x^2 + a0y^2 + a1x*b0x - \ a0x*(a1x + b0x) + a1y*b0y - a0y*(a1y + b0y) + (a0z - a1z)*(a0z - b0z))*((a0x \ - a1x)*(b0x - b1x) + (a0y - a1y)*(b0y - b1y) + (a0z - a1z)*(b0z - b1z)) + \ 4*((a0x - a1x)^2 + (a0y - a1y)^2 + (a0z - a1z)^2)*((a0x - b0x)*(b0x - b1x) + \ (a0y - b0y)*(b0y - b1y) + (a0z - b0z)*(b0z - b1z)))/(-4*((a0x - a1x)*(b0x - \ b1x) + (a0y - a1y)*(b0y - b1y) + (a0z - a1z)*(b0z - b1z))^2 + 4*((a0x - \ a1x)^2 + (a0y - a1y)^2 + (a0z - a1z)^2)*((b0x - b1x)^2 + (b0y - b1y)^2 + \ (b0z - b1z)^2))) */ static void int_solve(nec_3vector& a0, nec_3vector& a1, nec_3vector& b0, nec_3vector& b1, nec_float& distance, nec_float& sa, nec_float& sb) { nec_float a0x = a0.x(); nec_float a0y = a0.y(); nec_float a0z = a0.z(); nec_float b0x = b0.x(); nec_float b0y = b0.y(); nec_float b0z = b0.z(); nec_float a1x = a1.x(); nec_float a1y = a1.y(); nec_float a1z = a1.z(); nec_float b1x = b1.x(); nec_float b1y = b1.y(); nec_float b1z = b1.z(); nec_float a01x = (a0x - a1x); nec_float a01y = (a0y - a1y); nec_float a01z = (a0z - a1z); nec_float b01x = (b0x - b1x); nec_float b01y = (b0y - b1y); nec_float b01z = (b0z - b1z); nec_float moda = (a01x*a01x + a01y*a01y + a01z*a01z); nec_float modb = (b01x*b01x + b01y*b01y + b01z*b01z); nec_float tmp2 = (a01x*b01x + a01y*b01y + a01z*b01z); nec_float den = (-4.0*tmp2*tmp2 + 4.0*moda*modb); distance = 9.0e9; sa = 2.0; sb = 2.0; if (0 == den) return; nec_float tmp3 = (-4.0*(a0x*a0x + a0y*a0y + a1x*b0x - a0x*(a1x + b0x) + a1y*b0y - a0y*(a1y + b0y) + a01z*(a0z - b0z))*tmp2 + 4.0*moda*((a0x - b0x)*b01x + (a0y - b0y)*b01y + (a0z - b0z)*b01z)); sa = (a0x*a01x + a0y*a01y + a0z*a01z - a01x*b0x - a01y*b0y - a01z*b0z - tmp3*tmp2/den)/moda; sb = -(tmp3/den); nec_float d2 = pow((a0x - b0x + sa*(a1x - a0x) - sb*(b1x - b0x)),2) + pow((a0z - b0z + sa*(a1z - a0z) - sb*(b1z - b0z)),2) + pow((a0y - b0y + sa*(a1y - a0y) - sb*(b1y - b0y)),2); distance = std::sqrt(d2); } private: nec_3vector x0, x1; nec_float radius; }; #endif /*__nec_wire__*/ necpp-1.5.0+cvs20101003/src/nec_radiation_pattern.cpp0000644000175000017500000004415611130541231020532 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_radiation_pattern.h" #include "nec_context.h" #include "c_geometry.h" #include "nec_exception.h" int nec_radiation_pattern::get_index(int theta_index, int phi_index) const { if (theta_index >= n_theta) throw new nec_exception("nec_radiation_pattern: Theta index too large"); if (phi_index >= n_phi) throw new nec_exception("nec_radiation_pattern: Phi index too large"); return phi_index*n_theta + theta_index; } nec_radiation_pattern::nec_radiation_pattern(int in_n_theta, int in_n_phi, nec_float in_theta_start, nec_float in_phi_start, nec_float in_delta_theta, nec_float in_delta_phi, nec_float in_range, nec_ground& in_ground, int in_ifar, nec_float in_wavelength, nec_float pinr, nec_float pnlr, int in_rp_output_format, int in_rp_normalization, int in_rp_ipd, int in_rp_power_average, nec_float in_gnor, c_plot_card& in_plot_card) : m_ground(in_ground), m_plot_card(in_plot_card) { n_theta = in_n_theta; n_phi = in_n_phi; m_theta_start = in_theta_start; m_phi_start = in_phi_start; delta_theta = in_delta_theta; delta_phi = in_delta_phi; m_range = in_range; // was rfld m_rp_output_format = in_rp_output_format; m_rp_normalization = in_rp_normalization; m_rp_ipd = in_rp_ipd; m_rp_power_average = in_rp_power_average; // was iavp m_rp_gnor = in_gnor; int n_angles = n_theta * n_phi; _gain.resize(n_angles); _power_gain_vert.resize(n_angles); _power_gain_horiz.resize(n_angles); _power_gain_tot.resize(n_angles); _power_gain_rhcp.resize(n_angles); _power_gain_lhcp.resize(n_angles); _polarization_axial_ratio.resize(n_angles); _polarization_tilt.resize(n_angles); _polarization_sense_index.resize(n_angles); _averaging_scales.resize(n_angles); _e_theta.resize(n_angles); _e_phi.resize(n_angles); _e_r.resize(n_angles); _ifar = in_ifar; _wavelength = in_wavelength; _pinr = pinr; _pnlr = pnlr; m_analysis_done = false; _maximum_gain = -999.0; } /*! \brief Write the analyzed data to a file */ void nec_radiation_pattern::write_to_file_aux(ostream& os) { if (false == m_analysis_done) throw new nec_exception("Internal Error: Radiation Pattern Analysis not done"); static const char *hpol[4] = { "LINEAR", "RIGHT ", "LEFT ", " " }; static const char *gain_type[2] = { "----- POWER GAINS ----- ", "--- DIRECTIVE GAINS ---" }; static const char *igax[4] = { " MAJOR", " MINOR", " VERTC", " HORIZ" }; int i; output_helper oh(os,_result_format); if ( _ifar >= 2) { oh.section_start("FAR FIELD GROUND PARAMETERS"); if ( _ifar > 3) { os << endl; os << " RADIAL WIRE GROUND SCREEN" << endl; os << " "; oh.int_out(5, m_ground.radial_wire_count); os << " WIRES" << endl; os << " WIRE LENGTH= "; oh.real_out(8,2, m_ground.radial_wire_length,false); os << " METERS" << endl; os << " WIRE RADIUS= "; oh.real_out(10,3, m_ground.radial_wire_radius); os << " METERS" << endl; } /* if ( _ifar > 3) */ if ( _ifar != 4 ) { std::string hclif; if ( (_ifar == 2) || (_ifar == 5) ) hclif = "LINEAR"; if ( (_ifar == 3) || (_ifar == 6) ) hclif= "CIRCLE"; os << endl; os << " " << hclif << " CLIFF" << endl; os << " EDGE DISTANCE= "; oh.real_out(9,2,m_ground.cliff_edge_distance,false); os << " METERS" << endl; os << " HEIGHT= "; oh.real_out(8,2,m_ground.cliff_height,false); os << " METERS" << endl; os << " SECOND MEDIUM -" << endl; os << " RELATIVE DIELECTRIC CONST.= "; oh.real_out(7,3,m_ground.epsr2, false); os << endl; os << " CONDUCTIVITY= "; oh.real_out(10,3,m_ground.sig2,false); os << " MHOS" << endl; } /* if ( _ifar != 4 ) */ } /* if ( _ifar >= 2) */ if ( _ifar == 1) { oh.section_start("RADIATED FIELDS NEAR GROUND"); os << " ------- LOCATION ------- --- E(THETA) --- ---- E(PHI) ---- --- E(RADIAL) ---" << endl; os << " RHO PHI Z MAG PHASE MAG PHASE MAG PHASE" << endl; os << " METERS DEGREES METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" << endl; } else // _ifar != 1 { oh.section_start("RADIATION PATTERNS"); if ( m_range >= 1.0e-20) { nec_float exrm = 1.0 / m_range; nec_float exra = m_range/ _wavelength; exra = -360.0*(exra - floor(exra)); os << " RANGE: "; oh.real_out(13,6,m_range); os << " METERS" << endl; os << " EXP(-JKR)/R: "; oh.real_out(12,5,exrm); os << " AT PHASE: "; oh.real_out(7,2,exra,false); os << " DEGREES" << endl; } int itmp1 = 2 * m_rp_output_format; int itmp2 = itmp1+1; os << " ---- ANGLES ----- "; oh.string_out(23,gain_type[m_rp_ipd]); os << " ---- POLARIZATION ---- ---- E(THETA) ---- ----- E(PHI) ------" << endl; os << " THETA PHI "; oh.string_out(6,igax[itmp1]); os << " "; oh.string_out(6,igax[itmp2]); os << " TOTAL AXIAL TILT SENSE MAGNITUDE PHASE MAGNITUDE PHASE" << endl; os << " DEGREES DEGREES DB DB DB RATIO DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" << endl; } /* if ( _ifar == 1) */ i=0; nec_float phi = m_phi_start- delta_phi; for (int kph = 1; kph <= n_phi; kph++ ) { phi += delta_phi; nec_float thet= m_theta_start- delta_theta; for(int kth = 1; kth <= n_theta; kth++ ) { thet += delta_theta; if ( m_ground.present() && (thet > 90.01) && (_ifar != 1) ) continue; /* elliptical polarization */ if ( _ifar == 1) { nec_complex e_theta = _e_theta[i]; nec_complex e_phi = _e_phi[i]; nec_complex e_r = _e_r[i]; oh.start_record(); oh.padding(" "); oh.real_out(9,2,m_range,false); oh.separator(); oh.real_out(7,2,phi,false); oh.separator(); oh.real_out(9,2,thet,false); oh.separator(); oh.real_out(11,4,abs(e_theta)); oh.separator(); oh.real_out(7,2,arg_degrees(e_theta),false); oh.separator(); oh.real_out(11,4,abs(e_phi)); oh.separator(); oh.real_out(7,2,arg_degrees(e_phi),false); oh.separator(); oh.real_out(11,4,abs(e_r)); oh.separator(); oh.real_out(7,2,arg_degrees(e_r),false); oh.end_record(); } else { nec_complex e_theta = _e_theta[i]; nec_complex e_phi = _e_phi[i]; const char* pol_sense = hpol[_polarization_sense_index[i]]; oh.start_record(); oh.padding(" "); oh.real_out(7,2,thet,false); oh.separator(); oh.real_out(9,2,phi,false); oh.separator(); oh.padding(" "); oh.real_out(8,2,_power_gain_vert[i],false); oh.separator(); oh.real_out(8,2,_power_gain_horiz[i],false); oh.separator(); oh.real_out(8,2,_power_gain_tot[i],false); oh.separator(); oh.real_out(11,4,_polarization_axial_ratio[i],false); oh.separator(); oh.real_out(9,2,_polarization_tilt[i],false); oh.separator(); oh.string_out(6,pol_sense); oh.separator(); oh.real_out(11,4,abs(e_theta)); oh.separator(); oh.real_out(9,2,arg_degrees(e_theta),false); oh.separator(); oh.real_out(11,4,abs(e_phi)); oh.separator(); oh.real_out(9,2,arg_degrees(e_phi),false); oh.end_record(); m_plot_card.plot_patterns(thet, phi, e_theta, e_phi, _power_gain_vert[i], _power_gain_horiz[i], _power_gain_tot[i]); } /* if ( _ifar != 1) */ i++; } /* for( kth = 1; kth <= n_theta; kth++ ) */ } /* for( kph = 1; kph <= n_phi; kph++ ) */ if ( m_rp_power_average != 0) { oh.section_end(); os << " AVERAGE POWER GAIN: "; oh.real_out(11,4,_average_power_gain); os << " - SOLID ANGLE USED IN AVERAGING: ("; oh.real_out(7,4,_average_power_solid_angle,false); os << ")*PI STERADIANS" << endl; } if ( m_rp_normalization != 0) write_normalized_gain(os); } /*! \brief Generate the data for the radiation pattern */ void nec_radiation_pattern::analyze(nec_context* m_context) { if (m_analysis_done) return; int pol_sense_index; nec_float exrm=0., exra=0., prad, gcon, gcop; nec_float phi, thet; nec_float tilta, emajr2, eminr2, pol_axial_ratio; nec_float dfaz, dfaz2, cdfaz, tstor1=0., tstor2, stilta; if ((m_context->m_excitation_type == EXCITATION_VOLTAGE) || (m_context->m_excitation_type == EXCITATION_VOLTAGE_DISC) ) { gcop= _wavelength * _wavelength * 2.0 * pi()/(em::impedance() * _pinr); prad= _pinr- m_context->structure_power_loss- _pnlr; gcon= gcop; if ( m_context->ipd != 0) gcon= gcon* _pinr/ prad; } else if ( m_context->m_excitation_type == EXCITATION_CURRENT) { _pinr=394.51* m_context->xpr6* m_context->xpr6* _wavelength* _wavelength; gcop= _wavelength* _wavelength*2.* pi()/(em::impedance() * _pinr); prad= _pinr- m_context->structure_power_loss- _pnlr; gcon= gcop; if ( m_context->ipd != 0) gcon= gcon* _pinr/ prad; } else { prad=0.; gcon=4.* pi()/(1.0+ m_context->xpr6* m_context->xpr6); gcop= gcon; } if ( m_range >= 1.0e-20) { exrm=1./ m_range; exra= m_range/ _wavelength; exra=-360.*( exra- floor( exra)); } int result_counter=0; nec_float pint = 0.0; nec_float delta_phi_rad = degrees_to_rad(delta_phi); nec_float tmp2 = 0.5 * degrees_to_rad(delta_theta); phi= m_phi_start- delta_phi; for (int kph = 1; kph <= n_phi; kph++ ) { phi += delta_phi; nec_float pha = degrees_to_rad(phi); thet= m_theta_start- delta_theta; for (int kth = 1; kth <= n_theta; kth++ ) { thet += delta_theta; if ( m_ground.present() && (thet > 90.01) && (_ifar != 1) ) continue; nec_float tha = degrees_to_rad(thet); nec_complex eth, eph; if ( 1 == _ifar) { bool space_wave_only = (false == m_ground.present()); nec_complex erd; m_context->gfld(m_range/_wavelength, pha, thet/_wavelength, ð, &eph, &erd, space_wave_only, _wavelength ); _e_theta[result_counter] = eth; _e_phi[result_counter] = eph; _e_r[result_counter] = erd; } else { m_context->ffld(tha, pha, ð, &eph, _wavelength); nec_float ethm2= norm(eth); nec_float ethm= sqrt(ethm2); nec_float etha= arg_degrees(eth); nec_float ephm2= norm(eph); nec_float ephm= sqrt( ephm2); nec_float epha= arg_degrees( eph); /* elliptical polarization calc. */ if ( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) { tilta=0.; emajr2=0.; eminr2=0.; pol_axial_ratio=0.; pol_sense_index = 3; } else { dfaz= epha- etha; if ( epha >= 0.) dfaz2= dfaz-360.; else dfaz2= dfaz+360.; if ( fabs(dfaz) > fabs(dfaz2) ) dfaz= dfaz2; cdfaz= cos(degrees_to_rad(dfaz)); tstor1= ethm2- ephm2; tstor2=2.* ephm* ethm* cdfaz; tilta=.5* atan2( tstor2, tstor1); stilta= sin( tilta); tstor1= tstor1* stilta* stilta; tstor2= tstor2* stilta* cos( tilta); emajr2=- tstor1+ tstor2+ ethm2; eminr2= tstor1- tstor2+ ephm2; if ( eminr2 < 0.) eminr2=0.; pol_axial_ratio= sqrt( eminr2/ emajr2); tilta= rad_to_degrees(tilta); if ( pol_axial_ratio <= 1.0e-5) pol_sense_index = POL_LINEAR; else if ( dfaz <= 0.) pol_sense_index = POL_RIGHT; else pol_sense_index = POL_LEFT; } /* if ( (ethm2 <= 1.0e-20) && (ephm2 <= 1.0e-20) ) */ /* Gain Normalization Variables */ nec_float gnmj= db10( gcon* emajr2); nec_float gnmn= db10( gcon* eminr2); nec_float gnv = db10( gcon* ethm2); nec_float gnh = db10( gcon* ephm2); nec_float gtot= db10( gcon*(ethm2+ ephm2) ); if (m_rp_normalization > 0) { nec_float temp_gain; switch(m_rp_normalization ) { case 1: temp_gain = gnmj; break; case 2: temp_gain = gnmn; break; case 3: temp_gain = gnv; break; case 4: temp_gain = gnh; break; case 5: temp_gain = gtot; break; default: throw new nec_exception("Unknown Gain Normalization Encountered."); } _gain[result_counter] = temp_gain; } /* if ( m_rp_normalization > 0) */ if ( m_rp_power_average != 0) { // compute the numerical integral of the power gain in angular co-ordinates tstor1= gcop*( ethm2+ ephm2); nec_float tmp3 = tha - tmp2; nec_float tmp4 = tha + tmp2; if ( kth == 1) tmp3= tha; else if ( kth == n_theta) tmp4= tha; nec_float da = fabs( delta_phi_rad*( cos(tmp3)- cos(tmp4))); if ( (kph == 1) || (kph == n_phi) ) da *=.5; pint += tstor1 * da; if ( m_rp_power_average == 2) // do not print the power gain values (just compute the average) continue; } if ( m_rp_output_format != 1) { _power_gain_vert[result_counter] = gnmj; _power_gain_horiz[result_counter] = gnmn; } else { _power_gain_vert[result_counter] = gnv; _power_gain_horiz[result_counter] = gnh; } ethm *= _wavelength; ephm *= _wavelength; if ( m_range >= 1.0e-20 ) { ethm= ethm* exrm; etha= etha+ exra; ephm= ephm* exrm; epha= epha+ exra; } _e_theta[result_counter] = deg_polar(ethm, etha); _e_phi[result_counter] = deg_polar(ephm, epha); _power_gain_tot[result_counter] = gtot; { nec_float a = pol_axial_ratio; if (pol_sense_index == POL_RIGHT) a = -a; nec_float gain = from_db10(gtot); nec_float lhcp_f =(1+2*a+a*a)/(2*(1+a*a)); nec_float rhcp_f =(1-2*a+a*a)/(2*(1+a*a)); _power_gain_rhcp[result_counter] = db10(gain * rhcp_f); _power_gain_lhcp[result_counter] = db10(gain * lhcp_f); } _polarization_axial_ratio[result_counter] = pol_axial_ratio; _polarization_tilt[result_counter] = tilta; _polarization_sense_index[result_counter] = pol_sense_index; _averaging_scales[result_counter] = (sin(tha) * (n_theta - 1) / n_theta) + 1.0/n_theta; } /* if ( _ifar == 1) */ result_counter++; } /* for( kth = 1; kth <= n_theta; kth++ ) */ } /* for( kph = 1; kph <= n_phi; kph++ ) */ if ( m_rp_power_average != 0) { /* nec_float tmp3 = degrees_to_rad(m_theta_start); tmp4 = tmp3 + degrees_to_rad(delta_theta) * (nec_float)(n_theta-1); tmp3 = fabs( degrees_to_rad(delta_phi) * (nec_float)( n_phi-1)*( cos( tmp3)- cos( tmp4))); pint /= tmp3; tmp3 /= pi(); _average_power_gain = pint; _average_power_solid_angle = tmp3; */ // We now compute the solid angle over which the power is averaged nec_float theta_start_rad = degrees_to_rad(m_theta_start); nec_float theta_range = degrees_to_rad(delta_theta) * (nec_float)(n_theta-1); nec_float phi_range = degrees_to_rad(delta_phi) * (nec_float)(n_phi-1); nec_float total_theta = theta_start_rad + theta_range; nec_float solid_angle = fabs(phi_range * (cos(theta_start_rad) - cos(total_theta)) ); _average_power_gain = pint / solid_angle; _average_power_solid_angle = solid_angle / pi(); // We display it as a multiple of pi() } _maximum_gain = _gain.maxCoeff(); m_analysis_done = true; } nec_float nec_radiation_pattern::get_gain_normalization_factor(nec_float gnor) { if ( fabs(gnor) > 1.0e-20) return gnor; if (false == m_analysis_done) throw new nec_exception("Internal Error: Radiation Pattern Analysis not done"); return _maximum_gain; } void nec_radiation_pattern::write_normalized_gain(ostream& os) { // if is non-zero then use it as a normaliztion factor nec_float normalization_factor = get_gain_normalization_factor(m_rp_gnor); string norm_type; switch (m_rp_normalization) { case 1: norm_type = "MAJOR AXIS"; break; case 2: norm_type = "MINOR AXIS"; break; case 3: norm_type = "VERTICAL"; break; case 4: norm_type = "HORIZONTAL"; break; case 5: norm_type = "TOTAL "; break; default: throw new nec_exception("Unknown Gain Normalization Encountered."); } output_helper oh(os,_result_format); oh.section_start("NORMALIZED GAIN"); { stringstream mess; mess << norm_type << " GAIN"; oh.center_text(mess.str(), ""); } { stringstream mess; mess << "NORMALIZATION FACTOR: " << normalization_factor << " dB"; oh.center_text(mess.str(), ""); } /* os << " " << norm_type << " GAIN" << endl; os << " NORMALIZATION FACTOR: "; oh.real_out(7,2,normalization_factor,false); os << " db" << endl << endl; */ os << " ---- ANGLES ---- ---- ANGLES ---- ---- ANGLES ----" << endl; os << " THETA PHI GAIN THETA PHI GAIN THETA PHI GAIN" << endl; os << " DEGREES DEGREES DB DEGREES DEGREES DB DEGREES DEGREES DB" << endl; int row_count = 0; int n_cols = 3; int item_count = 0; for (int p=0;p #include /* Replaces the "10000" limit used to */ /* identify segment/patch connections */ #define PCHCON 100000 class nec_context; #include "nec_output.h" #include "nec_wire.h" /**! \brief Use of the c_geometry class. c_geometry g = new c_geometry(); g.parse_geometry(file); OR c_geometry g = new c_geometry(); g.wire(xxxxxxx); g.arc(); ... g.geometry_complete(); */ class c_geometry { public: c_geometry(); void set_context(nec_context* m_context); /*! \brief Generates segment geometry for a straingt wire \param tag_id \param segment_count Number of Elements (should be around 12-20 per wavelength) \param rad Wire radius of first segment (in Meters) \param rdel Ratio of the length of a segment to the length of the previous segment. (Set to 1.0 if segments have uniform length) \param rrad The ratio of the radii of adjacent segments (Set to 1.0 if not tapered) */ void wire( int tag_id, int segment_count, nec_float xw1, nec_float yw1, nec_float zw1, // first co-ordinate nec_float xw2, nec_float yw2, nec_float zw2, // second co-ordinate nec_float rad, nec_float rdel, nec_float rrad); void arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ); void helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ); 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 reflect( int ix, int iy, int iz, int itx, int nop ); /*! \brief Scale all dimensions of a structure by a constant.*/ void scale( nec_float xw1); void patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ); /*! \brief Geometry is complete \exception nec_exception* If there is an error with the geometry. */ void geometry_complete(nec_context* m_context, int card_int_1, int card_int_2); /*!\brief Parse an NEC geometry description contained in the file input_fp */ void parse_geometry(nec_context* m_context, FILE* input_fp); /*!\brief Helper method to decide whether extended. thin-wire approximation can be used */ int test_ek_approximation(int seg1, int seg2); int get_segment_number( int in_tag, int m); void frequency_scale(nec_float freq_mhz); void tbf( int i, int icap); void trio( int j ); void get_current_coefficients(nec_float wavelength, complex_array& curx, real_array& air, real_array& aii, real_array& bir, real_array& bii, real_array& cir, real_array& cii, complex_array& vqds, int nqds, int_array& iqds); nec_float patch_angle(int patch_index, nec_float in_ax, nec_float in_ay, nec_float in_az); /*! \brief Calculate the xyz components of the electric field due to surface currents. */ void fflds(nec_float rox, nec_float roy, nec_float roz, complex_array& scur, nec_complex *in_ex, nec_complex *in_ey, nec_complex *in_ez ); int n; // The number of segments int np; int_array segment_tags; real_array x, y, z, segment_length, segment_radius; real_array x2, y2, z2, cab, sab, salp; int m, mp; // The number of patches int m_ipsym; real_array t1x, t1y, t1z, t2x, t2y, t2z; // t1, t2 basis co-ordinates? real_array px, py, pz, pbi, psalp; // patch data int n_plus_m, n_plus_2m, n_plus_3m; /* n+m,n+2m,n+3m */ int_array icon1, icon2; // Connected Segment Information (was common /segj/ in FORTRAN code) int jsno, nscon, maxcon; /* Max. no. connections */ int_array jco; real_array ax, bx, cx; private: // The geometry data measured in meters is stored in these arrays // and the x,y,z,si,bi arrays are then scaled for each frequency real_array x_unscaled, y_unscaled, z_unscaled, si_unscaled, bi_unscaled; real_array px_unscaled, py_unscaled, pz_unscaled, pbi_unscaled; void sbf( int i, int is, nec_float *aa, nec_float *bb, nec_float *cc ); void divide_patch( int nx ); void connect_segments( int ignd ); void read_geometry_card(FILE* input_fp, char *gm, int *i1, int *i2, nec_float *x1, nec_float *y1,nec_float *z1, nec_float *x2, nec_float *y2, nec_float *z2, nec_float *rad ); nec_context* m_context; nec_output_file* m_output; std::vector m_wires; }; #endif /* __c_geometry__ */ necpp-1.5.0+cvs20101003/src/misc.cpp0000644000175000017500000000556610310210756015137 0ustar numanuma/* * Miscellaneous support functions for nec2++ */ #include "misc.h" #include using namespace std; /*------------------------------------------------------------------------*/ /* usage() * * prints usage information */ void usage(void) { fprintf( stderr, "usage: nec2++ [-i] [-o]" "\n -g: print maximum gain to stdout." "\n -b: Perform NEC++ Benchmark." "\n -s: print results to standard output." "\n -c: print results in comma-separated-value (CSV) format," "\n this options is used in conjunction with (-s) above." "\n -h: print this usage information and exit." "\n -v: print nec2++ version number and exit.\n"); } /* end of usage() */ /*------------------------------------------------------------------------*/ /* Returns process time (user+system) BUT in _msec_ */ #ifndef _WIN32 #include #include void secnds( nec_float *x) { struct tms buffer; times(&buffer); *x = 1000.0 * ( (nec_float)(buffer.tms_utime + buffer.tms_stime) ) / ( (nec_float) sysconf(_SC_CLK_TCK) ); } #else #include void secnds( nec_float *x) { nec_float c = nec_float(clock()); *x = (1000.0 * c) / CLOCKS_PER_SEC; } #endif /*------------------------------------------------------------------*/ /* load_line() * * loads a line from a file, aborts on failure. lines beginning * with a '#' are ignored as comments. at the end of file EOF is * returned. */ int load_line( char *buff, FILE *pfile ) { int num_chr = 0, /* number of characters read, excluding lf/cr */ eof = 0, /* EOF flag */ chr; /* character read by getc */ /* clear buffer at start */ buff[0] = '\0'; /* ignore commented lines, white spaces and eol/cr */ if( (chr = fgetc(pfile)) == EOF ) return( EOF ); while( (chr == '#') || (chr == ' ') || (chr == CR ) || (chr == LF ) ) { /* go to the end of line (look for lf or cr) */ while( (chr != CR) && (chr != LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); /* dump any cr/lf remaining */ while( (chr == CR) || (chr == LF) ) if( (chr = fgetc(pfile)) == EOF ) return( EOF ); } /* end of while( (chr == '#') || ... */ while( num_chr < LINE_LEN ) { /* if lf/cr reached before filling buffer, return */ if( (chr == CR) || (chr == LF) ) break; /* enter new char to buffer */ buff[num_chr++] = chr; /* terminate buffer as a string on EOF */ if( (chr = fgetc(pfile)) == EOF ) { buff[num_chr] = '\0'; eof = EOF; } } /* end of while( num_chr < max_chr ) */ /* Capitalize first two characters (mnemonics) */ if( (buff[0] > 0x60) && (buff[0] < 0x79) ) buff[0] -= 0x20; if( (buff[1] > 0x60) && (buff[1] < 0x79) ) buff[1] -= 0x20; /* terminate buffer as a string */ buff[num_chr] = '\0'; return( eof ); } /* end of load_line() */ necpp-1.5.0+cvs20101003/src/XGetopt.cpp0000644000175000017500000001306011451333570015571 0ustar numanuma// XGetopt.cpp Version 1.1 // // Author: Hans Dietrich // hdietrich2@hotmail.com // // This software is released into the public domain. // You are free to use it in any way you like. // // This software is provided "as is" with no expressed // or implied warranty. I accept no liability for any // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include "XGetopt.h" /////////////////////////////////////////////////////////////////////////////// // // X G e t o p t . c p p // // // NAME // getopt -- parse command line options // // SYNOPSIS // int getopt(int argc, char *argv[], char *optstring) // // extern char *optarg; // extern int optind; // // DESCRIPTION // The getopt() function parses the command line arguments. Its // arguments argc and argv are the argument count and array as // passed into the application on program invocation. In the case // of Visual C++ programs, argc and argv are available via the // variables __argc and __argv (double underscores), respectively. // getopt returns the next option letter in argv that matches a // letter in optstring. // // optstring is a string of recognized option letters; if a letter // is followed by a colon, the option is expected to have an argument // that may or may not be separated from it by white space. optarg // is set to point to the start of the option argument on return from // getopt. // // Option letters may be combined, e.g., "-ab" is equivalent to // "-a -b". Option letters are case sensitive. // // getopt places in the external variable optind the argv index // of the next argument to be processed. optind is initialized // to 0 before the first call to getopt. // // When all options have been processed (i.e., up to the first // non-option argument), getopt returns EOF, optarg will point // to the argument, and optind will be set to the argv index of // the argument. If there are no non-option arguments, optarg // will be set to NULL. // // The special option "--" may be used to delimit the end of the // options; EOF will be returned, and "--" (and everything after it) // will be skipped. // // RETURN VALUE // For option letters contained in the string optstring, getopt // will return the option letter. getopt returns a question mark (?) // when it encounters an option letter not included in optstring. // EOF is returned when processing is finished. // // BUGS // 1) Long options are not supported. // 2) The GNU double-colon extension is not supported. // 3) The environment variable POSIXLY_CORRECT is not supported. // 4) The + syntax is not supported. // 5) The automatic permutation of arguments is not supported. // 6) This implementation of getopt() returns EOF if an error is // encountered, instead of -1 as the latest standard requires. // // EXAMPLE // BOOL CMyApp::ProcessCommandLine(int argc, char *argv[]) // { // int c; // // while ((c = getopt(argc, argv, "aBn:")) != EOF) // { // switch (c) // { // case 'a': // TRACE(_T("option a\n")); // // // // set some flag here // // // break; // // case 'B': // TRACE( _T("option B\n")); // // // // set some other flag here // // // break; // // case 'n': // TRACE(_T("option n: value=%d\n"), atoi(optarg)); // // // // do something with value here // // // break; // // case '?': // TRACE(_T("ERROR: illegal option %s\n"), argv[optind-1]); // return FALSE; // break; // // default: // TRACE(_T("WARNING: no handler for option %c\n"), c); // return FALSE; // break; // } // } // // // // check for non-option args here // // // return TRUE; // } // /////////////////////////////////////////////////////////////////////////////// char *optarg; // global argument pointer int optind = 0; // global argv index int XGetopt(int argc, char *argv[], const char *optstring) { char c; const char *cp; static char *next = NULL; if (optind == 0) next = NULL; optarg = NULL; if (next == NULL || *next == '\0') { if (optind == 0) optind++; if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') { optarg = NULL; if (optind < argc) optarg = argv[optind]; return EOF; } if (strcmp(argv[optind], "--") == 0) { optind++; optarg = NULL; if (optind < argc) optarg = argv[optind]; return EOF; } next = argv[optind]+1; optind++; } c = *next++; cp = strchr(optstring, c); if (cp == NULL || c == ':') return '?'; cp++; if (*cp == ':') { if (*next != '\0') { optarg = next; next = NULL; } else if (optind < argc) { optarg = argv[optind]; optind++; } else { return '?'; } } return c; } necpp-1.5.0+cvs20101003/src/electromag.h0000644000175000017500000000274010404145457015773 0ustar numanuma#ifndef __electromag__ #define __electromag__ /* Various Useful Electromagnetism Utilities for nec2cpp Copyright (C) 2004-2006 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "math_util.h" namespace em { class constants { public: static nec_float permittivity; static nec_float permeability; }; // Calculate the power from a voltage and a current. inline nec_float power(nec_complex voltage, nec_complex current) { return 0.5* real(voltage * conj(current)); } // Electromagnetic Constants inline nec_float permittivity() { return constants::permittivity; } inline nec_float permeability() { return constants::permeability; } nec_float speed_of_light(); nec_float impedance(); nec_float inverse_impedance(); nec_float impedance_over_2pi(); } #endif /* __electromag__ */ necpp-1.5.0+cvs20101003/src/nec2cpp.cpp0000644000175000017500000005305011451605767015546 0ustar numanuma/* Translation to C++ by Tim Molteno Based on the C port by N. Kyriazis Including some pieces from additional work by Jeroen Vreeken Fixed a few bugs in the process. Using the std vector library in preparation for moving to ATLAS for the matrix and vector operations. Debian Build Instructions apt-get install atlas3-base atlas3-headers atlas3-base-dev apt-get install refblas3-dev lapack3-dev lapack3-doc For more information on using LAPACK for doing efficient computation, see http://seehuhn.de/comp/linear.html */ /* Original disclaimer that came with the FORTRAN code */ /******* Translated to the C language by N. Kyriazis 20 Aug 2003 *******/ /* */ /* Program NEC(input,tape5=input,output,tape11,tape12,tape13,tape14, */ /* tape15,tape16,tape20,tape21) */ /* */ /* Numerical Electromagnetics Code (NEC2) developed at Lawrence */ /* Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 */ /* for problems with the NEC code. For problems with the vax implem- */ /* entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 */ /* 422-5936) */ /* file created 4/11/80. */ /* */ /* ***********Notice********** */ /* This computer code material was prepared as an account of work */ /* sponsored by the United States government. Neither the United */ /* States nor the United States Department Of Energy, nor any of */ /* their employees, nor any of their contractors, subcontractors, */ /* or their employees, makes any warranty, express or implied, or */ /* assumes any legal liability or responsibility for the accuracy, */ /* completeness or usefulness of any information, apparatus, product */ /* or process disclosed, or represents that its use would not infringe */ /* privately-owned rights. */ /* */ /************************************************************************/ #include "nec2cpp.h" #include "nec_exception.h" #include #include #include #include using namespace std; #include "nec_context.h" #ifndef _WIN32 /* Signal handler */ static void sig_handler( int signal ); #endif /*-------------------------------------------------------------------*/ int nec_main( int argc, char **argv, nec_output_file& s_output ); /* New main() function This places an exception handler around the old main loop to allow errors to be nicely caught! */ int main( int argc, char **argv ) { nec_output_file s_output; try { if (true)// This is an nec_3vector testharness { nec_3vector x(1,2,3); nec_3vector y(3,5,1); nec_3vector a = x + y; ASSERT(a == nec_3vector(4,7,4)); /* a = x.cwise() * y; ASSERT(a == nec_3vector(-13,8,-1)); a = y.cwise() * x; ASSERT(a == nec_3vector(13,-8,1)); a = x.cwise() + 3.0; ASSERT(a == nec_3vector(4,5,6));*/ nec_float ip = x.dot(y); ASSERT(ip == 16); } nec_main(argc, argv, s_output); } catch (const char* message) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(message); exit(1); } catch (nec_exception* nex) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(nex->get_message().c_str()); exit(1); } catch(...) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(" Unknown exception"); exit(1); } } #include "c_geometry.h" void benchmark(); void benchmark() { try { cout << "The nec2++ benchmark." << endl; cout << "nec2++ version " nec_version << endl << endl; nec_float bench = nec_context::benchmark(); cout << "Your computer's score is: " << bench << " NEC's" << endl; } catch (const char* message) { cout << "NEC++ Runtime Error: " << endl; cout << message << endl; exit(1); } catch (nec_exception* nex) { cout << "NEC++ Runtime Error: " << endl; cout << nex->get_message().c_str() << endl; exit(1); } } int readmn(FILE* input_fp, FILE* output_fp, char *gm, int *i1, int *i2, int *i3, int *i4, nec_float *f1, nec_float *f2, nec_float *f3, nec_float *f4, nec_float *f5, nec_float *f6); #include "XGetopt.h" int nec_main( int argc, char **argv, nec_output_file& s_output ) { nec_output_flags s_output_flags; FILE *input_fp=NULL; FILE *output_fp=NULL; string input_filename, output_filename; char ain[3], line_buf[81]; /* input card mnemonic list */ /* "XT" stands for "exit", added for testing */ #define CMD_NUM 21 const char *atst[CMD_NUM] = { "FR", "LD", "GN", "EX", "NT", "TL", \ "XQ", "GD", "RP", "NX", "PT", "KH", \ "NE", "NH", "PQ", "EK", "CP", "PL", \ "EN", "WG", "MP" }; int itmp3, itmp2, itmp4; int ain_num; /* ain mnemonic as a number */ nec_float tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; nec_float ex_timer; /* getopt() variables */ extern char *optarg; int option; #ifndef _WIN32 /*** signal handler related code ***/ /* new and old actions for sigaction() */ struct sigaction sa_new, sa_old; /* initialize new actions */ sa_new.sa_handler = sig_handler; sigemptyset( &sa_new.sa_mask ); sa_new.sa_flags = 0; /* register function to handle signals */ sigaction( SIGINT, &sa_new, &sa_old ); sigaction( SIGSEGV, &sa_new, 0 ); sigaction( SIGFPE, &sa_new, 0 ); sigaction( SIGTERM, &sa_new, 0 ); sigaction( SIGABRT, &sa_new, 0 ); #endif /*** command line arguments handler ***/ if ( argc == 1 ) { usage(); exit(-1); } bool results_to_stdout = false; // allocate a new nec_context; nec_context s_context; /* process command line options */ while( (option = XGetopt(argc, argv, "i:o:hvscxgb") ) != -1 ) { switch( option ) { case 'i' : /* specify input file name */ input_filename = optarg; break; case 'o' : /* specify output file name */ output_filename = optarg; break; case 'g': /* return only the maximum gain to stdout */ s_output_flags.set_gain_only(true); break; case 's': /* return output to stdout */ results_to_stdout = true; break; case 'c': /* use CSV result data */ s_context.set_results_format(RESULT_FORMAT_CSV); break; case 'x': /* use XML result data */ s_context.set_results_format(RESULT_FORMAT_XML); break; case 'h' : /* print usage and exit */ usage(); exit(0); case 'v' : /* print nec2++ version */ #ifdef _MSC_VER cout << ( "nec2++ " nec_version ) << " compiler: " << _MSC_VER << endl; #else cout << ( "nec2++ " nec_version ) << (" compiler: " __VERSION__) << endl; #endif exit(0); case 'b' : /* Run benchmark */ benchmark(); exit(0); default: /* print usage and exit */ usage(); exit(-1); } } /*** open input file ***/ if ( (input_fp = fopen(input_filename.c_str(), "r")) == NULL ) { string mesg = "nec2++: " + input_filename; perror( mesg.c_str() ); exit(-1); } /* make an output file name if not */ /* specified by user on invocation */ if ( output_filename == "" ) { /* strip the input file name extension if there is one */ output_filename = input_filename.substr(0, input_filename.find(".",0)) + ".out"; } /* open output file */ if ( (output_fp = fopen(output_filename.c_str(), "w")) == NULL ) { string mesg = "nec2++: " + output_filename; perror( mesg.c_str() ); exit(-1); } s_output.set_file(output_fp); secnds( &ex_timer ); s_context.set_output(s_output, s_output_flags); s_context.initialize(); /* main execution loop, exits at various points */ /* depending on error conditions or end of jobs */ while( true ) { s_output.end_section(); s_output.set_indent(31); s_output.line(" __________________________________________"); s_output.line("| |"); s_output.line("| NUMERICAL ELECTROMAGNETICS CODE (nec2++) |"); s_output.line("| Translated to 'C++' in Double Precision |"); s_output.line("| Version " nec_version " |"); s_output.line("|__________________________________________|"); /* read a line from input file */ if ( load_line(line_buf, input_fp) == EOF ) throw new nec_exception("Error reading input file."); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* If its an "XT" card, exit (used for debugging) */ if ( strcmp(ain, "XT") == 0 ) { nec_error_mode em(s_output); s_output.end_section(); s_output.line("nec2++: Exiting after an \"XT\" command in main()"); exit(0); } /* if its a "cm" or "ce" card start reading comments */ if ( (strcmp(ain, "CM") == 0) || (strcmp(ain, "CE") == 0) ) { s_output.end_section(); s_output.set_indent(31); s_output.line("---------------- COMMENTS ----------------"); s_output.line(&line_buf[2]); while( strcmp(ain, "CM") == 0 ) { /* read a line from input file */ if ( load_line(line_buf, input_fp) == EOF ) throw new nec_exception("Error reading input file (comments not terminated?)"); /* separate card's id mnemonic */ strncpy( ain, line_buf, 2 ); ain[2] = '\0'; /* write comment to output file */ s_output.line(&line_buf[2]); } /* no "ce" card at end of comments */ if ( strcmp(ain, "CE") != 0 ) { throw new nec_exception("ERROR: INCORRECT LABEL FOR A COMMENT CARD"); } } else { rewind( input_fp ); } /* initializations etc from original fortran code */ int data_card_count=0; /* set up geometry data in subroutine parse_geometry */ c_geometry* geo = s_context.get_geometry(); geo->parse_geometry(&s_context, input_fp); s_context.calc_prepare(); s_output.end_section(); /* Main input section, exits at various points depending on error conditions or end of job. This is called the card input loop. */ bool next_job = false; /* start next job (next structure) flag */ while ( ! next_job ) { int itmp1; /* main input section - standard read statement - jumps */ /* to appropriate section for specific parameter set up */ int parameter_count = readmn(input_fp, output_fp, ain, &itmp1, &itmp2, &itmp3, &itmp4, &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6 ); /* If its an "XT" card, exit */ if ( strcmp(ain, "XT" ) == 0 ) { nec_error_mode em(s_output); s_output.endl(); s_output.line("nec2++: Exiting after an \"XT\" command in main()" ); exit(0); } data_card_count++; fprintf( output_fp, "\n***** DATA CARD N0. %3d " "%s %3d %5d %5d %5d %12.5E %12.5E %12.5E %12.5E %12.5E %12.5E", data_card_count, ain, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); /* identify card id mnemonic (except "ce" and "cm") */ for( ain_num = 0; ain_num < CMD_NUM; ain_num++ ) if ( strncmp( ain, atst[ain_num], 2) == 0 ) break; /* take action according to card id mnemonic */ switch( ain_num ) { case 0: /* "fr" card, frequency parameters */ s_context.fr_card(itmp1, itmp2, tmp1, tmp2); continue; case 1: /* "ld" card, loading parameters */ s_context.ld_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3); continue; case 2: /* "gn" card, ground parameters under the antenna */ s_context.gn_card(itmp1, itmp2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 3: /* "ex" card, excitation parameters */ s_context.ex_card((enum excitation_type)itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 4: /* "nt" card, network parameters */ s_context.nt_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 5: /* "tl" card, network parameters */ if (parameter_count < 10) { nec_error_mode em(s_output); s_output.endl(); s_output.line("nec2++: Missing parameters in \"TL\" card. Blank parameters should be specified as zero." ); exit(0); } s_context.tl_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; /* continue card input loop */ case 6: /* "xq" execute card - calc. including radiated fields */ s_context.xq_card(itmp1); continue; case 7: /* "gd" card, ground representation */ s_context.gd_card(tmp1, tmp2, tmp3, tmp4); continue; /* continue card input loop */ case 8: /* "rp" card, standard observation angle parameters */ { // pull out the XNDA parameters here... int XNDA = itmp4; int X = XNDA / 1000; int N = (XNDA / 100) % 10; int D = (XNDA / 10) % 10; int A = XNDA % 10; s_context.rp_card(itmp1, itmp2, itmp3, X, N, D, A, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } continue; /* was break; followed by special code */ case 9: /* "nx" card, do next job */ next_job = true; continue; /* continue card input loop */ case 10: /* "pt" card, print control for current */ s_context.pt_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 11: /* "kh" card, matrix integration limit */ s_context.kh_card(tmp1); continue; /* continue card input loop */ case 12: /* "ne" card, near field calculation parameters */ s_context.ne_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 13: /* "nh" card, near field calculation parameters */ s_context.nh_card(itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); continue; case 14: /* "pq" card, print control for charge */ s_context.pq_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 15: /* "ek" card, extended thin wire kernel option */ if (-1 == itmp1) s_context.set_extended_thin_wire_kernel(false); else s_context.set_extended_thin_wire_kernel(true); continue; /* continue card input loop */ case 16: /* "cp" card, maximum coupling between antennas */ s_context.cp_card(itmp1, itmp2, itmp3, itmp4); continue; /* continue card input loop */ case 17: /* "pl" card, plot flags */ { std::string ploutput_filename(input_filename); ploutput_filename += ".plt"; try { s_context.pl_card(ploutput_filename.c_str(), itmp1, itmp2, itmp3, itmp4); } catch(...) { char mesg[88] = "nec2++: "; strcat( mesg, ploutput_filename.c_str() ); perror( mesg ); exit(-1); } } continue; /* continue card input loop */ case 19: /* "wg" card, not supported */ throw new nec_exception("\"WG\" card, not supported."); case 20: /* "MP" card. Material Parameters */ s_context.medium_parameters(tmp1, tmp2); continue; default: if ( ain_num != 18 ) // EN card { throw new nec_exception("FAULTY DATA CARD LABEL AFTER GEOMETRY SECTION."); } /****************************************************** *** normal exit of nec2++ when all jobs complete ok *** ******************************************************/ s_context.all_jobs_completed(); // put in here for the moment... if (results_to_stdout) s_context.write_results(cout); /* time the process */ secnds( &tmp1 ); tmp1 -= ex_timer; fprintf( output_fp, "\n\n TOTAL RUN TIME: %d msec", (int)tmp1 ); if( input_fp != NULL ) fclose( input_fp ); if( output_fp != NULL ) fclose(output_fp); return(0); } /* switch( ain_num ) */ /* End of the main input section. far_field_flag is true if last card was XQ or RP This is no longer used, but I am leaving it in here while I iron this out properly. simulate() should be called by the xq card and the rp card. */ ASSERT(false == ((ain_num == 6) || (ain_num == 8))); s_context.simulate(false); } /* while( ! next_job ) */ } /* while(true) */ return(0); } /* end of nec_main() */ /*-----------------------------------------------------------------------*/ /*!\brief Read a line and fill in the parameter values. \return The number of parameters read */ int readmn(FILE* input_fp, FILE* output_fp, char *gm, int *i1, int *i2, int *i3, int *i4, nec_float *f1, nec_float *f2, nec_float *f3, nec_float *f4, nec_float *f5, nec_float *f6 ) { int parameter_count = 0; char line_buf[134]; int line_idx; int n_integer_params = 4, n_float_params = 6; int integer_array[4] = { 0, 0, 0, 0 }; nec_float real_array[6] = { 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ int eof = load_line( line_buf, input_fp ); /* get line length */ int line_length = (int) strlen(line_buf ); /* abort if card's mnemonic too short or missing */ if ( line_length < 2 ) { if (EOF == eof) { // insert an EN card if we get to an end of file strncpy( gm, "EN", 2 ); return 0; } else { fprintf( output_fp, "\n COMMAND DATA CARD ERROR:" "\n CARD'S MNEMONIC CODE TOO SHORT OR MISSING." ); exit(-1); } } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if ( strcmp( gm, "XT" ) == 0 ) { fprintf( stderr, "\nnec2++: Exiting after an \"XT\" command in read_geometry_card()\n" ); fprintf( output_fp, "\n\n nec2++: Exiting after an \"XT\" command in read_geometry_card()" ); exit(0); } /* Return if only mnemonic on card */ if ( line_length == 2 ) { *i1 = *i2 = *i3 = *i4 = 0; *f1 = *f2 = *f3 = *f4 = *f5 = *f6 = 0.0; return 0; } /* read integers from line */ line_idx = 1; for (int i = 0; i < n_integer_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if ( (line_buf[line_idx] == '\0') ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /* read an integer from line */ integer_array[i] = atoi( &line_buf[line_idx] ); parameter_count++; /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); exit(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } } /* for( i = 0; i < n_integer_params; i++ ) */ /* read nec_floats from line */ for (int i = 0; i < n_float_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if ( (line_buf[line_idx] == '\0') ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /* read a nec_float from line */ real_array[i] = atof( &line_buf[line_idx] ); parameter_count++; /* traverse numerical field to next ' ' or ',' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { fprintf( output_fp, "\n COMMAND DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); exit(-1); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } } /* for( i = 0; i < n_float_params; i++ ) */ *i1= integer_array[0]; *i2= integer_array[1]; *i3= integer_array[2]; *i4= integer_array[3]; *f1= real_array[0]; *f2= real_array[1]; *f3= real_array[2]; *f4= real_array[3]; *f5= real_array[4]; *f6= real_array[5]; return parameter_count; } /*-----------------------------------------------------------------------*/ #ifndef _WIN32 static void sig_handler(int signal ) { switch( signal ) { case SIGINT : fprintf(stderr, "nec2++: exiting via user interrupt" ); exit( signal ); case SIGSEGV : fprintf(stderr, "nec2++: segmentation fault" ); exit( signal ); case SIGFPE : fprintf(stderr, "nec2++: floating point exception" ); exit( signal ); case SIGABRT : fprintf(stderr, "nec2++: abort signal received" ); exit( signal ); case SIGTERM : fprintf(stderr, "nec2++: termination request received" ); exit( signal ); } } #endif necpp-1.5.0+cvs20101003/src/necDiff.cpp0000644000175000017500000000430510310210756015530 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* necDiff A program to compare two output files from NEC style antenna simulations. The purpose is to support a testharness for the development of a C++ version of NEC-2. Author: Tim Molteno tim@physics.otago.ac.nz */ #include #include #include using namespace std; #include "AntennaInput.h" #include "RadiationInput.h" #include "PowerBudget.h" int main(int argc, char** argv) { cout << "NecDiff 0.12" << endl; string file1(argv[1]); string file2(argv[2]); cout << "File1: " << file1 << endl; cout << "File2: " << file2 << endl; { AntennaInput ai1(file1); AntennaInput ai2(file2); cout << "AntennaInput Difference = " << ai1.difference(ai2) << endl; if (!ai1.equalto(ai2)) { cerr << file1 << "::" << file2; cerr << ". Input Parameters Different " << ai1.difference(ai2) << endl; } } // Compare Power Budget { PowerBudget r1(file1); PowerBudget r2(file2); cout << "PowerBudget Difference = " << r1.difference(r2) << endl; if (!r1.equalto(r2)) { cerr << file1 << "::" << file2; cerr << ". Power Budgets Different " << r1.difference(r2) << endl; // return 1; } } // Compare Radiation Patterns { RadiationInput r1(file1); RadiationInput r2(file2); cout << "RadiationInput Difference = " << r1.difference(r2) << endl; if (!r1.equalto(r2)) { cerr << file1 << "::" << file2; cerr << ". Radiation Patterns Different " << r1.difference(r2) << endl; // return 1; } } return 0; } necpp-1.5.0+cvs20101003/src/c_geometry.cpp0000644000175000017500000021167111451605767016356 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_geometry.h" #include "nec_context.h" #include "nec_exception.h" #include #include c_geometry::c_geometry() { n = 0; np = 0; // n is the number of segments m = 0; mp = 0; // m is the number of patches m_ipsym = 0; n_plus_m = 0; n_plus_2m = 0; n_plus_3m = 0; jsno = 0; nscon = 0; maxcon = 0; m_context = NULL; m_output = NULL; } void c_geometry::set_context(nec_context* in_context) { m_context = in_context; m_output = &m_context->m_output; } /*! \brief Get a segment number for a specified tag. \param in_tag The tag \param in_m The mth segment with the specified tag will be returned. \return The segment number of the mth segment having the tag number in_tag. if in_tag=0 segment number m is returned. */ int c_geometry::get_segment_number( int in_tag, int in_m) { ASSERT(in_tag >= 0); ASSERT(in_m >= 0); if (in_m <= 0) { throw new nec_exception("CHECK DATA, PARAMETER SPECIFYING SEGMENT POSITION IN A GROUP OF EQUAL TAGS MUST NOT BE ZERO" ); } if ( 0 == in_tag) { return( in_m ); } int tag_seg_count=0; for (int i = 0; i < n; i++ ) { if ( segment_tags[i] == in_tag ) { tag_seg_count++; if ( tag_seg_count == in_m) { return( i+1 ); } } } throw new nec_exception("NO SEGMENT HAS AN ITAG OF ", in_tag); return 0; } #include "c_plot_card.h" #include void str_toupper(std::string &str); void str_toupper(std::string &str) { std::transform(str.begin(), str.end(), str.begin(), (int(*)(int)) std::toupper); } void c_geometry::parse_geometry(nec_context* in_context, FILE* input_fp ) { char gm[3]; char ifx[2] = {'*', 'X'}, ify[2]={'*','Y'}, ifz[2]={'*','Z'}; char ipt[4] = { 'P', 'R', 'T', 'Q' }; /* input card mnemonic list */ /* "XT" stands for "exit", added for testing */ /* #define GM_NUM 12 char *atst[GM_NUM] = { "GW", "GX", "GR", "GS", "GE", "GM", \ "SP", "SM", "GA", "SC", "GH", "GF" };*/ bool print_structure_spec = true; int nwire, isct, i1, i2; int card_int_1, card_int_2; /* The two integer parameters from the geometry card */ nec_float rad, xs1, xs2, ys1, ys2, zs1, zs2, x4=0, y4=0, z4=0; nec_float x3=0, y3=0, z3=0, xw1, xw2, yw1, yw2, zw1, zw2; nec_float dummy; m_ipsym=0; nwire=0; n=0; np=0; m=0; mp=0; isct=0; /* read geometry data card and branch to */ /* section for operation requested */ do { read_geometry_card(input_fp, gm, &card_int_1, &card_int_2, &xw1, &yw1, &zw1, &xw2, &yw2, &zw2, &rad); /* identify card id mnemonic */ std::string card_id(gm); str_toupper(card_id); // int gm_num; // for( gm_num = 0; gm_num < GM_NUM; gm_num++ ) // if ( strncmp( gm, atst[gm_num], 2) == 0 ) // break; if ( print_structure_spec ) { m_output->end_section(); m_output->set_indent(32); m_output->line("-------- STRUCTURE SPECIFICATION --------"); m_output->line("COORDINATES MUST BE INPUT IN" ); m_output->line("METERS OR BE SCALED TO METERS" ); m_output->line("BEFORE STRUCTURE INPUT IS ENDED" ); m_output->set_indent(0); m_output->line(" WIRE SEG FIRST LAST TAG"); m_output->line(" No: X1 Y1 Z1 X2 Y2 Z2 RADIUS No: SEG SEG No:" ); print_structure_spec = false; } if ( card_id != "GH") // gm_num != 10 ) isct=0; /* "gw" card, generate segment data for straight wire. GW STRAIGHT WIRE, ENDS 1,2 card_int_1- TAG NO. card_int_2- NO. SEGMENTS xw1- X1 F2- Y1 F3- Z1 F4- X2 F5- Y2 F6- Z2 F7- WIRE RAD., 0=USE GC FOR TAPERED WIRE */ if (card_id == "GW") { int wire_segment_count = card_int_2; int wire_tag = card_int_1; nwire++; // output some wire diagnostics. m_output->nec_printf( "\n" " %5d %10.4f %10.4f %10.4f %10.4f" " %10.4f %10.4f %10.4f %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, yw2, zw2, rad, wire_segment_count, n+1, n + wire_segment_count, wire_tag ); if ( rad != 0.0) // rad == 0 implies a tapered wire { xs1 = 1.0; ys1 = 1.0; } else { int ix,iy; read_geometry_card(input_fp, gm, &ix, &iy, &xs1, &ys1, &zs1, &dummy, &dummy, &dummy, &dummy); if ( strcmp(gm, "GC" ) != 0 ) { throw new nec_exception("GEOMETRY DATA CARD ERROR" ); } m_output->nec_printf( "\n ABOVE WIRE IS TAPERED. SEGMENT LENGTH RATIO: %9.5f\n" " " "RADIUS FROM: %9.5f TO: %9.5f", xs1, ys1, zs1 ); if ( (ys1 == 0) || (zs1 == 0) ) { throw new nec_exception("GEOMETRY DATA CARD ERROR" ); } rad= ys1; ys1= pow( (zs1/ys1), (1./(wire_segment_count-1.)) ); } wire(wire_tag, wire_segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, xs1, ys1); } /* reflect structure along x,y, or z */ /* axes or rotate to form cylinder. */ /* "gx" card */ else if (card_id == "GX") { int iy= card_int_2/10; int iz= card_int_2- iy*10; int ix= iy/10; iy= iy- ix*10; if ( ix != 0) ix=1; if ( iy != 0) iy=1; if ( iz != 0) iz=1; m_output->nec_printf( "\n STRUCTURE REFLECTED ALONG THE AXES %c %c %c" " - TAGS INCREMENTED BY %d\n", ifx[ix], ify[iy], ifz[iz], card_int_1 ); reflect( ix, iy, iz, card_int_1, card_int_2); } /* "gr" card */ else if (card_id == "GR") { m_output->nec_printf( "\n STRUCTURE ROTATED ABOUT Z-AXIS %d TIMES" " - LABELS INCREMENTED BY %d\n", card_int_2, card_int_1 ); int ix=-1; int iy = 0; int iz = 0; reflect( ix, iy, iz, card_int_1, card_int_2); } /* "gs" card, scale structure dimensions by factor xw1. */ else if (card_id == "GS") { m_output->nec_printf( "\n STRUCTURE SCALED BY FACTOR: %10.5f", xw1 ); scale(xw1); } /* "ge" card, terminate structure geometry input. */ else if (card_id == "GE") { geometry_complete(in_context, card_int_1, card_int_2); return; } /* "gm" card, move structure or reproduce */ /* original structure in new positions. */ else if (card_id == "GM") { m_output->nec_printf( "\n THE STRUCTURE HAS BEEN MOVED, MOVE DATA CARD IS:\n" " %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, rad ); xw1= degrees_to_rad(xw1); yw1= degrees_to_rad(yw1); zw1= degrees_to_rad(zw1); move( xw1, yw1, zw1, xw2, yw2, zw2, (int)( rad+.5), card_int_2, card_int_1); } /* "sp" card, generate single new patch */ else if (card_id == "SP") { i1= m+1; card_int_2++; if ( card_int_1 != 0) { throw new nec_exception("PATCH DATA ERROR" ); } m_output->nec_printf( "\n" " %5d%c %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", i1, ipt[card_int_2-1], xw1, yw1, zw1, xw2, yw2, zw2 ); if ( (card_int_2 == 2) || (card_int_2 == 4) ) isct=1; if ( card_int_2 > 1) { // read another geometry card for the rest of the patch data int ix,iy; read_geometry_card(input_fp, gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if ( (card_int_2 == 2) || (card_int_1 > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); if ( strcmp(gm, "SC") != 0 ) { throw new nec_exception("PATCH DATA ERROR" ); } } /* if ( card_int_2 > 1) */ else { xw2= degrees_to_rad(xw2); yw2= degrees_to_rad(yw2); } patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); } /* "sm" card, generate multiple-patch surface */ else if (card_id == "SM") { i1= m+1; m_output->nec_printf( "\n" " %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f" " SURFACE - %d BY %d PATCHES", i1, ipt[1], xw1, yw1, zw1, xw2, yw2, zw2, card_int_1, card_int_2 ); if ( (card_int_1 < 1) || (card_int_2 < 1) ) { throw new nec_exception("PATCH DATA ERROR" ); } int ix,iy; read_geometry_card(input_fp, gm, &ix, &iy, &x3, &y3, &z3, &x4, &y4, &z4, &dummy); if ( (card_int_2 == 2) || (card_int_1 > 0) ) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); if ( strcmp(gm, "SC" ) != 0 ) { throw new nec_exception("PATCH DATA ERROR" ); } patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); } /* "ga" card, generate segment data for wire arc */ else if (card_id == "GA") { nwire++; i1= n+1; i2= n+ card_int_2; m_output->nec_printf( "\n" " %5d ARC RADIUS: %9.5f FROM: %8.3f TO: %8.3f DEGREES" " %11.5f %5d %5d %5d %4d", nwire, xw1, yw1, zw1, xw2, card_int_2, i1, i2, card_int_1 ); arc( card_int_1, card_int_2, xw1, yw1, zw1, xw2); } /* "sc" card */ else if (card_id == "SC") { if ( isct == 0) { throw new nec_exception("PATCH DATA ERROR" ); } i1= m+1; card_int_2++; if ( (card_int_1 != 0) || ((card_int_2 != 2) && (card_int_2 != 4)) ) { throw new nec_exception("PATCH DATA ERROR" ); } xs1= x4; ys1= y4; zs1= z4; xs2= x3; ys2= y3; zs2= z3; x3= xw1; y3= yw1; z3= zw1; if ( card_int_2 == 4) { x4= xw2; y4= yw2; z4= zw2; } xw1= xs1; yw1= ys1; zw1= zs1; xw2= xs2; yw2= ys2; zw2= zs2; if ( card_int_2 != 4) { x4= xw1+ x3- xw2; y4= yw1+ y3- yw2; z4= zw1+ z3- zw2; } m_output->nec_printf( "\n" " %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f", i1, ipt[card_int_2-1], xw1, yw1, zw1, xw2, yw2, zw2 ); m_output->nec_printf( "\n" " %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f", x3, y3, z3, x4, y4, z4 ); patch( card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4); } /* "gh" card, generate helix */ else if (card_id == "GH") { nwire++; i1= n+1; i2= n+ card_int_2; m_output->nec_printf( "\n" " %5d HELIX STRUCTURE - SPACING OF TURNS: %8.3f AXIAL" " LENGTH: %8.3f %8.3f %5d %5d %5d %4d\n " " RADIUS X1:%8.3f Y1:%8.3f X2:%8.3f Y2:%8.3f ", nwire, xw1, yw1, rad, card_int_2, i1, i2, card_int_1, zw1, xw2, yw2, zw2 ); helix( xw1, yw1, zw1, xw2, yw2, zw2, rad, card_int_2, card_int_1); } /* "gf" card, not supported */ else if (card_id == "GF") throw new nec_exception("NGF solution option not supported"); /* error message */ else { m_output->nec_printf( "\n GEOMETRY DATA CARD ERROR" ); m_output->nec_printf( "\n" " %2s %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f", gm, card_int_1, card_int_2, xw1, yw1, zw1, xw2, yw2, zw2, rad ); throw new nec_exception("GEOMETRY DATA CARD ERROR"); } } /* do */ while( true ); } #include "nec_wire.h" /** We have finished with the geometry description, now connect things up. */ void c_geometry::geometry_complete(nec_context* in_context, int card_int_1, int card_int_2) { if (0 == np + mp) throw new nec_exception("Geometry has no wires or patches."); /* TCAM: The following does not make sense for the semantics of the plot card. I have left this in, I hope someone will tell me why it is required. */ if (card_int_2 != 0) in_context->plot_card.set_plot_real_imag_currents(); /* Check to see whether any wires intersect with one another */ for (uint32_t i=0; i j) { nec_wire b = m_wires[j]; vector wires = a.intersect(b); if (wires.size() > 2) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR -- WIRE #"); nex->append(j+1); nex->append(" INTERSECTS WIRE #"); nex->append(i+1); throw nex; } } } } // now proceed and complete the geometry setup... // Check here that patches form a closed surfaceAntennaInput /* From Jerry Burke (the original author of NEC2): Patches are modeled in NEC-2 and NEC-4 with the magnetic field integral equation, and it is valid only for closed perfectly conducting surfaces. ďż˝You start with a single patch and connect a wire to its center so that it splits into four patches. ďż˝You would need to use the SM command to make a surface with more patches, then use other SM or MV commands to form the other five faces of a closed box. ďż˝People often do use the NEC patch model for non-closed surfaces, and it is completely invalid. ďż˝It would be very useful to have a check for non-closed patch surfaces in NEC-2 or in GUIs written for it , but determining whether a bunch of patches forms a closed surface is not easy. ďż˝If you want to model a monopole on a surface in NEC-2, you should model the surface as a wire grid. */ connect_segments( card_int_1); if ( n != 0) { /* Allocate wire buffers */ segment_length.resize(n); sab.resize(n); cab.resize(n); salp.resize(n); m_output->nec_printf( "\n\n\n" " " " ---------- SEGMENTATION DATA ----------\n" " " " COORDINATES IN METERS\n" " " " I+ AND I- INDICATE THE SEGMENTS BEFORE AND AFTER I\n" ); m_output->nec_printf( "\n" " SEG COORDINATES OF SEGM CENTER SEGM ORIENTATION" " ANGLES WIRE CONNECTION DATA TAG\n" " No: X Y Z LENGTH ALPHA " " BETA RADIUS I- I I+ NO:" ); for(int i = 0; i < n; i++ ) { nec_float xw1= x2[i]- x[i]; nec_float yw1= y2[i]- y[i]; nec_float zw1= z2[i]- z[i]; x[i]=( x[i]+ x2[i])*.5; y[i]=( y[i]+ y2[i])*.5; z[i]=( z[i]+ z2[i])*.5; nec_float xw2= xw1* xw1+ yw1* yw1+ zw1* zw1; nec_float yw2= sqrt( xw2); yw2=( xw2/ yw2+ yw2)*.5; segment_length[i]= yw2; cab[i]= xw1/ yw2; sab[i]= yw1/ yw2; xw2= zw1/ yw2; if ( xw2 > 1.) xw2=1.; if ( xw2 < -1.) xw2=-1.; salp[i]= xw2; xw2= rad_to_degrees(asin( xw2)); yw2= rad_to_degrees(atan2( yw1, xw1)); m_output->nec_printf( "\n" " %5d %9.4f %9.4f %9.4f %9.4f" " %9.4f %9.4f %9.4f %5d %5d %5d %5d", i+1, x[i], y[i], z[i], segment_length[i], xw2, yw2, segment_radius[i], icon1[i], i+1, icon2[i], segment_tags[i] ); in_context->plot_card.plot_segments(i,x,y,z,segment_length,xw2,yw2,segment_radius,icon1,icon2); if ( (segment_length[i] <= 1.e-20) || (segment_radius[i] <= 0.) ) { throw new nec_exception("SEGMENT DATA ERROR" ); } } /* for( i = 0; i < n; i++ ) */ } /* if ( n != 0) */ if ( m != 0) { m_output->nec_printf( "\n\n\n" " " " --------- SURFACE PATCH DATA ---------\n" " " " COORDINATES IN METERS\n\n" " PATCH COORD. OF PATCH CENTER UNIT NORMAL VECTOR " " PATCH COMPONENTS OF UNIT TANGENT VECTORS\n" " NO: X Y Z X Y Z " " AREA X1 Y1 Z1 X2 Y2 Z2" ); for(int i = 0; i < m; i++ ) { nec_float xw1=( t1y[i]* t2z[i]- t1z[i]* t2y[i])* psalp[i]; nec_float yw1=( t1z[i]* t2x[i]- t1x[i]* t2z[i])* psalp[i]; nec_float zw1=( t1x[i]* t2y[i]- t1y[i]* t2x[i])* psalp[i]; m_output->nec_printf( "\n" " %4d %10.5f %10.5f %10.5f %8.4f %8.4f %8.4f" " %10.5f %8.4f %8.4f %8.4f %8.4f %8.4f %8.4f", i+1, px[i], py[i], pz[i], xw1, yw1, zw1, pbi[i], t1x[i], t1y[i], t1z[i], t2x[i], t2y[i], t2z[i] ); } /* for( i = 0; i < m; i++ ) */ } /* if ( m == 0) */ n_plus_m = n+m; n_plus_2m = n+2*m; n_plus_3m = n+3*m; x_unscaled.resize(n); y_unscaled.resize(n); z_unscaled.resize(n); si_unscaled.resize(n); bi_unscaled.resize(n); px_unscaled.resize(m); py_unscaled.resize(m); pz_unscaled.resize(m); pbi_unscaled.resize(m); // Fill the unscaled segments... for (int i = 0; i < n; i++ ) { x_unscaled[i]= x[i]; y_unscaled[i]= y[i]; z_unscaled[i]= z[i]; si_unscaled[i]= segment_length[i]; bi_unscaled[i]= segment_radius[i]; } // Fill the unscaled patches... for (int i = 0; i < m; i++ ) { px_unscaled[i]= px[i]; py_unscaled[i]= py[i]; pz_unscaled[i]= pz[i]; pbi_unscaled[i]= pbi[i]; } } /*! \brief Generates segment geometry for a straingt wire \param tag_id \param segment_count Number of Elements (should be around 12-20 per wavelength) \param rad Wire radius of first segment (in Meters) \param rdel Ratio of the length of a segment to the length of the previous segment. (Set to 1.0 if segments have uniform length) \param rrad The ratio of the radii of adjacent segments (Set to 1.0 if not tapered) */ void c_geometry::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 ) { nec_float delz, rd, fns, radz; int istart = n; n = n + segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; /* Reallocate tags buffer */ segment_tags.resize(n + m); /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); nec_3vector dx(xw2- xw1, yw2- yw1, zw2- zw1); if ( fabs(rdel-1.0) >= 1.0e-6) // Use a tapered wire { delz= dx.norm(); dx /= delz; delz= delz*(1.- rdel)/(1.- pow(rdel, segment_count) ); rd= rdel; } else { fns= segment_count; dx /= fns; delz=1.0; rd=1.0; } /* There is no restriction on the angle between two wires, but accuracy will be lost if the center of a segment falls within the volume of the wire the segment connects to. The risk of this reduces as the angle between wires approaches 180 degrees. Wires which intersect away from their ends are not connected, but errors will occur if one wire occupies the space of another one. For accuracy, separate wire centers by several radii of the largest wire. */ // check that none of the existing wires intersect with the midpoint // of the first and last segment nec_3vector wire_start(xw1,yw1,zw1); nec_3vector wire_end(xw2,yw2,zw2); nec_3vector seg_midpoint(wire_start + (dx/2)*delz); nec_3vector end_seg_midpoint = wire_end - (dx*delz / 2); /* Check to see whether any wires intersect with the segment_midpoint */ for (uint32_t i=0; iappend(" OF WIRE #"); nex->append(m_wires.size()+1); nex->append(" INTERSECTS WIRE #"); nex->append(i+1); throw nex; } if (a.intersect(end_seg_midpoint)) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR -- LAST SEGMENT MIDPOINT"); nex->append(" OF WIRE #"); nex->append(m_wires.size()+1); nex->append(" INTERSECTS WIRE #"); nex->append(i+1); throw nex; } } radz= rad; nec_3vector xs1(xw1,yw1,zw1); nec_3vector x_end(xw2,yw2,zw2); m_wires.push_back(nec_wire(xs1, x_end, rad)); for (int i = istart; i < n; i++ ) { segment_tags[i]= tag_id; nec_3vector xs2(xs1 + dx*delz); x[i]= xs1.x(); y[i]= xs1.y(); z[i]= xs1.z(); x2[i]= xs2.x(); y2[i]= xs2.y(); z2[i]= xs2.z(); ASSERT(0.0 != radz); segment_radius[i]= radz; delz= delz* rd; radz= radz* rrad; xs1 = xs2; } x2[n-1]= xw2; y2[n-1]= yw2; z2[n-1]= zw2; } /*-----------------------------------------------------------------------*/ /* subroutine helix generates segment geometry */ /* data for a helix of segment_count segments */ void c_geometry::helix( nec_float s, nec_float hl, nec_float a1, nec_float b1, nec_float a2, nec_float b2, nec_float rad, int segment_count, int tag_id ) { int ist; nec_float turns, zinc, copy, sangle, hdia, turn, pitch, hmaj, hmin; ist= n; n += segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; turns= fabs( hl/ s); zinc= fabs( hl/ segment_count); segment_tags.resize(n+m); /*????*/ /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); z[ist]=0.; for(int i = ist; i < n; i++ ) { segment_radius[i]= rad; segment_tags[i]= tag_id; if ( i != ist ) z[i]= z[i-1]+ zinc; z2[i]= z[i]+ zinc; if ( a2 == a1) { if ( b1 == 0.) b1= a1; x[i]= a1* cos(2.* pi()* z[i]/ s); y[i]= b1* sin(2.* pi()* z[i]/ s); x2[i]= a1* cos(2.* pi()* z2[i]/ s); y2[i]= b1* sin(2.* pi()* z2[i]/ s); } else { if ( b2 == 0.) b2= a2; x[i]=( a1+( a2- a1)* z[i]/ fabs( hl))* cos(2.* pi()* z[i]/ s); y[i]=( b1+( b2- b1)* z[i]/ fabs( hl))* sin(2.* pi()* z[i]/ s); x2[i]=( a1+( a2- a1)* z2[i]/ fabs( hl))* cos(2.* pi()* z2[i]/ s); y2[i]=( b1+( b2- b1)* z2[i]/ fabs( hl))* sin(2.* pi()* z2[i]/ s); } /* if ( a2 == a1) */ if ( hl > 0.) continue; copy= x[i]; x[i]= y[i]; y[i]= copy; copy= x2[i]; x2[i]= y2[i]; y2[i]= copy; } /* for( i = ist; i < n; i++ ) */ if ( a2 != a1) { sangle= atan( a2/( fabs( hl)+( fabs( hl)* a1)/( a2- a1))); m_output->nec_printf( "\n THE CONE ANGLE OF THE SPIRAL IS %10.4f", sangle ); return; } if ( a1 == b1) { hdia=2.* a1; turn= hdia* pi(); pitch= atan( s/( pi()* hdia)); turn= turn/ cos( pitch); pitch=180.* pitch/ pi(); } else { if ( a1 >= b1) { hmaj=2.* a1; hmin=2.* b1; } else { hmaj=2.* b1; hmin=2.* a1; } hdia= sqrt(( hmaj*hmaj+ hmin*hmin)/2* hmaj); turn=2.* pi()* hdia; pitch=(180./ pi())* atan( s/( pi()* hdia)); } /* if ( a1 == b1) */ m_output->nec_printf( "\n" " THE PITCH ANGLE IS: %.4f THE LENGTH OF WIRE/TURN IS: %.4f", pitch, turn ); } /*-----------------------------------------------------------------------*/ /* subroutine move moves the structure with respect to its */ /* coordinate system or reproduces structure in new positions. */ /* structure is rotated about x,y,z axes by rox,roy,roz */ /* respectively, then shifted by xs,ys,zs */ void c_geometry::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 ) { int nrp, ix, i1, k, ir, i, ii; nec_float sps, cps, sth, cth, sph, cph, xx, xy; nec_float xz, yx, yy, yz, zx, zy, zz, xi, yi, zi; if ( fabs( rox)+ fabs( roy) > 1.0e-10) m_ipsym= m_ipsym*3; sps= sin( rox); cps= cos( rox); sth= sin( roy); cth= cos( roy); sph= sin( roz); cph= cos( roz); xx= cph* cth; xy= cph* sth* sps- sph* cps; xz= cph* sth* cps+ sph* sps; yx= sph* cth; yy= sph* sth* sps+ cph* cps; yz= sph* sth* cps- cph* sps; zx=- sth; zy= cth* sps; zz= cth* cps; if ( nrpt == 0) nrp=1; else nrp= nrpt; ix=1; if ( n > 0) { i1= get_segment_number( its, 1); if ( i1 < 1) i1= 1; ix= i1; if ( nrpt == 0) k= i1-1; else { k= n; /* Reallocate tags buffer */ segment_tags.resize(n+m + (n+1-i1)*nrpt); // mreq = n+m + (n+1-i1)*nrpt; // segment_tags.resize(mreq); /* Reallocate wire buffers */ int new_size = (n+(n+1-i1)*nrpt); x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); } for( ir = 0; ir < nrp; ir++ ) { for( i = i1-1; i < n; i++ ) { xi= x[i]; yi= y[i]; zi= z[i]; x[k]= xi* xx+ yi* xy+ zi* xz+ xs; y[k]= xi* yx+ yi* yy+ zi* yz+ ys; z[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= x2[i]; yi= y2[i]; zi= z2[i]; x2[k]= xi* xx+ yi* xy+ zi* xz+ xs; y2[k]= xi* yx+ yi* yy+ zi* yz+ ys; z2[k]= xi* zx+ yi* zy+ zi* zz+ zs; segment_radius[k]= segment_radius[i]; segment_tags[k]= segment_tags[i]; if ( segment_tags[i] != 0) segment_tags[k]= segment_tags[i]+ itgi; k++; } /* for( i = i1; i < n; i++ ) */ i1= n+1; n= k; } /* for( ir = 0; ir < nrp; ir++ ) */ } /* if ( n >= n2) */ if ( m > 0) { i1 = 0; if ( nrpt == 0) k= 0; else k = m; /* Reallocate patch buffers */ int new_size = m * (1+nrpt); px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( ii = 0; ii < nrp; ii++ ) { for( i = i1; i < m; i++ ) { xi= px[i]; yi= py[i]; zi= pz[i]; px[k]= xi* xx+ yi* xy+ zi* xz+ xs; py[k]= xi* yx+ yi* yy+ zi* yz+ ys; pz[k]= xi* zx+ yi* zy+ zi* zz+ zs; xi= t1x[i]; yi= t1y[i]; zi= t1z[i]; t1x[k]= xi* xx+ yi* xy+ zi* xz; t1y[k]= xi* yx+ yi* yy+ zi* yz; t1z[k]= xi* zx+ yi* zy+ zi* zz; xi= t2x[i]; yi= t2y[i]; zi= t2z[i]; t2x[k]= xi* xx+ yi* xy+ zi* xz; t2y[k]= xi* yx+ yi* yy+ zi* yz; t2z[k]= xi* zx+ yi* zy+ zi* zz; psalp[k]= psalp[i]; pbi[k]= pbi[i]; k++; } /* for( i = i1; i < m; i++ ) */ i1= m; m = k; } /* for( ii = 0; ii < nrp; ii++ ) */ } /* if ( m >= m2) */ if ( (nrpt == 0) && (ix == 1) ) return; np= n; mp= m; m_ipsym=0; return; } /*-----------------------------------------------------------------------*/ /* reflects partial structure along x,y, or z axes or rotates */ /* structure to complete a symmetric structure. */ void c_geometry::reflect( int ix, int iy, int iz, int itx, int nop ) { int iti, i, nx, itagi, k; nec_float e1, e2, fnop, sam, cs, ss, xk, yk; np= n; mp= m; m_ipsym=0; iti= itx; if ( ix >= 0) { if ( nop == 0) return; m_ipsym=1; /* reflect along z axis */ if ( iz != 0) { m_ipsym=2; if ( n > 0 ) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m)); /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= z[i]; e2= z2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]= x[i]; y[nx]= y[i]; z[nx]=- e1; x2[nx]= x2[i]; y2[nx]= y2[i]; z2[nx]=- e2; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } /* for( i = 0; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if ( n > 0) */ if ( m > 0 ) { /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx = i+m; if ( fabs(pz[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]= px[i]; py[nx]= py[i]; pz[nx]=- pz[i]; t1x[nx]= t1x[i]; t1y[nx]= t1y[i]; t1z[nx]=- t1z[i]; t2x[nx]= t2x[i]; t2y[nx]= t2y[i]; t2z[nx]=- t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; } /* if ( m >= m2) */ } /* if ( iz != 0) */ /* reflect along y axis */ if ( iy != 0) { if ( n > 0) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m));/*????*/ /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= y[i]; e2= y2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]= x[i]; y[nx]=- e1; z[nx]= z[i]; x2[nx]= x2[i]; y2[nx]=- e2; z2[nx]= z2[i]; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } /* for( i = n2-1; i < n; i++ ) */ n= n*2; iti= iti*2; } /* if ( n >= n2) */ if ( m > 0 ) { /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx= i+m; if ( fabs( py[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]= px[i]; py[nx]=- py[i]; pz[nx]= pz[i]; t1x[nx]= t1x[i]; t1y[nx]=- t1y[i]; t1z[nx]= t1z[i]; t2x[nx]= t2x[i]; t2y[nx]=- t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } /* for( i = m2; i <= m; i++ ) */ m= m*2; } /* if ( m >= m2) */ } /* if ( iy != 0) */ /* reflect along x axis */ if ( ix == 0 ) return; if ( n > 0 ) { /* Reallocate tags buffer */ segment_tags.resize(2*n + m); // segment_tags.resize((2*n+m));/*????*/ /* Reallocate wire buffers */ int new_size = 2*n; x.resize(new_size); y.resize(new_size); z.resize(new_size); x2.resize(new_size); y2.resize(new_size); z2.resize(new_size); segment_radius.resize(new_size); for( i = 0; i < n; i++ ) { nx= i+ n; e1= x[i]; e2= x2[i]; if ( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } x[nx]=- e1; y[nx]= y[i]; z[nx]= z[i]; x2[nx]=- e2; y2[nx]= y2[i]; z2[nx]= z2[i]; itagi= segment_tags[i]; if ( itagi == 0) segment_tags[nx]=0; if ( itagi != 0) segment_tags[nx]= itagi+ iti; segment_radius[nx]= segment_radius[i]; } n= n*2; } /* if ( n > 0) */ if ( m == 0 ) return; /* Reallocate patch buffers */ int new_size = 2*m; px.resize(new_size); py.resize(new_size); pz.resize(new_size); t1x.resize(new_size); t1y.resize(new_size); t1z.resize(new_size); t2x.resize(new_size); t2y.resize(new_size); t2z.resize(new_size); pbi.resize(new_size); psalp.resize(new_size); for( i = 0; i < m; i++ ) { nx= i+m; if ( fabs( px[i]) <= 1.0e-10) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--PATCH "); nex->append(i+1); nex->append("LIES IN PLANE OF SYMMETRY"); throw nex; } px[nx]=- px[i]; py[nx]= py[i]; pz[nx]= pz[i]; t1x[nx]=- t1x[i]; t1y[nx]= t1y[i]; t1z[nx]= t1z[i]; t2x[nx]=- t2x[i]; t2y[nx]= t2y[i]; t2z[nx]= t2z[i]; psalp[nx]=- psalp[i]; pbi[nx]= pbi[i]; } m= m*2; return; } /* if ( ix >= 0) */ /* reproduce structure with rotation to form cylindrical structure */ fnop= (nec_float)nop; m_ipsym=-1; sam=two_pi() / fnop; cs= cos( sam); ss= sin( sam); if ( n > 0) { n *= nop; nx= np; /* Reallocate tags buffer */ segment_tags.resize(n + m); //segment_tags.resize((n+m));/*????*/ /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); for( i = nx; i < n; i++ ) { k= i- np; xk= x[k]; yk= y[k]; x[i]= xk* cs- yk* ss; y[i]= xk* ss+ yk* cs; z[i]= z[k]; xk= x2[k]; yk= y2[k]; x2[i]= xk* cs- yk* ss; y2[i]= xk* ss+ yk* cs; z2[i]= z2[k]; segment_radius[i]= segment_radius[k]; itagi= segment_tags[k]; if ( itagi == 0) segment_tags[i]=0; if ( itagi != 0) segment_tags[i]= itagi+ iti; } } /* if ( n >= n2) */ if ( m == 0 ) return; m *= nop; nx= mp; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); for( i = nx; i < m; i++ ) { k = i-mp; xk= px[k]; yk= py[k]; px[i]= xk* cs- yk* ss; py[i]= xk* ss+ yk* cs; pz[i]= pz[k]; xk= t1x[k]; yk= t1y[k]; t1x[i]= xk* cs- yk* ss; t1y[i]= xk* ss+ yk* cs; t1z[i]= t1z[k]; xk= t2x[k]; yk= t2y[k]; t2x[i]= xk* cs- yk* ss; t2y[i]= xk* ss+ yk* cs; t2z[i]= t2z[k]; psalp[i]= psalp[k]; pbi[i]= pbi[k]; } /* for( i = nx; i < m; i++ ) */ } /*-----------------------------------------------------------------------*/ /*! \brief Scale all dimensions of a structure by a constant.*/ void c_geometry::scale( nec_float xw1 ) { // scale wires for (int i = 0; i < n; i++) { x[i] = x[i]* xw1; y[i] = y[i]* xw1; z[i] = z[i]* xw1; x2[i] = x2[i]* xw1; y2[i] = y2[i]* xw1; z2[i] = z2[i]* xw1; segment_radius[i]= segment_radius[i] * xw1; } if ( m > 0) { // scale patches nec_float yw1= xw1* xw1; for (int i = 0; i < m; i++) { px[i]= px[i]* xw1; py[i]= py[i]* xw1; pz[i]= pz[i]* xw1; pbi[i]= pbi[i]* yw1; } } /* if ( m > 0) */ } /*-----------------------------------------------------------------------*/ /* connect sets up segment connection data in arrays icon1 and */ /* icon2 by searching for segment ends that are in contact. */ void c_geometry::connect_segments( int ignd ) { nscon= -1; maxcon = 1; if (n <= 1) { throw new nec_exception("GEOMETRY HAS ONE OR FEWER SEGMENTS. Please send bug report. This causes an error that we're trying to fix."); } if ( ignd != 0) { m_output->nec_printf( "\n\n GROUND PLANE SPECIFIED." ); if ( ignd > 0) m_output->nec_printf( "\n WHERE WIRE ENDS TOUCH GROUND, CURRENT WILL" " BE INTERPOLATED TO IMAGE IN GROUND PLANE.\n" ); if ( m_ipsym == 2) { np=2* np; mp=2* mp; } if ( abs( m_ipsym) > 2 ) { np= n; mp= m; } if ( np > n) { throw new nec_exception("ERROR: NP > N IN c_geometry::connect_segments()" ); } if ( (np == n) && (mp == m) ) m_ipsym=0; } /* if ( ignd != 0) */ if ( n != 0) { /* Allocate memory to connections */ icon1.resize((n+m)); icon2.resize((n+m)); for (int i = 0; i < n; i++ ) { int iz = i+1; nec_float zi1 = z[i]; nec_float zi2 = z2[i]; nec_3vector v1(x[i], y[i], z[i]); nec_3vector v2(x2[i], y2[i], z2[i]); nec_float slen = norm(v2 - v1) * SMIN; /* determine connection data for end 1 of segment. */ bool segment_on_ground = false; if ( ignd > 0) { if ( zi1 <= -slen) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("EXTENDS BELOW GROUND"); throw nex; } if ( zi1 <= slen) { icon1[i]= iz; z[i]=0.; segment_on_ground = true; } /* if ( zi1 <= slen) */ } /* if ( ignd > 0) */ if ( false == segment_on_ground ) { int ic= i; nec_float sep=0.0; for (int j = 1; j < n; j++) { ic++; if ( ic >= n) ic=0; nec_3vector vic(x[ic], y[ic], z[ic]); sep = normL1(v1 - vic); if ( sep <= slen) { icon1[i]= -(ic+1); break; } nec_3vector v2ic(x2[ic], y2[ic], z2[ic]); sep = normL1(v1 - v2ic); if ( sep <= slen) { icon1[i]= (ic+1); break; } } /* for( j = 1; j < n; j++) */ if ( ((iz > 0) || (icon1[i] <= PCHCON)) && (sep > slen) ) icon1[i]=0; } /* if ( ! jump ) */ /* determine connection data for end 2 of segment. */ if ( (ignd > 0) || segment_on_ground ) { if ( zi2 <= -slen) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("EXTENDS BELOW GROUND"); throw nex; } if ( zi2 <= slen) { if ( icon1[i] == iz ) { nec_exception* nex = new nec_exception("GEOMETRY DATA ERROR--SEGMENT "); nex->append(iz); nex->append("LIES IN GROUND PLANE"); throw nex; } icon2[i]= iz; z2[i]=0.; continue; } /* if ( zi2 <= slen) */ } /* if ( ignd > 0) */ // re-initialize these vectors! v1 = nec_3vector(x[i], y[i], z[i]); v2 = nec_3vector(x2[i], y2[i], z2[i]); int ic= i; nec_float sep=0.0; for (int j = 1; j < n; j++ ) { ic++; if ( ic >= n) ic=0; nec_3vector vic(x[ic], y[ic], z[ic]); sep = normL1(v2 - vic); if (sep <= slen) { icon2[i]= (ic+1); break; } nec_3vector v2ic(x2[ic], y2[ic], z2[ic]); sep = normL1(v2 - v2ic); if (sep <= slen) { icon2[i]= -(ic+1); break; } } /* for( j = 1; j < n; j++ ) */ if ( ((iz > 0) || (icon2[i] <= PCHCON)) && (sep > slen) ) icon2[i]=0; } /* for( i = 0; i < n; i++ ) */ /* find wire-surface connections for new patches */ for (int ix=0; ix nec_printf( "\n\n" " TOTAL SEGMENTS USED: %d SEGMENTS IN A" " SYMMETRIC CELL: %d SYMMETRY FLAG: %d", n, np, m_ipsym ); if ( m > 0) m_output->nec_printf( "\n" " TOTAL PATCHES USED: %d PATCHES" " IN A SYMMETRIC CELL: %d", m, mp ); if (0 == np + mp) throw new nec_exception("connect_segments Geometry has zero wires and zero patches."); int symmetry = (n+m)/(np+mp); /* was iseg */ if ( symmetry != 1) { /*** may be error condition?? ***/ if ( m_ipsym == 0 ) { nec_error_mode nem(*m_output); m_output->endl(); m_output->line("ERROR: IPSYM=0 IN connect_segments()" ); throw new nec_exception("ERROR: IPSYM=0 IN connect_segments()"); } if ( m_ipsym < 0 ) m_output->nec_printf( "\n STRUCTURE HAS %d FOLD ROTATIONAL SYMMETRY\n", symmetry ); else { int sym_planes = symmetry/2; if ( symmetry == 8) sym_planes=3; m_output->nec_printf( "\n STRUCTURE HAS %d PLANES OF SYMMETRY\n", sym_planes ); } /* if ( m_ipsym < 0 ) */ } /* if ( symmetry == 1) */ if ( n == 0) return; /* Allocate to connection buffers */ jco.resize(maxcon); /* Adjust connected seg. ends to exactly coincide. print junctions of 3 or more seg. also find old seg. connecting to new seg. */ int junction_counter = 0; // used just to print the junction number out if there are 3 or more segments bool header_printed = false; // Have we printed the header for (int j = 0; j < n; j++ ) { int jx = j+1; int iend = -1; int jend = -1; int ix= icon1[j]; int ic=1; jco[0]= -jx; nec_float xa = x[j]; nec_float ya = y[j]; nec_float za = z[j]; while( true ) { if ( (ix != 0) && (ix != (j+1)) && (ix <= PCHCON) ) { int nsflg=0; bool jump = false; do { if ( ix == 0 ) { nec_exception* nex = new nec_exception("CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT: "); nex->append(ix); throw nex; } if ( ix < 0 ) ix= -ix; else jend= -jend; jump = false; if ( ix == jx ) break; if ( ix < jx ) { jump = true; break; } /* Record max. no. of connections */ ic++; if ( ic >= maxcon ) { maxcon = ic+1; jco.resize(maxcon); } jco[ic-1]= ix* jend; if ( ix > 0) nsflg=1; int ixx = ix-1; if ( jend != 1) { xa= xa+ x[ixx]; // dies here if n == 1. ix is totally fried. ya= ya+ y[ixx]; za= za+ z[ixx]; ix= icon1[ixx]; continue; } xa= xa+ x2[ixx]; ya= ya+ y2[ixx]; za= za+ z2[ixx]; ix= icon2[ixx]; } /* do */ while( ix != 0 ); if ( jump && (iend == 1) ) break; else if ( jump ) { iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; continue; } nec_float ic_f = (nec_float)ic; xa = xa / ic_f; ya = ya / ic_f; za = za / ic_f; for (int i = 0; i < ic; i++ ) { ix= jco[i]; if ( ix <= 0) { ix=- ix; int ixx = ix-1; x[ixx]= xa; y[ixx]= ya; z[ixx]= za; continue; } int ixx = ix-1; x2[ixx]= xa; y2[ixx]= ya; z2[ixx]= za; } /* for( i = 0; i < ic; i++ ) */ if ( ic >= 3) { if ( false == header_printed ) { m_output->nec_printf( "\n\n" " ---------- MULTIPLE WIRE JUNCTIONS ----------\n" " JUNCTION SEGMENTS (- FOR END 1, + FOR END 2)" ); header_printed = true; } junction_counter++; m_output->nec_printf( "\n %5d ", junction_counter ); for (int i = 1; i <= ic; i++ ) { m_output->nec_printf( "%5d", jco[i-1] ); if ( !(i % 20) ) m_output->nec_printf( "\n " ); } } /* if ( ic >= 3) */ } /*if ( (ix != 0) && (ix != j) && (ix <= PCHCON) ) */ if ( iend == 1) break; iend=1; jend=1; ix= icon2[j]; ic=1; jco[0]= jx; xa= x2[j]; ya= y2[j]; za= z2[j]; } /* while( true ) */ } /* for( j = 0; j < n; j++ ) */ ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } /* arc generates segment geometry data for an arc of segment_count segments */ void c_geometry::arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ) { int istart = n; n += segment_count; np= n; mp= m; m_ipsym=0; if ( segment_count < 1) return; if ( fabs(ang2 - ang1) > 360.0) { throw new nec_exception("ERROR -- ARC ANGLE EXCEEDS 360 DEGREES"); } /* Reallocate tags buffer */ segment_tags.resize(n+m); /* Reallocate wire buffers */ x.resize(n); y.resize(n); z.resize(n); x2.resize(n); y2.resize(n); z2.resize(n); segment_radius.resize(n); nec_float ang = degrees_to_rad(ang1); nec_float dang = degrees_to_rad(ang2- ang1) / segment_count; nec_float xs1= rada * cos(ang); nec_float zs1= rada * sin(ang); for(int i = istart; i < n; i++ ) { ang += dang; nec_float xs2 = rada * cos(ang); nec_float zs2 = rada * sin(ang); x[i]= xs1; y[i]=0.; z[i]= zs1; x2[i]= xs2; y2[i]=0.; z2[i]= zs2; xs1= xs2; zs1= zs2; segment_radius[i]= rad; segment_tags[i]= tag_id; } /* for( i = ist; i < n; i++ ) */ } /*-----------------------------------------------------------------------*/ /*! \brief patch generates and modifies patch geometry data. */ void c_geometry::patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, nec_float ax3, nec_float ay3, nec_float az3, nec_float ax4, nec_float ay4, nec_float az4 ) { int mi, ntp, iy, ix; nec_float s1x=0., s1y=0., s1z=0., s2x=0., s2y=0., s2z=0., xst=0.; nec_float znv, xnv, ynv, xa, xn2, yn2, zn2, salpn, xs, ys, zs, xt, yt, zt; /* new patches. for nx=0, ny=1,2,3,4 patch is (respectively) */; /* arbitrary, rectagular, triangular, or quadrilateral. */ /* for nx and ny > 0 a rectangular surface is produced with */ /* nx by ny rectangular patches. */ m++; mi= m-1; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); if ( nx > 0) ntp=2; else ntp= ny; if ( ntp <= 1) { px[mi]= ax1; py[mi]= ay1; pz[mi]= az1; pbi[mi]= az2; znv= cos( ax2); xnv= znv* cos( ay2); ynv= znv* sin( ay2); znv= sin( ax2); xa= sqrt( xnv* xnv+ ynv* ynv); if ( xa >= 1.0e-6) { t1x[mi]=- ynv/ xa; t1y[mi]= xnv/ xa; t1z[mi]=0.; } else { t1x[mi]=1.; t1y[mi]=0.; t1z[mi]=0.; } } /* if ( ntp <= 1) */ else { s1x= ax2- ax1; s1y= ay2- ay1; s1z= az2- az1; s2x= ax3- ax2; s2y= ay3- ay2; s2z= az3- az2; if ( nx != 0) { s1x= s1x/ nx; s1y= s1y/ nx; s1z= s1z/ nx; s2x= s2x/ ny; s2y= s2y/ ny; s2z= s2z/ ny; } xnv= s1y* s2z- s1z* s2y; ynv= s1z* s2x- s1x* s2z; znv= s1x* s2y- s1y* s2x; xa= sqrt( xnv* xnv+ ynv* ynv+ znv* znv); xnv= xnv/ xa; ynv= ynv/ xa; znv= znv/ xa; xst= sqrt( s1x* s1x+ s1y* s1y+ s1z* s1z); t1x[mi]= s1x/ xst; t1y[mi]= s1y/ xst; t1z[mi]= s1z/ xst; if ( ntp <= 2) { px[mi]= ax1+.5*( s1x+ s2x); py[mi]= ay1+.5*( s1y+ s2y); pz[mi]= az1+.5*( s1z+ s2z); pbi[mi]= xa; } else { if ( ntp != 4) { px[mi]=( ax1+ ax2+ ax3)/3.; py[mi]=( ay1+ ay2+ ay3)/3.; pz[mi]=( az1+ az2+ az3)/3.; pbi[mi]=.5* xa; } else { s1x= ax3- ax1; s1y= ay3- ay1; s1z= az3- az1; s2x= ax4- ax1; s2y= ay4- ay1; s2z= az4- az1; xn2= s1y* s2z- s1z* s2y; yn2= s1z* s2x- s1x* s2z; zn2= s1x* s2y- s1y* s2x; xst= sqrt( xn2* xn2+ yn2* yn2+ zn2* zn2); salpn=1./(3.*( xa+ xst)); px[mi]=( xa*( ax1+ ax2+ ax3)+ xst*( ax1+ ax3+ ax4))* salpn; py[mi]=( xa*( ay1+ ay2+ ay3)+ xst*( ay1+ ay3+ ay4))* salpn; pz[mi]=( xa*( az1+ az2+ az3)+ xst*( az1+ az3+ az4))* salpn; pbi[mi]=.5*( xa+ xst); s1x=( xnv* xn2+ ynv* yn2+ znv* zn2)/ xst; if ( s1x <= 0.9998) { throw new nec_exception("ERROR -- CORNERS OF QUADRILATERAL PATCH DO NOT LIE IN A PLANE"); } } /* if ( ntp != 4) */ } /* if ( ntp <= 2) */ } /* if ( ntp <= 1) */ t2x[mi]= ynv* t1z[mi]- znv* t1y[mi]; t2y[mi]= znv* t1x[mi]- xnv* t1z[mi]; t2z[mi]= xnv* t1y[mi]- ynv* t1x[mi]; psalp[mi]=1.; if ( nx != 0) { m += nx*ny-1; /* Reallocate patch buffers */ px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); xn2= px[mi]- s1x- s2x; yn2= py[mi]- s1y- s2y; zn2= pz[mi]- s1z- s2z; xs= t1x[mi]; ys= t1y[mi]; zs= t1z[mi]; xt= t2x[mi]; yt= t2y[mi]; zt= t2z[mi]; for( iy = 0; iy < ny; iy++ ) { xn2 += s2x; yn2 += s2y; zn2 += s2z; for( ix = 1; ix <= nx; ix++ ) { xst= (nec_float)ix; px[mi]= xn2+ xst* s1x; py[mi]= yn2+ xst* s1y; pz[mi]= zn2+ xst* s1z; pbi[mi]= xa; psalp[mi]=1.; t1x[mi]= xs; t1y[mi]= ys; t1z[mi]= zs; t2x[mi]= xt; t2y[mi]= yt; t2z[mi]= zt; mi++; } /* for( ix = 0; ix < nx; ix++ ) */ } /* for( iy = 0; iy < ny; iy++ ) */ } /* if ( nx != 0) */ m_ipsym=0; np= n; mp= m; } /*!\brief Divide a patch into four (was subph). Used when a patch is connected to a wire. The patch nx is divided into 4 patches that become nx, nx+1, nx+2, nx+3. The other patches are shifted to make room for the three new patches. \param nx The index of the patch to divide (starting at 1) */ void c_geometry::divide_patch(int nx) { m += 3; px.resize(m); py.resize(m); pz.resize(m); t1x.resize(m); t1y.resize(m); t1z.resize(m); t2x.resize(m); t2y.resize(m); t2z.resize(m); pbi.resize(m); psalp.resize(m); /* Shift patches to make room for new ones */ for (int iy = m-1; iy > nx; iy--) { int old_index = iy - 3; px[iy] = px[old_index]; py[iy] = py[old_index]; pz[iy] = pz[old_index]; pbi[iy] = pbi[old_index]; psalp[iy] = psalp[old_index]; t1x[iy] = t1x[old_index]; t1y[iy] = t1y[old_index]; t1z[iy] = t1z[old_index]; t2x[iy] = t2x[old_index]; t2y[iy] = t2y[old_index]; t2z[iy] = t2z[old_index]; } /* divide patch for connection */ int patch_index = nx-1; nec_float xs = px[patch_index]; nec_float ys = py[patch_index]; nec_float zs = pz[patch_index]; nec_float xa = pbi[patch_index]/4.; nec_float xst = sqrt(xa)/2.; nec_float s1x = t1x[patch_index]; nec_float s1y = t1y[patch_index]; nec_float s1z = t1z[patch_index]; nec_float s2x = t2x[patch_index]; nec_float s2y = t2y[patch_index]; nec_float s2z = t2z[patch_index]; nec_float saln = psalp[patch_index]; nec_float xt = xst; nec_float yt = xst; int new_index = patch_index; /* Generate the four new patches */ for (int ix = 1; ix <= 4; ix++ ) { px[new_index]= xs+ xt* s1x+ yt* s2x; py[new_index]= ys+ xt* s1y+ yt* s2y; pz[new_index]= zs+ xt* s1z+ yt* s2z; pbi[new_index]= xa; t1x[new_index]= s1x; t1y[new_index]= s1y; t1z[new_index]= s1z; t2x[new_index]= s2x; t2y[new_index]= s2y; t2z[new_index]= s2z; psalp[new_index]= saln; if (2 == ix) yt = -yt; if ( (ix == 1) || (ix == 3) ) xt = -xt; new_index++; } /* Readjust the mp patch index to account for the added patches */ if (nx <= mp) mp += 3; } /*----------------------------------------------------------------------- Read Geometry Data from a Card -------------------------------------------------------------------------*/ void c_geometry::read_geometry_card(FILE* input_fp, char *gm, int *in_i1, int *in_i2, nec_float *in_x1, nec_float *in_y1, nec_float *in_z1, nec_float *in_x2, nec_float *in_y2, nec_float *in_z2, nec_float *in_rad ) { char line_buf[134]; int i, line_idx; int n_integer_params = 2, n_float_params = 7; int integer_params[2] = { 0, 0 }; nec_float real_params[7] = { 0., 0., 0., 0., 0., 0., 0. }; /* read a line from input file */ load_line( line_buf, input_fp ); /* get line length */ int line_length = (int)strlen( line_buf ); /* abort if card's mnemonic too short or missing */ if ( line_length < 2 ) { nec_exception* nex = new nec_exception("GEOMETRY DATA CARD ERROR:"); nex->append(" CARD'S MNEMONIC CODE TOO SHORT OR MISSING."); throw nex; } /* extract card's mnemonic code */ strncpy( gm, line_buf, 2 ); gm[2] = '\0'; /* Exit if "XT" command read (for testing) */ if ( strcmp( gm, "XT" ) == 0 ) { nec_exception* nex = new nec_exception("Exiting after an \"XT\" command in read_geometry_card()"); throw nex; } /* Return if only mnemonic on card */ if ( line_length == 2 ) { *in_i1 = *in_i2 = 0; *in_x1 = *in_y1 = *in_z1 = *in_x2 = *in_y2 = *in_z2 = *in_rad = 0.0; return; } /* read integers from line */ line_idx = 1; for( i = 0; i < n_integer_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') ) if ( (line_buf[line_idx] == '\0') ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } /* read an integer from line */ integer_params[i] = atoi( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') ) { nec_stop( "GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN INTEGER FIELD AT CHAR. %d\n", gm, line_buf[line_idx], (line_idx+1) ); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } } /* for( i = 0; i < n_integer_params; i++ ) */ /* read nec_floats from line */ for( i = 0; i < n_float_params; i++ ) { /* Find first numerical character */ while( ((line_buf[++line_idx] < '0') || (line_buf[ line_idx] > '9')) && (line_buf[ line_idx] != '+') && (line_buf[ line_idx] != '-') && (line_buf[ line_idx] != '.') ) if ( (line_buf[line_idx] == '\0') ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } /* read a nec_float from line */ real_params[i] = atof( &line_buf[line_idx] ); /* traverse numerical field to next ' ' or ',' or '\0' */ line_idx--; while( (line_buf[++line_idx] != ' ') && (line_buf[ line_idx] != ',') && (line_buf[ line_idx] != '\0') ) { /* test for non-numerical characters */ if ( ((line_buf[line_idx] < '0') || (line_buf[line_idx] > '9')) && (line_buf[line_idx] != '.') && (line_buf[line_idx] != '+') && (line_buf[line_idx] != '-') && (line_buf[line_idx] != 'E') && (line_buf[line_idx] != 'e') ) { nec_stop( "\n GEOMETRY DATA CARD \"%s\" ERROR:" "\n NON-NUMERICAL CHARACTER '%c' IN FLOAT FIELD AT CHAR. %d.\n", gm, line_buf[line_idx], (line_idx+1) ); } } /* while( (line_buff[++line_idx] ... */ /* Return on end of line */ if ( line_buf[line_idx] == '\0' ) { *in_i1= integer_params[0]; *in_i2= integer_params[1]; *in_x1= real_params[0]; *in_y1= real_params[1]; *in_z1= real_params[2]; *in_x2= real_params[3]; *in_y2= real_params[4]; *in_z2= real_params[5]; *in_rad= real_params[6]; return; } } /* for( i = 0; i < n_float_params; i++ ) */ *in_i1 = integer_params[0]; *in_i2 = integer_params[1]; *in_x1 = real_params[0]; *in_y1 = real_params[1]; *in_z1 = real_params[2]; *in_x2 = real_params[3]; *in_y2 = real_params[4]; *in_z2 = real_params[5]; *in_rad = real_params[6]; } /* compute basis function i */ void c_geometry::tbf( int i, int icap ) { int jcoxx, njun1=0, njun2, jsnop, jsnox; nec_float sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; jsno=0; nec_float pp = 0.0; int ix = i-1; int jcox = icon1[ix]; if ( jcox > PCHCON) jcox= i; int jend = -1; int iend = -1; nec_float _sig = -1.0; do { if ( jcox != 0 ) { if ( jcox < 0 ) jcox=- jcox; else { _sig = -_sig; jend=- jend; } jcoxx = jcox-1; jsno++; jsnox = jsno-1; jco[jsnox]= jcox; nec_float d = pi() * segment_length[jcoxx]; sdh = sin(d); cdh = cos(d); sd = 2.0 * sdh * cdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( log(1./( pi()* segment_radius[jcoxx]))-.577215664); pp= pp- omc/ sd* aj; ax[jsnox]= aj/ sd* _sig; bx[jsnox]= aj/(2.* cdh); cx[jsnox]=- aj/(2.* sdh)* _sig; if ( jcox != i) { if ( jend == 1) jcox= icon2[jcoxx]; else jcox= icon1[jcoxx]; if ( abs(jcox) != i ) { if ( jcox != 0 ) continue; else { nec_exception* nex = new nec_exception("TBF - SEGMENT CONNECTION ERROR FOR SEGMENT "); nex->append(i); throw nex; } } } /* if ( jcox != i) */ else bx[jsnox] =- bx[jsnox]; if ( iend == 1) break; } /* if ( jcox != 0 ) */ pm=- pp; pp=0.; njun1= jsno; jcox= icon2[ix]; if ( jcox > PCHCON) jcox= i; jend=1; iend=1; _sig=-1.; } /* do */ while( jcox != 0 ); njun2= jsno- njun1; jsnop= jsno; jco[jsnop]= i; nec_float d = pi()* segment_length[ix]; sdh = sin(d); cdh = cos(d); sd = 2.0 * sdh * cdh; cd= cdh*cdh - sdh*sdh; if ( d <= 0.015) { omc = 4.0* d*d; omc = ((1.3888889e-3* omc-4.1666666667e-2)* omc+.5)* omc; } else omc = 1.0 - cd; ap=1./( log(1./( pi()* segment_radius[ix]))-.577215664); aj= ap; if ( njun1 == 0) { if ( njun2 == 0) { bx[jsnop]=0.; if ( icap == 0) xxi=0.; else { qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } cx[jsnop]=1./( cdh- xxi* sdh); jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun2 == 0) */ if ( icap == 0) xxi=0.; else { qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); } qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); d= cd- xxi* sd; bx[jsnop]=( sdh+ ap* qp*( cdh- xxi* sdh))/ d; cx[jsnop]=( cdh+ ap* qp*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun2; iend++ ) { ax[iend]=-ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun1 == 0) */ if ( njun2 == 0) { if ( icap == 0) xxi=0.; else { qm= pi()* segment_radius[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); } qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); d= cd- xxi* sd; bx[jsnop]=( aj* qm*( cdh- xxi* sdh)- sdh)/ d; cx[jsnop]=( cdh- aj* qm*( sdh+ xxi* cdh))/ d; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jsno= jsnop+1; ax[jsnop]=-1.; return; } /* if ( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; bx[jsnop]=( aj* qm+ ap* qp)* sdh/ sd; cx[jsnop]=( aj* qm- ap* qp)* cdh/ sd; for( iend = 0; iend < njun1; iend++ ) { ax[iend]= ax[iend]* qm; bx[iend]= bx[iend]* qm; cx[iend]= cx[iend]* qm; } jend= njun1; for( iend = jend; iend < jsno; iend++ ) { ax[iend]=- ax[iend]* qp; bx[iend]= bx[iend]* qp; cx[iend]=- cx[iend]* qp; } jsno= jsnop+1; ax[jsnop]=-1.; } /* compute the components of all basis functions on segment j */ void c_geometry::trio( int j ) { int jcox, jcoxx, jsnox, jx, jend=0, iend=0; jsno=0; jx = j-1; jcox= icon1[jx]; jcoxx = jcox-1; if ( jcox <= PCHCON) { jend=-1; iend=-1; } if ( (jcox == 0) || (jcox > PCHCON) ) { jcox= icon2[jx]; jcoxx = jcox-1; if ( jcox <= PCHCON) { jend=1; iend=1; } if ( jcox == 0 || (jcox > PCHCON) ) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; return; } } /* if ( (jcox == 0) || (jcox > PCHCON) ) */ do { if ( jcox < 0 ) jcox=- jcox; else jend=- jend; jcoxx = jcox-1; if ( jcox != j) { jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon ); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( jcox, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= jcox; if ( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if ( jcox == 0 ) { nec_exception* nex = new nec_exception("TRIO - SEGMENT CONNENTION ERROR FOR SEGMENT "); nex->append(j); throw nex; } else continue; } /* if ( jcox != j) */ if ( iend == 1) break; jcox= icon2[jx]; if ( jcox > PCHCON) break; jend=1; iend=1; } /* do */ while( jcox != 0 ); jsnox = jsno; jsno++; /* Allocate to connections buffers */ if ( jsno >= maxcon ) { maxcon = jsno +1; jco.resize(maxcon ); ax.resize(maxcon); bx.resize(maxcon); cx.resize(maxcon); } sbf( j, j, &ax[jsnox], &bx[jsnox], &cx[jsnox]); jco[jsnox]= j; } /*! \brief To evaluate the current expansion function associated with a given segment, returning only that portion on a particular segment. \param i The segment on which the expansion function is centered. \param is The segment for which the function coefficients A_j, B_j and C_j are requested \param aa The return value for the function coefficient A_j \param bb The return value for the function coefficient B_j \param cc The return value for the function coefficient C_j SBF is very similar to TBF. Both routines evaluate the current expansion functions. However, while TBF stores the coefficients for each segment on which a given expansion function is non-zero, SBF returns the coefficients ofr only a single specified segment. Refer to TBF for a discussion of the coding and variables. One additional variable in SBF -- june -- is set to -1 or +1 if \param is is found connected to end1 or end2 respectively of segment i. If I == IS and segment i is not connected to a surface of ground plane, then june is set to 0. */ void c_geometry::sbf( int i, int is, nec_float *aa, nec_float *bb, nec_float *cc ) { int local_jsno; // this parameter is renamed because it shadows the member variable of the same name int ix, june, jcox, jcoxx, jend, iend, njun1=0, njun2; nec_float d, sig, pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi; *aa=0.; *bb=0.; *cc=0.; june=0; local_jsno=0; pp=0.; ix=i-1; jcox= icon1[ix]; if ( jcox > PCHCON) jcox= i; jcoxx = jcox-1; jend=-1; iend=-1; sig=-1.; do { DEBUG_TRACE("c_geometry::sbf(" << i << "," << is << "): " << jcox); if ( jcox != 0 ) { if ( jcox < 0 ) jcox=- jcox; else { sig=- sig; jend=- jend; } jcoxx = jcox-1; local_jsno++; d= pi()* segment_length[jcoxx]; sdh= sin( d); cdh= cos( d); sd=2.* sdh* cdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cdh* cdh+ sdh* sdh; aj=1./( log(1./( pi()* segment_radius[jcoxx]))-.577215664); pp -= omc/ sd* aj; if ( jcox == is) { *aa= aj/ sd* sig; *bb= aj/(2.* cdh); *cc=- aj/(2.* sdh)* sig; june= iend; } if ( jcox != i ) { if ( jend != 1) jcox= icon1[jcoxx]; else jcox= icon2[jcoxx]; if ( abs(jcox) != i ) { if ( jcox == 0 ) { nec_exception* nex = new nec_exception("SBF - SEGMENT CONNECTION ERROR FOR SEGMENT "); nex->append(i); throw nex; } else continue; } } /* if ( jcox != i ) */ else if ( jcox == is) *bb=- *bb; if ( iend == 1) break; } /* if ( jcox != 0 ) */ pm=- pp; pp=0.; njun1= local_jsno; jcox= icon2[ix]; if ( jcox > PCHCON) jcox= i; jend=1; iend=1; sig=-1.; } /* do */ while( jcox != 0 ); njun2= local_jsno- njun1; d= pi()* segment_length[ix]; sdh= sin( d); cdh= cos( d); sd=2.* sdh* cdh; cd= cdh* cdh- sdh* sdh; if ( d <= 0.015) { omc=4.* d* d; omc=((1.3888889e-3* omc -4.1666666667e-2)* omc +.5)* omc; } else omc=1.- cd; ap=1./( log(1./( pi()* segment_radius[ix])) -.577215664); aj= ap; if ( njun1 == 0) { if ( njun2 == 0) { *aa =-1.; qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); *cc=1./( cdh- xxi* sdh); return; } qp= pi()* segment_radius[ix]; xxi= qp* qp; xxi= qp*(1.-.5* xxi)/(1.- xxi); qp=-( omc+ xxi* sd)/( sd*( ap+ xxi* pp)+ cd*( xxi* ap- pp)); if ( june == 1) { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; if ( i != is) return; } *aa -= 1.; d = cd - xxi * sd; *bb += (sdh + ap * qp * (cdh - xxi * sdh)) / d; *cc += (cdh + ap * qp * (sdh + xxi * cdh)) / d; return; } /* if ( njun1 == 0) */ if ( njun2 == 0) { qm= pi()* segment_radius[ix]; xxi= qm* qm; xxi= qm*(1.-.5* xxi)/(1.- xxi); qm=( omc+ xxi* sd)/( sd*( aj- xxi* pm)+ cd*( pm+ xxi* aj)); if ( june == -1) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; if ( i != is) return; } *aa -= 1.; d= cd- xxi* sd; *bb += ( aj* qm*( cdh- xxi* sdh)- sdh)/ d; *cc += ( cdh- aj* qm*( sdh+ xxi* cdh))/ d; return; } /* if ( njun2 == 0) */ qp= sd*( pm* pp+ aj* ap)+ cd*( pm* ap- pp* aj); qm=( ap* omc- pp* sd)/ qp; qp=-( aj* omc+ pm* sd)/ qp; if ( june != 0 ) { if ( june < 0 ) { *aa= *aa* qm; *bb= *bb* qm; *cc= *cc* qm; } else { *aa=- *aa* qp; *bb= *bb* qp; *cc=- *cc* qp; } if ( i != is) return; } /* if ( june != 0 ) */ *aa -= 1.; *bb += ( aj* qm+ ap* qp)* sdh/ sd; *cc += ( aj* qm- ap* qp)* cdh/ sd; } /* get_current_coefficients computes coefficients of the: constant [air, aii] sine [bir, bii] cosine [cir, cii] terms in the current interpolation functions for the current vector curx. */ void c_geometry::get_current_coefficients(nec_float wavelength, complex_array& curx, real_array& air, real_array& aii, real_array& bir, real_array& bii, real_array& cir, real_array& cii, complex_array& vqds, int nqds, int_array& iqds) { static nec_complex s_CCJ(0.0,-0.01666666667); nec_float ar, ai, sh; nec_complex cs1, cs2; if ( n != 0) { for (int i = 0; i < n; i++ ) { air[i] = 0.0; aii[i] = 0.0; bir[i] = 0.0; bii[i] = 0.0; cir[i] = 0.0; cii[i] = 0.0; } for (int i = 0; i < n; i++ ) { ar= real( curx[i]); ai= imag( curx[i]); tbf( i+1, 1 ); for (int jx = 0; jx < jsno; jx++ ) { int j = jco[jx]-1; air[j] += ax[jx]* ar; aii[j] += ax[jx]* ai; bir[j] += bx[jx]* ar; bii[j] += bx[jx]* ai; cir[j] += cx[jx]* ar; cii[j] += cx[jx]* ai; } } /* for( i = 0; i < n; i++ ) */ for (int is = 0; is < nqds; is++ ) { int i= iqds[is]-1; int jx= icon1[i]; icon1[i]=0; tbf(i+1,0); icon1[i]= jx; sh = segment_length[i]*.5; nec_complex curd = s_CCJ * vqds[is]/( (log(2.* sh/ segment_radius[i])-1.)* (bx[jsno-1]* cos(two_pi() * sh)+ cx[jsno-1]* sin(two_pi() * sh))* wavelength ); ar = real( curd); ai = imag( curd); for ( jx = 0; jx < jsno; jx++ ) { int j = jco[jx]-1; air[j] += ax[jx]* ar; aii[j] += ax[jx]* ai; bir[j] += bx[jx]* ar; bii[j] += bx[jx]* ai; cir[j] += cx[jx]* ar; cii[j] += cx[jx]* ai; } } /* for( is = 0; is < nqds; is++ ) */ for (int i = 0; i < n; i++ ) curx[i]= nec_complex( air[i]+cir[i], aii[i]+cii[i] ); } /* if ( n != 0) */ if ( m == 0) return; /* convert surface currents from */ /* t1,t2 components to x,y,z components */ int jco1 = n_plus_2m; int jco2 = jco1 + m; for (int i = 1; i <= m; i++ ) { jco1 -= 2; jco2 -= 3; cs1= curx[jco1]; cs2= curx[jco1+1]; curx[jco2] = cs1* t1x[m-i]+ cs2* t2x[m-i]; curx[jco2+1]= cs1* t1y[m-i]+ cs2* t2y[m-i]; curx[jco2+2]= cs1* t1z[m-i]+ cs2* t2z[m-i]; } } void c_geometry::frequency_scale(nec_float freq_mhz) { DEBUG_TRACE("frequency_scale(" << freq_mhz << ")"); nec_float fr = (1.0e6 * freq_mhz) / em::speed_of_light(); DEBUG_TRACE(" fr=(" << fr << ")"); for (int i = 0; i < n; i++ ) { x[i]= x_unscaled[i]* fr; y[i]= y_unscaled[i]* fr; z[i]= z_unscaled[i]* fr; segment_length[i]= si_unscaled[i]* fr; segment_radius[i]= bi_unscaled[i]* fr; if (segment_length[i] < 0.02) { m_output->nec_printf( "WARNING- SEGMENT[%i] LENGTH TOO SMALL (%f)\n",i,segment_length[i]); /* nec_exception* nex = new nec_exception("SCALE - SEGMENT["); nex->append(i); nex->append("] LENGTH TOO SMALL ("); nex->append(segment_length[i]); nex->append(") WAVELENGTHS "); throw nex;*/ } } nec_float fr2 = fr*fr; for (int i = 0; i < m; i++ ) { px[i]= px_unscaled[i]* fr; py[i]= py_unscaled[i]* fr; pz[i]= pz_unscaled[i]* fr; pbi[i]= pbi_unscaled[i]* fr2; } } void c_geometry::fflds(nec_float rox, nec_float roy, nec_float roz, complex_array& scur, nec_complex *in_ex, nec_complex *in_ey, nec_complex *in_ez ) { static nec_complex _const4(0.0,em::impedance() / 2.0); // +188.365 // From FORTRAN common block // EQUIVALENCE (XS,X), (YS,Y), (ZS,Z), (S,BI), (CONS,CONSX) nec_complex ex(cplx_00()); nec_complex ey(cplx_00()); nec_complex ez(cplx_00()); for (int i = 0; i < m; i++ ) { nec_float arg = patch_angle(i,rox,roy,roz); nec_complex ct = cplx_exp(arg) * pbi[i]; int k = 3*i; ex += scur[k]* ct; ey += scur[k+1]* ct; ez += scur[k+2]* ct; } nec_complex ct = rox*ex+ roy*ey+ roz*ez; *in_ex = _const4*(ct*rox - ex); *in_ey = _const4*(ct*roy - ey); *in_ez = _const4*(ct*roz - ez); } int c_geometry::test_ek_approximation(int seg1, int seg2) { nec_float segment_ratio = segment_radius[seg2] / segment_radius[seg1]; nec_float xi = fabs(cab[seg1]*cab[seg2] + sab[seg1]*sab[seg2] + salp[seg1]*salp[seg2]); if ( (xi < 0.999999) || (fabs(segment_ratio-1.0) > 1.e-6)) return 2; else return 0; } nec_float c_geometry::patch_angle(int patch_index, nec_float in_ax, nec_float in_ay, nec_float in_az) { return two_pi()*(in_ax*px[patch_index]+ in_ay*py[patch_index]+ in_az*pz[patch_index]); } necpp-1.5.0+cvs20101003/src/nec_results.h0000644000175000017500000005325111122445120016166 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_results__ #define __nec_results__ #include #include #include #include #include #include "math_util.h" using namespace std; enum RESULT_FORMAT { RESULT_FORMAT_NEC = 1, RESULT_FORMAT_XML = 2, RESULT_FORMAT_CSV = 3 }; /*!\brief A class that handles various standard output functions for the results. This class will handle format changes between various output formats. */ class output_helper { private: ostream& os; enum RESULT_FORMAT m_format; bool m_in_section; public: output_helper(ostream& in_os, enum RESULT_FORMAT in_format) : os(in_os), m_format(in_format), m_in_section(false) { } ~output_helper() { section_end(); } inline void separator() { switch (m_format) { case RESULT_FORMAT_CSV: os << ","; break; case RESULT_FORMAT_NEC: default: os << " "; break; } } inline void start_record() { switch (m_format) { case RESULT_FORMAT_XML: os << ""; break; default: break; } } inline void end_record() { switch (m_format) { case RESULT_FORMAT_XML: os << "" << endl; break; default: os << endl; break; } } inline void padding(const char* s) { switch (m_format) { case RESULT_FORMAT_NEC: os << s; break; default: break; } } void center_text(const std::string& text, const string& border) { size_t len = text.length() + 2*(border.length() + 1); size_t offset = 40 - len/2; for (size_t i=0;i" << endl; break; default: os << endl << endl << endl; break; } m_in_section = true; } inline void section_end() { m_in_section = false; switch (m_format) { case RESULT_FORMAT_NEC: os << endl << endl << endl; break; case RESULT_FORMAT_XML: os << "" << endl; break; default: os << endl << endl << endl; break; } } inline void int_out(int w, int i) { os << setw(w) << i; } inline void string_out(int w, const std::string& s) { os << right << setw(w) << s; } inline void string_out(int w, const char* s) { os << right << setw(w) << s; } inline void real_out(int w, int p, nec_float f, bool sci = true) { ios::fmtflags flags = ios::showpoint | ios::uppercase | ios::right; if (sci) flags |= ios::scientific; else flags |= ios::fixed; os.unsetf(ios::adjustfield | ios::basefield | ios::floatfield); os.setf(flags); os.precision(p); os.width(w); os << f; } inline void complex_out(int w, int p, nec_complex c, bool sci = true) { real_out(w,p,real(c),sci); separator(); real_out(w,p,imag(c),sci); } inline void polar_out(int w, int p, nec_complex c, bool sci = true) { real_out(w,p,abs(c),sci); separator(); real_out(w,p,arg_degrees(c),sci); } }; /*!\brief Used to specify the kind of results we wish to pull out of the results database. */ enum nec_result_type { RESULT_NORMALIZED_RECEIVING_PATTERN = 1, RESULT_STRUCTURE_EXCITATION = 2, RESULT_ANTENNA_INPUT = 3, RESULT_RADIATION_PATTERN = 4, RESULT_NEAR_FIELD_PATTERN = 5, RESULT_STRUCTURE_CURRENTS = 6 }; /** This class contains the results of the NEC analysis. Set methods will store the results in this class, but will NOT print the results to a file */ class nec_base_result { private: bool _write_file; nec_float _frequency; protected: enum RESULT_FORMAT _result_format; public: virtual void write_to_file(ostream& os) = 0; virtual enum nec_result_type get_result_type() = 0; nec_base_result() : _write_file(true), _result_format(RESULT_FORMAT_NEC) { } virtual ~nec_base_result() { } inline bool write_file() const { return _write_file; } inline void set_write_file(bool f) { _write_file = f; } inline void set_frequency(nec_float f) { _frequency = f; } nec_float get_frequency() { return _frequency; } inline void set_result_format(enum RESULT_FORMAT f) { _result_format = f; } }; /** Normalized Receiving Pattern */ class nec_norm_rx_pattern : public nec_base_result { // Receiving Pattern nec_float _norm_factor; nec_float _eta, _axial_ratio; int _segment_number; string _type; long n_theta; long n_phi; nec_float _theta0, _theta_step; nec_float _phi0, _phi_step; real_array _mag; public: nec_norm_rx_pattern( int in_n_theta, int in_n_phi, real_array& in_mag, nec_float theta0, nec_float theta_step, nec_float phi0, nec_float phi_step, nec_float in_eta, nec_float in_axial_ratio, int in_segment_number, string in_type) { n_theta = in_n_theta; n_phi = in_n_phi; _mag = in_mag; _mag.resize(n_theta, n_phi); _theta0 = theta0; _theta_step = theta_step; _phi0 = phi0; _phi_step = phi_step; _eta = in_eta; _axial_ratio = in_axial_ratio; _segment_number = in_segment_number; _type = in_type; _mag.resize(n_theta, n_phi); } virtual ~nec_norm_rx_pattern() { } virtual enum nec_result_type get_result_type() { return RESULT_NORMALIZED_RECEIVING_PATTERN; } void set_input(int theta_index, int phi_index, nec_float mag) { _mag(theta_index,phi_index) = mag; } /*Added for the python wrapping : some basic access functions...*/ int get_n_theta() { return n_theta ; } int get_n_phi() { return n_phi ; } nec_float get_theta_start() { return _theta0; } nec_float get_phi_start() { return _phi0; } nec_float get_delta_theta() { return _theta_step; } nec_float get_delta_phi() { return _phi_step; } nec_float get_eta() { return _eta; } nec_float get_axial_ratio() { return _axial_ratio; } int get_segment_number() { return _segment_number; } string get_type() { return _type; } real_array get_mag() { return _mag; } /*End of access functions added for the wrapping*/ nec_float get_mag(int theta_index, int phi_index) { return _mag(theta_index, phi_index); } nec_float get_norm_factor() { return _mag.maxCoeff(); } virtual void write_to_file(ostream& os) { if (n_theta == 0) return; if (n_phi == 0) return; nec_float norm_factor = get_norm_factor(); output_helper oh(os,_result_format); oh.section_start("NORMALIZED RECEIVING PATTERN"); os << " NORMALIZATION FACTOR: ";oh.real_out(11,4,norm_factor);os << endl; os << " ETA: ";oh.real_out(7,2,_eta,false); os << " DEGREES" << endl; os << " TYPE: " << _type << endl; os << " AXIAL RATIO: "; oh.real_out(6,3,_axial_ratio,false); os << endl; os << " SEGMENT No: ";oh.int_out( 5, _segment_number); os << endl << endl; os << " THETA PHI ---- PATTERN ----" << endl; os << " (DEG) (DEG) DB MAGNITUDE" << endl; nec_float theta = _theta0; for (int t=0; t _tag, _segment; vector _voltage, _current, _impedance, _admittance; vector _power; long n_items; nec_complex voli, curi; public: nec_structure_excitation() { n_items = 0; } virtual ~nec_structure_excitation() { } virtual enum nec_result_type get_result_type() { return RESULT_STRUCTURE_EXCITATION; } /*The two methods bellow have been modified to get rid of "nec_structure_excitation_data" */ /*void add(int segment_number, int segment_tag, nec_complex voltage, nec_complex current, nec_float power) { structure_excitation_data sed(segment_number, segment_tag, voltage, current, power); m_data.push_back(sed); n_items++; } virtual void write_to_file(ostream& os) { output_helper oh(os,_result_format); oh.section_start(); os << " --------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" << endl; os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " No: No: REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i = 0; i < n_items; i++ ) { m_data[i].write(oh); } }*/ void add(int segment, int tag, nec_complex voltage, nec_complex current, nec_float power) { n_items++; _tag.push_back(tag); _segment.push_back(segment); _voltage.push_back(voltage); _current.push_back(current); _impedance.push_back(voltage/current); _admittance.push_back(current/voltage); _power.push_back(power); } virtual void write_to_file(ostream& os) { output_helper oh(os,_result_format); oh.section_start("STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS"); os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " No: No: REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i=0; i get_tag() { return _tag; } vector get_segment() { return _segment; } vector get_current() { return _current; } vector get_voltage() { return _voltage; } vector get_power() { return _power; } /*End of access functions added for the wrapping*/ }; /** Antenna Input Parameters */ class nec_antenna_input : public nec_base_result { // Antenna Input Parameters vector _tag, _segment; vector _power; vector _voltage, _current, _impedance, _admittance; long n_items; public: nec_antenna_input() { n_items = 0; } virtual ~nec_antenna_input() { } virtual enum nec_result_type get_result_type() { return RESULT_ANTENNA_INPUT; } void set_input(int tag, int segment, nec_complex voltage, nec_complex current, nec_complex impedance, nec_complex admittance, nec_float power) { n_items++; _tag.push_back(tag); _segment.push_back(segment); _voltage.push_back(voltage); _current.push_back(current); _impedance.push_back(impedance); _admittance.push_back(admittance); _power.push_back(power); } virtual void write_to_file(ostream& os) { if (n_items == 0) return; output_helper oh(os,_result_format); oh.section_start("ANTENNA INPUT PARAMETERS"); os << " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER" << endl; os << " NO. NO. REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS)" << endl; for (int i=0; i get_tag() { return _tag; } vector get_segment() { return _segment; } vector get_current() { return _current; } vector get_voltage() { return _voltage; } vector& get_impedance() { return _impedance; } vector get_power() { return _power; } /*End of access functions added for the wrapping*/ }; class nec_near_field_pattern : public nec_base_result { private: /*Near field pattern*/ int nfeh; vector _x, _y, _z; vector _field_x, _field_y, _field_z; long n_items; public: nec_near_field_pattern(int in_nfeh) { nfeh = in_nfeh; n_items = 0; } virtual ~nec_near_field_pattern() { } virtual enum nec_result_type get_result_type() { return RESULT_NEAR_FIELD_PATTERN; } void set_input(nec_float x, nec_float y, nec_float z, nec_complex field_x, nec_complex field_y, nec_complex field_z) { n_items++; _x.push_back(x); _y.push_back(y); _z.push_back(z); _field_x.push_back(field_x); _field_y.push_back(field_y); _field_z.push_back(field_z); } virtual void write_to_file(ostream& os) { if (n_items == 0) return; output_helper oh(os,_result_format); if ( nfeh != 1) { oh.section_start("NEAR ELECTRIC FIELDS"); os << " ------- LOCATION ------- ------- EX ------ ------- EY ------ ------- EZ ------" << endl; os << " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE" << endl; os << " METERS METERS METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" << endl; } else { oh.section_start("NEAR MAGNETIC FIELDS"); os << " ------- LOCATION ------- ------- HX ------ ------- HY ------ ------- HZ ------" << endl; os << " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE" << endl; os << " METERS METERS METERS AMPS/M DEGREES AMPS/M DEGREES AMPS/M DEGREES" << endl; } for (int i=0; i get_x() { return _x; } vector get_y() { return _y; } vector get_z() { return _z; } vector get_field_x() { return _field_x; } vector get_field_y() { return _field_y; } vector get_field_z() { return _field_z; } /*End of access functions added for the wrapping*/ }; class nec_radiation_pattern; class nec_structure_currents; /** Stores a whole lot of nec_result objects. This class is effectively a database of the simulation results. Usage nec_antenna_input* ai = new nec_antenna_input(); s_results.add(ai); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); ai->set_intput(tag, segment, voltage, current, impedance, admittance, power); */ class nec_results { vector _results; int _n; bool _file_out; public: enum RESULT_FORMAT m_result_format; nec_results() { m_result_format = RESULT_FORMAT_NEC; _n = 0; _file_out = false; } // On destruction we write to a file. ~nec_results() { // write_to_file(); for (int i=0;i<_n;i++) { delete _results[i]; _results[i] = NULL; } } void add(nec_base_result* br) { br->set_result_format(m_result_format); _results.push_back(br); _n++; } /*!\brief Get the nth result that matches the specified result type \param index The zero-based index for the result \param result_type The requested result type \return NULL if the result does not exist. \note You must NOT delete the nec_norm_rx_pattern object when finished with it. */ nec_base_result* get_result(const long index, const enum nec_result_type result_type) { long counter = 0; for (int i=0;i<_n;i++) { if (_results[i]->get_result_type() == result_type) { if (index == counter++) return _results[i]; } } return NULL; } /*!\brief Get normalized receiving pattern results \param index The zero-based index for the normalized receiving pattern. \return NULL if the result does not exist. \note You must NOT delete the nec_norm_rx_pattern object when finished with it. */ nec_norm_rx_pattern* get_norm_rx_pattern(const long index) { return (nec_norm_rx_pattern*)get_result(index, RESULT_NORMALIZED_RECEIVING_PATTERN); } /*!\brief Get radiation pattern results \param index The zero-based index for the radiation pattern. \return NULL if the result does not exist. \note You must NOT delete the nec_radiation_pattern object when finished with it. */ nec_radiation_pattern* get_radiation_pattern(const long index) { return (nec_radiation_pattern*)get_result(index, RESULT_RADIATION_PATTERN); } /*!\brief Get antenna input parameter results \param index The zero-based index for the antenna input. \return NULL if the result does not exist. \note You must NOT delete the nec_antenna_input object when finished with it. */ nec_antenna_input* get_antenna_input(const long index) { return (nec_antenna_input*)get_result(index, RESULT_ANTENNA_INPUT); } /*!\brief Get structure excitation results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_structure_excitation* get_structure_excitation(const long index) { return (nec_structure_excitation*)get_result(index, RESULT_STRUCTURE_EXCITATION); } /*!\brief Get near field pattern results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_near_field_pattern* get_near_field_pattern(const long index) { return (nec_near_field_pattern*)get_result(index, RESULT_NEAR_FIELD_PATTERN); } /*!\brief Get structure currents results \param index The zero-based index for the nec_structure_excitation. \return NULL if the result does not exist. \note You must NOT delete the nec_structure_excitation object when finished with it. */ nec_structure_currents* get_structure_currents(const long index) { return (nec_structure_currents*)get_result(index, RESULT_STRUCTURE_CURRENTS); } void write(ostream& os) { for (int i=0;i<_n;i++) { if (_results[i]->write_file()) { _results[i]->write_to_file(os); _results[i]->set_write_file(false); } } } }; #endif /* __nec_results__ */ necpp-1.5.0+cvs20101003/src/c_evlcom.cpp0000644000175000017500000004250410741570022015767 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_evlcom.h" #include "matrix_algebra.h" // for test() #include "nec_exception.h" using namespace std; /* What on earth is this NM thing? */ #define NM 131072 #define MAXH 20 #define CRIT 1.0E-4 #define PTP .6283185308 #define NTS 4 /* compute integration parameter xlam=lambda from parameter t. */ void c_evlcom::lambda( nec_float t, nec_complex *xlam, nec_complex *dxlam ) const { *dxlam = m_contour_b - m_contour_a; *xlam = m_contour_a + *dxlam*t; } /*! \brief gshank integrates the 6 Sommerfeld integrals from start to infinity (until convergence) in lambda. At the break point, bk, the step increment may be changed from dela to delb. Shank's algorithm to accelerate convergence of a slowly converging series is used. */ void c_evlcom::gshank( nec_complex start, nec_complex dela, complex_array& sum, int nans, complex_array& seed, int ibk, nec_complex bk, nec_complex delb ) { bool brk = false; int ibx, jm; static nec_float rbk, amg, den, denm; nec_complex a1, a2, as1, as2, del, aa; nec_complex q1[6][20], q2[6][20]; complex_array ans1(6), ans2(6); rbk=real(bk); del=dela; if (ibk == 0) ibx=1; else ibx=0; // I believe that this is a spurious generalization for this routine. Hence the // following assert. ASSERT(nans == 6); for (int i = 0; i < nans; i++ ) ans2[i]=seed[i]; m_contour_b=start; for (int intx = 1; intx <= MAXH; intx++ ) { int inx=intx-1; m_contour_a = m_contour_b; m_contour_b += del; if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=1; m_contour_b=bk; del=delb; rom1(nans,sum,2); if ( ibx != 2 ) { for (int i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for (int i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; intx = 0; continue; } /* if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) */ rom1(nans,sum,2); for (int i = 0; i < nans; i++ ) ans1[i] = ans2[i]+sum[i]; m_contour_a = m_contour_b; m_contour_b += del; if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) { /* hit break point. reset seed and start over. */ ibx=2; m_contour_b=bk; del=delb; rom1(nans,sum,2); if ( ibx != 2 ) { for (int i = 0; i < nans; i++ ) ans2[i] += sum[i]; intx = 0; continue; } for (int i = 0; i < nans; i++ ) ans2[i] = ans1[i]+sum[i]; intx = 0; continue; } /* if ( (ibx == 0) && (real(m_contour_b) >= rbk) ) */ rom1(nans,sum,2); for (int i = 0; i < nans; i++ ) ans2[i]=ans1[i]+sum[i]; den=0.; for (int i = 0; i < nans; i++ ) { as1=ans1[i]; as2=ans2[i]; if (intx >= 2) { for (int j = 1; j < intx; j++ ) { jm=j-1; aa=q2[i][jm]; a1=q1[i][jm]+as1-2.*aa; if ( (real(a1) != 0.) || (imag(a1) != 0.) ) { a2=aa-q1[i][jm]; a1=q1[i][jm]-a2*a2/a1; } else a1=q1[i][jm]; a2=aa+as2-2.*as1; if ( (real(a2) != 0.) || (imag(a2) != 0.) ) a2=aa-(as1-aa)*(as1-aa)/a2; else a2=aa; q1[i][jm]=as1; q2[i][jm]=as2; as1=a1; as2=a2; } } q1[i][intx-1]=as1; q2[i][intx-1]=as2; amg=fabs(real(as2))+fabs(imag(as2)); if (amg > den) den=amg; } /* for ( i = 0; i < nans; i++ ) */ denm=1.e-3*den*CRIT; jm=intx-3; if (jm < 1) jm = 1; for (int j = jm-1; j < intx; j++ ) { brk = false; for (int i = 0; i < nans; i++ ) { a1=q2[i][j]; den=(fabs(real(a1))+fabs(imag(a1)))*CRIT; if (den < denm) den=denm; a1=q1[i][j]-a1; amg=fabs(real(a1)+fabs(imag(a1))); if (amg > den) { brk = true; break; } } /* for ( i = 0; i < nans; i++ ) */ if ( brk ) break; } /* for ( j = jm-1; j < intx; j++ ) */ if ( false == brk ) { for (int i = 0; i < nans; i++ ) sum[i]=.5*(q1[i][inx]+q2[i][inx]); return; } } /* for ( intx = 1; intx <= maxh; intx++ ) */ /* No convergence */ throw new nec_exception("No convergence in gshank() - aborting"); } /*! \brief rom1 integrates the 6 Sommerfeld integrals from m_contour_a to m_contour_b in lambda. The method of variable interval width Romberg integration is used. */ void c_evlcom::rom1( int n, complex_array& sum, int nx ) { int ns, nt; static nec_float z, ze, s, ep, zend, dz=0.0, dzot=0.0, tr, ti; static nec_complex t00, t11, t02; static complex_array g1(6), g2(6), g3(6), g4(6), g5(6), t01(6), t10(6), t20(6); ASSERT(n == 6); z = 0.0; ze = 1.0; s = 1.0; ep = s / (1.0e4 * NM); zend=ze-ep; nec_complex cmplx_zero(0.0,0.0); for (int i = 0; i < n; i++ ) sum[i]=cmplx_zero; ns=nx; nt=0; saoa(z,g1); bool jump = false; bool lstep = false; while( true ) { if ( false == jump ) { dz = s/ns; if ( (z+dz) > ze ) { dz=ze-z; if ( dz <= ep ) return; } dzot=dz*.5; saoa(z+dzot,g3); saoa(z+dz,g5); } /* if ( false == jump ) */ bool nogo = false; for (int i = 0; i < n; i++ ) { t00=(g1[i]+g5[i])*dzot; t01[i]=(t00+dz*g3[i])*.5; t10[i]=(4.*t01[i]-t00)/3.; /* test convergence of 3 point romberg result */ test( real(t01[i]), real(t10[i]), &tr, imag(t01[i]), imag(t10[i]), &ti, 0. ); if ( (tr > CRIT) || (ti > CRIT) ) nogo = true; } if ( false == nogo ) { for (int i = 0; i < n; i++ ) sum[i] += t10[i]; nt += 2; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = false; continue; } /* if ( false == nogo ) */ saoa(z+dz*.25,g2); saoa(z+dz*.75,g4); nogo = false; for (int i = 0; i < n; i++ ) { t02=(t01[i]+dzot*(g2[i]+g4[i]))*.5; t11=(4.*t02-t01[i])/3.; t20[i]=(16.*t11-t10[i])/15.; /* test convergence of 5 point Romberg result */ test( real(t11), real(t20[i]), &tr, imag(t11), imag(t20[i]), &ti, 0.0 ); if ( (tr > CRIT) || (ti > CRIT) ) nogo = true; } if ( false == nogo ) { for (int i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns=ns/2; nt=1; } jump = false; continue; } /* if ( false == nogo ) */ nt=0; if (ns < NM) { ns *= 2; dz=s/ns; dzot=dz*.5; for (int i = 0; i < n; i++ ) { g5[i]=g3[i]; g3[i]=g2[i]; } jump = true; continue; } /* if (ns < NM) */ if ( false == lstep ) { lstep = true; lambda( z, &t00, &t11 ); } for (int i = 0; i < n; i++ ) sum[i] += t20[i]; nt++; z += dz; if (z > zend) return; for (int i = 0; i < n; i++ ) g1[i]=g5[i]; if ( (nt >= NTS) && (ns > nx) ) { ns /= 2; nt=1; } jump = false; } /* while( TRUE ) */ } /*! \brief saoa computes the integrand for each of the 6 Sommerfeld integrals for source and observer above ground. */ void c_evlcom::saoa( nec_float t, complex_array& ans) { static nec_complex xl, dxl, cgam1, cgam2, b0, b0p, com, dgam, den1, den2; lambda(t, &xl, &dxl); if ( m_bessel_flag == true ) { /* Bessel function form */ bessel(xl*m_rho, &b0, &b0p); b0 *=2.; b0p *=2.; cgam1=sqrt(xl*xl-m_ck1sq); cgam2=sqrt(xl*xl-m_ck2sq); if (real(cgam1) == 0.0) cgam1=nec_complex(0.0,-fabs(imag(cgam1))); if (real(cgam2) == 0.) cgam2=nec_complex(0.0,-fabs(imag(cgam2))); } else { /* Hankel function form */ hankel(xl*m_rho, &b0, &b0p); com=xl-m_ck1; cgam1=sqrt(xl+m_ck1)*sqrt(com); if (real(com) < 0. && imag(com) >= 0.) cgam1=-cgam1; com=xl-m_ck2; cgam2=sqrt(xl+m_ck2)*sqrt(com); if (real(com) < 0. && imag(com) >= 0.) cgam2=-cgam2; } if (norm(xl) >= m_tsmag) { if (imag(xl) >= 0.0) { nec_float xlr = real(xl); if (xlr >= m_ck2) { if (xlr <= m_ck1r) dgam=cgam2-cgam1; else { nec_float sign =1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } } else { nec_float sign=-1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } /* if (xlr >= m_ck2) */ } /* if (imag(xl) >= 0.) */ else { nec_float sign=1.0; dgam=1.0/(xl*xl); dgam=sign*((m_ct3*dgam+m_ct2)*dgam+m_ct1)/xl; } } /* if (norm(xl) < m_tsmag) */ else { dgam=cgam2-cgam1; } #if 0 nec_float xlr = real(xl); if ( (xlr >= m_ck2) && (xlr <= m_ck1r)) { dgam=cgam2-cgam1; } else { sign = 1.0; if ((imag(xl) >= 0.0) && (xlr < m_ck2)) sign = -1.0; nec_floaf temp = 1.0/(xl*xl); dgam=sign*((m_ct3*temp+m_ct2)*temp+m_ct1)/xl; } #endif den2=m_cksm*dgam/(cgam2*(m_ck1sq*cgam2+m_ck2sq*cgam1)); den1=1./(cgam1+cgam2)-m_cksm/cgam2; com=dxl*xl*exp(-cgam2*m_zph); ans[5]=com*b0*den1/m_ck1; com *= den2; if (m_rho != 0.) { b0p=b0p/m_rho; ans[0]=-com*xl*(b0p+b0*xl); ans[3]=com*xl*b0p; } else { ans[0]=-com*xl*xl*.5; ans[3]=ans[0]; } ans[1]=com*cgam2*cgam2*b0; ans[2]=-ans[3]*cgam2*m_rho; ans[4]=com*b0; } /* evlua controls the integration contour in the complex */ /* lambda plane for evaluation of the sommerfeld integrals */ void c_evlcom::evlua( nec_complex *erv, nec_complex *ezv, nec_complex *erh, nec_complex *eph ) { static nec_float del, slope, rmis; static nec_complex cp1, cp2, cp3, bk, delta, delta2; complex_array sum(6), ans(6); del=m_zph; if ( m_rho > del ) del=m_rho; if (m_zph >= 2.*m_rho) { /* Bessel function form of Sommerfeld integrals */ m_bessel_flag=true; m_contour_a=nec_complex(0.0,0.0); del=1.0/del; if ( del > m_tkmag) { m_contour_b=nec_complex(0.1*m_tkmag,-0.1*m_tkmag); rom1(6,sum,2); m_contour_a=m_contour_b; m_contour_b=nec_complex(del,-del); rom1 (6,ans,2); for (int i = 0; i < 6; i++ ) sum[i] += ans[i]; } else { m_contour_b=nec_complex(del,-del); rom1(6,sum,2); } delta=PTP*del; gshank(m_contour_b,delta,ans,6,sum,0,m_contour_b,m_contour_b); ans[5] *= m_ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(m_ck1sq*ans[2]); *ezv=conj(m_ck1sq*(ans[1]+m_ck2sq*ans[4])); *erh=conj(m_ck2sq*(ans[0]+ans[5])); *eph=-conj(m_ck2sq*(ans[3]+ans[5])); return; } /* if (m_zph >= 2.*m_rho) */ /* Hankel function form of Sommerfeld integrals */ m_bessel_flag=false; cp1=nec_complex(0.0,.4*m_ck2); cp2=nec_complex(.6*m_ck2,-.2*m_ck2); cp3=nec_complex(1.02*m_ck2,-.2*m_ck2); m_contour_a=cp1; m_contour_b=cp2; rom1(6,sum,2); m_contour_a=cp2; m_contour_b=cp3; rom1(6,ans,2); for (int i = 0; i < 6; i++ ) sum[i]=-(sum[i]+ans[i]); /* path from imaginary axis to -infinity */ if (m_zph > .001*m_rho) slope=m_rho/m_zph; else slope=1000.; del=PTP/del; delta=nec_complex(-1.0,slope)*del/sqrt(1.+slope*slope); delta2=-conj(delta); gshank(cp1,delta,ans,6,sum,0,bk,bk); rmis=m_rho*(real(m_ck1)-m_ck2); bool jump = false; if ( (rmis >= 2.*m_ck2) && (m_rho >= 1.e-10) ) { if (m_zph >= 1.e-10) { bk=nec_complex(-m_zph,m_rho)*(m_ck1-cp3); rmis=-real(bk)/fabs(imag(bk)); if (rmis > 4.*m_rho/m_zph) jump = true; } if ( false == jump ) { /* integrate up between branch cuts, then to + infinity */ cp1=m_ck1- nec_complex(0.1,+0.2); cp2=cp1+.2; bk=nec_complex(0.,del); gshank(cp1,bk,sum,6,ans,0,bk,bk); m_contour_a=cp1; m_contour_b=cp2; rom1(6,ans,1); for (int i = 0; i < 6; i++ ) ans[i] -= sum[i]; gshank(cp3,bk,sum,6,ans,0,bk,bk); gshank(cp2,delta2,ans,6,sum,0,bk,bk); } jump = true; } /* if ( (rmis >= 2.*m_ck2) || (m_rho >= 1.e-10) ) */ else jump = false; if ( false == jump ) { /* integrate below branch points, then to + infinity */ for (int i = 0; i < 6; i++ ) sum[i]=-ans[i]; rmis=real(m_ck1)*1.01; if ( (m_ck2+1.) > rmis ) rmis=m_ck2+1.; bk=nec_complex(rmis,.99*imag(m_ck1)); delta=bk-cp3; delta *= del/abs(delta); gshank(cp3,delta,ans,6,sum,1,bk,delta2); } /* if ( false == jump ) */ ans[5] *= m_ck1; /* conjugate since nec uses exp(+jwt) */ *erv=conj(m_ck1sq*ans[2]); *ezv=conj(m_ck1sq*(ans[1]+m_ck2sq*ans[4])); *erh=conj(m_ck2sq*(ans[0]+ans[5])); *eph=-conj(m_ck2sq*(ans[3]+ans[5])); } /*-----------------------------------------------------------------------*/ #define GAMMA .5772156649 #define C3 .7978845608 #define P10 .0703125 #define P20 .1121520996 #define Q10 .125 #define Q20 .0732421875 #define P11 .1171875 #define P21 .1441955566 #define Q11 .375 #define Q21 .1025390625 #define POF .7853981635 /* bessel evaluates the zero-order bessel function */ /* and its derivative for complex argument z. */ void bessel( nec_complex z, nec_complex *j0, nec_complex *j0p ) { static int m[101]; static nec_float a1[25], a2[25]; static nec_complex cplx_01(0.0,1.0); static nec_complex cplx_10(1.0,0.0); /* initialization of constants */ static bool bessel_init = false; if ( false == bessel_init ) { for (int k = 1; k <= 25; k++ ) { int index = k-1; a1[index] = -0.25/(k*k); a2[index] = 1.0/(k+1.0); } for (int i = 1; i <= 101; i++ ) { nec_float tst=1.0; int init; for (int k = 0; k < 24; k++ ) { init = k; tst *= -i*a1[k]; if ( tst < 1.0e-6 ) break; } m[i-1] = init+1; } /* for (int i = 1; i<= 101; i++ ) */ bessel_init = true; } /* if (false == bessel_init) */ nec_float zms = norm(z); if (zms <= 1.e-12) { *j0=cplx_10; *j0p=-0.5*z; return; } nec_complex j0x, j0px; int ib=0; if (zms <= 37.21) { if (zms > 36.0) ib=1; /* series expansion */ #pragma message("Some strange code below. Why use the norm of a vector as an index?") int iz = int(zms); // TCAM : conversion of nec_float to int here! // Using int() I think that this is the same as the fortran implicit coercion // but perhaps we should be doing an explicit rounding operation? int miz=m[iz]; *j0 = cplx_10; *j0p = cplx_10; nec_complex zk = cplx_10; nec_complex zi = z*z; for (int k = 0; k < miz; k++ ) { zk *= a1[k]*zi; *j0 += zk; *j0p += a2[k]*zk; } *j0p *= -0.5*z; if (ib == 0) return; j0x=*j0; j0px=*j0p; } /* asymptotic expansion */ nec_complex zi = 1.0/z; nec_complex zi2 = zi*zi; nec_complex p0z = 1.0 + (P20*zi2-P10)*zi2; nec_complex p1z = 1.0 +(P11-P21*zi2)*zi2; nec_complex q0z = (Q20*zi2-Q10)*zi; nec_complex q1z = (Q11-Q21*zi2)*zi; nec_complex zk = exp(cplx_01 * (z-POF)); zi2 = 1.0/zk; nec_complex cz = 0.5*(zk+zi2); nec_complex sz = cplx_01 * 0.5 * (zi2-zk); zk = C3*sqrt(zi); *j0 = zk*(p0z*cz-q0z*sz); *j0p = -zk*(p1z*sz+q1z*cz); if (ib == 0) return; nec_float pi_10 = pi() * 10.0; zms = cos((sqrt(zms)-6.0)*pi_10); *j0 = 0.5*(j0x*(1.0+zms)+ *j0*(1.0-zms)); *j0p = 0.5*(j0px*(1.0+zms)+ *j0p*(1.0-zms)); } #define C1 -.02457850915 #define C2 .3674669052 /* hankel evaluates hankel function of the first kind, */ /* order zero, and its derivative for complex argument z */ void hankel( nec_complex z, nec_complex *h0, nec_complex *h0p ) { static int m[101]; static nec_float a1[25], a2[25], a3[25], a4[25]; nec_complex clogz, p0z, p1z, q0z, q1z, zi, zi2, zk; static nec_complex cplx_01(0.0,1.0); static bool hankel_init = false; /* initialization of constants */ if ( ! hankel_init ) { nec_float psi=-GAMMA; for (int k = 1; k <= 25; k++ ) { int i = k-1; a1[i]=-.25/(k*k); a2[i]=1.0/(k+1.0); psi += 1.0/k; a3[i]=psi+psi; a4[i]=(psi+psi+1.0/(k+1.0))/(k+1.0); } for (int i = 1; i <= 101; i++ ) { int init; nec_float test=1.0; for (int k = 0; k < 24; k++ ) { init = k; test *= -i*a1[k]; if ((test*a3[k]) < 1.e-6) break; } m[i-1]=init+1; } hankel_init = true; } /* if ( ! hankel_init ) */ nec_float zms = norm(z); if (zms == 0.0) throw new nec_exception("hankel not valid for z=0."); nec_complex y0(0,0); nec_complex y0p(0,0); int ib=0; if (zms <= 16.81) { if (zms > 16.) ib=1; /* series expansion */ int iz = int(zms); // TCAM using explicit int() coercion int miz = m[iz]; nec_complex j0(1.0,0.0); nec_complex j0p(1.0,0.0); zk = j0; zi = z*z; for (int k = 0; k < miz; k++ ) { zk *= a1[k]*zi; j0 += zk; j0p += a2[k]*zk; y0 += a3[k]*zk; y0p += a4[k]*zk; } j0p *= -.5*z; clogz= log(.5*z); y0 = (2.0 * j0 * clogz-y0)/pi() + C2; y0p = (2.0/z +2.0*j0p*clogz + 0.5*y0p*z)/pi() + C1*z; *h0=j0+cplx_01*y0; *h0p=j0p+cplx_01*y0p; if (ib == 0) return; y0=*h0; y0p=*h0p; } /* if (zms <= 16.81) */ /* asymptotic expansion */ zi=1./z; zi2=zi*zi; p0z=1.+(P20*zi2-P10)*zi2; p1z=1.+(P11-P21*zi2)*zi2; q0z=(Q20*zi2-Q10)*zi; q1z=(Q11-Q21*zi2)*zi; zk=exp(cplx_01*(z-POF))*sqrt(zi)*C3; *h0=zk*(p0z+cplx_01*q0z); *h0p=cplx_01*zk*(p1z+cplx_01*q1z); if (ib == 0) return; zms=cos((sqrt(zms)-4.)*31.41592654); *h0=.5*(y0*(1.+zms)+ *h0*(1.-zms)); *h0p=.5*(y0p*(1.+zms)+ *h0p*(1.-zms)); } necpp-1.5.0+cvs20101003/src/Makefile.am0000644000175000017500000000210211130541231015507 0ustar numanumabin_PROGRAMS = nec2diff nec2++ nec2___SOURCES = common.h nec2cpp.cpp nec2cpp.h XGetopt.cpp XGetopt.h nec2diff_SOURCES = AntennaInput.h BaseInput.h CurrentInput.h necDiff.cpp PowerBudget.h RadiationInput.h include_HEADERS = libnecpp.h noinst_HEADERS = nec_debug.h nec_exception.h nec_wire.h # set the include path found by configure INCLUDES = $(all_includes) # the library search path. nec2___LDADD = $(top_builddir)/src/libnecpp.la lib_LTLIBRARIES = libnecpp.la libnecpp_la_SOURCES = c_evlcom.cpp c_geometry.cpp c_ggrid.cpp c_plot_card.cpp \ libNEC.cpp matrix_algebra.cpp misc.cpp nec_context.cpp nec_exception.cpp \ nec_ground.cpp nec_output.cpp nec_radiation_pattern.cpp c_evlcom.h c_geometry.h \ c_ggrid.h c_plot_card.h common.h electromag.h math_util.h matrix_algebra.h misc.h \ libnecpp.h nec_context.h nec_exception.h nec_ground.h nec_output.h \ nec_radiation_pattern.h nec_results.h safe_array.h nec_structure_currents.cpp \ nec_structure_currents.h electromag.cpp libnecpp_la_LDFLAGS = @LIBLAPACK@ -lm -lstdc++ libnecpp_la_CXXFLAGS = nec2___LDFLAGS = -all-static necpp-1.5.0+cvs20101003/src/RadiationInput.h0000644000175000017500000000732210310210756016573 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Radiation_Input__ #define __Radiation_Input__ #include #include "BaseInput.h" class RadiationInput : public BaseInput { public: vector theta, phi; vector power_v, power_h, power_t; vector pol_axial_ratio, pol_tilt; string pol_sense; // ignore polarization sense vector E_theta_mag, E_phi_mag; vector E_theta_phase, E_phi_phase; long n_items; RadiationInput(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("RADIATION PATTERNS"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { while (line.find("VOLTS/M",0) == string::npos) line = readline(); /* - - ANGLES - - - POWER GAINS - - - - POLARIZATION - - - - - - E(THETA) - - - - - - E(PHI) - - - THETA PHI VERT. HOR. TOTAL AXIAL TILT SENSE MAGNITUDE PHASE MAGNITUDE PHASE DEGREES DEGREES DB DB DB RATIO DEG. VOLTS/M DEGREES VOLTS/M DEGREES .00 .00 -999.99 -3.23 -3.23 .00000 -90.00 LINEAR 0.00000E+00 -81.39 7.35700E-05 -195.64 */ line = readline(); while (line != "") { stringstream ss(line); theta.push_back(read_fixed(ss)); phi.push_back(read_fixed(ss)); power_v.push_back(read_fixed(ss)); power_h.push_back(read_fixed(ss)); power_t.push_back(read_fixed(ss)); pol_axial_ratio.push_back(read_fixed(ss)); pol_tilt.push_back(read_fixed(ss)); ss >> pol_sense; E_theta_mag.push_back(read_sci(ss)); E_theta_phase.push_back(read_fixed(ss)); E_phi_mag.push_back(read_sci(ss)); E_phi_phase.push_back(read_fixed(ss)); line = readline(); n_items++; } cout << "Radiation pattern: " << n_items << " lines" << endl; } } } bool equalto(const RadiationInput& ai) { if (difference(ai) > 1e-4) return false; return true; } double difference(const RadiationInput& ai) { double ret = 0.0; // compart angles if (n_items != ai.n_items) return 1; for (long i=0; i < n_items;i++) { if (theta[i] != ai.theta[i]) return 1; if (phi[i] != ai.phi[i]) return 1; try { ret += diff(power_v[i], ai.power_v[i]); ret += diff(power_h[i], ai.power_h[i]); ret += diff(power_t[i], ai.power_t[i]); if (power_v[i] > -999.0) { ret += diff(pol_axial_ratio[i], ai.pol_axial_ratio[i]); ret += diff(pol_tilt[i], ai.pol_tilt[i]); ret += diff(deg_polar(E_theta_mag[i],E_theta_phase[i]), deg_polar(ai.E_theta_mag[i],ai.E_theta_phase[i])); ret += diff(deg_polar(E_phi_mag[i],E_phi_phase[i]), deg_polar(ai.E_phi_mag[i],ai.E_phi_phase[i])); } } catch (string message) { cout << "Diff at [" << theta[i] << "," << phi[i] << "] : " << message << endl; } } return ret; }; }; #endif /* __Radiation_Input__ */ necpp-1.5.0+cvs20101003/src/PowerBudget.h0000644000175000017500000000540010310210756016063 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PowerBudget__ #define __PowerBudget__ #include #include "BaseInput.h" /* ---------- POWER BUDGET --------- INPUT POWER = 3.3203E-05 Watts RADIATED POWER= 3.3203E-05 Watts STRUCTURE LOSS= 0.0000E+00 Watts NETWORK LOSS = 0.0000E+00 Watts EFFICIENCY = 100.00 Percent */ class PowerBudget : public BaseInput { public: vector input_power, radiated_power, structure_loss, network_loss, efficiency; long n_items; double get_power_line() { string line = readline(); if (line.length() < 2) line = readline(); // delete up to '=' character (+1 includes the = character) line.erase(0, line.find("=",0) + 1); stringstream ss(line); double ret = read_sci(ss); return ret; } PowerBudget(std::string& filename) : BaseInput(filename) { n_items = 0; string searchString("POWER BUDGET"); while (m_stream.good()) { string line = readline(); if (line.find(searchString,0) != string::npos) { // check for a blank line here. { double p = get_power_line(); input_power.push_back(p); } { double p = get_power_line(); radiated_power.push_back(p); } { double p = get_power_line(); structure_loss.push_back(p); } { double p = get_power_line(); network_loss.push_back(p); } { double p = get_power_line(); efficiency.push_back(p); } n_items++; } } } bool equalto(const PowerBudget& pb) { if (difference(pb) > 1e-4) return false; return true; } double difference(const PowerBudget& pb) { double ret = 0; if (n_items != pb.n_items) return 1.0; try { for (long i=0; i #include #include #include "nec_exception.h" #ifdef NEC_ERROR_CHECK class BoundsViol : public nec_exception { public: BoundsViol(const char* message, long index, long bound) : nec_exception(message) { m_message << "array index: " << index << " exceeds " << bound << std::endl; } }; #endif /*! \brief A Safe Array class for nec2++ that performs bounds checking if the macro NEC_ERROR_CHECK is defined at compile time. This class also includes some utility functions for handling common vector operations. \todo Modify the resize() operator so that we resize in units of _resize_chunk. This will increase efficiency. */ template class safe_array { public: safe_array() : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { } safe_array(long in_size) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { resize(in_size); } /* safe_array(long n_rows, long n_cols) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { resize(n_rows, n_cols); }*/ safe_array(const safe_array& in_array) : len_(0), rows_(0), cols_(0), resize_chunk_(2), data_(NULL), data_size_(0), own_data_(true) { copy(in_array); } ~safe_array() { if (own_data_) delete[] data_; } long size() const { return len_; } void resize(long n_rows, long n_cols) { rows_ = n_rows; cols_ = n_cols; resize(rows_ * cols_); } // Copy the contents of in_array to our array // resizing as appropriate. void copy(const safe_array& in_array) { if (in_array.rows_ == 0) resize(in_array.len_); else resize(in_array.rows_,in_array.cols_); for (long i=0; i data_size_) { // We allocate resize_chunk_ more bytes than we need to avoid // resizing too often. T* new_data_ = new T[new_length + resize_chunk_]; data_size_ = new_length + resize_chunk_; if (0 != len_) std::memcpy(new_data_, data_, len_ * sizeof(T)); delete[] data_; data_ = new_data_; len_ = new_length; } else { len_ = new_length; } } /*!\brief return the largest element of the array */ T maxCoeff() const { if (0 == len_) throw new nec_exception("No elements in maxCoeff"); T ret = data_[check(0)]; for (long i = 1; i < len_; i++ ) { if ( data_[check(i)] > ret) ret = data_[check(i)]; } return ret; } /*!\brief return the largest element of the array */ T minCoeff() const { if (0 == len_) throw new nec_exception("No elements in minCoeff"); T ret = data_[check(0)]; for (long i = 1; i < len_; i++ ) { if ( data_[check(i)] < ret) ret = data_[check(i)]; } return ret; } /*!\brief return the sum of the specified elements in the array */ T sum(long start_index, long stop_index) { T ret = data_[check(start_index)]; for (long i = start_index+1; i < stop_index; i++ ) { ret += data_[check(i)]; } return ret; } /*!\brief return the sum of all elements in the array */ T sum() { return sum(0,len_); } // fill specified elements of the array with x void fill(long start, long N, const T& x) { long stop = start + N; for (long i = start; i < stop; i++ ) { data_[check(i)] = x; } } // fill all elements of the array with x void setConstant(const T& x) { fill(0,len_,x); } /*! \brief Set an element assuming that the data is stored in column major form. */ void set_col_major(int col_dim, int col, int row, const T& val) { data_[check(row*col_dim + col)] = val; } /*! \brief Get an element assuming that the data is stored in column major form. */ T& get_col_major(int col_dim, int col, int row) { return data_[check(row*col_dim + col)]; } T& operator()(long row, long col) { return data_[check(row,col)]; } const T& operator[](long i) const { return data_[check(i)]; } T& operator[](long i) { return data_[check(i)]; } /*!\brief Return a representation of a subset of this array \param start_index The index of the first element \param end_index If -1, then finish at the end of the array */ safe_array segment(long start_index) { return eigen_segment(start_index, size() - start_index); /* if (-1 == end_index) end_index = len_; return safe_array(*this, start_index, end_index, false);*/ } /*!\brief Return a representation of a subset of this array \param start_index The index of the first element \param end_index If -1, then finish at the end of the array */ safe_array eigen_segment(long start_index, long n) { long end_index = start_index + n; return safe_array(*this, start_index, end_index, false); } T* data() const { return data_; } safe_array& operator=(const safe_array& in_array) { copy(in_array); return *this; } private: long len_; long rows_; long cols_; long resize_chunk_; T* data_; long data_size_; bool own_data_; /*!\brief Constructor only used to construct segment \param in_copy_data True if we create a copy of data from in_array. False - just reference the data in in_array. */ safe_array(safe_array& in_array, long start_index, long end_index, bool in_copy_data) { resize_chunk_ = in_array.resize_chunk_; len_ = (end_index - start_index); rows_ = 0; cols_ = 0; if (in_copy_data) { data_ = new T[len_]; data_size_ = len_; for (long i=0; i= len_) throw new BoundsViol("safe_array: ", i, len_); #endif return i; } inline long check(long row, long col) const { #ifdef NEC_ERROR_CHECK if (row < 0 || row >= rows_) throw new BoundsViol("safe_array: ", row, rows_); if (col < 0 || col >= cols_) throw new BoundsViol("safe_array: ", col, cols_); #endif return check(col*rows_ + row); } }; #endif /* __safe_array__ */ necpp-1.5.0+cvs20101003/src/c_plot_card.cpp0000644000175000017500000001065511044461425016456 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "c_plot_card.h" #include "math_util.h" #include "math_util.h" #include #include using namespace std; c_plot_card::c_plot_card() { p1 = 0; p2 = 0; p3 = 0; p4 = 0; plot_fp = NULL; } c_plot_card::c_plot_card(const c_plot_card& p) { p1 = p.p1; p2 = p.p2; p3 = p.p3; p4 = p.p4; plot_fp = p.plot_fp; } c_plot_card::c_plot_card(int itmp1, int itmp2, int itmp3, int itmp4, string& filename) { p1 = itmp1; p2 = itmp2; p3 = itmp3; p4 = itmp4; plot_fp = NULL; /* Open plot file */ if ( (plot_fp = fopen(filename.c_str(), "w")) == NULL ) { throw 100; } } c_plot_card::~c_plot_card() { if ( plot_fp != NULL ) fclose( plot_fp ); } bool c_plot_card::is_valid() const { return (NULL != plot_fp); } bool c_plot_card::storing() const { return (p1 != 0); } bool c_plot_card::currents() const { return (p1 == 1); } bool c_plot_card::near_field() const { return (p1 == 2); } bool c_plot_card::patterns() const { return (p1 == 3); } bool c_plot_card::realimag() const { return ( ((p1 == 1) || (p1 == 2)) && (p2 == 1) ); } bool c_plot_card::magphase() const { return ( ((p1 == 1) || (p1 == 2)) && (p2 == 3) ); } void c_plot_card::set_plot_real_imag_currents() { p1 = 1; p2 = 1; } void c_plot_card::plot_endl() const { if (NULL == plot_fp) throw 100; fprintf( plot_fp, "\n"); } void c_plot_card::plot_double(nec_float x) const { if (NULL == plot_fp) throw 100; fprintf( plot_fp, "%12.4E ", x ); } void c_plot_card::plot_complex(nec_complex x) const { if (NULL == plot_fp) throw 100; switch( p2 ) { case 2: plot_double(real(x)); plot_double(imag(x)); case 3: plot_double(abs(x)); plot_double(arg_degrees(x)); } } void c_plot_card::plot_complex_2d(nec_complex x, nec_complex y, nec_complex z) const { switch( p3 ) { case 1: plot_complex(x); break; case 2: plot_complex(y); break; case 3: plot_complex(z); break; case 4: plot_complex(x); plot_complex(y); plot_complex(z); break; } } void c_plot_card::plot_currents(nec_complex ex, nec_complex ey, nec_complex ez) const { if (false == currents()) return; plot_complex_2d(ex, ey, ez); plot_endl(); } void c_plot_card::plot_segments(int i, real_array& x, real_array& y, real_array& z, real_array& si, nec_float xw2, nec_float yw2, real_array& bi, int_array& icon1, int_array& icon2) const { if (false == near_field()) return; fprintf( plot_fp, "%12.4E %12.4E %12.4E " "%12.4E %12.4E %12.4E %12.4E %5d %5d %5d\n", x[i],y[i],z[i],si[i],xw2,yw2,bi[i],icon1[i],i+1,icon2[i] ); } void c_plot_card::plot_fields( nec_complex ex, nec_complex ey, nec_complex ez, nec_float xob, nec_float yob, nec_float zob) { if ( p1 != 2) return; nec_float xxx; if ( p4 < 0 ) xxx = xob; else if ( p4 == 0 ) xxx= yob; else xxx= zob; plot_double(xxx); plot_complex_2d(ex,ey,ez); plot_endl(); } void c_plot_card::plot_patterns(nec_float theta, nec_float phi, nec_complex e_theta, nec_complex e_phi, nec_float g_vert, nec_float g_horiz, nec_float g_tot) { if ( false == patterns()) return; switch (p2) { case 1: plot_double(theta); plot_complex(e_theta); plot_endl(); break; case 2: plot_double(phi); plot_complex(e_phi); plot_endl(); break; } if ( p4 == 0 ) return; // plot gains I4(3)- 1=V, 2=H, 3=TOTAL, 4=V H T GAINS DB switch (p2) { case 1: plot_double(theta); break; case 2: plot_double(phi); break; } switch( p4 ) { case 1: plot_double(g_vert); // vertical break; case 2: plot_double(g_horiz); // horizontal break; case 3: plot_double(g_tot); // total break; case 4: plot_double(g_vert); plot_double(g_horiz); plot_double(g_tot); break; } plot_endl(); } necpp-1.5.0+cvs20101003/src/nec_context.cpp0000644000175000017500000054461211451605767016536 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_context.h" #include "c_geometry.h" #include "nec_exception.h" #include nec_context::nec_context() { m_output_fp=NULL; m_geometry = new c_geometry(); inc=0; isave=0; nthic=0; nphic=0; impedance_norm_factor = 0.0; // was zpnorm xpr1=0.0; xpr2=0.0; xpr3=0.0; xpr4=0.0; xpr5=0.0; xpr7=0.0; /*structure_currents is a pointer to the "nec_base_result" which takes care of storing and printing of the currents*/ structure_currents = NULL; // allocate the ground grid ggrid.initialize(); } nec_context::~nec_context() { delete m_geometry; } /*! \brief Initialize everything, called after construction so that we can tell the geometry object what nec_context object to point to. */ void nec_context::initialize() { DEBUG_TRACE("initialize()"); nthi=0; nphi=0; iflow = 1; thetis=0.0; phiss=0.0; iptag=0; iptagf=0; iptagt=0; iptaq=0; iptaqf=0; iptaqt=0; init_voltage_sources(); m_geometry->set_context(this); imat=0; // this should go away! It appears to be related to some very old code for handling out-of-core situations */ } /*! \brief Private method to initialize the voltage source buffers */ void nec_context::init_voltage_sources() { /* Free vsource buffers */ ivqd.resize(0); iqds.resize(0); vqd.resize(0); vqds.resize(0); source_segment_array.resize(0); source_voltage_array.resize(0); voltage_source_count=0; nvqd=0; iped=0; } /*! \brief After the geometry has been specified, this function prepares for calculations */ void nec_context::calc_prepare() { DEBUG_TRACE("calc_prepare()"); iflow=1; int n_plus_m = m_geometry->n_plus_m; /* Allocate some buffers */ air.resize(n_plus_m); aii.resize(n_plus_m); bir.resize(n_plus_m); bii.resize(n_plus_m); cir.resize(n_plus_m); cii.resize(n_plus_m); ip.resize(m_geometry->n_plus_2m); current_vector.resize(m_geometry->n_plus_3m); /* Matrix parameters */ if ( imat == 0) { neq= m_geometry->n_plus_2m; neq2=0; } /* default values for input parameters and flags */ npeq = m_geometry->np + 2*m_geometry->mp; processing_state=1; rkh=1.; m_use_exk=false; m_excitation_type = EXCITATION_VOLTAGE; nload=0; network_count=0; m_near=-1; ifar=-1; ncoup=0; icoup=0; freq_mhz= em::speed_of_light() / 1.0e6; ground.default_values(); nfrq=1; iptflg=-2; iptflq=-1; iped=0; } /*!\brief Benchmark the libnecpp engine. A score of 1.0 is roughly an Athlon XP 1800. */ nec_float nec_context::benchmark() { nec_float start_timer, stop_timer; secnds( &start_timer ); for (int i=0; i<20; i++) { { /* CMEXAMPLE 2. CENTER FED LINEAR ANTENNA. CM CURRENT SLOPE DISCONTINUITY SOURCE. CM 1. THIN PERFECTLY CONDUCTING WIRE CE 2. THIN ALUMINUM WIRE GW 0 8 0. 0. -.25 0. 0. .25 .00001 GE FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 50. XQ LD 5 0 0 0 3.720E+07 FR 0 1 0 0 300. EX 5 0 5 0 1. GN 1 XQ EN */ nec_context nec; nec.set_gain_only(true); nec.initialize(); c_geometry* geo = nec.get_geometry(); geo->wire(0,8, 0.0, 0.0, -0.25, 0.0, 0.0, 0.25, 0.00001, 1.0, 1.0); nec.geometry_complete(0,0); nec.fr_card(0, 3, 200.0, 50.0); nec.ex_card(EXCITATION_VOLTAGE_DISC, 0, 5, 1, 1.0, 0.0, 50.0, 0.0, 0.0, 0.0); nec.xq_card(0); nec.ld_card(5, 0, 0,0, 3.72e7, 0.0, 0.0); nec.fr_card(0, 1, 300.0, 0.0); nec.ex_card(EXCITATION_VOLTAGE_DISC, 0, 5, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec.gn_card(1, 0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0); // TODO Keep testing here... nec.xq_card(0); /* This line kills the version on Wine! Very strange! I think that the gn card is bad fixme:msvcrt:MSVCRT_signal (11 (nil)):stub err:seh:EXC_DefaultHandling Unhandled exception code c0000005 flags 0 addr 0x404e2380 Wine failed with return code 1 */ } { /* An example showing how to evaluate for maximum gain. CM GA - NEC FILE CE go blue ! GW 0 36 0 0 0 -0.042 0.008 0.017 0.001 GW 0 21 -0.042 0.008 0.017 -0.048 0.021 -0.005 0.001 GW 0 70 -0.048 0.021 -0.005 0.039 0.032 -0.017 0.001 GW 0 70 -0.048 0.021 -0.005 0.035 0.043 0.014 0.001 GW 0 50 -0.042 0.008 0.017 0.017 -0.015 0.014 0.001 GW 0 66 0.017 -0.015 0.014 -0.027 0.04 -0.031 0.001 GW 0 85 -0.027 0.04 -0.031 0.046 -0.01 0.028 0.001 GW 0 47 0.046 -0.01 0.028 -0.013 -0.005 0.031 0.001 GW 0 70 0.017 -0.015 0.014 -0.048 -0.038 -0.04 0.001 GW 0 77 -0.048 -0.038 -0.04 0.049 -0.045 -0.04 0.001 GE 0 GN -1 LD 5 0 0 0 3.720E+07 FR 0 1 0 0 2400 PT -1 EX 1 1 1 0 0 0 0 0 0 0 0 RP 0 1 1 0500 90 90 0 0 EN */ nec_context nec; nec.set_gain_only(false); nec.initialize(); c_geometry* geo = nec.get_geometry(); geo->wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); geo->wire(0, 21, 0.042, 0.002, 0.017, -0.028, 0.011, 0.005, 0.001, 1.0, 1.0); geo->wire(0, 70, -0.058, 0.021, 0.005, 0.039, 0.062, 0.017, 0.001, 1.0, 1.0); geo->wire(0, 70, 0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); geo->wire(0, 50, 0.042, 0.018, 0.017, 0.017, 0.015, 0.024, 0.001, 1.0, 1.0); geo->wire(0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); geo->wire(0, 85, 0.027, 0.04, 0.031, -0.046, -.01, 0.028, 0.001, 1.0, 1.0); geo->wire(0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); geo->wire(0, 70, 0.027, 0.015, 0.014, -0.078, 0.038, -0.04, 0.001, 1.0, 1.0); geo->wire(0, 77, 0.078, -0.038, 0.04, 0.049, 0.065, 0.04, 0.001, 1.0, 1.0); nec.geometry_complete(0,0); nec.gn_card(-1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); nec.ld_card(5,0,0,0,3.72e7,0.0,0.0); nec.pt_card(-1, 0, 0, 0); nec.ex_card(EXCITATION_LINEAR, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec.fr_card(0, 2, 2400.0, 100.0); nec.rp_card(0, 1, 1, 0,5,0,0, 90.0, 90.0, 0.0, 0.0, 0.0, 0.0); double g = 0; g = nec.get_gain_max(); } } /* time the process */ secnds( &stop_timer ); stop_timer -= start_timer; cout << endl << endl; nec_float sec = stop_timer / 1000.0; nec_float bench = 70.0 / sec; return bench; } /*! \brief Signal the end of a geometry description. This function prepares for a calculation by calling calc_prepare(). */ void nec_context::geometry_complete(int card_int_1, int card_int_2) { DEBUG_TRACE("geometry_complete()"); m_geometry->geometry_complete(this, card_int_1, card_int_2); calc_prepare(); } /*! 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 */ 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) { m_geometry->wire(tag_id, segment_count, xw1, yw1, zw1, xw2, yw2, zw2, rad, rdel, rrad); } /*! 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. */ void nec_context::arc( int tag_id, int segment_count, nec_float rada, nec_float ang1, nec_float ang2, nec_float rad ) { m_geometry->arc(tag_id, segment_count, rada, ang1, ang2, rad); } /*! \brief Add an helix to the geometry, \remark 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::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) { m_geometry->helix(s, hl, a1, b1, a2, b2, rad, segment_count, tag_id); } /* "fr" card, frequency parameters FREQUENCY I1- O= LINEAR STEP, 1=MULTIPLICATIVE I2- NO. STEPS, BLANK=1 I3- BLANK -- not used in this function I4- BLANK -- not used in this function F1- FREQUENCY OR START FREQUENCY F2- FREQ INCREMENT, ADD OR MULTIPLY */ void nec_context::fr_card(int in_ifrq, int in_nfrq, nec_float in_freq_mhz, nec_float in_del_freq) { DEBUG_TRACE("fr_card()"); ifrq = in_ifrq; nfrq = in_nfrq; if ( nfrq == 0) nfrq=1; freq_mhz = in_freq_mhz; delfrq = in_del_freq; if ( iped == 1) impedance_norm_factor = 0.0; processing_state = 1; iflow = 1; } void nec_context::ld_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float tmp1, nec_float tmp2, nec_float tmp3) { DEBUG_TRACE("ld_card()"); if ( iflow != 3 ) { iflow=3; /* Free loading buffers */ nload=0; ldtyp.resize(0); ldtag.resize(0); ldtagf.resize(0); ldtagt.resize(0); zlr.resize(0); zli.resize(0); zlc.resize(0); if ( processing_state > 2 ) processing_state=2; if ( itmp1 == -1 ) return; // continue card input loop } /* Reallocate loading buffers */ nload++; ldtyp.resize(nload); ldtag.resize(nload); ldtagf.resize(nload); ldtagt.resize(nload); zlr.resize(nload); zli.resize(nload); zlc.resize(nload); int idx = nload-1; ldtyp[idx]= itmp1; ldtag[idx]= itmp2; if ( itmp4 == 0) itmp4= itmp3; ldtagf[idx]= itmp3; ldtagt[idx]= itmp4; if ( itmp4 < itmp3 ) { nec_stop("DATA FAULT ON LOADING CARD No: %d: ITAG " "STEP1: %d IS GREATER THAN ITAG STEP2: %d", nload, itmp3, itmp4 ); } zlr[idx]= tmp1; zli[idx]= tmp2; zlc[idx]= tmp3; } /* "gn" card, ground parameters under the antenna GN NEAR GROUND, GROUND SCREEN, ADDED GROUND I1- -1=SET FREE SPACE (A), 0=REFL COEFF, 1=IDEAL (B), 2-SOMMERFELD I2- (A) BLANK), NO WIRES IN GND SCREEN (C), 0= NO WIRES (D) I3- BLANK I4- BLANK F1- (A,B) BLANK, DIELECTRIC OF NEAR GROUND F2- (A,B) BLANK, CONDUCTIVITY OF NEAR GROUND F3- (A,B) BLANK, (C) RADIUS OF SCREEN, (D) DIELECTRIC 2ND MEDIUM F4- (A,B) BLANK, (C) RADII SCREEN WIRES, (D) CONDUCT. 2ND MEDIUM F5- (A,B) BLANK, (C) BLANK, (D) DIST TO 2ND MEDIUM, SEE RP F6- (A,B) BLANK, (C) BLANK, (D) HEIGHT 2ND MEDIUM (AS IN GD) */ 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) { DEBUG_TRACE("gn_card(" << ground_type << ")"); ground.parse_gn(ground_type, rad_wire_count, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); iflow=4; if ( processing_state > 2) processing_state=2; } /* 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) */ 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) { DEBUG_TRACE("ex_card(" << itmp1 << "," << itmp2 << "," << itmp3 << "," << itmp4 << "," << tmp1 << "," << tmp2 << "," << tmp3 << "," << tmp4 << "," << tmp5 << "," << tmp6 << ")"); if ( iflow != 5) { init_voltage_sources(); iflow=5; if ( processing_state > 3) processing_state=3; } masym = itmp4/10; ASSERT(itmp1 >= 0); m_excitation_type = itmp1; if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) // (Voltage excitation) { ntsol=0; if ( m_excitation_type == EXCITATION_VOLTAGE_DISC) // Voltage DISC. { nvqd++; ivqd.resize(nvqd ); iqds.resize(nvqd ); vqd.resize( nvqd ); vqds.resize(nvqd ); int indx = nvqd-1; ivqd[indx]= m_geometry->get_segment_number( itmp2, itmp3); vqd[indx]= nec_complex( tmp1, tmp2); if ( abs( vqd[indx]) < 1.e-20) vqd[indx] = cplx_10(); iped= itmp4- masym*10; impedance_norm_factor= tmp3; if ( (iped == 1) && (impedance_norm_factor > 0.0) ) iped=2; return; /* continue card input loop */ } /* if ( m_excitation_type == EXCITATION_VOLTAGE_DISC) */ voltage_source_count++; source_segment_array.resize(voltage_source_count ); source_voltage_array.resize(voltage_source_count ); { int indx = voltage_source_count-1; int seg_number = m_geometry->get_segment_number( itmp2, itmp3); if (seg_number > m_geometry->segment_length.size()) { nec_exception* nex = new nec_exception("CHECK DATA, PARAMETER SPECIFYING EXCITATION SOURCE SEGMENT ["); nex->append(seg_number); nex->append("] IS TOO LARGE" ); throw nex; } source_segment_array[indx] = seg_number; DEBUG_TRACE("Voltage Source: " << nec_complex( tmp1, tmp2)); source_voltage_array[indx]= nec_complex( tmp1, tmp2); if ( abs( source_voltage_array[indx]) < 1.e-20) source_voltage_array[indx] = cplx_10(); iped= itmp4- masym*10; impedance_norm_factor= tmp3; if ( (iped == 1) && (impedance_norm_factor > 0.0) ) iped = 2; return; /* continue card input loop */ } } /* if ( (m_excitation_type == 0) || (m_excitation_type == 5) ) */ nthi= itmp2; nphi= itmp3; xpr1= tmp1; xpr2= tmp2; xpr3= tmp3; xpr4= tmp4; xpr5= tmp5; xpr6= tmp6; // xpr7= tmp7; Put this in here once we are parsing NEC4 excitation stuff. voltage_source_count=0; nvqd=0; thetis= xpr1; phiss= xpr2; } /* 5: "tl" cards, network 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 */ void nec_context::tl_card(int itmp1, int itmp2, int itmp3, int itmp4, nec_float characteristic_impedance, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6) { if ( iflow != 6) { network_count=0; ntsol=0; iflow=6; if ( processing_state > 3) processing_state=3; if ( itmp2 == -1 ) return; /* continue card input loop */ } /* Re-allocate network buffers */ network_count++; ntyp.resize(network_count); iseg1.resize(network_count); iseg2.resize(network_count); x11r.resize(network_count); x11i.resize(network_count); x12r.resize(network_count); x12i.resize(network_count); x22r.resize(network_count); x22i.resize(network_count); int idx = network_count-1; ntyp[idx] = 2; // TL card iseg1[idx]= m_geometry->get_segment_number( itmp1, itmp2); iseg2[idx]= m_geometry->get_segment_number( itmp3, itmp4); x11r[idx]= characteristic_impedance; x11i[idx]= tmp2; x12r[idx]= tmp3; x12i[idx]= tmp4; x22r[idx]= tmp5; x22i[idx]= tmp6; if (characteristic_impedance <= 0.0) { // Negative characteristic impedance implies a crossed line ntyp[idx] = 3; x11r[idx] = -characteristic_impedance; } } /* 4: 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) */ 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) { if ( iflow != 6) { network_count=0; ntsol=0; iflow=6; if ( processing_state > 3) processing_state=3; if ( itmp2 == -1 ) return; /* continue card input loop */ } /* Re-allocate network buffers */ network_count++; ntyp.resize(network_count); iseg1.resize(network_count); iseg2.resize(network_count); x11r.resize(network_count); x11i.resize(network_count); x12r.resize(network_count); x12i.resize(network_count); x22r.resize(network_count); x22i.resize(network_count); int idx = network_count-1; ntyp[idx]=1; // NT card iseg1[idx]= m_geometry->get_segment_number( itmp1, itmp2); iseg2[idx]= m_geometry->get_segment_number( itmp3, itmp4); x11r[idx]= tmp1; x11i[idx]= tmp2; x12r[idx]= tmp3; x12i[idx]= tmp4; x22r[idx]= tmp5; x22i[idx]= tmp6; } /* "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 */ void nec_context::xq_card(int itmp1) { DEBUG_TRACE("xq_card(" << itmp1 << ")"); DEBUG_TRACE("iflow =" << iflow); if ( ((iflow == 10) && (itmp1 == 0)) || ((nfrq == 1) && (itmp1 == 0) && (iflow > 7)) ) return; /* continue card input loop */ if ( itmp1 == 0) { if ( iflow > 7) iflow=11; else iflow=7; } else { ifar=0; rfld=0.; ipd=0; iavp=0; m_rp_normalization=0; m_rp_output_format=0; nth=91; nph=1; thets=0.0; phis=0.0; dth=1.0; dph=0.0; if ( itmp1 == 2) phis=90.0; if ( itmp1 == 3) { nph=2; dph=90.0; } } /* if ( itmp1 == 0) */ simulate(true); } /* "gd" card, ground representation */ void nec_context::gd_card(nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4) { DEBUG_TRACE("gd_card(" << tmp1 << ")"); ground.setup_cliff(tmp1, tmp2, tmp3, tmp4); iflow=9; } /*! \brief Standard radiation pattern parameters \param calc_mode \param n_theta \param n_phi \param output_format The output format (0 major axis, minor axis and total gain printed. 1 vertical, horizontal ant total gain printed.) \param normalization Controls 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. \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.
  • D = 0 power gain.
  • D = 1 directive gain.
\param 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.
\param theta0 - Initial theta angle in degrees (initial z coordinate in meters if I1 = 1). \param phi0 - Initial phi angle in degrees. \param delta_theta - Increment for theta in degrees (increment for z in meters if I1 = 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 I1 = 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 w111 be normalized to the value of gain_norm. */ 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) { DEBUG_TRACE("rp_card(" << calc_mode << ")"); ifar= calc_mode; nth = n_theta; nph = n_phi; if ( nth == 0) nth=1; if ( nph == 0) nph=1; m_rp_output_format = output_format; m_rp_normalization = normalization; ipd = D; iavp = A; DEBUG_TRACE(" xnda = (" << m_rp_output_format << m_rp_normalization << ipd << iavp << ")"); if ( m_rp_output_format != 0) m_rp_output_format=1; if ( ipd != 0) ipd=1; // sanity check. Not point normalizing if there are too few data points to normalize on if ( (nth < 2) || (nph < 2) || (ifar == 1) ) iavp=0; thets = theta0; phis = phi0; dth = delta_theta; dph = delta_phi; rfld = radial_distance; gnor = gain_norm; iflow=10; simulate(true); } /* "pt" card, print control for current */ void nec_context::pt_card(int itmp1, int itmp2, int itmp3, int itmp4) { iptflg= itmp1; iptag= itmp2; iptagf= itmp3; iptagt= itmp4; if ( (itmp3 == 0) && (iptflg != -1) ) iptflg=-2; if ( itmp4 == 0) iptagt= iptagf; } /* "pq" card, print control for charge */ void nec_context::pq_card(int itmp1, int itmp2, int itmp3, int itmp4) { iptflq= itmp1; iptaq= itmp2; iptaqf= itmp3; iptaqt= itmp4; if ( (itmp3 == 0) && (iptflq != -1) ) iptflq=-2; if ( itmp4 == 0) iptaqt= iptaqf; } /* "kh" card, matrix integration limit */ void nec_context::kh_card(nec_float tmp1) { rkh = tmp1; if ( processing_state > 2) processing_state=2; iflow=1; } 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) { ne_nh_card(0, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } 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) { ne_nh_card(1, itmp1, itmp2, itmp3, itmp4, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); } /* \brief Near field calculation parameters */ void nec_context::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) { nfeh = in_nfeh; if ( (iflow == 8) && (nfrq != 1) ) { m_output.endl(2); m_output.line("WHEN MULTIPLE FREQUENCIES ARE REQUESTED, " "ONLY ONE NEAR FIELD CARD CAN BE USED -"); m_output.line(" LAST CARD READ WILL BE USED" ); } m_near= itmp1; nrx= itmp2; nry= itmp3; nrz= itmp4; xnr= tmp1; ynr= tmp2; znr= tmp3; dxnr= tmp4; dynr= tmp5; dznr= tmp6; iflow=8; if ( nfrq == 1) simulate(); } /* "ek" card, extended thin wire kernel option */ void nec_context::set_extended_thin_wire_kernel(bool ek_flag) { m_use_exk = ek_flag; if ( processing_state > 2) processing_state=2; iflow=1; } /* "cp" card, maximum coupling between antennas */ void nec_context::cp_card(int itmp1, int itmp2, int itmp3, int itmp4) { if ( iflow != 2) { ncoup=0; nctag.resize(0); ncseg.resize(0); y11a.resize(0); y12a.resize(0); } icoup=0; iflow=2; if ( itmp2 == 0) return; /* continue card input loop */ ncoup++; nctag.resize(ncoup); ncseg.resize(ncoup); nctag[ncoup-1]= itmp1; ncseg[ncoup-1]= itmp2; if ( itmp4 == 0) return; /* continue card input loop */ ncoup++; nctag.resize(ncoup); ncseg.resize(ncoup); nctag[ncoup-1]= itmp3; ncseg[ncoup-1]= itmp4; } /* "pl" card, plot flags throws int on error. */ void nec_context::pl_card(const char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4) { std::string fname(ploutput_filename); plot_card = c_plot_card(itmp1,itmp2,itmp3,itmp4, fname); } /*! \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 nec_context::simulate(bool far_field_flag) { DEBUG_TRACE("simulate(" << far_field_flag << ")"); /* Allocate the normalization buffer */ { int mreq1 = 0; int mreq2 = 0; if ( iped ) mreq1 = 4*nfrq; if ( iptflg >= 2 ) mreq2 = nthi*nphi; int newsize = std::max(mreq1,mreq2); fnorm.resize(newsize); } /* igox is a state variable that is used to change from one processing mode to another. The processing to be performed are as follows: 1: Memory allocation & Initialization 2: Structure segment loading 3: Excitation set up (right hand side, -e inc.) 4: ? 5: Near field calculation 6: standard far field calculation */ int igox; int mhz = 0; if ( (far_field_flag == true) && (processing_state == 5) ) igox = 6; else igox = processing_state; try { int iresrv = 0; bool in_freq_loop = false; do { switch( igox ) { case 1: /* Memory allocation for primary interacton matrix. */ if (false == in_freq_loop) { iresrv = m_geometry->n_plus_2m * (m_geometry->np+2*m_geometry->mp); cm.resize(iresrv); /* Memory allocation for symmetry array */ nop = neq/npeq; symmetry_array.resize(nop*nop); mhz = 1; /* irngf is not used (NGF function not implemented) */ if ( imat == 0) fblock( npeq, neq, iresrv, m_geometry->m_ipsym); in_freq_loop = true; } if ( mhz != 1) { if ( ifrq == 1) freq_mhz *= delfrq; else freq_mhz += delfrq; } wavelength = em::speed_of_light() / (1.0e6 * freq_mhz); print_freq_int_krnl(freq_mhz, wavelength, rkh, m_use_exk); m_geometry->frequency_scale(freq_mhz); processing_state = 2; case 2: /* structure segment loading */ structure_segment_loading(); processing_state=3; ntsol=0; case 3: /* excitation set up (right hand side, -e inc.) */ nthic=1; nphic=1; inc=1; nprint=0; default: enum excitation_return ret = excitation_loop(igox, mhz); if (FREQ_LOOP_CONTINUE == ret) { continue; // Continue frequency loop } if (FREQ_LOOP_CARD_CONTINUE == ret) { throw 1; // Continue card input } nphic = 1; /* normalized receiving pattern printed */ print_norm_rx_pattern(); xpr2 = phiss; if ( mhz == nfrq) ifar=-1; if ( nfrq == 1) { m_output.end_section(); throw 1; // Continue card input } print_input_impedance(); nfrq=1; mhz=1; } /* switch( igox ) */ } while( (++mhz <= nfrq) ); } /* try */ catch (int excep) { ASSERT(excep == 1); // keep going on the card input. The exception // is thrown in order to continue card input. } } /* ********************************************************************************************************** */ void nec_context::print_freq_int_krnl( nec_float f, nec_float lambda, nec_float int_dist, bool using_extended_kernel) { m_output.end_section(); m_output.set_indent(31); m_output.line("--------- FREQUENCY --------"); m_output.string("FREQUENCY= "); m_output.real_out(11,4,f); m_output.line(" MHZ"); m_output.string("WAVELENGTH="); m_output.real_out(11,4,lambda); m_output.line(" METERS"); m_output.endl(2); m_output.set_indent(24); m_output.line("APPROXIMATE INTEGRATION EMPLOYED FOR SEGMENTS"); m_output.string("THAT ARE MORE THAN "); m_output.real_out(5,3,int_dist,false); m_output.line(" WAVELENGTHS APART"); if ( using_extended_kernel ) m_output.line( "THE EXTENDED THIN WIRE KERNEL WILL BE USED"); m_output.set_indent(0); } void nec_context::antenna_env(void) { m_output.end_section(); m_output.line(" -------- ANTENNA ENVIRONMENT --------" ); if ( false == ground.present()) { m_output.line(" FREE SPACE" ); return; } ground.frati=cplx_10(); if (false == ground.type_perfect()) // if ( ground.iperf != 1) { if ( ground.sig < 0.) ground.sig=- ground.sig/(em::impedance_over_2pi()*wavelength); nec_complex epsc = nec_complex( ground.epsr, -ground.sig*wavelength*em::impedance_over_2pi()); ground.zrati = 1.0/ sqrt( epsc); ground_wave.set_u(ground.zrati); if ( ground.radial_wire_count != 0) { ground.scrwl= ground.radial_wire_length/ wavelength; ground.scrwr= ground.radial_wire_radius/ wavelength; ground.m_t1 = cplx_01()*2367.067/ (nec_float) ground.radial_wire_count; ground.t2 = ground.scrwr * (nec_float) ground.radial_wire_count; m_output.line( " RADIAL WIRE GROUND SCREEN"); m_output.nec_printf( " %d WIRES\n" " WIRE LENGTH: %8.2f METERS\n" " WIRE RADIUS: %10.3E METERS", ground.radial_wire_count, ground.radial_wire_length, ground.radial_wire_radius ); m_output.endl(); m_output.line(" MEDIUM UNDER SCREEN -" ); } if (false == ground.type_sommerfeld_norton()) { m_output.line(" FINITE GROUND - REFLECTION COEFFICIENT APPROXIMATION" ); } else { // calculate the Sommerfeld Norton ground stuff. ggrid.sommerfeld( ground.epsr, ground.sig, freq_mhz ); ground.frati = (epsc-1.0)/(epsc+1.0); if ( abs(( ggrid.m_epscf- epsc)/ epsc) >= 1.0e-3 ) { nec_stop("ERROR IN GROUND PARAMETERS -" "\n COMPLEX DIELECTRIC CONSTANT FROM FILE IS: %12.5E%+12.5Ej" "\n REQUESTED: %12.5E%+12.5Ej", real(ggrid.m_epscf), imag(ggrid.m_epscf), real(epsc), imag(epsc) ); } m_output.line(" FINITE GROUND - SOMMERFELD SOLUTION" ); } /* if ( ground.type_sommerfeld_norton() ) */ m_output.endl(); m_output.nec_printf( " " "RELATIVE DIELECTRIC CONST: %.3f\n" " " "CONDUCTIVITY: %10.3E MHOS/METER\n" " " "COMPLEX DIELECTRIC CONSTANT: %11.4E%+11.4Ej", ground.epsr, ground.sig, real(epsc), imag(epsc) ); } else { m_output.nec_printf(" PERFECT GROUND" ); } } #if 0 /*No more used...*/ void nec_context::print_structure_currents(char *pattype, int iptflg, int iptflq, int iptag, int iptagf, int iptagt, int iptaq, int iptaqf, int iptaqt) { int jump; nec_float cmag, ph; nec_complex curi; nec_float fr; nec_float etha, ethm, ephm, epha; nec_complex eth, eph, ex, ey, ez; if ( m_geometry->n != 0) { if ( iptflg != -1) { if ( iptflg <= 0) { m_output.endl(3); m_output.line( " -------- CURRENTS AND LOCATION --------"); m_output.line( " DISTANCES IN WAVELENGTHS" ); m_output.endl(); m_output.line( " SEG TAG COORDINATES OF SEGM CENTER SEGM ------------- CURRENT (AMPS) -------------"); m_output.line( " No: No: X Y Z LENGTH REAL IMAGINARY MAGN PHASE"); } else if ( (iptflg != 3) && (inc <= 1) ) { m_output.endl(3); m_output.nec_printf( " -------- RECEIVING PATTERN PARAMETERS --------\n" " ETA: %7.2f DEGREES\n" " TYPE: %s\n" " AXIAL RATIO: %6.3f\n\n" " THETA PHI ----- CURRENT ---- SEG\n" " (DEG) (DEG) MAGNITUDE PHASE No:", xpr3, pattype, xpr6 ); } /* if ( iptflg <= 0) */ } /* if ( iptflg != -1) */ structure_power_loss=0.; int itmp1=0; jump= iptflg+1; for (int i = 0; i < m_geometry->n; i++ ) { curi= current_vector[i]* wavelength; cmag= abs( curi); ph= arg_degrees( curi); if ( (nload != 0) && (fabs(real(zarray[i])) >= 1.e-20) ) structure_power_loss += 0.5*cmag*cmag*real(zarray[i]) * m_geometry->segment_length[i]; if ( jump == 0) continue; if ( jump > 0 ) { if ( (iptag != 0) && (m_geometry->segment_tags[i] != iptag) ) continue; itmp1++; if ( (itmp1 < iptagf) || (itmp1 > iptagt) ) continue; if ( iptflg != 0) { if ( iptflg >= 2 ) { fnorm[inc-1]= cmag; isave = i+1; } if ( iptflg != 3) { m_output.endl(); m_output.nec_printf(" %7.2f %7.2f %11.4E %7.2f %5d", xpr1, xpr2, cmag, ph, i+1 ); continue; } } /* if ( iptflg != 0) */ else /*iptflg = 0, only the currents specified are printed*/ { m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); // added test for plot_card.is_valid() if (plot_card.is_valid() && plot_card.currents()) { plot_card.plot_complex(curi); plot_card.plot_endl(); } } } else /*iptflg = -2, all currents are printed*/ { m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); // added test for plot_card.is_valid() if (plot_card.is_valid() && plot_card.currents()) { plot_card.plot_complex(curi); plot_card.plot_endl(); } } } /* for( i = 0; i < n; i++ ) */ if ( iptflq != -1) { m_output.endl(3); m_output.nec_printf( " " "------ CHARGE DENSITIES ------\n" " " " DISTANCES IN WAVELENGTHS\n\n" " SEG TAG COORDINATES OF SEG CENTER SEG" " " " CHARGE DENSITY (COULOMBS/METER)\n" " NO: NO: X Y Z LENGTH" " " " REAL IMAGINARY MAGN PHASE" ); itmp1 = 0; fr = 1.e-6/freq_mhz; for(int i = 0; i < m_geometry->n; i++ ) { if ( iptflq != -2 ) { if ( (iptaq != 0) && (m_geometry->segment_tags[i] != iptaq) ) continue; itmp1++; if ( (itmp1 < iptaqf) || (itmp1 > iptaqt) ) continue; } /* if ( iptflq == -2) */ curi = fr * nec_complex(- bii[i], bir[i]); cmag = abs( curi); ph = arg_degrees( curi); m_output.endl(); m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %9.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph ); } /* for( i = 0; i < n; i++ ) */ } /* if ( iptflq != -1) */ } /* if ( n != 0) */ if ( m_geometry->m != 0) { m_output.endl(3); m_output.nec_printf( " " " --------- SURFACE PATCH CURRENTS ---------\n" " " " DISTANCE IN WAVELENGTHS\n" " " " CURRENT IN AMPS/METER\n\n" " ---------" " SURFACE COMPONENTS -------- " "---------------- RECTANGULAR COMPONENTS ----------------\n" " PCH --- PATCH CENTER --- TANGENT VECTOR 1 " " TANGENT VECTOR 2 ------- X ------ ------- Y ------" " " " ------- Z ------\n No: X Y Z MAG." " " "PHASE MAG. PHASE REAL IMAGINARY REAL " " IMAGINARY REAL IMAGINARY" ); int j = m_geometry->n-3; int itmp1 = -1; for(int i = 0; i < m_geometry->m; i++ ) { j += 3; itmp1++; ASSERT(itmp1 == i); ex= current_vector[j]; ey= current_vector[j+1]; ez= current_vector[j+2]; eth= ex* m_geometry->t1x[itmp1]+ ey* m_geometry->t1y[itmp1]+ ez* m_geometry->t1z[itmp1]; eph= ex* m_geometry->t2x[itmp1]+ ey* m_geometry->t2y[itmp1]+ ez* m_geometry->t2z[itmp1]; ethm= abs( eth); etha= arg_degrees( eth); ephm= abs( eph); epha= arg_degrees( eph); m_output.endl(); m_output.nec_printf( " %4d %7.3f %7.3f %7.3f %11.4E " "%8.2f %11.4E %8.2f" " %9.2E %9.2E %9.2E %9.2E %9.2E %9.2E", i+1, m_geometry->px[itmp1], m_geometry->py[itmp1], m_geometry->pz[itmp1], ethm, etha, ephm, epha, real(ex), imag(ex), real(ey), imag(ey), real(ez), imag(ez)); plot_card.plot_currents(ex,ey,ez); } /* for( i=0; i 1) ) return; int itmp3 = 0; int net_type = ntyp[0]; for (int i = 0; i < 2; i++ ) { if ( net_type == 3) net_type = 2; for (int j = 0; j < network_count; j++) { if ( (ntyp[j]/net_type) != 1 ) { itmp3 = ntyp[j]; // can never be zero } else { if ( (ntyp[j] >= 2) && (x11i[j] <= 0.0) ) { int idx4 = iseg1[j]-1; int idx5 = iseg2[j]-1; nec_float xx = m_geometry->x[idx5]- m_geometry->x[idx4]; nec_float yy = m_geometry->y[idx5]- m_geometry->y[idx4]; nec_float zz = m_geometry->z[idx5]- m_geometry->z[idx4]; // set the length of the transmission line to be the // straight line distance. x11i[j] = wavelength*sqrt(xx*xx + yy*yy + zz*zz); } } } if ( itmp3 == 0) // can only be zero if all the networks are the same type return; net_type = itmp3; } } /* calculate_network_data */ void nec_context::print_network_data(void) { // int i, j; int itmp1, itmp2, itmp3, itmp4, itmp5; const char *pnet[3] = { " ", "STRAIGHT", " CROSSED" }; if ( (network_count != 0) && (inc <= 1) ) { m_output.nec_printf( "\n\n\n" " " "---------- NETWORK DATA ----------" ); itmp3=0; itmp1= ntyp[0]; for(int i = 0; i < 2; i++ ) { if ( itmp1 == 3) itmp1=2; if ( itmp1 == 2) { m_output.endl(); m_output.nec_printf( " -- FROM - --- TO -- " "TRANSMISSION LINE " " --------- SHUNT ADMITTANCES (MHOS) " "--------- LINE\n" " TAG SEG TAG SEG IMPEDANCE " "LENGTH " " ----- END ONE ----- " "----- END TWO ----- TYPE\n" " No: No: No: No: OHMS " "METERS REAL IMAGINARY " "REAL IMAGINARY" ); } else if (itmp1 == 1) { m_output.endl(); m_output.nec_printf( " -- FROM - --- TO -- " "--------" " ADMITTANCE MATRIX ELEMENTS (MHOS) " "---------\n" " TAG SEG TAG SEG " "----- (ONE,ONE) ------ " " ----- (ONE,TWO) ----- " "----- (TWO,TWO) -------\n" " No: No: No: No: REAL " "IMAGINARY " " REAL IMAGINARY REAL " "IMAGINARY" ); } for (int j = 0; j < network_count; j++) { itmp2= ntyp[j]; if ( (itmp2/itmp1) != 1 ) itmp3 = itmp2; else { int idx4, idx5; itmp4= iseg1[j]; itmp5= iseg2[j]; idx4 = itmp4-1; idx5 = itmp5-1; #if 0 This code has moved to calculate_network_data() if ( (itmp2 >= 2) && (x11i[j] <= 0.0) ) { nec_float xx = m_geometry->x[idx5]- m_geometry->x[idx4]; nec_float yy = m_geometry->y[idx5]- m_geometry->y[idx4]; nec_float zz = m_geometry->z[idx5]- m_geometry->z[idx4]; // set the length of the transmission line to be the // straight line distance. x11i[j]= wavelength*sqrt(xx*xx+yy*yy+zz*zz); } #endif m_output.endl(); m_output.nec_printf( " %4d %5d %4d %5d " "%11.4E %11.4E %11.4E %11.4E " "%11.4E %11.4E %s", m_geometry->segment_tags[idx4], itmp4, m_geometry->segment_tags[idx5], itmp5, x11r[j], x11i[j], x12r[j], x12i[j], x22r[j], x22i[j], pnet[itmp2-1] ); } /* if (( itmp2/ itmp1) == 1) */ } /* for( j = 0; j < network_count; j++) */ if ( itmp3 == 0) break; itmp1= itmp3; } /* for( j = 0; j < network_count; j++) */ } /* if ( (network_count != 0) && (inc <= 1) ) */ } /* print_network_data */ void nec_context::print_norm_rx_pattern() { if ((iptflg != 2)&&(iptflg != 3)) return; // do not print { // Call the new nec_results class that handles // a normalized receiving pattern. nec_float theta_step = xpr4; nec_float phi_step = xpr5; nec_float eta = xpr3; nec_float axial_ratio = xpr6; string pol_type(nec_structure_currents::hpol(m_excitation_type)); int segment_number = isave; nec_norm_rx_pattern* rx_pattern = new nec_norm_rx_pattern(nthi, nphi, fnorm, thetis, theta_step, phiss, phi_step, eta, axial_ratio, segment_number, pol_type); rx_pattern->set_frequency(freq_mhz/(1.e-6)); m_results.add(rx_pattern); // write the restuls to our output. std::stringstream ss; rx_pattern->write_to_file(ss); m_output.line(ss.str().c_str()); } #if 0 nec_float phi = phiss; int itmp1 = nthi * nphi; nec_float norm_factor = fnorm[0]; for(int j = 1; j < itmp1; j++ ) if ( fnorm[j] > norm_factor) norm_factor = fnorm[j]; m_output.endl(3); m_output.nec_printf( " " "---- NORMALIZED RECEIVING PATTERN ----\n" " " "NORMALIZATION FACTOR: %11.4E\n" " " "ETA: %7.2f DEGREES\n" " " "TYPE: %s\n" " AXIAL RATIO: %6.3f\n" " SEGMENT No: %d\n\n" " " "THETA PHI ---- PATTERN ----\n" " " "(DEG) (DEG) DB MAGNITUDE", norm_factor, xpr3, hpol[m_excitation_type-1], xpr6, isave ); for(int j = 0; j < nphi; j++ ) { int itmp2 = nthi*j; for(int i = 0; i < nthi; i++ ) { int itmp3 = i + itmp2; if ( itmp3 < itmp1) { nec_float _tmp2 = fnorm[itmp3] / norm_factor; nec_float _tmp3 = db20( _tmp2); m_output.endl(); m_output.nec_printf(" %7.2f %7.2f %7.2f %11.4E", xpr1, phi, _tmp3, _tmp2 ); xpr1 += xpr4; } } /* for( i = 0; i < nthi; i++ ) */ xpr1= thetis; phi += xpr5; } /* for( j = 0; j < nphi; j++ ) */ #endif } void nec_context::print_power_budget(void) { if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) { nec_float radiated_power = input_power- network_power_loss - structure_power_loss; nec_float efficiency = 100.0 * radiated_power/input_power; m_output.endl(3); m_output.nec_printf( " " "---------- POWER BUDGET ---------\n" " " "INPUT POWER = %11.4E Watts\n" " " "RADIATED POWER= %11.4E Watts\n" " " "STRUCTURE LOSS= %11.4E Watts\n" " " "NETWORK LOSS = %11.4E Watts\n" " " "EFFICIENCY = %7.2f Percent", input_power, radiated_power, structure_power_loss, network_power_loss, efficiency ); } /* if ( (m_excitation_type == EXCITATION_VOLTAGE) || (m_excitation_type == EXCITATION_VOLTAGE_DISC) ) */ } void nec_context::print_input_impedance() { nec_float tmp1, tmp2, tmp3, tmp4, tmp5; int i, itmp1, itmp2; if ( iped != 0) { int iss; if ( nvqd > 0) iss = ivqd[nvqd-1]; else iss = source_segment_array[voltage_source_count-1]; m_output.endl(3); m_output.nec_printf( " " " -------- INPUT IMPEDANCE DATA --------\n" " " " SOURCE SEGMENT No: %d\n" " " " NORMALIZATION FACTOR:%12.5E\n\n" " ----------- UNNORMALIZED IMPEDANCE ---------- " " ------------ NORMALIZED IMPEDANCE -----------\n" " FREQ RESISTANCE REACTANCE MAGNITUDE PHASE " " RESISTANCE REACTANCE MAGNITUDE PHASE\n" " MHz OHMS OHMS OHMS DEGREES " " OHMS OHMS OHMS DEGREES", iss, impedance_norm_factor ); itmp1= nfrq; if ( 0 == ifrq ) tmp1= freq_mhz-( nfrq-1)* delfrq; else tmp1= freq_mhz/( pow(delfrq, (nfrq-1)) ); for( i = 0; i < itmp1; i++ ) { itmp2= 4*i; tmp2= fnorm[itmp2 ]/ impedance_norm_factor; tmp3= fnorm[itmp2+1]/ impedance_norm_factor; tmp4= fnorm[itmp2+2]/ impedance_norm_factor; tmp5= fnorm[itmp2+3]; m_output.endl(); m_output.nec_printf( " %9.3f %11.4E %11.4E %11.4E %7.2f " " %11.4E %11.4E %11.4E %7.2f", tmp1, fnorm[itmp2], fnorm[itmp2+1], fnorm[itmp2+2], fnorm[itmp2+3], tmp2, tmp3, tmp4, tmp5 ); if ( ifrq == 0) tmp1 += delfrq; else tmp1 *= delfrq; } /* for( i = 0; i < itmp1; i++ ) */ m_output.end_section(); } /* if ( iped != 0) */ } void nec_context::structure_segment_loading() { nec_float tim1, tim, tim2; m_output.end_section(); m_output.line(" ------ STRUCTURE IMPEDANCE LOADING ------" ); if ( nload != 0) load(); if ( nload == 0 ) { m_output.line(" THIS STRUCTURE IS NOT LOADED" ); } antenna_env(); /* fill and factor primary interaction matrix */ secnds( &tim1 ); cmset( neq, cm, rkh ); secnds( &tim2 ); tim= tim2- tim1; factrs(m_output, npeq, neq, cm, ip ); secnds( &tim1 ); tim2= tim1- tim2; m_output.end_section(); m_output.line(" ---------- MATRIX TIMING ----------"); m_output.string(" FILL= "); m_output.integer(int(tim)); m_output.string(" msec FACTOR: "); m_output.integer(int(tim2)); m_output.string(" msec"); } void nec_context::setup_excitation() { nec_float tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; tmp1=tmp2=tmp3=tmp4=tmp5=tmp6=0.0; if ( (m_excitation_type != 0) && (m_excitation_type != 5) ) { if ( (iptflg <= 0) || (m_excitation_type == 4) ) { m_output.endl(3); m_output.line(" ---------- EXCITATION ----------" ); } tmp5= degrees_to_rad(xpr5); tmp4= degrees_to_rad(xpr4); if ( m_excitation_type == 4) { tmp1= xpr1/ wavelength; tmp2= xpr2/ wavelength; tmp3= xpr3/ wavelength; tmp6= xpr6/( wavelength* wavelength); m_output.endl(); m_output.line( " CURRENT SOURCE"); m_output.line( " -- POSITION (METERS) -- ORIENTATION (DEG)"); m_output.line( " X Y Z ALPHA BETA DIPOLE MOMENT"); m_output.nec_printf(" %10.5f %10.5f %10.5f %7.2f %7.2f %8.3f", xpr1, xpr2, xpr3, xpr4, xpr5, xpr6 ); } else { tmp1= degrees_to_rad(xpr1); tmp2= degrees_to_rad(xpr2); tmp3= degrees_to_rad(xpr3); tmp6= xpr6; if ( iptflg <= 0) { m_output.endl(); m_output.nec_printf( "PLANE WAVE - THETA: %7.2f deg, PHI: %7.2f deg," " ETA=%7.2f DEG, TYPE - %s AXIAL RATIO: %6.3f", xpr1, xpr2, xpr3, nec_structure_currents::hpol(m_excitation_type).c_str(), xpr6 ); } } /* if ( m_excitation_type == 4) */ } nec_float incident_amplitude = 1.0; // the incident electric field amplitude... if (xpr7 != 0.0) incident_amplitude = xpr7; /* Fill E-field right-hand matrix */ etmns( tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, incident_amplitude, m_excitation_type, current_vector); } enum excitation_return nec_context::excitation_loop(int in_freq_loop_state, int mhz) { int itmp1; do { if (in_freq_loop_state < 4) { setup_excitation(); /* matrix solving (netwk calls solves) */ calculate_network_data(); print_network_data(); if ( (inc > 1) && (iptflg > 0) ) nprint=1; // c_network::net_solve( cm, &cm[ib11], &cm[ic11], &cm[id11], ip, current_vector ); netwk( cm, ip, current_vector ); ntsol=1; if ( iped != 0) { itmp1= 4*( mhz-1); fnorm[itmp1 ] = real( zped); fnorm[itmp1+1] = imag( zped); fnorm[itmp1+2] = abs( zped); fnorm[itmp1+3] = arg_degrees( zped); if ( iped != 2 ) { if ( fnorm[itmp1+2] > impedance_norm_factor) impedance_norm_factor = fnorm[itmp1+2]; } } /* if ( iped != 0) */ /* printing structure currents */ /* The printing of currents is now managed by a dedicated nec_base_result : nec_structure_currents*/ /* Check that the flag for currents and charge densities don't have unexpected values */ if((iptflg <-2)||(iptflg > 3)) { m_output.line("Warning : The print control flag for currents was uncorrect ; it has been set to -1 (no printing for currents)."); iptflg = -1; } if((iptflq <-2)||(iptflq > 0)) { m_output.line("Warning : The print control flag for charge densities was uncorrect ; it has been set to -1 (no printing for charge densities)."); iptflq = -1; } /* Check for compatibility between the excitation type and the output format for currents */ if(m_excitation_type != 1 && m_excitation_type != 2 && m_excitation_type != 3) { if (iptflg == 2 || iptflg == 3) { m_output.line("Warning : The output format chosen for currents was incompatible with the excitation type. No currents has been printed."); iptflg = -1; } } /* Now proceed with the printing of currents */ if (iptflg != -1 || iptflq != -1) { if((iptflg < 1 || iptflg == 3 || ((iptflg == 1 || iptflg == 2) && inc <= 1)) || (iptflg == -1 && iptflq != -1)) { structure_currents = new nec_structure_currents(this, m_excitation_type, nload, xpr3, xpr6); if(iptflg != 3) { structure_currents->set_frequency(freq_mhz/(1.e-6)); m_results.add(structure_currents); } } structure_currents->analyze(); if(iptflg != 3) { std::stringstream ss; structure_currents->write_to_file(ss); m_output.string(ss.str().c_str(), false); } } /* if (iptflg != -1 || iptflq != -1) */ /*print_structure_currents(hpol[m_excitation_type-1], iptflg, iptflq, iptag, iptagf, iptagt, iptaq, iptaqf, iptaqt);*/ print_power_budget(); processing_state = 4; if ( ncoup > 0) couple( current_vector, wavelength ); if ( iflow == 7) { if ( (m_excitation_type > 0) && (m_excitation_type < 4) ) { nthic++; inc++; xpr1 += xpr4; if ( nthic <= nthi ) continue; /* continue excitation loop */ nthic=1; xpr1= thetis; xpr2= xpr2+ xpr5; nphic++; if ( nphic <= nphi ) continue; /* continue excitation loop */ return FREQ_PRINT_NORMALIZATION; } /* if ( (m_excitation_type >= 1) && (m_excitation_type <= 3) ) */ if ( nfrq != 1) { return FREQ_LOOP_CONTINUE; /* continue the freq loop */ } m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } /*if ( iflow == 7) */ } if (in_freq_loop_state < 5) processing_state = 5; /* near field calculation */ if (in_freq_loop_state < 6) { if ( m_near != -1) { if((nrx*nry*nrz) != 0) nfpat(); if ( mhz == nfrq) m_near=-1; if ( nfrq == 1) { m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } } /* if ( near != -1) */ } /* Standard far-field calculation */ if ( ifar != -1) { nec_radiation_pattern* rad_pat = new nec_radiation_pattern(nth, nph, thets, phis, dth, dph, rfld, ground, ifar, wavelength, input_power, network_power_loss, m_rp_output_format, m_rp_normalization, ipd, iavp, gnor, plot_card); rad_pat->analyze(this); /* Here we write the largest gain to the standard output if the user has specified this on the command line. */ if (m_output_flags.get_gain_flag()) { rad_pat->write_gain_normalization(); delete rad_pat; } else { rad_pat->set_frequency(freq_mhz/(1.e-6)); m_results.add(rad_pat); // write the results to the ordinary NEC output file. std::stringstream ss; rad_pat->write_to_file(ss); m_output.line(ss.str().c_str()); // print_radiation_pattern(input_power, network_power_loss); } } if ( (m_excitation_type == 0) || (m_excitation_type >= 4) ) { if ( mhz == nfrq ) ifar=-1; if ( nfrq != 1) { return FREQ_LOOP_CONTINUE; /* continue the freq loop */ } m_output.end_section(); return FREQ_LOOP_CARD_CONTINUE; /* continue card input loop */ } nthic++; inc++; xpr1 += xpr4; if ( nthic <= nthi ) continue; /* continue excitation loop */ nthic = 1; xpr1 = thetis; xpr2 += xpr5; nphic++; if ( nphic > nphi ) return FREQ_PRINT_NORMALIZATION; } while( true ); } /* excitation_loop */ /* load calculates the impedance of specified */ /* segments for various types of loading */ void nec_context::load() { int istep, istepx, l1, l2, ldtags, ichk; bool iwarn = false; nec_complex zt, tpcj; int n = m_geometry->n; int np = m_geometry->np; tpcj = nec_complex(0.0,1.883698955e+9); m_output.endl(); m_output.line(" LOCATION RESISTANCE INDUCTANCE CAPACITANCE IMPEDANCE (OHMS) CONDUCTIVITY CIRCUIT"); m_output.line(" ITAG FROM THRU OHMS HENRYS FARADS REAL IMAGINARY MHOS/METER TYPE"); /* Initialize impedance array, used for temporary */ /* storage of loading information. */ zarray.resize(n); zarray.setConstant(cplx_00()); istep = 0; /* Surely This should be rewritten as... for (int istepx=0; istepx 5 ) { m_output.nec_printf( "\n IMPROPER LOAD TYPE CHOSEN," " REQUESTED TYPE IS %d", ldtyp[istepx] ); stop(-1); } ... rest of code here } // done with loads. if ( iwarn == true ) m_output.nec_printf( "\n NOTE, SOME OF THE ABOVE SEGMENTS " "HAVE BEEN LOADED TWICE - IMPEDANCES ADDED" ); if ( nop != 1) { for( i = 0; i < np; i++ ) { zt= zarray[i]; l1= i; for( l2 = 1; l2 < nop; l2++ ) { l1 += np; zarray[l1]= zt; } } } */ /* cycle over loading cards */ while( true ) { istepx = istep; istep++; if ( istep > nload) { if ( iwarn == true ) m_output.line("NOTE, SOME OF THE ABOVE SEGMENTS HAVE BEEN LOADED TWICE - IMPEDANCES ADDED" ); if ( nop == 1) return; for(int i = 0; i < np; i++ ) { zt= zarray[i]; l1= i; for( l2 = 1; l2 < nop; l2++ ) { l1 += np; zarray[l1]= zt; } } return; } /* if ( istep > nload) */ if ( ldtyp[istepx] > 5 ) { nec_stop("IMPROPER LOAD TYPE CHOSEN," " REQUESTED TYPE IS %d", ldtyp[istepx] ); } /* search segments for proper itags */ ldtags = ldtag[istepx]; int jump = ldtyp[istepx]+1; ichk=0; l1= 1; l2= n; if ( ldtags == 0) { if ( (ldtagf[istepx] != 0) || (ldtagt[istepx] != 0) ) { l1= ldtagf[istepx]; l2= ldtagt[istepx]; } } for(int i = l1-1; i < l2; i++ ) { if ( ldtags != 0) { if ( ldtags != m_geometry->segment_tags[i]) continue; if ( ldtagf[istepx] != 0) { ichk++; if ( (ichk < ldtagf[istepx]) || (ichk > ldtagt[istepx]) ) continue; } else ichk=1; } /* if ( ldtags != 0) */ else ichk=1; nec_float seg_length = m_geometry->segment_length[i]; ASSERT(0.0 != m_geometry->segment_length[i]); ASSERT(0.0 != m_geometry->segment_radius[i]); /* Calculation of lamda*imped. per unit length, jump to appropriate section for loading type */ switch( jump ) { case 1: zt= zlr[istepx]/ seg_length+ tpcj* zli[istepx]/( seg_length*wavelength); if ( fabs( zlc[istepx]) > 1.0e-20) zt += wavelength/( tpcj* seg_length* zlc[istepx]); break; case 2: zt= tpcj* seg_length* zlc[istepx]/ wavelength; if ( fabs( zli[istepx]) > 1.0e-20) zt += seg_length* wavelength/( tpcj* zli[istepx]); if ( fabs( zlr[istepx]) > 1.0e-20) zt += seg_length/ zlr[istepx]; zt=1./ zt; break; case 3: zt= zlr[istepx]* wavelength+ tpcj* zli[istepx]; if ( fabs( zlc[istepx]) > 1.0e-20) zt += 1./( tpcj* seg_length* seg_length* zlc[istepx]); break; case 4: zt= tpcj* seg_length* seg_length* zlc[istepx]; if ( fabs( zli[istepx]) > 1.0e-20) zt += 1./( tpcj* zli[istepx]); if ( fabs( zlr[istepx]) > 1.0e-20) zt += 1./( zlr[istepx]* wavelength); zt=1./ zt; break; case 5: zt= nec_complex( zlr[istepx], zli[istepx])/ seg_length; break; case 6: { zt= zint( zlr[istepx]* wavelength, m_geometry->segment_radius[i]); } } /* switch( jump ) */ if (( fabs( real( zarray[i]))+ fabs( imag( zarray[i]))) > 1.0e-20) iwarn=true; zarray[i] += zt; } /* for( i = l1-1; i < l2; i++ ) */ if ( ichk == 0 ) { nec_exception* nex = new nec_exception("LOADING DATA CARD ERROR, NO SEGMENT HAS AN ITAG = "); nex->append(ldtags); throw nex; } /* printing the segment loading data, jump to proper print */ switch( jump ) { case 1: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.," SERIES "); break; case 2: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL"); break; case 3: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0., "SERIES (PER METER)"); break; case 4: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], zlr[istepx], zli[istepx], zlc[istepx],0.,0.,0.,"PARALLEL (PER METER)"); break; case 5: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx],0.,0.,0., zlr[istepx], zli[istepx],0.,"FIXED IMPEDANCE "); break; case 6: impedance_print( ldtags, ldtagf[istepx], ldtagt[istepx], 0.,0.,0.,0.,0., zlr[istepx]," WIRE "); } /* switch( jump ) */ } /* while( true ) */ } /* cmset sets up the complex structure matrix in the array in_cm */ void nec_context::cmset( int nrow, complex_array& in_cm, nec_float rkhx) { int mp2, iout, it, j, i1, i2, in2; int im1, im2, ist, ij, jss, jm1, jm2, jst, k, kk; complex_array scm; int np = m_geometry->np; int mp = m_geometry->mp; mp2 = 2 * mp; // = np + mp2; // neq= m_geometry->n_plus_2m; // n + 2* m; rkh= rkhx; iout=2* npblk* nrow; it= nlast; in_cm.fill(0,it*nrow,cplx_00()); i1= 1; i2= it; in2= i2; if ( in2 > np) in2= np; im1= i1- np; im2= i2- np; if ( im1 < 1) im1=1; ist=1; if ( i1 <= np) ist= np- i1+2; /* wire source loop */ int n = m_geometry->n; for( j = 1; j <= n; j++ ) { m_geometry->trio(j); for (int i = 0; i < m_geometry->jsno; i++ ) { ij = m_geometry->jco[i]; m_geometry->jco[i] = ((ij-1)/ np)* mp2+ij; } if ( i1 <= in2) cmww( j, i1, in2, in_cm, nrow, in_cm, nrow,1); if ( im1 <= im2) { complex_array temp = in_cm.segment((ist-1)*nrow); cmws( j, im1, im2, temp, nrow, in_cm, 1); } /* matrix elements modified by loading */ if ( nload == 0) continue; if ( j > np) continue; int ipr = j; if ( (ipr < 1) || (ipr > it) ) continue; nec_complex zaj= zarray[j-1]; for (int i = 0; i < m_geometry->jsno; i++ ) { jss = m_geometry->jco[i]; in_cm[(jss-1)+(ipr-1)*nrow] -= ( m_geometry->ax[i]+ m_geometry->cx[i])* zaj; } } /* for( j = 1; j <= n; j++ ) */ int m = m_geometry->m; if ( m != 0) { /* matrix elements for patch current sources */ jm1=1- mp; jm2=0; jst=1- mp2; for (int i = 0; i < nop; i++ ) { jm1 += mp; jm2 += mp; jst += npeq; if ( i1 <= in2) { complex_array temp = in_cm.segment((jst-1)); cmsw( jm1, jm2, i1, in2, temp, in_cm, 0, nrow, 1); } if ( im1 <= im2) { complex_array temp = in_cm.segment((jst-1)+(ist-1)*nrow); compute_matrix_ss( jm1, jm2, im1, im2, temp, nrow, 1); } } } /* if ( m != 0) */ if ( icase == 1) return; /* Allocate to scratch memory */ scm.resize(m_geometry->n_plus_2m); /* combine elements for symmetry modes */ for (int i = 0; i < it; i++ ) { int row_offset = i*nrow; for( j = 0; j < npeq; j++ ) { for( k = 0; k < nop; k++ ) { int ka = j+ k*npeq; scm[k] = in_cm[row_offset + ka]; } in_cm[row_offset + j] = scm.sum(0,nop); for( k = 1; k < nop; k++ ) { int ka = j+ k*npeq; nec_complex deter = scm[0]; for( kk = 1; kk < nop; kk++ ) { deter += scm[kk] * symmetry_array[k+kk*nop]; } in_cm[row_offset + ka] = deter; } } } scm.resize(0); } /* compute_matrix_ss computes matrix elements for surface-surface interactions. */ void nec_context::compute_matrix_ss( int j1, int j2, int im1, int im2, complex_array& in_cm, int nrow, int itrp ) { int i1, i2, icomp, ii1, i, il, ii2, jj1, jl, jj2; nec_float t1xi, t1yi, t1zi, t2xi, t2yi, t2zi, xi, yi, zi; nec_complex g11, g12, g21, g22; i1=( im1+1)/2; i2=( im2+1)/2; icomp= i1*2-3; ii1=-2; if ( icomp+2 < im1) ii1=-3; /* loop over observation patches */ il = -1; for( i = i1; i <= i2; i++ ) { il++; icomp += 2; ii1 += 2; ii2 = ii1+1; t1xi= m_geometry->t1x[il]* m_geometry->psalp[il]; t1yi= m_geometry->t1y[il]* m_geometry->psalp[il]; t1zi= m_geometry->t1z[il]* m_geometry->psalp[il]; t2xi= m_geometry->t2x[il]* m_geometry->psalp[il]; t2yi= m_geometry->t2y[il]* m_geometry->psalp[il]; t2zi= m_geometry->t2z[il]* m_geometry->psalp[il]; xi= m_geometry->px[il]; yi= m_geometry->py[il]; zi= m_geometry->pz[il]; /* loop over source patches */ jj1=-2; for(int j = j1; j <= j2; j++ ) { jl=j-1; jj1 += 2; jj2 = jj1+1; m_s= m_geometry->pbi[jl]; xj= m_geometry->px[jl]; yj= m_geometry->py[jl]; zj= m_geometry->pz[jl]; t1xj= m_geometry->t1x[jl]; t1yj= m_geometry->t1y[jl]; t1zj= m_geometry->t1z[jl]; t2xj= m_geometry->t2x[jl]; t2yj= m_geometry->t2y[jl]; t2zj= m_geometry->t2z[jl]; hintg( xi, yi, zi); g11=-( t2xi* exk+ t2yi* eyk+ t2zi* ezk); g12=-( t2xi* exs+ t2yi* eys+ t2zi* ezs); g21=-( t1xi* exk+ t1yi* eyk+ t1zi* ezk); g22=-( t1xi* exs+ t1yi* eys+ t1zi* ezs); if ( i == j ) { g11 -= .5; g22 += .5; } /* normal fill */ if ( itrp == 0) { if ( icomp >= im1 ) { in_cm[ii1+jj1*nrow]= g11; in_cm[ii1+jj2*nrow]= g12; } if ( icomp >= im2 ) continue; in_cm[ii2+jj1*nrow]= g21; in_cm[ii2+jj2*nrow]= g22; continue; } /* if ( itrp == 0) */ /* transposed fill */ if ( icomp >= im1 ) { in_cm[jj1+ii1*nrow]= g11; in_cm[jj2+ii1*nrow]= g12; } if ( icomp >= im2 ) continue; in_cm[jj1+ii2*nrow]= g21; in_cm[jj2+ii2*nrow]= g22; } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1; i <= i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* computes matrix elements for e along wires due to patch current */ void nec_context::cmsw( int j1, int j2, int i1, int i2, complex_array& in_cm, complex_array& cw, int ncw, int nrow, int itrp ) { nec_float fsign=1.0; complex_array emel(9); /*! -1 offset to "m_geometry->jsno" for array indexing */ int jsnox = m_geometry->jsno-1; if (itrp < 0) return; int k=-1; int icgo=0; /* observation loop */ for (int i = i1-1; i < i2; i++ ) { k++; nec_float xi = m_geometry->x[i]; nec_float yi= m_geometry->y[i]; nec_float zi= m_geometry->z[i]; nec_float cabi= m_geometry->cab[i]; nec_float sabi= m_geometry->sab[i]; nec_float salpi= m_geometry->salp[i]; int ipch=0; if ( m_geometry->icon1[i] >= PCHCON) { ipch= m_geometry->icon1[i]-PCHCON; fsign=-1.; } if ( m_geometry->icon2[i] >= PCHCON) { ipch= m_geometry->icon2[i]-PCHCON; fsign=1.; } /* source loop */ int jl = -1; for (int j = j1; j <= j2; j++ ) { jl += 2; int js = j-1; t1xj= m_geometry->t1x[js]; t1yj= m_geometry->t1y[js]; t1zj= m_geometry->t1z[js]; t2xj= m_geometry->t2x[js]; t2yj= m_geometry->t2y[js]; t2zj= m_geometry->t2z[js]; xj= m_geometry->px[js]; yj= m_geometry->py[js]; zj= m_geometry->pz[js]; m_s = m_geometry->pbi[js]; /* ground loop */ #warning weird problem to test here. replaced loop variable called ip for (int ipgnd = 1; ipgnd <= ground.ksymp; ipgnd++ ) { if ( ((ipch == j) || (icgo != 0)) && (ipgnd != 2) ) { if ( icgo <= 0 ) { ASSERT(ipgnd != 2); pcint( xi, yi, zi, cabi, sabi, salpi, emel); nec_float angle = pi()* m_geometry->segment_length[i]* fsign; nec_float pxl = sin(angle); nec_float pyl = cos(angle); exc= emel[8]* fsign; m_geometry->trio(i+1); int il= i-ncw; if ( i < m_geometry->np) il += (il/m_geometry->np)*2*m_geometry->mp; if ( itrp == 0 ) cw[k+il*nrow] += exc*( m_geometry->ax[jsnox]+ m_geometry->bx[jsnox]* pxl+ m_geometry->cx[jsnox]* pyl); else cw[il+k*nrow] += exc*( m_geometry->ax[jsnox]+ m_geometry->bx[jsnox]* pxl+ m_geometry->cx[jsnox]* pyl); } /* if ( icgo <= 0 ) */ if ( itrp == 0) { in_cm[k+(jl-1)*nrow]= emel[icgo]; in_cm[k+jl*nrow] = emel[icgo+4]; } else { in_cm[(jl-1)+k*nrow]= emel[icgo]; in_cm[jl+k*nrow] = emel[icgo+4]; } icgo++; if ( icgo == 4) icgo=0; continue; } /* if ( ((ipch == (j+1)) || (icgo != 0)) && (ipgnd != 2) ) */ unere( xi, yi, zi, ipgnd == 2); /* normal fill */ if ( itrp == 0) { in_cm[k+(jl-1)*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; in_cm[k+jl*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; continue; } /* transposed fill */ in_cm[(jl-1)+k*nrow] += exk* cabi+ eyk* sabi+ ezk* salpi; in_cm[jl+k*nrow] += exs* cabi+ eys* sabi+ ezs* salpi; } /* for( ipgnd = 1; ipgnd <= ground.ksymp; ipgnd++ ) */ } /* for( j = j1; j <= j2; j++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* cmws computes matrix elements for wire-surface interactions */ void nec_context::cmws( int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int itrp ) { int ipr, ipatch, ik, js=0, jx; nec_float xi, yi, zi, tx, ty, tz; nec_complex etk, ets, etc; j--; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; /* observation loop */ ipr= -1; for(int i = i1; i <= i2; i++ ) { ipr++; ipatch=(i+1)/2; ik= i-( i/2)*2; if ( (ik != 0) || (ipr == 0) ) { js= ipatch-1; xi= m_geometry->px[js]; yi= m_geometry->py[js]; zi= m_geometry->pz[js]; hsfld( xi, yi, zi,0.); if ( ik != 0 ) { tx= m_geometry->t2x[js]; ty= m_geometry->t2y[js]; tz= m_geometry->t2z[js]; } else { tx= m_geometry->t1x[js]; ty= m_geometry->t1y[js]; tz= m_geometry->t1z[js]; } } /* if ( (ik != 0) || (ipr == 0) ) */ else { tx= m_geometry->t1x[js]; ty= m_geometry->t1y[js]; tz= m_geometry->t1z[js]; } /* if ( (ik != 0) || (ipr == 0) ) */ etk=-( exk* tx+ eyk* ty+ ezk* tz)* m_geometry->psalp[js]; ets=-( exs* tx+ eys* ty+ ezs* tz)* m_geometry->psalp[js]; etc=-( exc* tx+ eyc* ty+ ezc* tz)* m_geometry->psalp[js]; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if ( itrp == 0) { for(int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[ipr+jx*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* if ( itrp == 0) */ /* transposed fill */ if ( itrp != 2) { for(int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* if ( itrp != 2) */ /* transposed fill - c(ws) and d(ws)prime (=cw) */ for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; if ( jx < nr) in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; else { jx -= nr; cw[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } } /* for( ij = 0; ij < m_geometry->jsno; ij++ ) */ } /* for( i = i1; i <= i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* cmww computes matrix elements for wire-wire interactions */ void nec_context::cmww( int j, int i1, int i2, complex_array& in_cm, int nr, complex_array& cw, int nw, int itrp) { int i, jx; nec_float xi, yi, zi, ai, cabi, sabi, salpi; nec_complex etk, ets, etc; /* set source segment parameters */ jx = j; j--; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; /* Decide whether ext. t.w. approx. can be used */ if ( m_use_exk == true) { int ipr = m_geometry->icon1[j]; if (ipr > PCHCON) ind1 = 0; // trap bug also in original fortran else if (ipr == 0) ind1 = 1; else if ((ipr == jx) && ( cabj*cabj + sabj*sabj > 1.e-8)) ind1=2; else if (ipr < 0) { ind1 = 2; int iprx= -ipr - 1; if ( m_geometry->icon1[iprx] == -jx ) ind1 = m_geometry->test_ek_approximation(j,iprx); } /* if ( ipr < 0 ) */ else { if ( ipr != jx ) { ind1=2; int iprx = ipr-1; if ( m_geometry->icon2[iprx] == jx ) ind1 = m_geometry->test_ek_approximation(j,iprx); } else if ( (cabj* cabj+ sabj* sabj) > 1.e-8) ind1=2; else ind1=0; } /* if ( ipr < 0 ) */ { int iprx = std::abs(ipr) - 1; int ind1_test = 2; if (ipr > PCHCON) ind1_test = 0; else if (ipr == 0) ind1_test = 1; else if ((ipr == jx) && (cabj*cabj + sabj*sabj <= 1.e-8)) ind1_test = 0; else if ((ipr > 0) && (m_geometry->icon2[iprx] == jx)) ind1_test = m_geometry->test_ek_approximation(j, ipr - 1); else if ((ipr < 0) && (m_geometry->icon1[iprx] == -jx)) ind1_test = m_geometry->test_ek_approximation(j, -ipr - 1); ASSERT(ind1_test == ind1); } ipr = m_geometry->icon2[j]; if (ipr > PCHCON) ind2 = 2; // trap bug also in original fortran else if (ipr == 0) ind2 = 1; else if (ipr < 0) { int iprx = -ipr - 1; if ( -m_geometry->icon2[iprx] != jx ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,iprx); } } /* if ( ipr < 0 ) */ else { if ( ipr != jx ) { int iprx = ipr-1; if ( m_geometry->icon1[iprx] != jx ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,iprx); } } /* if ( ipr != jx ) */ else if ( (cabj* cabj+ sabj* sabj) > 1.e-8) ind2=2; else ind2=0; } /* if ( ipr < 0 ) */ } /* if ( m_use_exk == true) */ /* observation loop */ int ipr=-1; for( i = i1-1; i < i2; i++ ) { ipr++; xi= m_geometry->x[i]; yi= m_geometry->y[i]; zi= m_geometry->z[i]; ai= m_geometry->segment_radius[i]; cabi= m_geometry->cab[i]; sabi= m_geometry->sab[i]; salpi= m_geometry->salp[i]; efld( xi, yi, zi, ai, i != j); etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; /* fill matrix elements. element locations */ /* determined by connection data. */ /* normal fill */ if ( itrp == 0) { for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx = m_geometry->jco[ij]-1; in_cm[ipr+jx*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* transposed fill */ if ( itrp != 2) { for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } continue; } /* trans. fill for c(ww) - test for elements for d(ww)prime. (=cw) */ for (int ij = 0; ij < m_geometry->jsno; ij++ ) { jx= m_geometry->jco[ij]-1; if ( jx < nr) in_cm[jx+ipr*nr] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; else { jx -= nr; cw[jx*ipr*nw] += etk* m_geometry->ax[ij]+ ets* m_geometry->bx[ij]+ etc* m_geometry->cx[ij]; } } /* for( ij = 0; ij < m_geometry->jsno; ij++ ) */ } /* for( i = i1-1; i < i2; i++ ) */ } /*-----------------------------------------------------------------------*/ /* couple computes the maximum coupling between pairs of segments. */ void nec_context::couple( complex_array& in_currents, nec_float in_wavelength ) { int j1, j2, l1, itt1, itt2, its1, its2, isg1, isg2, npm1; nec_float dbc, c, gmax; nec_complex y11, y12, y22, yl, yin, zl, zin, rho; if ( (voltage_source_count != 1) || (nvqd != 0) ) return; int seg_num = m_geometry->get_segment_number( nctag[icoup], ncseg[icoup]); if ( seg_num != source_segment_array[0] ) return; zin= source_voltage_array[0]; icoup++; y11a.resize(icoup); y11a[icoup-1]= in_currents[seg_num-1]*in_wavelength/zin; l1=(icoup-1)*(ncoup-1); for (int i = 0; i < ncoup; i++ ) { if ( (i+1) == icoup) continue; l1++; y12a.resize(l1); int k = m_geometry->get_segment_number( nctag[i], ncseg[i]); y12a[l1-1]= in_currents[k-1]* in_wavelength/ zin; } if ( icoup < ncoup) return; m_output.endl(3); m_output.nec_printf( " -----------" " ISOLATION DATA -----------\n\n" " ------- COUPLING BETWEEN ------ MAXIMUM " " ---------- FOR MAXIMUM COUPLING ----------\n" " SEG SEG COUPLING LOAD" " IMPEDANCE (2ND SEG) INPUT IMPEDANCE \n" " TAG SEG No: TAG SEG No: (DB) " " REAL IMAGINARY REAL IMAGINARY" ); npm1= ncoup-1; for (int i = 0; i < npm1; i++ ) { itt1= nctag[i]; its1= ncseg[i]; isg1= m_geometry->get_segment_number( itt1, its1); l1= i+1; for (int j = l1; j < ncoup; j++ ) { itt2= nctag[j]; its2= ncseg[j]; isg2= m_geometry->get_segment_number( itt2, its2); j1= j+ i* npm1-1; j2= i+ j* npm1; y11= y11a[i]; y22= y11a[j]; y12=.5*( y12a[j1]+ y12a[j2]); yin= y12* y12; dbc= abs( yin); c= dbc/(2.* real( y11)* real( y22)- real( yin)); if ( (c >= 0.0) && (c <= 1.0) ) { if ( c >= .01 ) gmax=(1.- sqrt(1.- c*c))/c; else gmax=.5*( c+.25* c* c* c); rho= gmax* conj( yin)/ dbc; yl=((1.- rho)/(1.+ rho)+1.)* real( y22)- y22; zl=1./ yl; yin= y11- yin/( y22+ yl); zin=1./ yin; dbc= db10( gmax); m_output.endl(); m_output.nec_printf( " %4d %4d %5d %4d %4d %5d %9.3f" " %12.5E %12.5E %12.5E %12.5E", itt1, its1, isg1, itt2, its2, isg2, dbc, real(zl), imag(zl), real(zin), imag(zin) ); continue; } /* if ( (c >= 0.0) && (c <= 1.0) ) */ m_output.endl(); m_output.nec_printf( " %4d %4d %5d %4d %4d %5d **ERROR** " "COUPLING IS NOT BETWEEN 0 AND 1. (= %12.5E)", itt1, its1, isg1, itt2, its2, isg2, c ); } /* for( j = l1; j < ncoup; j++ ) */ } /* for( i = 0; i < npm1; i++ ) */ } /*! \brief Compute near E-fields of a segment due to constant sine and cosine currents distributions. The ground effect is included. \param xi,yi,zi x,y,z components of the field evaluation point. \param ai Radius of the segment on which the field is evaluated. \param on_source_segment Flag to indicate if the field evaluation point is not on the source segment (i != j) */ void nec_context::efld( nec_float xi, nec_float yi, nec_float zi, nec_float ai, bool not_on_source_segment) { #define txk egnd[0] #define tyk egnd[1] #define tzk egnd[2] #define txs egnd[3] #define tys egnd[4] #define tzs egnd[5] #define txc egnd[6] #define tyc egnd[7] #define tzc egnd[8] nec_float salpr, zij, zp, rhox; nec_float rhoy, rhoz, rh, r, rmag, cth, px, py; nec_float xymag, xspec, yspec, rhospc, dmin, shaf; nec_complex epx, epy, refs, refps, zrsin, zratx, zscrn; nec_complex tezs, ters, tezc, terc, tezk, terk; complex_array egnd(9); nec_float xij = xi - xj; nec_float yij = yi - yj; bool ijx = not_on_source_segment; { // calculate the direct field. salpr= salpj; zij= zi- zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh = sqrt( rhox*rhox + rhoy*rhoy + rhoz*rhoz + ai*ai); if ( rh <= 1.e-10) { rhox=0.0; rhoy=0.0; rhoz=0.0; } else { rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; } /* lumped current element approx. for large separations */ r= sqrt( zp*zp + rh*rh); if ( r >= rkh) { rmag = two_pi() * r; cth = zp/ r; px = rh/ r; txk = nec_complex( cos( rmag),- sin( rmag)); py= two_pi() * r* r; tyk= em::impedance() * cth* txk* nec_complex(1.0,-1.0/ rmag)/ py; tzk= em::impedance() * px* txk* nec_complex(1.0, rmag-1.0/ rmag)/(2.* py); tezk= tyk* cth- tzk* px; terk= tyk* px+ tzk* cth; rmag= sin( pi()* m_s)/ pi(); tezc= tezk* rmag; terc= terk* rmag; tezk= tezk* m_s; terk= terk* m_s; txs=cplx_00(); tys=cplx_00(); tzs=cplx_00(); } /* if ( r >= rkh) */ if ( r < rkh) { /* eksc for thin wire approx. or ekscx for extended t.w. approx. */ if ( m_use_exk == false) eksc( m_s, zp, rh, two_pi(), ijx, &tezs, &ters, &tezc, &terc, &tezk, &terk ); else ekscx( m_b, m_s, zp, rh, two_pi(), ijx, ind1, ind2, &tezs, &ters, &tezc, &terc, &tezk, &terk); txs= tezs* cabj+ ters* rhox; tys= tezs* sabj+ ters* rhoy; tzs= tezs* salpr+ ters* rhoz; } txk= tezk* cabj+ terk* rhox; tyk= tezk* sabj+ terk* rhoy; tzk= tezk* salpr+ terk* rhoz; txc= tezc* cabj+ terc* rhox; tyc= tezc* sabj+ terc* rhoy; tzc= tezc* salpr+ terc* rhoz; exk= txk; eyk= tyk; ezk= tzk; exs= txs; eys= tys; ezs= tzs; exc= txc; eyc= tyc; ezc= tzc; } if (ground.present()) { // Now do the reflected field... ijx=1; salpr= -salpj; zij= zi + zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh = sqrt( rhox*rhox + rhoy*rhoy + rhoz*rhoz + ai*ai); if ( rh <= 1.e-10) { rhox=0.0; rhoy=0.0; rhoz=0.0; } else { rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; } /* lumped current element approx. for large separations */ r= sqrt( zp*zp + rh*rh); if ( r >= rkh) { rmag = two_pi() * r; cth = zp/ r; px = rh/ r; txk = nec_complex( cos( rmag),- sin( rmag)); py= two_pi() * r* r; tyk= em::impedance() * cth* txk* nec_complex(1.0,-1.0/ rmag)/ py; tzk= em::impedance() * px* txk* nec_complex(1.0, rmag-1.0/ rmag)/(2.* py); tezk= tyk* cth- tzk* px; terk= tyk* px+ tzk* cth; rmag= sin( pi()* m_s)/ pi(); tezc= tezk* rmag; terc= terk* rmag; tezk= tezk* m_s; terk= terk* m_s; txs=cplx_00(); tys=cplx_00(); tzs=cplx_00(); } /* if ( r >= rkh) */ if ( r < rkh) { /* eksc for thin wire approx. or ekscx for extended t.w. approx. */ if ( m_use_exk == false) eksc( m_s, zp, rh, two_pi(), ijx, &tezs, &ters, &tezc, &terc, &tezk, &terk ); else ekscx( m_b, m_s, zp, rh, two_pi(), ijx, ind1, ind2, &tezs, &ters, &tezc, &terc, &tezk, &terk); txs= tezs* cabj+ ters* rhox; tys= tezs* sabj+ ters* rhoy; tzs= tezs* salpr+ ters* rhoz; } txk= tezk* cabj+ terk* rhox; tyk= tezk* sabj+ terk* rhoy; tzk= tezk* salpr+ terk* rhoz; txc= tezc* cabj+ terc* rhox; tyc= tezc* sabj+ terc* rhoy; tzc= tezc* salpr+ terc* rhoz; ASSERT(ground.is_valid()); if (ground.type_finite_reflection()) { zratx= ground.zrati; rmag= r; xymag= sqrt( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if ( ground.radial_wire_count != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrt( xspec*xspec + yspec*yspec + ground.t2*ground.t2); if ( rhospc <= ground.scrwl) { zscrn= ground.m_t1* rhospc* log( rhospc/ ground.t2); zratx=( zscrn* ground.zrati)/( em::impedance() * ground.zrati+ zscrn); } } /* if ( ground.radial_wire_count != 0) */ /* Calculation of reflection coefficients when ground is specified. */ if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; zrsin=cplx_10(); } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; zrsin= sqrt(1.0 - zratx*zratx*(1.0 - cth*cth) ); } /* if ( xymag <= 1.0e-6) */ refs=( cth- zratx* zrsin)/( cth+ zratx* zrsin); refps=-( zratx* cth- zrsin)/( zratx* cth+ zrsin); refps= refps- refs; epy= px* txk+ py* tyk; epx= px* epy; epy= py* epy; txk= refs* txk+ refps* epx; tyk= refs* tyk+ refps* epy; tzk= refs* tzk; epy= px* txs+ py* tys; epx= px* epy; epy= py* epy; txs= refs* txs+ refps* epx; tys= refs* tys+ refps* epy; tzs= refs* tzs; epy= px* txc+ py* tyc; epx= px* epy; epy= py* epy; txc= refs* txc+ refps* epx; tyc= refs* tyc+ refps* epy; tzc= refs* tzc; } /* if (ground.type_finite_reflection()) */ exk -= txk* ground.frati; eyk -= tyk* ground.frati; ezk -= tzk* ground.frati; exs -= txs* ground.frati; eys -= tys* ground.frati; ezs -= tzs* ground.frati; exc -= txc* ground.frati; eyc -= tyc* ground.frati; ezc -= tzc* ground.frati; } if (false == ground.type_sommerfeld_norton()) // (ground.iperf != 2) return; /* field due to ground using Sommerfeld/Norton */ sn = norm(cabj, sabj); if ( sn >= 1.0e-5) { xsn= cabj/ sn; ysn= sabj/ sn; } else { sn=0.0; xsn=1.0; ysn=0.0; } /* displace observation point for thin wire approximation */ zij= zi+ zj; salpr=- salpj; rhox= sabj* zij- salpr* yij; rhoy= salpr* xij- cabj* zij; rhoz= cabj* yij- sabj* xij; rh = norm(rhox, rhoy, rhoz); // rhox* rhox+ rhoy* rhoy+ rhoz* rhoz; if ( rh <= 1.e-10) { xo= xi- ai* ysn; yo= yi+ ai* xsn; zo= zi; } else { rh= ai/ sqrt( rh); if ( rhoz < 0.0) rh=- rh; xo= xi+ rh* rhox; yo= yi+ rh* rhoy; zo= zi+ rh* rhoz; } /* if ( rh <= 1.e-10) */ r = xij*xij + yij*yij + zij*zij; if ( r <= .95) { /* Field from interpolation is integrated over segment */ isnor=1; dmin = norm(exk) + norm(eyk) + norm(ezk); dmin = 0.01* sqrt(dmin); shaf = 0.5* m_s; rom2(-shaf, shaf, egnd, dmin); } else { /* Norton field equations and lumped current element approximation */ isnor=2; sflds(0., egnd); } /* if ( r <= .95) */ if ( r > .95) { zp= xij* cabj+ yij* sabj+ zij* salpr; rh= r- zp* zp; if ( rh <= 1.e-10) dmin = 0.0; else dmin = sqrt( rh/( rh+ ai* ai)); if ( dmin <= .95) { px=1.- dmin; terk=( txk* cabj+ tyk* sabj+ tzk* salpr)* px; txk= dmin* txk+ terk* cabj; tyk= dmin* tyk+ terk* sabj; tzk= dmin* tzk+ terk* salpr; ters=( txs* cabj+ tys* sabj+ tzs* salpr)* px; txs= dmin* txs+ ters* cabj; tys= dmin* tys+ ters* sabj; tzs= dmin* tzs+ ters* salpr; terc=( txc* cabj+ tyc* sabj+ tzc* salpr)* px; txc= dmin* txc+ terc* cabj; tyc= dmin* tyc+ terc* sabj; tzc= dmin* tzc+ terc* salpr; } } /* if ( r > .95) */ exk= exk+ txk; eyk= eyk+ tyk; ezk= ezk+ tzk; exs= exs+ txs; eys= eys+ tys; ezs= ezs+ tzs; exc= exc+ txc; eyc= eyc+ tyc; ezc= ezc+ tzc; } /*-----------------------------------------------------------------------*/ /* Compute E-field of sine, cosine, and constant current filaments by thin wire approximation. */ void nec_context::eksc( nec_float s, nec_float z, nec_float rh, nec_float xk, int ij, nec_complex *in_ezs, nec_complex *ers, nec_complex *in_ezc, nec_complex *erc, nec_complex *in_ezk, nec_complex *erk ) { static nec_complex __const1(0.0,4.771341189); // set some global variables for the gf() method. These should be moved to parameters of gf (via intx) ija = ij; zpk = xk* z; nec_float rhk = xk * rh; rkb2 = rhk * rhk; nec_float sh =.5* s; nec_float shk = xk * sh; nec_float ss = sin(shk); nec_float cs = cos(shk); nec_float z2a = sh - z; nec_float z1a =-(sh + z); nec_complex gz1, gz2, gp1, gp2; gx( z1a, rh, xk, &gz1, &gp1); gx( z2a, rh, xk, &gz2, &gp2); nec_complex gzp1 = gp1 * z1a; nec_complex gzp2 = gp2 * z2a; *in_ezs= __const1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *in_ezc=- __const1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *erk= __const1*( gp2- gp1)* rh; nec_float cint, sint; intx(-shk, shk, rhk, ij, &cint, &sint); *in_ezk=- __const1*( gzp2- gzp1+ xk* xk* nec_complex( cint,- sint)); if ( rh >= 1.0e-10) { gzp1 = gzp1 * z1a; gzp2 = gzp2 * z2a; *ers =- __const1*(( gzp2+ gzp1+ gz2+ gz1)* ss-( z2a* gz2- z1a* gz1)* cs*xk)/ rh; *erc =- __const1*(( gzp2- gzp1+ gz2- gz1)* cs+( z2a* gz2+ z1a* gz1)* ss*xk)/ rh; return; } *ers = cplx_00(); *erc = cplx_00(); } /*-----------------------------------------------------------------------*/ /* Compute e field of sine, cosine, and constant current filaments by extended thin wire approximation. */ void nec_context::ekscx( nec_float bx, nec_float s, nec_float z, nec_float rhx, nec_float xk, int ij, int inx1, int inx2, nec_complex *in_ezs, nec_complex *ers, nec_complex *in_ezc, nec_complex *erc, nec_complex *in_ezk, nec_complex *erk ) { static nec_complex __const1(0.0,4.771341189); int ira; nec_float b, rh, sh, rhk, shk, ss, cs, z1a; nec_float z2a, a2, bk, bk2, cint, sint; nec_complex gz1, gz2, gzp1, gzp2, gr1, gr2; nec_complex grp1, grp2, grk1, grk2, gzz1, gzz2; if ( rhx >= bx) { rh= rhx; b= bx; ira=0; } else { rh= bx; b= rhx; ira=1; } sh=.5* s; // set some global variables for the gf() method. These should be moved to parameters of gf (via intx) ija= ij; zpk= xk* z; rhk= xk* rh; rkb2= rhk* rhk; shk= xk* sh; ss= sin( shk); cs= cos( shk); z2a= sh- z; z1a=-( sh+ z); a2= b* b; if ( inx1 != 2) gxx( z1a, rh, b, a2, xk, ira, &gz1, &gzp1, &gr1, &grp1, &grk1, &gzz1); else { gx( z1a, rhx, xk, &gz1, &grk1); gzp1= grk1* z1a; gr1= gz1/ rhx; grp1= gzp1/ rhx; grk1= grk1* rhx; gzz1= cplx_00(); } if ( inx2 != 2) gxx( z2a, rh, b, a2, xk, ira, &gz2, &gzp2, &gr2, &grp2, &grk2, &gzz2); else { gx( z2a, rhx, xk, &gz2, &grk2); gzp2= grk2* z2a; gr2= gz2/ rhx; grp2= gzp2/ rhx; grk2= grk2* rhx; gzz2= cplx_00(); } *in_ezs= __const1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss); *in_ezc=- __const1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs); *ers=- __const1*(( z2a* grp2+ z1a* grp1+ gr2+ gr1)*ss -( z2a* gr2- z1a* gr1)* cs* xk); *erc=- __const1*(( z2a* grp2- z1a* grp1+ gr2- gr1)*cs +( z2a* gr2+ z1a* gr1)* ss* xk); *erk= __const1*( grk2- grk1); intx(- shk, shk, rhk, ij, &cint, &sint); bk= b* xk; bk2= bk* bk*.25; *in_ezk=- __const1*( gzp2- gzp1+ xk* xk*(1.- bk2)* nec_complex( cint,- sint)-bk2*( gzz2- gzz1)); } /*-----------------------------------------------------------------------*/ /*!\brief Fills the array e with the negative of the electric field tangent to the segments and the tangential magnetic field on the surfaces \param e is the right hand side of the matrix equation. */ void nec_context::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 ) { nec_float cth, sth, cph, sph, cet, set, pxl, pyl, pzl, wx; nec_float wy, wz, qx, qy, qz, ds, dsh, rs, r; nec_complex er, et, ezh, erh, rrv, rrh, tt1, tt2; int n = m_geometry->n; int m = m_geometry->m; // int neq= n+2*m; ASSERT(neq == n+2*m); nqds=0; ASSERT(excite_type >= 0); /* applied field of voltage sources for transmitting case */ if ( (excite_type == EXCITATION_VOLTAGE) || (excite_type == EXCITATION_VOLTAGE_DISC) ) { e.fill(0,neq,cplx_00()); for (int i = 0; i < voltage_source_count; i++ ) { int source_index = source_segment_array[i]-1; e[source_index] = -source_voltage_array[i]/(m_geometry->segment_length[source_index]* wavelength); } if ( nvqd == 0) return; for (int i = 0; i < nvqd; i++ ) { qdsrc( ivqd[i], vqd[i], e); } return; } /* if ( (excite_type == EXCITATION_VOLTAGE) || (excite_type == EXCITATION_VOLTAGE_DISC) ) */ /* incident plane wave, linearly polarized. */ if ((excite_type == EXCITATION_LINEAR) || (excite_type == EXCITATION_CIRC_RIGHT) || (excite_type == EXCITATION_CIRC_LEFT)) { cth= cos( p1); sth= sin( p1); cph= cos( p2); sph= sin( p2); cet= cos( p3); set= sin( p3); pxl= cth* cph* cet- sph* set; pyl= cth* sph* cet+ cph* set; pzl=- sth* cet; wx=- sth* cph; wy=- sth* sph; wz=- cth; qx= wy* pzl- wz* pyl; qy= wz* pxl- wx* pzl; qz= wx* pyl- wy* pxl; if (ground.present()) { if (ground.type_perfect()) { rrv=-cplx_10(); rrh=-cplx_10(); } else { rrv= sqrt(1.0 - ground.get_zrati_sqr() * sth*sth); rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); } } if ( excite_type == EXCITATION_LINEAR) { if ( n != 0) { for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi() *( wx* m_geometry->x[i]+ wy* m_geometry->y[i]+ wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] = -(pxl*m_geometry->cab[i]+ pyl*m_geometry->sab[i]+ pzl*m_geometry->salp[i]) * e_amplitude * incident_amplitude; } if (ground.present()) { tt1=( pyl* cph- pxl* sph)*( rrh- rrv); nec_complex cx= rrv* pxl- tt1* sph; nec_complex cy= rrv* pyl+ tt1* cph; nec_complex cz=- rrv* pzl; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]- wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] -= ( cx* m_geometry->cab[i]+ cy* m_geometry->sab[i]+ cz* m_geometry->salp[i])* e_amplitude * incident_amplitude; } } } /* if ( n != 0) */ if ( m == 0) // if no surface patches we're done! return; { int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; ASSERT(is == i); i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT( arg == (- two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]+ wz* m_geometry->pz[i]))); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * em::inverse_impedance(); e[i2]=( qx* m_geometry->t1x[i]+ qy* m_geometry->t1y[i]+ qz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]=( qx* m_geometry->t2x[i]+ qy* m_geometry->t2y[i]+ qz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } if (ground.present()) { tt1=( qy* cph- qx* sph)*( rrv- rrh); nec_complex cx=-( rrh* qx- tt1* sph); nec_complex cy=-( rrh* qy+ tt1* cph); nec_complex cz= rrh* qz; int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT((-two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]- wz* m_geometry->pz[i])) == arg); nec_complex e_amplitude = cplx_exp(arg) * m_geometry->psalp[i] * em::inverse_impedance(); e[i2]= e[i2]+( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]= e[i1]+( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } return; } /* if ( excite_type == EXCITATION_LINEAR) */ /* incident plane wave, elliptic polarization. */ tt1=-(cplx_01())* p6; if ( excite_type == EXCITATION_CIRC_LEFT) tt1=- tt1; if ( n != 0) { nec_complex cx= pxl+ tt1* qx; nec_complex cy= pyl+ tt1* qy; nec_complex cz= pzl+ tt1* qz; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]+ wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] = -(cx* m_geometry->cab[i] + cy* m_geometry->sab[i] + cz*m_geometry->salp[i])* e_amplitude * incident_amplitude; } if (ground.present()) { tt2=( cy* cph- cx* sph)*( rrh- rrv); nec_complex ccx= rrv* cx- tt2* sph; nec_complex ccy= rrv* cy+ tt2* cph; nec_complex ccz=- rrv* cz; for (int i = 0; i < n; i++ ) { nec_float arg=- two_pi()*( wx* m_geometry->x[i]+ wy* m_geometry->y[i]- wz* m_geometry->z[i]); nec_complex e_amplitude(cos(arg), sin(arg)); e[i] -= (ccx* m_geometry->cab[i]+ ccy* m_geometry->sab[i]+ ccz* m_geometry->salp[i]) * e_amplitude * incident_amplitude; } } } /* if ( n != 0) */ if ( m == 0) return; nec_complex cx= qx- tt1* pxl; nec_complex cy= qy- tt1* pyl; nec_complex cz= qz- tt1* pzl; { int i= -1; int i1= n-2; for (int is = 0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT(arg == -two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]+ wz* m_geometry->pz[i])); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * em::inverse_impedance(); e[i2]=( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1]=( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } if (ground.present()) { tt1=( cy* cph- cx* sph)*( rrv- rrh); cx=-( rrh* cx- tt1* sph); cy=-( rrh* cy+ tt1* cph); cz= rrh* cz; int i= -1; int i1= n-2; for (int is=0; is < m; is++ ) { i++; i1 += 2; int i2 = i1+1; nec_float arg = -m_geometry->patch_angle(i,wx,wy,wz); ASSERT(arg == -two_pi()*( wx* m_geometry->px[i]+ wy* m_geometry->py[i]- wz* m_geometry->pz[i])); nec_complex e_amplitude = nec_complex(cos(arg), sin(arg)) * m_geometry->psalp[i] * em::inverse_impedance(); e[i2] += ( cx* m_geometry->t1x[i]+ cy* m_geometry->t1y[i]+ cz* m_geometry->t1z[i])* e_amplitude * incident_amplitude; e[i1] += ( cx* m_geometry->t2x[i]+ cy* m_geometry->t2y[i]+ cz* m_geometry->t2z[i])* e_amplitude * incident_amplitude; } } return; } /* if ( excite_type <= 3) */ ASSERT(excite_type == EXCITATION_CURRENT); /* incident field of an elementary current source. */ nec_float cosp4 = cos(p4); wx = cosp4 * cos(p5); wy = cosp4 * sin(p5); wz = sin(p4); ds = p6*em::impedance_over_2pi(); dsh= p6/(2.0 * two_pi()); // TODO: Split the following loop up into two loops i=1:n and i=1:m // to loop over the patches and the segments seperately for (int i = 0; i < m_geometry->n_plus_m; i++ ) { if ( i < n ) { pxl = m_geometry->x[i] - p1; pyl = m_geometry->y[i] - p2; pzl = m_geometry->z[i] - p3; } else // patches { int patch_index = i - n; pxl = m_geometry->px[patch_index] - p1; pyl = m_geometry->py[patch_index] - p2; pzl = m_geometry->pz[patch_index] - p3; } rs = norm2(pxl,pyl,pzl); if ( rs < 1.0e-30) continue; r = sqrt(rs); pxl = pxl/r; pyl = pyl/r; pzl = pzl/r; cth = pxl*wx + pyl*wy + pzl*wz; sth = sqrt(1.0 - cth*cth); qx = pxl - wx*cth; qy = pyl - wy*cth; qz = pzl - wz*cth; nec_float arg = norm(qx,qy,qz); if ( arg >= 1.e-30) { qx = qx / arg; qy = qy / arg; qz = qz / arg; } else { qx = 1.0; qy = 0.0; qz = 0.0; } /* if ( arg >= 1.e-30) */ arg = two_pi() * r; tt1 = nec_complex(cos(arg), -sin(arg)); if ( i < n ) { tt2 = nec_complex(1.0,-1.0/arg) / rs; er = ds* tt1* tt2* cth; et = 0.5 * ds * tt1 *((cplx_01()) * two_pi()/r + tt2)* sth; ezh= er*cth - et*sth; erh= er*sth + et*cth; nec_complex cx = ezh*wx + erh*qx; nec_complex cy = ezh*wy + erh*qy; nec_complex cz = ezh*wz + erh*qz; e[i] = -(cx* m_geometry->cab[i]+ cy* m_geometry->sab[i]+ cz* m_geometry->salp[i]); } else // patches { int patch_index = i - n; int i1 = i + patch_index*2; // was i1 += 2; and starts at n-2 int i2 = i1+1; pxl = wy*qz - wz*qy; // cross product here... pyl = wz*qx - wx*qz; pzl = wx*qy - wy*qx; tt2= dsh* tt1* nec_complex(1.0/r, two_pi())/ r* sth* m_geometry->psalp[patch_index]; nec_complex cx= tt2* pxl; nec_complex cy= tt2* pyl; nec_complex cz= tt2* pzl; e[i2] = cx*m_geometry->t1x[patch_index] + cy*m_geometry->t1y[patch_index] + cz*m_geometry->t1z[patch_index]; e[i1] = cx*m_geometry->t2x[patch_index] + cy*m_geometry->t2y[patch_index] + cz*m_geometry->t2z[patch_index]; } /* if ( i < n) */ } /* for( i = 0; i < m_geometry->n_plus_m; i++ ) */ } /*!\brief Computes the integrand exp(jkr)/(kr) for numerical integration. TODO: Place the ija, rkb2, zpk = xk*z global variables as parameters (possibly also the rk parameter). */ void nec_context::gf( nec_float zk, nec_float *co, nec_float *si ) { static nec_float _gf_const0 = -1.38888889e-3; static nec_float _gf_const1 = 4.16666667e-2; nec_float zdk = zk - zpk; nec_float rk = sqrt(rkb2 + zdk*zdk); *si= sin(rk)/ rk; if ( ija != 0 ) { *co = cos(rk)/ rk; return; } if ( rk >= .2) { *co = (cos(rk) - 1.0)/rk; return; } nec_float rks = rk*rk; *co = ((_gf_const0 * rks + _gf_const1)* rks - 0.5)* rk; } /*-----------------------------------------------------------------------*/ /* integrand for h field of a wire */ void nec_context::gh( nec_float zk, nec_float *hr, nec_float *hi) { nec_float rs, r, ckr, skr, rr2, rr3; rs= zk- zpka; rs= rhks+ rs* rs; r= sqrt( rs); ckr= cos( r); skr= sin( r); rr2=1./ rs; rr3= rr2/ r; *hr= skr* rr2+ ckr* rr3; *hi= ckr* rr2- skr* rr3; } /*-----------------------------------------------------------------------*/ /* Segment end contributions for thin wire approx. This function is called a lot. We should try to optimise this if at all possible. */ void nec_context::gx( nec_float zz, nec_float rh, nec_float xk, nec_complex *gz, nec_complex *gzp) { nec_float r2 = zz*zz+ rh*rh; nec_float r = sqrt(r2); nec_float rkz = xk * r; nec_complex temp(cos(rkz),-sin(rkz)); temp /= r; *gz = temp; *gzp = -nec_complex(1.0, rkz) * temp / r2; } /*-----------------------------------------------------------------------*/ /*! \brief Segment end contributions for extended thin wire approx. */ void nec_context::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 ) { nec_float r, r2, r4, rk, rk2, rh2, t1, t2; nec_complex gz, c1, c2, c3; r2= zz* zz+ rh* rh; r= sqrt( r2); r4= r2* r2; rk= xk* r; rk2= rk* rk; rh2= rh* rh; t1=.25* a2* rh2/ r4; t2=.5* a2/ r2; c1= nec_complex(1.0, rk); c2=3.* c1- rk2; c3= nec_complex(6.0, rk)* rk2-15.* c1; gz= nec_complex( cos( rk),- sin( rk))/ r; *g2= gz*(1.+ t1* c2); *g1= *g2- t2* c1* gz; gz= gz/ r2; *g2p= gz*( t1* c3- c1); *gzp= t2* c2* gz; *g3= *g2p+ *gzp; *g1p= *g3* zz; if ( ira != 1) { *g3=( *g3+ *gzp)* rh; *gzp=- zz* c1* gz; if ( rh <= 1.0e-10) { *g2=0.; *g2p=0.; return; } *g2= *g2/ rh; *g2p= *g2p* zz/ rh; return; } /* if ( ira != 1) */ t2=.5* a; *g2=- t2* c1* gz; *g2p= t2* gz* c2/ r2; *g3= rh2* *g2p- a* gz* c1; *g2p= *g2p* zz; *gzp=- zz* c1* gz; } /*-----------------------------------------------------------------------*/ /* hfk computes the H-field of a uniform current filament by numerical integration */ void nec_context::hfk( nec_float el1, nec_float el2, nec_float rhk, nec_float zpkx, nec_float *sgr, nec_float *sgi ) { int nx = 1, nma = 65536, nts = 4; int ns, nt; bool flag = true; nec_float rx = 1.0e-4; nec_float z, ze, s, ep, zend, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; nec_float g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; nec_float g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; zpka= zpkx; rhks= rhk* rhk; z= el1; ze= el2; s= ze- z; ep= s/(10.* nma); zend= ze- ep; *sgr=0.0; *sgi=0.0; ns= nx; nt=0; gh( z, &g1r, &g1i); while( true ) { if ( flag ) { dz= s/ ns; zp= z+ dz; if ( zp > ze ) { dz= ze- z; if ( fabs(dz) <= ep ) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } } dzot= dz*.5; zp= z+ dzot; gh( zp, &g3r, &g3i); zp= z+ dz; gh( zp, &g5r, &g5i); } /* if ( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if ( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if ( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if ( nt >= nts) { if ( ns > nx) { ns= ns/2; nt=1; } } flag = true; continue; } /* if ( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gh( zp, &g2r, &g2i); zp= z+ dz*0.75; gh( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if ( (te2i > rx) || (te2r > rx) ) { nt=0; if ( ns >= nma) m_output.nec_printf( "\n STEP SIZE LIMITED AT Z= %10.5f", z ); else { ns= ns*2; dz= s/ ns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = false; continue; } } /* if ( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if ( z >= zend) { *sgr= *sgr* rhk*.5; *sgi= *sgi* rhk*.5; return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { ns= ns/2; nt=1; } flag = true; } /* while( true ) */ } /*-----------------------------------------------------------------------*/ /* hintg computes the h field of a patch current */ void nec_context::hintg( nec_float xi, nec_float yi, nec_float zi ) { nec_float rx, ry, rfl, xymag, pxx, pyy, cth; nec_float rz, rsq, r, rk, cr, sr, t1zr, t2zr; nec_complex gam, f1x, f1y, f1z, f2x, f2y, f2z, rrv, rrh; rx= xi- xj; ry= yi- yj; rfl=-1.; exk=cplx_00(); eyk=cplx_00(); ezk=cplx_00(); exs=cplx_00(); eys=cplx_00(); ezs=cplx_00(); for (int ground_loop = 1; ground_loop <= ground.ksymp; ground_loop++ ) { rfl=- rfl; rz = zi - zj*rfl; rsq = rx*rx + ry*ry + rz*rz; if ( rsq < 1.0e-20) continue; r = sqrt( rsq ); rk= two_pi() * r; cr= cos( rk); sr= sin( rk); gam=-( nec_complex(cr,-sr)+rk*nec_complex(sr,cr) )/( four_pi()*rsq*r )* m_s; exc= gam* rx; eyc= gam* ry; ezc= gam* rz; t1zr= t1zj* rfl; t2zr= t2zj* rfl; f1x= eyc* t1zr- ezc* t1yj; f1y= ezc* t1xj- exc* t1zr; f1z= exc* t1yj- eyc* t1xj; f2x= eyc* t2zr- ezc* t2yj; f2y= ezc* t2xj- exc* t2zr; f2z= exc* t2yj- eyc* t2xj; if ( ground_loop != 1) { if ( ground.type_perfect() ) //ground.iperf == 1) { f1x=- f1x; f1y=- f1y; f1z=- f1z; f2x=- f2x; f2y=- f2y; f2z=- f2z; } else { xymag= sqrt(rx*rx + ry*ry); if ( xymag <= 1.0e-6) { pxx=0.; pyy=0.; cth=1.; rrv=cplx_10(); } else { pxx=- ry/ xymag; pyy= rx/ xymag; cth= rz/ r; rrv= sqrt(1.0 - ground.get_zrati_sqr() *(1.0 - cth* cth)); } /* if ( xymag <= 1.0e-6) */ rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); gam=( f1x* pxx+ f1y* pyy)*( rrv- rrh); f1x= f1x* rrh+ gam* pxx; f1y= f1y* rrh+ gam* pyy; f1z= f1z* rrh; gam=( f2x* pxx+ f2y* pyy)*( rrv- rrh); f2x= f2x* rrh+ gam* pxx; f2y= f2y* rrh+ gam* pyy; f2z= f2z* rrh; } /* if ( ground.iperf == 1) */ } /* if ( ground_loop != 1) */ exk += f1x; eyk += f1y; ezk += f1z; exs += f2x; eys += f2y; ezs += f2z; } /* for( ground_loop = 1; ground_loop <= ground.ksymp; ground_loop++ ) */ } /*-----------------------------------------------------------------------*/ /*!\brief hsfld computes the h field for constant, sine, and cosine current on a segment including ground effects. */ void nec_context::hsfld( nec_float xi, nec_float yi, nec_float zi, nec_float ai ) { nec_float xij, yij, rfl, salpr, zij, zp, rhox, rhoy, rhoz, rh, phx; nec_float phy, phz, rmag, xymag, xspec, yspec, rhospc, px, py, cth; nec_complex hpk, hps, hpc, qx, qy, qz, rrv, rrh, zratx; xij= xi- xj; yij= yi- yj; rfl=-1.; for (int ground_loop = 0; ground_loop < ground.ksymp; ground_loop++ ) { rfl=- rfl; salpr= salpj* rfl; zij= zi- rfl* zj; zp= xij* cabj+ yij* sabj+ zij* salpr; rhox= xij- cabj* zp; rhoy= yij- sabj* zp; rhoz= zij- salpr* zp; rh= sqrt( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai); if ( rh <= 1.0e-10) { exk=0.; eyk=0.; ezk=0.; exs=0.; eys=0.; ezs=0.; exc=0.; eyc=0.; ezc=0.; continue; } rhox= rhox/ rh; rhoy= rhoy/ rh; rhoz= rhoz/ rh; phx= sabj* rhoz- salpr* rhoy; phy= salpr* rhox- cabj* rhoz; phz= cabj* rhoy- sabj* rhox; hsflx( m_s, rh, zp, &hpk, &hps, &hpc); if ( ground_loop == 1 ) { if ( false == ground.type_perfect() ) { zratx= ground.zrati; rmag= sqrt( zp* zp+ rh* rh); xymag= sqrt( xij* xij+ yij* yij); /* set parameters for radial wire ground screen. */ if ( ground.radial_wire_count != 0) { xspec=( xi* zj+ zi* xj)/( zi+ zj); yspec=( yi* zj+ zi* yj)/( zi+ zj); rhospc= sqrt( xspec*xspec + yspec*yspec + ground.t2*ground.t2); if ( rhospc <= ground.scrwl) { rrv = ground.m_t1 * rhospc* log(rhospc/ ground.t2); zratx = ( rrv* ground.zrati)/( em::impedance() * ground.zrati + rrv); } } /* calculation of reflection coefficients when ground is specified. */ if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=cplx_10(); } else { px=- yij/ xymag; py= xij/ xymag; cth= zij/ rmag; rrv= sqrt(1.- zratx* zratx*(1.- cth* cth)); } rrh= zratx* cth; rrh=-( rrh- rrv)/( rrh+ rrv); rrv= zratx* rrv; rrv=( cth- rrv)/( cth+ rrv); qy=( phx* px+ phy* py)*( rrv- rrh); qx= qy* px+ phx* rrh; qy= qy* py+ phy* rrh; qz= phz* rrh; exk= exk- hpk* qx; eyk= eyk- hpk* qy; ezk= ezk- hpk* qz; exs= exs- hps* qx; eys= eys- hps* qy; ezs= ezs- hps* qz; exc= exc- hpc* qx; eyc= eyc- hpc* qy; ezc= ezc- hpc* qz; continue; } /* if ( ground.iperf != 1 ) */ exk= exk- hpk* phx; eyk= eyk- hpk* phy; ezk= ezk- hpk* phz; exs= exs- hps* phx; eys= eys- hps* phy; ezs= ezs- hps* phz; exc= exc- hpc* phx; eyc= eyc- hpc* phy; ezc= ezc- hpc* phz; continue; } /* if ( ground_loop == 1 ) */ exk= hpk* phx; eyk= hpk* phy; ezk= hpk* phz; exs= hps* phx; eys= hps* phy; ezs= hps* phz; exc= hpc* phx; eyc= hpc* phy; ezc= hpc* phz; } /* for( ground_loop = 0; ground_loop < ground.ksymp; ground_loop++ ) */ } /*-----------------------------------------------------------------------*/ /* calculates h field of sine cosine, and constant current of segment */ void nec_context::hsflx( nec_float s, nec_float rh, nec_float zpx, nec_complex *hpk, nec_complex *hps, nec_complex *hpc ) { nec_float r1, r2, zp, z2a, hss, dh, z1; nec_float rhz, dk, cdk, sdk, hkr, hki, rh2; nec_complex fjk, ekr1, ekr2, t1, t2, cons; nec_float pi8 = pi() * 8.0; fjk = -two_pi_j(); if ( rh >= 1.0e-10) { if ( zpx >= 0.0) { zp= zpx; hss=1.; } else { zp=- zpx; hss=-1.; } dh= 0.5* s; z1= zp+ dh; z2a= zp- dh; if ( z2a >= 1.0e-7) rhz= rh/ z2a; else rhz=1.; dk= two_pi() * dh; cdk= cos( dk); sdk= sin( dk); hfk(- dk, dk, rh* two_pi(), zp* two_pi(), &hkr, &hki); *hpk= nec_complex( hkr, hki); if ( rhz >= 1.0e-3) { rh2= rh* rh; r1= sqrt( rh2+ z1* z1); r2= sqrt( rh2+ z2a* z2a); ekr1= exp( fjk* r1); ekr2= exp( fjk* r2); t1= z1* ekr1/ r1; t2= z2a* ekr2/ r2; *hps=( cdk*( ekr2- ekr1)- cplx_01()* sdk*( t2+ t1))* hss; *hpc=- sdk*( ekr2+ ekr1)- cplx_01()* cdk*( t2- t1); cons=- cplx_01()/(2.0 * two_pi() * rh); *hps= cons* *hps; *hpc= cons* *hpc; return; } /* if ( rhz >= 1.0e-3) */ ekr1= nec_complex( cdk, sdk)/( z2a* z2a); ekr2= nec_complex( cdk,- sdk)/( z1* z1); t1= two_pi()*(1.0/z1 - 1.0/z2a); t2= exp( fjk* zp)* rh/ pi8; *hps= t2*( t1+( ekr1+ ekr2)* sdk)* hss; *hpc= t2*(- cplx_01()* t1+( ekr1- ekr2)* cdk); return; } /* if ( rh >= 1.0e-10) */ *hps=cplx_00(); *hpc=cplx_00(); *hpk=cplx_00(); } /* intx performs numerical integration of exp(jkr)/r by the method of variable interval width Romberg integration. The integrand value is supplied by subroutine gf. */ void nec_context::intx( nec_float el1, nec_float el2, nec_float b, int ij, nec_float *sgr, nec_float *sgi) { int ns, nt; int nx = 1, nma = 65536, nts = 4; bool flag = true; nec_float z, s, ze, fnm, ep, zend, fns, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i; nec_float g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r; nec_float g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r; nec_float rx = 1.0e-4; z= el1; ze= el2; if ( ij == 0) ze=0.; s= ze- z; fnm= nma; ep= s/(10.* fnm); zend= ze- ep; *sgr=0.; *sgi=0.; ns= nx; nt=0; gf( z, &g1r, &g1i); while( true ) { if ( flag ) { fns= ns; dz= s/ fns; zp= z+ dz; if ( zp > ze) { dz= ze- z; if ( fabs(dz) <= ep) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } } /* if ( zp > ze) */ dzot= dz*.5; zp= z+ dzot; gf( zp, &g3r, &g3i); zp= z+ dz; gf( zp, &g5r, &g5i); } /* if ( flag ) */ t00r=( g1r+ g5r)* dzot; t00i=( g1i+ g5i)* dzot; t01r=( t00r+ dz* g3r)*0.5; t01i=( t00i+ dz* g3i)*0.5; t10r=(4.0* t01r- t00r)/3.0; t10i=(4.0* t01i- t00i)/3.0; /* test convergence of 3 point romberg result. */ test( t01r, t10r, &te1r, t01i, t10i, &te1i, 0.); if ( (te1i <= rx) && (te1r <= rx) ) { *sgr= *sgr+ t10r; *sgi= *sgi+ t10i; nt += 2; z += dz; if ( z >= zend) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = true; continue; } /* if ( (te1i <= rx) && (te1r <= rx) ) */ zp= z+ dz*0.25; gf( zp, &g2r, &g2i); zp= z+ dz*0.75; gf( zp, &g4r, &g4i); t02r=( t01r+ dzot*( g2r+ g4r))*0.5; t02i=( t01i+ dzot*( g2i+ g4i))*0.5; t11r=(4.0* t02r- t01r)/3.0; t11i=(4.0* t02i- t01i)/3.0; t20r=(16.0* t11r- t10r)/15.0; t20i=(16.0* t11i- t10i)/15.0; /* test convergence of 5 point romberg result. */ test( t11r, t20r, &te2r, t11i, t20i, &te2i, 0.); if ( (te2i > rx) || (te2r > rx) ) { nt=0; if ( ns >= nma) m_output.nec_printf( "\n STEP SIZE LIMITED AT Z= %10.5f", z ); else { /* halve step size */ ns= ns*2; fns= ns; dz= s/ fns; dzot= dz*0.5; g5r= g3r; g5i= g3i; g3r= g2r; g3i= g2i; flag = false; continue; } } /* if ( (te2i > rx) || (te2r > rx) ) */ *sgr= *sgr+ t20r; *sgi= *sgi+ t20i; nt++; z += dz; if ( z >= zend) { /* add contribution of near singularity for diagonal term */ if (ij == 0) { *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b)); *sgi=2.* *sgi; } return; } g1r= g5r; g1i= g5i; if ( nt >= nts) if ( ns > nx) { /* Double step size */ ns= ns/2; nt=1; } flag = true; } /* while( true ) */ } /*! \brief nefld computes the near field at specified points in space after the structure currents have been computed. \param xob,yob,zob The field evaluation points. */ void nec_context::nefld( nec_float xob, nec_float yob, nec_float zob, nec_complex *ex, nec_complex *ey, nec_complex *ez ) { int i, ix, ipr, jc; nec_float zp, ax; nec_complex acx, bcx, ccx; *ex=cplx_00(); *ey=cplx_00(); *ez=cplx_00(); ax=0.0; int n = m_geometry->n; for( i = 0; i < n; i++ ) { xj= xob- m_geometry->x[i]; yj= yob- m_geometry->y[i]; zj= zob- m_geometry->z[i]; zp= m_geometry->cab[i]* xj+ m_geometry->sab[i]* yj+ m_geometry->salp[i]* zj; if ( fabs( zp) > 0.5001* m_geometry->segment_length[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= m_geometry->segment_radius[i]; if ( zp > 0.9* xj* xj) continue; ax= xj; break; } /* for( i = 0; i < n; i++ ) */ for( i = 0; i < n; i++ ) { ix = i+1; m_s = m_geometry->segment_length[i]; m_b = m_geometry->segment_radius[i]; xj= m_geometry->x[i]; yj= m_geometry->y[i]; zj= m_geometry->z[i]; cabj= m_geometry->cab[i]; sabj= m_geometry->sab[i]; salpj= m_geometry->salp[i]; if ( m_use_exk == true) { ipr= m_geometry->icon1[i]; if (ipr > PCHCON) ind1 = 2; else if ( ipr < 0 ) { ipr = -ipr; int iprx = ipr-1; if ( -m_geometry->icon1[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind1=1; else { int iprx = ipr-1; if ( ipr != ix ) { if ( m_geometry->icon2[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); } } /* if ( ipr != ix ) */ else { if ( (cabj* cabj+ sabj* sabj) > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= m_geometry->icon2[i]; if (ipr > PCHCON) ind2 = 2; else if ( ipr < 0 ) { ipr = -ipr; int iprx = ipr-1; if ( -m_geometry->icon2[iprx] != ix ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(i,iprx); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind2=1; else { int iprx = ipr-1; if ( ipr != ix ) { if ( m_geometry->icon1[iprx] != ix ) ind2=2; else { ind2 = m_geometry->test_ek_approximation(i,iprx); } } /* if ( ipr != (i+1) ) */ else { if ( (cabj* cabj+ sabj* sabj) > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if ( m_use_exk == true) */ efld( xob, yob, zob, ax, true); acx= nec_complex( air[i], aii[i]); bcx= nec_complex( bir[i], bii[i]); ccx= nec_complex( cir[i], cii[i]); *ex += exk* acx+ exs* bcx+ exc* ccx; *ey += eyk* acx+ eys* bcx+ eyc* ccx; *ez += ezk* acx+ ezs* bcx+ ezc* ccx; } /* for( i = 0; i < n; i++ ) */ jc= n-1; for( i = 0; i < m_geometry->m; i++ ) { m_s= m_geometry->pbi[i]; xj= m_geometry->px[i]; yj= m_geometry->py[i]; zj= m_geometry->pz[i]; t1xj= m_geometry->t1x[i]; t1yj= m_geometry->t1y[i]; t1zj= m_geometry->t1z[i]; t2xj= m_geometry->t2x[i]; t2yj= m_geometry->t2y[i]; t2zj= m_geometry->t2z[i]; jc += 3; acx= t1xj* current_vector[jc-2]+ t1yj* current_vector[jc-1]+ t1zj* current_vector[jc]; bcx= t2xj* current_vector[jc-2]+ t2yj* current_vector[jc-1]+ t2zj* current_vector[jc]; { unere( xob, yob, zob, false); *ex += acx* exk+ bcx* exs; *ey += acx* eyk+ bcx* eys; *ez += acx* ezk+ bcx* ezs; } if (ground.present()) { unere( xob, yob, zob, true); *ex += acx* exk+ bcx* exs; *ey += acx* eyk+ bcx* eys; *ez += acx* ezk+ bcx* ezs; } /* for( ipa = 0; ipa < ground.ksymp; ipa++ ) { int ipgnd= ipa+1; unere( xob, yob, zob, ipgnd == 2); *ex= *ex+ acx* exk+ bcx* exs; *ey= *ey+ acx* eyk+ bcx* eys; *ez= *ez+ acx* ezk+ bcx* ezs; } */ } /* for( i = 0; i < m; i++ ) */ } /*-----------------------------------------------------------------------*/ #include /* subroutine netwk solves for structure currents for a given */ /* excitation including the effect of non-radiating networks if */ /* present. */ void nec_context::netwk( complex_array& in_cm, int_array& in_ip, complex_array& einc ) /* The parameters cmb, cmc, cmd appear to be Numerical Green's Functions Related. N.G.F are not implemented in this version of NEC. The evidence for the above opinion is from the NEC-PC code that does implement the N.G.F. */ { /* Network buffers */ int_array ipnt, nteqa, ntsca; complex_array vsrc, rhs, cmn, rhnt, rhnx; bool jump1, jump2; int nteq=0, ntsc=0, nseg2, irow2=0; int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0; nec_float asmx, asa, y11r, y11i, y12r, y12i, y22r, y22i; nec_complex ymit, vlt, cux; neqz2= neq2; if ( neqz2 == 0) neqz2=1; input_power = 0.0; network_power_loss = 0.0; neqt= neq+ neq2; int ndimn = (2*network_count + voltage_source_count); /* Allocate network buffers */ if ( network_count > 0 ) { rhs.resize( m_geometry->n_plus_3m ); // this should probably be ndimn! rhnt.resize( ndimn ); rhnx.resize( ndimn); cmn.resize( ndimn * ndimn ); ntsca.resize( ndimn ); nteqa.resize( ndimn ); ipnt.resize( ndimn ); vsrc.resize( voltage_source_count ); } if ( ntsol == 0) { /* compute relative matrix asymmetry */ if ( masym != 0) { irow1=0; for( i = 0; i < network_count; i++ ) { nseg1= iseg1[i]; for( isc1 = 0; isc1 < 2; isc1++ ) { if ( irow1 == 0) { ipnt[irow1]= nseg1; nseg1= iseg2[i]; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } nseg1= iseg2[i]; } /* for( isc1 = 0; isc1 < 2; isc1++ ) */ } /* for( i = 0; i < network_count; i++ ) */ ASSERT(voltage_source_count >= 0); for( i = 0; i < voltage_source_count; i++ ) { nseg1= source_segment_array[i]; if ( irow1 == 0) { ipnt[irow1]= nseg1; irow1++; continue; } int j = 0; for( j = 0; j < irow1; j++ ) if ( nseg1 == ipnt[j]) break; if ( j == irow1 ) { ipnt[irow1]= nseg1; irow1++; } } /* for( i = 0; i < voltage_source_count; i++ ) */ if ( irow1 >= 2) { for( i = 0; i < irow1; i++ ) { isc1 = ipnt[i]-1; asmx= m_geometry->segment_length[isc1]; rhs.fill(0,neqt,cplx_00()); rhs[isc1] = cplx_10(); solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < irow1; j++ ) { isc1= ipnt[j]-1; cmn[j+i*ndimn]= rhs[isc1]/ asmx; } } /* for( i = 0; i < irow1; i++ ) */ asmx=0.0; asa=0.0; for( i = 1; i < irow1; i++ ) { for (int j = 0; j < i; j++ ) { cux = cmn[i+j*ndimn]; nec_float pwr= abs(( cux- cmn[j+i*ndimn])/ cux); asa += pwr* pwr; if ( pwr >= asmx) { asmx= pwr; nteq= ipnt[i]; ntsc= ipnt[j]; } } /* for( j = 0; j < i; j++ ) */ } /* for( i = 1; i < irow1; i++ ) */ asa= sqrt( asa*2./ (nec_float)( irow1*( irow1-1))); m_output.nec_printf( "\n\n" " MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n" " MATRIX IS %10.3E FOR SEGMENTS %d AND %d\n" " RMS RELATIVE ASYMMETRY IS %10.3E", asmx, nteq, ntsc, asa ); } /* if ( irow1 >= 2) */ } /* if ( masym != 0) */ /* solution of network equations */ if ( network_count != 0) { // zero the cmn array, and the rhnx array cmn.setConstant(cplx_00()); rhnx.setConstant(cplx_00()); nteq=0; ntsc=0; /* sort network and source data and assign equation numbers to segments */ for (int j = 0; j < network_count; j++ ) { nseg1= iseg1[j]; nseg2= iseg2[j]; // Calculate the admittance yXX for this network element if ( ntyp[j] <= 1) // if not transmission line { y11r= x11r[j]; y11i= x11i[j]; y12r= x12r[j]; y12i= x12i[j]; y22r= x22r[j]; y22i= x22i[j]; } else { y22r= two_pi() * x11i[j]/ wavelength; y12r=0.; y12i=1./( x11r[j]* sin( y22r)); y11r= x12r[j]; y11i=- y12i* cos( y22r); y22r= x22r[j]; y22i= y11i+ x22i[j]; y11i= y11i+ x12i[j]; if ( ntyp[j] != 2) // ntype == 3, must be crossed element { y12r = -y12r; y12i = -y12i; } } /* if ( ntyp[j] <= 1) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg1 == source_segment_array[i]) { isc1 = i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc1=-1; for( i = 0; i < nteq; i++ ) { if ( nseg1 == nteqa[i]) { irow1 = i; jump2 = true; break; } } if ( ! jump2 ) { irow1= nteq; nteqa[nteq]= nseg1; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg1 == ntsca[i]) { irow1 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow1= ndimn- (ntsc+1); ntsca[ntsc]= nseg1; vsrc[ntsc]= source_voltage_array[isc1]; ntsc++; } } /* if ( ! jump1 ) */ jump1 = false; for( i = 0; i < voltage_source_count; i++ ) { if ( nseg2 == source_segment_array[i]) { isc2= i; jump1 = true; break; } } jump2 = false; if ( ! jump1 ) { isc2=-1; for( i = 0; i < nteq; i++ ) { if ( nseg2 == nteqa[i]) { irow2= i; jump2 = true; break; } } if ( ! jump2 ) { irow2= nteq; nteqa[nteq]= nseg2; nteq++; } } /* if ( ! jump1 ) */ else { for( i = 0; i < ntsc; i++ ) { if ( nseg2 == ntsca[i]) { irow2 = ndimn- (i+1); jump2 = true; break; } } if ( ! jump2 ) { irow2= ndimn- (ntsc+1); ntsca[ntsc]= nseg2; vsrc[ntsc]= source_voltage_array[isc2]; ntsc++; } } /* if ( ! jump1 ) */ /* Fill network equation matrix and right hand side vector with network short-circuit admittance matrix coefficients. */ if ( isc1 == -1) { cmn[irow1+irow1*ndimn] -= nec_complex( y11r, y11i)* m_geometry->segment_length[nseg1-1]; cmn[irow1+irow2*ndimn] -= nec_complex( y12r, y12i)* m_geometry->segment_length[nseg1-1]; } else { rhnx[irow1] += nec_complex( y11r, y11i)* source_voltage_array[isc1]/wavelength; rhnx[irow2] += nec_complex( y12r, y12i)* source_voltage_array[isc1]/wavelength; } if ( isc2 == -1) { cmn[irow2+irow2*ndimn] -= nec_complex( y22r, y22i)* m_geometry->segment_length[nseg2-1]; cmn[irow2+irow1*ndimn] -= nec_complex( y12r, y12i)* m_geometry->segment_length[nseg2-1]; } else { rhnx[irow1] += nec_complex( y12r, y12i)* source_voltage_array[isc2]/wavelength; rhnx[irow2] += nec_complex( y22r, y22i)* source_voltage_array[isc2]/wavelength; } } /* for( j = 0; j < network_count; j++ ) */ /* add interaction matrix admittance elements to network equation matrix */ for( i = 0; i < nteq; i++ ) { rhs.fill(0,neqt,cplx_00()); irow1= nteqa[i]-1; rhs[irow1]=cplx_10(); solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for (int j = 0; j < nteq; j++ ) { irow1= nteqa[j]-1; cmn[i+j*ndimn] += rhs[irow1]; } } /* for( i = 0; i < nteq; i++ ) */ /* factor network equation matrix */ lu_decompose(m_output, nteq, cmn, ipnt, ndimn); } /* if ( network_count != 0) */ } /* if ( ntsol != 0) */ if (0 == network_count) { /* solve for currents when no networks are present */ solves( in_cm, in_ip, einc, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); ntsc=0; } else // if ( network_count != 0) { /* Add to network equation right hand side the terms due to element interactions */ for (i = 0; i < neqt; i++) rhs[i]= einc[i]; solves( in_cm, in_ip, rhs, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, rhs, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; rhnt[i]= rhnx[i]+ rhs[irow1]; } /* solve network equations */ solve( nteq, cmn, ipnt, rhnt, ndimn); /* Add fields due to network voltages to electric fields applied to structure and solve for induced current */ for( i = 0; i < nteq; i++ ) { irow1= nteqa[i]-1; einc[irow1] -= rhnt[i]; } solves( in_cm, in_ip, einc, neq, 1, m_geometry->np, m_geometry->n, m_geometry->mp, m_geometry->m, nop, symmetry_array); m_geometry->get_current_coefficients(wavelength, einc, air, aii, bir, bii, cir, cii, vqds, nqds, iqds); nec_structure_excitation* seo = new nec_structure_excitation(); for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* m_geometry->segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; int segment_tag = m_geometry->segment_tags[segment_index]; seo->add(segment_number, segment_tag, voltage, current, power); } for ( i = 0; i < ntsc; i++ ) { int segment_number = ntsca[i]; int segment_index = segment_number-1; nec_complex voltage = vsrc[i]; nec_complex current = einc[segment_index]* wavelength; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; int segment_tag = m_geometry->segment_tags[segment_index]; seo->add(segment_number, segment_tag, voltage, current, power); } /* for( i = 0; i < ntsc; i++ ) */ if ( nprint == 0) { std::stringstream ss; seo->write_to_file(ss); m_output.line(ss.str().c_str()); } seo->set_frequency(freq_mhz/(1.e-6)); m_results.add(seo); /* if ( nprint == 0) { m_output.nec_printf( "\n\n\n" " " "--------- STRUCTURE EXCITATION DATA AT NETWORK CONNECTION POINTS --------" ); m_output.nec_printf( "\n" " TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) " " IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER\n" " No: No: REAL IMAGINARY REAL IMAGINARY " " REAL IMAGINARY REAL IMAGINARY (WATTS)" ); } for( i = 0; i < nteq; i++ ) { int segment_number = nteqa[i]; int segment_index = segment_number-1; nec_complex voltage = rhnt[i]* m_geometry->segment_length[segment_index]* wavelength; nec_complex current = einc[segment_index]* wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; int segment_tag = m_geometry->segment_tags[segment_number]; nec_float power = em::power(voltage,current); network_power_loss = network_power_loss - power; if ( nprint == 0) m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_number, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); } for( i = 0; i < ntsc; i++ ) { irow1= ntsca[i]-1; vlt= vsrc[i]; cux= einc[irow1]* wavelength; ymit= cux/ vlt; zped= vlt/ cux; irow2= m_geometry->segment_tags[irow1]; nec_float pwr= em::power(vlt,cux); network_power_loss= network_power_loss- pwr; if ( nprint == 0) m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, irow1+1, real(vlt), imag(vlt), real(cux), imag(cux), real(zped), imag(zped), real(ymit), imag(ymit), pwr ); } // for( i = 0; i < ntsc; i++ ) */ } // if ( network_count != 0) if ( (voltage_source_count+nvqd) == 0) return; // Create an antenna_input results object to hold the antenna input results. nec_antenna_input* antenna_input = new nec_antenna_input(); antenna_input->set_frequency(freq_mhz/(1.e-6)); m_results.add(antenna_input); /* m_output.end_section(); m_output.nec_printf( " " "--------- ANTENNA INPUT PARAMETERS ---------" ); m_output.nec_printf( "\n" " TAG SEG VOLTAGE (VOLTS) " "CURRENT (AMPS) IMPEDANCE (OHMS) " " ADMITTANCE (MHOS) POWER\n" " NO. NO. REAL IMAGINARY" " REAL IMAGINARY REAL " "IMAGINARY REAL IMAGINARY (WATTS)" ); */ for( i = 0; i < voltage_source_count; i++ ) { int segment_index = source_segment_array[i]-1; nec_complex voltage = source_voltage_array[i]; nec_complex current = einc[segment_index] * wavelength; bool add_as_network_loss = false; if( ntsc != 0) { int j = 0; for (j = 0; j < ntsc; j++ ) if (ntsca[j] == segment_index+1) break; int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; nec_complex temp = rhnx[row_index]; for (int k = 0; k < nteq; k++ ) temp -= cmn[k+row_offset]*rhnt[k]; current = (einc[segment_index] + temp) * wavelength; add_as_network_loss = true; } /* The following Code provided by Neoklis Kyriazis as a replacement for the broken code below. if( ntsc == 0) { cux= einc[isc1]* wlam; irow1=0; } else { for( j = 0; j < ntsc; j++ ) if( ntsca[j] == isc1+1) break; irow1= ndimn- (j+1); cux= rhnx[irow1]; for( j = 0; j < nteq; j++ ) cux -= cmn[j+irow1*ndimn]*rhnt[j]; cux=(einc[isc1]+ cux)* wlam; irow1++; } // if( ntsc == 0) // the following loop is completely mysterious! for (int j = 0; j < ntsc; j++ ) { // I am now almost sure that the following code is not correct. // This modifies the current, however if the inner loop is executed more // than once, then only the last current modification is kept! if ( ntsca[j] == segment_index+1) { int row_index = ndimn - (j+1); int row_offset = row_index*ndimn; // I wish I knew what was going on here... nec_complex temp = rhnx[row_index]; // renamed current -> temp to avoid confusion for (int k = 0; k < nteq; k++ ) temp -= cmn[k + row_offset]*rhnt[k]; current = (temp + einc[segment_index])* wavelength; add_as_network_loss = true; #warning "This loop is messed up. The j is inside another j loop" // I have removed the j from the "for (int k = 0; k < nteq; k++ )" loop // and placed this"j=nteq" statement here. j = nteq; } } */ nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); if ( add_as_network_loss ) network_power_loss += power; input_power += power; int segment_tag = m_geometry->segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); /* m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); */ } /* for( i = 0; i < voltage_source_count; i++ ) */ for( i = 0; i < nvqd; i++ ) { /* isc1= ivqd[i]-1; vlt= vqd[i]; cux= cmplx( air[isc1], aii[isc1]); ymit= cmplx( bir[isc1], bii[isc1]); zped= cmplx( cir[isc1], cii[isc1]); pwr= si[isc1]* TP*.5; cux=( cux- ymit* sin( pwr)+ zped* cos( pwr))* wlam; ymit= cux/ vlt; zped= vlt/ cux; pwr=.5* creal( vlt* conj( cux)); pin= pin+ pwr; irow2= itag[isc1]; fprintf( output_fp, "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", irow2, isc1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux), creal(zped), cimag(zped), creal(ymit), cimag(ymit), pwr ); */ int segment_index = ivqd[i]-1; nec_complex voltage = vqd[i]; nec_complex _ai( air[segment_index], aii[segment_index]); nec_complex _bi( bir[segment_index], bii[segment_index]); nec_complex _ci( cir[segment_index], cii[segment_index]); // segment length is measured in wavelengths. The phase is therefore the length in wavelengths // multiplied by pi().// TCAM CHANGED TO pi() (from TP*.5)!! nec_float segment_length_phase = m_geometry->segment_length[segment_index] * pi(); nec_complex current = (_ai - _bi* sin(segment_length_phase) + _ci * cos(segment_length_phase)) * wavelength; nec_complex admittance = current / voltage; nec_complex impedance = voltage / current; nec_float power = em::power(voltage,current); input_power += power; int segment_tag = m_geometry->segment_tags[segment_index]; antenna_input->set_input( segment_tag, segment_index+1, voltage, current, impedance, admittance, power); /* m_output.nec_printf( "\n" " %4d %5d %11.4E %11.4E %11.4E %11.4E" " %11.4E %11.4E %11.4E %11.4E %11.4E", segment_tag, segment_index+1, real(voltage), imag(voltage), real(current), imag(current), real(impedance), imag(impedance), real(admittance), imag(admittance), power ); */ } /* for( i = 0; i < nvqd; i++ ) */ std::stringstream ss; antenna_input->write_to_file(ss); m_output.line(ss.str().c_str()); } /*-----------------------------------------------------------------------*/ /* compute near e or h fields over a range of points */ void nec_context::nfpat( void ) { int i, j, kk; nec_float znrt, cth=0., sth=0., ynrt, cph=0., sph=0., xnrt, xob, yob; nec_float zob, tmp1, tmp2, tmp3; /* nec_float tmp4, tmp5, tmp6; */ nec_complex ex, ey, ez; /* The printing of near fields is now managed by a dedicated nec_base_result : nec_near_field_pattern*/ /* if ( nfeh != 1) { m_output.nec_printf( "\n\n\n" " " "-------- NEAR ELECTRIC FIELDS --------\n" " ------- LOCATION ------- ------- EX ------ ------- EY ------ ------- EZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS VOLTS/M DEGREES VOLTS/M DEGREES VOLTS/M DEGREES" ); } else { m_output.nec_printf( "\n\n\n" " " "-------- NEAR MAGNETIC FIELDS ---------\n\n" " ------- LOCATION ------- ------- HX ------ ------- HY ------ ------- HZ ------\n" " X Y Z MAGNITUDE PHASE MAGNITUDE PHASE MAGNITUDE PHASE\n" " METERS METERS METERS AMPS/M DEGREES AMPS/M DEGREES AMPS/M DEGREES" ); }*/ nec_near_field_pattern* nfp = new nec_near_field_pattern(nfeh); nfp->set_frequency(freq_mhz/(1.e-6)); m_results.add(nfp); znrt= znr- dznr; for( i = 0; i < nrz; i++ ) { znrt += dznr; if ( m_near != 0) { cth= cos( degrees_to_rad(znrt) ); sth= sin( degrees_to_rad(znrt) ); } ynrt= ynr- dynr; for( j = 0; j < nry; j++ ) { ynrt += dynr; if ( m_near != 0) { cph= cos( degrees_to_rad(ynrt) ); sph= sin( degrees_to_rad(ynrt) ); } xnrt= xnr- dxnr; for( kk = 0; kk < nrx; kk++ ) { xnrt += dxnr; if ( m_near != 0) { xob= xnrt* sth* cph; yob= xnrt* sth* sph; zob= xnrt* cth; } else { xob= xnrt; yob= ynrt; zob= znrt; } tmp1= xob/ wavelength; tmp2= yob/ wavelength; tmp3= zob/ wavelength; if ( nfeh != 1) nefld( tmp1, tmp2, tmp3, &ex, &ey, &ez); else nhfld( tmp1, tmp2, tmp3, &ex, &ey, &ez); /*no more used */ /* tmp1= abs( ex); tmp2= arg_degrees( ex); tmp3= abs( ey); tmp4= arg_degrees( ey); tmp5= abs( ez); tmp6= arg_degrees( ez); m_output.nec_printf( "\n" " %9.4f %9.4f %9.4f %11.4E %7.2f %11.4E %7.2f %11.4E %7.2f", xob, yob, zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 ); */ nfp->set_input(xob, yob, zob, ex, ey, ez); plot_card.plot_fields(ex, ey, ez, xob, yob, zob); } /* for( kk = 0; kk < nrx; kk++ ) */ } /* for( j = 0; j < nry; j++ ) */ } /* for( i = 0; i < nrz; i++ ) */ // write the results to the ordinary NEC output file. std::stringstream ss; nfp->write_to_file(ss); m_output.line(ss.str().c_str()); } /*-----------------------------------------------------------------------*/ /*!\brief Computes the near field at specified points in space after the structure currents have been computed. */ void nec_context::nhfld( nec_float xob, nec_float yob, nec_float zob, nec_complex *hx, nec_complex *hy, nec_complex *hz ) { *hx=cplx_00(); *hy=cplx_00(); *hz=cplx_00(); nec_float ax = 0.0; int n = m_geometry->n; for (int i = 0; i < n; i++ ) { xj= xob- m_geometry->x[i]; yj= yob- m_geometry->y[i]; zj= zob- m_geometry->z[i]; nec_float zp= m_geometry->cab[i]* xj+ m_geometry->sab[i]* yj+ m_geometry->salp[i]* zj; if ( fabs( zp) > 0.5001* m_geometry->segment_length[i]) continue; zp= xj* xj+ yj* yj+ zj* zj- zp* zp; xj= m_geometry->segment_radius[i]; if ( zp > 0.9* xj* xj) continue; ax = xj; break; } for (int i = 0; i < n; i++ ) { m_s = m_geometry->segment_length[i]; m_b = m_geometry->segment_radius[i]; xj= m_geometry->x[i]; yj= m_geometry->y[i]; zj= m_geometry->z[i]; cabj= m_geometry->cab[i]; sabj= m_geometry->sab[i]; salpj= m_geometry->salp[i]; hsfld( xob, yob, zob, ax); nec_complex acx= nec_complex( air[i], aii[i]); nec_complex bcx= nec_complex( bir[i], bii[i]); nec_complex ccx= nec_complex( cir[i], cii[i]); *hx += exk* acx+ exs* bcx+ exc* ccx; *hy += eyk* acx+ eys* bcx+ eyc* ccx; *hz += ezk* acx+ ezs* bcx+ ezc* ccx; } if ( m_geometry->m == 0) return; int jc= n-1; for (int i = 0; i < m_geometry->m; i++ ) { m_s = m_geometry->pbi[i]; xj= m_geometry->px[i]; yj= m_geometry->py[i]; zj= m_geometry->pz[i]; t1xj= m_geometry->t1x[i]; t1yj= m_geometry->t1y[i]; t1zj= m_geometry->t1z[i]; t2xj= m_geometry->t2x[i]; t2yj= m_geometry->t2y[i]; t2zj= m_geometry->t2z[i]; hintg( xob, yob, zob); jc += 3; nec_complex acx= t1xj* current_vector[jc-2] + t1yj* current_vector[jc-1] + t1zj* current_vector[jc]; nec_complex bcx= t2xj* current_vector[jc-2] + t2yj* current_vector[jc-1] + t2zj* current_vector[jc]; *hx= *hx+ acx* exk+ bcx* exs; *hy= *hy+ acx* eyk+ bcx* eys; *hz= *hz+ acx* ezk+ bcx* ezs; } } /*-----------------------------------------------------------------------*/ /**\brief Integrate over patches at wire connection point */ void nec_context::pcint( nec_float xi, nec_float yi, nec_float zi, nec_float cabi, nec_float sabi, nec_float salpi, complex_array& e) { nec_float d, ds, da, gcon, fcon, xxj, xyj, xzj, xs, s1; nec_float xss, yss, zss, s2x; int nint = 10; d = sqrt(m_s)*0.5; ds=4.* d/ (nec_float) nint; da= ds* ds; gcon=1./ m_s; fcon=1./(2.* two_pi() * d); xxj= xj; xyj= yj; xzj= zj; xs = m_s; m_s = da; s1= d+ ds*.5; xss= xj+ s1*( t1xj+ t2xj); yss= yj+ s1*( t1yj+ t2yj); zss= zj+ s1*( t1zj+ t2zj); s1= s1+ d; s2x= s1; nec_complex e1=cplx_00(); nec_complex e2=cplx_00(); nec_complex e3=cplx_00(); nec_complex e4=cplx_00(); nec_complex e5=cplx_00(); nec_complex e6=cplx_00(); nec_complex e7=cplx_00(); nec_complex e8=cplx_00(); nec_complex e9=cplx_00(); for (int i1 = 0; i1 < nint; i1++ ) { s1= s1- ds; nec_float s2 = s2x; xss= xss- ds* t1xj; yss= yss- ds* t1yj; zss= zss- ds* t1zj; xj= xss; yj= yss; zj= zss; for(int i2 = 0; i2 < nint; i2++ ) { s2= s2- ds; xj= xj- ds* t2xj; yj= yj- ds* t2yj; zj= zj- ds* t2zj; unere( xi, yi, zi, false); exk= exk* cabi+ eyk* sabi+ ezk* salpi; exs= exs* cabi+ eys* sabi+ ezs* salpi; nec_float g1 = (d + s1)*(d + s2)*gcon; nec_float g2 = (d - s1)*(d + s2)*gcon; nec_float g3 = (d - s1)*(d - s2)*gcon; nec_float g4 = (d + s1)*(d - s2)*gcon; nec_float f2 = (s1*s1 + s2*s2) * two_pi(); nec_float f1= s1/f2 - (g1 - g2 - g3 + g4)*fcon; f2 = s2/f2 - (g1 + g2 - g3 - g4)*fcon; e1 += exk* g1; e2 += exk* g2; e3 += exk* g3; e4 += exk* g4; e5 += exs* g1; e6 += exs* g2; e7 += exs* g3; e8 += exs* g4; e9 += exk* f1+ exs*f2; } } /* for( i1 = 0; i1 < nint; i1++ ) */ e[0]= e1; e[1]= e2; e[2]= e3; e[3]= e4; e[4]= e5; e[5]= e6; e[6]= e7; e[7]= e8; e[8]= e9; xj= xxj; yj= xyj; zj= xzj; m_s= xs; } /*-----------------------------------------------------------------------*/ /* impedance_print sets up the print formats for impedance loading */ void nec_context::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, const char *ia) { /* record to be output and buffer used to make it */ std::string record; char buf[15]; int in[3], i1, i; nec_float fl[6]; in[0]= in1; in[1]= in2; in[2]= in3; fl[0]= fl1; fl[1]= fl2; fl[2]= fl3; fl[3]= fl4; fl[4]= fl5; fl[5]= fl6; /* integer format */ i1=0; record = "\n "; if ( (in1 == 0) && (in2 == 0) && (in3 == 0) ) { record += " ALL"; i1=1; } for( i = i1; i < 3; i++ ) { if ( in[i] == 0) record += " "; else { sprintf( buf, "%5d", in[i] ); record += buf; } } /* floating point format */ for( i = 0; i < 6; i++ ) { if ( fabs( fl[i]) >= 1.0e-20 ) { sprintf( buf, " %11.4E", fl[i] ); record += buf; } else record += " "; } record += " "; record += ia; m_output.string(record.c_str() ); } /*-----------------------------------------------------------------------*/ /* fill incident field array for charge discontinuity voltage source */ void nec_context::qdsrc( int is, nec_complex v, complex_array& e ) { static nec_complex s_CCJ(0.0,-0.01666666667); int i, jx, j, jp1, ipr, i1; nec_float xi, yi, zi, ai, cabi, sabi, salpi, tx, ty, tz; nec_complex curd, etk, ets, etc; is--; i= m_geometry->icon1[is]; m_geometry->icon1[is]=0; m_geometry->tbf( is+1,0); m_geometry->icon1[is]= i; m_s = m_geometry->segment_length[is]*.5; curd= s_CCJ * v/(( log(2.* m_s/ m_geometry->segment_radius[is])-1.)*( m_geometry->bx[m_geometry->jsno-1]* cos( two_pi() * m_s)+ m_geometry->cx[m_geometry->jsno-1]* sin( two_pi() * m_s))* wavelength); vqds[nqds]= v; iqds[nqds]= is+1; nqds++; for( jx = 0; jx < m_geometry->jsno; jx++ ) { j= m_geometry->jco[jx]-1; jp1 = j+1; m_s= m_geometry->segment_length[j]; m_b= m_geometry->segment_radius[j]; xj= m_geometry->x[j]; yj= m_geometry->y[j]; zj= m_geometry->z[j]; cabj= m_geometry->cab[j]; sabj= m_geometry->sab[j]; salpj= m_geometry->salp[j]; if ( m_use_exk == true) { ipr= m_geometry->icon1[j]; if (ipr > PCHCON) ind1=2; else if ( ipr < 0 ) { ipr=- ipr; ipr--; if ( -m_geometry->icon1[ipr-1] != jp1 ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind1=1; else /* ipr > 0 */ { ipr--; if ( ipr != j ) { if ( m_geometry->icon2[ipr] != jp1) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr != j ) */ else { if ( (cabj* cabj+ sabj* sabj) > 1.0e-8) ind1=2; else ind1=0; } } /* else */ ipr= m_geometry->icon2[j]; if (ipr > PCHCON) ind2=2; else if ( ipr < 0 ) { ipr = -ipr; ipr--; if ( -m_geometry->icon2[ipr] != jp1 ) ind1=2; else { ind1 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind1); } } /* if ( ipr < 0 ) */ else if ( ipr == 0 ) ind2=1; else /* ipr > 0 */ { ipr--; if ( ipr != j ) { if ( m_geometry->icon1[ipr] != jp1) ind2=2; else { ind2 = m_geometry->test_ek_approximation(j,ipr); int ind_test; xi= fabs( cabj* m_geometry->cab[ipr]+ sabj* m_geometry->sab[ipr]+ salpj* m_geometry->salp[ipr]); if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[ipr]/m_b-1.) > 1.0e-6) ) ind_test=2; else ind_test=0; ASSERT(ind_test == ind2); } } /* if ( ipr != j )*/ else { if ( (cabj* cabj+ sabj* sabj) > 1.0e-8) ind1=2; else ind1=0; } } /* else */ } /* if ( m_use_exk == true) */ int n = m_geometry->n; for( i = 0; i < n; i++ ) { xi= m_geometry->x[i]; yi= m_geometry->y[i]; zi= m_geometry->z[i]; ai= m_geometry->segment_radius[i]; efld( xi, yi, zi, ai, (i != j)); cabi= m_geometry->cab[i]; sabi= m_geometry->sab[i]; salpi= m_geometry->salp[i]; etk= exk* cabi+ eyk* sabi+ ezk* salpi; ets= exs* cabi+ eys* sabi+ ezs* salpi; etc= exc* cabi+ eyc* sabi+ ezc* salpi; e[i]= e[i]-( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx])* curd; } int m = m_geometry->m; if ( m != 0) { i1= n-1; for( i = 0; i < m; i++ ) { xi= m_geometry->px[i]; yi= m_geometry->py[i]; zi= m_geometry->pz[i]; hsfld( xi, yi, zi,0.); i1++; tx= m_geometry->t2x[i]; ty= m_geometry->t2y[i]; tz= m_geometry->t2z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx] )* curd* m_geometry->psalp[i]; i1++; tx= m_geometry->t1x[i]; ty= m_geometry->t1y[i]; tz= m_geometry->t1z[i]; etk= exk* tx+ eyk* ty+ ezk* tz; ets= exs* tx+ eys* ty+ ezs* tz; etc= exc* tx+ eyc* ty+ ezc* tz; e[i1] += ( etk* m_geometry->ax[jx]+ ets* m_geometry->bx[jx]+ etc* m_geometry->cx[jx])* curd* m_geometry->psalp[i]; } } /* if ( m != 0) */ if ( nload > 0 ) e[j] += zarray[j]* curd*(m_geometry->ax[jx]+ m_geometry->cx[jx]); } /* for( jx = 0; jx < m_geometry->jsno; jx++ ) */ } /*-----------------------------------------------------------------------*/ #if 1 /* Results: (epsilon = 81) cond --------- NEC-4D ------------- ------------- NEC-2D ----------- S/m Rin Xin Avg. Gain Rin Xin Avg. Gain 0.001 7.69123E+01 1.26695E+02 0.160 7.90906E+01 1.29476E+02 0.155 0.003 7.21069E+01 1.25749E+02 0.167 7.38409E+01 1.28334E+02 0.162 0.01 6.06862E+01 1.19449E+02 0.218 6.02083E+01 1.22146E+02 0.202 0.03 4.92272E+01 1.02255E+02 0.289 4.36457E+01 1.07793E+02 0.323 0.1 4.10716E+01 7.86277E+01 0.409 2.84842E+01 9.36058E+01 0.583 0.3 2.78348E+01 6.67538E+01 0.664 1.96676E+01 8.87374E+01 0.929 1.0 -4.87995E+00 1.01535E+02 -4.060 1.59479E+01 8.70547E+01 1.218 5.0 -4.21415E+01 3.45929E+02 -0.492 .42931E+01 8.59620E+01 1.472 */ void nec_context::rom2( nec_float a, nec_float b, complex_array& sum, nec_float dmin ) { /* Z=A ZE=B S=B-A IF (S.GE.0.) GO TO 1 WRITE(3,18) STOP */ int nts = 4, nx = 1; const int n = 9; nec_float rx = 1e-4; nec_float dz = 0.0; nec_float dzot= dz*.5; nec_float _z = a; nec_float ze = b; nec_float _s = b - a; if ( _s < 0.0) { throw new nec_exception("ERROR - B LESS THAN A IN ROM2"); } /* 1 EP=S/(1.E4*NM) ZEND=ZE-EP DO 2 I=1,N 2 SUM(I)=(0.,0.) NS=NX NT=0 CALL SFLDS (Z,G1) */ complex_array g1(9), g2(9), g3(9), g4(9), g5(9); complex_array t01(9), t10(9), t20(9), t11(9); /*! tolerance for hitting upper limit */ const nec_float ep = _s/(1.0e4 * m_geometry->n_plus_m); /*! upper limit */ const nec_float zend = ze - ep; sum.fill(0,n,cplx_00()); int ns = nx; /*! counter to control increasing subinterval size */ int nt = 0; sflds( _z, g1); /* 3 DZ=S/NS IF (Z+DZ.LE.ZE) GO TO 4 DZ=ZE-Z IF (DZ.LE.EP) GO TO 17 4 DZOT=DZ*.5 CALL SFLDS (Z+DZOT,G3) CALL SFLDS (Z+DZ,G5) */ loop3: dz = _s / ns; if ( _z + dz >= ze) { dz = ze - _z; if ( dz <= ep) return; } dzot= dz*.5; sflds( _z + dzot, g3); sflds( _z + dz, g5); /* 5 TMAG1=0. TMAG2=0. C C EVALUATE 3 POINT ROMBERG RESULT AND TEST CONVERGENCE. C DO 6 I=1,N T00=(G1(I)+G5(I))*DZOT T01(I)=(T00+DZ*G3(I))*.5 T10(I)=(4.*T01(I)-T00)/3. IF (I.GT.3) GO TO 6 TR=DREAL(T01(I)) TI=DIMAG(T01(I)) TMAG1=TMAG1+TR*TR+TI*TI TR=DREAL(T10(I)) TI=DIMAG(T10(I)) TMAG2=TMAG2+TR*TR+TI*TI 6 CONTINUE */ loop5: for (int i=0;i zend) return; for (int i = 0; i < n; i++ ) g1[i] = g5[i]; if ( (nt >= nts) && (ns > nx) ) { /* Double step size */ ns = ns/2; nt = 1; } goto loop3; } /* 14 NT=0 IF (NS.LT.NM) GO TO 15 WRITE(3,19) Z GO TO 10 15 NS=NS*2 DZ=S/NS DZOT=DZ*.5 DO 16 I=1,N G5(I)=G3(I) 16 G3(I)=G2(I) GO TO 5 */ nt=0; if ( ns >= m_geometry->n_plus_m ) { nec_error_mode em(m_output); m_output.string("ROM2 -- STEP SIZE LIMITED AT Z = "); m_output.real_out(12,5,_z); m_output.endl(); goto loop10; } ns = ns*2; dz = _s/ ns; dzot = dz*.5; for (int i = 0; i < n; i++ ) { g5[i] = g3[i]; g3[i] = g2[i]; } goto loop5; } /* 17 CONTINUE RETURN C 18 FORMAT (30H ERROR - B LESS THAN A IN ROM2) 19 FORMAT (33H ROM2 -- STEP SIZE LIMITED AT Z =,1P,E12.5) END */ #else /*! For the Sommerfeld ground option, rom2 integrates over the source segment to obtain the total field due to ground. The method of variable interval width Romberg integration is used. There are 9 field components - the x, y, and z components due to constant, sine, and cosine current distributions. \param a lower limit of integral \param b upper limit of integral \param dmin Set in EFLD to 1% of the magnitude of the electric field */ void nec_context::rom2( nec_float a, nec_float b, complex_array& sum, nec_float dmin ) { ASSERT(sum.size() == 9); bool recalculate_fields = true; static bool step_warning_issued = false; int nts = 4, nx = 1, n = 9; /*! subinterval size */ nec_float dz=0.0; /*! dz divided by 2.0 */ nec_float dzot=0.0; /*! relative error limit */ nec_float rx = 1.0e-8; complex_array g1(9), g2(9), g3(9), g4(9), g5(9); complex_array t01(9), t10(9), t20(9); nec_float _z = a; const nec_float ze = b; const nec_float _s = b - a; if ( _s < 0.0) { throw new nec_exception("ERROR - B LESS THAN A IN ROM2"); } /*! tolerance for hitting upper limit */ const nec_float ep = _s/(1.0e4 * m_geometry->n_plus_m); /*! upper limit */ const nec_float zend = ze - ep; sum.fill(0,n,cplx_00()); int ns = nx; /*! counter to control increasing subinterval size */ int nt = 0; sflds( _z, g1); while ( true ) { if ( recalculate_fields ) { // Now we do the same housekeeping before looping back _z = _z + dz; if ( _z > zend) return; for (int i = 0; i < n; i++ ) g1[i] = g5[i]; if ( (nt >= nts) && (ns > nx) ) { /* Double step size */ ns = ns/2; nt = 1; } dz = _s / ns; if ( _z + dz >= ze) { dz = ze - _z; if ( dz <= ep) return; } dzot= dz*.5; sflds( _z + dzot, g3); sflds( _z + dz, g5); } // Evaluate 3-point Romberg result and test convergence. for (int i = 0; i < n; i++ ) { nec_complex t00 = (g1[i]+ g5[i]) * dzot; t01[i] = (t00 + dz * g3[i]) * 0.5; t10[i] = (4.0 * t01[i] - t00)/3.; } nec_float tmag1 = sqrt( norm(t01[0]) + norm(t01[1]) + norm(t01[2]) ); nec_float tmag2 = sqrt( norm(t10[0]) + norm(t10[1]) + norm(t10[2]) ); nec_float tr = test_simple( tmag1, tmag2, dmin); if ( tr <= rx) { nt += 2; for (int i = 0; i < n; i++ ) sum[i] += t10[i]; recalculate_fields = true; continue; } /* if ( tr <= rx) */ sflds( _z+ dz*.25, g2); sflds( _z+ dz*.75, g4); tmag1 = 0.0; tmag2 = 0.0; /* Evaluate 5 point Romberg result and test convergence. */ for (int i = 0; i < n; i++ ) { nec_complex t02 = (t01[i]+ dzot*( g2[i]+ g4[i]))*0.5; nec_complex t11 = (4.0 * t02- t01[i] )/3.0; t20[i] = (16.* t11- t10[i])/15.0; if (i <= 2) { tmag1 += norm(t11); tmag2 += norm(t20[i]); } } tmag1 = sqrt(tmag1); tmag2 = sqrt(tmag2); tr = test_simple( tmag1, tmag2, dmin); if ( tr > rx) { nt=0; if ( ns <= m_geometry->n_plus_m ) { // halve step size ns = ns*2; dz = _s/ ns; dzot = dz*.5; for (int i = 0; i < n; i++ ) { g5[i] = g3[i]; g3[i] = g2[i]; } recalculate_fields=false; continue; } nec_error_mode em(m_output); m_output.string("ROM2 -- STEP SIZE LIMITED AT Z = "); m_output.real_out(12,5,_z); m_output.endl(); if (false == step_warning_issued) { m_output.line("About the above warning:"); m_output.line("Probably caused by a wire too close to the ground in the Somerfeld/"); m_output.line("Norton ground method. Execution continues but results may be inaccurate."); step_warning_issued = true; } } /* if ( tr <= rx) */ nt = nt+1; for (int i = 0; i < n; i++ ) sum[i] += t20[i]; recalculate_fields = true; } /* while( true ) */ } #endif /*-----------------------------------------------------------------------*/ /* sflds returns the field due to ground for a current element on the source segment at t relative to the segment center. */ void nec_context::sflds(const nec_float t, complex_array& e ) { static nec_complex __const1(0.0,4.771341189); nec_float xt, yt, zt, rhx, rhy, rhs, rho, phx, phy; nec_float cph, sph, zphs, r2s, rk, sfac, thet; nec_complex erv, ezv, erh, ezh, eph; xt= xj + t* cabj; yt= yj + t* sabj; zt= zj + t* salpj; rhx= xo- xt; rhy= yo- yt; rhs= rhx* rhx+ rhy* rhy; rho= sqrt( rhs); if ( rho <= 0.0) { rhx=1.0; rhy=0.0; phx=0.0; phy=1.0; } else { rhx= rhx/ rho; rhy= rhy/ rho; phx= -rhy; phy= rhx; } cph= rhx* xsn+ rhy* ysn; sph= rhy* xsn- rhx* ysn; if ( fabs( cph) < 1.0e-10) cph=0.0; if ( fabs( sph) < 1.0e-10) sph=0.0; ground_wave.zph = zo+ zt; zphs= ground_wave.zph* ground_wave.zph; r2s= rhs+ zphs; ground_wave.r2= sqrt( r2s); rk= ground_wave.r2* two_pi(); ground_wave.xx2 = nec_complex( cos( rk),-sin( rk)); /* Use Norton approximation for field due to ground. Current is lumped at segment center with current moment for constant, sine, or cosine distribution. */ if ( isnor != 1) { ground_wave.zmh=1.0; ground_wave.r1=1.; ground_wave.xx1=0.; gwave(erv, ezv, erh, ezh, eph, ground_wave); nec_complex et = -__const1 * ground.frati* ground_wave.xx2/( r2s* ground_wave.r2); nec_complex er = 2.* et* nec_complex(1.0, rk); et= et* nec_complex(1.0 - rk* rk, rk); nec_complex hrv = ( er+ et)* rho* ground_wave.zph/ r2s; nec_complex hzv = ( zphs* er- rhs* et)/ r2s; nec_complex hrh = ( rhs* er- zphs* et)/ r2s; erv= erv- hrv; ezv= ezv- hzv; erh= erh+ hrh; ezh= ezh+ hrv; eph= eph+ et; erv= erv* salpj; ezv= ezv* salpj; erh= erh* sn* cph; ezh= ezh* sn* cph; eph= eph* sn* sph; erh= erv+ erh; e[0]=( erh* rhx+ eph* phx)* m_s; e[1]=( erh* rhy+ eph* phy)* m_s; e[2]=( ezv+ ezh)* m_s; e[3]=0.; e[4]=0.; e[5]=0.; sfac= pi()* m_s; sfac= sin( sfac)/ sfac; e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; return; } /* if ( isnor != 1) */ /* Interpolate in Sommerfeld field tables */ if ( rho >= 1.0e-12) thet= atan( ground_wave.zph/ rho); else thet= pi_two(); /* Combine vertical and horizontal components and convert to x,y,z components. multiply by exp(-jkr)/r. */ ggrid.interpolate( ground_wave.r2, thet, &erv, &ezv, &erh, &eph ); ground_wave.xx2= ground_wave.xx2 / ground_wave.r2; sfac= sn* cph; erh= ground_wave.xx2*( salpj* erv+ sfac* erh); ezh= ground_wave.xx2*( salpj* ezv- sfac* erv); /* x,y,z fields for constant current */ eph= sn* sph* ground_wave.xx2* eph; e[0]= erh* rhx+ eph* phx; e[1]= erh* rhy+ eph* phy; e[2]= ezh; /* x,y,z fields for sine current */ rk= two_pi() * t; sfac= sin( rk); e[3]= e[0]* sfac; e[4]= e[1]* sfac; e[5]= e[2]* sfac; /* x,y,z fields for cosine current */ sfac= cos( rk); e[6]= e[0]* sfac; e[7]= e[1]* sfac; e[8]= e[2]* sfac; } /*-----------------------------------------------------------------------*/ /*!\brief Calculates the electric field due to unit current in the t1 and t2 directions on a patch \param ground_reflection If true, then calculate the field reflected from the ground. (was ipgnd == 2) */ void nec_context::unere( nec_float xob, nec_float yob, nec_float zob, bool ground_reflection ) { nec_float px, py, cth; nec_complex rrv, rrh, edp; nec_float zr = zj; nec_float t1zr = t1zj; nec_float t2zr = t2zj; if ( ground_reflection) { zr =- zr; t1zr = -t1zr; t2zr = -t2zr; } nec_float rx = xob- xj; nec_float ry = yob- yj; nec_float rz = zob- zr; nec_float r2 = rx*rx + ry*ry + rz*rz; if ( r2 <= 1.0e-20) { exk=cplx_00(); eyk=cplx_00(); ezk=cplx_00(); exs=cplx_00(); eys=cplx_00(); ezs=cplx_00(); return; } nec_float r = sqrt(r2); nec_float tt1 = -two_pi() * r; nec_float tt2 = tt1 * tt1; nec_float rt = r2*r; nec_complex er = nec_complex( sin(tt1),-cos(tt1))*( CONST2* m_s); nec_complex q1= nec_complex(tt2 - 1.0, tt1)* er/ rt; nec_complex q2= nec_complex(3.0- tt2,-3.0*tt1)* er/( rt* r2); er = q2*( t1xj* rx+ t1yj* ry+ t1zr* rz); exk= q1* t1xj+ er* rx; eyk= q1* t1yj+ er* ry; ezk= q1* t1zr+ er* rz; er= q2*( t2xj* rx+ t2yj* ry+ t2zr* rz); exs= q1* t2xj+ er* rx; eys= q1* t2yj+ er* ry; ezs= q1* t2zr+ er* rz; if ( !ground_reflection) return; // handle the ground_reflection if ( ground.type_perfect() ) // (ground.iperf == 1) { exk=- exk; eyk=- eyk; ezk=- ezk; exs=- exs; eys=- eys; ezs=- ezs; return; } nec_float xymag = sqrt(rx*rx + ry*ry); if ( xymag <= 1.0e-6) { px=0.; py=0.; cth=1.; rrv=cplx_10(); } else { px=- ry/ xymag; py= rx/ xymag; cth= rz/ sqrt( xymag* xymag+ rz* rz); rrv= sqrt(1.0- ground.get_zrati_sqr() * (1.0 - cth*cth)); } rrh= ground.zrati* cth; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati* rrv; rrv=-( cth- rrv)/( cth+ rrv); edp=( exk* px+ eyk* py)*( rrh- rrv); exk= exk* rrv+ edp* px; eyk= eyk* rrv+ edp* py; ezk= ezk* rrv; edp=( exs* px+ eys* py)*( rrh- rrv); exs= exs* rrv+ edp* px; eys= eys* rrv+ edp* py; ezs= ezs* rrv; } /*-----------------------------------------------------------------------*/ /* zint computes the internal impedance of a circular wire */ nec_complex zint_old( nec_float sigl, nec_float rolam ); nec_complex zint_old( nec_float sigl, nec_float rolam ) { #define cc1 nec_complex( 6.0e-7, + 1.9e-6) #define cc2 nec_complex(-3.4e-6, + 5.1e-6) #define cc3 nec_complex(-2.52e-5, + 0.0) #define cc4 nec_complex(-9.06e-5 , - 9.01e-5) #define cc5 nec_complex( 0., - 9.765e-4) #define cc6 nec_complex(.0110486, - .0110485) #define cc7 nec_complex( 0., - .3926991) #define cc8 nec_complex( 1.6e-6, - 3.2e-6) #define cc9 nec_complex( 1.17e-5, - 2.4e-6) #define cc10 nec_complex( 3.46e-5, + 3.38e-5) #define cc11 nec_complex( 5.0e-7, + 2.452e-4) #define cc12 nec_complex(-1.3813e-3, + 1.3811e-3) #define cc13 nec_complex(-6.25001e-2, - 1.0e-7) #define cc14 nec_complex(.7071068, + .7071068) #define cn cc14 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 ) #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 ) #define f(d) ( sqrt(pi_two()/(d))*exp(-cn*(d)+th(-8./x)) ) #define g(d) ( exp(cn*(d)+th(8./x))/sqrt(two_pi()*(d)) ) nec_complex br1, br2, zint; nec_float x, y, s, ber, bei; nec_float tpcmu = 2.368705e+3; nec_float cmotp = 60.00; x= sqrt( tpcmu* sigl)* rolam; if ( x <= 110.) { if ( x <= 8.) { y= x/8.; y= y* y; s= y* y; ber=((((((-9.01e-6* s+1.22552e-3)* s-.08349609)* s+ 2.6419140)* s-32.363456)* s+113.77778)* s-64.)* s+1.; bei=((((((1.1346e-4* s-.01103667)* s+.52185615)* s-10.567658)* s+72.817777)* s-113.77778)* s+16.)* y; br1= nec_complex( ber, bei); ber=(((((((-3.94e-6* s+4.5957e-4)* s-.02609253)* s+ .66047849)* s-6.0681481)* s+14.222222)* s-4.)* y)* x; bei=((((((4.609e-5* s-3.79386e-3)* s+.14677204)* s- 2.3116751)* s+11.377778)* s-10.666667)* s+.5)* x; br2= nec_complex( ber, bei); br1= br1/ br2; zint= cplx_01()* sqrt( cmotp/sigl )* br1/ rolam; return( zint ); } // if ( x <= 8.) br2= cplx_01()* f(x)/ pi(); br1= g( x)+ br2; br2= g( x)* ph(8./ x)- br2* ph(-8./ x); br1= br1/ br2; zint= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; return( zint ); } // if ( x <= 110.) br1= nec_complex(.70710678,-.70710678); zint= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; return( zint ); } /* zint computes the internal impedance of a circular wire */ nec_complex nec_context::zint( nec_float sigl, nec_float rolam ) { #define cc1 nec_complex( 6.0e-7, + 1.9e-6) #define cc2 nec_complex(-3.4e-6, + 5.1e-6) #define cc3 nec_complex(-2.52e-5, + 0.0) #define cc4 nec_complex(-9.06e-5 , - 9.01e-5) #define cc5 nec_complex( 0., - 9.765e-4) #define cc6 nec_complex(.0110486, - .0110485) #define cc7 nec_complex( 0., - .3926991) #define cc8 nec_complex( 1.6e-6, - 3.2e-6) #define cc9 nec_complex( 1.17e-5, - 2.4e-6) #define cc10 nec_complex( 3.46e-5, + 3.38e-5) #define cc11 nec_complex( 5.0e-7, + 2.452e-4) #define cc12 nec_complex(-1.3813e-3, + 1.3811e-3) #define cc13 nec_complex(-6.25001e-2, - 1.0e-7) #define cc14 nec_complex(.7071068, + .7071068) #define cn cc14 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 ) #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 ) #define f(d) ( sqrt(pi_two()/(d))*exp(-cn*(d)+th(-8./x)) ) #define g(d) ( exp(cn*(d)+th(8./x))/sqrt(two_pi()*(d)) ) static nec_float tpcmu = 2.368705e+3; static nec_float cmotp = 60.00; nec_float x = sqrt(tpcmu * sigl) * rolam; // if x is zero, then we have a zero radius! ASSERT(x != 0.0); if (x > 110.0) { nec_complex br1 = nec_complex(0.70710678, -0.70710678); nec_complex ret= cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } if (x > 8.0) { nec_complex br2 = cplx_01()* f(x)/ pi(); nec_complex temp_gx = g(x); nec_complex br1 = temp_gx + br2; br2 = temp_gx * ph(8.0/x) - br2 * ph(-8.0/x); br1 = br1/ br2; nec_complex ret = cplx_01()* sqrt( cmotp/ sigl)* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } nec_float x8 = x / 8.0; nec_float y = x8*x8; nec_float s = y*y; nec_float ber=((((((-9.01e-6* s+1.22552e-3)* s-.08349609)* s+ 2.6419140)* s-32.363456)* s+113.77778)* s-64.)* s+1.; nec_float bei=((((((1.1346e-4* s-.01103667)* s+.52185615)* s-10.567658)* s+72.817777)* s-113.77778)* s+16.)* y; nec_complex br1= nec_complex( ber, bei); ber=(((((((-3.94e-6*s + 4.5957e-4)*s - 0.02609253)*s + 0.66047849)* s - 6.0681481)*s + 14.222222)*s - 4.0)* y)* x; bei=((((((4.609e-5* s-3.79386e-3)* s+.14677204)* s- 2.3116751)* s+11.377778)* s-10.666667)* s+.5)* x; nec_complex br2= nec_complex( ber, bei); br1= br1/ br2; nec_complex ret = cplx_01()* sqrt( cmotp/sigl )* br1/ rolam; ASSERT(ret == zint_old(sigl, rolam)); return ret; } /* fblock( np + 2 mp, n+2m, m_geometry->n_plus_2m * (m_geometry->np+2*m_geometry->mp), m_geometry->m_ipsym) */ /* fblock sets parameters for out-of-core */ /* solution for the primary matrix (a) */ void nec_context::fblock( int nrow, int ncol, int imax, int ipsym ) { int ka, kk; if ( (nrow*ncol) <= imax) { npblk= nrow; nlast= nrow; imat= nrow* ncol; if ( nrow == ncol) { icase=1; return; } else icase=2; } /* if ( nrow*ncol <= imax) */ if ( (nop*nrow) != ncol) { nec_stop("SYMMETRY ERROR - NROW: %d NCOL: %d", nrow, ncol ); } /* set up symmetry_array matrix for rotational symmetry. */ if ( ipsym <= 0) { nec_float phaz = two_pi()/nop; for(int i = 1; i < nop; i++ ) { for(int j= i; j < nop; j++ ) { nec_float arg = phaz * (nec_float)i * (nec_float)j; symmetry_array[i+j*nop]= nec_complex( cos( arg), sin( arg)); symmetry_array[j+i*nop]= symmetry_array[i+j*nop]; } } return; } /* if ( ipsym <= 0) */ /* set up symmetry_array matrix for plane symmetry */ kk=1; symmetry_array[0]=cplx_10(); int k_power = 2; for( ka = 1; k_power != nop; ka++ ) k_power *= 2; for(int k = 0; k < ka; k++ ) { for(int i = 0; i < kk; i++ ) { for(int j = 0; j < kk; j++ ) { nec_complex deter = symmetry_array[i+j*nop]; symmetry_array[i+(j+kk)*nop] = deter; symmetry_array[i+kk+(j+kk)*nop] =- deter; symmetry_array[i+kk+j*nop] = deter; } } kk *= 2; } /* for( k = 0; k < ka; k++ ) */ } /*! \brief gfld computes the radiated field including ground wave. \param space_only Compute only the space wave (was ksymp == 1) */ 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 ) { int i, k; nec_float b, r, thet, arg, phx, phy, rx, ry, dx, dy, dz, rix, riy, rhs, rhp; nec_float rhx, rhy, calp, cbet, sbet, cph, sph, el, rfl, riz, thx, thy, thz; nec_float rxyz, rnx, rny, rnz, omega, sill, top, bot, a, too, boo, c, rr, ri; nec_complex cix, ciy, ciz, exa, erv; nec_complex ezv, erh, eph, ezh, ex, ey; r= sqrt( rho*rho+ rz*rz ); if ( (space_only) || (abs(ground.zrati) > .5) || (r > 1.e5) ) { /* computation of space wave only */ if ( rz >= 1.0e-20) thet= atan( rho/ rz); else thet= pi()*.5; ffld(thet, phi, eth, epi, _wavelength); arg= -two_pi() * r; exa= nec_complex( cos( arg), sin( arg))/ r; *eth= *eth* exa; *epi= *epi* exa; *erd=cplx_00(); return; } /* if ( (space_only) && (abs(gound.zrati) > .5) && (r > 1.e5) ) */ /* computation of space and ground waves. */ ground_wave.set_u(ground.zrati); phx=- sin( phi); phy= cos( phi); rx= rho* phy; ry=- rho* phx; cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); /* summation of field from individual segments */ for( i = 0; i < m_geometry->n; i++ ) { dx= m_geometry->cab[i]; dy= m_geometry->sab[i]; dz= m_geometry->salp[i]; rix= rx- m_geometry->x[i]; riy= ry- m_geometry->y[i]; rhs= rix* rix+ riy* riy; rhp= sqrt( rhs); if ( rhp >= 1.0e-6) { rhx= rix/ rhp; rhy= riy/ rhp; } else { rhx=1.; rhy=0.; } calp=1.- dz* dz; if ( calp >= 1.0e-6) { calp= sqrt( calp); cbet= dx/ calp; sbet= dy/ calp; cph= rhx* cbet+ rhy* sbet; sph= rhy* cbet- rhx* sbet; } else { cph= rhx; sph= rhy; } el= pi()* m_geometry->segment_length[i]; rfl=-1.; /* Integration of (current)*(phase factor) over segment and image for constant, sine, and cosine current distributions */ for( k = 0; k < 2; k++ ) { rfl=- rfl; riz= rz- m_geometry->z[i]* rfl; rxyz= sqrt( rix* rix+ riy* riy+ riz* riz); rnx= rix/ rxyz; rny= riy/ rxyz; rnz= riz/ rxyz; omega=-( rnx* dx+ rny* dy+ rnz* dz* rfl); sill= omega* el; top= el+ sill; bot= el- sill; if ( fabs( omega) >= 1.0e-7) a=2.* sin( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if ( fabs( top) >= 1.0e-7) too= sin( top)/ top; else too=1.- top* top/6.; if ( fabs( bot) >= 1.0e-7) boo= sin( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= two_pi()*( m_geometry->x[i]* rnx+ m_geometry->y[i]* rny+ m_geometry->z[i]* rnz* rfl); exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri)/two_pi(); if ( k != 1 ) { ground_wave.xx1= exa; ground_wave.r1= rxyz; ground_wave.zmh= riz; continue; } ground_wave.xx2 = exa; ground_wave.r2= rxyz; ground_wave.zph= riz; } /* for( k = 0; k < 2; k++ ) */ /* call subroutine to compute the field */ /* of segment including ground wave. */ gwave(erv, ezv, erh, ezh, eph, ground_wave); erh= erh* cph* calp+ erv* dz; eph= eph* sph* calp; ezh= ezh* cph* calp+ ezv* dz; ex= erh* rhx- eph* rhy; ey= erh* rhy+ eph* rhx; cix= cix+ ex; ciy= ciy+ ey; ciz= ciz+ ezh; } /* for( i = 0; i < n; i++ ) */ arg= -two_pi() * r; exa= nec_complex( cos( arg), sin( arg)); cix= cix* exa; ciy= ciy* exa; ciz= ciz* exa; rnx= rx/ r; rny= ry/ r; rnz= rz/ r; thx= rnz* phy; thy=- rnz* phx; thz=- rho/ r; *eth= cix* thx+ ciy* thy+ ciz* thz; *epi= cix* phx+ ciy* phy; *erd= cix* rnx+ ciy* rny+ ciz* rnz; } /* ffld calculates the far zone radiated electric fields, */ /* the factor exp(j*k*r)/(r/lamda) not included */ void nec_context::ffld(nec_float thet, nec_float phi, nec_complex *eth, nec_complex *eph, nec_float _wavelength ) { static nec_complex CONST3(0.0, -em::impedance() / four_pi()); // -29.97922085; int k, i; bool jump; nec_float phx, phy, roz, rozs, thx, thy, thz, rox, roy; nec_float tthet=0., darg=0., omega, el, sill, top, bot, a; nec_float too, boo, b, c, d, rr, ri, arg, dr; nec_complex cix, ciy, ciz, exa, ccx, ccy, ccz, cdp; nec_complex zrsin, rrv, rrh, rrv1, rrh1, rrv2, rrh2; nec_complex tix, tiy, tiz, zscrn, ex, ey, ez; phx=- sin( phi); phy= cos( phi); roz= cos( thet); rozs= roz; thx= roz* phy; thy=- roz* phx; thz=- sin( thet); rox=- thz* phy; roy= thz* phx; jump = false; if ( m_geometry->n != 0) { /* loop for structure image if any */ /* calculation of reflection coeffecients */ for( k = 0; k < ground.ksymp; k++ ) { if ( k != 0 ) { /* for perfect ground */ if (ground.type_perfect()) { rrv=-cplx_10(); rrh=-cplx_10(); } else { /* for infinite planar ground */ zrsin= sqrt(1.- ground.get_zrati_sqr() * thz* thz); rrv=-( roz- ground.zrati * zrsin)/( roz+ ground.zrati* zrsin); rrh=( ground.zrati* roz- zrsin)/( ground.zrati* roz+ zrsin); } /* for the cliff problem, two reflction coefficients calculated */ if ( ifar > 1) { rrv1= rrv; rrh1= rrh; tthet= tan( thet); if ( ifar != 4) { nec_complex zrati2 = ground.get_zrati2(_wavelength); zrsin = sqrt(1.- zrati2 * zrati2 * thz* thz); rrv2 =-( roz- zrati2* zrsin)/( roz+ zrati2* zrsin); rrh2 =( zrati2* roz- zrsin)/( zrati2* roz+ zrsin); darg = -two_pi() * 2.0 * ground.get_ch(_wavelength) * roz; } } /* if ( ifar > 1) */ roz=- roz; ccx= cix; ccy= ciy; ccz= ciz; } /* if ( k != 0 ) */ cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); /* loop over structure segments */ for( i = 0; i < m_geometry->n; i++ ) { omega=-( rox* m_geometry->cab[i]+ roy* m_geometry->sab[i]+ roz* m_geometry->salp[i]); el= pi()* m_geometry->segment_length[i]; sill= omega* el; top= el+ sill; bot= el- sill; if ( fabs( omega) >= 1.0e-7) a=2.* sin( sill)/ omega; else a=(2.- omega* omega* el* el/3.)* el; if ( fabs( top) >= 1.0e-7) too= sin( top)/ top; else too=1.- top* top/6.; if ( fabs( bot) >= 1.0e-7) boo= sin( bot)/ bot; else boo=1.- bot* bot/6.; b= el*( boo- too); c= el*( boo+ too); rr= a* air[i]+ b* bii[i]+ c* cir[i]; ri= a* aii[i]- b* bir[i]+ c* cii[i]; arg= two_pi()*( m_geometry->x[i]* rox+ m_geometry->y[i]* roy+ m_geometry->z[i]* roz); if ( (k != 1) || (ifar < 2) ) { /* summation for far field integral */ exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri); cix= cix+ exa* m_geometry->cab[i]; ciy= ciy+ exa* m_geometry->sab[i]; ciz= ciz+ exa* m_geometry->salp[i]; continue; } /* calculation of image contribution */ /* in cliff and ground screen problems */ /* specular point distance */ dr= m_geometry->z[i]* tthet; d= dr* phy+ m_geometry->x[i]; if ( ifar == 2) { if (( ground.get_cl(_wavelength) - d) > 0.0) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if ( ifar == 2) */ else { d= sqrt( d*d + (m_geometry->y[i]-dr*phx)*(m_geometry->y[i]-dr*phx) ); if ( ifar == 3) { if (( ground.get_cl(_wavelength) - d) > 0.0) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } } /* if ( ifar == 3) */ else { if (( ground.scrwl- d) >= 0.0) { /* radial wire ground screen reflection coefficient */ d += ground.t2; zscrn= ground.m_t1 * d* log( d/ ground.t2); zscrn=( zscrn* ground.zrati)/( em::impedance() * ground.zrati+ zscrn); zrsin= sqrt(1.- zscrn* zscrn* thz* thz); rrv=( roz+ zscrn* zrsin)/(- roz+ zscrn* zrsin); rrh=( zscrn* roz+ zrsin)/( zscrn* roz- zrsin); } /* if (( ground.scrwl- d) < 0.) */ else { if ( ifar == 4) { rrv= rrv1; rrh= rrh1; } /* if ( ifar == 4) */ else { if ( ifar == 5) d= dr* phy+ m_geometry->x[i]; if (( ground.get_cl(_wavelength) - d) > 0.) { rrv= rrv1; rrh= rrh1; } else { rrv= rrv2; rrh= rrh2; arg= arg+ darg; } /* if (( cl- d) > 0.) */ } /* if ( ifar == 4) */ } /* if (( ground.scrwl- d) < 0.) */ } /* if ( ifar == 3) */ } /* if ( ifar == 2) */ /* contribution of each image segment modified by */ /* reflection coef, for cliff and ground screen problems */ exa= nec_complex( cos( arg), sin( arg))* nec_complex( rr, ri); tix= exa* m_geometry->cab[i]; tiy= exa* m_geometry->sab[i]; tiz= exa* m_geometry->salp[i]; cdp=( tix* phx+ tiy* phy)*( rrh- rrv); cix= cix+ tix* rrv+ cdp* phx; ciy= ciy+ tiy* rrv+ cdp* phy; ciz= ciz- tiz* rrv; } /* for( i = 0; i < n; i++ ) */ if ( k == 0 ) continue; /* calculation of contribution of structure image for infinite ground */ if ( ifar < 2) { cdp=( cix* phx+ ciy* phy)*( rrh- rrv); cix= ccx+ cix* rrv+ cdp* phx; ciy= ccy+ ciy* rrv+ cdp* phy; ciz= ccz- ciz* rrv; } else { cix= cix+ ccx; ciy= ciy+ ccy; ciz= ciz+ ccz; } } /* for( k=0; k < ground.ksymp; k++ ) */ if ( m_geometry->m > 0) jump = true; else { *eth=( cix* thx+ ciy* thy+ ciz* thz)* CONST3; *eph=( cix* phx+ ciy* phy)* CONST3; return; } } /* if ( n != 0) */ if ( ! jump ) { cix=cplx_00(); ciy=cplx_00(); ciz=cplx_00(); } /* electric field components */ roz= rozs; { // without ground complex_array temp = current_vector.segment(m_geometry->n); m_geometry->fflds(rox, roy, roz, temp, &ex, &ey, &ez); } if (ground.present()) { // with ground nec_complex tempx, tempy, tempz; complex_array temp = current_vector.segment(m_geometry->n); m_geometry->fflds(rox, roy, -roz, temp, &tempx, &tempy, &tempz); if (ground.type_perfect()) { tempx = -tempx; tempy = -tempy; tempz = -tempz; } else { // get reflection co-efficient?? rrv= sqrt(1.0 - ground.get_zrati_sqr() * thz* thz); rrh= ground.zrati * roz; rrh=( rrh- rrv)/( rrh+ rrv); rrv= ground.zrati * rrv; rrv=-( roz- rrv)/( roz+ rrv); *eth=( tempx* phx+ tempy* phy)*( rrh- rrv); tempx= tempx* rrv+ *eth* phx; tempy= tempy* rrv+ *eth* phy; tempz= tempz* rrv; } /* if ( ground.iperf == 1) */ ex += tempx; ey += tempy; ez -= tempz; } ex += cix* CONST3; ey += ciy* CONST3; ez += ciz* CONST3; *eth= ex*thx + ey*thy + ez*thz; *eph= ex*phx + ey*phy; } necpp-1.5.0+cvs20101003/src/nec_exception.cpp0000644000175000017500000000702611117330057017023 0ustar numanuma/*************************************************************************** * Copyright (C) 2004 by Tim Molteno * * tim@physics.otago.ac.nz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "safe_array.h" #include "nec_exception.h" #include "stdarg.h" using namespace std; string nec_exception::string_printf(const char* fmt, ...) { stringstream _sstream; va_list ap; /* special type for variable */ safe_array format(2048); /* argument lists */ int i, j; /* Need all these to store */ char c; /* values below in switch */ double d; unsigned u; char *s; void *v; va_start(ap, fmt); /* must be called before work */ while (*fmt) { for (j = 0; fmt[j] && fmt[j] != '%'; j++) format[j] = fmt[j]; /* not a format string */ if (j) { format[j] = '\0'; _sstream << format.data(); /* log it verbatim */ fmt += j; } else { for (j = 0; !isalpha(fmt[j]); j++) { /* find end of format specifier */ format[j] = fmt[j]; if (j && fmt[j] == '%') /* special case printing '%' */ break; } format[j] = fmt[j]; /* finish writing specifier */ format[j + 1] = '\0'; /* don't forget NULL terminator */ fmt += j + 1; switch (format[j]) { /* cases for all specifiers */ case 'd': case 'i': /* many use identical actions */ i = va_arg(ap, int); /* process the argument */ _sstream << i; /* and log it */ break; case 'o': case 'x': case 'X': case 'u': u = va_arg(ap, unsigned); _sstream << u; break; case 'c': c = (char) va_arg(ap, int); /* must cast! */ _sstream << c; break; case 's': s = va_arg(ap, char *); _sstream << s; break; case 'f': case 'e': case 'E': case 'g': case 'G': d = va_arg(ap, double); _sstream << d; break; case 'p': v = va_arg(ap, void *); _sstream << v; break; case '%': _sstream << "%%"; break; default: throw new nec_exception("Invalid format specifier in os_printf()"); } } } va_end(ap); /* clean up */ return _sstream.str(); } necpp-1.5.0+cvs20101003/src/atlas_check.sh0000755000175000017500000000042411042761575016301 0ustar numanuma#!/bin/sh gcc -Wall -o atlas_check atlas_check.cpp -L /usr/lib/atlas -llapack -lblas -latlas -lstdc++ ./atlas_check rm atlas_check gfortran -Wall -o atlas_check atlas_check.f ./atlas_check rm atlas_check gfortran -Wall -o atlas_check lu_ralston.f ./atlas_check rm atlas_check necpp-1.5.0+cvs20101003/src/XGetopt.h0000644000175000017500000000113311451333571015235 0ustar numanuma// XGetopt.h // // Author: Hans Dietrich // hdietrich2@hotmail.com // // This software is released into the public domain. // You are free to use it in any way you like. // // This software is provided "as is" with no expressed // or implied warranty. I accept no liability for any // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// #ifndef XGETOPT_H #define XGETOPT_H extern int optind, opterr; extern char *optarg; int XGetopt(int argc, char *argv[], const char *optstring); #endif //XGETOPT_H necpp-1.5.0+cvs20101003/src/BaseInput.h0000644000175000017500000000411210310210756015525 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __Base_Input__ #define __Base_Input__ #include "math_util.h" #include #include nec_float diff(nec_float a, nec_float b) { if (a == b) return 0; if ((a < 1e-8) && (b < 1e-8)) return 0; nec_float sub = a - b; nec_float sum = a + b; nec_float ret = sub*sub; if ((a != 0) && (b != 0)) ret /= sum*sum; ret = sqrt(ret); if (ret > 1e-2) { cout << " diff(" << a << "," << b << ") = " << ret << endl; } return ret; } nec_float diff(nec_complex a, nec_complex b) { if (a == b) return 0; if ((abs(a) < 1e-8) && (abs(b) < 1e-8)) return 0; nec_float ret = norm(a - b); nec_float sum = norm(a + b); if (sum != 0) ret /= sum; ret = sqrt(ret); if (ret > 1e-2) { stringstream ss; cout << " diff(" << a << "," << b << ") = " << ret << endl; } return ret; } class BaseInput { public: BaseInput(const std::string& filename) : m_filename(filename), m_stream(filename.c_str()) { } private: char linec[512]; protected: std::string m_filename; std::ifstream m_stream; string readline() { m_stream.getline(&linec[0],512); return string(&linec[0]); } double read_sci(std::istream& is) { double x; is.setf(ios_base::skipws); is >> x; return x; } double read_fixed(std::istream& is) { double x; is.setf(ios_base::skipws); is >> x; return x; } }; #endif /* __Base_Input__ */ necpp-1.5.0+cvs20101003/src/nec_structure_currents.cpp0000644000175000017500000003400111130554610021001 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "nec_structure_currents.h" #include "nec_context.h" #include "nec_exception.h" #include "c_geometry.h" int nec_structure_currents::get_n() { return m_geometry->n; } int nec_structure_currents::get_m() { return m_geometry->m; } nec_structure_currents::nec_structure_currents(nec_context * in_context, enum excitation_type in_pattype, int in_nload, nec_float in_xpr3, nec_float in_xpr6) { m_context = in_context; m_geometry = m_context->m_geometry; pattype = in_pattype; iptflg = m_context->iptflg; iptflq = m_context->iptflq; iptag = m_context->iptag; iptagf = m_context->iptagf; iptagt = m_context->iptagt; iptaq = m_context->iptaq; iptaqf = m_context->iptaqf; iptaqt = m_context->iptaqt; nload = in_nload; xpr3 = in_xpr3; xpr6 = in_xpr6; wavelength = m_context->wavelength; freq_mhz = m_context->freq_mhz; structure_power_loss=0; current_nb_elements = 0; q_density_nb_elements = 0; q_density_last_printed = 0; patch_nb_elements = 0; } /* EXCITATION_VOLTAGE = 0, EXCITATION_LINEAR = 1, EXCITATION_CIRC_RIGHT = 2, EXCITATION_CIRC_LEFT = 3, EXCITATION_CURRENT = 4, EXCITATION_VOLTAGE_DISC = 5 */ std::string nec_structure_currents::hpol(enum excitation_type e) { switch(e) { case EXCITATION_LINEAR: return std::string("LINEAR"); case EXCITATION_CIRC_RIGHT: return std::string("RIGHT"); case EXCITATION_CIRC_LEFT: return std::string("LEFT"); default: { nec_exception* nex = new nec_exception("Unknown Excitation type"); throw nex; } } } void nec_structure_currents::analyze() { int jump; nec_float cmag; // nec_complex curi; nec_float fr; nec_complex eth, eph, ex, ey, ez; if (m_geometry->n != 0) { if (iptflg!= -1) { int itmp1=0; jump= iptflg+1; for (int i = 0; i < m_geometry->n; i++ ) { nec_complex curi= m_context->current_vector[i]* wavelength; cmag= abs(curi); if ( (nload != 0) && (fabs(real(m_context->zarray[i])) >= 1.e-20) ) structure_power_loss += 0.5*cmag*cmag*real( m_context->zarray[i]) * m_geometry->segment_length[i]; if ( jump == 0) continue; if ( jump > 0 ) { if ( (iptag != 0) && (m_geometry->segment_tags[i] != iptag) ) continue; itmp1++; if ( (itmp1 < iptagf) || (itmp1 > iptagt) ) continue; if ( iptflg != 0) { if ( iptflg >= 2 ) { m_context->fnorm[m_context->get_inc()-1]= cmag; m_context->set_isave(i+1); } if ( iptflg != 3) { /*m_output.nec_printf(" %7.2f %7.2f %11.4E %7.2f %5d", xpr1, xpr2, cmag, ph, i+1 );*/ current_nb_elements++; _current_theta.push_back(m_context->get_xpr1()); _current_phi.push_back(m_context->get_xpr2()); _current.push_back(curi); _current_segment_number.push_back(i+1); continue; } } /* if ( iptflg != 0) */ else /* iptflg == 0, only the currents specified will be printed, using the standard format*/ { /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ current_nb_elements++; _current_segment_number.push_back(i+1); _current_segment_tag.push_back(m_geometry->segment_tags[i]); _current_segment_center_x.push_back(m_geometry->x[i]); _current_segment_center_y.push_back(m_geometry->y[i]); _current_segment_center_z.push_back(m_geometry->z[i]); _current_segment_length.push_back(m_geometry->segment_length[i]); _current.push_back(curi); // added test for plot_card.is_valid() if (m_context->plot_card.is_valid() && m_context->plot_card.currents()) { m_context->plot_card.plot_complex(curi); m_context->plot_card.plot_endl(); } } /* iptflg == 0, only the currents specified will be printed, using the standard format*/ } else /* iptflg == -2, all currents will be printed, using the standard format*/ { /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %8.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ current_nb_elements++; _current_segment_number.push_back(i+1); _current_segment_tag.push_back(m_geometry->segment_tags[i]); _current_segment_center_x.push_back(m_geometry->x[i]); _current_segment_center_y.push_back(m_geometry->y[i]); _current_segment_center_z.push_back(m_geometry->z[i]); _current_segment_length.push_back(m_geometry->segment_length[i]); _current.push_back(curi); // added test for plot_card.is_valid() if (m_context->plot_card.is_valid() && m_context->plot_card.currents()) { m_context->plot_card.plot_complex(curi); m_context->plot_card.plot_endl(); } } /* iptflg == -2, all currents will be printed, using the standard format*/ } /* for( i = 0; i < n; i++ ) */ m_context->structure_power_loss = structure_power_loss; }/* if (iptflg != -1) */ if (iptflq != -1) { int itmp1 = 0; fr = 1.e-6/(freq_mhz); for(int i = 0; i < m_geometry->n; i++ ) { if ( iptflq != -2 ) { if ( (iptaq != 0) && (m_geometry->segment_tags[i] != iptaq) ) continue; itmp1++; if ( (itmp1 < iptaqf) || (itmp1 > iptaqt) ) continue; } /* if ( iptflq == -2) */ nec_complex curi = fr * nec_complex(- m_context->bii[i], m_context->bir[i]); /*m_output.nec_printf( " %5d %4d %9.4f %9.4f %9.4f %9.5f" " %11.4E %11.4E %11.4E %9.3f", i+1, m_geometry->segment_tags[i], m_geometry->x[i], m_geometry->y[i], m_geometry->z[i], m_geometry->segment_length[i], real(curi), imag(curi), cmag, ph );*/ q_density_nb_elements++; _q_density_segment_number.push_back(i+1); _q_density_segment_tag.push_back(m_geometry->segment_tags[i]); _q_density_segment_center_x.push_back(m_geometry->x[i]); _q_density_segment_center_y.push_back(m_geometry->y[i]); _q_density_segment_center_z.push_back(m_geometry->z[i]); _q_density_segment_length.push_back(m_geometry->segment_length[i]); _q_density.push_back(curi); } /* for(int i = 0; i < m_geometry->n; i++ ) */ } /* if (iptflq != -1) */ } /* if (m_geometry->n != 0) */ if (m_geometry->m != 0) { int j = m_geometry->n-3; int itmp1 = -1; for(int i = 0; i < m_geometry->m; i++ ) { j += 3; itmp1++; ASSERT(itmp1 == i); ex= m_context->current_vector[j]; ey= m_context->current_vector[j+1]; ez= m_context->current_vector[j+2]; eth= ex* m_geometry->t1x[itmp1]+ ey* m_geometry->t1y[itmp1]+ ez* m_geometry->t1z[itmp1]; eph= ex* m_geometry->t2x[itmp1]+ ey* m_geometry->t2y[itmp1]+ ez* m_geometry->t2z[itmp1]; /*m_output.nec_printf( " %4d %7.3f %7.3f %7.3f %11.4E " "%8.2f %11.4E %8.2f" " %9.2E %9.2E %9.2E %9.2E %9.2E %9.2E", i+1, m_geometry->px[itmp1], m_geometry->py[itmp1], m_geometry->pz[itmp1], ethm, etha, ephm, epha, real(ex), imag(ex), real(ey), imag(ey), real(ez), imag(ez));*/ patch_nb_elements++; _patch_number.push_back(i+1); _patch_center_x.push_back(m_geometry->px[itmp1]); _patch_center_y.push_back(m_geometry->py[itmp1]); _patch_center_z.push_back(m_geometry->pz[itmp1]); _patch_tangent_vector1.push_back(eth); _patch_tangent_vector2.push_back(eph); _patch_e_x.push_back(ex); _patch_e_y.push_back(ey); _patch_e_z.push_back(ez); m_context->plot_card.plot_currents(ex,ey,ez); } /* for( i=0; im != 0) */ } void nec_structure_currents::write_to_file_aux(ostream& os) { output_helper oh(os,_result_format); if ( m_geometry->n != 0) { if ( iptflg != -1) { if ( iptflg <= 0) { oh.section_start("CURRENTS AND LOCATION"); oh.center_text("DISTANCES IN WAVELENGTHS",""); os << endl; os << " SEG TAG COORDINATES OF SEGM CENTER SEGM ------------- CURRENT (AMPS) -------------" << endl; os << " No: No: X Y Z LENGTH REAL IMAGINARY MAGN PHASE" << endl; for(int i=0; iget_inc() <= 1) { oh.section_start("RECEIVING PATTERN PARAMETERS"); os << " ETA: "; oh.real_out(7,2,xpr3,false); os << " DEGREES" << endl; os << " TYPE: "; oh.string_out(6, nec_structure_currents::hpol(pattype)); os << endl; os << " AXIAL RATIO: "; oh.real_out(6,3,xpr6,false); os << endl << endl; os << " THETA PHI ----- CURRENT ---- SEG" << endl; os << " (DEG) (DEG) MAGNITUDE PHASE No:" << endl; } int i = current_nb_elements-1; oh.start_record(); oh.padding(" "); oh.real_out(7, 2, _current_theta[i], false); oh.separator(); oh.real_out(7, 2, _current_phi[i], false); oh.separator(); oh.padding(" "); oh.real_out(11,4, abs(_current[i]), true); oh.separator(); oh.padding(" "); oh.real_out(7,2, arg_degrees(_current[i]), false); oh.separator(); oh.padding(" "); oh.int_out(5, _current_segment_number[i]); oh.separator(); oh.end_record(); } /* if ( iptflg <= 0) */ } /* if ( iptflg != -1) */ if ( iptflq != -1) { oh.section_start("CHARGE DENSITIES"); oh.center_text("DISTANCES IN WAVELENGTHS",""); os << endl; os << " SEG TAG COORDINATES OF SEG CENTER SEG CHARGE DENSITY (COULOMBS/METER)" << endl; os << " NO: NO: X Y Z LENGTH REAL IMAGINARY MAGN PHASE" << endl; for(int i=q_density_last_printed; i< q_density_nb_elements; i++) { oh.start_record(); oh.padding(" "); oh.int_out(5, _q_density_segment_number[i]); oh.separator(); oh.int_out(4, _q_density_segment_tag[i]); oh.separator(); oh.real_out(9, 4,_q_density_segment_center_x[i], false); oh.separator(); oh.real_out(9, 4, _q_density_segment_center_y[i], false); oh.separator(); oh.real_out(9, 4, _q_density_segment_center_z[i], false); oh.separator(); oh.real_out(9, 5, _q_density_segment_length[i], false); oh.separator(); oh.real_out(11,4, real(_q_density[i]), true); oh.separator(); oh.real_out(11,4, imag(_q_density[i]), true); oh.separator(); oh.real_out(11,4, abs(_q_density[i]), true); oh.separator(); oh.real_out(9,3, arg_degrees(_q_density[i]), false); oh.separator(); oh.end_record(); } q_density_last_printed = q_density_nb_elements; } } /*if ( m_geometry->n != 0) */ if ( m_geometry->m != 0) { oh.section_start("SURFACE PATCH CURRENTS"); oh.center_text("DISTANCES IN WAVELENGTHS",""); oh.center_text("CURRENT IN AMPS/METER",""); os << endl << endl; oh.center_text("SURFACE COMPONENTS","---------"); oh.center_text("RECTANGULAR COMPONENTS","---------"); os << " PCH --- PATCH CENTER --- TANGENT VECTOR 1 TANGENT VECTOR 2"; os << " ------- X ------ ------- Y ------ ------- Z ------" << endl; os << " No: X Y Z MAG. PHASE MAG. PHASE"; os << " REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY" << endl; for(int i=0; im != 0) */ } /* write_to_file_aux */ necpp-1.5.0+cvs20101003/src/matrix_algebra.h0000644000175000017500000000302010310210756016611 0ustar numanuma#ifndef __matrix_algebra__ #define __matrix_algebra__ /* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math_util.h" #include "nec_output.h" void lu_decompose(nec_output_file& s_output, int n, complex_array& a, int_array& ip, int ndim); void factrs(nec_output_file& s_output, int np, int nrow, complex_array& a, int_array& ip ); void solve( int n, complex_array& a, int_array& ip, complex_array& b, int ndim ); void solves(complex_array& a, int_array& ip, complex_array& b, int neq, int nrh, int np, int n, int mp, int m, int nop, complex_array& symmetry_array); /* Do some simple tests for integration convergence */ void test(nec_float f1r, nec_float f2r, nec_float *tr, nec_float f1i, nec_float f2i, nec_float *ti, nec_float dmin); nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin ); #endif /* __matrix_algebra__ */ necpp-1.5.0+cvs20101003/src/electromag.cpp0000644000175000017500000000303710404145457016326 0ustar numanuma/* Electromagnetic Functions and Definitions for nec2++ Copyright (C) 2006 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "electromag.h" nec_float em::constants::permittivity = 8.854e-12; nec_float em::constants::permeability = four_pi() * 1.0e-7; nec_float em::speed_of_light() // was (CVEL in old nec2) but we have changed it to be in meters per second { static nec_float ret = 1.0 / sqrt(permeability() * permittivity()); return ret; // 299.8e6; } nec_float em::impedance() // was (ETA in old nec2) { static nec_float ret = sqrt(permeability() / permittivity()); return ret; // 376.8 } nec_float em::inverse_impedance() // was (RETA in old nec2) { static nec_float ret = 1.0 / em::impedance(); return ret; // 2.654420938E-3; } nec_float em::impedance_over_2pi() // was (59.958 in old nec2) { static nec_float ret = em::impedance() / two_pi(); return ret; // 59.958 } necpp-1.5.0+cvs20101003/src/c_plot_card.h0000644000175000017500000000513711044461425016122 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_plot_card__ #define __c_plot_card__ #include "math_util.h" #include #include /*! All the logic for handling the plot card is contained in this class. There appear to be many variants of the PL card. I am using the documentation below as a guide. \verbatim PL PLOT DATA STORAGE I1- 0=NO STORE, 1=CURRENTS, 2=NEAR FIELD, 3=PATTERNS I2(1,2)- 0=NO, 1=REAL,IMAG, 3=MAG, PHASE I2(3)- 1=TH, 2=PHI, 3=RHO ANGLES I3(1)- 0=N0, 1=IX, 2=IY, 3=IZ, 4=IX IY IZ I3(2)- 0-N0, 1=X, 2=Y, 3=Z, 4=X Y Z, 5=TOTAL COMPONENT I3(3)- 0=NO, 1=TH, 2=PHI, 3=RHO E-FIELD COMPOMENT I4(1)- BLANK I4(2)- 1=X, 2=Y, 3=Z CORDINATE VALUES I4(3)- 1=V, 2=H, 3=TOTAL, 4=V H T GAINS DB \endverbatim */ class c_plot_card { public: c_plot_card(); c_plot_card(const c_plot_card& p); c_plot_card(int itmp1, int itmp2, int itmp3, int itmp4, std::string& filename); virtual ~c_plot_card(); bool is_valid() const; bool storing() const; bool currents() const; bool near_field() const ; bool patterns() const; bool realimag() const; bool magphase() const; void set_plot_real_imag_currents(); void plot_endl() const; void plot_double(nec_float x) const; void plot_complex(nec_complex x) const; void plot_complex_2d(nec_complex x, nec_complex y, nec_complex z) const; void plot_currents(nec_complex ex, nec_complex ey, nec_complex ez) const; void plot_segments(int i, real_array& x, real_array& y, real_array& z, real_array& si, nec_float xw2, nec_float yw2, real_array& bi, int_array& icon1, int_array& icon2) const; void plot_fields( nec_complex ex, nec_complex ey, nec_complex ez, nec_float xob, nec_float yob, nec_float zob); void plot_patterns(nec_float theta, nec_float phi, nec_complex e_theta, nec_complex e_phi, nec_float g_vert, nec_float g_horiz, nec_float g_tot); private: int p1, p2, p3, p4; FILE* plot_fp; }; #endif /* __c_plot_card__ */ necpp-1.5.0+cvs20101003/src/nec_ground.cpp0000644000175000017500000000760610404136216016326 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math_util.h" #include "nec_exception.h" /* \section{NEC Ground Specification} \subsection{the GN Card} The GN card 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. The parameters of the second medium can also be specified on another data card whose mnemonic is GD. With the GD card, the parameters of the second medium can be varied and only the radiated fields need to be recalculated. Furthermore, if a radial wire ground screen has been specified on the GN card, the GD card is the only way to include a second medium. See Section~\ref{sec_card_gd} for details. \subsection{"gd" card: ground representation} \label{sec_card_gd} To specify the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the fields of surface patches. < */ #include "nec_ground.h" #include "nec_output.h" #include "misc.h" // for stop() function /* Parse a GN card. The input parameters here are the fields of the GN card. GN NEAR GROUND, GROUND SCREEN, ADDED GROUND I1- -1=SET FREE SPACE (A), 0=REFL COEFF, 1=IDEAL (B), 2-SOMMERFIELD I2- (A) BLANK), NO WIRES IN GND SCREEN (C), 0= NO WIRES (D) I3- BLANK I4- BLANK F1- (A,B) BLANK, DIELECTRIC OF NEAR GROUND F2- (A,B) BLANK, CONDUCTIVITY OF NEAR GROUND F3- (A,B) BLANK, (C) RADIUS OF SCREEN, (D) DIELECTRIC 2ND MEDIUM F4- (A,B) BLANK, (C) RADII SCREEN WIRES, (D) CONDUCT. 2ND MEDIUM F5- (A,B) BLANK, (C) BLANK, (D) DIST TO 2ND MEDIUM, SEE RP F6- (A,B) BLANK, (C) BLANK, (D) HEIGHT 2ND MEDIUM (AS IN GD) */ void nec_ground::parse_gn(int itmp1, int itmp2, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6 ) { // iperf = -1 - nullifies ground parameters previously used and sets free- space condition. // The remainder of the card is left blank in this case. if ( itmp1 == -1 ) // nullify previous ground conditions. { ksymp=1; radial_wire_count=0; iperf=0; return; } iperf = itmp1; ASSERT(iperf >= 0); radial_wire_count = itmp2; ksymp = 2; epsr = tmp1; sig = tmp2; if (radial_wire_count != 0) { if ( iperf == 2) { throw new nec_exception("RADIAL WIRE G.S. APPROXIMATION MAY NOT BE USED WITH SOMMERFELD GROUND OPTION"); } radial_wire_length= tmp3; radial_wire_radius= tmp4; return; } setup_cliff(tmp3,tmp4,tmp5,tmp6); } /* Setup a cliff (two medium ground) */ void nec_ground::setup_cliff(nec_float in_eprs2, nec_float in_sig2, nec_float clt, nec_float cht) { cliff_edge_distance = clt; cliff_height = cht; epsr2 = in_eprs2; sig2 = in_sig2; } using namespace std; #include "electromag.h" nec_complex nec_ground::get_zrati2(nec_float wavelength) { return sqrt(1.0 / nec_complex(epsr2,-sig2 * wavelength * em::impedance_over_2pi())); } necpp-1.5.0+cvs20101003/src/nec_radiation_pattern.h0000644000175000017500000002377711450361470020217 0ustar numanuma/* Copyright (C) 2004-2005 Timothy C.A. Molteno tim@molteno.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_radiation_pattern__ #define __nec_radiation_pattern__ #include "nec_results.h" #include "math_util.h" #include "nec_ground.h" #include "c_plot_card.h" /** \brief The types of polarization that gain normalization should be done with */ enum polarization_norm { POL_MAJOR_AXIZ=1, POL_MINOR_AXIS=2, POL_VERTICAL=3, POL_HORIZONTAL=4, POL_TOTAL=5 }; /** \brief The types of polarization sense */ enum polarization_sense { POL_LINEAR=0, POL_RIGHT=1, POL_LEFT=2 }; class nec_context; class nec_radiation_pattern : public nec_base_result { public: // Radiation Pattern nec_radiation_pattern(int in_n_theta, int in_n_phi, nec_float in_theta_start, nec_float in_phi_start, nec_float in_delta_theta, nec_float in_delta_phi, nec_float in_range, nec_ground& in_ground, int in_ifar, nec_float in_wavelength, nec_float pinr, nec_float pnlr, int in_rp_output_format, int in_rp_normalization, int in_rp_ipd, int in_rp_power_average, nec_float in_gnor, c_plot_card& in_plot_card); virtual void write_to_file(ostream& os) { write_to_file_aux(os); } virtual enum nec_result_type get_result_type() { return RESULT_RADIATION_PATTERN; } void analyze(nec_context* in_context); void write_gain_normalization() { if (_ifar != 1) { nec_float norm = get_maximum_gain_db(); printf("Max Gain: %f\n",norm); } } /*Added for the python wrapping : some basic access functions...*/ real_array get_gain() { return _gain; } real_array get_gain_vert() { return _power_gain_vert; } real_array get_gain_horiz() { return _power_gain_horiz; } real_array get_gain_tot() { return _power_gain_tot; } real_array get_pol_axial_ratio() { return _polarization_axial_ratio; } /*! \brief Get the polarization axial ratio */ nec_float get_pol_axial_ratio(int theta_index, int phi_index) const { return _polarization_axial_ratio[get_index(theta_index, phi_index)]; } real_array get_pol_tilt() { return _polarization_tilt; } int_array get_pol_sense_index() { return _polarization_sense_index; } /*! \brief Get the polarization sense \return enum polarization_sense POL_LINEAR, POL_RIGHT, POL_LEFT */ int get_pol_sense(int theta_index, int phi_index) const { return _polarization_sense_index[get_index(theta_index, phi_index)]; } /*! \brief Get the magnitude of E(THETA) */ nec_float get_etheta_magnitude(int theta_index, int phi_index) { return abs(_e_theta[get_index(theta_index, phi_index)]); } /*! \brief Get the phase (in degrees) of E(THETA) */ nec_float get_etheta_phase(int theta_index, int phi_index) { return arg_degrees(_e_theta[get_index(theta_index, phi_index)]); } /*! \brief Return a complex array for the electric field E(THETA) */ complex_array get_e_theta() { return _e_theta; } /*! \brief Get the magnitude of E(PHI) */ nec_float get_ephi_magnitude(int theta_index, int phi_index) { return abs(_e_phi[get_index(theta_index, phi_index)]); } /*! \brief Get the phase (in degrees) of E(PHI) */ nec_float get_ephi_phase(int theta_index, int phi_index) { return arg_degrees(_e_phi[get_index(theta_index, phi_index)]); } /*! \brief Return a complex array for the electric field E(PHI) */ complex_array get_e_phi() { return _e_phi; } complex_array get_e_r() { return _e_r; } nec_float get_normalization_factor() { return get_gain_normalization_factor(m_rp_gnor); } nec_float get_average_power_gain() { return _average_power_gain; } nec_float get_average_power_solid_angle() { return _average_power_solid_angle; } nec_ground get_ground() { return m_ground; } nec_float get_range() { return m_range; } nec_float get_wavelength() { return _wavelength; } nec_float get_delta_theta() { return delta_theta; } nec_float get_theta_start() { return m_theta_start; } nec_float get_delta_phi() { return delta_phi; } nec_float get_phi_start() { return m_phi_start; } int get_ifar() { return _ifar; } int get_rp_normalization() { return m_rp_normalization; } int get_rp_output_format() { return m_rp_output_format; } int get_rp_power_average() { return m_rp_power_average; } int get_rp_ipd() { return m_rp_ipd; } /*End of access functions added for the wrapping*/ nec_float get_maximum_gain_db() { return get_gain_normalization_factor(0); } /****************** STATISTICS ********************/ private: nec_float mean(real_array& pattern) const { nec_float sum = 0.0; long len = pattern.size(); for (long i=0;i #include #include "common.h" class nec_exception { public: nec_exception() { } nec_exception(const char* message) { m_message << message; } nec_exception(const char* message, int code) { m_message << message << code; } template void append(const T& message) { m_message << message; } std::string get_message() { std::string ret = m_message.str(); return ret; } static std::string string_printf(const char* fmt, ...); protected: std::stringstream m_message; }; #ifdef _MSC_VER /* Visual C++ does not allow macros with variable argument lists. Therefore error messages will be meaningless when this is compiled using VC++, however at least it will compile! */ inline void nec_stop(const char* __fmt, ...) { nec_exception* __nex = new nec_exception("Undefined Error"); // __nex->os_printf(__fmt, __VA_ARGS__); throw __nex; } #else #define nec_stop(__fmt, ...)\ { nec_exception* __nex = new nec_exception();\ std::string _mess = nec_exception::string_printf(__fmt, __VA_ARGS__); \ __nex->append(_mess.c_str()); \ throw __nex; \ } #endif #endif /* __nec_exception__ */ necpp-1.5.0+cvs20101003/src/libnecpp.h0000644000175000017500000004126111450075244015444 0ustar numanuma/*************************************************************************** * Copyright (C) 2004-2008 by Tim Molteno * * tim@molteno.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ /*! \file libnecpp.h \brief nec++ Library Functions. \verbatim How to use libNEC. Enter the following file into test_nec.c, and compile with gcc -o test_nec test_nec.c -lnecpp #include "libnecpp.h" #include int main(int argc, char **argv) { nec_context* nec; double gain; nec = nec_create(); nec_wire(nec, 0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0); nec_wire(nec, 0, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 0, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 0, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0); nec_wire(nec, 0, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0); nec_wire(nec, 0, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0); nec_wire(nec, 0, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0); nec_wire(nec, 0, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0); nec_geometry_complete(nec, 0, 0); nec_gn_card(nec, -1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0); nec_ld_card(nec, 5,0,0,0,3.72e7,0.0,0.0); nec_pt_card(nec, -1, 0, 0, 0); nec_ex_card(nec, 1, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); nec_fr_card(nec, 0, 2, 2400.0, 100.0); nec_rp_card(nec, 0, 1, 1, 0,5,0,0, 90.0, 90.0, 0.0, 0.0, 0.0, 0.0); printf("Impedance: %f, %f\n",nec_impedance_real(nec,0), nec_impedance_imag(nec,0)); printf("Gain: %f, %f +/- %f dB\n",nec_gain_max(nec,0), nec_gain_mean(nec,0), nec_gain_sd(nec,0)); printf("RHCP Gain: %f, %f +/- %f dB\n",nec_gain_rhcp_max(nec,0), nec_gain_rhcp_mean(nec,0), nec_gain_rhcp_sd(nec,0)); printf("LHCP Gain: %f, %f +/- %f dB\n",nec_gain_lhcp_max(nec,0), nec_gain_lhcp_mean(nec,0), nec_gain_lhcp_sd(nec,0)); nec_delete(nec); return 0; } \endverbatim */ #ifndef __libnecpp__ #define __libnecpp__ /*! A Struct to represent the nec_context class.*/ #ifdef __cplusplus class nec_context; #else struct nec_context; typedef struct nec_context nec_context; #endif #ifdef __cplusplus extern "C" { #endif /*! \brief Construct and initialize an nec_context */ nec_context* nec_create(); /*!\brief Delete an nec_context object. */ long nec_delete(nec_context* in_context); /*!\brief Benchmark the libnecpp engine. A score of 100 is roughly an Athlon XP 1800. */ long nec_benchmark(); /*! \brief Generates segment geometry for a straigt wire \param in_context The nec_context created with nec_create() \param tag_id \param segment_count Number of Elements (should be around 12-20 per wavelength) \param rad Wire radius of first segment (in Meters) \param rdel Ratio of the length of a segment to the length of the previous segment. (Set to 1.0 if segments have uniform length) \param rrad The ratio of the radii of adjacent segments (Set to 1.0 if not tapered) */ /*! 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 */ void nec_wire(nec_context* in_context, int tag_id, int segment_count, double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad); /*! \brief Indicate that the geometry is complete (GE card) \param in_context The nec_context created with nec_create() \param gpflag Geometry ground plain flag. 0 - no ground plane is present. 1 - Indicates a ground plane is present. Structure symmetry is modified as required, and the current expansion is modified so that the currents an segments touching the ground (x, Y plane) are interpolated to their images below the ground (charge at base is zero) -1 - indicates a ground is present. Structure symmetry is modified as required. Current expansion, however, is not modified, Thus, currents on segments touching the ground will go to zero at the ground. \param card_int_2 Unused (set to zero) */ void nec_geometry_complete(nec_context* in_context, int gpflag, int card_int_2); /* NEC card functions. */ /*!\brief Ground Card Examples: 1) Infinite ground plane nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); 2) Radial Wire Ground Plane (4 wires, 2 meters long, 5mm in radius) nec_gn_card(nec, 4, 0, 0.0, 0.0, 2.0, 0.005, 0.0, 0.0) */ void nec_gn_card(nec_context* in_context, int itmp1, int itmp2, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); /*! * FR card * @param in_context The nec_context created with nec_create() * @param in_ifrq 0 is a linear range of frequencies, 1 is a log range. * @param in_nfrq The number of frequencies * @param in_freq_mhz The starting frequency in MHz. * @param in_del_freq The frequency step (in MHz for ifrq = 0) */ void nec_fr_card(nec_context* in_context, int in_ifrq, int in_nfrq, double in_freq_mhz, double in_del_freq); /*! * LD card (Loading) * @param in_context The nec_context created with nec_create() * @param ldtyp Type of loading (5 = segment conductivity) * @param ldtag Tag (zero for absolute segment numbers, or in conjunction with 0 for next parameter, for all segments) * @param ldtagf Equal to m specifies the mth segment of the set of segments whose tag numbers equal the tag number specified in the previous parameter. If the previous parameter (LDTAG) is zero, LDTAGF then specifies an absolute segment number. If both LDTAG and LDTAGF are zero, all segments will be loaded. * @param ldtagt Equal to n specifies the nth segment of the set of segments whose tag numbers equal the tag number specified in the parameter LDTAG. This parameter must be greater than or equal to the previous param- eter. The loading specified is applied to each of the mth through nth segments of the set of segments having tags equal to LDTAG. Again if LDTAG is zero, these parameters refer to absolute segment numbers. If LDTAGT is left blank, it is set equal to the previous parameter (LDTAGF). Floating Point Input for the Various Load Types: */ void nec_ld_card(nec_context* in_context, int ldtyp, int ldtag, int ldtagf, int ldtagt, double tmp1, double tmp2, double tmp3); void nec_ex_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_tl_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_nt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_xq_card(nec_context* in_context, int itmp1); void nec_gd_card(nec_context* in_context, double tmp1, double tmp2, double tmp3, double tmp4); /*! \brief Standard radiation pattern parameters \param calc_mode This 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: \arg \c 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. \arg \c 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.) \arg \c 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. \arg \c 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. \arg \c 4 - radial wire ground screen centered at origin. \arg \c 5 - both radial wire ground screen and linear cliff. \arg \c 6 - both radial wire ground screen ant circular cliff. \param n_theta The number of theta angles. \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 nec_rp_card() function will cause 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 nec_rp_card() function is called. \li At a single frequency, any number of nec_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 nec_fr_card() function is greater than one), only one nec_rp_card() function will act as data inside the loop. Subsequent calls to nec_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 nec_rp_card(nec_context* in_context, int calc_mode, int n_theta, int n_phi, int output_format, int normalization, int D, int A, double theta0, double phi0, double delta_theta, double delta_phi, double radial_distance, double gain_norm); void nec_pt_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_pq_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_kh_card(nec_context* in_context, double tmp1); void nec_ne_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_nh_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5, double tmp6); void nec_ek_card(nec_context* in_context, int itmp1); void nec_cp_card(nec_context* in_context, int itmp1, int itmp2, int itmp3, int itmp4); void nec_pl_card(nec_context* in_context, char* ploutput_filename, int itmp1, int itmp2, int itmp3, int itmp4); /*! \brief Get statistics of the gains in dB. This function requires a previous rp_card() method to have been called (with the gain normalization set to 5) \param index The rp_card frequency index \return The maximum gain in dB or -999.0 if no radiation pattern had been previously requested. */ double nec_gain_max(nec_context* in_context, int freq_index); double nec_gain_min(nec_context* in_context, int freq_index); double nec_gain_mean(nec_context* in_context, int freq_index); double nec_gain_sd(nec_context* in_context, int freq_index); double nec_gain_rhcp_max(nec_context* in_context, int freq_index); double nec_gain_rhcp_min(nec_context* in_context, int freq_index); double nec_gain_rhcp_mean(nec_context* in_context, int freq_index); double nec_gain_rhcp_sd(nec_context* in_context, int freq_index); double nec_gain_lhcp_max(nec_context* in_context, int freq_index); double nec_gain_lhcp_min(nec_context* in_context, int freq_index); double nec_gain_lhcp_mean(nec_context* in_context, int freq_index); double nec_gain_lhcp_sd(nec_context* in_context, int freq_index); double nec_impedance_real(nec_context* in_context, int freq_index); double nec_impedance_imag(nec_context* in_context, int freq_index); #ifdef __cplusplus } #endif #endif /* __libnecpp__ */ necpp-1.5.0+cvs20101003/src/c_ggrid.h0000644000175000017500000000350411106432011015227 0ustar numanuma/* Copyright (C) 2004-2006 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __c_ggrid__ #define __c_ggrid__ #include "math_util.h" #include "common.h" #include "misc.h" #include "c_evlcom.h" using namespace std; /** This class was the old FORTRAN common block 'ggrid'. It now contains the ground grid, and methods to do the Sommerfeld stuff. */ class c_ggrid { public: static int m_nxa[3], m_nya[3]; static nec_float m_dxa[3], m_dya[3]; static nec_float m_xsa[3], m_ysa[3]; nec_complex m_epscf; complex_array m_ar1, m_ar2, m_ar3; c_evlcom m_evlcom; void initialize() { m_ar1.resize(11*10*4); m_ar2.resize(17*5*4); m_ar3.resize(9*8*4); } void interpolate( nec_float x, nec_float y, nec_complex *f1, nec_complex *f2, nec_complex *f3, nec_complex *f4 ); void sommerfeld( nec_float epr, nec_float sig, nec_float freq_mhz ); }; class c_ground_wave { public: /* common /gwav/ */ nec_float r1, r2, zmh, zph; nec_complex u, u2, xx1, xx2; void set_u(nec_complex in_u) { u = in_u; u2 = u * u; } }; void gwave( nec_complex& erv, nec_complex& ezv, nec_complex& erh, nec_complex& ezh, nec_complex& eph, c_ground_wave& ground_wave); #endif necpp-1.5.0+cvs20101003/src/matrix_algebra.cpp0000644000175000017500000005230711451332251017162 0ustar numanuma/* Copyright (C) 2004-2008 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA From: Date: Wed Apr 10 1996 - 22:17:10 EDT Re: NEC benchmarks, and a way to speedup your code (maybe) In running benchmarks on different platforms with NEC codes of different origins, anomalous timings could result from the transposed (or not) storage of the matrix. This was discussed in the July 1995 ACES Newsletter. Since many NEC users probably did not see that, there will be versions of NEC around with and without this do-it-yourself change that can greatly speedup the solution. All codes sent out from LLNL since May 1995 have the matrix un-transposed for in-core solution. In NEC-2, 3 and 4 the matrix is stored in transposed form (column,row) for convenience in the out-of-core solution. Transposed storage is unnecessary when the matrix fits into RAM, and will slow down the matrix solution since inner loops in subroutines FACTR and SOLVE are changing the second index in the array. The difference between transposed and normal storage was not very large on older computers, but can be very significant on PCs and workstations that depend on cache storage. On a VAX 6330 the matrix-factor time with matrix transposed was slower than with normal storage by a factor of 1.2. However, on an Alpha 3000/400 the factor was 2.4 and on a Mac 8100 it was 3.5 to 4. Fortunately it is easy to fix this problem if you have a FORTRAN compiler. Rather than changing the entire matrix fill and NGF, you can simply re-transpose the matrix at the beginning of subroutine FACTR. Instructions for doing this were given in the ACES Newsletter, but FACTR and SOLVE routines with the changes made are included below. These should just replace the same routines in NEC-2, 3 or 4 after the parameter MAXSEG has been set correctly. (A confusing factor if you are not used to archaic FORTRAN: 2*MAXSEG sets the size of the complex array D in COMMON/SCRATM/ in FACTR and SOLVE. COMMON/SCRATM/ is contained in several other routines in NEC, and the lengths must match. However, in subroutine RDPAT the array is real, so the dimension would be 4*MAXSEG. If the array in your FACTR and SOLVE has a number for a dimension, then MAXSEG should be half that number. If your code gets the dimension from an INCLUDE file, you should use that INCLUDE.) Re-transposing the matrix takes a little time, proportional to N**2, but saves time proportional to N**3. The amount of time wasted is negligible, and the risk of breaking something if you try to undo the transposed storage throughout the code is great. I do not know whether this change has gotten into the codes on ftp.netcom.com. At least for benchmarks it should be checked that any codes compared are the same, re-transposed for speed or not for "classic" NEC. Jerry Burke LLNL FACTR and SOLVE routines with matrix re-transposed: SUBROUTINE FACTR (N,A,IP,NDIM) C C Purpose: C FACTR computes the LU decomposition of the matrix in A. The C algorithm is described on pages 411-416 OF A. Ralston--A First C Course in Numerical Analysis. Comments below refer to comments in C Ralston's text. (MATRIX TRANSPOSED.) C PARAMETER (MAXSEG=300) COMPLEX A,D,ARJ DIMENSION A(NDIM,NDIM), IP(NDIM) COMMON /SCRATM/ D(2*MAXSEG) INTEGER R,RM1,RP1,PJ,PR C C Un-transpose the matrix for Gauss elimination C DO 12 I=2,N DO 11 J=1,I-1 ARJ=A(I,J) A(I,J)=A(J,I) A(J,I)=ARJ 11 CONTINUE 12 CONTINUE IFLG=0 DO 9 R=1,N C C STEP 1 C DO 1 K=1,N D(K)=A(K,R) 1 CONTINUE C C STEPS 2 AND 3 C RM1=R-1 IF (RM1.LT.1) GO TO 4 DO 3 J=1,RM1 PJ=IP(J) ARJ=D(PJ) A(J,R)=ARJ D(PJ)=D(J) JP1=J+1 DO 2 I=JP1,N D(I)=D(I)-A(I,J)*ARJ 2 CONTINUE 3 CONTINUE 4 CONTINUE C C STEP 4 C DMAX=REAL(D(R)*CONJG(D(R))) IP(R)=R RP1=R+1 IF (RP1.GT.N) GO TO 6 DO 5 I=RP1,N ELMAG=REAL(D(I)*CONJG(D(I))) IF (ELMAG.LT.DMAX) GO TO 5 DMAX=ELMAG IP(R)=I 5 CONTINUE 6 CONTINUE IF (DMAX.LT.1.E-10) IFLG=1 PR=IP(R) A(R,R)=D(PR) D(PR)=D(R) C C STEP 5 C IF (RP1.GT.N) GO TO 8 ARJ=1./A(R,R) DO 7 I=RP1,N A(I,R)=D(I)*ARJ 7 CONTINUE 8 CONTINUE IF (IFLG.EQ.0) GO TO 9 WRITE(3,10) R,DMAX IFLG=0 9 CONTINUE RETURN C 10 FORMAT (' FACTR: PIVOT(',I3,')=',1PE16.8) END SUBROUTINE SOLVE (N,A,IP,B,NDIM) C======================================================================= C (C) Copyright 1992 C The Regents of the University of California. All rights reserved. C======================================================================= C C SOLVE solves the matrix equation LU*X=B where L is a unit C lower triangular matrix and U is an upper triangular matrix both C of which are stored in A. The RHS vector B is input and the C solution is returned through vector B. C PARAMETER (MAXSEG=300) COMPLEX A,B,Y,SUM INTEGER PI COMMON /SCRATM/ Y(2*MAXSEG) DIMENSION A(NDIM,NDIM), IP(NDIM), B(NDIM) C C FORWARD SUBSTITUTION C DO 3 I=1,N PI=IP(I) Y(I)=B(PI) B(PI)=B(I) IP1=I+1 IF (IP1.GT.N) GO TO 2 DO 1 J=IP1,N B(J)=B(J)-A(J,I)*Y(I) 1 CONTINUE 2 CONTINUE 3 CONTINUE C C BACKWARD SUBSTITUTION C DO 6 K=1,N I=N-K+1 SUM=(0.,0.) IP1=I+1 IF (IP1.GT.N) GO TO 5 DO 4 J=IP1,N SUM=SUM+A(I,J)*B(J) 4 CONTINUE 5 CONTINUE B(I)=(Y(I)-SUM)/A(I,I) 6 CONTINUE RETURN END */ #include "math_util.h" #include using namespace std; #include "nec_exception.h" #include "matrix_algebra.h" #include "nec_output.h" #include "config.h" #ifdef NEC_MATRIX_CHECK //#define NEC_MATRIX_CHECK void to_octave(nec_complex& x); void to_octave(nec_complex& x) { cout << real(x) << " + " << imag(x) << "I"; } void to_octave(int& x); void to_octave(int& x) { cout << x; } void to_octave(nec_complex* a, int n, int ndim); void to_octave(nec_complex* a, int n, int ndim) { cout << "["; for (int row = 0; row < n; row++ ) { int row_offset = row*ndim; for (int i = 0; i < n; i++ ) { to_octave(a[i+row_offset]); if (i < n-1) cout << ", "; } if (row < n-1) cout << "; "; } cout << "];" << endl; } void to_octave(complex_array& a, int n, int ndim); void to_octave(complex_array& a, int n, int ndim) { to_octave(a.get_ptr(),n,ndim); } void to_octave(int* a, int n); void to_octave(int* a, int n) { cout << "["; for (int i = 0; i < n; i++ ) { to_octave(a[i]); if (i < n-1) cout << ", "; } cout << "];" << endl; } void to_octave(int_array& a, int n); void to_octave(int_array& a, int n) { to_octave(a.get_ptr(),n); } #endif #ifndef LAPACK /*! \brief Solve The system of equations using Gaussian Elimination. Subroutine to factor a matrix into a unit lower triangular matrix and an upper triangular matrix using the Gauss-Doolittle algorithm presented on pages 411-416 of A. Ralston -- a first course in numerical analysis. Comments below refer to comments in Ralstons text. (matrix transposed.) */ void lu_decompose(nec_output_file& s_output, int n, complex_array& a, int_array& ip, int ndim) { DEBUG_TRACE("lu_decompose_ge(" << n << "," << ndim << ")"); #ifdef NEC_MATRIX_CHECK // Debug output to try and figure out the LAPACK stuff cout << "a = "; to_octave(a,n,ndim); #endif /* Allocate scratch memory */ complex_array scm; scm.resize(n); /* Un-transpose the matrix for Gauss elimination */ for (int i = 1; i < n; i++ ) { int i_offset = i * ndim; int j_offset = 0; for (int j = 0; j < i; j++ ) { nec_complex aij = a[i+j_offset]; a[i+j_offset] = a[j+i_offset]; a[j+i_offset] = aij; j_offset += ndim; } } bool iflg=false; /* step 1 */ for (int r = 0; r < n; r++ ) { int r_offset = r*ndim; for (int k = 0; k < n; k++ ) scm[k]= a[k+r_offset]; /* steps 2 and 3 */ int rm1 = r; for (int j = 0; j < rm1; j++ ) { int pj= ip[j]-1; nec_complex arj = scm[pj]; a[j+r_offset]= arj; scm[pj]= scm[j]; int jp1 = j+1; int j_offset = j*ndim; for (int i = jp1; i < n; i++ ) scm[i] -= a[i+j_offset]* arj; } /* step 4 */ nec_float dmax = norm(scm[r]); int rp1 = r+1; ip[r]= rp1; for (int i = rp1; i < n; i++ ) { nec_float elmag = norm(scm[i]); if ( elmag >= dmax) { dmax = elmag; ip[r] = i+1; // set the permute array element } } if ( dmax < 1.e-10) iflg=true; int pr = ip[r]-1; a[r+r_offset] = scm[pr]; scm[pr] = scm[r]; /* step 5 */ if ( rp1 < n) { nec_complex arr = cplx_10() / a[r+r_offset]; for (int i = rp1; i < n; i++ ) a[i+r_offset]= scm[i]* arr; } if ( true == iflg ) { s_output.string("\n PIVOT("); s_output.integer(r); s_output.string(")= "); s_output.real(dmax); iflg=false; } } /* for( r=0; r < n; r++ ) */ #ifdef NEC_MATRIX_CHECK cout << "solved = "; to_octave(a,n,ndim); cout << "ip = "; to_octave(ip,n); #endif } /*! \brief Subroutine to solve the matrix equation lu*x=b where l is a unit lower triangular matrix and u is an upper triangular matrix both of which are stored in a. the rhs vector b is input and the solution is returned through vector b. (matrix transposed) COMPLEX*16 A,B,Y,SUM INTEGER PI COMMON /SCRATM/ Y(2*MAXSEG) DIMENSION A(NDIM,NDIM), IP(NDIM), B(NDIM) C C FORWARD SUBSTITUTION C DO 3 I=1,N PI=IP(I) Y(I)=B(PI) B(PI)=B(I) IP1=I+1 IF (IP1.GT.N) GO TO 2 DO 1 J=IP1,N B(J)=B(J)-A(J,I)*Y(I) 1 CONTINUE 2 CONTINUE 3 CONTINUE C C BACKWARD SUBSTITUTION C DO 6 K=1,N I=N-K+1 SUM=(0.,0.) IP1=I+1 IF (IP1.GT.N) GO TO 5 DO 4 J=IP1,N SUM=SUM+A(I,J)*B(J) 4 CONTINUE 5 CONTINUE B(I)=(Y(I)-SUM)/A(I,I) 6 CONTINUE RETURN END */ void solve( int n, complex_array& a, int_array& ip, complex_array& b, int ndim ) { DEBUG_TRACE("solve(" << n << "," << ndim << ")"); /* We should use zgetrs from LAPACK to solve this. */ complex_array y(n); /* forward substitution */ for (int i = 0; i < n; i++ ) { int pivot_index = ip[i]-1; y[i]= b[pivot_index]; b[pivot_index]= b[i]; int ip1= i+1; int i_offset = i*ndim; for (int j = ip1; j < n; j++ ) b[j] -= a[j+i_offset] * y[i]; } /* backward substitution */ for (int k = 0; k < n; k++ ) { int i= n-k-1; nec_complex sum(cplx_00()); int ip1= i+1; for (int j = ip1; j < n; j++ ) sum += a[i+j*ndim]* b[j]; b[i] = (y[i]- sum) / a[i+i*ndim]; } } #else /* LAPACK */ #warning("Using lapack") extern "C" { //#include #include } // extern "C" void zgetrf_( int *M, int *N, void *A, int *LDA, int *IPIV, int *INFOp); // //SUBROUTINE DGETRF( M, N, A, LDA, IPIV, INFO ) // int lapack_zgetrf(int M, int N, void *A, int LDA, int *IPIV) // { // int info; // zgetrf_(&M, &N, (void*)A, &LDA, IPIV, &info); // return info; // } // // // #warning "Using LAPACK for Matrix Operations" /*! Use lapack to perform LU decomposition */ void lu_decompose(nec_output_file& s_output, int n, complex_array& a_in, int_array& ip, int ndim) { DEBUG_TRACE("factor_lapack(" << n << "," << ndim << ")"); ASSERT(n <= ndim); #ifdef NEC_MATRIX_CHECK cout << "atlas_a = "; to_octave(a_in,n,ndim); #endif /* Un-transpose the matrix for Gauss elimination */ for (int i = 1; i < n; i++ ) { int i_offset = i * ndim; int j_offset = 0; for (int j = 0; j < i; j++ ) { nec_complex aij = a_in[i+j_offset]; a_in[i+j_offset] = a_in[j+i_offset]; a_in[j+i_offset] = aij; j_offset += ndim; } } /* Now call the LAPACK LU-Decomposition ZGETRF computes an LU factorization of a general M-by-N matrix A * using partial pivoting with row interchanges. * * The factorization has the form * A = P * L * U * where P is a permutation matrix, L is lower triangular with unit * diagonal elements (lower trapezoidal if m > n), and U is upper * triangular (upper trapezoidal if m < n). Arguments * ========= * * M (input) INTEGER * The number of rows of the matrix A. M >= 0. * * N (input) INTEGER * The number of columns of the matrix A. N >= 0. * * A (input/output) COMPLEX*16 array, dimension (LDA,N) * On entry, the M-by-N matrix to be factored. * On exit, the factors L and U from the factorization * A = P*L*U; the unit diagonal elements of L are not stored. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,M). * * IPIV (output) INTEGER array, dimension (min(M,N)) * The pivot indices; for 1 <= i <= min(M,N), row i of the * matrix was interchanged with row IPIV(i). * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, U(i,i) is exactly zero. The factorization * has been completed, but the factor U is exactly * singular, and division by zero will occur if it is used * to solve a system of equations. */ int info = clapack_zgetrf (CblasColMajor, n, n, (void*) a_in.data(), ndim, ip.data()); if (0 != info) { /* The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. */ throw new nec_exception("nec++: LU Decomposition Failed: ",info); } #ifdef NEC_MATRIX_CHECK cout << "atlas_solved = "; to_octave(a_in,n,ndim); cout << "atlas_ip = "; to_octave(ip,n); #endif } // extern "C" void zgetrs_(char* TRANS, int* N, int* NRHS, void *A, int* LDA, int *IPIV, void* B, int* LDB, int *INFOp); // // SUBROUTINE ZGETRS( TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO ) // int lapack_zgetrs(int N, int NRHS, void *A, int LDA, int *IPIV, void* B, int LDB) // { // int info; // char transp = 'N'; // zgetrs_(&transp, &N, &NRHS, (void*)A, &LDA, IPIV, B, &LDB, &info); // return info; // } /*! \brief Subroutine to solve the matrix equation lu*x=b where l is a unit lower triangular matrix and u is an upper triangular matrix both of which are stored in a. the rhs vector b is input and the solution is returned through vector b. (matrix transposed) */ void solve( int n, complex_array& a, int_array& ip, complex_array& b, int ndim ) { DEBUG_TRACE("solve(" << n << "," << ndim << ")"); int info = clapack_zgetrs (CblasColMajor, CblasNoTrans, n, 1, (void*) a.data(), ndim, ip.data(), b.data(), n); if (0 != info) { /* The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. */ throw new nec_exception("nec++: Solving Failed: ",info); } } #endif /* LAPACK */ /*-----------------------------------------------------------------------*/ /** factrs For symmetric structure, transforms submatricies to form matricies of the symmetric modes and calls routine to LU decompose matricies. If no symmetry [nrow = np], the routine is called to LU decompose the complete matrix. */ void factrs(nec_output_file& s_output, int np, int nrow, complex_array& a, int_array& ip ) { DEBUG_TRACE("factrs(" << np << "," << nrow << ")"); if (nrow == np) // no symmetry { lu_decompose(s_output, np, a, ip, nrow ); return; } int num_symmetric_modes = nrow / np; DEBUG_TRACE("\tnum_symmetric_modes = " << num_symmetric_modes); for (int mode = 0; mode < num_symmetric_modes; mode++ ) { int mode_offset = mode * np; complex_array a_temp = a.segment(mode_offset); int_array ip_temp = ip.segment(mode_offset); lu_decompose(s_output, np, a_temp, ip_temp, nrow ); } } /*-----------------------------------------------------------------------*/ /** Subroutine solves, for symmetric structures, handles the transformation of the right hand side vector and solution of the matrix eq. \param neq number of equations? \param nrh dimension of right hand vector? */ void solves(complex_array& a, int_array& ip, complex_array& b, int neq, int nrh, int np, int n, int mp, int m, int nop, complex_array& symmetry_array ) { DEBUG_TRACE("solves(" << neq << "," << nrh << "," << np << "," << n << ")"); DEBUG_TRACE(" ( nop=" << nop << ")"); /* Allocate some scratch memory */ complex_array scm; scm.resize(n + 2*m); int npeq= np+ 2*mp; nec_float fnop = nop; nec_float fnorm = 1.0/ fnop; int nrow= neq; if ( nop != 1) { for (int ic = 0; ic < nrh; ic++ ) { int column_offset = ic*neq; if ( (n != 0) && (m != 0) ) { for (int i = 0; i < neq; i++ ) scm[i]= b[i+column_offset]; int j= np-1; for (int k = 0; k < nop; k++ ) { if ( k != 0 ) { int ia= np-1; for (int i = 0; i < np; i++ ) { ia++; j++; b[j+column_offset]= scm[ia]; } if ( k == (nop-1) ) continue; } /* if ( k != 0 ) */ int mp2 = 2*mp; int ib= n-1; for (int i = 0; i < mp2; i++ ) { ib++; j++; b[j+column_offset]= scm[ib]; } } /* for( k = 0; k < nop; k++ ) */ } /* if ( (n != 0) && (m != 0) ) */ /* transform matrix eq. rhs vector according to symmetry modes */ for (int i = 0; i < npeq; i++ ) { for (int k = 0; k < nop; k++ ) { int ia= i+ k* npeq; scm[k]= b[ia+column_offset]; } nec_complex sum_normal(scm[0]); for (int k = 1; k < nop; k++ ) sum_normal += scm[k]; b[i+column_offset]= sum_normal * fnorm; for (int k = 1; k < nop; k++ ) { int ia= i+ k* npeq; nec_complex sum(scm[0]); for (int j = 1; j < nop; j++ ) sum += scm[j]* conj( symmetry_array[k+j*nop]); b[ia+column_offset]= sum* fnorm; } } /* for( i = 0; i < npeq; i++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ } /* if ( nop != 1) */ /* solve each mode equation */ for (int kk = 0; kk < nop; kk++ ) { int ia= kk* npeq; for (int ic = 0; ic < nrh; ic++ ) { int column_offset = ic*neq; complex_array a_sub = a.segment(ia); complex_array b_sub = b.segment(ia+column_offset); int_array ip_sub = ip.segment(ia); solve( npeq, a_sub, ip_sub, b_sub, nrow ); } } /* for( kk = 0; kk < nop; kk++ ) */ if ( nop == 1) { return; } /* inverse transform the mode solutions */ for (int ic = 0; ic < nrh; ic++ ) { int column_offset = ic*neq; for (int i = 0; i < npeq; i++ ) { for (int k = 0; k < nop; k++ ) { int ia= i+ k* npeq; scm[k]= b[ia+column_offset]; } nec_complex sum_normal(scm[0]); for (int k = 1; k < nop; k++ ) sum_normal += scm[k]; b[i+column_offset]= sum_normal; for (int k = 1; k < nop; k++ ) { int ia= i+ k* npeq; nec_complex sum(scm[0]); for (int j = 1; j < nop; j++ ) sum += scm[j]* symmetry_array[k+j*nop]; b[ia+column_offset]= sum; } } /* for( i = 0; i < npeq; i++ ) */ if ( (n == 0) || (m == 0) ) continue; for (int i = 0; i < neq; i++ ) scm[i]= b[i+column_offset]; int j = np-1; for (int k = 0; k < nop; k++ ) { if ( k != 0 ) { int ia = np-1; for (int i = 0; i < np; i++ ) { ia++; j++; b[ia+column_offset]= scm[j]; } if ( k == nop) continue; } /* if ( k != 0 ) */ int ib = n-1; int mp2 = 2* mp; for (int i = 0; i < mp2; i++ ) { ib++; j++; b[ib+column_offset]= scm[j]; } } /* for( k = 0; k < nop; k++ ) */ } /* for( ic = 0; ic < nrh; ic++ ) */ } /*-----------------------------------------------------------------------*/ /** \brief test for convergence in numerical integration */ void test( nec_float f1r, nec_float f2r, nec_float *tr, nec_float f1i, nec_float f2i, nec_float *ti, nec_float dmin ) { static nec_float _min_val = 1.0e-37; /* { double den; den= fabs( f2r); *tr= fabs( f2i); if( den < *tr) den= *tr; if( den < dmin) den= dmin; if( den < 1.0e-37) { *tr=0.; *ti=0.; return; } *tr= fabs(( f1r- f2r)/ den); *ti= fabs(( f1i- f2i)/ den); } */ nec_float den = fabs( f2r); nec_float temp_tr = fabs( f2i); if( den < temp_tr) den = temp_tr; if( den < dmin) den = dmin; if( den < _min_val) { *tr = 0.0; *ti = 0.0; return; } *tr= fabs((f1r - f2r)/ den); *ti= fabs((f1i - f2i)/ den); } /** Simpler test for convergence in numerical integration. This tests only one number. It is a special case of the test() function above. */ nec_float test_simple( nec_float f1r, nec_float f2r, nec_float dmin ) { static nec_float _min_val = 1.0e-37; nec_float den = fabs(f2r); if( den < dmin) den = dmin; if (den < _min_val) { return 0.0; } return fabs((f1r - f2r) / den); } necpp-1.5.0+cvs20101003/src/CVS/0000755000175000017500000000000011452152157014127 5ustar numanumanecpp-1.5.0+cvs20101003/src/CVS/Root0000644000175000017500000000007011452152150014763 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/src/CVS/Repository0000644000175000017500000000001211452152150016213 0ustar numanumanecpp/src necpp-1.5.0+cvs20101003/src/CVS/Entries0000644000175000017500000000435411452152157015471 0ustar numanuma/AntennaInput.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /BaseInput.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /CurrentInput.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /Makefile.am/1.7/Tue Jan 6 02:31:53 2009// /PowerBudget.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /RadiationInput.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /XGetopt.cpp/1.5/Fri Oct 1 10:27:04 2010// /XGetopt.h/1.4/Fri Oct 1 10:27:05 2010// /atlas_check.cpp/1.3/Fri Jan 11 04:26:58 2008// /atlas_check.sh/1.3/Sun Jul 27 02:54:53 2008// /c_evlcom.cpp/1.2/Fri Jan 11 04:26:58 2008// /c_evlcom.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /c_geometry.cpp/1.21/Sat Oct 2 10:39:51 2010// /c_geometry.h/1.6/Tue Jan 6 04:09:44 2009// /c_ggrid.cpp/1.5/Wed Nov 12 01:40:25 2008// /c_ggrid.h/1.4/Wed Nov 12 01:40:25 2008// /c_plot_card.cpp/1.2/Fri Aug 1 01:12:53 2008// /c_plot_card.h/1.2/Fri Aug 1 01:12:53 2008// /common.h/1.12/Sat Oct 2 10:42:33 2010// /electromag.cpp/1.1/Fri Mar 10 00:41:19 2006// /electromag.h/1.3/Fri Mar 10 00:41:19 2006// /libNEC.cpp/1.5/Mon Sep 27 11:06:05 2010// /libnecpp.h/1.8/Mon Sep 27 11:06:12 2010// /math_util.h/1.6/Fri Dec 19 00:29:54 2008// /matrix_algebra.cpp/1.14/Fri Oct 1 10:15:05 2010// /matrix_algebra.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /misc.cpp/1.1.1.1/Fri Sep 9 04:39:10 2005// /misc.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /nec2cpp.cpp/1.8/Sat Oct 2 10:39:51 2010// /nec2cpp.h/1.1.1.1/Fri Sep 9 04:39:10 2005// /necDiff.cpp/1.1.1.1/Fri Sep 9 04:39:10 2005// /nec_context.cpp/1.26/Sat Oct 2 10:39:51 2010// /nec_context.h/1.13/Sat Dec 27 09:23:07 2008// /nec_debug.h/1.1.1.1/Fri Sep 9 04:39:11 2005// /nec_exception.cpp/1.3/Mon Dec 8 23:39:27 2008// /nec_exception.h/1.4/Tue Jan 6 04:34:08 2009// /nec_ground.cpp/1.2/Thu Mar 9 23:38:54 2006// /nec_ground.h/1.3/Mon Dec 8 23:39:27 2008// /nec_output.cpp/1.4/Wed Nov 12 01:40:25 2008// /nec_output.h/1.1.1.1/Fri Sep 9 04:39:11 2005// /nec_radiation_pattern.cpp/1.15/Tue Jan 6 02:31:53 2009// /nec_radiation_pattern.h/1.17/Tue Sep 28 12:44:40 2010// /nec_results.h/1.11/Thu Dec 18 13:04:16 2008// /nec_structure_currents.cpp/1.9/Tue Jan 6 04:09:44 2009// /nec_structure_currents.h/1.8/Tue Jan 6 04:09:44 2009// /nec_wire.h/1.4/Mon Sep 27 11:06:12 2010// /net_solve.cpp/1.2/Sun Dec 14 03:26:05 2008// /safe_array.h/1.13/Mon Dec 29 10:02:12 2008// D necpp-1.5.0+cvs20101003/src/nec_output.h0000644000175000017500000000446210310210757016031 0ustar numanuma#ifndef __nec_output__ #define __nec_output__ /* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "math_util.h" #include "nec_debug.h" class nec_output_flags { public: nec_output_flags() { do_gain = false; do_nec_output = true; } void set_gain_only(bool in_gain_only) { do_gain = in_gain_only; do_nec_output = !in_gain_only; } bool get_nec_flag() { return do_nec_output; } bool get_gain_flag() { return do_gain; } private: bool do_gain; bool do_nec_output; }; class nec_output_file { public: nec_output_file(); void set_file(FILE* in_fp); void endl(int n_lines = 1); void end_section(); void set_indent(int n = 0); void line(const char* in_str); void string(const char* in_str, bool require_endl = false); void real(nec_float in_nec_float); void real_out(int w, int p, nec_float f, bool sci = true); void integer(long in_integer); void set_error_mode(bool f); void nec_printf(const char* fmt, ...); FILE* get_fp() { return m_output_fp; } private: void indent(); void do_output(const char* str); FILE* m_output_fp; bool m_require_indent; int m_indent; bool m_error_mode; FILE* m_error_fp; }; /** A little class for setting up error mode, and then automatically going back to normal output mode. Usage { nec_error_mode em(s_output); s_output.line("Darn..."); } s_output.line("Normal output here"); */ class nec_error_mode { public: nec_error_mode(nec_output_file& of) : m_of(of) { of.set_error_mode(true); } ~nec_error_mode() { m_of.set_error_mode(false); } private: nec_output_file& m_of; }; #endif /* __nec_output__ */ necpp-1.5.0+cvs20101003/src/nec_ground.h0000644000175000017500000001261211117330057015765 0ustar numanuma/* Copyright (C) 2004 Timothy C.A. Molteno This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __nec_ground__ #define __nec_ground__ #include "common.h" #include "math_util.h" #include "nec_debug.h" /* \section{NEC Ground Specification} \subsection{the GN Card} The GN card 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. The parameters of the second medium can also be specified on another data card whose mnemonic is GD. With the GD card, the parameters of the second medium can be varied and only the radiated fields need to be recalculated. Furthermore, if a radial wire ground screen has been specified on the GN card, the GD card is the only way to include a second medium. See Section~\ref{sec_card_gd} for details. \subsection{"gd" card: ground representation} \label{sec_card_gd} To specify the ground parameters of a second medium which is not in the immediate vicinity of the antenna. This card may only be used if a GN card has also been used. It does not affect the fields of surface patches. < */ class nec_ground { public: nec_ground() { default_values(); } nec_ground(const nec_ground& in_ground) { iperf = in_ground.iperf; ksymp = in_ground.ksymp; epsr = in_ground.epsr; // relative dielectric constant sig = in_ground.sig; // Conductivity // radial wire ground radial_wire_count = in_ground.radial_wire_count; radial_wire_length = in_ground.radial_wire_length; radial_wire_radius = in_ground.radial_wire_radius; // second medium parameters cliff_edge_distance = in_ground.cliff_edge_distance; cliff_height = in_ground.cliff_height; epsr2 = in_ground.epsr2; // Relative dielectric constant sig2 = in_ground.sig2; // Conductivity in mhos/meter } void default_values() { zrati=cplx_10(); ksymp=1; radial_wire_count = 0; radial_wire_length = 0.0; radial_wire_radius = 0.0; iperf=0; /*22/09/2005 : added initialization for sig and epsr*/ epsr = 0; sig = 0; } /* Parse a GN card. The input parameters here are the fields of the GN card. */ void parse_gn(int itmp1, int itmp2, nec_float tmp1, nec_float tmp2, nec_float tmp3, nec_float tmp4, nec_float tmp5, nec_float tmp6 ); /* Setup a cliff (two medium ground) */ void setup_cliff(nec_float in_eprs2, nec_float in_sig2, nec_float clt, nec_float cht); nec_complex get_zrati2(nec_float wavelength); nec_float get_cl(nec_float wavelength) // cliff edge in wavelengths, { return cliff_edge_distance / wavelength; } nec_float get_ch(nec_float wavelength) // cliff Height in wavelengths. { return cliff_height / wavelength; } nec_complex get_zrati_sqr() const { return zrati*zrati; } // accessors for the ground type inline bool type_finite_reflection() { return (0 == iperf); } inline bool type_perfect() { return (1 == iperf); } inline bool type_sommerfeld_norton() { return (2 == iperf); } bool is_valid() const { if (iperf < 0) return false; if (iperf > 2) return false; if (ksymp < 1) return false; if (ksymp > 2) return false; return true; } /*! \brief Return true if a ground is present */ bool present() const { ASSERT(is_valid()); if (2 == ksymp) return true; return false; } nec_float epsr; // relative dielectric constant nec_float sig; // Conductivity // radial wire ground int radial_wire_count; nec_float radial_wire_length; nec_float radial_wire_radius; // second medium parameters nec_float cliff_edge_distance; nec_float cliff_height; nec_float epsr2; // Relative dielectric constant nec_float sig2; // Conductivity in mhos/meter // MOVE THESE TO THE GROUND nec_float scrwl; // length of wires in radial-wire ground-screen in wavelengths nec_float scrwr; // radius of wires in radial-wire ground-screen in wavelengths nec_complex m_t1; nec_float t2; // constants for the radial-wire ground-screen impedance nec_complex zrati, frati; nec_float t1; // constants for the radial-wire ground-screen impedance /** Ground Flag. ==1 no ground, =2 ground present */ int ksymp; private: /* iperf: Ground-type flag. The options are: -1 - nullifies ground parameters previously used and sets free- space condition. The remainder of the card is left blank in this case. O - finite ground, reflection-coefficient approximation. 1 - perfectly conducting ground. 2 - finite ground, Sommerfeld/Norton method. */ int iperf; }; #endif /* __nec_ground__ */ necpp-1.5.0+cvs20101003/win32/0000755000175000017500000000000011452152163013644 5ustar numanumanecpp-1.5.0+cvs20101003/win32/nec2++/0000755000175000017500000000000011452152163014621 5ustar numanumanecpp-1.5.0+cvs20101003/win32/nec2++/nec2++.sln0000644000175000017500000000157310310210764016314 0ustar numanumaMicrosoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nec2++", "nec2++.vcproj", "{DEBF3687-CC50-4D98-A234-E6B9BC618609}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {DEBF3687-CC50-4D98-A234-E6B9BC618609}.Debug.ActiveCfg = Debug|Win32 {DEBF3687-CC50-4D98-A234-E6B9BC618609}.Debug.Build.0 = Debug|Win32 {DEBF3687-CC50-4D98-A234-E6B9BC618609}.Release.ActiveCfg = Release|Win32 {DEBF3687-CC50-4D98-A234-E6B9BC618609}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal necpp-1.5.0+cvs20101003/win32/nec2++/nec2++.vcproj0000644000175000017500000001240110310210764017013 0ustar numanuma necpp-1.5.0+cvs20101003/win32/nec2++/CVS/0000755000175000017500000000000011452152163015254 5ustar numanumanecpp-1.5.0+cvs20101003/win32/nec2++/CVS/Root0000644000175000017500000000007011452152163016117 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/win32/nec2++/CVS/Repository0000644000175000017500000000002311452152163017351 0ustar numanumanecpp/win32/nec2++ necpp-1.5.0+cvs20101003/win32/nec2++/CVS/Entries0000644000175000017500000000014311452152163016606 0ustar numanuma/nec2++.sln/1.1.1.1/Fri Sep 9 04:39:16 2005// /nec2++.vcproj/1.1.1.1/Fri Sep 9 04:39:16 2005// D necpp-1.5.0+cvs20101003/win32/CVS/0000755000175000017500000000000011452152163014277 5ustar numanumanecpp-1.5.0+cvs20101003/win32/CVS/Entries.Log0000644000175000017500000000001711452152163016351 0ustar numanumaA D/nec2++//// necpp-1.5.0+cvs20101003/win32/CVS/Root0000644000175000017500000000007011452152163015142 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/win32/CVS/Repository0000644000175000017500000000001411452152163016374 0ustar numanumanecpp/win32 necpp-1.5.0+cvs20101003/win32/CVS/Entries0000644000175000017500000000000211452152163015623 0ustar numanumaD necpp-1.5.0+cvs20101003/Makefile.cvs0000644000175000017500000000014610310210751015123 0ustar numanumadefault: all all: libtoolize --force --copy aclocal autoheader automake --add-missing autoconf necpp-1.5.0+cvs20101003/AUTHORS0000644000175000017500000000036510740110415013747 0ustar numanumaThe C++ port started and completed by Tim Molteno The Python work is done by Remi Sassolas This work could not have been done without the tremendous effort put into the C port by Neoklis Kyriazis. necpp-1.5.0+cvs20101003/ChangeLog0000644000175000017500000002554211451615014014462 0ustar numanumaVersion 1.5 - 2010-10-02 * Added a test for segment midpoint intersections. If two wires are joined at acute angles to each other, this can lead to inaccurate simulations. If either the first or last segment midpoint of a wire lies inside any other wire an exception is thrown with a message. * Better exception handling in the Ruby binding. Exception's now have their messages passed through. * Improved preporting of power gain. This means that hopefully (not quite fully tested) the gain normalization does not any longer have any effect on the get_maximum_gain functions e.t.c. * Modified to work with atlas 3.8 * Fixed up the benchmark to avoid wires at a very acute angles (violating the midpoint intersection test) Version 1.4 - 2009-01-02 * Added accessor functions for radiation pattern statistics. * Renamed some methods * Added Ruby Wrapper to the C library * Added code to detect wire intersections and throw an exception. * Renamed some methods in the C library interface. This makes a more logical grouping when getting statistics from radiation patterns. * Added Ruby Wrapper to the C library libnecpp. This code is in the directory Ruby. Version 1.3 * Using the correct value for speed of light throughout (was using 299.8 as default freq, and this caused slight problems. Now using 1 meter as default wavelength (rather than 299.8 as the default frequency) * Added error message when segment length is less that 0.01 wavelengths long. * Added accessor functions for RHCP and LHCP receiving gain to nec_radiation_pattern nec_float get_power_gain_tot(int theta_index, int phi_index) const nec_float get_power_gain_rhcp(int theta_index, int phi_index) const nec_float get_power_gain_lhcp(int theta_index, int phi_index) const * Changes geometry parsing to make ix,iy,iz local variables. Set iy=0 before calling reflect for GR card. Version 1.2.9 * Improvements to the LAPACK use. Autoconf now checks for the correct functions. Version 1.2.8 * We NOW are using LAPACK. Huge speed bonus. Run configure with the option --with-lapack to compile this in. You will need to install some LAPACK libraries. Some work needed in the autoconf files (configure.in) to make this work correctly on more platforms. On debian use aptitude install libatlas-base-dev Version 1.2.7 * Some work on using ATLAS for the Gaussian Elimination. * cleaned up some code that produced warnings in gcc 4.2 (const char coercions) Version 1.2.6 * Added output flag for XML -x * Cleaned up output file handling in nec_results (a little) Version 1.2.5 * Fixed a bug in handling of patches. Thanks to the hard work of Neoklis and Jerry Burke (original author), this has been sorted out. It is tested with neokliks_bug.nec (in test data) and caused a segmentation fault in all versions, C, C++ and FORTRAN. * Some code has been added for handling arbitrary media - permittivity and permeability. A new card has been added as well. Version 1.2.4 * (Remi Sassolas) Major Progress in the Python Port * (Remi Sassolas) Fixed crashing bug in structure current printing. This bug would happen when someone absent-minded (or just silly) would ask the currents to be printed using the output format designed for a receiving pattern, but wouldn't use an incident plane wave as the excitation type. Then NEC-2 would crash (segmentation fault) * (Remi Sassolas) New Results object for handling structure currents. Version 1.2.3 * Added new test case (pjw_small.nec) that appears to fail on the radiation pattern result when compared to original FORTRAN. This was caused by an error in the original FORTRAN parser. Decided to do better and use a proper LL(k) parser generator. * Added ANTLR grammar (see http://www.antlr.org) that generates a parser for nec files. This was motivated by a silent failure the caused the wrong result to be printed. For the moment this development is separate (inside the antlr directory). However by version 1.3 we will be using an ANTLR grammar. * Moved lots of code from header files into .cpp files. This makes the libnecpp more usable as a C++ shared library. * Added a new method 'calculate_network_data()' to the nec_context class. This separates out the calculations from the print_network_data() method. This code is still ugly but should be functional. * Moved development to alioth.debian.org to support the python programming effort. * src/PowerBudget.h: Allow for blank line following POWER INPUT to cope with FORTRAN output * src/nec2cpp.cpp: Check number of parameters in the TL card and return an error if not all parameters are supplied. This resolves an ambiguity when blank parameters are present (we can't test for these). * src/nec_radiation_pattern.h: Added accessor functions to the nec_radiation_pattern results class. * Added an example file "example/test_nec.cpp" to show how to use a results object from a C++ program. Version 1.2.2 * Trap condition where n<=1 in c_geometry::connect_segments pending finding where the bug is. The array icon1 does not have its values initialized under these circumstances and bad things happen (walk all over memory). * Cleaned up the connect_segments code in c_geometry.h. Moved many variable declarations into local contexts. * Added L1-norm and Euclidian norm to the nec_3vector class (use it in c_geometry::connect_segments) * Clean up local variables in nec_context::nhfld() * Clean up local variables in nec_context::pcint() * Fixed conversion of int to bool when calling nec_context::efld(). Removed unnecessary ij variable. Version 1.2.1 * Make ksymp a private member of nec_ground. Replaced it with a boolean accessor method present() that indicates whether the ground is present. Then removed some ugly code in nec_context::efld(). * Switched on all warnings I can think of (more than -Wall) in the debug build. This found a lot of shadowed variables. * Removed shadowed variables in c_geometry. * Switched normalized receiving pattern output to use the results object. Version 1.2 * Cleaned up: degree to radian conversion. Speedup. Radiation Pattern Code. Easier to read (plenty of work left) * New Results API allows easy access to simulation results, currently includes the following output * Antenna Input parameters * Normalized Receiving Pattern * Radiation Pattern * Structure excitation * Note: The new radiation pattern output will generate phases of complex numbers that are between -180 and +180. For example -195 will appear as +165 degrees. * Enabled the writing of some data to standard output (-s command line option) * NEW: Data can be written in comma-separated-value format for easy importing into other plotting programmes. * Fixed bug in printing STRUCTURE EXCITATION data (the segment number was incorrect) * Testharness fixes * Faster benchmark code (similar output values) This is because we are using some dynamic benchmarking of clients in a heterogenous multiprocessing systemm. Version 1.1.4 * Removed the inclusion of c_geometry.h from nec_context.h. This got rid of some unnecessary dependencies. Also changed nec_context to point to a geometry object (rather than own it). * Added classes for representation of geometry -- to construct XML geometry descriptions. * Added enum for excitation type * New nec_3vector class to simplify vast amounts of code. * Fixed bug in current excitation (inside etmns). Bug exists also in nec2c. This occurs if the excitation type (excite_type) parameter is EXCITATION_CURRENT. * Changed the parameters of the rp_card function to explicitly take the XNDA parameters as separate integers. This avoids 0500 being passed in as an octal number! * Code cleanup in c_geometry::tbf() Version 1.1.3 * Slight changes to benchmarking output. * Notes on compilation Version 1.1.2 * New header files for the libnecpp.h. * Moved to libtool for library generation. * Minor code cleanup in c_evlcom (variable renaming and commenting) * Added endl() to version. Version 1.1.1 21 January 2005. * Cleaned up and reworked patch subdivision. * Fixed a bug in interpolate() caused by not having the precalculated data static. Thanks to Neokolis for pointing this out. * Cleaned up rom2() and rechecked program flow. Version 1.1.0 20 January 2005. * Got LAPACK going. There is generally a 100% speedup. However the LAPACK routines sometimes produce different answers to the built in LU decomposition routine? Therefore LAPACK LU decompositions is still not included in the default build. * Fixed up a re-initialization problem in the temporary geometry files. * Several Improved testharness code. * Moved temporary geometry into the geometry class. Set this up in the geometry_complete() method. * Added #include to misc.cpp * Ignore Radiation Pattern Polarization angles in the testharness where the power level is -999 dB. These have no physical meaning and are often different with LAPACK. Version 1.0.8 December 2004. * Clean up of nec_context member variables s,b. Renamed m_s, and m_b * Added member function to c_geometry for testing whenther we should be using a thin wire approximation or not. * Fix problem introduced in the Sommerfeld-Norton ground condition, added more testharness stuff. Version 1.0.7 December 2004. * Switched command-line option parsing to XGetopt for cross platform compatibility * Fixed major bug in Win32 executable that caused a crash on file output. Added Visual Studio Project files * Changed member 'near' of nec_context to m_near to avoid a conflict with the VC++ reserved word 'near' * Modified the error message macro to allow compilation on Visual C++. This causes error messages to NOT have a content if nec2++ is compiled with a non-C99 standard compiler. Version 1.0.6 December 2004. * Fix for non-initialization of voltage sources if no excitations were specified (Thanks to Jerome Plet) * Cleaned up code for bad loop in nec_context (Thanks to Neoklis Kyriazis for this) * Removed old Numerical Greens Functions code and variables -- these were not doing anything (ib11 e.t.c.) * All system exit (stop()) calls have been removed and replaced by exceptions (apart from those inside the main command line programme) Version 1.0.5 December 2004. * Fix for not clearing temporary geometry correctly. * Moved more stop(-1) commands to throwing nec_exceptions. * Improved Doxygen Comments * Added arc and helix commands to the nec_context object. Version 1.0.4 November 2004. This version includes significant changes. nec2++ can now be called from a C API, although I am still figuring out how to remove the requirement for linking to the standard C++ library! Help would be appreciated here. See the examples directory in the source tree. This version has also moved to KDevelop and autoconf as the primary development environment. This means that nec2++ can be build using the industry standard './configure', 'make' and 'make install' commands. Please note that my aim is to NOT require KDevelop to build this project, but rather I am using it here. I might well have missed something when creating the source distribution. If I have, please let me know. necpp-1.5.0+cvs20101003/necpp.kdevelop0000644000175000017500000002643411130554610015547 0ustar numanuma Tim Molteno tim@physics.otago.ac.nz 1.4.0 KDevAutoProject C++ C++ Code . false This is a port and rewrite of the numerical electromagnetic code (NEC) version 2. NEC was originally written in FORTRAN. NEC2++ is written in C++ and has been extensively modified from the original source to make it possible to incorporate NEC into your own programs (for visualization or antenna optimization). kdevcvsservice necpp src/nec2++ debug /home/tim/alioth/necpp/debug/src/nec2++ false build / -b true -i ../test_data/intersection.nec -o ../test_data/intersection.out /home/tim/alioth/necpp/debug true false false optimized kdevgccoptions kdevgppoptions kdevg77options -O2 -Wall -DLAPACK --static --enable-debug=full --without-lapack debug kdevgccoptions kdevgppoptions kdevg77options -O0 -g3 -Wall -Wunused-parameter -Wshadow -Wsign-compare -Winline -DNEC_ERROR_CHECK --host=i586-mingw32msvc ming -D__MINGW32__ -D__WIN32__=1 -mwindows -mno-cygwin -mwindows -mno-cygwin kdevgccoptions kdevgppoptions kdevg77options i586-mingw32msvc-gcc i586-mingw32msvc-c++ -Wall -O2 -D__MINGW32__ -D__WIN32__=1 -mwindows -mno-cygwin --enable-debug=full matrix_debug -llapack_atlas -llapack -lblas -latlas kdevgccoptions kdevgppoptions kdevg77options -O0 -g3 -Wall -DNEC_ERROR_CHECK -DNEC_MATRIX_CHECK -O0 -g3 -Wall -DLAPACK -DNEC_ERROR_CHECK -DNEC_MATRIX_CHECK kdevgccoptions kdevgppoptions kdevg77options -O2 -Wall false 1 false 0 false ada ada_bugs_gcc bash bash_bugs clanlib w3c-dom-level2-html fortran_bugs_gcc gnome1 gnustep gtk gtk_bugs haskell haskell_bugs_ghc java_bugs_gcc java_bugs_sun kde2book opengl pascal_bugs_fp php php_bugs perl perl_bugs python python_bugs qt-kdev3 ruby ruby_bugs sdl w3c-svg sw w3c-uaag10 wxwidgets_bugs Guide to the Qt Translation Tools Qt Assistant Manual Qt Designer Manual Qt Reference Documentation qmake User Guide KDE Libraries (Doxygen) html/ html/ false false *.o,*.lo,CVS false false .h .cpp true true true false true true true 250 400 250 false 0 true true false std=_GLIBCXX_STD;__gnu_cxx=std true false false false true true true false .; false false set m_,_ theValue true true false 3 /usr/share/qt3 3 EmbeddedKDevDesigner false true Vertical -i ../test_data/neoklis_bug.nec -o ../test_data/neoklis_bug.outdbg true false false false false true 10 false false nec2++ 1.1.0 GPL false false false 0 false false false false true true true true -C VisualBoyAdvance false false -f0 -1 necpp-1.5.0+cvs20101003/NEWS0000644000175000017500000000137211130324355013401 0ustar numanumaVersion 1.4 New Ruby module. C library interface cleanup. Version 1.3 Switched to Lapack as the main method for doing LU decomposition. Many many bug fixes. Version 1.2.9 Some improvements with the configure.in file. Now detects the atlas libraries for LAPACK and uses them. Still more to be done in this area. Version 1.2.8 Much faster! We're now using LAPACK for the LU decomposition. On my laptop, nec2++ -b produces 1.3 normally. 1.45 with basic blas, and 1. Version 1.0.4 * Moved to AutoConf (Using KDevelop -- an excellent development environment) * Nec++ is now available as a library (libnecpp.a) and can be called from within other programs. See the example directory in the source distribution. * Doxygen is being used for code documentation.necpp-1.5.0+cvs20101003/Ruby/0000755000175000017500000000000011452152143013621 5ustar numanumanecpp-1.5.0+cvs20101003/Ruby/test.rb0000644000175000017500000000751711450102241015127 0ustar numanuma# Test Code for the nec2++ ruby module # Author: Tim Molteno, tim@physics.otago.ac.nz # GPL v3. require 'necpp' require 'complex' =begin Collect some statistics about an antenna. If a frequency scan is done, then each individual result can be accessed using the index parameter. Here these are all zero. =end def antenna_stats(nec) result_index = 0 z = Complex(Necpp.nec_impedance_real(nec,result_index), Necpp.nec_impedance_imag(nec,result_index)) print "Impedance:#{z} Ohms\n" print "Gain:#{Necpp.nec_gain_max(nec,result_index)} dB Mean:#{Necpp.nec_gain_mean(nec,result_index)} dB, sd #{Necpp.nec_gain_sd(nec,result_index)} dB\n" print "RHCP:#{Necpp.nec_gain_rhcp_max(nec,result_index)} dB #{Necpp.nec_gain_rhcp_min(nec,result_index)} dB Mean:#{Necpp.nec_gain_rhcp_mean(nec,result_index)} dB, sd #{Necpp.nec_gain_rhcp_sd(nec,result_index)} dB\n" print "LHCP:#{Necpp.nec_gain_lhcp_max(nec,result_index)} dB Mean:#{Necpp.nec_gain_lhcp_mean(nec,result_index)} dB, sd #{Necpp.nec_gain_lhcp_sd(nec,result_index)} dB\n" end def benchmark nec = Necpp.nec_create Necpp.nec_wire(nec, 1, 9, 0.0, 0.0, 0.0, -0.0166, 0.0045, 0.0714, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 2, 7, -0.0166, 0.0045, 0.0714, -0.0318, -0.0166, 0.017, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 3, 7, -0.0318, -0.0166, 0.017, -0.0318, -0.0287, 0.0775, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 4, 11, -0.0318, -0.0287, 0.0775, -0.0318, 0.0439, 0.014, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 5, 7, -0.0318, 0.0439, 0.014, -0.0318, 0.0045, 0.0624, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 6, 5, -0.0318, 0.0045, 0.0624, -0.0106, 0.0378, 0.0866, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 7, 7, -0.0106, 0.0378, 0.0866, -0.0106, 0.0257, 0.023, 0.001, 1.0, 1.0) Necpp.nec_geometry_complete(nec, 1, 0); Necpp.nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); Necpp.nec_fr_card(nec, 0, 1, 1600.0, 0.0) Necpp.nec_ex_card(nec, 0, 1, 1, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) # Necpp.nec_rp_card(nec, 0, 90, 1, 0,0,0,0, 0, 90, 1, 0, 0, 0); Necpp.nec_rp_card(nec, 0, 17, 45, 0,0,0,0, 0, 0, 5, 8, 0, 0) 100.times do antenna_stats(nec) end Necpp.nec_delete(nec) nec = Necpp.nec_create Necpp.nec_wire(nec, 1, 17, 0, 0, 2, 0, 0, 11, 0.1, 1, 1); Necpp.nec_geometry_complete(nec, 1, 0); Necpp.nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); Necpp.nec_fr_card(nec, 0, 1, 30, 0); Necpp.nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0, 0, 0, 0, 0); Necpp.nec_rp_card(nec, 0, 90, 1, 0,5,0,0, 0, 90, 1, 0, 0, 0); 100.times do antenna_stats(nec) end Necpp.nec_delete(nec) nec = Necpp.nec_create Necpp.nec_wire(nec, 1, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 2, 21, -0.042, 0.008, 0.017, -0.048, 0.021, -0.005, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 3, 70, -0.048, 0.021, -0.005, 0.039, 0.032, -0.017, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 4, 70, -0.048, 0.021, -0.005, 0.035, 0.043, 0.014, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 5, 50, -0.042, 0.008, 0.017, 0.017, -0.015, 0.014, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 6, 66, 0.017, -0.015, 0.014, -0.027, 0.04, -0.031, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 7, 85, -0.027, 0.04, -0.031, 0.046, -0.01, 0.028, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 8, 47, 0.046, -0.01, 0.028, -0.013, -0.005, 0.031, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 9, 70, 0.017, -0.015, 0.014, -0.048, -0.038, -0.04, 0.001, 1.0, 1.0) Necpp.nec_wire(nec, 10, 77, -0.048, -0.038, -0.04, 0.049, -0.045, -0.04, 0.001, 1.0, 1.0) Necpp.nec_geometry_complete(nec, 0, 0) Necpp.nec_gn_card(nec, -1,0,0.0, 0.0, 0.0,0.0, 0.0, 0.0) Necpp.nec_ld_card(nec, 5,0,0,0,3.72e7,0.0,0.0) Necpp.nec_pt_card(nec, -1, 0, 0, 0) Necpp.nec_ex_card(nec, 1, 1, 1, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) Necpp.nec_fr_card(nec, 0, 2, 2400.0, 100.0) Necpp.nec_rp_card(nec, 0, 1, 1, 0,5,0,0, 90.0, 90.0, 0.0, 0.0, 0.0, 0.0) 100.times do antenna_stats(nec) end Necpp.nec_delete(nec) end #print "Benchmark: #{Necpp.nec_benchmark}\n" 1.times do benchmark end necpp-1.5.0+cvs20101003/Ruby/necpp.i0000644000175000017500000000220411450076151015100 0ustar numanuma%module necpp /* Part of the Ruby binding code for nec2++ Copyright (C) 2008-2010 Tim Molteno. tim@physics.otago.ac.nz Released under the GPL v3. */ %{ #include "../src/libnecpp.h" #include "../src/nec_exception.h" %} /* Handle exceptions thrown by nec2++ */ %exception { try { $action } catch (nec_exception* e) { static VALUE cpperror = rb_define_class("CPPError", rb_eStandardError); rb_raise(cpperror, e->get_message().c_str()); } } %include "typemaps.i" /* Used for functions that output a new opaque pointer */ %typemap(in,numinputs=0) opaque_t *OUTPUT (opaque_t retval) { /* OUTPUT in */ retval = NULL; $1 = &retval; } /* used for functions that take in an opaque pointer (or NULL) and return a (possibly) different pointer */ %typemap(argout) opaque_t *OUTPUT, opaque_t *INOUT { /* OUTPUT argout */ %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(retval$argnum), $1_descriptor, 0)); } %typemap(in) opaque_t *INOUT (opaque_t retval) { /* INOUT in */ SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&retval), 0, 0); $1 = &retval; } /* No need for special IN typemap, it works anyway */ %include "../src/libnecpp.h" necpp-1.5.0+cvs20101003/Ruby/README0000644000175000017500000000133311123647643014512 0ustar numanuma==Ruby necpp module== This module allows you to do antenna simulations in Ruby using the nec2++ antenna simulation package. This is a wrapper using SWIG of the C interface, so the syntax is quite simple. Have a look at the file test.rb, for an example of how this library can be used. ==Author== Tim Molteno. tim@physics.otago.ac.nz ==Instructions== To use this library, you must have the necpp library installed on your system: On Debian based systems: aptitude install necpp ==To generate this module== You should install SWIG (on Debian 'aptitude install swig ruby-dev'), and then issue the following commands swig -v -c++ -ruby necpp.i ruby extconf.rb make sudo make install Then test with ruby test.rb necpp-1.5.0+cvs20101003/Ruby/extconf.rb0000644000175000017500000000021111122426001015575 0ustar numanumarequire 'mkmf' # Add autoitx.lib $libs = append_library($libs,"necpp") #$libs = append_library($libs,"stdc++") create_makefile('necpp')necpp-1.5.0+cvs20101003/Ruby/build.sh0000755000175000017500000000032111450075175015262 0ustar numanuma#!/bin/sh # Script to build the nec2++ ruby module. # Change the RUBY environment variable # as appropriate for your system RUBY=ruby1.9.1 swig -v -c++ -ruby necpp.i ${RUBY} extconf.rb make sudo make install necpp-1.5.0+cvs20101003/Ruby/CVS/0000755000175000017500000000000011452152143014254 5ustar numanumanecpp-1.5.0+cvs20101003/Ruby/CVS/Root0000644000175000017500000000007011452152143015117 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/Ruby/CVS/Repository0000644000175000017500000000001311452152143016350 0ustar numanumanecpp/Ruby necpp-1.5.0+cvs20101003/Ruby/CVS/Entries0000644000175000017500000000031511452152143015607 0ustar numanuma/README/1.5/Mon Dec 22 08:28:19 2008// /build.sh/1.5/Mon Sep 27 11:05:33 2010// /extconf.rb/1.1/Thu Dec 18 10:54:57 2008// /necpp.i/1.5/Mon Sep 27 11:13:45 2010// /test.rb/1.7/Mon Sep 27 11:48:49 2010// D necpp-1.5.0+cvs20101003/CVS/0000755000175000017500000000000011452152140013330 5ustar numanumanecpp-1.5.0+cvs20101003/CVS/Entries.Log0000644000175000017500000000026011452152163015407 0ustar numanumaA D/FORTRAN//// A D/Python//// A D/Ruby//// A D/antlr//// A D/c_src//// A D/docs//// A D/example//// A D/html//// A D/src//// A D/templates//// A D/test_data//// A D/win32//// necpp-1.5.0+cvs20101003/CVS/Root0000644000175000017500000000007011452152137014201 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/CVS/Repository0000644000175000017500000000000611452152137015434 0ustar numanumanecpp necpp-1.5.0+cvs20101003/CVS/Entries0000644000175000017500000000113611452152140014665 0ustar numanuma/AUTHORS/1.5/Sun Jan 6 08:27:57 2008// /COPYING/1.1.1.1/Fri Sep 9 04:39:05 2005// /ChangeLog/1.22/Sat Oct 2 11:39:56 2010// /Doxyfile/1.4/Thu Nov 20 23:47:08 2008// /INSTALL/1.9/Sun Dec 14 21:43:40 2008// /Makefile.am/1.1.1.1/Fri Sep 9 04:39:05 2005// /Makefile.cvs/1.1.1.1/Fri Sep 9 04:39:05 2005// /Makefile.test/1.9/Mon Dec 8 01:23:43 2008// /NEWS/1.4/Mon Jan 5 06:30:05 2009// /README/1.6/Sun Dec 14 03:26:05 2008// /TODO/1.5/Tue Jan 6 04:09:44 2009// /configure.in/1.13/Fri Oct 1 10:14:52 2010// /makefile.dist/1.7/Tue Dec 8 22:57:50 2009// /necpp.kdevelop/1.25/Tue Jan 6 04:09:44 2009// D necpp-1.5.0+cvs20101003/configure.in0000644000175000017500000000147511451332234015220 0ustar numanumaAC_INIT(configure.in) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(necpp, 1.4.0) dnl ************************************************ dnl *** Check for Lapack library dnl ************************************************ AC_ARG_WITH([lapack], [AS_HELP_STRING([--without-lapack], [disable support for lapack])], [], [with_lapack=yes]) LIBLAPACK= AS_IF([test "x$with_lapack" != xno], [ LDFLAGS="$LDFLAGS -L/usr/lib/atlas-base/atlas" AC_CHECK_LIB( [lapack], [clapack_zgetrf], [AC_SUBST([LIBLAPACK], ["-L/usr/lib/atlas-base/atlas -llapack -lblas -lpthread"]) AC_DEFINE([LAPACK], [1], [Define if you have liblapack])], [AC_MSG_FAILURE([lapack library test failed (--without-lapack to disable)])], []) ]) AC_CHECK_LIB([m],[pow]) AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL AC_OUTPUT(Makefile src/Makefile) necpp-1.5.0+cvs20101003/antlr/0000755000175000017500000000000011452152144014021 5ustar numanumanecpp-1.5.0+cvs20101003/antlr/from_string.h0000644000175000017500000000234711110372657016535 0ustar numanuma/* Utility file for parsing text in C++ Copyright (C) 2008 Timothy C.A. Molteno (tim@physics.otago.ac.nz) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __from_string__ #define __from_string__ #include #include #include #include template T from_string(const std::string& s) { T t; std::istringstream iss(s); iss >> std::dec >> t; if (iss.fail()) { std::cout << "Failed to parse " << s << std::endl; throw -1; } return t; } #endif /* __from_string__ */ necpp-1.5.0+cvs20101003/antlr/README0000644000175000017500000000035411110373460014700 0ustar numanumaThis is a parser for NEC antenna geometry files written for the ANTLR parser generator. At the moment it is rudimentary. Requires ANTLR aptitude install libantlr-dev Also requires lapack libraries. aptitude install math-atlas-dev necpp-1.5.0+cvs20101003/antlr/nec.g0000644000175000017500000002423211411601606014736 0ustar numanuma/* ANTLR Grammar for nec2++ This file describes the NEC-2 file as a grammar, and when run through the antlr parser generator will create a parser for nec2++ files. Copyright (C) 2005-2008 Timothy C.A. Molteno (tim@physics.otago.ac.nz) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ header { // The statements in this block appear in all header files #include ANTLR_USING_NAMESPACE(std) ANTLR_USING_NAMESPACE(antlr) #include "from_string.h" #include "nec_context.h" #include "c_geometry.h" #include "nec_exception.h" } options { language="Cpp"; } class NECParser extends Parser; options { k=4; } { public: nec_context nec; nec_output_file s_output; } startRule : ( necFile | /* nothing */ ) EOF ; necFile : { // nec_output_flags s_output_flags; // nec.set_output(s_output, s_output_flags); // nec.set_results_stdout(true); // s_output.set_file(fopen("test.out", "w")); nec.initialize(); } commentSection geometrySection analysisSection { nec.all_jobs_completed(); cout << "Max Gain: " << nec.get_gain_max() << endl; } ; ///////////////////////////////////////////////////////////// // // Comment Section // commentSection : { s_output.end_section(); s_output.set_indent(31); s_output.line("---------------- COMMENTS ----------------"); } (cmLine)* ceLine ; cmLine : comment:CM { string cm = comment->getText().substr(2); s_output.line(cm.c_str()); } ; ceLine : comment:CE { string cm = comment->getText().substr(2); s_output.line(cm.c_str()); } ; ///////////////////////////////////////////////////////////// // // Geometry Section // geometrySection : (geometryLine)+ geometryEnd ; geometryLine : wire ; geometryEnd { int gpflag = 0; } : GE (gpflag=intNum)? NEWLINE { c_geometry* geo = nec.get_geometry(); geo->geometry_complete(&nec, gpflag, 0); nec.calc_prepare(); cout << "Geometry Complete" << endl; } ; wire { int tag = 0, ns = 0; double xw1, yw1, zw1, xw2, yw2, zw2, rad; double rDel = 1.0, rad1 = 1.0, rad2 = 0.0; } : GW tag=intNum ns=intNum xw1=realNum yw1=realNum zw1=realNum xw2=realNum yw2=realNum zw2=realNum ( rad=realNum NEWLINE { rad != 0 }? | NEWLINE GC (INT INT)? rDel=realNum rad1=realNum rad2=realNum NEWLINE { if ( (rad1 == 0) || (rad2 == 0) ) { throw new nec_exception("GEOMETRY DATA CARD ERROR" ); } rad = rad1; rad1 = pow( (rad2/rad1), (1.0/(ns-1.0)) ); } ) { c_geometry* geo = nec.get_geometry(); geo->wire(tag, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad, rDel, rad1); } ; ///////////////////////////////////////////////////////////// // // Analysis Section // analysisSection : (analysisLine)+ ; analysisLine : frCard | ekCard | exCard | gnCard | ldCard | ntCard | rpCard | ptCard | tlCard | xqCard | enCard ; /* Integers IFRQ (I1) - Determines the type of frequency stepping: 0 - linear stepping. 1 - multiplicative stepping. NFRQ (12) - Number of frequency steps. If this field is blank, one is assumed. (I3), (I4) - Blank. Floating Point FMHZ (F1) - Frequency in MegaHertz. DELFRQ (F2)- Frequency stepping increment. If the frequency stepping is linear, this quantity is added to the frequency each time. If the stepping is multiplicative, this is the multiplication factor. (F3) ... (F6) - Blank. */ frCard : { int ifrq; int nfrq=1; double fmhz = 0.0; double delfrq = 0.0; } FR ifrq=intNum ( nfrq=intNum fmhz=realNum (delfrq=realNum)* | fmhz=realNum ) NEWLINE { nec.fr_card(ifrq, nfrq, fmhz, delfrq); } ; /* Should we use the extended thin wire kernel or not. EK -1 cancels. */ ekCard : { int ekflg=0; } EK (ekflg=intNum)? NEWLINE { nec.set_extended_thin_wire_kernel(-1 != ekflg); } ; exCard { int extype = 0, tag = 0, m=0, exflag = 0; double f1 = 0.0, f2=0.0, f3=0.0, f4=0.0, f5=0.0, f6=0.0; enum excitation_type t; } : EX extype=intNum { std::cout << "EX: " << extype << endl; } ( {extype == 0}? tag=intNum m=intNum exflag=intNum f1=realNum (f2=realNum f3=realNum)? { t = EXCITATION_VOLTAGE; } | {extype == 1}? INT INT INT f1=realNum f2=realNum f3=realNum f4=realNum f5=realNum f6=realNum { t = EXCITATION_LINEAR; } | {extype == 2}? INT INT INT f1=realNum f2=realNum f3=realNum f4=realNum f5=realNum f6=realNum { t = EXCITATION_CIRC_RIGHT; } | {extype == 3}? INT INT INT f1=realNum f2=realNum f3=realNum f4=realNum f5=realNum f6=realNum { t = EXCITATION_CIRC_LEFT; } | {extype == 4}? INT INT INT f1=realNum f2=realNum f3=realNum f4=realNum f5=realNum f6=realNum { t = EXCITATION_CURRENT; } | {extype == 5}? tag=intNum m=intNum exflag=intNum f1=realNum (f2=realNum f3=realNum)? { t = EXCITATION_VOLTAGE_DISC; } ) NEWLINE { nec.ex_card(t, tag, m, exflag, f1, f2, f3, f4, f5, f6 ); } ; gnCard { int ground_type = 0, rad_wire_count=0; double epse=0.0, sig=0.0, f3=0.0, f4=0.0, f5=0.0, f6=0.0; } : GN ground_type=intNum ( {ground_type == -1}? // nullify previous ground conditions | {ground_type == 1 }? (INT)* // perfect ground | {ground_type == 0 }? rad_wire_count=intNum INT INT epse=realNum sig=realNum (f3=realNum f4=realNum f5=realNum f6=realNum)? // finite ground | {ground_type == 2 }? rad_wire_count=intNum INT INT epse=realNum sig=realNum (f3=realNum f4=realNum f5=realNum f6=realNum)? // Sommerfeld Norton ground ) NEWLINE { nec.gn_card(ground_type, rad_wire_count, epse, sig, f3, f4, f5, f6 ); } ; /* Generate Cylindrical Structure (GR) To reproduce a structure by rotating about the Z-axis to form a complete cylindrical array, and to set flags so that symmetry is utilized in the solution. (I1) - Tag number increment. (I2) - Total number of times that the structure is to occur in the cylindrical array. Decimal Numbers The decimal number fields are not used. */ grCard { int tag_increment = 0, n_times=0; } : GR tag_increment=intNum n_times=intNum { s_output.nec_printf( "\n STRUCTURE ROTATED ABOUT Z-AXIS %d TIMES" " - LABELS INCREMENTED BY %d\n", n_times, tag_increment ); c_geometry* geo = nec.get_geometry(); geo->reflect( -1, 0, 0, tag_increment, n_times); } ; ldCard { int ldtyp = 0, tag=0, m=0, n=0; double zlr,zli=0.0, zlc=0.0; } : LD ldtyp=intNum tag=intNum m=intNum n=intNum zlr=realNum (zli=realNum zlc=realNum)? NEWLINE { nec.ld_card(ldtyp, tag, m, n, zlr, zli, zlc ); } ; rpCard { int rpflg = 0, ntheta, nphi, xnda; double thets, phis,dth, dph, rfld=0.0, gnor=0.0 ; } : RP rpflg=intNum ntheta=intNum nphi=intNum xnda=intNum thets=realNum phis=realNum dth=realNum dph=realNum (rfld=realNum (gnor=realNum)?)? NEWLINE { int X = xnda / 1000; int N = (xnda / 100) % 10; int D = (xnda / 10) % 10; int A = xnda % 10; nec.rp_card(rpflg, ntheta, nphi, X,N,D,A, thets, phis, dth, dph, rfld, gnor); } ; ptCard { int a,b,c,d; } : PT a=intNum b=intNum c=intNum d=intNum NEWLINE ; ntCard { int tag1 = 0, m1=0, tag2, m2=0; double y11r, y11i, y12r, y12i, y22r, y22i; } : NT tag1=intNum m1=intNum tag2=intNum m2=intNum y11r=realNum y11i=realNum y12r=realNum y12i=realNum y22r=realNum y22i=realNum NEWLINE { nec.nt_card(tag1, m1, tag2, m2, y11r, y11i, y12r, y12i, y22r, y22i); } ; /* TODO: Allow y11i to be blank */ tlCard { int tag1 = 0, m1=0, tag2, m2=0; double y11r, y11i=0.0, y12r, y12i, y22r=0.0, y22i=0.0 ; } : TL tag1=intNum m1=intNum tag2=intNum m2=intNum y11r=realNum y11i=realNum y12r=realNum y12i=realNum y22r=realNum y22i=realNum NEWLINE { nec.tl_card(tag1, m1, tag2, m2, y11r, y11i, y12r, y12i, y22r, y22i); } ; xqCard { int xqflag = 0; } : XQ (xqflag=intNum)? NEWLINE { nec.xq_card(xqflag); nec.simulate(false); } ; enCard : EN (NEWLINE | EOF) { nec.simulate(false); } ; protected realNum returns [double val] : r:REAL { val = from_string(r->getText()); } | i:INT { val = double(from_string(i->getText())); } ; protected intNum returns [int val] : txt:INT { val = from_string(txt->getText()); } ; ///////////////////////////////////////////////////////////////// // // Lexical Analyzer, breaks the file into tokens // to be used by the parser. // // class NECLexer extends Lexer; options { caseSensitive=false; k=2; charVocabulary = '\3'..'\377'; } /* To make this column sensitive, use something like... CM : {getColumn()==1}? "CM" (~'\n')* '\n'; */ CM : "cm" (~'\n')* '\n' { newline(); } ; CE : "ce" (~'\n')* '\n' { newline(); } ; GW : "gw" ; GC : "gc" ; GH : "gh" ; GE : "ge" ; GX : "gx" ; SP : "sp" ; EK : "ek" ; EX : "ex" ; FR : "fr" ; GN : "gn" ; LD : "ld" ; NT : "nt" ; RP : "rp" ; PT : "pt" ; TL : "tl" ; XQ : "xq" ; EN : "en" ; WS : ( '\003'..'\010' | '\013' | '\f' | '\016'.. '\037' | '\177'..'\377' | ' ' | '\t' )+ { _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP; } ; NEWLINE options { paraphrase = "end of line"; } : '\n' { newline(); } | "\r\n" { newline(); } ; Cpp_Comment : "//" (~'\n')* '\n' //match alt andet end newline { _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP; newline(); } ; // Numbers protected REAL options { paraphrase = "a real number"; } :; protected INT options { paraphrase = "an integer"; } :; protected DIGIT : '0'..'9' ; Number : ( '+' | '-' ) ? ( ( DIGIT )+ ( '.' ( DIGIT )* (Exponent)? { $setType(REAL); } | { $setType(INT); } ) | '.' ( DIGIT )+ (Exponent)? { $setType(REAL); } ) ; Exponent : 'e' ( '+' | '-' )? ( DIGIT )+ ; necpp-1.5.0+cvs20101003/antlr/antlr_test.cpp0000644000175000017500000000575011110730150016701 0ustar numanuma#include #include #include #include #include using namespace std; #include "NECLexer.hpp" #include "NECParser.hpp" #include #include "XGetopt.h" int main( int argc, char **argv ) { nec_output_file s_output; nec_output_flags s_output_flags; string input_filename, output_filename; /* getopt() variables */ extern char *optarg; if ( argc == 1 ) { usage(); exit(-1); } bool results_to_stdout = false; // allocate a new nec_context; nec_context s_context; int option; /* process command line options */ while( (option = XGetopt(argc, argv, "i:o:hvscxgb") ) != -1 ) { switch( option ) { case 'i' : /* specify input file name */ input_filename = optarg; break; case 'o' : /* specify output file name */ output_filename = optarg; break; case 'g': /* return only the maximum gain to stdout */ s_output_flags.set_gain_only(true); break; case 's': /* return output to stdout */ results_to_stdout = true; break; case 'c': /* use CSV result data */ s_context.set_results_format(RESULT_FORMAT_CSV); break; case 'x': /* use XML result data */ s_context.set_results_format(RESULT_FORMAT_XML); break; case 'h' : /* print usage and exit */ usage(); exit(0); case 'v' : /* print nec2++ version */ #ifdef _MSC_VER cout << ( "nec2++ " nec_version ) << " compiler: " << _MSC_VER << endl; #else cout << ( "nec2++ " nec_version ) << (" compiler: " __VERSION__) << endl; #endif exit(0); case 'b' : /* Run benchmark */ nec_context::benchmark(); exit(0); default: /* print usage and exit */ usage(); exit(-1); } } ifstream infs(input_filename.c_str()); FILE *output_fp=NULL; if ( !infs.good() ) { string mesg = "nec2++: Could not open " + input_filename; perror( mesg.c_str() ); exit(-1); } /* make an output file name if not */ /* specified by user on invocation */ if ( output_filename == "" ) { /* strip the input file name extension if there is one */ output_filename = input_filename.substr(0, input_filename.find(".",0)) + ".out"; } /* open output file */ if ( (output_fp = fopen(output_filename.c_str(), "w")) == NULL ) { string mesg = "nec2++: " + output_filename; perror( mesg.c_str() ); exit(-1); } s_output.set_file(output_fp); // secnds( &ex_timer ); s_context.set_output(s_output, s_output_flags); s_context.initialize(); try { NECLexer lexer(infs); NECParser parser(lexer); parser.nec.set_output(s_output, s_output_flags); parser.startRule(); return 0; } catch(antlr::ANTLRException e) { cout << "NEC++ Parse Error: " << e.toString() << endl; exit(1); } catch (const char* message) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(message); exit(1); } catch (nec_exception* nex) { nec_error_mode nem(s_output); s_output.line("NEC++ Runtime Error: "); s_output.line(nex->get_message().c_str()); exit(1); } } necpp-1.5.0+cvs20101003/antlr/example_fail.nec0000644000175000017500000000050511110376727017144 0ustar numanumaCMEXAMPLE 2. CENTER FED LINEAR ANTENNA. CM CURRENT SLOPE DISCONTINUITY SOURCE. CM 1. THIN PERFECTLY CONDUCTING WIRE CE 2. THIN ALUMINUM WIRE GW 0 8.0 0. 0. -.25 0. 0. .25 .00001 GE FR 0 3 0 0 200. 50. EX 5 0 5 1 1. 0. 50. XQ LD 5 0 0 0 3.720E+07 FR 0 1 0 0 300. EX 5 0 5 0 1. XQ EN necpp-1.5.0+cvs20101003/antlr/makefile0000644000175000017500000000265511110730150015517 0ustar numanuma######################################## # # Build the NEC2++ parser using the # ANTLR compiler construction toolkit # # On Debian Systems just type: # aptitude install antlr libantlr-dev # .SUFFIXES: .parse .nec NECPP_SRC = ../src/c_evlcom.cpp ../src/c_geometry.cpp ../src/c_ggrid.cpp \ ../src/c_plot_card.cpp ../src/matrix_algebra.cpp ../src/misc.cpp \ ../src/nec_context.cpp ../src/nec_ground.cpp ../src/nec_output.cpp \ ../src/nec_radiation_pattern.cpp ../src/nec_exception.cpp \ ../src/electromag.cpp ../src/nec_structure_currents.cpp \ ../src/XGetopt.cpp NECPP_OBJ = $(NECPP_SRC:.cpp=.o) ANTLR_SRC = antlr_test.cpp NECLexer.cpp NECParser.cpp ANTLR_OBJ = $(ANTLR_SRC:.cpp=.o) ANTLR = java -classpath /usr/share/java/antlr.jar antlr.Tool all: antlr test echo: echo ${NECPP_SRC} antlr: nec.g ${ANTLR} nec.g clean: rm -f ${ANTLR_OBJ} ${NECPP_OBJ} NEC* antlr_test LDFLAGS = -lstdc++ -lantlr -lm -L /usr/lib/atlas -llapack CXXFLAGS = -I ../ -I ../src/ -g3 -O0 test: ${ANTLR_OBJ} ${ANTLR_SRC} ${NECPP_OBJ} ${NECPP_SRC} g++ -o antlr_test ${ANTLR_OBJ} ${NECPP_OBJ} ${LDFLAGS} - ./antlr_test -i ../test_data/example2.nec -o example2.out # - ./antlr_test -i ../test_data/example3.nec # - ./antlr_test -i example_fail.nec TEST_FILES := $(shell find ../test_data/ -name "*.nec") TEST_OUT = $(TEST_FILES:.nec=.antlr) %.nec %.antlr: - ./antlr_test -i $*.nec -o $@ test_clean: rm ${TEST_OUT} test_all: ${TEST_OUT} echo "DONE" necpp-1.5.0+cvs20101003/antlr/CVS/0000755000175000017500000000000011452152144014454 5ustar numanumanecpp-1.5.0+cvs20101003/antlr/CVS/Root0000644000175000017500000000007011452152144015317 0ustar numanuma:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/necpp necpp-1.5.0+cvs20101003/antlr/CVS/Repository0000644000175000017500000000001411452152144016551 0ustar numanumanecpp/antlr necpp-1.5.0+cvs20101003/antlr/CVS/Entries0000644000175000017500000000040611452152144016010 0ustar numanuma/README/1.3/Mon Nov 17 22:58:56 2008// /antlr_test.cpp/1.3/Wed Nov 19 06:21:28 2008// /example_fail.nec/1.1/Mon Nov 17 23:27:19 2008// /from_string.h/1.1/Mon Nov 17 22:52:31 2008// /makefile/1.5/Wed Nov 19 06:21:28 2008// /nec.g/1.7/Sun Jun 27 07:53:42 2010// D