Go to file
2024-06-01 16:56:48 +02:00
.gitignore Adds .gitignore 2021-11-29 12:02:54 +01:00
bathymetry_gebco_2560_1280_mod2_color.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
billiard_phase_space.c Add files via upload 2023-10-29 15:45:58 +01:00
colormaps.c Add files via upload 2022-03-13 15:29:50 +01:00
colors_waves.c Add files via upload 2022-03-13 15:29:50 +01:00
digital_elevation_model_large.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
drop_billiard.c Add files via upload 2023-03-25 19:56:19 +01:00
Earth_Map_Blue_Marble_2002_large.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
global_3d.c Add files via upload 2024-06-01 16:54:53 +02:00
global_ljones.c Add files via upload 2024-06-01 16:54:53 +02:00
global_particles.c Add files via upload 2023-07-08 23:28:23 +02:00
global_pdes.c Add files via upload 2024-06-01 16:54:53 +02:00
global_perc.c Add files via upload 2022-10-18 23:28:20 +02:00
heat.c Add files via upload 2024-06-01 16:54:53 +02:00
hsluv.c Add files via upload 2021-10-03 14:24:56 +02:00
hsluv.h Add files via upload 2021-10-03 14:24:56 +02:00
lennardjones.c Add files via upload 2024-06-01 16:54:53 +02:00
LICENSE Initial commit 2021-05-02 09:00:33 +02:00
ljones_movie.c Add files via upload 2023-01-22 16:49:04 +01:00
makefile Add files via upload 2023-10-29 15:45:58 +01:00
mangrove.c Add files via upload 2024-06-01 16:54:53 +02:00
Mars_Viking_ClrMosaic_global_925m_scaled.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
marscyl2.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Mercury_color_photo.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Mercury_Messenger_DEM_Global_665m_1024_1_cropped.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Moon_LRO_LOLA_global_LDEM_1024.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Moon_photo_map.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Parameters_April21.md Add files via upload 2021-08-03 16:16:14 +02:00
Parameters_April22.md Add files via upload 2022-05-14 21:04:33 +02:00
Parameters_April23.md Add files via upload 2023-04-30 17:01:39 +02:00
Parameters_April24.md Add files via upload 2024-06-01 16:56:48 +02:00
Parameters_August21.md Add files via upload 2021-09-01 17:11:59 +02:00
Parameters_August22.md Add files via upload 2023-08-02 17:11:22 +02:00
Parameters_August23.md Add files via upload 2023-09-02 11:37:37 +02:00
Parameters_December21.md Add files via upload 2022-02-05 18:45:19 +01:00
Parameters_December22.md Add files via upload 2023-01-22 16:50:00 +01:00
Parameters_December23.md Add files via upload 2024-03-09 18:20:06 +01:00
Parameters_February22.md Add files via upload 2022-03-13 15:36:12 +01:00
Parameters_February23.md Add files via upload 2023-03-25 19:57:19 +01:00
Parameters_February24.md Add files via upload 2024-03-09 18:20:06 +01:00
Parameters_January22.md Add files via upload 2022-02-05 18:45:19 +01:00
Parameters_January23.md Add files via upload 2023-03-25 19:57:19 +01:00
Parameters_January24.md Add files via upload 2024-03-09 18:20:06 +01:00
Parameters_July21.md Add files via upload 2021-07-31 12:54:28 +02:00
Parameters_July22.md Add files via upload 2022-08-01 22:34:51 +02:00
Parameters_July23.md Add files via upload 2023-09-02 11:37:37 +02:00
Parameters_July.md Add files via upload 2023-09-02 11:37:37 +02:00
Parameters_June21.md Add files via upload 2021-08-01 14:53:47 +02:00
Parameters_June22.md Add files via upload 2023-08-02 17:13:58 +02:00
Parameters_June23.md Add files via upload 2023-07-08 23:35:09 +02:00
Parameters_March22.md Add files via upload 2022-04-12 19:25:14 +02:00
Parameters_March23.md Add files via upload 2023-08-02 17:15:48 +02:00
Parameters_March24.md Add files via upload 2024-06-01 16:56:48 +02:00
Parameters_May21.md Add files via upload 2021-08-01 15:26:37 +02:00
Parameters_May22.md Add files via upload 2022-06-25 15:51:53 +02:00
Parameters_May23.md Add files via upload 2023-07-08 23:35:09 +02:00
Parameters_May24.md Add files via upload 2024-06-01 16:56:48 +02:00
Parameters_November21.md Add files via upload 2021-12-28 15:45:19 +01:00
Parameters_November22.md Add files via upload 2023-01-22 16:50:00 +01:00
Parameters_November23.md Add files via upload 2023-12-26 23:03:18 +01:00
Parameters_October21.md Add files via upload 2022-03-13 18:29:22 +01:00
Parameters_October22.md Add files via upload 2022-11-20 23:18:30 +01:00
Parameters_October23.md Add files via upload 2023-12-26 23:03:18 +01:00
Parameters_September21.md Add files via upload 2021-10-02 08:10:50 +02:00
Parameters_September22.md Add files via upload 2022-10-18 23:36:12 +02:00
Parameters_September23.md Add files via upload 2023-10-29 15:47:26 +01:00
Parameters.md Add files via upload 2024-03-09 18:21:54 +01:00
particle_billiard.c Add files via upload 2023-07-08 23:28:23 +02:00
particle_pinball.c Add files via upload 2023-03-25 19:56:19 +01:00
percolation.c Add files via upload 2022-10-18 23:28:20 +02:00
rde.c Add files via upload 2024-06-01 16:54:53 +02:00
README.md Update README.md 2023-10-29 15:53:09 +01:00
schrodinger.c Add files via upload 2024-06-01 16:54:53 +02:00
sub_hashgrid.c Add files via upload 2023-12-26 23:01:20 +01:00
sub_lj.c Add files via upload 2024-06-01 16:54:53 +02:00
sub_maze.c Add files via upload 2023-03-25 19:56:19 +01:00
sub_part_billiard_phasespace.c Add files via upload 2023-10-29 15:45:58 +01:00
sub_part_billiard.c Add files via upload 2023-10-29 15:45:58 +01:00
sub_part_pinball.c Add files via upload 2021-11-12 16:22:24 +01:00
sub_perco_3d.c Add files via upload 2022-11-20 23:17:39 +01:00
sub_perco.c Add files via upload 2023-10-29 15:45:58 +01:00
sub_rde.c Add files via upload 2024-06-01 16:54:53 +02:00
sub_sphere.c Add files via upload 2024-03-09 18:17:55 +01:00
sub_wave_3d_rde.c Add files via upload 2024-06-01 16:54:53 +02:00
sub_wave_3d.c Add files via upload 2024-06-01 16:54:53 +02:00
sub_wave_comp.c Add files via upload 2023-12-26 23:01:20 +01:00
sub_wave.c Add files via upload 2024-06-01 16:54:53 +02:00
turbo_colormap.c Add files via upload 2021-10-24 15:20:56 +02:00
Venus_Magellan_Topography_Global_4641m_v02_scaled2.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
Venus_map_NASA_JPL_Magellan-Venera-Pioneer.ppm.gz Add files via upload 2023-12-26 23:01:20 +01:00
wave_3d.c Add files via upload 2024-06-01 16:54:53 +02:00
wave_billiard.c Add files via upload 2024-06-01 16:54:53 +02:00
wave_common.c Add files via upload 2024-06-01 16:54:53 +02:00
wave_comparison.c Add files via upload 2024-06-01 16:54:53 +02:00
wave_energy.c Add files via upload 2024-06-01 16:54:53 +02:00
wave_sphere.c Add files via upload 2024-06-01 16:54:53 +02:00

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:

  1. hsluv.cand hsluv.h from https://github.com/adammaj1/hsluv-color-gradient
  2. turbo_colormap.c from https://gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7a
  3. colormaps.c containing look-up tables from https://github.com/yuki-koyama/tinycolormap

