Skip to content

Physical based liquid simulation tool written in haskell

License

Notifications You must be signed in to change notification settings

Demezy/SPHSimulation

Repository files navigation

SPH Simulation

📚 Project Description

Smothered-particle hydrodynamics simulation of liquids written in Haskell.

🎬 Demo

Teaser

🚀 Quick start

To build and run the project using Stack use:

stack run

Or using Cabal:

cabal run SPHSimulation-exe

Known issues

In case of having problems with OpenGL install freeglut

macOS:

brew install freeglut

Arch Linux:

sudo pacman -Sy --noconfirm freeglut

⚙️ Development

Adding new file

  1. Create NewFileName.hs in ./src folder

Important: Filename should start with capital letter

  1. Head of the file should contain module declaration
 module NewFileName where
  1. Import this module to ./app/Main.hs
 import NewFileName
  1. Update ./SPHSimulation.cabal correspondingly
 library
  exposed-modules:
      Lib
      Objects
      NewFileName

Profiling

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

About

Physical based liquid simulation tool written in haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published