Parfis is an acronym for Particles and Field Simulator. Parfis is written in C++ with Python bindings. The algorithm is based on the particle-in-cell (PIC) method used for interacting many-particle systems. In the PIC method individual particles (or fluid elements) in a Lagrangian frame are tracked in a continuous phase space, whereas moments of the distribution such as densities and currents are computed simultaneously on Eulerian (stationary) mesh points.
You can quickly install and try parfis by doing the following in your terminal:
pip install parfisAfter installing you can try if the library loads and check the info of the istalled build with the following three commands from your python terminal:
from parfis import Parfis
Parfis.load_lib()
print(Parfis.info())Explore the possibilities by checking some of the examples given in the demo section of the doc web-site.
The build configuration is generated with CMake. After obtaining the source from the GitHub repo, run the CMake commands shown here.
For building the dynamic library you will need cmake and cxx compiler. For running cpp tests you will need to pull and build googletest. On Linux the following commands will install cmake and cxx compiler, and the scripts build the parfis lib for the two versions of the state variable (float and double) and run the python tests:
sudo apt get install cmake
sudo apt get install g++
cd scripts
./buildParfis.sh
./buildParfis.sh float
./installParfisLocally.sh
./runPythonTests.shIf you plan to run googletests on the pure cpp library. You should install google test
first and set the cmake script build you the tests from cpp_test folder. This is written
in the following scripts (for debug mode and state type double).
cd scripts
./buildGoogletest.sh
./buildParfis.sh Debug gtestAll
./runDebugGtestAll.shBuilding on Linux and Windows is the same, presumably you have CMake installed:
cd parfis
mkdir build
cd build
cmake ..
cmake --build . --config ReleaseFor more info on building from source check build section from the doc web-size.
You can use the supplied conda environment .yml file to create an
environment parfis from which you can perform all the compilation, google testing,
pytesting and doc generation.
To create a parfis environment run:
cd script
conda env create -n parfis --file ./parfisCondaEnv.yml
conda activate parfisTo run python tests:
- Install the requred python modules from the requrements file in the script directory.
- Run local installation of parfis.
pip install -r requirements.txt
./installParfisLocally.shSince the requirements.txt has all the needed modules to generate
documentation, the later is generated by calling the following scirpt.
./buildDocOnly.sh