|
| |
Field exampleDescription: This example generates a magnetic field PA from a set of field vectors. Category: SL Libraries Note that PA files store for each point in space a scalar magnetic potential, not a magnetic field vector ((see p. 2-12 of the SIMION 7.0 manual). The latter is mathematically the negative of the gradient of the former, and the former can be recreated by computing the line integral over the latter. The SL Libraries take care of the integration for you. This example is implemented in three programming languages:
CPP versionUse: To use, compile the field.cpp program into field.exe and run the program. Build files are provided for Microsoft Visual C++ 6.0 and GNU g++ C++ compilers. If you use another compatible c++ compiler, you just have to make sure that you add the SL Libraries for C++ (lib\cpp) to your include seach path and make sure pa.cpp gets compiled into the binary). Browse the source code: Perl versionUse: To use, just run the field.bat program. This will execute the Perl interpreter and point it to the location of the SL Libraries for Perl (lib\perl). Browse the source code: Python versionUse: To use, set the "PATH" variable in field.bat to point to the directory in which python.exe is installed on your system. Then run field.bat. Browse the source code: |
|