├── resource.rc ├── res ├── FasterCap.ico ├── FasterCap_16x16.png ├── FasterCap_32x32.png ├── FasterCap_16x16.xpm └── FasterCap_32x32.xpm ├── IFasterCap_x64.tlb ├── IFasterCap_x86.tlb ├── Solver ├── AutoPanel.cpp ├── CMakeLists.txt ├── SphereGen.h ├── AutoElement.cpp ├── MultiplyHierarchical.h ├── AutoConductor.h ├── SphereGen.cpp ├── AutoConductor.cpp ├── SolverGlobal.cpp ├── AutoElement.h └── AutoSegment.h ├── hlp ├── Images │ ├── FC2Cubes.png │ ├── FC2Square.png │ ├── FRC2DCoax.png │ ├── openicon.png │ ├── FC2ListFile.png │ ├── FC2ListFile2.png │ ├── FC2RunMenu.png │ ├── FC2RunMenu2.png │ ├── FC2RunMenu3.png │ ├── FC2Sphere1.png │ ├── FC2Sphere2.png │ ├── FC2Sphere3.png │ ├── FC2DielSphere.png │ ├── FC2OpenSphere1.png │ ├── FC2Sphere1Text.png │ ├── FC2SpherePlane.png │ ├── FC2SpheresHier.png │ ├── FasterCapRun01.png │ ├── launchfastcapicon.png │ ├── FC2Sphere1Commented.png │ ├── cubes_capacitances.png │ └── maxwell_capacitance_matrix.png ├── FasterCap.hhp ├── Output │ ├── Output_ch04.htm │ └── Output_ch02.htm ├── Automation │ ├── GetSolveTimeMethod.htm │ ├── ShowWindowMethod.htm │ ├── IsRunningProperty.htm │ ├── QuitMethod.htm │ ├── GetSolveMemoryMethod.htm │ ├── GetCondNamesMethod.htm │ ├── StopMethod.htm │ ├── GetCapacitanceMethod.htm │ ├── RunMethod.htm │ ├── GetConductanceMethod.htm │ ├── SetEndCallbackMethod.htm │ ├── FasterCapAutomationOverview.htm │ ├── SetLogCallbackMethod.htm │ ├── GetReturnStatusMethod.htm │ └── AutomationExamples.htm ├── Run │ ├── Run_ch03.htm │ └── Run_ch02.htm ├── InputFile │ ├── 3D │ │ ├── InputFile_3D_ch07.htm │ │ ├── InputFile_3D_ch06.htm │ │ ├── InputFile_3D_ch05.htm │ │ ├── InputFile_3D_ch03.htm │ │ ├── InputFile_3D_ch02.htm │ │ └── InputFile_3D_ch04.htm │ ├── 2D │ │ ├── InputFile_2D_ch07.htm │ │ ├── InputFile_2D_ch05.htm │ │ ├── InputFile_2D_ch03.htm │ │ ├── InputFile_2D_ch04.htm │ │ └── InputFile_2D_ch02.htm │ ├── InputFile_single_file.htm │ └── InputFile_main.htm └── WelcometoFasterCap.htm ├── test.h ├── stdafx.h ├── wx_pch.h ├── FasterCapConsole.h ├── IFasterCap.idl ├── registry3264.h ├── LicenseBox.h ├── AboutBox.h ├── wxsmith ├── LicenseBox.wxs ├── AboutBox.wxs └── FasterCapframe.wxs ├── History.txt ├── FasterCapApp.h ├── README.md ├── FasterCapGlobal.h ├── AutomationHelper.h ├── RunDialog.h ├── registry3264.cpp ├── CMakeLists.txt ├── FasterCapGlobal.cpp ├── AboutBox.cpp └── LicenseBox.cpp /resource.rc: -------------------------------------------------------------------------------- 1 | aaaa ICON "res/FasterCap.ico" 2 | 3 | #include "wx/msw/wx.rc" 4 | -------------------------------------------------------------------------------- /res/FasterCap.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/res/FasterCap.ico -------------------------------------------------------------------------------- /IFasterCap_x64.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/IFasterCap_x64.tlb -------------------------------------------------------------------------------- /IFasterCap_x86.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/IFasterCap_x86.tlb -------------------------------------------------------------------------------- /Solver/AutoPanel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/Solver/AutoPanel.cpp -------------------------------------------------------------------------------- /hlp/Images/FC2Cubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Cubes.png -------------------------------------------------------------------------------- /hlp/Images/FC2Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Square.png -------------------------------------------------------------------------------- /hlp/Images/FRC2DCoax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FRC2DCoax.png -------------------------------------------------------------------------------- /hlp/Images/openicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/openicon.png -------------------------------------------------------------------------------- /res/FasterCap_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/res/FasterCap_16x16.png -------------------------------------------------------------------------------- /res/FasterCap_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/res/FasterCap_32x32.png -------------------------------------------------------------------------------- /hlp/Images/FC2ListFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2ListFile.png -------------------------------------------------------------------------------- /hlp/Images/FC2ListFile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2ListFile2.png -------------------------------------------------------------------------------- /hlp/Images/FC2RunMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2RunMenu.png -------------------------------------------------------------------------------- /hlp/Images/FC2RunMenu2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2RunMenu2.png -------------------------------------------------------------------------------- /hlp/Images/FC2RunMenu3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2RunMenu3.png -------------------------------------------------------------------------------- /hlp/Images/FC2Sphere1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Sphere1.png -------------------------------------------------------------------------------- /hlp/Images/FC2Sphere2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Sphere2.png -------------------------------------------------------------------------------- /hlp/Images/FC2Sphere3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Sphere3.png -------------------------------------------------------------------------------- /hlp/Images/FC2DielSphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2DielSphere.png -------------------------------------------------------------------------------- /hlp/Images/FC2OpenSphere1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2OpenSphere1.png -------------------------------------------------------------------------------- /hlp/Images/FC2Sphere1Text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Sphere1Text.png -------------------------------------------------------------------------------- /hlp/Images/FC2SpherePlane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2SpherePlane.png -------------------------------------------------------------------------------- /hlp/Images/FC2SpheresHier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2SpheresHier.png -------------------------------------------------------------------------------- /hlp/Images/FasterCapRun01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FasterCapRun01.png -------------------------------------------------------------------------------- /hlp/Images/launchfastcapicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/launchfastcapicon.png -------------------------------------------------------------------------------- /hlp/Images/FC2Sphere1Commented.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/FC2Sphere1Commented.png -------------------------------------------------------------------------------- /hlp/Images/cubes_capacitances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/cubes_capacitances.png -------------------------------------------------------------------------------- /hlp/Images/maxwell_capacitance_matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ediloren/FasterCap/HEAD/hlp/Images/maxwell_capacitance_matrix.png -------------------------------------------------------------------------------- /hlp/FasterCap.hhp: -------------------------------------------------------------------------------- 1 | [OPTIONS] 2 | Compatibility=1.1 or later 3 | Compiled file=../FasterCapHelp.chm 4 | Contents file=FasterCap.hhc 5 | Default Window=mainwin 6 | Display compile progress=Yes 7 | Language=0x409 Inglese (Stati Uniti) 8 | Title=FasterCap Help 9 | 10 | [WINDOWS] 11 | mainwin="FasterCap Help","FasterCap.hhc",,"WelcometoFasterCap.htm","WelcometoFasterCap.htm",,,,,0x2020,,0x3806,[0,0,640,450],0x30000,,,,,,0 12 | 13 | 14 | [INFOTYPES] 15 | 16 | -------------------------------------------------------------------------------- /res/FasterCap_16x16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * FasterCap_16x16_xpm[] = { 3 | "16 16 4 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFF00", 7 | "@ c #0000FF", 8 | "................", 9 | ".++++++++++++++.", 10 | ".++++++++++++++.", 11 | ".++++++++++++++.", 12 | ".++++++++++++++.", 13 | ".+++++@+@++++++.", 14 | ".+++++@+@++++++.", 15 | ".+++++@+@++++++.", 16 | ".@@@@@@+@@@@@@@.", 17 | ".+++++@+@++++++.", 18 | ".+++++@+@++++++.", 19 | ".+++++@+@++++++.", 20 | ".++++++++++++++.", 21 | ".++++++++++++++.", 22 | ".++++++++++++++.", 23 | "................"}; 24 | -------------------------------------------------------------------------------- /hlp/Output/Output_ch04.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Output 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap Output

17 | 18 |

Output tail

19 | 20 |

The output tail provides summary information. 21 |
  22 | 23 | 24 |
Total allocated memory: 12530 kilobytes 25 |
Total time: 0.311000s (0 days, 0 hours, 0 mins, 0 s) 26 |
27 | 28 | 29 |

In particular: 30 | 31 |

35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hlp/Automation/GetSolveTimeMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetSolveTime Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetSolveTime

16 | 17 |
float FasterCapObject.GetSolveTime()
18 | 19 |

Return Value

20 |

The method returns the total time spent for the calculation. 21 | 22 |

Parameters

23 |

None 24 | 25 |

Remarks

26 |

Gets the total time spent by FasterCap for the last solve process. 27 | 28 |

See Also

29 |

FasterCap Automation Overview | GetSolveMemory Method 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /hlp/Automation/ShowWindowMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ShowWindow Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.ShowWindow

16 | 17 |
void FasterCapObject.ShowWindow()
18 | 19 |

Return Value

20 |

None 21 | 22 |

Parameters

23 |

None 24 | 25 |

Remarks

26 |

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

Notes:

28 | Once the console becomes visible, you cannot hid it again. 29 | 30 |

See Also

31 |

FasterCap Object Overview 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /hlp/Automation/IsRunningProperty.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | IsRunning Property Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.IsRunning

16 | 17 |
boolean FasterCapObject.IsRunning()
18 | 19 |

Return Value

20 |

True if there's a simulation running. False if FasterCap is idle. 21 | 22 |

Parameters

23 |

None 24 | 25 |

Remarks

26 |

Tests if FasterCap is running a simulation. 27 | 28 |

See Also

29 |

FasterCap Automation Overview | SetEndCallback Method | Stop Method 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /hlp/Automation/QuitMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Quit Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.Quit

16 | 17 |
boolean FasterCapObject.Quit()
18 | 19 |

Return Value

20 |

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

Parameters

23 |

None 24 | 25 |

Remarks

26 |

Quits FasterCap. 27 | 28 |

See Also

29 |

FasterCap Automation Overview | Stop Method 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /hlp/Run/Run_ch03.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Running FasterCap 11 | 12 | 13 | 14 | 15 | 16 |

Running FasterCap

17 | 18 |

Launching FasterCap through Automation

19 | 20 | FasterCap can be launched through COM Automation. This is a propietary MS technology implemented under Windows. COM Automation is not available under Linux. 21 |

FasterCap's Automation interface allows a remote application to fully control FasterCap, either showing the GUI or as a GUI-less solver engine. 22 |

For details about the Automation interface, please see the relevant Automation section. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /hlp/Automation/GetSolveMemoryMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetSolveMemory Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetSolveMemory

16 | 17 |
long FasterCapObject.GetSolveMemory()
18 | 19 |

Return Value

20 |

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

Parameters

23 |

None 24 | 25 |

Remarks

26 |

Gets the total time memory allocated by FasterCap for the last solve process. 27 | 28 |

See Also

29 |

FasterCap Automation Overview | GetSolveTime Method 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /hlp/Automation/GetCondNamesMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetCondNames Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetCondNames

16 | 17 |
VARIANT FasterCapObject.GetCondNames()
18 | 19 |

Return Value

20 |

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

Notes:

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

Parameters

25 |

None 26 | 27 |

Remarks

28 |

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

See Also

31 |

FasterCap Automation Overview | GetCapacitance Method 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /hlp/Automation/StopMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Stop Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.Stop

16 | 17 |
void FasterCapObject.Stop()
18 | 19 |

Return Value

20 |

None 21 | 22 |

Parameters

23 |

None 24 | 25 |

Remarks

26 |

Stops the currently running simulation. 27 |

Notes:

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

See Also

31 |

FasterCap Automation Overview | IsRunning Property | SetEndCallback Method 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /res/FasterCap_32x32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * FasterCap_32x32_xpm[] = { 3 | "32 32 4 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFF00", 7 | "@ c #0000FF", 8 | "................................", 9 | ".++++++++++++++++++++++++++++++.", 10 | ".++++++++++++++++++++++++++++++.", 11 | ".++++++++++++++++++++++++++++++.", 12 | ".++++++++++++++++++++++++++++++.", 13 | ".++++++++++++++++++++++++++++++.", 14 | ".++++++++++++++++++++++++++++++.", 15 | ".++++++++++++++++++++++++++++++.", 16 | ".+++++++++++++@++@+++++++++++++.", 17 | ".+++++++++++++@++@+++++++++++++.", 18 | ".+++++++++++++@++@+++++++++++++.", 19 | ".+++++++++++++@++@+++++++++++++.", 20 | ".+++++++++++++@++@+++++++++++++.", 21 | ".+++++++++++++@++@+++++++++++++.", 22 | ".+++++++++++++@++@+++++++++++++.", 23 | ".+++@@@@@@@@@@@++@@@@@@@@@@@+++.", 24 | ".+++++++++++++@++@+++++++++++++.", 25 | ".+++++++++++++@++@+++++++++++++.", 26 | ".+++++++++++++@++@+++++++++++++.", 27 | ".+++++++++++++@++@+++++++++++++.", 28 | ".+++++++++++++@++@+++++++++++++.", 29 | ".+++++++++++++@++@+++++++++++++.", 30 | ".+++++++++++++@++@+++++++++++++.", 31 | ".++++++++++++++++++++++++++++++.", 32 | ".++++++++++++++++++++++++++++++.", 33 | ".++++++++++++++++++++++++++++++.", 34 | ".++++++++++++++++++++++++++++++.", 35 | ".++++++++++++++++++++++++++++++.", 36 | ".++++++++++++++++++++++++++++++.", 37 | ".++++++++++++++++++++++++++++++.", 38 | ".++++++++++++++++++++++++++++++.", 39 | "................................"}; 40 | -------------------------------------------------------------------------------- /Solver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(FasterCap_Sources 2 | ${CMAKE_CURRENT_LIST_DIR}/AutoConductor.cpp 3 | ${CMAKE_CURRENT_LIST_DIR}/AutoConductor.h 4 | ${CMAKE_CURRENT_LIST_DIR}/AutoElement.cpp 5 | ${CMAKE_CURRENT_LIST_DIR}/AutoElement.h 6 | ${CMAKE_CURRENT_LIST_DIR}/AutoPanel.cpp 7 | ${CMAKE_CURRENT_LIST_DIR}/AutoPanel.h 8 | ${CMAKE_CURRENT_LIST_DIR}/Autorefine.cpp 9 | ${CMAKE_CURRENT_LIST_DIR}/Autorefine.h 10 | ${CMAKE_CURRENT_LIST_DIR}/AutoSegment.cpp 11 | ${CMAKE_CURRENT_LIST_DIR}/AutoSegment.h 12 | ${CMAKE_CURRENT_LIST_DIR}/MultiplyHierarchical.cpp 13 | ${CMAKE_CURRENT_LIST_DIR}/MultiplyHierarchical.h 14 | ${CMAKE_CURRENT_LIST_DIR}/Potential.cpp 15 | ${CMAKE_CURRENT_LIST_DIR}/Potential.h 16 | ${CMAKE_CURRENT_LIST_DIR}/SolveCapacitance.cpp 17 | ${CMAKE_CURRENT_LIST_DIR}/SolveCapacitance.h 18 | ${CMAKE_CURRENT_LIST_DIR}/SolverGlobal.cpp 19 | ${CMAKE_CURRENT_LIST_DIR}/SolverGlobal.h 20 | ${CMAKE_CURRENT_LIST_DIR}/SphereGen.cpp 21 | ${CMAKE_CURRENT_LIST_DIR}/SphereGen.h 22 | ) 23 | 24 | 25 | #set(LinAlgebra_Required_Libs 26 | # debug MSVCRTD.LIB 27 | # debug MSVCPRTD.LIB 28 | # optimized MSVCRT.LIB 29 | # optimized MSVCPRT.LIB) 30 | 31 | # not creating a library (to save on compile time) 32 | #add_library(Solver ${Solver_Sources}) 33 | # libraries that needs to be linked to the present library 34 | #target_link_libraries(Solver ${Solver_Required_Libs}) 35 | #target_link_libraries(Solver ${EXTRA_LIBS}) 36 | 37 | 38 | -------------------------------------------------------------------------------- /hlp/Automation/GetCapacitanceMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetCapacitance Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetCapacitance

16 | 17 |
VARIANT FasterCapObject.GetCapacitance()
18 | 19 |

Return Value

20 |

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

Notes:

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

Parameters

25 |

None 26 | 27 |

Remarks

28 |

Gets the capacitance values calculated by FasterCap, result of the simulation. 29 | 30 |

See Also

31 |

FasterCap Automation Overview | GetCondNames Method | GetConductance Method 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /hlp/Automation/RunMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Run Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.Run

16 | 17 |
boolean FasterCapObject.Run(BSTR commandLine)
18 | 19 |

Return Value

20 |

True if FasterCap was able to start a simulation, false otherwise. 21 |

Notes:

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

Parameters

25 |

26 | commandLine 27 |

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

28 |

Example:

29 |

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

30 | 31 |

Remarks

32 |

Runs a simulation. 33 | 34 |

See Also

35 |

FasterCap Automation Overview | IsRunning Property | Stop Method 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /hlp/Automation/GetConductanceMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetCapacitance Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetConductance

16 | 17 |
VARIANT FasterCapObject.GetConductance()
18 | 19 |

Return Value

20 |

The method returns a 2-dimensional safe-array encapsulated in a variant data. The array contains the imaginary part of the complex capacitance matrix as calculated by FasterCap (i.e. the conductance divided by 2*pi*f, where pi is pi greek and f is the frequency of interest). The first dimension of the array is the row index, the second is the column index. 21 |

Notes:

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

Parameters

25 |

None 26 | 27 |

Remarks

28 |

Gets the conductance values calculated by FasterCap, result of the simulation. 29 | 30 |

See Also

31 |

FasterCap Automation Overview | GetCondNames Method | GetCapacitance Method 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch07.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Name definitions ('N' statement)

19 | 20 |

Syntax: N <oldcondname> <newcondname> 21 | 22 | 23 |

The 'N' element at the beginning of a line renames a conductor. More specifically, it associates all the panels previously assigned to the conductor named <oldcondname> to the conductor named <newcondname>. 24 | 25 |

Example: 26 | 27 |
  28 | 29 |
Q 1  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  1.0 1.0 1.0 30 |
Q 1  0.0 1.0 0.0  1.0 1.0 0.0  1.0 1.0 1.0  0.0 1.0 1.0 31 |
Q 1  1.0 0.0 0.0  0.0 0.0 0.0  0.0 0.0 1.0  1.0 0.0 1.0 32 |
Q 1  0.0 0.0 0.0  0.0 1.0 0.0  0.0 1.0 1.0  0.0 0.0 1.0 33 |
Q 1  0.0 0.0 0.0  1.0 0.0 0.0  1.0 1.0 0.0  0.0 1.0 0.0 34 |
Q 1  0.0 0.0 1.0  1.0 0.0 1.0  1.0 1.0 1.0  0.0 1.0 1.0 35 |
N 1  mycube 36 |
37 | 38 |

