Tools for making Particle in Cell simulations in Mathematica. The package features C code compilation to produce fast simulations.
1D1V plasma simulation with periodic boundaries with no magnetic fields are only implemented at the moment.
Check the example notebook or the example script to see how it works.
Note that a C compiler have to be set in Mathematica for these to work. In case you have installed a C compiler it is sometimes automatically detected by Mathematica, but sometimes it is not. Check out the reference.
You may still use the package without a C compiler. Replace CompilationTarget -> "C"
by CompilationTarget -> "WMV"
to try the demos.
To install the PiCbench package evaluate:
Get["https://raw.githubusercontent.com/dih5/PiCbench/master/BootstrapInstall.m"]
This method uses MathematicaBootstrapInstaller and will also install the ProjectInstaller package if you don't have it already installed.
To load the PiCbench package evaluate: Needs["PiCbench`"]
.
-
Download latest released PiCbench.zip file.
-
Extract downloaded
PiCbench.zip
to any directory which is on the Mathematica$Path
, e.g. to install for the current userFileNameJoin[{$UserBaseDirectory,"Applications"}]
, for all usersFileNameJoin[{$BaseDirectory,"Applications"}]
. -
To load the package evaluate:
Needs["PiCbench`"]
.
To use package directly from the Web, without installation, evaluate:
Get["https://raw.githubusercontent.com/dih5/PiCbench/master/PiCbench/" <> # <> ".m"] & /@ {"Parameters", "Initialization", "Plot", "Compile", "Particle2Grid", "Maxwell", "Mover", "PiCbench"}
Note that with this method of initialization package documentation will not be available in Mathematica Documentation Center.
This application comes with documentation integrated with the Mathematica Documentation Center.
After installation search for "PiCbench" in documentation center
or press F1
key with cursor on name of any of symbols introduced by this application.
The package has been tested with Mathematica 9.0 and 10.X on Windows and Linux. It will probably work in Mathematica 6.0+, but it has not been tested. If you do so, please let me know.
This package is released under the GNU GPLv3 license.
Releases of this package will be numbered using Semantic Versioning guidelines.
The PiC notebook from the Berkley Plasma Simulation Group found here served as a motivation to try PiC simulations in Mathematica and also served as a model for the first implementation of some of the algorithms.