1
0

I am forking YueChuan's repo. Then I can pull-request from him.

Juan Keymer 52893c5af8 Reverted notation to comply with Glib standard. 8 сар өмнө
.gitignore b8d29603d2 Simplified arguments of functions in the code as data is global --- no need to pass on value 8 сар өмнө
README.md 686ca890a7 Edited README 8 сар өмнө
X-Institute_logo_small.tif 5c4cc649b9 added an image used by the About dialog 8 сар өмнө
diffusion.c c3abf08a7c Added a call to printGrid after initializing the lattice 8 сар өмнө
diffusion_v0.c c3abf08a7c Added a call to printGrid after initializing the lattice 8 сар өмнө
diffusion_w_gtk.c a37b65a092 Added button controls and some minimal code to them. 8 сар өмнө
diffusion_w_gtk_ctrl.c 52893c5af8 Reverted notation to comply with Glib standard. 8 сар өмнө
makefile 4d5383d9fb copied the code w_gtk to w_gtk_crl to use it as template to make the final version with simulation controls 8 сар өмнө

README.md

Diffusion

We started by forking 跃川's original repository.

The code implements a FTCS (foward Time, Central difference Space) explicit method to numerically solve the diffusion equation for a given boundary and initial conditions.

To compile type:

make

After re-organizing the code, we use the code base to add a GTK pixmap to the simulated space-time-concentration. We will use a color gradrient to represent concentration and then build up a GDK pixbuffer to paint.

There are 4 executable files (to be made by typing "make"):

1.- original code:  "diffusion"

2.- original code re-packed and organized:  "diffusion_v0"

3.- code with Gtk but static stimulation with no Gtk controls:  "diffusion_w_gtk"

4.- Similation App with full controls (Initialize, Run & Stop): "difussion_w_gtk_ctrl"

The changes are:

**From 1 to 2:

Re-organizing code and modify Print function to print only few values so to increase Lattice size and simulation time.

-- move the data structure to store the Lattice (spatial) values to a structure and make it global -- made the lattice bigger (256 sites) and simulate for longer (256 iterations) -- truncated the PrintGrid function to fit the new lattice size in one screen width -- made an init_lattice function and move relevant code there -- made an update_lattice function and move relevant code there -- mande an integrate_simulation function and move relevant code there -- make main dependent on the argument vector.

**From 2 to 3:

-- added Gtk functionality. Add Activate function and create a Window there as well as integrate simulation -- Made Main call the Gtk loop by spanning an Gtk Application and return a running process

**From 3 to 4: -- add more widgets and time handlers to make a "simulator" app scrolling a time buffer of the simulation state