You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nilsberglund-orleans fc192fb978
Update rde.c
3 weeks ago
.gitignore Adds .gitignore 7 months ago
LICENSE Initial commit 1 year ago
Parameters.md Add files via upload 4 weeks ago
Parameters_April21.md Add files via upload 11 months ago
Parameters_April22.md Add files via upload 1 month ago
Parameters_August21.md Add files via upload 10 months ago
Parameters_December21.md Add files via upload 5 months ago
Parameters_February22.md Add files via upload 3 months ago
Parameters_January22.md Add files via upload 5 months ago
Parameters_July21.md Add files via upload 11 months ago
Parameters_June21.md Add files via upload 11 months ago
Parameters_March22.md Add files via upload 2 months ago
Parameters_May21.md Add files via upload 11 months ago
Parameters_November21.md Add files via upload 6 months ago
Parameters_October21.md Add files via upload 3 months ago
Parameters_September21.md Add files via upload 9 months ago
README.md Update README.md 1 month ago
colormaps.c Add files via upload 3 months ago
colors_waves.c Add files via upload 3 months ago
drop_billiard.c Add files via upload 6 months ago
global_3d.c Add files via upload 1 month ago
global_ljones.c Add files via upload 4 weeks ago
global_particles.c Add files via upload 5 months ago
global_pdes.c Add files via upload 1 month ago
heat.c Add files via upload 5 months ago
hsluv.c Add files via upload 9 months ago
hsluv.h Add files via upload 9 months ago
lennardjones.c Add files via upload 4 weeks ago
mangrove.c Add files via upload 2 months ago
particle_billiard.c Add files via upload 5 months ago
particle_pinball.c Add files via upload 7 months ago
rde.c Update rde.c 3 weeks ago
schrodinger.c Add files via upload 5 months ago
sub_hashgrid.c Add files via upload 4 weeks ago
sub_lj.c Add files via upload 1 month ago
sub_part_billiard.c Add files via upload 2 months ago
sub_part_pinball.c Add files via upload 7 months ago
sub_rde.c Add files via upload 1 month ago
sub_wave.c Add files via upload 1 month ago
sub_wave_3d.c Add files via upload 1 month ago
sub_wave_3d_rde.c Add files via upload 1 month ago
sub_wave_comp.c Add files via upload 3 months ago
turbo_colormap.c Add files via upload 8 months ago
wave_3d.c Add files via upload 1 month ago
wave_billiard.c Add files via upload 2 months ago
wave_common.c Add files via upload 1 month ago
wave_comparison.c Add files via upload 2 months ago
wave_energy.c Add files via upload 2 months ago

README.md

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 three groups of 6 files, 17 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

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. global_particles.c: global variables and parameters
  5. sub_part_billiard.c: drawing/computation routines common to particle_billiard and drop_billiard
  6. sub_part_pinball.c: additional drawing/computation routines for particle_pinball
  • Create subfolders tif_part, tif_drop
  • Customize constants at beginning of .c file
  • Compile with

gcc -o particle_billiard particle_billiard.c-O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut

gcc -o drop_billiard drop_billiard.c-O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -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_comparison.c: comparison of the wave equation in two different domains
  4. wave_energy.c: a version of wave_billiard plotting the energy profile of the wave
  5. mangrove.c: a version of wave_billiard with additional features to animate mangroves
  6. heat.c: simulation of the heat equation, with optional drawing of gradient field lines
  7. rde.c: simulation of reaction-diffusion equations, plots in 2D and 3D (including Schrödinger equation)
  8. schrodinger.c: simulation of the Schrodinger equation in 2D (old version)
  9. global_pdes.c: global variables and parameters
  10. global_3d.c: additional global variables for 3d version
  11. sub_wave.c: drawing/computation routines common to wave_billiard, heat and schrodinger
  12. sub_wave_comp.c: some modified functions needed by wave_comparison
  13. sub_wave_3d.c: additional functions for 3d version
  14. common_wave.c: common functions of wave_billiard and wave_comparison
  15. colors_waves.c: colormaps used by wave simulations
  16. sub_rde.c: additional routines for rde.c
  17. sub_wave_rde_3d.c: additional 3d drawing routines for rde.c
  • Create subfolders tif_wave, tif_heat, tif_bz, tif_schrod
  • Customize constants at beginning of .c file
  • Compile with

gcc -o wave_billiard wave_billiard.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut -O3 -fopenmp

gcc -o wave_comparison wave_comparison.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -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 -lXmu -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
  • Create subfolder tif_ljones
  • Customize constants at beginning of .c file
  • Compile with

gcc -o lennardjones lennardjones.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut -O3 -fopenmp

  • Generate movie with

ffmpeg -i lennardjones.%05d.tif -vcodec libx264 lennardjones.mp4

Some references