Skip to content

An repository showing an example of use for the sparpy/aboria libraries

License

Notifications You must be signed in to change notification settings

rneuhausler/example

 
 

Repository files navigation

example

A repository showing an example of use for the sparpy/aboria libraries

Prerequisites:

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

Compiling and running the example:

  1. clone the sparpy repository to your computer
$ git clone https://github.com/martinjrobins/sparpy
  1. make a build directory within the sparpy source tree, and use CMake to configure the project.
$ cd sparpy
$ mkdir build
$ cd build
$ cmake ..
  1. Assuming you don't get any errors here, you can then compile sparpy using make
$ make
  1. 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
  1. 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
  1. 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

  2. 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 .
  1. Put Release in the CMAKE_BUILD_TYPE variable field, then configure and generate the project (i.e. hit c, then g). After this you can re-build the project using make
$ make

About

An repository showing an example of use for the sparpy/aboria libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%