GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Babalion/SandPiles: Sandpiles simulation based on a cellular automaton

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
results
results
 
 
CMakeLists.txt
CMakeLists.txt
 
 
Cell.h
Cell.h
 
 
Configuration.cpp
Configuration.cpp
 
 
Configuration.h
Configuration.h
 
 
LICENSE
LICENSE
 
 
main.cpp
main.cpp
 
 
readme.md
readme.md
 
 
utils.h
utils.h
 
 

Repository files navigation

Sandpiles Simulation

Requirements and Installation

Requirements

Project is based on C++20

  1. CMake https://cmake.org/install/
  2. OpenCV from: https://docs.opencv.org/4.5.2/df/d65/tutorial_table_of_content_introduction.html

How to run?

This is a CMake-Project. Compilation and building is pretty easy. Simply run in main folder via terminal:

cmake --build ./cmake-build-release --target SandPiles -- -j 6

The executable can be found in ./cmake-build-release/bin/SandPiles.

Results

Main idea from https://www.hiskp.uni-bonn.de/uploads/media/sandpiles.pdf.

SandPiles is a simple cellular-automaton where one can observe the collective behavior of falling sand on a field. The boundary conditions are open in these implementations. You can start with a random distribution of piles of sand or define one on your own.

The collapse condition of a sand pile is, when the max difference in height to a von Neumann neighbour exceeds the specified criticalSlope. So different systems can be simulated.

The program shows a GUI generated with OpenCV. Single frames ov a view can be saved.

If one would like to create an animation this can be achieved by commandline via ffmpeg -framerate 10 -pattern_type glob -i './cmake-build-release/bin/results/*.png' -vf "scale=iw/2:ih/2" ./results/out.mp4 which generates a .mp4or.gif from all .png files in the folder.

A small impression as gif with a random initial setting and always add one sand in the middle of the field. There are more simulations, also in better quality (mp4) in ./results.

Example Image

Color-scale

Thanks to https://gka.github.io/palettes/#/7|d|ff006a,ffffff,ffffff|ffffff,ffffff,0088d7|1|1 for the really nice color scale.

Blue is a valley, red is a mountain, white is the mean height. The color scheme is regularly adjusted at runtime.

About

Sandpiles simulation based on a cellular automaton

Topics

cellular-automatonsandpilessimulationstatistical-physics

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.