Welcome to FastCap2

FastCap2 User Guide

Welcome to FastCap2 !

FastCap2 is a powerful three-dimensional capactiance extraction program.

Features include:

  • Computation of self and mutual capacitances between ideal conductors of arbitrary shapes, orientations and sizes!
  • Dielectric regions composed if any number of constant-permittivity regions of any shape and size!
  • Very fast solution!
  • Full automation support allowing remote control of FastCap2 by other programs, either in foreground or in background!
  • Lots of options!
  • Free (see disclaimer and conditions of use)!

FastCap manual

The original FastCap manual in Acrobat Reader compatible format (needs Acrobat Reader) can be open clicking here.

Support

Visit our web site FastFieldSolvers for new releases, support, customization and many other services!

Copyright FastFieldSolvers, 2012 - All rights reserved


FastCap2 Tutorial

Getting started with FastCap2

This tutorial will show you step-by-step how to perform the basic capacitance extraction tasks with FastCap2.

In this tutorial, you will learn how to:

  • Load a FastCap2 input file into FastModel
  • Understand basic FastCap2 input file syntax
  • aunch FastCap2 from FastModel
  • Understand FastCap2 output
  • Refine the geometry to achieve greater accuracy
  • Change the global permittivity factor
  • Work with hierarchical input files (list files)
  • Define dielectric interfaces


FastCap2 Tutorial

Load a FastCap2 input file into FastModel

Launch FastModel

  1. If FastModel is not already running, double click the FastModel icon on your desktop or select 'FastModel' from your Start menu in Windows.
  2. Click on the I agree button to accept FastModel's license.

Load a FastCap2 input file

  1. Select the FastCap2 View (the view should be in foreground with the caption highlighted).
  2. From the File menu select File->Open FastCap2 File or click on the [image] icon on the toolbar.
  3. Under the Files of type drop-down menu select FastCap2 Geometry Files (*.neu, *.qui)
  4. Browse to the software installation directory (e.g. C:\Program Files\FastFieldSolvers) and under FastCap2\Samples\Input_files select the file sphere1.qui, then click Open.

    A coarse model of a sphere will appear in the FastModel View.


FastCap2 Tutorial

Understand basic FastCap2 input file syntax

Browse the input file

  1. If the FastCap2 View is not visible, bring it in foreground
  2. Examine the first line of the view. The line begins with a '0', then contains a description of the content of the file. Every FastCap2 file must begin with such a line.
  3. Examine the following lines. All lines begin with the letter 'T'. This means that the line describes a triangle. Then follows a conductor name, 'sphere', and a triplet of 3D coordinates, specifying the triangle corners, as highlighted in the following figure.

  4. Go to the end of file. Notice that there is no need of any end of file specifier.

Add comments

To add a comment, simply begin a line with a '*'. The line will be recognized as comment and highlighted in color.
  1. Add an asterisk '*' at the very beginning of lines 5, 6, 7, 8, as shown in the following figure (you can easily find the lines looking at the row counter on the status bar, which shows the current cursor position).

  2. Right click with the mouse on the FastCap2 view and from the pop-up menu choose Update Model
  3. Examine the FastModel View. You should notice that four triangles disappeared from the sphere surface. If you cannot see it, try rotating the sphere.
  4. Remove the asterisks and update the model. The sphere shoud appear complete again.

Add patches

As 'T' keywords are used to specify triangular patches, the 'Q' keyword is used to describe a quadrilateral panel.
  1. Go to the end of the FastCap View
  2. Add the following line after the last 'T' statement

    Q plane -1 -1 0 1 -1 0 1 1 0 -1 1 0

  3. Right click with the mouse on the FastCap2 view and from the pop-up menu choose Update Model
  4. Examine the FastModel View. You shoud see a quadrilateral plane cutting the sphere in two halves.
  5. Delete or comment the last line you added and update the model. The plane should disappear.


FastCap2 Tutorial

Launch FastCap2 from FastModel

Launch FastCap2

Now you are ready to start a capacitance extraction. For this example, we will extract the capacitance of the sphere you have visualized in FastModel.

  1. Click on the [image] icon on the toolbar. The Run Menu dialog from FastCap2 should open.

Select FastCap2 parameters