This input file fragments specifies a cubic conductor whose name is '1'. The conductor is then renamed to a more user-friendly name mycube. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hlp/Automation/SetEndCallbackMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | SetEndCallback Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.SetEndCallback

16 | 17 |
boolean FasterCapObject.SetEndCallback(IDispatch* callback, BSTR cbName)
18 | 19 |

Return Value

20 |

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

Parameters

23 |

24 | callback 25 |

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

26 |

27 | cbName 28 |

Name of the callback function.

29 |

The callback function must have the following prototype:

30 |

void cbName() 31 | 32 |

Remarks

33 |

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

See Also

36 |

FasterCap Automation Overview | IsRunning Property | SetLogCallback Method 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /test.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef TEST_INCLUDED_H 26 | #define TEST_INCLUDED_H 27 | 28 | void test_pot2D(); 29 | 30 | #endif //TEST_INCLUDED_H 31 | -------------------------------------------------------------------------------- /hlp/Output/Output_ch02.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Output 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap Output

17 | 18 |

Output header

19 | 20 |

The header provides basic informations about the simulation that is going to be run. 21 |
  22 | 23 | 24 |
Running FasterCap version 5.0.2 25 |
Copyright 2013 FastFieldSolvers S.r.l. http://www.fastfieldsolvers.com, All Rights reserved 26 |
Starting capacitance extraction with the following parameters: 27 |
Input file: C:\Documents and Settings\All Users\Documents\FastFieldSolvers\FasterCap\cubes.lst 28 |
Auto calculation with max error: 0.01 29 |
Remark: Auto option overrides all other Manual settings 30 |
  31 |
Solution scheme (-g): Collocation, GMRES tolerance (-t): 0.005 32 |
Out-of-core free memory to link memory condition (-f): 5 33 |
Potential interaction coefficient to mesh refinement ratio (-d): 1 34 |
Mesh curvature (-mc): 3 35 |
Number of input panels to solver engine: 24 36 |
37 | 38 | 39 |

In particular, besides the version and copyright information, you have: 40 | 41 |

46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Solver/SphereGen.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // SphereGen.h 26 | // 27 | 28 | #include "SolverGlobal.h" 29 | 30 | int gensphere(double sradius, long depth, FILE *sfp); 31 | -------------------------------------------------------------------------------- /hlp/InputFile/2D/InputFile_2D_ch07.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 2D Input Files

17 | 18 |

Name definitions ('N' statement)

19 | 20 |

Syntax: N <oldcondname> <newcondname> 21 | 22 | 23 |

The 'N' element at the beginning of a line renames a conductor. More specifically, it associates all the segments previously assigned to the conductor named <oldcondname> to the conductor named <newcondname>. 24 | 25 |

Example: 26 | 27 |
  28 | 29 |
S circle 0.1 0 0.098768907 0.015642989 30 |
S circle 0.098768907 0.015642989 0.095105938 0.030900818 31 |
S circle 0.095105938 0.030900818 0.089101283 0.045397812 32 |
S circle 0.089101283 0.045397812 0.080902789 0.058777026 33 |
S circle 0.080902789 0.058777026 0.070712316 0.07070904 34 |
S circle 0.070712316 0.07070904 0.058780774 0.080900066 35 |
S circle 0.058780774 0.080900066 0.045401939 0.08909918 36 |
S circle 0.045401939 0.08909918 0.030905224 0.095104506 37 |
S circle 0.030905224 0.095104506 0.015647565 0.098768182 38 |
S circle 0.015647565 0.098768182 4.63268E-06 0.1 39 |
N circle  coax_outer_shell 40 |
41 | 42 |

This input file fragments specifies a conductor whose name is 'circle'. The conductor is then renamed to a more user-friendly name coax_outer_shell. 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /stdafx.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // stdafx.h : dummy include file for compatibility with MS Visual Studio precompiled 26 | // headers (#included in VS .cpp files) 27 | 28 | #if !defined(AFX_STDAFX_H_MULTIPLATFORM) 29 | #define AFX_STDAFX_H_MULTIPLATFORM 30 | 31 | #endif 32 | 33 | 34 | -------------------------------------------------------------------------------- /hlp/InputFile/2D/InputFile_2D_ch05.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 2D Input Files

17 | 18 |

Straight segment definitions ('S' statement)

19 | 20 |

Syntax: S <condname> <x1> <y1>   <x2> <y2> 21 | 22 | 23 |

The 'S' element at the beginning of a line defines a straight segment. If the segment belongs to a conductor surface, the <condname> parameter is used to associate the segment to a parent conductor named <condname>. If the segment belongs to a dielectric surface, the <condname> parameter is ignored. 24 | The (x1, y1), (x2, y2) 2D points specify the coordinates of the two end points of the segment. 25 | 26 |

Example 1: 27 | 28 |
  29 | 30 |
S circle 0.1 0  0.098768907 0.015642989 31 |
32 | 33 |

This input file fragments specifies a segment of the surface of a conductor, whose name is circle. 34 | 35 |

Example 2: 36 | 37 |
  38 | 39 |
S inner_shell 0.098768907 0.015642989  0.095105938 0.030900818 40 |
S outer_shell 0.095105938 0.030900818  0.089101283 0.045397812 41 |
S inner_shell 0.089101283 0.045397812  0.080902789 0.058777026 42 | 43 |
44 | 45 |

This input file fragments specifies two segments of the surface of a conductor, whose name is inner_shell, and one segment of the surface of a second conductor, whose name is outer_shell. 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /hlp/Automation/FasterCapAutomationOverview.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FastCap Automation Overview 10 | 11 | 12 | 13 | 14 | 15 |

FasterCap Automation Overview

16 | 17 | FasterCap provides a MS Windows Automation interface which allows a remote application to fully control FasterCap. 18 | 19 |

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

The Automation Object

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

Automation References

26 | 27 | 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: 28 | 29 | 36 | 37 |

Example programs

38 | 39 | Some example programs are provided to help understand and implement FasterCap remote control. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /hlp/InputFile/InputFile_single_file.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap Input Files

17 | 18 |

Single Input File option

19 | 20 | FasterCap supports also the option to specify all input data in a single file. This avoids the need for a possibly large number of different input files. 21 |

The format is as follows: 22 | 23 |

(main input file) 24 |
End 25 |
File <first_sub-file> 26 |
(contents of <first_sub-file>) 27 |
End 28 |
File <second_sub-file> 29 |
(contents of <second_sub-file>) 30 |
End 31 |
32 | 33 |

In this way, all references to external files can be replaced by internal references; for instance, if you write 34 | 35 |
C first_sub-file 1.0 0.0 0.0 0.0 36 | 37 | 38 |
FasterCap will not try to access the file 'first_sub-file' from the file system, but will take the data from the 'File' section as per the above definition. 39 | 40 |

FasterCap allows hierarchical definitions, i.e. 'first_sub-file' can contain references to 'second_sub-file'. If the referenced files are not found internally, FasterCap assumes that they reside on the file system, and will look for them accordingly. 41 | 42 |

The characters following 'E' in 'End' and following 'F' in 'File' are optional. Like the other statements, 'E' and 'F' are case-insensitive, and must be the first character of the line in which they are defined. 43 |
Moreover, the 'End' statement in itself is optional, and is included only for input file readibility. 44 | 45 |

You can find some examples of single input files in the 'Samples' directory, for both 3D and 2D models. 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /wx_pch.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // Purpose: Header to create Pre-Compiled Header (PCH) 26 | 27 | #ifndef WX_PCH_H_INCLUDED 28 | #define WX_PCH_H_INCLUDED 29 | 30 | // basic wxWidgets headers 31 | #include 32 | 33 | #ifdef __BORLANDC__ 34 | #pragma hdrstop 35 | #endif 36 | 37 | #ifndef WX_PRECOMP 38 | #include 39 | #endif 40 | 41 | #ifdef WX_PRECOMP 42 | // put here all your rarely-changing header files 43 | #endif // WX_PRECOMP 44 | 45 | #endif // WX_PCH_H_INCLUDED 46 | -------------------------------------------------------------------------------- /hlp/Automation/SetLogCallbackMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | SetLogCallback Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.SetLogCallback

16 | 17 |
boolean FasterCapObject.SetLogCallback(IDispatch* callback, BSTR cbName)
18 | 19 |

Return Value

20 |

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

Parameters

23 |

24 | callback 25 |

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

26 |

27 | cbName 28 |

Name of the callback function.

29 |

The callback function must have the following prototype:

30 |

void cbName(BSTR logString, long color) 31 |

logString

32 |

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

33 |

color

34 |

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.

35 | 36 |

Remarks

37 |

