.gitignore | ||
bathymetry_gebco_2560_1280_mod2_color.ppm.gz | ||
billiard_phase_space.c | ||
colormaps.c | ||
colors_waves.c | ||
digital_elevation_model_large.ppm.gz | ||
drop_billiard.c | ||
Earth_Map_Blue_Marble_2002_large.ppm.gz | ||
global_3d.c | ||
global_ljones.c | ||
global_particles.c | ||
global_pdes.c | ||
global_perc.c | ||
heat.c | ||
hsluv.c | ||
hsluv.h | ||
lennardjones.c | ||
LICENSE | ||
ljones_movie.c | ||
makefile | ||
mangrove.c | ||
Mars_Viking_ClrMosaic_global_925m_scaled.ppm.gz | ||
marscyl2.ppm.gz | ||
Mercury_color_photo.ppm.gz | ||
Mercury_Messenger_DEM_Global_665m_1024_1_cropped.ppm.gz | ||
Moon_LRO_LOLA_global_LDEM_1024.ppm.gz | ||
Moon_photo_map.ppm.gz | ||
Parameters_April21.md | ||
Parameters_April22.md | ||
Parameters_April23.md | ||
Parameters_April24.md | ||
Parameters_August21.md | ||
Parameters_August22.md | ||
Parameters_August23.md | ||
Parameters_August24.md | ||
Parameters_December21.md | ||
Parameters_December22.md | ||
Parameters_December23.md | ||
Parameters_February22.md | ||
Parameters_February23.md | ||
Parameters_February24.md | ||
Parameters_January22.md | ||
Parameters_January23.md | ||
Parameters_January24.md | ||
Parameters_July21.md | ||
Parameters_July22.md | ||
Parameters_July23.md | ||
Parameters_July24.md | ||
Parameters_July.md | ||
Parameters_June21.md | ||
Parameters_June22.md | ||
Parameters_June23.md | ||
Parameters_June24.md | ||
Parameters_March22.md | ||
Parameters_March23.md | ||
Parameters_March24.md | ||
Parameters_May21.md | ||
Parameters_May22.md | ||
Parameters_May23.md | ||
Parameters_May24.md | ||
Parameters_November21.md | ||
Parameters_November22.md | ||
Parameters_November23.md | ||
Parameters_October21.md | ||
Parameters_October22.md | ||
Parameters_October23.md | ||
Parameters_September21.md | ||
Parameters_September22.md | ||
Parameters_September23.md | ||
Parameters_September24.md | ||
Parameters.md | ||
particle_billiard.c | ||
particle_pinball.c | ||
percolation.c | ||
PHOTONSband.ppm.gz | ||
rde.c | ||
README.md | ||
schrodinger.c | ||
sub_hashgrid.c | ||
sub_lj.c | ||
sub_maze.c | ||
sub_part_billiard_phasespace.c | ||
sub_part_billiard.c | ||
sub_part_pinball.c | ||
sub_perco_3d.c | ||
sub_perco.c | ||
sub_rde.c | ||
sub_sphere.c | ||
sub_wave_3d_rde.c | ||
sub_wave_3d.c | ||
sub_wave_comp.c | ||
sub_wave.c | ||
turbo_colormap.c | ||
Venus_Magellan_Topography_Global_4641m_v02_scaled2.ppm.gz | ||
Venus_map_NASA_JPL_Magellan-Venera-Pioneer.ppm.gz | ||
wave_3d.c | ||
wave_billiard.c | ||
wave_common.c | ||
wave_comparison.c | ||
wave_energy.c | ||
wave_sphere.c |
Tool to create videos of particles or waves in different 2D domains.
Created by Nils Berglund and optimized by Marco Mancini
C code for videos on YouTube Channel https://www.youtube.com/c/NilsBerglund
Parameter values used in specific simulations will be gradually added to file Parameters.md
, Parameters_June21.md
and so on.
There are four groups of 8 files, 19 files, 5 files and 4 files. In addition the following files handling color schemes have been included:
hsluv.c
andhsluv.h
from https://github.com/adammaj1/hsluv-color-gradientturbo_colormap.c
from https://gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7acolormaps.c
containing look-up tables from https://github.com/yuki-koyama/tinycolormap
The following file (beta version) provides support for creating mazes:
sub_maze.c
The files
*.ppm.gz
are required by wave_sphere.c
and rde.c
and should be unzipped before compiling.
Simulations of classical particles in billiards.
- particle_billiard.c: simulation of a collection of non-interacting particles in a billiard
- drop_billiard.c: simulation of an expanding front of particles
- particle_pinball.c: variant of
particle_billiard
with some extra statistics plots - billiard_phasespace.c: variant of
particle_billiard
for phase portraits (only works for certain shapes) - global_particles.c: global variables and parameters
- sub_part_billiard.c: drawing/computation routines common to
particle_billiard
anddrop_billiard
- sub_part_pinball.c: additional drawing/computation routines for
particle_pinball
- sub_billiard_phasespace.c: additional drawing/computation routines for
billiard_phasespace
- Create subfolders
tif_part
,tif_drop
- Customize constants at beginning of .c file
- Compile with
make particle_billiard
,make_drop_billiard
, etc, or
gcc -o particle_billiard particle_billiard.c-O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut
gcc -o drop_billiard drop_billiard.c-O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 lglut
- Many laptops claim to have 4 cores, but two of those are virtual. OMP acceleration may be more effective after executing
export OMP_NUM_THREADS=2
in the shell before running the program
- Generate movie with
ffmpeg -i part.%05d.tif -vcodec libx264 part.mp4
Simulations of wave equation and reaction-diffusion equations, including the Schrodinger equation.
- wave_billiard.c: simulation of the (linear) wave equation
- wave_3d.c: 3d rendering of wave equation
- wave_sphere.c: wave equation on a sphere (3d and 2d render)
- wave_comparison.c: comparison of the wave equation in two different domains
- wave_energy.c: a version of
wave_billiard
plotting the energy profile of the wave - mangrove.c: a version of
wave_billiard
with additional features to animate mangroves - heat.c: simulation of the heat equation, with optional drawing of gradient field lines
- rde.c: simulation of reaction-diffusion equations, plots in 2d and 3d (including Schrödinger equation, Euler equation, and shallow water equation)
- schrodinger.c: simulation of the Schrodinger equation in 2d (old version)
- global_pdes.c: global variables and parameters
- global_3d.c: additional global variables for 3d version
- sub_wave.c: drawing/computation routines common to
wave_billiard
,heat
andschrodinger
- sub_wave_comp.c: some modified functions needed by
wave_comparison
- sub_wave_3d.c: additional functions for 3d version
- common_wave.c: common functions of
wave_billiard
andwave_comparison
- colors_waves.c: colormaps used by wave simulations
- sub_rde.c: additional routines for rde.c
- sub_wave_rde_3d.c: additional 3d drawing routines for rde.c
- sub_sphere.c: additional routines for wave_sphere.c
- Create subfolders
tif_wave
,tif_heat
,tif_bz
,tif_schrod
- Customize constants at beginning of .c file
- Compile with
make wave_billiard
, etc, or
gcc -o wave_billiard wave_billiard.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut -O3 -fopenmp
gcc -o wave_comparison wave_comparison.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut -O3 -fopenmp
gcc -o heat heat.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut -O3 -fopenmp
gcc -o schrodinger schrodinger.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut -O3 -fopenmp
- Many laptops claim to have 4 cores, but two of those are virtual. OMP acceleration may be more effective after executing
export OMP_NUM_THREADS=2
in the shell before running the program
- Generate movie with
ffmpeg -i wave.%05d.tif -vcodec libx264 wave.mp4
Molecular dynamics simulations.
- lennardjones.c: simulation of molecular dynamics
- global_ljones.c: global variables and parameters
- sub_lj.c: drawing and initialization routines
- sub_hashgrid.c: hashgrid manipulation routines
- lj_movie.c: render movie with precomputed particle positions (requires files lj_time_series.dat and lj_final_positions.dat generated by lennardjones)
- Create subfolder
tif_ljones
- Customize constants at beginning of .c file
- Compile with
make lennardjones
or
gcc -o lennardjones lennardjones.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut -O3 -fopenmp
- Generate movie with
ffmpeg -i lennardjones.%05d.tif -vcodec libx264 lennardjones.mp4
Percolation simulations.
- percolation.c: simulation of Bernoulli percolation
- global_perc.c: global variables and parameters
- sub_perco.c: drawing and cluster finding routines
- sub_perco_3d.c: 3D drawing routines
- Create subfolder
tif_perc
- Customize constants at beginning of .c file
- Compile with
make percolation
or
gcc -o percolation percolation.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lglut -O3 -fopenmp
- Generate movie with
ffmpeg -i percolation.%05d.tif -vcodec libx264 percolation.mp4
Some references
- Discretizing the wave equation: https://hplgit.github.io/fdm-book/doc/pub/wave/pdf/wave-4print.pdf
- Absorbing boundary conditions: https://hal.archives-ouvertes.fr/hal-01374183
- Cloaking device: https://www.sciencedirect.com/science/article/pii/S0165212514001759
- Poisson disc sampling: https://bl.ocks.org/mbostock/dbb02448b0f93e4c82c3
- Thermostat algorithm: https://doi.org/10.1007/s10955-009-9734-0 or http://www.maths.warwick.ac.uk/~theil/HL12-3-2009.pdf