The FastCap2 Run Menu dialog contains a lot of options. For most simulations, you can keep the defaults. However, in our case you must inform FastCap2 that you are not feeding in a hierarchical input file but directly a geometry file.
  1. Remove the tick mark near the List File label, as shown in the figure.

Run FastCap2

  1. Click the Run button to start the simulation.


FastCap2 Tutorial

Understand FastCap2 output

FastCap2 has produced a detailed output about the simulation you ran. Let's examine it.

The preamble

FastCap, (c) by M.I.T.
Windows porting and modifications, version 3.1
   (c) 1998, 2004 by Enrico Di Lorenzo, www.fastfieldsolvers.com

Running fastcap 2.0 (18Sep92)
  Input: C:\Program Files\FastFieldSolvers\FastCap2\Samples\Input_files\sphere1.qui
  Input surfaces:
   GROUP1
    C:\Program Files\FastFieldSolvers\FastCap2\Samples\Input_files\sphere1.qui, conductor
      title: `Sphere with radius 1.000000, refined up to depth 1
'
      outer permittivity: 1
      number of panels: 80
      number of extra evaluation points: 0
      translation: (0 0 0)
  Date: Wed May 18 18:21:58 2005

The preamble summarizes the input file(s) information. In particular, after the copyright notice, you find:

  • The main input file name

      Input: C:\Program Files\FastFieldSolvers\FastCap2\Samples\Input_files\sphere1.qui
  • The list of all input files containing actual panels. In our case, the main input file directly contains the geometric description of the triangular panels, so the file name is the same of the main one and we have only one group.

      Input surfaces:
       GROUP1
        C:\Program Files\FastFieldSolvers\FastCap2\Samples\Input_files\sphere1.qui, conductor
          title: `Sphere with radius 1.000000, refined up to depth 1
    '
          outer permittivity: 1
          number of panels: 80
          number of extra evaluation points: 0
          translation: (0 0 0)

    Inside each group, there is some specific information.

    • The group number.

         GROUP1

      This is a sequential number used to distinguish different input files

    • The geometry file name

          C:\Program Files\FastFieldSolvers\FastCap2\Samples\Input_files\sphere1.qui, conductor
    • The title of the geometry file, that is the first line of the input file, with the beginning '0' stripped out

            title: `Sphere with radius 1.000000, refined up to depth 1
    • The permittivity of the dielectric medium surrounding the conductor

            outer permittivity: 1
    • The number of panels (either triangular or quadrangular) described in this geometry file

            number of panels: 80
    • The number of extra evaluation points

            number of extra evaluation points: 0
    • The global translation applied to all panel coordinates contained in the geometry file

            translation: (0 0 0)
  • The time at which your simulation ran

      Date: Wed May 18 18:21:58 2005

The Summary

INPUT SUMMARY
  Expansion order: 2
  Number of partitioning levels: 3
  Overall permittivity factor: 1
  Total number of panels: 80
    Number of conductor panels: 80
    Number of dielectric interface panels: 0
    Number of thin conductor on dielectric interface panels: 0
  Number of conductors: 1

The summary provides information about global parameters. In particular:

  • The expansion order

      Expansion order: 2

    This is the multipole expansion order selected in the Run Menu dialog. For normal geometries, you don't need to modify this parameter; in some cases, you can select 3 as expansion order to improve the precision of the results, but usually you get better results by further refining the input geometry.

  • The number of partitioning levels

      Number of partitioning levels: 3

    This is an internal parameter, automatically calculated by FastCap2. It is an indicator of the depth of the spatial subdivision of the input geometry volume. The greater is the overall geometry dimension / minimum patch area, the larger is the number of partitioning levels required to subdivide the space for simulation needs.

  • The overall permittivity factor

      Overall permittivity factor: 1

    This is the overall permittivity factor selected in the Run form. This in an overall relative permittivity factor which multiplies all FastCap2 results. You'll see the effect of this parameter later in this tutorial.

  • Total number of panels

      Total number of panels: 80

    This is the total number of panels read from the input file(s). In this case, where the input file is unique, the total number of files is equal (of course) to the number of panels shown in the preamble. In case of hierarchical input files (the so-called list files), this figure will show the sum of the number of panels found in each input file.

  • The number of conductor panels, dielectric interface panels and thin conductor panels

        Number of conductor panels: 80
        Number of dielectric interface panels: 0
        Number of thin conductor on dielectric interface panels: 0

    These lines detail the total number of panels, split according to their function. In this example we have no dielectric interface panels, since the sphere is embedded in an homogeneous medium.
    The 'thin conductor on dielectric interface panels' are an old type of panels which have never been supported by FastCap2; you can safely ignore this line.

  • The number of conductors

      Number of conductors: 1

    This is the total number of conductors found in the input file(s).

The simulation and the result

No expansions at level 3 (lowest)
No expansions at level 2
Percentage of multiplies done by multipole: 0%
Warning: no multipole acceleration

ITERATION DATA
Starting on column 1 (sphere%GROUP1)
1 2 3

CAPACITANCE MATRIX, nanofarads
                                1
sphere%GROUP1 1 0.1058

The last part of the output provides information about the state of the simulation and the result. In particular:

  • The expansion order

    No expansions at level 3 (lowest)
    No expansions at level 2
    Percentage of multiplies done by multipole: 0%
    Warning: no multipole acceleration

    This information regards the internal algorithm used by FastCap2. In this case, the problem is small, so FastCap2 has automatically decided not to use the multipole algorithm, because it gives a faster computation time but only for problems bigger than a threshold number of panels.

  • The iteration data

    ITERATION DATA
    Starting on column 1 (sphere%GROUP1)
    1 2 3

    This is the number of iterations required to reach convergence inverting the potential matrix to get the capacitance matrix. You can consider the number of iterations as an rough indicator of how well behaved the matrix is and so, indirectly, of how correctly discretized the input geometry is. You'll have a series of iterations for each conductor in your problem. In this case, having only one conductor, there is only one row.

  • The result

    CAPACITANCE MATRIX, nanofarads
                                    1
    sphere%GROUP1 1 0.1058

    This is the actual capacitance of our sphere, scaled to nanofarads.

Congratulations! You have just completed your first capacitance extraction with FastCap2.


FastCap2 Tutorial

Refine the geometry to achieve greater accuracy

The capacitance of a sphere

The sphere is a geometrical object for which a closed-form formula for the calculation of capacitance exists. By Gauss's law, a conducting sphere with one meter radius in free space has a capacitance of 4πε0 Farad, that is, about 0.111265 nF.

By comparing this result with FastCap2's, which is 0.1058 nF, we have about 5% error in the capacitance value. FastCap2's declared accuracy is 1%, but only provided with a suitable input discretization.

A refined sphere

  1. Load in FastModel the input file named sphere2.qui, which is located in the same directory of sphere1.qui.
  2. Examine the sphere in the FastModel panel. You'll see that this is a more refined model of a sphere.
  3. Launch FastCap2 on the new input file, just like you did with the previous file.

Checking the result

  1. Look at the result at the end of FastCap2's output window. The calculated capacitance is 0.1098 nF, which is within 1% of the correct value of 0.111265 nF.
  2. In this particular case, the correct value of the capacitance was known beforehand trough an analytical formula. But how, in general, the user can be sure to have reached 1% accuracy in the results? To answer this question, load the file sphere3.qui, which is located in the same directory of sphere1.qui and sphere2.qui, into FastModel.
  3. Examine the sphere in the FastModel panel. You'll see that this is an even more refined model of a sphere.
  4. Launch FastCap2 on the new input file, just like you did with the previous files.
  5. Check the new result, which is 0.1109 nF, even closer to 0.111265 nF. However, what is important here is that the capacitance calculated with the file sphere3.qui is within 1% of the capacitance calculated with the file sphere2.qui. This means that we have reached convergence, even if we had not known that the correct result was 0.111265 nF.


FastCap2 Tutorial

Change the global permittivity factor

We have calculated the capacitance of a sphere in free air. Now we would like to see how this capacitance would change if the sphere was embedded in a different dielectric medium, whose relative dielectric constant is different from one.

  1. With the file named sphere3.qui open in FastModel, launch FastCap2 but stop at the Run Menu dialog.
  2. Change the global permittivity factor to 2, as indicated in the following figure.
  3. Launch the simulation by clicking on the Run button.
  4. Examine the result. The calculated capacitance is 0.2218 nF, exactly twice the 0.1109 nF value we obtained in the free air, as expected.


FastCap2 Tutorial

Work with hierarchical input files (list files)

Suppose that you would like to know the capacitance of a structure made up of two spheres, instead of one.

You could simply use an input file describing first one sphere and then the second one, maybe changing the conductor name (see Understand basic FastCap2 input file syntax) to distinguish between the two spheres.

However, a simpler option to achieve the same result is to use a hierarchical input file.

Write and use a list file

  1. Close any file open in FastModel, by selecting the FastCap2 View and then, from the main menu, File->Close FastCap2 File
  2. In the FastCap2 View, type or copy and paste the following lines:

    *
    * Hierarchical input file example
    *
    * the first sphere is centered at the origin
    C sphere2.qui 1.0 0.0 0.0 0.0
    * the second sphere is offset along the x axis
    C sphere2.qui 1.0 2.0 0.0 0.0

  3. From the main menu, select File->Save FastCap2 File As..., name the file hierarchical.lst and save it in the same directory containing the sample file sphere2.qui.
  4. Click with the right mouse button on the FastCap2 View and select Update Model. You should see in the FastModel View a picture of the two spheres, like the one shown in the following figure:

  5. Launch a FastCap2 simulation, but this time put a tick mark near the List File label on the Run Menu dialog, as shown in the figure, to inform FastCap2 that it should process a hierarchical input file.

  6. Launch the simulation by clicking on the Run button.
  7. Examine the result, reported here below.

    CAPACITANCE MATRIX, nanofarads
                            1          2
    sphere%GROUP1 1     0.2047    -0.1284
    sphere%GROUP2 2    -0.1284     0.2047

    The result is a 2x2 capacitance matrix, one row / column for each conductor. Note that, even if the conductor name inside the sphere2.qui file was always sphere, FastCap2 distinguished between the two conductors by appending a unique suffix to the name.

Merge conductors

  1. You may have wanted to know the self capacitance of the whole structure. You can perform some computations to get it from the 2x2 capacitance matrix, or you can ask FastCap2 to consider both spheres as part of the same conductor. To do this, add a '+' at the end of the first conductor specification line, as shown in the figure. The '+' will merge the two input files in a single conductor.

  2. Launch a FastCap2 simulation.
  3. Examine the result. The capacitance value should be 0.1526 nF, which is exactly (0.2047 - 0.1284)*2, what you would get analitically from the previous 2x2 capacitance matrix.


FastCap2 Tutorial

Define dielectric interfaces

Dielectric interface panels are specified using the same syntax used for conductor panels. It is the list file that specifies if the panels must be treated as conductors or dielectric interfaces.

  1. Load the sample file coated_sph.lst into FastModel. You should see two concentric spheres in the FastModel view.

  2. Examine the list file in the FastCap2 View.

    The first non-comment line begins with a 'C' character. This line specifies that the file sphere2.qui is used to define a conductor. The conductor is surrounded by a dielectric medium whose dielectric constant is 2.0. Moreover, the coordinates of the panels described in the sphere2.qui file have a 3D offset of (0.0, 0.0, 0.0), that is, no offset.

    The second non-comment line begins with a 'D' character. This line specifies that the file sphere_big2.qui is used to define a dielectric interface. This is the outer shell containing the conductive sphere. The dielectric medium on one side of the interface has dielectric constant 1.0, while the medium on the other side has dielectric constant 2.0. The coordinates of the panels described in the sphere_big2.qui file have a 3D offset of (0.0, 0.0, 0.0), that is, no offset. In the end, the last triplet of numbers, together with the '-' sign, defines the reference point for the 'in' side of the interface. In this case, the command means that the point (0.0, 0.0, 0.0) lies in the region of space filled with dielectric medium with constant 2.0.

  3. Launch a FastCap simulation.
  4. Examine the result. The value for the capacitance should be 0.1478 nF, well within 1% of the 0.14835 nF value expected by Gauss's Law.


FastCap2 Automation Overview

FastCap2 provides a Windows Automation interface which allows a remote application to fully control FastCap2.

For example, a Visual Basic script inside an MS Windows Excel sheet can launch FastCap2 in background, make it perform some simulation, then retrieve the results and show them in some cells - and all without even showing up the FastCap2 window!

The Automation Object

FastCap2 can be controlled by any Automation-capable application. The automation object which must be created to control FastCap2 is named FastCap2.Document. This name is defined in the Windows Registry at installation time or, if removed from the Registry, any time FastCap2 is run.

Automation References

Automation is quite a complex topic in itself and will not be described here. We suggest to the unexperienced User to read Microsoft documentation on Automation. In particular, the following sources could be useful and can be found, for instance, on Microsoft web site:
  • "Locating resources to study automation", Microsoft Knowledge Base Article KB152023
  • "Building OLE Automation Service Components in Visual Basic and Visual C++", David George, Microsoft Corporation, October 2, 1995
  • "Inside OLE 2nd Edition", Kraig Brockschmidt, Microsoft Press, 1995

Example programs

Some example programs are provided to help understand and implement FastCap2 remote control.


FastCap2 Example Programs

FastCap2 Automation Example Programs

Altough Automation is a complex topic, using FastCap2 via Automation is simple enough. To get you started, we have created some example scripts which can be used to learn how to control FastCap2 and as a base to build more complex applications. In spite of their short length, these examples are quite comprehensive and the source code is well commented.

You can find the example files in a sub-directory in FastCap2's installation directory.

FastCapClient Sample Program

This is the most complete example, which shows the use of all FastCap2 methods and properties. To compile this example, you must have MS Visual Basic 6.0 (or newer) installed.

fc_drive.xls Sample Program

This is a Visual Basic for Applications example. To run this example, you must have MS Excel 2000 (or newer) installed.

Remark: for the script to work, you must answer 'yes' at the prompt which asks you if you want to enable the macros, when you load the file into Excel.

Remark: the files sphere0.qui, sphere1.qui, sphere2.qui, sphere3.qui are used by this script and must reside in the same directory of fc_drive.xls for the script to work.

fcdriv.vbs Sample Program

This is a Visual Basic Script example. To run this example, you only need one of the following Windows versions: Me, 2000, XP. The best way to launch this script is from a DOS shell, typing "cscript fcdriv.vbs", in the directory where fcdriv.vbs resides. You can also double-click on the file name, but in this case all the log messages will appear in separate pop-up message boxes.

Remark: the files sphere0.qui, sphere1.qui, sphere2.qui, sphere3.qui are used by this script and must reside in the same directory of fcdriv.vbs for the script to work.


Run Method Reference

FastCap2Object.Run

boolean FastCap2Object.Run(BSTR commandLine)

Return Value

True if FastCap2 was able to start a simulation, false otherwise.

Notes:

A reason why FastCap2 could not be able to start a simulation is that a simulation is already running. You can try to stop FastCap2 before retrying and / or poll FastCap2 status.

Parameters

commandLine

A string containing a FastCap2 command line, as would be given from a shell console.

Example:

FastCap2Object.Run("-lspheres.lst -o3")

Remarks

Runs a simulation.

See Also

FastCap2 Automation Overview | IsRunning Property | Stop Method


Stop Method Reference

FastCap2Object.Stop

void FastCap2Object.Stop()

Return Value

None

Parameters

None

Remarks

Stops the currently running simulation.

Notes:

It could take some time before FastCap2 actually stops, depending on the operation currently under execution. You can poll FastCap2 status checking the IsRunning property or you can set a callback upon FastCap2 end of operation using the SetEndCallback method.

See Also

FastCap2 Automation Overview | IsRunning Property | SetEndCallback Method


Quit Method Reference

FastCap2Object.Quit

boolean FastCap2Object.Quit()

Return Value

If true, FastCap2 was able to quit. If false, FastCap2 couldn't quit (possibly because there's a simulaton on going; try to stop it before quitting).

Parameters

None

Remarks

Quits FastCap2.

See Also

FastCap2 Automation Overview | Stop Method


ShowWindow Method Reference

FastCap2Object.ShowWindow

void FastCap2Object.ShowWindow()

Return Value

None

Parameters

None

Remarks

Shows FastCap2 console window, which is hidden by default when the FastCap2 Object is created via automation.

Notes:

Once the console becomes visible, you cannot hid it again.

See Also

FastCap2 Object Overview


GetCapacitance Method Reference

FastCap2Object.GetCapacitance

VARIANT FastCap2Object.GetCapacitance()

Return Value

The method returns a 2-dimensional safe-array encapsulated in a variant data. The array contains the capacitance matrix as calculated by FastCap2, in Farads. The first dimension of the array is the row index, the second is the column index.

Notes:

The array dimensions can be queried from the safe array itself, see the 'safe array' topic in the MS Automation documentation.

Parameters

None

Remarks

Gets the capacitance values calculated by FastCap2, result of the simulation.

See Also

FastCap2 Automation Overview | GetCondNames Method


GetCondNames Method Reference

FastCap2Object.GetCondNames

VARIANT FastCap2Object.GetCondNames()

Return Value

The method returns a 1-dimensional safe-array encapsulated in a variant data. The array contains the names of the conductors to which the capacitance matrix rows / columns refer.

Notes:

The array dimensions can be queried from the safe array itself, see the 'safe array' topic in the MS Automation documentation.

Parameters

None

Remarks

Gets conductor names for the rows / columns of the capacitance matrix.

See Also

FastCap2 Automation Overview | GetCapacitance Method


SetEndCallback Method Reference

FastCap2Object.SetEndCallback

boolean FastCap2Object.SetEndCallback(IDispatch* callback, BSTR cbName)

Return Value

True if a callback function was set. False if the callback function is reset to default (no callback).

Parameters

callback

Pointer to the client's automation object exposing the callback function. If NULL is passed as argument, the callback will be removed.

cbName

Name of the callback function.

The callback function must have the following prototype:

void cbName()

Remarks

Call this function to set a callback upon FastCap2 simulation end. That is, when FastCap2 has finished the simulation and results are available, the cbName function will be called to notify the client.

See Also

FastCap2 Automation Overview | IsRunning Property | SetLogCallback Method


SetLogCallback Method Reference

FastCap2Object.SetLogCallback

boolean FastCap2Object.SetLogCallback(IDispatch* callback, BSTR cbName)

Return Value

True if a callback function was set. False if the callback function is reset to default (no callback).

Parameters

callback

Pointer to the client's automation object exposing the callback function. If NULL is passed as argument, the callback will be removed.

cbName

Name of the callback function.

The callback function must have the following prototype:

void cbName(BSTR logString, long color)

logString

The string containing the log text passed back to the client.

color

The color of the string. The color will be black (red 255, green 255, blue 255) for normal messages and red (red 255, green 0, blue 0) for error messages.

Remarks

Call this function to set a callback upon FastCap2 log output. That is, when FastCap2 has something to log (everything that would normally be visible in FastCap2's console window), the cbName function will be called to notify the client and provide him the output string. This function is especially useful if FastCap2's console window is hidden.

See Also

FastCap2 Automation Overview | ShowWindow Method | SetEndCallback Method


GetSolveTime Method Reference

FastCap2Object.GetSolveTime

float FastCap2Object.GetSolveTime()

Return Value

The method returns the total time spent for the calculation.

Parameters

None

Remarks

Gets the total time spent by FastCap2 for the last solve process.

See Also

FastCap2 Automation Overview | GetSolveMemory Method


GetSolveMemory Method Reference

FastCap2Object.GetSolveMemory

long FastCap2Object.GetSolveMemory()

Return Value

The method returns the total memory allocated for the calculation, in bytes.

Parameters

None

Remarks

Gets the total time memory allocated by FastCap2 for the last solve process.

See Also

FastCap2 Automation Overview | GetSolveTime Method


GetReturnStatus Method Reference

FastCap2Object.GetReturnStatus

short FastCap2Object.GetReturnStatus()

Return Value

The method returns the return status of FastCap2.

Valid status values are:

FC_NORMAL_END         0
FC_USER_BREAK        -1
FC_OUT_OF_MEMORY     -2
FC_CANNOT_OPEN_FILE  -4
FC_FILE_ERROR        -8
FC_GENERIC_ERROR     -8192
FC_STILL_RUNNING     -16384

Parameters

None

Remarks

Returns the reason why FastCap2 stopped execution. The reason could be normal end, user break or errors.

See Also

FastCap2 Automation Overview


IsRunning Property Reference

FastCap2Object.IsRunning

boolean FastCap2Object.IsRunning()

Return Value

True if there's a simulation running. False if FastCap2 is idle.

Parameters

None

Remarks

Tests if FastCap2 is running a simulation.

See Also

FastCap2 Automation Overview | SetEndCallback Method | Stop Method