2D PIC code used at SPC for simulation of trapped electron clouds in Penning like traps.
General electrode geometries are simulated using web-splines method.
Poisson solver is based on finite element methods.
Electron collisions against a uniform room temperature neutral gas are simulated using monte-carlo algorithms.
Recent Commits
Commit | Author | Details | Committed | ||||
---|---|---|---|---|---|---|---|
e94a6b82ca6c | pgiroud | Corrected an error in the subroutine calc_cellindex | Jul 8 | ||||
95cc86f7cf6e | pgiroud | Added the AGPL license | May 27 | ||||
dcbebf0c577c | pgiroud | Corrected a bug for the SEE module | Feb 27 | ||||
f362700e803f | pgiroud | For the compilation with the SEE module | Feb 26 | ||||
36ab7d206c37 | pgiroud | Improved the SEE module | Feb 26 | ||||
ca78c2e2ad94 | pgiroud | Implemented the secondary electron emission (SEE) | Feb 23 | ||||
6395add1c927 | pgiroud | Added the angular dependence of the IIEE yield | Feb 23 | ||||
3d56defa7e9a | pgiroud | Added instructions to the README for compiling the libraries | Feb 23 | ||||
6792f5ad75e9 | pgiroud | Improved the energy distribution of electrons emitted by IIEE | Jan 24 | ||||
6a0f3bee4a1f | pgiroud | Computes the right number of particles per MPI process | Jan 23 | ||||
085a993b7a78 | lebars | Changed the order of Bound and boundary_loss to avoid crashes during iiee runs… | Dec 20 2023 | ||||
ac0bd095567a | lebars | corrected dimension mismatch for rhsoverlap | Dec 20 2023 | ||||
91eb59f1c5b4 | lebars | added chekc on leftproc rightproc to avoid errors on jed | Dec 19 2023 | ||||
30889ce5a4ee | lebars | Merge branch 'master' of ssh://c4science.ch/source/fennecs | Dec 19 2023 | ||||
5880077ba3ec | lebars | Adapted code to remove warning messages during -warn all | Dec 19 2023 |
README.md
FENNECS
Dependencies
This code needs the following libraries to run:
- futils for writing and reading to .h5 files https://c4science.ch/diffusion/FUTILS/
- bsplines for 2D b-splines interpolation, solving and evaluating the Poisson equation https://c4science.ch/source/spclibs/ WARNING: it is necessary to add the option "-DBSPLINES_USE_MUMPS=ON" during the compilation of spclibs with cmake
- SINTEF SISL a C library for NURBS curves interrogation and calculating the distance to a NURBS curve https://github.com/SINTEF-Geometry/SISL
- forSISL a library layer to use SINTEF SISL in Fortran https://github.com/rweed/forSISL WARNING: the compile options of forSISL must be modified to add the openmp compile options to allow threadsafe calls to the forSISL subroutines
- xgrafix optional library to display a graphical interface during a run and show simulation variables https://ptsg.egr.msu.edu/
Each of these libraries must be compiled according to their respective instructions.
Compilation
To compile the program, the dependencies must first be compiled according to their respective instructions. A Makefile is found in the src folder and prior to the compilation the environment variable $PLATFORM must be defined to use the correct *.mk file, which includes options specific to gcc or intel compilers and specifies the paths to the different libraries. An example can be found and adapted in intel.mk and gcc.mk.
To compile in linux:
- modify the intel.mk or gcc.mk to point to the correct libraries path
- $> export PLATFORM=intel
- $> make release
The code can also be compiled using cmake
- $> mkdir build
- $> cd build
- $> cmake .. -DCMAKE_PREFIX_PATH="<path to futils/lib>;<path to bsplines/lib>" -DSISL=<path to SISL> -DforSISL=<path to forSISL>
- $> make
Running the code
An example of a simulation configuration can be found in wk/T-REX. The code can be run on a cluster using slurm, by calling the run.sh in command line. It may be necessary to add the command line: "ulimit -s unlimited" to the bashrc to avoid segmentation faults during execution. The code can be stopped using the stop.sh which will create a file called "mystop" containing the remaining number of time-steps to run. The geometry of the T-REX case can be generated using the .m file in geometries/experiment_upper. This function uses functions defined in the matlab folder. The resulting .h5 file must be moved to wk/T-REX. The magnetic field is generated with the file Draw_B_Ellip_10T_DNP_geom.m in magnet/10T_DNP/ which uses functions defined in magnet/cryogenic. The resulting .h5 file must be moved to wk/T-REX.
Post-processing
A number of post-processing routines using matlab have been written and can be found in the matlab folder. To open a hdf5 result file, use the class fennecshdf5 with "result=fennecshdf5(filename);". The object result can then be interrogated to access variables stored in the hdf5 file.
Folder structure
The root folder contains the following folders:
- cmake: contains cmake configuration files
- geometries: contains matlab routines to generate input geometries for FENNECS
- magnet: contains matlab routines to generate input magnetic fields for FENNECS
- matlab: contains matlab routines to do post-processing of the h5 files generated by FENNECS
- python: contains non-functional preliminary routines in python to also do post-processing
- src: contains the Fortran 90 and C source code of FENNECS
- wk: working directory containing examples of simulation inputs