A repository showing an example of use for the sparpy/aboria libraries
You need to have the Boost libraries and the VTK libraries installed on your computer. E.g. on Ubuntu you can use apt-get
$ sudo apt install libboost-dev libvtk6-dev
- clone the
sparpy
repository to your computer
$ git clone https://github.com/martinjrobins/sparpy
- make a build directory within the sparpy source tree, and use CMake to configure the project.
$ cd sparpy
$ mkdir build
$ cd build
$ cmake ..
- Assuming you don't get any errors here, you can then compile sparpy using make
$ make
- Now you need to tell Python where the sparpy library is, so add the build directory to your PYTHONPATH. For example, in bash (Ubuntu) you use
$ export set PYTHONPATH=/path/to/sparpy/build
- Now clone this repository and run the example python script to check that it is working
$ cd ../..
$ git clone https://github.com/martinjrobins/example
$ cd example
$ python example.py
-
You now should have a bunch of
integrate<outputset>.vtu
files in the example directory. You can open these with Paraview (sudo apt install paraview
) and view the simulation output if you wish, or use matplotlib within Python to plot the data -
You might also want to go back to your sparpy build directory and recompile the library in release mode (all optimisations enabled). To do this, try using
ccmake
, which is a simple gui for CMake
$ cd /path/to/sparpy/build
$ ccmake .
- Put
Release
in theCMAKE_BUILD_TYPE
variable field, then configure and generate the project (i.e. hitc
, theng
). After this you can re-build the project using make
$ make