Call this function to set a callback upon FasterCap log output. That is, when FasterCap has something to log (everything that would normally be visible in FasterCap'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 FasterCap's console window is hidden. 38 | 39 |

See Also

40 |

FasterCap Automation Overview | ShowWindow Method | SetEndCallback Method 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /hlp/Automation/GetReturnStatusMethod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GetReturnStatus Method Reference 10 | 11 | 12 | 13 | 14 | 15 |

FasterCapObject.GetReturnStatus

16 | 17 |
short FasterCapObject.GetReturnStatus()
18 | 19 |

Return Value

20 |

The method returns the return status of FasterCap. 21 | 22 |

Valid status values are: 23 | 24 |

25 | FC_NORMAL_END             0
26 | FC_GENERIC_ERROR          1
27 | FC_FC_COMMAND_LINE_ERROR  64
28 | FC_CANNOT_OPEN_FILE       66
29 | FC_OUT_OF_MEMORY          71
30 | FC_FILE_ERROR             74
31 | FC_CANNOT_GO_OOC          97
32 | FC_EXCEPTION_ERROR        98
33 | FC_USER_BREAK             125
34 |
35 | 36 |

The meaning is: 37 |

FC_NORMAL_END: no error, normal end 38 | FC_GENERIC_ERROR: catchall for generic error 39 | FC_COMMAND_LINE_ERROR: command line usage error 40 | FC_CANNOT_OPEN_FILE: cannot open input file(s) 41 | FC_OUT_OF_MEMORY: out of memory 42 | FC_FILE_ERROR: generic file error 43 | FC_CANNOT_GO_OOC: cannot go out-of-core (probably disk full) 44 | FC_EXCEPTION_ERROR: unknown exception caught 45 | FC_USER_BREAK: user-requested break 46 | 47 |

Parameters

48 |

None 49 | 50 |

Remarks

51 |

Returns the reason why FasterCap stopped execution. The reason could be normal end, user break or errors. 52 | 53 |

See Also

54 |

FasterCap Automation Overview 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /FasterCapConsole.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef FASTERCAPCONSOLE_H 26 | #define FASTERCAPCONSOLE_H 27 | 28 | #include "FasterCapGlobal.h" 29 | #include "Solver/SolverGlobal.h" 30 | 31 | class FasterCapConsole 32 | { 33 | public: 34 | #ifdef FCG_HEADLESS 35 | int main(int& argc, char **argv, char bOption='\0'); 36 | #else 37 | int main(int& argc, wxChar **argv, char bOption='\0'); 38 | #endif // FCG_HEADLESS int main(int& argc, wxChar **argv, char bOption = '\0'); 39 | bool ParseCmdLine(const char *commandStr, CAutoRefGlobalVars &globalVars, wxString &errMsg); 40 | 41 | protected: 42 | int getSubstring(const char *buffer, char *substr, int *skip); 43 | 44 | private: 45 | }; 46 | 47 | #endif // FASTERCAPCONSOLE_H 48 | -------------------------------------------------------------------------------- /hlp/Automation/AutomationExamples.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | FastCap Example Programs 10 | 11 | 12 | 13 | 14 | 15 |

FasterCap Automation Example Programs

16 | 17 | Altough Automation is a complex topic, using FasterCap via Automation is simple enough. To get you started, we have created some example scripts which can be used to learn how to control FasterCap 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. 18 | 19 |

You can find the example files in a sub-directory in FasterCap's installation directory. 20 | 21 |

FasterCapClient Sample Program

22 | This is the most complete example, which shows the use of all FasterCap methods and properties. To compile this example, you must have MS Visual Basic 6.0 (or newer) installed. 23 |
For your convenience, we provided also the executable file that you can directly run, provided that you have Visual Basic 6.0 DLL installed. 24 | 25 |

fastercap_drive.xls Sample Program

26 | This is a Visual Basic for Applications example. To run this example, you must have MS Excel 2000 (or newer) installed. With minor modifications, marked with proper comments in the Visual Basic source code embedded in the spreadsheet, you can also run the same example using LibreOffice Calc. 27 |

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 or Calc. 28 |

Remark: the files sphere0.txt, sphere1.txt, sphere2.txt, sphere3.txt are used by this script and must reside in the same directory of fastercap_drive.xls for the script to work. 29 | 30 |

fastercap_drive.vbs Sample Program

31 | This is a Visual Basic Script example. The best way to launch this script is from a DOS shell, typing "cscript fastercap_drive.vbs", in the directory where fastercap_drive.vbs resides. 32 | 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. 33 |

Remark: the files sphere0.txt, sphere1.txt, sphere2.txt, sphere3.txt are used by this script and must reside in the same directory of fastercap_drive.vbs for the script to work. 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /IFasterCap.idl: -------------------------------------------------------------------------------- 1 | // IDL file for FasterCap 2 | // 3 | // {F99B4BC5-434E-4d11-8656-AE0AC816E586} = Type library's GUID 4 | // {4ACA654C-C56C-47d5-86F4-7B721F06E056} = FasterCap object's GUID 5 | // {80FDCF45-7F79-4409-8195-4FF9BB4BD5A3} = FasterCap VTable's GUID 6 | 7 | [uuid(F99B4BC5-434E-4d11-8656-AE0AC816E586), version(1.0), helpstring("FasterCap COM server")] 8 | library IFasterCap 9 | { 10 | importlib("STDOLE2.TLB"); 11 | 12 | [uuid(80FDCF45-7F79-4409-8195-4FF9BB4BD5A3), dual, oleautomation, hidden, nonextensible] 13 | interface IFasterCapVTbl : IDispatch 14 | { 15 | [helpstring("Check if FasterCap is running")] 16 | [id(1)] HRESULT IsRunning([out, retval] VARIANT_BOOL *); 17 | [helpstring("Show FasterCap window (hidden by default via Automation")] 18 | [id(2)] HRESULT ShowWindow(); 19 | [helpstring("Quit FasterCap")] 20 | [id(3)] HRESULT Quit([out, retval] VARIANT_BOOL *); 21 | [helpstring("Get a SafeArray containing the capacitance matrix")] 22 | [id(4)] HRESULT GetCapacitance([out, retval] VARIANT *); 23 | [helpstring("Get a SafeArray containing the conductance matrix")] 24 | [id(5)] HRESULT GetConductance([out, retval] VARIANT *); 25 | [helpstring("Get a SafeArray containing the conductor names")] 26 | [id(6)] HRESULT GetCondNames([out, retval] VARIANT *); 27 | [helpstring("Run FasterCap with the provided command line")] 28 | [id(7)] HRESULT Run([in] BSTR, [out, retval] VARIANT_BOOL *); 29 | [helpstring("Stop FasterCap execution")] 30 | [id(8)] HRESULT Stop(); 31 | [helpstring("Get FasterCap's execution time for last solve")] 32 | [id(9)] HRESULT GetSolveTime([out, retval] float *); 33 | [helpstring("Get FasterCap's max memory allocated during for last solve")] 34 | [id(10)] HRESULT GetSolveMemory([out, retval] long *); 35 | [helpstring("Get the total number of refined panels")] 36 | [id(11)] HRESULT GetPanelsNum([out, retval] long *); 37 | [helpstring("Get the total number of links between panels")] 38 | [id(12)] HRESULT GetLinksNum([out, retval] long *); 39 | [helpstring("Get FasterCap return status")] 40 | [id(13)] HRESULT GetReturnStatus([out, retval] short *); 41 | [helpstring("Set FasterCap Automation callback to signal end of execution")] 42 | [id(14)] HRESULT SetEndCallback([in] LPDISPATCH, [in] BSTR, [out, retval] VARIANT_BOOL *); 43 | [helpstring("Set FasterCap Automation callback to signal log messages")] 44 | [id(15)] HRESULT SetLogCallback([in] LPDISPATCH, [in] BSTR, [out, retval] VARIANT_BOOL *); 45 | }; 46 | 47 | [uuid(4ACA654C-C56C-47d5-86F4-7B721F06E056), helpstring("FasterCap document"), appobject] 48 | coclass IFasterCap 49 | { 50 | [default] interface IFasterCapVTbl; 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /registry3264.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | // Purpose: class derived from wxWidgets wxRegKey to manage 64 bits vs. 32 bits keys 25 | 26 | #include "wx_pch.h" 27 | 28 | // valid only for MS Win 29 | #ifdef __WXMSW__ 30 | 31 | #include 32 | 33 | #define KEY_REGKEY3264_DEFAULT (0) 34 | 35 | class wxRegKey3264 : public wxRegKey 36 | { 37 | public: 38 | wxRegKey3264(const wxString& strKey, REGSAM mode = KEY_REGKEY3264_DEFAULT); 39 | wxRegKey3264(const wxRegKey3264& keyParent, const wxString& strKey, REGSAM mode = KEY_REGKEY3264_DEFAULT); 40 | wxRegKey3264() : key3264access(KEY_REGKEY3264_DEFAULT) {} 41 | bool Open(AccessMode mode = Write); 42 | bool Create(bool bOkIfExists = true); 43 | bool Exists() const; 44 | bool HasSubKey(const wxChar *szKey) const; 45 | void SetKey32bits(); 46 | 47 | protected: 48 | bool KeyExists(WXHKEY hRootKey, const wxChar *szKey); 49 | 50 | REGSAM key3264access; 51 | }; 52 | 53 | #endif //__WXMSW__ 54 | -------------------------------------------------------------------------------- /LicenseBox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef LICENSEBOX_H 26 | #define LICENSEBOX_H 27 | 28 | #ifndef WX_PRECOMP 29 | //(*HeadersPCH(LicenseBox) 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | //*) 36 | #endif 37 | //(*Headers(LicenseBox) 38 | //*) 39 | 40 | class LicenseBox: public wxDialog 41 | { 42 | public: 43 | 44 | LicenseBox(wxWindow* parent,wxWindowID id=wxID_ANY); 45 | virtual ~LicenseBox(); 46 | 47 | //(*Declarations(LicenseBox) 48 | wxStaticText* StaticText_Header2; 49 | wxStaticText* StaticText_Header3; 50 | wxPanel* Panel1; 51 | wxStaticText* StaticText_Header1; 52 | wxTextCtrl* TextCtrl_License; 53 | //*) 54 | 55 | protected: 56 | 57 | //(*Identifiers(LicenseBox) 58 | static const long ID_STATICTEXT_HEADER1; 59 | static const long ID_STATICTEXT_HEADER2; 60 | static const long ID_STATICTEXT_HEADER3; 61 | static const long ID_TEXTCTRL_LICENSE; 62 | static const long ID_PANEL1; 63 | //*) 64 | 65 | private: 66 | 67 | //(*Handlers(LicenseBox) 68 | //*) 69 | 70 | DECLARE_EVENT_TABLE() 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /hlp/InputFile/InputFile_main.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap Input Files

17 | 18 |

Input File Syntax

19 | 20 | This chapter provides reference information about the FasterCap input file syntax 21 |

FasterCap supports 3D or 2D capacitance extraction. The input file syntax is as similar as possible for the two cases. 22 | 23 |

3D Syntax

24 | 25 |

The input files specify the geometry of the conductors and of the dielectrics through a description of their surfaces, modeled as quadrilateral or triangular panels. 26 |

The input file syntax for FasterCap is 100% compatible with the FastCap2 "generic file format". It also introduces some enhancements, mainly the support of complex permittivity values and of hierarchical models. 27 | 28 |

For more information about the input file syntax: 29 | 30 |

39 | 40 | 41 |

2D Syntax

42 | 43 |

The input files specify the geometry of the conductors and of the dielectrics through a description of their contours, modeled as straight segments. 44 |

The input file syntax is similar to the 3D FasterCap syntax, but adapted to the 2D case. 45 | 46 |

For more information about the input file syntax: 47 | 48 |

56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch06.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Triangular panel definitions ('T' statement)

19 | 20 |

Syntax: T <condname> <x1> <y1> <z1>   <x2> <y2> <z2>   <x3> <y3> <z3>   [<xref> <yref> <zref>] 21 | 22 | 23 |

The 'T' element at the beginning of a line defines a triangular panel. If the triangular panel belongs to a conductor surface, the <condname> parameter is used to associate the panel to a parent conductor named <condname>. If the triangular panel belongs to a dielectric surface, the <condname> parameter is ignored. 24 | The (x1, y1, z1), (x2, y2, z2), (x3, y3, z3) 3D points specify the coordinates of the three corners of the panel; the coordinates must be entered in clockwise or counterclockwise order starting from any one corner. 25 |
In case the panel is part of a dielectric interface, you can use the optional coordinates (xref, yref, zref) to specify a reference point; see 3D Dielectric definitions ('D' statement) for more details about dielectric interfaces. 26 | 27 |

Example 1: 28 | 29 |
  30 | 31 |
T mypyramid  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0 32 |
33 | 34 |

This input file fragments specifies a face of the surface of a conducting pyramid, whose name is mypyramid. 35 | 36 |

Example 2: 37 | 38 |
  39 | 40 |
T onepyramid  0.0 0.0 0.0  1.0 0.0 0.0  0.0 1.0 0.0 41 |
T otherpyramid  0.0 1.0 0.0  1.0 1.0 0.0  1.0 1.0 1.0 42 |
T onepyramid  0.0 0.0 0.0  1.0 0.0 0.0  0.5 0.5 1.0 43 | 44 |
45 | 46 |

This input file fragments specifies two face of the surface of a conducting pyramid, whose name is onepyramid, and one face of the surface of a second conducting pyramid, whose name is otherpyramid. 47 | 48 |

Example 3: 49 | 50 |
  51 | 52 |
T mypyramid  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  0.0 0.0 2.0 53 |
54 | 55 |

This input file fragments specifies a face of the surface of a dielectric pyramid, whose name is mypyramid, with a panel-specific dielectric reference point at (0,0,2). 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /AboutBox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef ABOUTBOX_H 26 | #define ABOUTBOX_H 27 | 28 | #ifndef WX_PRECOMP 29 | //(*HeadersPCH(AboutBox) 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | //*) 37 | #endif 38 | //(*Headers(AboutBox) 39 | //*) 40 | 41 | class AboutBox: public wxDialog 42 | { 43 | public: 44 | 45 | AboutBox(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize); 46 | virtual ~AboutBox(); 47 | 48 | //(*Declarations(AboutBox) 49 | wxButton* Button_ShowLicense; 50 | wxStaticText* StaticText_Version; 51 | wxStaticBitmap* StaticBitmap1; 52 | wxPanel* Panel1; 53 | wxStaticText* StaticText_WebSite; 54 | wxStaticText* StaticText_Copyright; 55 | //*) 56 | 57 | protected: 58 | 59 | //(*Identifiers(AboutBox) 60 | static const long ID_STATICBITMAP1; 61 | static const long ID_ABOUTBOX_VERSION; 62 | static const long ID_ABOUTBOX_COPYRIGHT; 63 | static const long ID_ABOUTBOX_WEBSITE; 64 | static const long ID_ABOUTBOX_SHOWLICENSE; 65 | static const long ID_PANEL1; 66 | //*) 67 | 68 | private: 69 | 70 | //(*Handlers(AboutBox) 71 | void OnButton_ShowLicenseClick(wxCommandEvent& event); 72 | //*) 73 | 74 | DECLARE_EVENT_TABLE() 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch05.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Quadrilateral panel definitions ('Q' statement)

19 | 20 |

Syntax: Q <condname> <x1> <y1> <z1>   <x2> <y2> <z2>   <x3> <y3> <z3>   <x4> <y4> <z4>   [<xref> <yref> <zref>] 21 | 22 | 23 |

The 'Q' element at the beginning of a line defines a quadrilateral panel. If the quadrilateral panel belongs to a conductor surface, the <condname> parameter is used to associate the panel to a parent conductor named <condname>. If the quadrilateral panel belongs to a dielectric surface, the <condname> parameter is ignored. 24 | The (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4) 3D points specify the coordinates of the four corners of the panel; the coordinates must be entered in clockwise or counterclockwise order starting from any one corner. 25 |
In case the panel is part of a dielectric interface, you can use the optional coordinates (xref, yref, zref) to specify a reference point; see 3D Dielectric definitions ('D' statement) for more details about dielectric interfaces. 26 | 27 |

Example 1: 28 | 29 |
  30 | 31 |
Q mycube  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  1.0 1.0 1.0 32 |
33 | 34 |

This input file fragments specifies a face of the surface of a conducting cube, whose name is mycube. 35 | 36 |

Example 2: 37 | 38 |
  39 | 40 |
Q onecube  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  1.0 1.0 1.0 41 |
Q othercube  0.0 1.0 0.0  1.0 1.0 0.0  1.0 1.0 1.0  0.0 1.0 1.0 42 |
Q onecube  1.0 0.0 0.0  0.0 0.0 0.0  0.0 0.0 1.0  1.0 0.0 1.0 43 | 44 |
45 | 46 |

This input file fragments specifies two face of the surface of a conducting cube, whose name is onecube, and one face of the surface of a second conducting cube, whose name is othercube. 47 | 48 |

Example 3: 49 | 50 |
  51 | 52 |
Q mycube  1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  1.0 1.0 1.0  0.0 0.0 2.0 53 |
54 | 55 |

This input file fragments specifies a face of the surface of a dielectric cube, whose name is mycube, with a panel-specific dielectric reference point at (0,0,2). 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /hlp/InputFile/2D/InputFile_2D_ch03.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 2D Input Files

17 | 18 |

Conductor definitions ('C' statement)

19 | 20 |

Syntax: C <file> <outperm> <xoffset> <yoffset> [+] 21 | 22 | 23 |

The 'C' element at the beginning of a line defines a conductor. The geometry of the conductor surface is further specified in the file <file>. The conductor is assumed embedded in an homogeneous dielectric medium with relative permettivity <outperm>. The relative permittivity <outperm> can be complex valued, in the format ere-jeim, where ere is the real part of the complex permittivity value, and eim is the imaginary part. The conductor can be translated with respect to the coordinates defined in <file> by an offset (xoffset, yoffset), thus allowing to reuse the same geometric definitions multiple times. 24 |
The optional + argument is used to merge the current conductor with the next one, thus treating them a single conductor. With this option, panels with the same conductor name in different files will belong to the same conductor (see panels definitions for more information about conducor naming). 25 | 26 |

Example 1: 27 |
  28 | 29 |
C circle_0.2_fine.txt 1.0  0.0 0.0 30 |
31 | 32 |

This input file fragments specifies a conductor whose geometry is defined in the file circle_0.1_fine.txt, embedded in a dielectric with permettivity equal to one (e.g. air), and translated to the position (0.0, 0.0). 33 | 34 |

Example 2: 35 |
  36 | 37 |
C microstrip_top_0.03.txt 1.0  -0.025 0.01 + 38 |
C microstrip_bottom_0.03.txt 2.0  -0.025 0.01 39 |
40 | 41 |

This input file fragments specifies a conductor made of two parts in contact with two dielectric materials with different relative permittivities. It is considered a single conductor since the first statement ends by +, thus collating the two elements; i.e. the two parts are considered short-circuited together. 42 | 43 |

Example 3: 44 |
  45 | 46 |
C circle_0.005.txt 4.0-j3.016e6  0.0 0.02 47 |
48 | 49 |

This input file fragments specifies a conductor whose geometry is defined in the file circle_0.005.txt, embedded in a dielectric with complex relative permettivity equal to 4.0-j3.016e6 (e.g. with real part equal to 4.0 and imaginary part equal to 3.016e6), and translated to the position (0.0, 0.02). 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch03.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Conductor definitions ('C' statement)

19 | 20 |

Syntax: C <file> <outperm> <xoffset> <yoffset> <zoffset> [+] 21 | 22 | 23 |

The 'C' element at the beginning of a line defines a conductor. The geometry of the conductor surface is further specified in the file <file>. The conductor is assumed embedded in an homogeneous dielectric medium with relative permettivity <outperm>. The relative permittivity <outperm> can be complex valued, in the format ere-jeim, where ere is the real part of the complex permittivity value, and eim is the imaginary part. The conductor can be translated with respect to the coordinates defined in <file> by an offset (xoffset, yoffset, zoffset), thus allowing to reuse the same geometric definitions multiple times. 24 |
The optional + argument is used to merge the current conductor with the next one, thus treating them a single conductor. With this option, panels with the same conductor name in different files will belong to the same conductor (see panels definitions for more information about conducor naming). 25 | 26 |

Example 1: 27 |
  28 | 29 |
C cube.txt    1.000000     2.0 0.0 0.0 30 |
31 | 32 |

This input file fragments specifies a conductor whose geometry is defined in the file cube.txt, embedded in a dielectric with permettivity equal to one (e.g. air), and translated to the position (2.0, 0.0, 0.0). 33 | 34 |

Example 2: 35 |
  36 | 37 |
C cube.txt    1.000000     0.0 0.0 0.0 + 38 |
C cube.txt    1.000000     2.0 0.0 0.0 39 |
40 | 41 |

This input file fragments specifies a conductor made of two cubes in free air. It is considered a single conductor since the first statement ends by +, thus collating the two elements; i.e. the two cubes are considered short-circuited together. 42 | 43 |

Example 3: 44 |
  45 | 46 |
C cube.txt    3.0-j0.02     2.0 0.0 0.0 47 |
48 | 49 |

This input file fragments specifies a conductor whose geometry is defined in the file cube.txt, embedded in a dielectric with complex permettivity equal to 3.0-j0.02 (e.g. with real part equal to 3.0 and imaginary part equal to 0.02), and translated to the position (2.0, 0.0, 0.0). 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /wxsmith/LicenseBox.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 6 | 7 | 8 | 9 | 1 10 | 3 11 | 12 | 13 | wxVERTICAL 14 | 15 | 16 | 17 | 18 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 19 | 5 20 | 21 | 22 | 23 | 24 | 25 | 26 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 27 | 5 28 | 29 | 30 | 31 | 32 | 33 | 34 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 35 | 5 36 | 37 | 38 | 39 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 40 | 5 41 | 42 | 43 | 44 | 45 | License 46 | 400,300 47 | 48 | 49 | wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 50 | 5 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 62 | 5 63 | 64 | 65 | 66 | 67 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 68 | 5 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Solver/AutoElement.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // 2D segments & 3D patch base class, to be used in AutoRefine 26 | // E. Di Lorenzo, 2013/02/05 27 | 28 | #include "AutoElement.h" 29 | 30 | // link with FasterCap main frame 31 | #include "../FasterCapGlobal.h" 32 | 33 | CAutoElement::CAutoElement() 34 | { 35 | unsigned char i; 36 | 37 | // initialize panel structure 38 | 39 | m_ucType = AUTOPANEL_IS_LEAF; 40 | 41 | for(i=0; iInitElementsTree(); 68 | m_pRight->InitElementsTree(); 69 | } 70 | } 71 | 72 | void CAutoElement::DeleteElementsTree() 73 | { 74 | // visit the tree 75 | 76 | if (IsLeaf() != true) { 77 | // scan the subtree, only after delete panel 78 | m_pLeft->DeleteElementsTree(); 79 | m_pRight->DeleteElementsTree(); 80 | } 81 | 82 | // then delete panel 83 | delete this; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /Solver/MultiplyHierarchical.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // MultiplyHierarchical.h : hierarchical multiplication class header file 26 | // 27 | 28 | #if !defined(AFX_MULTIPLYHIERARCHICAL_H__ENRI1945_5487_55D2_9284_04F014CF5600__INCLUDED_) 29 | #define AFX_MULTIPLYHIERARCHICAL_H__ENRI1945_5487_55D2_9284_04F014CF5600__INCLUDED_ 30 | 31 | #include "SolverGlobal.h" 32 | 33 | #include "Autorefine.h" 34 | 35 | // includes for LinALg 36 | #include "LinAlgebra/Vect.h" 37 | 38 | #define MULTHIER_MAX_RECURS_DEPTH 128 39 | 40 | 41 | class CMultHier : public CAutoRefine 42 | { 43 | 44 | public: 45 | CMultHier(); 46 | ~CMultHier(); 47 | int AllocateMemory(); 48 | void DeallocateMemory(); 49 | int MultiplyMatByVec_fast(CLin_Vector *v, CLin_Vector *q); 50 | void CopyChargesToVec(CLin_Vector *q); 51 | void CopyVecToCharges(CLin_Vector *q); 52 | void InitFlatLinks(); 53 | 54 | unsigned long m_ulFirstCondElemIndex; 55 | 56 | protected: 57 | void ComputePanelCharges_fast(); 58 | int ComputePanelPotentials_2fast(); 59 | void ComputeLeafPotentials_fast(); 60 | void CopyPanelCharges(); 61 | void CopyCharges(CAutoElement* panel); 62 | void CopyVecCharges(); 63 | void CopyVec(CAutoElement* panel); 64 | 65 | CLin_Range m_clsChargeVect, m_clsPotVect; 66 | long m_dIndex; 67 | CAutoElement *m_clsRecursVec[MULTHIER_MAX_RECURS_DEPTH]; 68 | 69 | }; 70 | 71 | #endif //!defined(AFX_MULTIPLYHIERARCHICAL_H__ENRI1945_5487_55D2_9284_04F014CF5600__INCLUDED_) 72 | -------------------------------------------------------------------------------- /hlp/InputFile/2D/InputFile_2D_ch04.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 2D Input Files

17 | 18 |

Dielectric definitions ('D' statement)

19 | 20 |

Syntax: D <file> <outperm> <inperm> <xoffset> <yoffset> <xref> <yref> [-] 21 | 22 | 23 |

The 'D' element at the beginning of a line defines a dielectric. The geometry of the dielectric contour is further specified in the file <file>. The dielectric contour is intended as the interface between two regions with relative permettivities <outperm> and <inperm>. The relative permittivities <outperm> and <inperm> can be complex valued, in the format eRe-jeIm, where eRe is the real part of the complex permittivity value, and eIm is the imaginary part. The dielectric can be translated with respect to the coordinates defined in <file> by an offset (xoffset, yoffset), thus allowing to reuse the same geometric definitions multiple times. The reference point (xref, yref) and the optional - argument are used to specify which side of the dielectric interface has which permittivity. More specifically, the reference point is assumed to lie on the <outperm> side of all the segments in <file>. The optional - argument indicates that (xref, yref) instead lies on the <inperm> side. The reference point is not translated, i.e. the offset only applies to the elements specified in <file>. 24 |

Remark: it is the user's responsibility to make sure that the reference point is on the same side of the dielectric interface for all panels. That is, each panel is evaluated as stand-alone with respect to the reference point, to define its <outperm> and <inperm> sides. There is no concept of a external and internal side of a surface specified by a group of panels, even if specified in the same file with the same conductor names, since FasterCap maintains no topological information. 25 | 26 |

Example 1: 27 |
  28 | 29 |
D circle_0.15_fine.txt 1.0 2.0  0.0 0.0  0.0 0.0 - 30 |
31 | 32 |

This input file fragments specifies a dielectric interface whose geometry is defined in the file circle_0.15_fine.txt. The interior of the circle is filled with a material with relative permittivity equal to 2.0, since the reference point is centered on the origin and the optional - argument is specified; while the dielectric medium ouside the circle has a relative permittivity equal to 1.0. 33 | 34 |

Example 2: 35 |
  36 | 37 |
D circle_0.15_fine.txt 3.0-j0.02 1.0  0.0 0.0  0.0 0.0 - 38 |
39 | 40 |

This input file fragments specifies a dielectric interface whose geometry is defined in the file circle_0.15_fine.txt. The interface is between air (relative permittivity equal to 1.0) and a lossy dielectric with complex relative permettivity equal to 3.0-j0.02 (e.g. with real part equal to 3.0 and imaginary part equal to 0.02). 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch02.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Input File Structure

19 | 20 |

The input file is a sequential list of materials definitions (conductor 'C' statements and dielectric 'D' statements) and of geometric panel descriptions (triangular patch 'T' and quadrilateral patch 'Q'). 21 |
Moreover, comments are allowed ('*' elements) as well as naming definitions ('N' elements) 22 | 23 |

Definitions can be nested in a hierarchical fashion to be able to re-use the geometric descriptions and to ease the construction of the models. 24 |
Panel geometric definitions ('Q' and 'T' elements) in the root file are assumed by default to belong to conductors embedded in a dielectric medium with unit permittivity. 25 | 26 |

All input files begins with a comment line. For compatibility and to ease possible file merging, you are recommended to start the line with a '*' character; anyway this is not mandatory, and the first line of any input file is simply ignored. 27 | 28 |

Remark: since FasterCap is able to automatically refine the geometry, it is best working with an input mesh as coarse as possible. This is a main difference with FastCap2, that needs a carefully pre-refined input mesh in order to produce accurate results. 29 | 30 |

An input file example is shown here below. 31 | 32 |

File cubes.txt: 33 |
  34 | 35 |
* Array of two cubes, in air 36 |
* 37 |
* conductor | dielectric | offset 38 |
* file name | constant   | in space 39 |
* 40 |
C cube.txt    1.000000     0.0 0.0 0.0 41 |
C cube.txt    1.000000     2.0 0.0 0.0 42 |
43 | 44 |

The above input file references hierarchically the file cube.txt. This file contains a geometric description of a unit cube, as shown here below. 45 | 46 |

File cube.txt: 47 |
  48 | 49 |
* 1mX1mX1m unit cube 50 |
* 51 |
* conductor     |   3D coordinates of the four corners 52 |
* name to which |   of the quadrilateral Q patch 53 |
* the Q patch   | 54 |
* belongs       | 55 |
* 56 |
Q mycube          1.0 1.0 0.0  1.0 0.0 0.0  1.0 0.0 1.0  1.0 1.0 1.0 57 |
Q mycube          0.0 1.0 0.0  1.0 1.0 0.0  1.0 1.0 1.0  0.0 1.0 1.0 58 |
Q mycube          1.0 0.0 0.0  0.0 0.0 0.0  0.0 0.0 1.0  1.0 0.0 1.0 59 |
Q mycube          0.0 0.0 0.0  0.0 1.0 0.0  0.0 1.0 1.0  0.0 0.0 1.0 60 |
Q mycube          0.0 0.0 0.0  1.0 0.0 0.0  1.0 1.0 0.0  0.0 1.0 0.0 61 |
Q mycube          0.0 0.0 1.0  1.0 0.0 1.0  1.0 1.0 1.0  0.0 1.0 1.0 62 | 63 |
64 | 65 |

The following sections explain in detail the meaning of each statement. 66 | 67 |

68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /wxsmith/AboutBox.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 0 6 | 7 | 8 | 9 | 10 | 2 11 | 2 12 | 13 | 14 | wxALL|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL 15 | 5 16 | 17 | 18 | 19 | 20 | wxVERTICAL 21 | 22 | 23 | 24 | 25 | wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 26 | 5 27 | 28 | 29 | 30 | 31 | 32 | 33 | wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 34 | 5 35 | 36 | 37 | 38 | 39 | 40 | 41 | wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 42 | 5 43 | 44 | 45 | 46 | wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 47 | 5 48 | 49 | 50 | 51 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 52 | 5 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 63 | 5 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 75 | 5 76 | 77 | 78 | 79 | wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 80 | 5 81 | 82 | 83 | 84 | 85 | wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 86 | 5 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /History.txt: -------------------------------------------------------------------------------- 1 | FasterCap History 2 | ================== 3 | Copyright (c) 2019 4 | FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com 5 | ================== 6 | 7 | Version 6.0.7, 2019/07/29 8 | - Fixed GetConductance bug using Automation under Windows 9 | - Fixed '-c' option missing in console mode 10 | 11 | Version 6.0.6, 2018/03/14 12 | - Added the '-e' option for output dump in CVS format 13 | - Added the '-oi' option for dumping "digested" input file 14 | - Minor bug fixing 15 | 16 | Version 6.0.5, 2018/01/26 17 | - Added the '-oi' option for input dump 18 | 19 | Version 6.0.0, 2017/08/24 20 | - LGPL version 21 | 22 | Version 5.5.2, 2015/01/19 23 | - Allowed running in pure console mode on Linux 24 | without the need of any DISPLAY 25 | 26 | Version 5.5.1, 2014/09/08 27 | - Improved Floating License mechanism 28 | - 64 bit version ported to MinGW-w64 29 | 30 | Version 5.5.0, 2014/06/30 31 | - Multi-processor version 32 | 33 | Version 5.0.7, 2014/03/31 34 | - Update to wxWidgets 3.0 35 | 36 | Version 5.0.6, 2013/12/12 37 | - Improved timing in connection to floating License Server, 38 | to avoid loosing connection in high load conditions 39 | 40 | Version 5.0.5, 2013/11/28 41 | - Fixing corner case issue in numerical potential evaluation 42 | 43 | Version 5.0.4, 2013/08/09 44 | - Enhanced flexibility on licensing 45 | 46 | Version 5.0.3, 2013/06/14 47 | - Added support for Win 64bits 48 | 49 | Version 5.0.2, 2013/03/12 50 | - Added 2D capacitance solver two-levels pre-conditioner support. 51 | - Added the Single Input File capability 52 | - Updated and changed exit status codes for both Automation 53 | and Console modes 54 | - Added console mode options: 55 | o print only the version 56 | o open only the help 57 | o print usage 58 | 59 | Version 5.0.1, 2013/03/11 60 | - Added 2D capacitance solver complex permittivity support. 61 | 62 | Version 5.0.0, 2013/01/11 63 | - Adding 2D capacitance solver capabilities. 64 | - Fixed a bug when dumping charge densities, in case there were conductors 65 | in contact with different dielectrics. 66 | 67 | Version 4.0.5, 2013/01/07 68 | - Minor stabilization fixes 69 | 70 | Version 4.0.0, 2012/12/21 71 | - Main Linux porting version 72 | - Improved two-levels pre-conditioner, both in terms of conditioning (less iterations needed 73 | to reach solution convergence) and of capability to build the preconditioner where 74 | the previous version failed and reverted to Jacobi preconditioner. 75 | In particular, the improved pre-conditioner is able to address ill-conditioned geometries 76 | with extreme geometrical ratios 77 | 78 | Version 3.5.0, 2012/12/04 79 | - Added command line option '-b' allowing launching FasterCap as a console application 80 | 81 | Version 3.1.1, 2012/12/03 82 | - Fixed issue when the maximum number of GMRES iterations is reached 83 | 84 | Version 3.1.0, 2012/11/19 85 | - Fixed issue with the division of stretched (long and thin) quadrilateral panels, 86 | causing in some cases many very small triangles to appear in the refinement 87 | - Changed the warning message for thin panels, so the user is notified, 88 | also in non-verbose mode, if the thin panels are in the input file or 89 | created during the triangularization 90 | - Added check for dummy dielectric surfaces (having the same dielectric constant 91 | on both sides). In this case FasterCap issues warning and skips the surface 92 | - Fixed issue in setting the verbose mode, that caused verbose information to appear 93 | only in the next run and not in the current 94 | 95 | Version 3.0.3, 2012/05/24 96 | - Support for complex permittivity to allow handling of lossy dielectric mediums 97 | 98 | Version 2.0, 2011/11/25 99 | - Out-of-core capability 100 | - Charge densities dump in FastModel compatibile format 101 | 102 | Version 1.2, 2010/12/18 103 | - Enhanced version supporting Automation 104 | 105 | Version 1.0, 2010/07/22 106 | - Creation 107 | -------------------------------------------------------------------------------- /wxsmith/FasterCapframe.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FasterCap 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 0 12 | 0 13 | 14 | 15 | 1000,400 16 | 17 | 10 18 | teletype 19 | 20 | 21 | 22 | wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 23 | 24 | 25 | 26 | 27 | wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Alt-F4 37 | Quit the application 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Open and run a FasterCap file 56 | 57 | 58 | 59 | 60 | Stop FasterCap execution 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | F1 69 | Display help 70 | 71 | 72 | 73 | 74 | 75 | F2 76 | Show program information, version and copyright 77 | 78 | 79 | 80 | 81 | 82 | 1 83 | -1 84 | wxSB_NORMAL 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Solver/AutoConductor.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // AutoConductor.h : CAutoConductor class definitions 26 | // E. Di Lorenzo, 2013/02/02 27 | 28 | #if !defined(AFX_AUTOCONDUCTOR_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 29 | #define AFX_AUTOCONDUCTOR_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_ 30 | 31 | #include "AutoPanel.h" 32 | #include "AutoSegment.h" 33 | // includes for bbox 34 | #include "Geometry/Geometry3D.h" 35 | #include "Geometry/Geometry2D.h" 36 | 37 | #include 38 | 39 | using namespace std; 40 | 41 | #define AUTOCONDUCTOR_MAX_NAME_LEN 512 42 | 43 | class CInteraction 44 | { 45 | public: 46 | CAutoPanel* m_clsPanel; 47 | double m_dPotCoeff; 48 | 49 | CInteraction() {} 50 | CInteraction(CAutoPanel *intPanel, double intPotCoeff) : m_clsPanel(intPanel), m_dPotCoeff(intPotCoeff) { } 51 | }; 52 | 53 | typedef C3DList InteractionC3DList; 54 | 55 | // conductor structure used by CAutoRefine 56 | class CAutoConductor 57 | { 58 | public: 59 | CAutoConductor(); 60 | CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm); 61 | CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm, 62 | double inpermRe, double inpermIm, C3DVector dielrefpoint); 63 | CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm, 64 | double inpermRe, double inpermIm, C2DVector dielrefpoint); 65 | void Scale(const double scale); 66 | 67 | char m_sName[AUTOCONDUCTOR_MAX_NAME_LEN]; 68 | // panels in 3D, segments in 2D 69 | StlAutoPanelDeque m_stlPanels; 70 | StlAutoSegmentDeque m_stlSegments; 71 | 72 | unsigned long m_ulLeafPanelNum; 73 | unsigned long m_ulInputPanelNum; 74 | bool m_bIsDiel; 75 | // diel constants for dielectrics 76 | double m_dOutperm[2], m_dInperm[2]; 77 | // diel constants for conductors 78 | double m_dSurfOutperm[AUTOPANEL_MAX_DIEL_NUM][2]; 79 | unsigned char m_ucMaxSurfOutperm; 80 | // 'm_clsDielRefxDPoint' is always on 'm_dOutperm' side 81 | C3DVector m_clsDielRef3DPoint; 82 | // conductor bounding box 83 | C3DBBox m_cls3DBbox; 84 | // top-level panel (either real panel or superpanel) 85 | union { 86 | CAutoPanel *m_pTopPanel; 87 | CAutoSegment *m_pTopSegment; 88 | CAutoElement *m_pTopElement; 89 | } m_uTopElement; 90 | 91 | protected: 92 | 93 | }; 94 | 95 | typedef std::deque StlAutoCondDeque; 96 | 97 | 98 | #endif //!defined(AFX_AUTOCONDUCTOR_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 99 | -------------------------------------------------------------------------------- /Solver/SphereGen.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define X .525731112119133606 30 | #define Z .850650808352039932 31 | 32 | static double vdata[12][3] = { 33 | {-X, 0.0, Z}, {X, 0.0, Z}, {-X, 0.0, -Z}, {X, 0.0, -Z}, 34 | {0.0, Z, X}, {0.0, Z, -X}, {0.0, -Z, X}, {0.0, -Z, -X}, 35 | {Z, X, 0.0}, {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0} }; 36 | 37 | static int tindices[20][3] = { 38 | {0,4,1}, {0,9,4}, {9,5,4}, {4,5,8}, {4,8,1}, 39 | {8,10,1}, {8,3,10}, {5,3,8}, {5,2,3}, {2,7,3}, 40 | {7,10,3}, {7,6,10}, {7,11,6}, {11,0,6}, {0,1,6}, 41 | {6,1,10}, {9,0,11}, {9,11,2}, {9,2,5}, {7,2,11} }; 42 | 43 | FILE *fp; 44 | double radius; 45 | 46 | void drawtriangle(double *v1, double *v2, double *v3) 47 | { 48 | fprintf(fp, "T sphere %f %f %f %f %f %f %f %f %f\n", v1[0] * radius, v1[1] * radius, v1[2] * radius, 49 | v2[0] * radius, v2[1] * radius, v2[2] * radius, 50 | v3[0] * radius, v3[1] * radius, v3[2] * radius); 51 | } 52 | 53 | void normalize(double v[3]) 54 | { 55 | double d = sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); 56 | 57 | if (d == 0.0) { 58 | fprintf(stderr, "ERROR: Zero length vector!\n"); 59 | return; 60 | } 61 | 62 | v[0] /= d; 63 | v[1] /= d; 64 | v[2] /= d; 65 | } 66 | 67 | void subdivide(double *v1, double *v2, double *v3, long depth) 68 | { 69 | double v12[3], v23[3], v31[3]; 70 | int i; 71 | 72 | if (depth == 0) { 73 | drawtriangle(v1, v2, v3); 74 | return; 75 | } 76 | 77 | for (i = 0; i < 3; i++) { 78 | v12[i] = v1[i] + v2[i]; 79 | v23[i] = v2[i] + v3[i]; 80 | v31[i] = v3[i] + v1[i]; 81 | } 82 | 83 | normalize(v12); 84 | normalize(v23); 85 | normalize(v31); 86 | 87 | subdivide(v1, v12, v31, depth-1); 88 | subdivide(v2, v23, v12, depth-1); 89 | subdivide(v3, v31, v23, depth-1); 90 | subdivide(v12, v23, v31, depth-1); 91 | } 92 | 93 | int gensphere(double sradius, long depth, FILE *sfp) 94 | { 95 | // char *endnumber; 96 | int i; 97 | 98 | radius = sradius; 99 | fp = sfp; 100 | 101 | if(fp == NULL) 102 | return -1; 103 | 104 | fprintf(fp, "0 Sphere with radius %f, refined up to depth %d\n", radius, (int)depth); 105 | 106 | for (i = 0; i < 20; i++) { 107 | subdivide(&vdata[tindices[i][0]][0], 108 | &vdata[tindices[i][1]][0], 109 | &vdata[tindices[i][2]][0], depth); 110 | } 111 | 112 | return 0; 113 | } 114 | 115 | -------------------------------------------------------------------------------- /Solver/AutoConductor.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // CAutoConductor class, to be used in AutoRefine 26 | // E. Di Lorenzo, 2013/02/02 27 | 28 | //#include "stdafx.h" 29 | 30 | #include "AutoConductor.h" 31 | 32 | // link with FasterCap main frame 33 | #include "../FasterCapGlobal.h" 34 | 35 | 36 | CAutoConductor::CAutoConductor() 37 | { 38 | m_sName[0] = '\0'; 39 | m_ulInputPanelNum = 0; 40 | m_ulLeafPanelNum = 0; 41 | m_uTopElement.m_pTopPanel = NULL; 42 | m_ucMaxSurfOutperm = 0; 43 | } 44 | 45 | CAutoConductor::CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm) 46 | { 47 | strcpy(m_sName, name); 48 | m_ulInputPanelNum = 0; 49 | m_ulLeafPanelNum = 0; 50 | m_bIsDiel = isdiel; 51 | m_dOutperm[0] = outpermRe; 52 | m_dOutperm[1] = outpermIm; 53 | m_dInperm[0] = 0.0; 54 | m_dInperm[1] = 0.0; 55 | m_clsDielRef3DPoint = C3DVector(0,0,0); 56 | m_uTopElement.m_pTopPanel = NULL; 57 | m_ucMaxSurfOutperm = 0; 58 | } 59 | 60 | CAutoConductor::CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm, 61 | double inpermRe, double inpermIm, C3DVector dielrefpoint) 62 | { 63 | strcpy(m_sName, name); 64 | m_ulInputPanelNum = 0; 65 | m_ulLeafPanelNum = 0; 66 | m_bIsDiel = isdiel; 67 | m_dOutperm[0] = outpermRe; 68 | m_dOutperm[1] = outpermIm; 69 | m_dInperm[0] = inpermRe; 70 | m_dInperm[1] = inpermIm; 71 | m_clsDielRef3DPoint = dielrefpoint; 72 | m_uTopElement.m_pTopPanel = NULL; 73 | m_ucMaxSurfOutperm = 0; 74 | } 75 | 76 | CAutoConductor::CAutoConductor(char *name, bool isdiel, double outpermRe, double outpermIm, 77 | double inpermRe, double inpermIm, C2DVector dielrefpoint) 78 | { 79 | strcpy(m_sName, name); 80 | m_ulInputPanelNum = 0; 81 | m_ulLeafPanelNum = 0; 82 | m_bIsDiel = isdiel; 83 | m_dOutperm[0] = outpermRe; 84 | m_dOutperm[1] = outpermIm; 85 | m_dInperm[0] = inpermRe; 86 | m_dInperm[1] = inpermIm; 87 | // trick of storing the dielectric 2D ref point inside the 3D ref point, 88 | // nulling the third coordinate 89 | m_clsDielRef3DPoint.x = dielrefpoint.x; 90 | m_clsDielRef3DPoint.y = dielrefpoint.y; 91 | m_clsDielRef3DPoint.z = 0.0; 92 | m_uTopElement.m_pTopPanel = NULL; 93 | m_ucMaxSurfOutperm = 0; 94 | } 95 | 96 | // scale conductor 97 | void CAutoConductor::Scale(const double scale) 98 | { 99 | m_clsDielRef3DPoint *= scale; 100 | // Remark: formally we should scale the bbox as well, however no need, 101 | // since this will be calculated AFTER the panels are scaled 102 | } 103 | -------------------------------------------------------------------------------- /hlp/InputFile/3D/InputFile_3D_ch04.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 3D Input Files

17 | 18 |

Dielectric definitions ('D' statement)

19 | 20 |

Syntax: D <file> <outperm> <inperm> <xoffset> <yoffset> <zoffset> <xref> <yref> <zref> [-] 21 | 22 | 23 |

The 'D' element at the beginning of a line defines a dielectric. The geometry of the dielectric surface is further specified in the file <file>. The dielectric surface is intended as the interface between two regions with relative permettivities <outperm> and <inperm>. The relative permittivities <outperm> and <inperm> can be complex valued, in the format eRe-jeIm, where eRe is the real part of the complex permittivity value, and eIm is the imaginary part. 24 |
The dielectric can be translated with respect to the coordinates defined in <file> by an offset (xoffset, yoffset, zoffset), thus allowing to reuse the same geometric definitions multiple times. 25 |
The reference point (xref, yref, zref) and the optional - argument are used to specify which side of the dielectric interface has which permittivity. More specifically, the reference point is assumed to lie on the <outperm> side of all the panels in <file>. The optional - argument indicates that (xref, yref, zref) instead lies on the <inperm> side. The reference point is not translated, i.e. the offset only applies to the elements specified in <file>. 26 | 27 |

Remark: it is the user's responsibility to make sure that the reference point is on the same side of the dielectric interface for all panels. That is, each panel is evaluated as stand-alone with respect to the reference point, to define its <outperm> and <inperm> sides. There is no concept of a external and internal side of a surface specified by a group of panels, even if specified in the same file with the same conductor names, since FasterCap maintains no topological information. 28 | 29 |

For complex shaped surfaces, FasterCap supports also the option to specify the reference point panel by panel, see 3D Triangular panel definitions ('T' statement) and 3D Quadrilateral panel definitions ('Q' statement) for details about the syntax. 30 | You can also mix the two type of panel definitions, i.e. panels without and panels with a per-panel reference point specification. In this case, panels without a reference point specified per panel will use the reference point specified for the whole dielectric interface in the 'D' statement. 31 | 32 |

Example 1: 33 |
  34 | 35 |
D sphere.txt  1.0 2.0  0.0 0.0 0.0  0.0 0.0 0.0  - 36 |
37 | 38 |

This input file fragments specifies a dielectric interface whose geometry is defined in the file sphere.txt. The interior of the sphere is filled with a material with relative permittivity equal 2.0, since the reference point is centered on the origin and the optional - argument is specified; while the dielectric medium ouside the sphere has a relative permittivity equal to 1.0. 39 | 40 |

Example 2: 41 |
  42 | 43 |
D sphere.txt  1.0 3.0-j0.02  0.0 0.0 0.0  0.0 0.0 0.0  - 44 |
45 | 46 |

This input file fragments specifies a dielectric interface whose geometry is defined in the file sphere.txt. The interface is between air (relative permittivity equal to 1.0) and a lossy dielectric with complex relative permettivity equal to 3.0-j0.02 (e.g. with real part equal to 3.0 and imaginary part equal to 0.02). 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /FasterCapApp.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef FASTERCAPAPP_H 26 | #define FASTERCAPAPP_H 27 | 28 | #include 29 | #include "FasterCapMain.h" 30 | 31 | // generic help system 32 | #include 33 | // MS help system 34 | #if wxUSE_MS_HTML_HELP 35 | # include 36 | #endif 37 | #include 38 | 39 | // This class is used in conjunction with FasterCapApp to enable 40 | // a pure console mode. 41 | // The new AppTraits is needed to be sure that the log target is the console 42 | // and not the wxLogGui 43 | class MixAppTraits : public wxGUIAppTraits 44 | { 45 | public: 46 | MixAppTraits(bool is_console); 47 | wxLog *CreateLogTarget(); 48 | 49 | protected: 50 | bool m_bIsConsole; 51 | }; 52 | 53 | // FasterCapApp enables also a pure console mode that can be used 54 | // GUI-less without even 55 | // initializing any GUI related stuff, so it can be used in 56 | // a remote console without exported DISPLAY in Linux 57 | // This is not an issue in Win as in this case the console 58 | // is always opened at start-up and the windows created only 59 | // on demand. 60 | // Similar to what shown at 61 | // http://compgroups.net/comp.soft-sys.wxwindows/hybrid-gui-console-app/2686190 62 | class FasterCapApp : public wxApp 63 | { 64 | public: 65 | inline FasterCapFrame *GetFasterCapFrame() { 66 | return m_pFasterCapFrame; 67 | } 68 | void DisplayHelp(); 69 | bool IsFirstUse(); 70 | void SetNotFirstUse(); 71 | wxString GetBasePath(); 72 | wxString GetSamplePath(); 73 | wxString GetLicenseTextPath(); 74 | 75 | int m_iRetStatus; 76 | 77 | protected: 78 | // overrides 79 | bool Initialize(int& argc, wxChar **argv); 80 | void CleanUp(); 81 | MixAppTraits *CreateTraits(); 82 | // virtuals 83 | virtual bool OnInit(); 84 | virtual int OnRun(); 85 | // virtual void OnIdle(wxIdleEvent& event); 86 | virtual int OnExit(); 87 | 88 | FasterCapFrame *m_pFasterCapFrame; 89 | long m_lIsFirstUse; 90 | wxString m_strBasePath; 91 | wxString m_strFasterCapPath; 92 | wxString m_strSamplePath; 93 | wxString m_strLicenseTextPath; 94 | #if wxUSE_MS_HTML_HELP 95 | // MS help support 96 | wxCHMHelpController *m_pHelp; 97 | #else 98 | // generic help support 99 | wxHtmlHelpController *m_pHelp; 100 | #endif 101 | bool m_bIsHelp; 102 | 103 | // DECLARE_EVENT_TABLE() 104 | }; 105 | #endif // FASTERCAPAPP_H 106 | -------------------------------------------------------------------------------- /Solver/SolverGlobal.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // SolverGlobal.cpp : globals 26 | // 27 | // Enrico Di Lorenzo, 2012/10/03 28 | 29 | #include "SolverGlobal.h" 30 | 31 | // global, type of solver invoked 32 | unsigned char g_ucSolverType = SOLVERGLOBAL_3DSOLVER; 33 | 34 | // result matrices and conductor names 35 | CLin_Matrix g_clsCapMatrixRe, g_clsCapMatrixIm; 36 | StlStringList g_stlCondNames; 37 | // statistics: 38 | // 39 | // memory used (in the thread) 40 | CMemoryUsage g_clsMemUsageCopy, g_clsMemUsage; 41 | // time 42 | float g_fSolveTime; 43 | // panels & links 44 | long g_lPanelsNum; 45 | long g_lLinksNum; 46 | 47 | 48 | CAutoRefGlobalVars::CAutoRefGlobalVars() 49 | { 50 | Reset(); 51 | } 52 | 53 | void CAutoRefGlobalVars::Reset() 54 | { 55 | m_sFileIn = "\0"; 56 | // if not specified, precond type is JACOBI 57 | m_ucPrecondType = AUTOREFINE_PRECOND_JACOBI; 58 | m_dMaxHierPreDiscSide = 128; 59 | m_uiSuperPreDim = 128; 60 | m_uiBlockPreSize = 32; 61 | m_bDumpResidual = false; 62 | m_bDumpTimeMem = false; 63 | m_bVerboseOutput = false; 64 | m_dGmresTol = 0.01; 65 | m_dHierPreGmresTol = 0.5; 66 | m_bOutputGeo = false; 67 | m_bDumpInputGeo = false; 68 | m_cScheme = AUTOREFINE_COLLOCATION; 69 | m_bAuto = false; 70 | m_bAutoPrecond = false; 71 | m_dAutoMaxErr = 0.01; 72 | m_dMeshEps = 0.1; 73 | m_dEpsRatio = 1.0; 74 | m_dMeshCurvCoeff = 3.0; 75 | m_dOutOfCoreRatio = 5.0; 76 | m_bOutputCharge = false; 77 | m_bOutputCapMtx = false; 78 | // not used any more in 'Run' dialog, but calculated offline and used globally 79 | m_dMaxDiscSide = 0.1; 80 | m_dEps = 0.3 * m_dMaxDiscSide; 81 | // not used any more in 'Run' dialog, but must be kept because 82 | // trigger operations in the code (watch out: may be used as unsupported options 83 | // via automation!) 84 | m_bKeepCharge = false; 85 | m_bRefineCharge = false; 86 | m_bKeepMesh = false; 87 | // not used in the 'Run' dialog, but globally used 88 | m_ucHasCmplxPerm = AUTOREFINE_REAL_PERM; 89 | m_bWarnGivenPre = false; 90 | m_bWarnGivenThin = false; 91 | m_bWarnGivenSkew = false; 92 | m_bWarnGivenSelfPot = false; 93 | m_bWarnGivenNaN = false; 94 | } 95 | 96 | CMemoryUsage::CMemoryUsage() 97 | { 98 | Clear(); 99 | } 100 | 101 | void CMemoryUsage::Clear() 102 | { 103 | m_ulPanelsMem = 0; 104 | m_ulLinksMem = 0; 105 | m_ulCondMem = 0; 106 | m_ulGmresMem = 0; 107 | m_ulPrecondMem = 0; 108 | m_ulChargesMem = 0; 109 | m_ulHierMem = 0; 110 | } 111 | 112 | unsigned long CMemoryUsage::GetTotal() 113 | { 114 | return (m_ulPanelsMem + m_ulChargesMem + m_ulLinksMem + m_ulCondMem + m_ulGmresMem + m_ulPrecondMem + m_ulHierMem); 115 | } 116 | 117 | unsigned long CMemoryUsage::GetTotalKB() 118 | { 119 | return GetTotal() / G_KILOBYTE; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /Solver/AutoElement.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // AutoSegment.h : 2D segments & 3D patch base class definition 26 | // E. Di Lorenzo, 2013/02/05 27 | 28 | #if !defined(AFX_AUTOELEMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 29 | #define AFX_AUTOELEMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_ 30 | 31 | #include "SolverGlobal.h" 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | // constant used to identify the class of the derived classes 39 | // throught the virtual function GetClass() 40 | #define AUTOELEMENT_SEGMENT 1 41 | #define AUTOELEMENT_PANEL 2 42 | #define AUTOELEMENT_QPANEL 4 43 | 44 | // constants used in CAutoPanel type 'm_ucType' 45 | #define AUTOPANEL_IS_LEAF (unsigned char)1 46 | #define AUTOPANEL_IS_DIEL (unsigned char)2 47 | #define AUTOPANEL_OUTPERM_NORMAL_DIR (unsigned char)4 48 | #define AUTOPANEL_OUTPERM_ELEMENT_LEVEL (unsigned char)8 49 | #define AUTOPANEL_IS_SUPER_NODE (unsigned char)128 50 | 51 | // maximum number of hierarchies supported by the panel structure 52 | // (e.g. for hierarchical preconditioning) 53 | #define AUTOPANEL_MAX_NUM_OF_HIERARCHIES (unsigned char)2 54 | 55 | // maximum number of different dielectric constants for the mediums surrounding 56 | // the different surfaces belonging to a single conductor 57 | #define AUTOPANEL_MAX_DIEL_NUM 256 58 | 59 | // EPS used to avoid divisions by zero, and other use 60 | #define AUTOPANEL_EPS 1E-12 61 | 62 | // panel structure used by CAutoRefine 63 | class CAutoElement 64 | { 65 | public: 66 | 67 | CAutoElement(); 68 | virtual ~CAutoElement() {} 69 | 70 | inline bool IsLeaf() 71 | { 72 | return (m_ucType & AUTOPANEL_IS_LEAF); 73 | } 74 | 75 | inline void SetNotLeaf() 76 | { 77 | m_ucType &= ~(AUTOPANEL_IS_LEAF); 78 | } 79 | 80 | inline double GetDimension() 81 | { 82 | return m_dDimension; 83 | } 84 | 85 | void InitElementsTree(); 86 | void DeleteElementsTree(); 87 | 88 | // virtual functions (pure virtual) 89 | virtual void ErrorPrintCoords() = 0; 90 | virtual unsigned char GetClass() = 0; 91 | 92 | unsigned char m_ucType; 93 | unsigned long m_ulLinkIndexStart[AUTOPANEL_MAX_NUM_OF_HIERARCHIES]; 94 | unsigned long m_ulLinkIndexEnd[AUTOPANEL_MAX_NUM_OF_HIERARCHIES]; 95 | unsigned long m_lNumOfChildren; 96 | CAutoElement *m_pLeft, *m_pRight; 97 | double m_dCharge, m_dPotential; 98 | long m_lIndex[AUTOPANEL_MAX_NUM_OF_HIERARCHIES]; 99 | unsigned char m_ucDielIndex; 100 | double m_dDimension; 101 | 102 | 103 | #ifdef DEBUG_DUMP_BASIC 104 | int m_iLevel; 105 | CAutoPanel *m_pParent; 106 | CAutoConductor *m_pCond; 107 | #endif 108 | 109 | }; 110 | 111 | #endif //!defined(AFX_AUTOELEMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FasterCap 2 | 3 | ## Copyright 4 | 5 | Copyright (c) 2019 6 | FastFieldSolvers S.R.L. - http://www.fastfieldsolvers.com 7 | 8 | ## Description 9 | 10 | FasterCap is a powerful three- and two-dimensional capactiance extraction program. 11 | 12 | For pre-compiled binaries, support, consultancy and additional information please visit http://www.fastfieldsolvers.com/ 13 | Access to the download pages is free, and you may access anonymously if you want. 14 | 15 | The source code is released under LGPL 2.1 or any later LGPL version, see the file LICENSE.txt for the details. 16 | 17 | ## Compiling 18 | 19 | FasterCap can be compiled for MS Windows and for *nix. For multiple platform compilation support, FasterCap uses CMake, plus Code::Blocks for the GUI version. 20 | The following software tools and complier chains are required. Used versions are indicated, higher version may work, but were not tested. 21 | 22 | ### MS Windows 64 bits 23 | 24 | - CMake 3.6.0 25 | - Code::Blocks, version 13.12 26 | - TDM-GCC 64 bits, version 4.8.1 27 | - wxWidgets, version 3.0 28 | 29 | #### Notes 30 | 31 | - Use a fresh TDM-GCC package, not the one shipped with Code::Blocks, as the latter is missing the TDM OpenMP package. 32 | 33 | - You need to pre-compile wxWidgets with TDM-GCC. Do not use pre-compiled versions, as the used compiler switch configurations may be very different when generating the binaries. Do NOT compile as monolithic, so .exe are smaller. Do two compiles, debug + release, using MSDOS makefiles and TDM-GCC (no need to use MSYS). 34 | 35 | - Run CMake until you configure all the required parameters (you need some knowledge of how CMake works). You may want to set the switch FASTFIELDSOLVERS_HEADLESS as ON for a DOS-only version ("headless") of the software, however under Windows this is useless; just run FasterCap in shell-only mode with the appropriate -b switch (see FasterCap documentation) 36 | 37 | ### Linux 64 bits 38 | 39 | - CMake 2.8.12 40 | - Code::Blocks, version 13.12 41 | - GCC, version 4.8.1 42 | - wxWidgets (wxGTK), version 3.0 43 | 44 | #### Notes 45 | 46 | - Run CMake until you configure all the required parameters (you need some knowledge of how CMake works), then generate a CodeBlock project. You may want to set the switch FASTFIELDSOLVERS_HEADLESS as ON for a shell-only version ("headless") of the software, or you can keep this OFF and just run FasterCap in shell-only mode with the appropriate -b switch (see FasterCap documentation) 47 | 48 | Example (using a GUI-less CMake): 49 | 50 | Move to the build directory you choose (different from the source files directory) and type the following command, where "../FasterCap" is the path to the base directory containing the FasterCap source code: 51 | 52 | `cmake -G"CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../FasterCap` 53 | 54 | Then you can open Code::Blocks, open the FasterCap.cbp project file created by CMake under the build diretory, and compile it. 55 | 56 | ### Linux 64 bits headless 57 | 58 | - CMake 3.5.1 59 | - GCC, version 4.8.1 or higher (higher version tested: on 5.4.0) 60 | - wxWidgets, version 3.0.2 or higher (higher version tested: 3.0.2) 61 | 62 | #### Notes 63 | 64 | - Run CMake until you configure all the required parameters (you need some knowledge of how CMake works). You **must** set the switch FASTFIELDSOLVERS_HEADLESS as ON, as in a headless Linux distro you have no drivers at all for video. 65 | 66 | Example: 67 | 68 | Move to the build directory you choose (different from the source files directory) and type the following command, where "../FasterCap" is the path to the base directory containing the FasterCap source code: 69 | 70 | `cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFASTFIELDSOLVERS_HEADLESS=ON ../FasterCap` 71 | 72 | Then you can launch the build process with: 73 | 74 | `make` 75 | 76 | Remark: at run time you will see the an "Assert failure" message. This is a wxWidgets issue, see ["debug message when running without session manager"](http://trac.wxwidgets.org/ticket/16024). 77 | The assert is harmless, and it is fixed starting from wxWidgets 3.1.1 78 | 79 | ## Additional packages 80 | 81 | FasterCap also requires two additional source code packages, that are available through the same official repositories you can access from http://www.fastfieldsolvers.com/ or directly from GitHub. 82 | 83 | The packages are: 84 | 85 | - LinAlgebra 86 | - Geometry 87 | 88 | Both package directories, with the above names, must be at the same hierarchy level in the folder structure of the FasterCap source code directory, and are handled by CMake. 89 | 90 | ## Additional information 91 | 92 | For any additional information please visit [FastFieldSolvers](https://www.fastfieldsolvers.com/), write on the [FastFieldSolvers Forum](https://www.fastfieldsolvers.com/forum) or [contact us](https://www.fastfieldsolvers.com/contact.htm). 93 | 94 | -------------------------------------------------------------------------------- /FasterCapGlobal.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // CPP header file containing function prototypes linking 26 | // FasterCap with the GUI I/O window. 27 | // Actual function bodies, when needed, are in FasterCapMain.cpp 28 | 29 | #ifndef FASTERCAPGLOBAL_H 30 | #define FASTERCAPGLOBAL_H 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | 37 | // debug defines 38 | //#define DEBUG_REGISTER_TYPELIB 39 | //#define DEBUG_TEST_POT 40 | //#define DEBUG_LOG_ENABLE 41 | 42 | //#define DEBUG_DUMP_BASIC 43 | //#define DEBUG_DUMP_POT 44 | //#define DEBUG_DUMP_UNCOMP_POT 45 | //#define DEBUG_DUMP_OTHER 46 | 47 | // define headless 48 | //#define FCG_HEADLESS 49 | 50 | // version and copyright header messages 51 | #define FCG_LIC_STD_HEADER1 "FasterCap License" 52 | #define FCG_HEADER_VERSION "FasterCap version 6.0.7" 53 | #define FCG_HEADER_COPYRIGHT "Copyright 2019 FastFieldSolvers S.R.L." 54 | #define FCG_HEADER_WEBSITE "http://www.fastfieldsolvers.com, All Rights reserved" 55 | // license text file name 56 | #define FCG_LICENSE_TEXT_FILE_NAME "LICENCE.txt" 57 | 58 | // must include global definitions for CMemoryUsage class definition 59 | // and FC return code defines, etc. 60 | #include "Solver/SolverGlobal.h" 61 | 62 | #ifndef FCG_HEADLESS 63 | // must include for App pointer global visibility 64 | #include "FasterCapApp.h" 65 | #endif // !FCG_HEADLESS 66 | 67 | // Needed for CLin_Matrix 68 | #include "LinAlgebra/Mtx.h" 69 | 70 | #define MAX_TITLE_LENGHT 64 71 | 72 | // color IDs for OutputText() in FasterCapMain.cpp 73 | #define FCW_BLACK 1 74 | #define FCW_RED 2 75 | 76 | // temp buffer for LogMsg() and ErrMsg() 77 | #define FCM_LOG_BUF_SIZE 1024 78 | 79 | 80 | #ifndef FCG_HEADLESS 81 | // global, exported variables & functions 82 | 83 | class Globals { 84 | 85 | public: 86 | inline static FasterCapApp *GetApp() { 87 | return m_pApp; 88 | } 89 | inline static void SetApp(FasterCapApp *fca) { 90 | m_pApp = fca; 91 | } 92 | 93 | 94 | protected: 95 | static FasterCapApp *m_pApp; 96 | }; 97 | 98 | // this function is used for system messages (console stdout or 99 | // GUI MessageBox according to 'FasterCapApp' being a pure console 100 | // or a GUI) 101 | void SysMsg(wxString message, wxString caption="Message", long style = wxOK|wxCENTRE); 102 | 103 | #endif //FCG_HEADLESS 104 | 105 | 106 | // interrupt FasterCap worker thread 107 | extern volatile bool g_bFCContinue; 108 | 109 | // later 110 | //extern char g_sTitle[64]; 111 | extern CLin_Matrix g_clsCapMatrixRe, g_clsCapMatrixIm; 112 | extern StlStringList g_stlCondNames; 113 | extern CMemoryUsage g_clsMemUsageCopy, g_clsMemUsage; 114 | extern float g_fSolveTime; 115 | extern long g_lPanelsNum; 116 | extern long g_lLinksNum; 117 | extern bool g_bIsConsole; 118 | 119 | // this function collects all log messages 120 | int LogMsg(const char *fmt,...); 121 | // this function collects all error messages 122 | int ErrMsg(const char *fmt,...); 123 | // this function collects all debug messages (for console only) 124 | int DebugMsg(const char *fmt,...); 125 | 126 | 127 | 128 | #endif //FASTERCAPGLOBAL_H 129 | 130 | -------------------------------------------------------------------------------- /hlp/Run/Run_ch02.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Running FasterCap 11 | 12 | 13 | 14 | 15 | 16 |

Running FasterCap

17 | 18 |

Launching FasterCap from the shell

19 | 20 | FasterCap can be launched in GUI-less mode from a System shell (e.g. a DOS shell under MS Windows, a KSH under Linux, etc.). 21 | 22 |

To enter the GUI-less text mode, you need to pass the additional command option '-b' ('batch' mode) when launching FasterCap from the System shell. 23 |

For example: 24 |
  25 | 26 |
FasterCap -b cube.txt -a0.01 27 |
28 |

  29 |
Please note that the command options can be passed in arbitrary order. Please note also that the default option for the GUI-less mode is not Automatic, as it is instead in the GUI mode; so you need to specify the -a option with the relevant tolerance to trigger the Automatic solution mode. 30 |

For a list of valid running command options, please see the explaination in the Run Menu dialog box paragraph. The command options are indicated together with the relevant settings descriptions. Example: 'Stop when relative error is lower than (-a)' indicates that the relevant parameter to control this setting when launched from a System shell is '-a' 31 |

You can also get a list of the valid command options with a short description when launching FasterCap from a System shell with the '-?' parameter (or with any invalid unsupported parameter). 32 |

For example: 33 |
  34 | 35 |
FasterCap -b -? 36 | 37 |

Usage: fastercap <input file> [-a<relative error>] [-ap] 38 |
                 [-m<mesh>] [-mc<mesh curvature] [-t<tolerance>] 39 |
                 [-d<interaction coeff>] [-f<outofcore>] [-g] 40 |
                 [-pj] [-ps<dimension>] [-o] [-r] [-c] [-i] [-v] 41 |
DEFAULT VALUES: 42 |
  -a: Automatically calculate settings, stop when relative error is lower than 43 | = 0.01 44 |
  -ap: Automatic preconditioner usage 45 |
  -m: Mesh relative refinement value = 0.1 46 |
  -mc: Mesh curvature coefficient = 3 47 |
  -t: GMRES iteration tolerance = 0.01 48 |
  -d: Direct potential interaction coefficient to mesh refinement ratio = 1 49 |
  -f: Out-Of-Core free memory to link memory condition = 5 50 |
  -g: Use Galerkin scheme 51 |
  -pj: Use Jacobi Preconditioner 52 |
  -ps: Use two-levels preconditioner with dimension = 5 53 |
OPTIONS: 54 |
  -o: Output refined geometry in FastCap2 format 55 |
  -r: Dump Gmres residual at each iteration 56 |
  -c: Dump charge densities in output file 57 |
  -i: Dump detailed time and memory information 58 |
  -v: Verbose output 59 |
  -b: Launch as console/shell application without GUI 60 |
  -b?: Print console usage (this text) 61 |
  -bv: Print only the version 62 |
  -h: Open only the help system (Linux only) 63 | 64 |
65 | 66 |

The list of valid return (exit) codes is: 67 | 68 |

69 |
// no error, normal end 70 |
#define FC_NORMAL_END 0 71 |
// catchall for generic error 72 |
#define FC_GENERIC_ERROR 1 73 |
// command line usage error 74 |
#define FC_COMMAND_LINE_ERROR 64 75 |
// cannot open input file(s) 76 |
#define FC_CANNOT_OPEN_FILE 66 77 |
// out of memory 78 |
#define FC_OUT_OF_MEMORY 71 79 |
// generic file error 80 |
#define FC_FILE_ERROR 74 81 |
// license error (e.g. invalid license) 82 |
#define FC_LICENSE_ERROR 77 83 |
// cannot go out-of-core (probably disk full) 84 |
#define FC_CANNOT_GO_OOC 97 85 |
// unknown exception caught 86 |
#define FC_EXCEPTION_ERROR 98 87 |
// user-requested break (not valid for console mode) 88 |
#define FC_USER_BREAK 125 89 |
90 | 91 |

The return codes can be checked under Linux with the following command: 92 |
93 | echo $? 94 | 95 |
and under MS Windows with the command: 96 |
97 | echo %ERRORLEVEL% 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /AutomationHelper.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // AutomationHelper.h : definition of MS Win Automation helper functions 26 | // Enrico Di Lorenzo 2013/03/14 27 | 28 | // These classes are wrappers for Automation variables. 29 | // The main ideas are taken from MS Win SDK 2003, files 30 | // afxdisp.h, afxole.inl, olevar.cpp 31 | // but here the classes are re-implemented from scratch 32 | 33 | #ifndef AUTOMATIONHELPER_DEFS 34 | #define AUTOMATIONHELPER_DEFS 35 | 36 | // definition of wxVariantData needed by the oleutils.h include 37 | #include 38 | // for COM Automation 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | // for wxASSERT 45 | #include 46 | 47 | #define ASSERT wxASSERT 48 | 49 | 50 | /////////////////////////////////// 51 | // AutoBSTR class (BSTR wrapper) 52 | /////////////////////////////////// 53 | 54 | class AutoBSTR 55 | { 56 | public: 57 | AutoBSTR(); 58 | ~AutoBSTR(); 59 | 60 | void Clear(); 61 | 62 | const AutoBSTR& operator=(const BSTR& BSTRsrc); 63 | const AutoBSTR& operator=(const char *textSrc); 64 | operator BSTR(); 65 | operator LPBSTR(); 66 | 67 | private: 68 | BSTR m_clsBSTR; 69 | }; 70 | 71 | inline AutoBSTR::AutoBSTR() { m_clsBSTR = NULL; } 72 | inline AutoBSTR::~AutoBSTR() { if(m_clsBSTR != NULL) {SysFreeString(m_clsBSTR);} } 73 | inline void AutoBSTR::Clear() { if(m_clsBSTR != NULL) {SysFreeString(m_clsBSTR);} } 74 | inline AutoBSTR::operator BSTR() { return m_clsBSTR; } 75 | inline AutoBSTR::operator LPBSTR() { return &m_clsBSTR; } 76 | 77 | 78 | /////////////////////////////////// 79 | // AutoVariant class (VARIANT wrapper) 80 | /////////////////////////////////// 81 | 82 | class AutoVariant : public VARIANT 83 | { 84 | public: 85 | AutoVariant(); 86 | ~AutoVariant(); 87 | 88 | void Clear(); 89 | void Attach(VARIANT& varSrc); 90 | VARIANT Detach(); 91 | 92 | const AutoVariant& operator=(const VARIANT& varSrc); 93 | const AutoVariant& operator=(const AutoVariant& varSrc); 94 | const AutoVariant& operator=(const char* pCharSrc); 95 | const AutoVariant& operator=(double dblSrc); 96 | operator LPVARIANT(); 97 | }; 98 | 99 | inline AutoVariant::AutoVariant() { VariantInit(this); } 100 | inline AutoVariant::~AutoVariant() { VariantClear(this); } 101 | inline void AutoVariant::Clear() { VariantClear(this); } 102 | inline AutoVariant::operator LPVARIANT() { return this; } 103 | 104 | 105 | /////////////////////////////////// 106 | // AutoSafeArray class (SAFEARRAY wrapper) 107 | /////////////////////////////////// 108 | 109 | class AutoSafeArray : public VARIANT 110 | { 111 | public: 112 | AutoSafeArray(); 113 | ~AutoSafeArray(); 114 | 115 | void Clear(); 116 | void Create(VARTYPE vtSrc, DWORD dwDims, DWORD* rgElements); 117 | void Create(VARTYPE vtSrc, DWORD dwDims, SAFEARRAYBOUND* rgsabounds); 118 | void PutElement(long* rgIndices, void* pvData); 119 | DWORD GetElemSize(); 120 | 121 | operator LPVARIANT(); 122 | }; 123 | 124 | // helper function 125 | void SafeArrayInit(AutoSafeArray* psa); 126 | 127 | inline AutoSafeArray::AutoSafeArray() { SafeArrayInit(this); vt = VT_EMPTY; } 128 | inline AutoSafeArray::~AutoSafeArray() { Clear(); } 129 | inline void AutoSafeArray::Clear() { VariantClear(this); } 130 | inline DWORD AutoSafeArray::GetElemSize() { return SafeArrayGetElemsize(parray); } 131 | inline AutoSafeArray::operator LPVARIANT() { return this; } 132 | 133 | 134 | 135 | #endif // AUTOMATIONHELPER_DEFS 136 | -------------------------------------------------------------------------------- /RunDialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #ifndef RUNDIALOG_H 26 | #define RUNDIALOG_H 27 | 28 | #ifndef WX_PRECOMP 29 | //(*HeadersPCH(RunDialog) 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | //*) 38 | #endif 39 | //(*Headers(RunDialog) 40 | //*) 41 | 42 | // for CAutoRefGlobalVars 43 | #include "Solver/SolverGlobal.h" 44 | 45 | class RunDialog: public wxDialog 46 | { 47 | public: 48 | 49 | RunDialog(wxWindow* parent,wxWindowID id=wxID_ANY); 50 | virtual ~RunDialog(); 51 | 52 | CAutoRefGlobalVars GetGlobalVars(); 53 | void SetGlobalVarsFileIn(std::string fileIn); 54 | 55 | //(*Declarations(RunDialog) 56 | wxTextCtrl* TextCtrl_EPS_Ratio; 57 | wxCheckBox* CheckBox_AutoSettings; 58 | wxCheckBox* CheckBox_Dump_Residual; 59 | wxTextCtrl* TextCtrl_Dim_Precond_Two_Levels; 60 | wxTextCtrl* TextCtrl_Autorefine_Out_of_Core; 61 | wxTextCtrl* TextCtrl_Curvature; 62 | wxTextCtrl* TextCtrl_Automatic_Error; 63 | wxStaticText* StaticText2; 64 | wxStaticText* StaticText6; 65 | wxTextCtrl* TextCtrl_MeshEps; 66 | wxCheckBox* CheckBox_GalerkinScheme; 67 | wxStaticText* StaticText8; 68 | wxPanel* Panel1; 69 | wxStaticText* StaticText1; 70 | wxCheckBox* CheckBox_Output_Geometry; 71 | wxStaticText* StaticText3; 72 | wxCheckBox* CheckBox_Output_Charge; 73 | wxCheckBox* CheckBox_Dump_Time_Mem; 74 | wxTextCtrl* TextCtrl_InputFileName; 75 | wxStaticText* StaticText5; 76 | wxTextCtrl* TextCtrl_GmresTol; 77 | wxStaticText* StaticText7; 78 | wxCheckBox* CheckBox_Dump_Geometry; 79 | wxCheckBox* CheckBox_Precond_Jacobi; 80 | wxCheckBox* CheckBox_Verbose_Output; 81 | wxButton* Button_BrowseInputFile; 82 | wxCheckBox* CheckBox_Auto_Precond; 83 | wxCheckBox* CheckBox_Precond_TwoLevels; 84 | wxStaticText* StaticText4; 85 | wxCheckBox* CheckBox_Output_Capacitance; 86 | //*) 87 | 88 | wxString m_strSamplePath; 89 | 90 | protected: 91 | 92 | //(*Identifiers(RunDialog) 93 | static const long ID_STATICTEXT1; 94 | static const long ID_INPUT_FILE_NAME; 95 | static const long ID_BROWSE_INPUT_FILE; 96 | static const long ID_AUTO_SETTINGS; 97 | static const long ID_STATICTEXT2; 98 | static const long ID_AUTOMATIC_ERROR; 99 | static const long ID_AUTO_PRECOND; 100 | static const long ID_STATICTEXT7; 101 | static const long ID_MESH_EPS; 102 | static const long ID_STATICTEXT8; 103 | static const long ID_GMRES_TOL; 104 | static const long ID_STATICTEXT3; 105 | static const long ID_EPS_RATIO; 106 | static const long ID_STATICTEXT4; 107 | static const long ID_CURVATURE; 108 | static const long ID_STATICTEXT5; 109 | static const long ID_AUTOREFINE_OUT_OF_CORE; 110 | static const long ID_GALERKIN_SCHEME; 111 | static const long ID_PRECOND_JACOBI; 112 | static const long ID_PRECOND_TWO_LEVELS; 113 | static const long ID_STATICTEXT6; 114 | static const long ID_DIM_PRECOND_TWO_LEVELS; 115 | static const long ID_OUTPUT_GEOMETRY; 116 | static const long ID_DUMP_GEOMETRY; 117 | static const long ID_OUTPUT_CHARGE; 118 | static const long ID_DUMP_RESIDUAL; 119 | static const long ID_DUMP_TIME_MEM; 120 | static const long ID_VERBOSE_OUTPUT; 121 | static const long ID_OUTPUT_CAPACITANCE; 122 | static const long ID_PANEL1; 123 | //*) 124 | 125 | private: 126 | 127 | //(*Handlers(RunDialog) 128 | void OnButton_BrowseInputFileClick(wxCommandEvent& event); 129 | void OnCheckBox_Dump_GeometryClick(wxCommandEvent& event); 130 | //*) 131 | 132 | // Implementation 133 | protected: 134 | void OnReset(wxCommandEvent& event); 135 | void CopyVarsToDialog(); 136 | void CopyDialogToVars(); 137 | void Reset(); 138 | 139 | CAutoRefGlobalVars m_clsGlobalVars; 140 | 141 | DECLARE_EVENT_TABLE() 142 | }; 143 | 144 | #endif 145 | -------------------------------------------------------------------------------- /registry3264.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | // class derived from wxWidgets wxRegKey to manage 64 bits vs. 32 bits keys 25 | 26 | #include "wx_pch.h" 27 | 28 | // valid only for MS Win 29 | #ifdef __WXMSW__ 30 | 31 | #include "registry3264.h" 32 | 33 | wxRegKey3264::wxRegKey3264(const wxString& strKey, REGSAM mode) 34 | { 35 | key3264access = mode; 36 | ::wxRegKey(strKey); 37 | } 38 | 39 | // parent is a normal regkey 40 | wxRegKey3264::wxRegKey3264(const wxRegKey3264& keyParent, const wxString& strKey, REGSAM mode) 41 | { 42 | key3264access = mode; 43 | ::wxRegKey(keyParent, strKey); 44 | } 45 | 46 | void wxRegKey3264::SetKey32bits() 47 | { 48 | key3264access = KEY_WOW64_32KEY; 49 | } 50 | 51 | // opens key (it's not an error to call Open() on an already opened key) 52 | bool wxRegKey3264::Open(AccessMode mode) 53 | { 54 | REGSAM mode3264; 55 | 56 | if ( IsOpened() ) 57 | { 58 | if ( mode <= m_mode ) 59 | return true; 60 | 61 | // we had been opened in read mode but now must be reopened in write 62 | Close(); 63 | } 64 | 65 | HKEY tmpKey; 66 | 67 | mode3264 = (Read ? KEY_READ : KEY_ALL_ACCESS) | key3264access; 68 | 69 | m_dwLastError = ::RegOpenKeyEx 70 | ( 71 | (HKEY) m_hRootKey, 72 | m_strKey, 73 | RESERVED, 74 | mode3264, 75 | &tmpKey 76 | ); 77 | 78 | if ( m_dwLastError != ERROR_SUCCESS ) 79 | { 80 | wxLogSysError(m_dwLastError, _("Can't open registry key '%s'"), 81 | (const char*)GetName()); 82 | return false; 83 | } 84 | 85 | m_hKey = (WXHKEY) tmpKey; 86 | m_mode = mode; 87 | 88 | return true; 89 | } 90 | 91 | // returns true if the key exists 92 | bool wxRegKey3264::Exists() const 93 | { 94 | // opened key has to exist, try to open it if not done yet 95 | return IsOpened() ? true : KeyExists(m_hRootKey, m_strKey); 96 | } 97 | 98 | // returns true if given subkey exists 99 | bool wxRegKey3264::HasSubKey(const wxChar *szKey) const 100 | { 101 | // this function should be silent, so suppress possible messages from Open() 102 | wxLogNull nolog; 103 | 104 | if ( !CONST_CAST Open(Read) ) 105 | return false; 106 | 107 | return KeyExists(m_hKey, szKey); 108 | } 109 | 110 | // creates key, failing if it exists and !bOkIfExists 111 | bool wxRegKey3264::Create(bool bOkIfExists) 112 | { 113 | // check for existence only if asked (i.e. order is important!) 114 | if ( !bOkIfExists && Exists() ) 115 | return false; 116 | 117 | if ( IsOpened() ) 118 | return true; 119 | 120 | HKEY tmpKey; 121 | 122 | DWORD disposition; 123 | m_dwLastError = RegCreateKeyEx((HKEY) m_hRootKey, m_strKey, 124 | NULL, // reserved 125 | NULL, // class string 126 | 0, 127 | KEY_READ | KEY_WRITE | key3264access, 128 | NULL, 129 | &tmpKey, 130 | &disposition); 131 | 132 | if ( m_dwLastError != ERROR_SUCCESS ) { 133 | wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"), 134 | (const char*)GetName()); 135 | return false; 136 | } 137 | else 138 | { 139 | m_hKey = (WXHKEY) tmpKey; 140 | return true; 141 | } 142 | } 143 | 144 | bool wxRegKey3264::KeyExists(WXHKEY hRootKey, const wxChar *szKey) 145 | { 146 | // don't close this key itself for the case of empty szKey! 147 | if ( wxIsEmpty(szKey) ) 148 | return true; 149 | 150 | HKEY hkeyDummy; 151 | if ( ::RegOpenKeyEx 152 | ( 153 | (HKEY)hRootKey, 154 | szKey, 155 | RESERVED, 156 | KEY_READ | key3264access, // we might not have enough rights for rw access 157 | &hkeyDummy 158 | ) == ERROR_SUCCESS ) 159 | { 160 | ::RegCloseKey(hkeyDummy); 161 | 162 | return true; 163 | } 164 | 165 | return false; 166 | } 167 | 168 | #endif 169 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # minimum version is 3.0 to be able to handle Eigen library 2 | cmake_minimum_required (VERSION 2.8) 3 | project (FasterCap) 4 | 5 | # main project specific settings 6 | # 7 | # option to compile as headless, or with GUI 8 | set(FASTFIELDSOLVERS_HEADLESS OFF CACHE BOOL "Compile as headless (i.e. no GUI)") 9 | 10 | # 11 | # Global Compiler and Linker Settings 12 | # 13 | 14 | # 15 | # using only GCC, therefore configuring build only for GCC 16 | # 17 | # .cmake files are script files; not using here any script 18 | #include(cMake/custom_include.cmake) 19 | #configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) 20 | # 21 | # if headless, pass on the "#define FCG_HEADLESS" 22 | if(${FASTFIELDSOLVERS_HEADLESS} MATCHES ON) 23 | add_definitions("-DFCG_HEADLESS -DwxUSE_GUI=0") 24 | else() 25 | add_definitions("-DwxUSE_GUI=1") 26 | endif() 27 | # 28 | # pass to gcc the argument -DHAVE_CONFIG_H . This defines the pre-processor token HAVE_CONFIG_H 29 | # exactly as if you had #define HAVE_CONFIG_H right at the start of each of your source files. 30 | # HAVE_CONFIG_H is a pre-defined macro in the build-system that generates a config.h 31 | # so that code knows whether it needs to #include config.h 32 | #add_definitions(-DHAVE_CONFIG_H) 33 | # 34 | # List of options to pass to the compiler (note this is a CMake list. Do not enclose in ") 35 | set(FASTFIELDSOLVERS_COMPILE_OPTIONS ${FASTFIELDSOLVERS_COMPILE_OPTIONS} -Wextra -Wall -fopenmp) 36 | # -fopenmp: use OpenMP pragmas 37 | # -lm: link the math library 38 | # -lstdc++: link the standard c++ library (needed for headless) 39 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp -lm -lstdc++") 40 | # -s: strip all symbols from the executable 41 | set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") 42 | 43 | # wxWidgets usage 44 | # See CMake docs "FindwxWidgets" 45 | # In general, for *nix CMake already generates the 'wx-confg' options that are needed 46 | # for compiling and linking with wxWidgets. However, if anything special is needed, 47 | # it must be tweaked into "wxWidgets_CONFIG_OPTIONS". 48 | # In this case, we pass the options `wx-config --version=3.0 --static=no --debug`, 49 | # but '--debug' is only needed in the debug build. Therefore, we use a CMake generator-expression 50 | # to define the flag "--debug" only in case of debug build (this is nested: the first clause 51 | # $ generates 1 or 0 if CONFIG is Debug or not. Then we use the conditional 52 | # expression $, so if the previous evaluates to 1, here the string is "--debug", 53 | # otherwise nothing. 54 | set(wxWidgets_CONFIG_OPTIONS --version=3.0 --static=no $<$:--debug>) 55 | # these flags are BUILD_TYPE dependent 56 | # -D__WXDEBUG__: define that wxWidgets are in debug version 57 | #set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D__WXDEBUG__") 58 | if(${FASTFIELDSOLVERS_HEADLESS} MATCHES ON) 59 | # we only need the 'base' wxWidget package for headless compile 60 | find_package(wxWidgets COMPONENTS base) 61 | else() 62 | # probably not all required. Note however that order is important. 63 | #find_package(wxWidgets COMPONENTS html xrc net core base msw png jpeg tiff zlib kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid comctl32 sock32 odbc32 iphlpapi) 64 | find_package(wxWidgets COMPONENTS core base html) 65 | endif() 66 | # Configuration to use 67 | # (e.g., msw, mswd, mswu, mswunivud, etc.) 68 | # wxWidgets_CONFIGURATION 69 | # general include (needed for wxWidgets in CMake), see CMake docs "FindwxWidgets" 70 | include(${wxWidgets_USE_FILE}) 71 | # add to WXWIDGETS_LIBS the wxWidgets libraries 72 | # we'll subsequently link WXWIDGETS_LIBS with 'target_link_libraries' 73 | set(WXWIDGETS_LIBS ${WXWIDGETS_LIBS} ${wxWidgets_LIBRARIES}) 74 | 75 | # general include_directories, as LinAlgebra and Geometry 76 | # are one level under the base path, and they are included 77 | # in the sources as "#include "LinAlgebra/Mtx.h" etc. 78 | include_directories("..") 79 | # same as above for the main includes in the base path; could use ${CMAKE_SOURCE_DIR} 80 | include_directories(".") 81 | 82 | include_directories ("../LinAlgebra") 83 | add_subdirectory("../LinAlgebra" LinAlgebra) 84 | include_directories ("../Geometry") 85 | add_subdirectory("../Geometry" Geometry) 86 | set (EXTRA_LIBS ${EXTRA_LIBS} LinAlgebra Geometry) 87 | 88 | include_directories ("${PROJECT_SOURCE_DIR}/Solver") 89 | include("./Solver/CMakeLists.txt") 90 | # do not create a library, to speed up compilation in case of file modifications 91 | # (only obj to recompile and final linking, no need to re-create also the library) 92 | #add_subdirectory(Solver) 93 | #set (EXTRA_LIBS ${EXTRA_LIBS} Solver) 94 | 95 | set(FastFieldSolvers_Sources ${FastFieldSolvers_Sources} 96 | FasterCapConsole.cpp 97 | FasterCapConsole.h 98 | FasterCapGlobal.cpp 99 | FasterCapGlobal.h 100 | test.cpp 101 | test.h) 102 | 103 | # if running with a GUI 104 | if(${FASTFIELDSOLVERS_HEADLESS} MATCHES OFF) 105 | set(FastFieldSolvers_Sources ${FastFieldSolvers_Sources} 106 | AboutBox.cpp 107 | AboutBox.h 108 | FasterCapApp.cpp 109 | FasterCapApp.h 110 | FasterCapMain.cpp 111 | FasterCapMain.h 112 | LicenseBox.cpp 113 | LicenseBox.h 114 | RunDialog.cpp 115 | RunDialog.h 116 | resource.rc) 117 | # and if also running on Windows 118 | if(CMAKE_SYSTEM_NAME STREQUAL Windows) 119 | set(FastFieldSolvers_Sources ${FastFieldSolvers_Sources} 120 | AutomationHelper.cpp 121 | AutomationHelper.h) 122 | endif() 123 | endif() 124 | 125 | add_executable (FasterCap ${FastFieldSolvers_Sources} ${FasterCap_Sources}) 126 | # Specify compile options to use when compiling a given target. 127 | target_compile_options(FasterCap PUBLIC ${FASTFIELDSOLVERS_COMPILE_OPTIONS}) 128 | target_link_libraries(FasterCap ${EXTRA_LIBS} ${WXWIDGETS_LIBS} ${EIGEN_LIBS}) 129 | -------------------------------------------------------------------------------- /FasterCapGlobal.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #include "FasterCapGlobal.h" 26 | 27 | #ifndef FCG_HEADLESS 28 | #include 29 | #endif // !FCG_HEADLESS 30 | 31 | // signals FasterCap to abort simulation and start waiting again for commands 32 | volatile bool g_bFCContinue = true; 33 | 34 | #ifdef DEBUG_LOG_ENABLE 35 | 36 | int DebugMsg(const char *fmt,...) 37 | { 38 | int ret = 0; 39 | 40 | wxString msg; 41 | va_list arg_ptr; 42 | wxDateTime currtime; 43 | 44 | va_start(arg_ptr, fmt); 45 | 46 | ret = msg.PrintfV(fmt, arg_ptr); 47 | 48 | va_end(arg_ptr); 49 | 50 | // if PrintfV() returns error 51 | if(ret < 0) { 52 | msg = wxT("Error: DebugMsg() is not able to print the message\n"); 53 | } 54 | 55 | // add timestamp 56 | currtime.SetToCurrent(); 57 | msg = currtime.FormatISODate() + wxT("@") + currtime.FormatISOTime() + wxT(" ") + msg; 58 | 59 | std::cout << msg; 60 | std::cout.flush(); 61 | 62 | return ret; 63 | } 64 | 65 | #else //not DEBUG_LOG_ENABLE 66 | 67 | int DebugMsg(const char *,...) 68 | { 69 | 70 | return 0; 71 | } 72 | 73 | #endif //DEBUG_LOG_ENABLE 74 | 75 | 76 | #ifndef FCG_HEADLESS 77 | 78 | // Static data members must be initialized at file scope, even if private. 79 | FasterCapApp *Globals::m_pApp = NULL; 80 | 81 | // remark: cannot be used before initializing 'g_bIsConsole' 82 | // also, in console mode 'style' is ignored 83 | void SysMsg(wxString message, wxString caption, long style) 84 | { 85 | if(g_bIsConsole == true) { 86 | std::cout << caption << " : " << message << std::endl; 87 | } 88 | else { 89 | wxMessageBox(message, caption, style); 90 | } 91 | } 92 | 93 | // in case of GUI, the LogMsg(), ErrMsg() functions etc. are implemented in FasterCapApp.cpp 94 | 95 | #else // if FCG_HEADLESS 96 | 97 | // ---------------------------------------------------------------------------- 98 | // global functions for printing messages to the console window 99 | // ---------------------------------------------------------------------------- 100 | 101 | int LogMsg(const char *fmt,...) 102 | { 103 | wxString msg; 104 | int ret; 105 | va_list arg_ptr; 106 | char buf[FCM_LOG_BUF_SIZE]; 107 | 108 | // The reason for using vsnprintf() instead of wxString::Format() or 109 | // wxString::PrintfV() is that, since we passed variable args, 110 | // then the proper casting is 'gone' beecause it's too late to do anything about 111 | // the arguments when they're already in va_list form 112 | // so wxString::PrintfV() expects strings in Unicode in a Unicode build, 113 | // or in UTF-8 in a non-unicode build, i.e. build-depending. 114 | // Since our LogMsg / ErrMsg is used with UTF-8 parameters in many cases 115 | // (i.e. passing a buffer of char), this does not work (interprets 116 | // the content of the buffer as Unicode). So we use vsnprintf() 117 | // that is always UTF-8 (viceversa, vswprintf() is always Unicode). 118 | // Note: the wx vararg functions (in this case wxString::Format) 119 | // accept any kind of strings. But this works only because they're not vararg 120 | // functions any longer, in fact, but rather pseudo-variadic templates. 121 | // (as per wxWidgets explanation in a forum thread) 122 | 123 | va_start(arg_ptr, fmt); 124 | ret = vsnprintf(buf, FCM_LOG_BUF_SIZE, fmt, arg_ptr); 125 | va_end(arg_ptr); 126 | 127 | msg = buf; 128 | 129 | // if PrintfV() returns error 130 | if(ret < 0) { 131 | msg = wxT("Error: LogMsg() is not able to print the message\n"); 132 | } 133 | 134 | std::cout << msg; 135 | 136 | return ret; 137 | } 138 | 139 | int ErrMsg(const char *fmt,...) 140 | { 141 | wxString msg; 142 | int ret; 143 | va_list arg_ptr; 144 | char buf[FCM_LOG_BUF_SIZE]; 145 | 146 | va_start(arg_ptr, fmt); 147 | ret = vsnprintf(buf, FCM_LOG_BUF_SIZE, fmt, arg_ptr); 148 | va_end(arg_ptr); 149 | 150 | msg = buf; 151 | 152 | // if PrintfV() returns error 153 | if(ret < 0) { 154 | msg = wxT("Error: ErrMsg() is not able to print the message\n"); 155 | } 156 | 157 | std::cout << msg; 158 | 159 | return ret; 160 | } 161 | 162 | 163 | #endif // !FCG_HEADLESS 164 | 165 | -------------------------------------------------------------------------------- /hlp/InputFile/2D/InputFile_2D_ch02.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | FasterCap Input Files 11 | 12 | 13 | 14 | 15 | 16 |

FasterCap 2D Input Files

17 | 18 |

Input File Structure

19 | 20 |

The input file is a sequential list of materials definitions (conductor 'C' statements and dielectric 'D' statements) and of geometric segment descriptions (straight segment 'S' statements). 21 |
Moreover, comments are allowed ('*' elements) as well as naming definitions ('N' elements) 22 | 23 |

Definitions can be nested in a hierarchical fashion to be able to re-use the geometric descriptions and to ease the construction of the models. 24 |
Segment geometric definitions ('S' elements) in the root file are assumed by default to belong to conductors embedded in a dielectric medium with unit permittivity. 25 | 26 |

All input files begins with a comment line. For compatibility and to ease possible file merging, you are recommended to start the line with a '*' character; anyway this is not mandatory, and the first line of any input file is always interpreted as a comment. 27 |

A 2D input file MUST contain in the first line of the root file the string "2D" or "2d". This string is used by FasterCap to switch to 2D solver mode. By default, FasterCap assumes to be in 3D solver mode, so 2D file definitions without the "2D" string will cause input parser errors. 28 | 29 |

Remark: since FasterCap is able to automatically refine the geometry, it is best working with an input mesh as coarse as possible. 30 | 31 |

An input file example is shown here below. 32 | 33 |

File coax_cable_coated_2d_fine.lst: 34 |
  35 | 36 |
* 2D - Coated coaxial cable, a=1 internal radius, b=1.5 diel interface, c=2 external radius 37 |
* Analytic capacitance capacitance is C1*C2/(C1+C2) where 38 |
* C1 = 2*pi*e0*er1/ln(b/a) = 274.4 pF/m, C2 = 2*pi*e0*er2/ln(c/b) = 193.4 pf/m 39 |
* It follows C = 113.4 pF/m 40 |
* Note that in this input file the discretization is finer (40 sections per circle) 41 |
* so actual capacitance is closer to the theorical one 42 |
  43 |
C circle_0.1_fine.txt 2.0  0.0 0.0 44 |
D circle_0.15_fine.txt 2.0 1.0  0.0 0.0  0.0 0.0 45 |
C circle_0.2_fine.txt 1.0  0.0 0.0 46 |
47 | 48 |

The above input file references hierarchically the files circle_0.1_fine.txt, circle_0.15_fine.txt, and circle_0.2_fine.txt. These files contains a geometric description of a circular conductor with different diameters, as shown here below for the file circle_0.1_fine.txt. 49 | 50 |

File circle_0.1_fine.txt: 51 |
  52 | 53 |
0 circle with diameter 0.1. centered at the origin 54 |
* 55 |
S circle 0.1 0 0.098768907 0.015642989 56 |
S circle 0.098768907 0.015642989 0.095105938 0.030900818 57 |
S circle 0.095105938 0.030900818 0.089101283 0.045397812 58 |
S circle 0.089101283 0.045397812 0.080902789 0.058777026 59 |
S circle 0.080902789 0.058777026 0.070712316 0.07070904 60 |
S circle 0.070712316 0.07070904 0.058780774 0.080900066 61 |
S circle 0.058780774 0.080900066 0.045401939 0.08909918 62 |
S circle 0.045401939 0.08909918 0.030905224 0.095104506 63 |
S circle 0.030905224 0.095104506 0.015647565 0.098768182 64 |
S circle 0.015647565 0.098768182 4.63268E-06 0.1 65 |
S circle 4.63268E-06 0.1 -0.015638413 0.098769631 66 |
S circle -0.015638413 0.098769631 -0.030896412 0.095107369 67 |
S circle -0.030896412 0.095107369 -0.045393684 0.089103386 68 |
S circle -0.045393684 0.089103386 -0.058773278 0.080905511 69 |
S circle -0.058773278 0.080905511 -0.070705764 0.070715592 70 |
S circle -0.070705764 0.070715592 -0.080897342 0.058784522 71 |
S circle -0.080897342 0.058784522 -0.089097077 0.045406067 72 |
S circle -0.089097077 0.045406067 -0.095103074 0.03090963 73 |
S circle -0.095103074 0.03090963 -0.098767457 0.01565214 74 |
S circle -0.098767457 0.01565214 -0.1 9.26536E-06 75 |
S circle -0.1 9.26536E-06 -0.098770355 -0.015633838 76 |
S circle -0.098770355 -0.015633838 -0.095108801 -0.030892006 77 |
S circle -0.095108801 -0.030892006 -0.089105489 -0.045389556 78 |
S circle -0.089105489 -0.045389556 -0.080908234 -0.05876953 79 |
S circle -0.080908234 -0.05876953 -0.070718867 -0.070702488 80 |
S circle -0.070718867 -0.070702488 -0.058788269 -0.080894619 81 |
S circle -0.058788269 -0.080894619 -0.045410195 -0.089094973 82 |
S circle -0.045410195 -0.089094973 -0.030914036 -0.095101642 83 |
S circle -0.030914036 -0.095101642 -0.015656716 -0.098766732 84 |
S circle -0.015656716 -0.098766732 -1.3898E-05 -0.099999999 85 |
S circle -1.3898E-05 -0.099999999 0.015629262 -0.09877108 86 |
S circle 0.015629262 -0.09877108 0.0308876 -0.095110232 87 |
S circle 0.0308876 -0.095110232 0.045385428 -0.089107592 88 |
S circle 0.045385428 -0.089107592 0.058765782 -0.080910957 89 |
S circle 0.058765782 -0.080910957 0.070699212 -0.070722142 90 |
S circle 0.070699212 -0.070722142 0.080891895 -0.058792017 91 |
S circle 0.080891895 -0.058792017 0.089092869 -0.045414322 92 |
S circle 0.089092869 -0.045414322 0.09510021 -0.030918442 93 |
S circle 0.09510021 -0.030918442 0.098766006 -0.015661291 94 |
S circle 0.098766006 -0.015661291 0.099999998 -1.85307E-05 95 |
96 |
97 | 98 |

The following sections explain in detail the meaning of each statement. 99 | 100 |

101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Solver/AutoSegment.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | // AutoSegment.h : 2D segments definitions 26 | // E. Di Lorenzo, 2013/02/02 27 | 28 | #if !defined(AFX_AUTOSEGMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 29 | #define AFX_AUTOSEGMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_ 30 | 31 | #include "SolverGlobal.h" 32 | 33 | #include 34 | #include 35 | 36 | // for base class 37 | #include "AutoElement.h" 38 | 39 | // includes for vector class 40 | #include "Geometry/Vector2D.h" 41 | 42 | // for common defines 43 | #include "AutoPanel.h" 44 | 45 | using namespace std; 46 | 47 | class CAutoConductor; 48 | 49 | // panel structure used by CAutoRefine 50 | class CAutoSegment : public CAutoElement 51 | { 52 | public: 53 | void CalcSegmentGeomPar(); 54 | void MakeSuperSegment(CAutoSegment *leftSubPanel, CAutoSegment *rightSubPanel); 55 | int Subdivide(); 56 | void Scale(double scale); 57 | 58 | // 59 | // virtual functions implementation 60 | 61 | void ErrorPrintCoords(); 62 | unsigned char GetClass() 63 | { 64 | return AUTOELEMENT_SEGMENT; 65 | } 66 | 67 | // 68 | // inlines 69 | 70 | inline C2DVector_float& GetCentroid() { 71 | return m_clsCentroid; 72 | } 73 | inline CAutoSegment *GetLeftChild() { 74 | return (CAutoSegment*)m_pLeft; 75 | } 76 | inline CAutoSegment *GetRightChild() { 77 | return (CAutoSegment*)m_pRight; 78 | } 79 | 80 | // geometric normal (i.e. calculated from the segment vertexes) can be 81 | // different from the normal used for the dielectric calculations in two cases: 82 | // Case 1: 83 | // in case of super-panels. In particular, if a super panel is created 84 | // from two normal-opposite segments, dielectric normal is zero, 85 | // even if the geometric normal is the one of the actual segment 86 | // Case 2: 87 | // for diel normal in opposide direction w.r.t the geometric normal 88 | // (i.e. panel->m_ucType not flagged AUTOPANEL_OUTPERM_NORMAL_DIR) 89 | // 90 | // 'm_clsNormal' stores the gemetric normal for standard segments, 91 | // while for super segments it stores the averaged normal from sub-segments 92 | inline C2DVector GetGeoNormal() 93 | { 94 | C2DVector_float unitvector; 95 | 96 | if(m_ucType & AUTOPANEL_IS_SUPER_NODE) { 97 | // calculate on the fly 98 | CalculateNormal(unitvector); 99 | } 100 | else { 101 | unitvector = m_clsNormal; 102 | } 103 | 104 | return unitvector; 105 | } 106 | 107 | inline C2DVector GetDielNormal() 108 | { 109 | double modnormal; 110 | C2DVector unitvector; 111 | 112 | if(m_ucType & AUTOPANEL_IS_SUPER_NODE) { 113 | // must normalize since super panel normals are not unit vectors 114 | // TBC warning: could normalize all super panel normals 115 | // after the end of hierarchical super panel build pass, to avoid calculating every time 116 | modnormal = Mod(m_clsNormal); 117 | if(modnormal < AUTOPANEL_EPS) { 118 | unitvector = C2DVector(0,0); 119 | } 120 | else { 121 | unitvector = m_clsNormal / modnormal; 122 | } 123 | } 124 | else { 125 | unitvector = m_clsNormal; 126 | } 127 | 128 | if( (m_ucType & AUTOPANEL_OUTPERM_NORMAL_DIR) != AUTOPANEL_OUTPERM_NORMAL_DIR ) { 129 | unitvector.Invert(); 130 | } 131 | 132 | return unitvector; 133 | } 134 | 135 | inline double GetLength() 136 | { 137 | return m_dDimension; 138 | } 139 | 140 | /* 141 | // for saving memory of CAutoPanel class structure 142 | 143 | inline C3DVector GetCentroid() { 144 | 145 | if( (m_ucType & AUTOPANEL_IS_SUPER_NODE) == AUTOPANEL_IS_SUPER_NODE) { 146 | // if super panel, compute centroid from bbox 147 | return (m_clsVertex[0] + m_clsVertex[1]) / 2.0; 148 | } 149 | else { 150 | return (m_clsVertex[0] + m_clsVertex[1] + m_clsVertex[2]) / 3.0; 151 | } 152 | } 153 | */ 154 | 155 | C2DVector_float m_clsVertex[2]; 156 | C2DVector_float m_clsNormal, m_clsCentroid; 157 | 158 | protected: 159 | 160 | double CalculateNormal(C2DVector_float &normal); 161 | 162 | }; 163 | 164 | typedef std::deque StlAutoSegmentDeque; 165 | 166 | 167 | #endif //!defined(AFX_AUTOSEGMENT_H__E89AAF21_5486_11D5_9282_04F014C10000__INCLUDED_) 168 | -------------------------------------------------------------------------------- /hlp/WelcometoFasterCap.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Welcome to FasterCap 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
FasterCap User Guide
23 | 24 |

Welcome to FasterCap !

25 | 26 |

FasterCap is a powerful three-dimensional capactiance extraction program. 27 |

Build upon state-of-the-art technology, FasterCap improves the capabilities of the premium 'golden reference' FastCap software, while preserving the accuracy for which FastCap is renowed. FasterCap is faster, requires less memory, and provides additional capabilities with respect to FastCap. 28 | 29 |

Features include:

30 |
    31 | 32 |
  • 3D and 2D solver capabilities 33 |

    FasterCap is able to handle 3D models as well as native 2D models for faster simulation where only the cross-section of the structure is of interest (e.g. transmission lines) 34 | 35 |

  • Support of lossy dielectric mediums 36 |

    Specifying complex permittivity values, you can simulate the presence of lossy dielectrics 37 | 38 |

  • Linear solution time with respect to the number of panels N. 39 |

    The time needed to compute the self and mutual capacitances between the input set of conductors increases only linearly with the overall number of panels N. This feature is guaranteed by the O(N) complexity of the underlying algoritm, no matter the shape, orientation and size of the input geometries 40 | 41 |

  • Support for arbitraty shaped dielectric interfaces 42 |

    FasterCap supports Dielectric regions composed of any number of constant-permittivity regions of any shape and size 43 | 44 |

  • Support for triangular and quadrilateral input elements 45 |

    FasterCap supports the definition of the input geometry using either triangular or quadrilateral input elements, for maximum flexibility. 46 | 47 |

  • Full Automation support, for solver control by remote programs 48 |

    Full automation support allows to fully control FasterCap from other programs, either in foreground or in background, using a standard interface. Thanks to this capability, FasterCap can be used as an embedded engine in your application, in a fast and smart way. 49 | 50 |

  • Automatic mesh refinement 51 |

    FasterCap can automatically refine the input geometry mesh until result convergence is reached, within a preset error threshold. Therefore, the user is free from the burden to provide more and more refined version of the input geometry to reach the requested accuracy of the results. 52 | 53 |

  • Handling of very large models, with improved speed and reduced memory requirements 54 |

    FasterCap is able handle very large, non-homogeneous geometries, easily breaking the barrier of one million panels in the mesh. This is thanks to the capability to achieve the solution in a shorter time and with smaller memory requirements with respect to FastCap. 55 | 56 |

  • Out-of-core capability 57 |

    Memory requirement, more than solution time, is the bottleneck of modern field simulations, limiting the maximum addressable system dimension. To overcame the RAM memory limits, imposed by the cost / GB, FasterCap is able to go out-of-core, that is, to resort to the much larger storage capacity of the hard disk. Using smart algorithms for streamlining the data structure organization on the hard disk, FasterCap is able to efficiently make use of the mass memory support to run huge simulations in a convenient time tradeoff. 58 | 59 |

  • Speed-independency from non-uniform geometries in space 60 |

    Thanks to the underlying data structures not requiring a uniform 3D partition of the model building box, as in most tree codes, the geometry can be highly non-uniform in space (the 'teapot in stadium' problem), without hampering the speed, the accuracy or the memory required to handle the model. 61 | 62 |

  • Multi-core parallel execution 63 |

    FasterCap leverages multi-core parallel execution capabilities of modern machines to run time-critical funcitons over multiple processor, for maximum speed gain. 64 | 65 |

  • Hierarchical input files support 66 |

    FasterCap extends the flexibility of the FastCap input files, to handle hierarchical input files. This capability allows to overcome the limit of two levels of hierarchy imposed by FastCap. You can therefore define your geometry in a very structured way, with maximum reuse of the different items definition. 67 | 68 |

  • Charge density output for visualization in FastModel 69 |

    The charge densities calculated for the set of conductors at each capacitance matrix column sweep can be output to a file, that can be loaded into FastModel for easy visualization. 70 | 71 |

  • Input file syntax compatible with FastCap 72 |

    FasterCap is 100% compatible with FastCap generic file format, thus preserving your existing import/export interfaces. 73 | 74 |

  • Refined model output in FastCap compatible format 75 |

    FasterCap optionally can dump in FastCap-compatible file a copy of the final refined mesh, thus enabling you to use FasterCap as a tool to refine the input geometry, and to run the same simulation in FastCap. This allows a straightforward benchmarking between the two solvers. 76 | 77 |

78 | 79 | 80 | 81 | 82 |

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

  85 |

Copyright FastFieldSolvers S.R.L. 2014 - All rights reserved
86 | 87 | 88 | -------------------------------------------------------------------------------- /AboutBox.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | #include "wx_pch.h" 25 | #include "AboutBox.h" 26 | 27 | #ifndef WX_PRECOMP 28 | //(*InternalHeadersPCH(AboutBox) 29 | #include 30 | #include 31 | //*) 32 | #endif 33 | //(*InternalHeaders(AboutBox) 34 | //*) 35 | 36 | #include "FasterCapGlobal.h" 37 | 38 | #include "LicenseBox.h" 39 | 40 | // include the big application icon 41 | #include "res/FasterCap_32x32.xpm" 42 | 43 | //(*IdInit(AboutBox) 44 | const long AboutBox::ID_STATICBITMAP1 = wxNewId(); 45 | const long AboutBox::ID_ABOUTBOX_VERSION = wxNewId(); 46 | const long AboutBox::ID_ABOUTBOX_COPYRIGHT = wxNewId(); 47 | const long AboutBox::ID_ABOUTBOX_WEBSITE = wxNewId(); 48 | const long AboutBox::ID_ABOUTBOX_SHOWLICENSE = wxNewId(); 49 | const long AboutBox::ID_PANEL1 = wxNewId(); 50 | //*) 51 | 52 | BEGIN_EVENT_TABLE(AboutBox,wxDialog) 53 | //(*EventTable(AboutBox) 54 | //*) 55 | END_EVENT_TABLE() 56 | 57 | AboutBox::AboutBox(wxWindow* parent,wxWindowID ,const wxPoint& ,const wxSize& ) 58 | { 59 | //(*Initialize(AboutBox) 60 | wxBoxSizer* BoxSizer2; 61 | wxBoxSizer* BoxSizer1; 62 | wxFlexGridSizer* FlexGridSizer1; 63 | wxBoxSizer* BoxSizer3; 64 | wxStdDialogButtonSizer* StdDialogButtonSizer1; 65 | 66 | Create(parent, wxID_ANY, _("About"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY")); 67 | BoxSizer1 = new wxBoxSizer(wxHORIZONTAL); 68 | Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); 69 | FlexGridSizer1 = new wxFlexGridSizer(2, 2, 0, 0); 70 | StaticBitmap1 = new wxStaticBitmap(Panel1, ID_STATICBITMAP1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1")); 71 | FlexGridSizer1->Add(StaticBitmap1, 1, wxALL|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 5); 72 | BoxSizer2 = new wxBoxSizer(wxVERTICAL); 73 | StaticText_Version = new wxStaticText(Panel1, ID_ABOUTBOX_VERSION, _("FasterCap Version X.X.X"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_ABOUTBOX_VERSION")); 74 | BoxSizer2->Add(StaticText_Version, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); 75 | StaticText_Copyright = new wxStaticText(Panel1, ID_ABOUTBOX_COPYRIGHT, _("Copyright (C) 2018 FastFieldSolvers S.R.L."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_ABOUTBOX_COPYRIGHT")); 76 | BoxSizer2->Add(StaticText_Copyright, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); 77 | StaticText_WebSite = new wxStaticText(Panel1, ID_ABOUTBOX_WEBSITE, _("http://www.fastfieldsolvers.com"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_ABOUTBOX_WEBSITE")); 78 | BoxSizer2->Add(StaticText_WebSite, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); 79 | FlexGridSizer1->Add(BoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); 80 | FlexGridSizer1->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 81 | BoxSizer3 = new wxBoxSizer(wxHORIZONTAL); 82 | Button_ShowLicense = new wxButton(Panel1, ID_ABOUTBOX_SHOWLICENSE, _("Show License"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_ABOUTBOX_SHOWLICENSE")); 83 | BoxSizer3->Add(Button_ShowLicense, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); 84 | StdDialogButtonSizer1 = new wxStdDialogButtonSizer(); 85 | StdDialogButtonSizer1->AddButton(new wxButton(Panel1, wxID_OK, wxEmptyString)); 86 | StdDialogButtonSizer1->Realize(); 87 | BoxSizer3->Add(StdDialogButtonSizer1, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); 88 | FlexGridSizer1->Add(BoxSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 89 | Panel1->SetSizer(FlexGridSizer1); 90 | FlexGridSizer1->Fit(Panel1); 91 | FlexGridSizer1->SetSizeHints(Panel1); 92 | BoxSizer1->Add(Panel1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 93 | SetSizer(BoxSizer1); 94 | BoxSizer1->Fit(this); 95 | BoxSizer1->SetSizeHints(this); 96 | 97 | Connect(ID_ABOUTBOX_SHOWLICENSE,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&AboutBox::OnButton_ShowLicenseClick); 98 | //*) 99 | 100 | // update with correct global values 101 | StaticText_Version->SetLabel(wxT(FCG_HEADER_VERSION)); 102 | StaticText_Copyright->SetLabel(wxT(FCG_HEADER_COPYRIGHT)); 103 | StaticText_WebSite->SetLabel(wxT(FCG_HEADER_WEBSITE)); 104 | StaticBitmap1->SetBitmap(wxBitmap(FasterCap_32x32_xpm)); 105 | // 106 | // and rearrange the dimension, since the static texts / images etc. can be smaller or larger 107 | // 108 | FlexGridSizer1->Fit(Panel1); 109 | // can/must call SetSizeHints() because 'Panel1' is derived from wxWindow, 110 | // while the other object in the hierarchy (e.g. BoxSizer) etc. derive from wxObject only 111 | FlexGridSizer1->SetSizeHints(Panel1); 112 | BoxSizer1->Fit(this); 113 | BoxSizer1->SetSizeHints(this); 114 | } 115 | 116 | AboutBox::~AboutBox() 117 | { 118 | //(*Destroy(AboutBox) 119 | //*) 120 | } 121 | 122 | void AboutBox::OnButton_ShowLicenseClick(wxCommandEvent& ) 123 | { 124 | LicenseBox licenseDlg(this); 125 | licenseDlg.ShowModal(); 126 | } 127 | -------------------------------------------------------------------------------- /LicenseBox.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * Copyright (c) 2017 * 4 | * FastFieldSolvers S.R.L. http://www.fastfieldsolvers.com * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Lesser General Public License (LGPL) * 8 | * as published by the Free Software Foundation; either version 2 of * 9 | * the License, or (at your option) any later version. * 10 | * for detail see the LICENCE text file. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU Library General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU Library General Public * 18 | * License along with this program; if not, write to the Free Software * 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 20 | * USA * 21 | * * 22 | ***************************************************************************/ 23 | 24 | 25 | #include "wx_pch.h" 26 | #include "LicenseBox.h" 27 | 28 | #ifndef WX_PRECOMP 29 | //(*InternalHeadersPCH(LicenseBox) 30 | #include 31 | #include 32 | //*) 33 | #endif 34 | 35 | #include 36 | #include 37 | 38 | // for #defines 39 | #include "FasterCapGlobal.h" 40 | 41 | //(*InternalHeaders(LicenseBox) 42 | #include 43 | //*) 44 | 45 | //(*IdInit(LicenseBox) 46 | const long LicenseBox::ID_STATICTEXT_HEADER1 = wxNewId(); 47 | const long LicenseBox::ID_STATICTEXT_HEADER2 = wxNewId(); 48 | const long LicenseBox::ID_STATICTEXT_HEADER3 = wxNewId(); 49 | const long LicenseBox::ID_TEXTCTRL_LICENSE = wxNewId(); 50 | const long LicenseBox::ID_PANEL1 = wxNewId(); 51 | //*) 52 | 53 | BEGIN_EVENT_TABLE(LicenseBox,wxDialog) 54 | //(*EventTable(LicenseBox) 55 | //*) 56 | END_EVENT_TABLE() 57 | 58 | LicenseBox::LicenseBox(wxWindow* parent,wxWindowID ) 59 | { 60 | wxTextFile file; 61 | wxFileName fileName; 62 | unsigned int i; 63 | 64 | //(*Initialize(LicenseBox) 65 | wxBoxSizer* BoxSizer2; 66 | wxBoxSizer* BoxSizer1; 67 | wxFlexGridSizer* FlexGridSizer1; 68 | wxStdDialogButtonSizer* StdDialogButtonSizer1; 69 | 70 | Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY")); 71 | BoxSizer1 = new wxBoxSizer(wxHORIZONTAL); 72 | Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); 73 | FlexGridSizer1 = new wxFlexGridSizer(3, 1, 0, 0); 74 | BoxSizer2 = new wxBoxSizer(wxVERTICAL); 75 | StaticText_Header1 = new wxStaticText(Panel1, ID_STATICTEXT_HEADER1, _("FasterCap Demo License"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT_HEADER1")); 76 | BoxSizer2->Add(StaticText_Header1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 77 | StaticText_Header2 = new wxStaticText(Panel1, ID_STATICTEXT_HEADER2, _("Please contact FastFieldSolvers S.r.l. if you wish to purchase a commercial license"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT_HEADER2")); 78 | BoxSizer2->Add(StaticText_Header2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 79 | StaticText_Header3 = new wxStaticText(Panel1, ID_STATICTEXT_HEADER3, _("http://www.fastfieldsolvers.com"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT_HEADER3")); 80 | BoxSizer2->Add(StaticText_Header3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 81 | FlexGridSizer1->Add(BoxSizer2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 82 | TextCtrl_License = new wxTextCtrl(Panel1, ID_TEXTCTRL_LICENSE, _("License"), wxDefaultPosition, wxSize(400,300), wxTE_AUTO_SCROLL|wxTE_MULTILINE|wxTE_WORDWRAP, wxDefaultValidator, _T("ID_TEXTCTRL_LICENSE")); 83 | FlexGridSizer1->Add(TextCtrl_License, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 84 | StdDialogButtonSizer1 = new wxStdDialogButtonSizer(); 85 | StdDialogButtonSizer1->AddButton(new wxButton(Panel1, wxID_OK, _("I accept"))); 86 | StdDialogButtonSizer1->Realize(); 87 | FlexGridSizer1->Add(StdDialogButtonSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 88 | Panel1->SetSizer(FlexGridSizer1); 89 | FlexGridSizer1->Fit(Panel1); 90 | FlexGridSizer1->SetSizeHints(Panel1); 91 | BoxSizer1->Add(Panel1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); 92 | SetSizer(BoxSizer1); 93 | BoxSizer1->Fit(this); 94 | BoxSizer1->SetSizeHints(this); 95 | //*) 96 | 97 | StaticText_Header1->SetLabel(wxT(FCG_LIC_STD_HEADER1)); 98 | StaticText_Header2->SetLabel(wxT(FCG_HEADER_COPYRIGHT)); 99 | StaticText_Header3->SetLabel(wxT(FCG_HEADER_WEBSITE)); 100 | 101 | // load license text 102 | 103 | TextCtrl_License->Clear(); 104 | 105 | if ( file.Open((Globals::GetApp())->GetLicenseTextPath()) ) { 106 | for (i = 0; i < file.GetLineCount(); i++) { 107 | TextCtrl_License->AppendText(file[i]); 108 | TextCtrl_License->AppendText(wxT("\n")); 109 | } 110 | file.Close(); 111 | } 112 | else { 113 | TextCtrl_License->SetDefaultStyle(wxTextAttr(*wxRED)); 114 | TextCtrl_License->AppendText("ERROR - License text cannot be read\n"); 115 | TextCtrl_License->AppendText("You are NOT authorized to use the software\n"); 116 | } 117 | 118 | // 119 | // and rearrange the dimension, since the static texts / images etc. can be smaller or larger 120 | // 121 | FlexGridSizer1->Fit(Panel1); 122 | // can/must call SetSizeHints() because 'Panel1' is derived from wxWindow, 123 | // while the other object in the hierarchy (e.g. BoxSizer) etc. derive from wxObject only 124 | FlexGridSizer1->SetSizeHints(Panel1); 125 | BoxSizer1->Fit(this); 126 | BoxSizer1->SetSizeHints(this); 127 | 128 | // go to beginning of text, first by unselecting all the text, then moving to first pos 129 | // remark: must use SetFocus() before, or it does not unselect the text (selecting when 130 | // getting focus is standard wxWidgets behavior, must explicitly unselect) 131 | TextCtrl_License->SetFocus(); 132 | TextCtrl_License->ShowPosition(0); 133 | TextCtrl_License->SetSelection(0, 0); 134 | } 135 | 136 | LicenseBox::~LicenseBox() 137 | { 138 | //(*Destroy(LicenseBox) 139 | //*) 140 | } 141 | 142 | --------------------------------------------------------------------------------