Skip to content

mkDoku/molecularDynamics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Molecular Dynamics in Haskell

This is a Haskell implementation of the Verlet-Velocity algorithm in a molecular dynamics framework for my blog post.

Pre-requisite Installations

Use Ghcup to install GHC, cabal-install, Stack and haskell-language-server from here

Additional Installation for Windows:

  • Download the freeglut windows development libraries from here
  • Add freeglut/bin/x64/ to your executable path.

To Install Molecular Dynamics

cd <path-to-MolecularDynamics-folder>
stack install

Nix

nix-build release.nix

Run examples

Change the main function in src/Main.hs according to the following section names and run the example via:

stack run

mainNewton

main :: IO ()
main = mainNewton

A particle moving to the right

mainNewtonBounce

main :: IO ()
main = mainNewtonBounce

A particle moving to the right and bouncing of a wall

mainVerlet

main :: IO ()
main = mainVerlet

Two particles attracting and repulsing each other

mainVerletSquare

main :: IO ()
main = mainVerletSquare

Molecular Dynamics simulation of 64 particles

mainVerletRandom

main :: IO ()
main = mainVerletRandom

Molecular Dynamics simulation of 24 randomly generated particles

Documentation

Have a look at the docs for the API documentation.

Generate the docs

Generate the Haddock documentation with:

stack exec -- haddock --html src/Main.hs --hyperlinked-source --odir=docs

About

Molecular Dynamics in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published