Smothered-particle hydrodynamics simulation of liquids written in Haskell.
To build and run the project using Stack use:
stack run
Or using Cabal:
cabal run SPHSimulation-exe
In case of having problems with OpenGL install freeglut
macOS:
brew install freeglut
Arch Linux:
sudo pacman -Sy --noconfirm freeglut
- Create
NewFileName.hs
in./src
folder
Important: Filename should start with capital letter
- Head of the file should contain module declaration
module NewFileName where
- Import this module to
./app/Main.hs
import NewFileName
- Update
./SPHSimulation.cabal
correspondingly
library
exposed-modules:
Lib
Objects
NewFileName
In some case you may want to profile program.
You first need to reinstall packages with profiling capabilities
cabal install --reinstall --enable-profiling
Then edit cabal configuration (SPHSimulation.cabal
) with such ghc options
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -p" -prof -O2
And finally run with profiling enabled
cabal run SPHSimulation-exe --enable-profiling
You will find *.prof
file at root dir of project