F a s t H e n r y 3 . 0 w r ----------------------------- 10-21-2001 Modifications by: Stephen R. Whiteley (stevew@wrcad.com) Whitleley Research Inc. ** This is the fasthenry-3.0-12Nov96 distribution with the following changes: 1) Support for superconductive elements has been added. This release is the successor to fasthenry-2.0S. 2) All references to "malloc.h" in the source code have been changed to "stdlib.h" to avoid a cascade of warnings during compilation. 3) A long expression in mutual.c which triggered a compiler bug in Red Hat Linux 6.0 has been altered to avoid the bug. 4) This version of fasthenry returns status 0 if there are no errors, nonzero if an error occurs. The original version had undefined return status. 5) The latex files for the manual have been eliminated, since they are useless without the figures. The master's thesis has been included instead (in the doc directory). 6) Two superconducting example files, sline1.inp and sline2.inp have been added to the examples directory. 7) Added declarations of static functions in sparse matrix package to avoid annoying compiler warnings. 8) Ported to Microsoft Windows using the mingw (www.mingw.org) version of gcc. To build under mingw, use "config mingw". The source code was made sensitive to the following defines, which are all necessary for mingw. a) NO_SBRK The library lacks the sbrk() function. b) NO_ATANH Substitute for missing atanh() and asinh() functions. c) NO_ISNAN The library lacks isnan() and finite() functions. ** 4-25-2001 Bug Fix: .default lambda=xxx should work now ** 6-19-2001 Bug Fix: Error in resistance computation fixed ** 10-21-2001 Changes: 1) For segments with no sigma/rho/lambda defined with no explicit defaults, sigma now defaults to copper (5.8e7). Previously this was a fatal error. 2) When files are opened for writing, binary files are now opened in "wb" mode rather than "w" mode. This is only important under Microsoft Windows, where binary data can be corrupted if file pointers are not explicitly opened in binary mode. ** 4-27-2004 Changes: Added #include "sparse/spMatrix" in Preconfig.c for declaration of spGetElement. This is critical when ints and pointers are of different widths. Commented out redundant spGetElement declaration in newPreconfig.c. Declaration of umalloc added to mulGlobal.h in zbuf, for int/pointer width difference. All programs compile without warnings on 64-bit sparc gcc-3.x (Solaris 8) using CC = gcc and CFLAGS = -O -m64 -DFOUR. ** 1-11-2009 Changes: Misc. code tweeks to avoid compiler warnings when using newer compilers, e.g., gcc-4.2. ** 2-11-2013 Changes: Fixed all warnings that issued when building on a OS X 10.6 MacBook Pro, using the default configuration. The programs should now build cleanly on 64-bit platforms. ** 1-1-2014 Changes: Added function prototypes to source code. Compilation is clean under OS X 10.9. ** 8-7-2014 Changes: Major improvements in the computation speed of large problems. The sparse preconditioner setup was a huge bottleneck. In particular, with one benchmark (added to the examples as noname.inp) building the preconditioner previously took more than 7 hours. In the present release, the same task takes about 5 minutes. The actual GMRES solving takes only about 40 seconds, so overall time is still dominated by preconditioner setup, but not as absurdly. The secret sauce involves things like hashing and shadow-bitmapping, those intesested can look in the source code for "SRW0814" preprocessor symbols in the fasthenry files, and "BUILDHASH" and "BITFIELD" preprocessor symbols in the Sparse package and read the comments. The key improvements were in the Sparse package, which does not scale well to large matrix size, large being about 27000 in this case. Also, the output to Matlab option should work now, on any platform. Previously, it would only work on 32-bit SPARC machines due to 1) integer size issues (broken on 64-bit systems) and 2) an obscure variable in the source code needs to be reset to support Intel, and this was simply overlooked. The endian-ness is now auto-detected so there is no variable to set anymore. The documentation has been converted to PDF, but the original PostScript files can be found in the old_ps directory. ** 8-25-2014 Changes: Imported the modified indexing of the Jimag/Jreal/Jmag files from FastHenry2 code from FastFieldSolvers.com. Output from fasthenry examples/together.inp -d grids -x trace1 (for example) now closely matches the output from FastHenry2 with the same input. ** 9-28-2015 Changes: Fixed MinGW compilation. I don't think that the port to MinGW was ever complete, and it was actually building with Cygwin. The present release alters resusage.h for MinGW compatibility, and adds a Makefile tweak. To build for MinGW, you must either hand-edit src/fasthenry/Makefile, or run "config mingw". There is a small change to the CFLAGS required. ** 11-9-2015 Changes: Back in 2003, MIT re-released FastHenry under the "new" MIT license, which was far more open-source friendly than the original 1996 license. This "wr" branch continued to carry the original license language, unil now. There are no code changes in this release, only the licensing info in the source files has been updated or added. ** 9-9-2019 Changes: Updated/reorganized the examples. Moved the Sparse package out of src/fasthenry and into src. Added an interface layer between the linear algebra calls (and library) and FastHenry. Added interfaces to Sparse, KLU (SuiteSparse) and Intel MKS sparse matrix packages, as illustrations. One can now relatively easily adapt the preconditioner to use a third-party linear algebra package, for possible performance gains. ***** * The Intel/DSS support is not included in this release, as it was * contributed by a third party and has not been cleared for release. ***** Use a real matrix for the preconditioner instead of complex when possible (lossless superconductors only). This may improve performance. The default is to build using the Sparse package, except when building under the XicTools framework, where KLU is the default. To build using one of the alternative packages: 1. Install the alternative package (SuiteSparse or Intel MKL). 2. Modify the mk_klu.inc or mk_dss.inc files in src/fasthenry so that the paths correspond to your installation location. 3. Build by giving one of make SOLVER=KLU_SOLVER all make SOLVER=DSS_SOLVER all Note that you can make different versions, but you will need to give "make clean" before making a new version. ** 3-28-2020 Changes: Added the MIT original Latex manual files to the doc/old_ps directory, for preservation. ** 3-30-2020 Changes: Updated the Windows packager (in msw_package). Calls inno-5.5.9, now includes local utod.exe unix to dos line termination translator. Added structure and scripts in packaged examples. --------------------- Superconductivity Support ------------------------- This version of fasthenry has been modified to support superconducting segments and ground planes. The analysis used is based on the London equations and the two-fluid model. Both reactive and lossy components of the superconductor complex conductivity are employed in obtaining the impedance matrix. Theory ------ * * In normal metal: (1) del X del X H = -i*omega*mu*sigma * H * In superconductor: (2) del X del X H = (1/lambda)^2 * H * * In fasthenry, (1) is solved, so the game is to replace sigma in * (1) with a complex variable that includes and reduces to (2). * We choose * * sigma_prime = sigma + i/(omega*mu*lambda^2) * * Then, using sigma_prime in (1) rather than sigma, one obtains * an expression that reduces to (2) as omega -> 0, yet retains * properties of (1). This is the two-fluid model, where the * sigma in sigma_prime represents the conductivity due to unpaired * electrons. * * Since sigma_prime blows up at omega = 0, we work with the * impedance, which we take as z = r1 + i*omega*r2 = i/sigma_prime. * The r1 and r2 variables are thus * * (3) r1 = sigma*(omega*mu*lambda^2)^2 * -------------------------------- * (sigma*omega*mu*lambda^2)^2 + 1 * * (4) r2 = mu*lambda^2 * -------------------------------- * (sigma*omega*mu*lambda^2)^2 + 1 Operation --------- The input and output formats of fasthenry are unchanged, with the exception of a new input parameter "lambda". The lambda parameter is the London penetration depth specified in the units in use, and can appear in segment or ground plane specification lines, and .default lines. When lambda is given and nonzero, the element is analyzed as a superconductor, and the sigma parameter defaults to zero (not the conductivity of copper, as in the normal case). If, however, a default sigma is specified, or a sigma specification appears in the segment or ground plane line, that sigma will be used. The proper value for sigma is the sigma 1 from the two-fluid model, which is the normal sigma times the ratio of the quasiparticle and total carrier densities, a temperature dependent quantity. For most applications, the loss is small enough to be considered negligible, so sigma need not be specified. To obtain accurate results, a sufficient number of filaments must exist in regions of high field gradient. Although the ground plane construct is supported, experience has shown that its use often leads to inaccurate results presumably due to insufficient filamentation. Some of the new fasthenry-3.0 features may solve this problem, but this has not been tested. It may prove necessary to implement ground planes with segments. The large filament count consumes much memory. This program benefits from cpu power and memory. Despite its name, be prepared to wait for results. Compilation is as described in the fasthenry documentation. If for some reason the superconductivity support is to be deleted, the mulGlobal.h file should be edited to set "SUPERCON" to "OFF". Interpretation of Results ------------------------- Fasthenry computes an impedance matrix, which is written to a file named "Zc.mat" when the run is complete. This gives the inductance values indirectly, through the imaginary parts divided by the radian frequency (2PI times the value given for ".freq"). In order to compute inductance, the specified frequency, i.e., the value provided for the ".freq" parameter in the input file, must be nonzero. For superconductors, with sigma equal to zero, the inductances should be independent of frequency, so the actual frequency chosen is not important. If the frequency is set to zero, FastHenry will compute the resistance of the conductors only, which will be zero for superconductors.