The following file (beta version) provides support for creating mazes:

  1. sub_maze.c

The files

  1. *.ppm.gz

are required by wave_sphere.c and should be unzipped before compiling.

Simulations of classical particles in billiards.

  1. particle_billiard.c: simulation of a collection of non-interacting particles in a billiard
  2. drop_billiard.c: simulation of an expanding front of particles
  3. particle_pinball.c: variant of particle_billiard with some extra statistics plots
  4. billiard_phasespace.c: variant of particle_billiard for phase portraits (only works for certain shapes)
  5. global_particles.c: global variables and parameters
  6. sub_part_billiard.c: drawing/computation routines common to particle_billiard and drop_billiard
  7. sub_part_pinball.c: additional drawing/computation routines for particle_pinball
  8. 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.

  1. wave_billiard.c: simulation of the (linear) wave equation
  2. wave_3d.c: 3d rendering of wave equation
  3. wave_sphere.c: wave equation on a sphere (3d and 2d render)
  4. wave_comparison.c: comparison of the wave equation in two different domains
  5. wave_energy.c: a version of wave_billiard plotting the energy profile of the wave
  6. mangrove.c: a version of wave_billiard with additional features to animate mangroves
  7. heat.c: simulation of the heat equation, with optional drawing of gradient field lines
  8. rde.c: simulation of reaction-diffusion equations, plots in 2d and 3d (including Schrödinger equation, Euler equation, and shallow water equation)
  9. schrodinger.c: simulation of the Schrodinger equation in 2d (old version)
  10. global_pdes.c: global variables and parameters
  11. global_3d.c: additional global variables for 3d version
  12. sub_wave.c: drawing/computation routines common to wave_billiard, heat and schrodinger
  13. sub_wave_comp.c: some modified functions needed by wave_comparison
  14. sub_wave_3d.c: additional functions for 3d version
  15. common_wave.c: common functions of wave_billiard and wave_comparison
  16. colors_waves.c: colormaps used by wave simulations
  17. sub_rde.c: additional routines for rde.c
  18. sub_wave_rde_3d.c: additional 3d drawing routines for rde.c
  19. 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.

  1. lennardjones.c: simulation of molecular dynamics
  2. global_ljones.c: global variables and parameters
  3. sub_lj.c: drawing and initialization routines
  4. sub_hashgrid.c: hashgrid manipulation routines
  5. 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.

  1. percolation.c: simulation of Bernoulli percolation
  2. global_perc.c: global variables and parameters
  3. sub_perco.c: drawing and cluster finding routines
  4. 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