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 | 8 сар өмнө | |
README.md | 8 сар өмнө | |
X-Institute_logo_small.tif | 8 сар өмнө | |
diffusion.c | 8 сар өмнө | |
diffusion_v0.c | 8 сар өмнө | |
diffusion_w_gtk.c | 8 сар өмнө | |
diffusion_w_gtk_ctrl.c | 8 сар өмнө | |
makefile | 8 сар өмнө |
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