Previous Section - SPPARKS Website - SPPARKS Documentation - SPPARKS Commands - Next Section

5. Example problems

The SPPARKS distribution includes an examples sub-directory with several sample problems. Each problem is in a sub-directory of its own. Most are small models that can be run quickly, requiring at most a couple of minutes to run on a desktop machine. Each problem has an input script (in.*) and produces a log file (log.*) and dump file (dump.*) when it runs. A few sample log file outputs on different machines and different numbers of processors are included in the directories to compare your answers to. E.g. a log file like means it ran on P processors of machine "foo".

In some cases, the dump files produced by the example runs can be animated using the various visuzlization tools, such as the toolkit referenced in the Additional Tools section of the SPPARKS documentation. Animations of some of these examples can be viewed on the Movies section of the SPPARKS WWW Site.

These are the sample problems in the examples sub-directories:

groups test of group-based KMC solver
ising standard Ising model
membrane membrane model of pore formation around protein inclusions
potts multi-state Potts model for grain growth

Here is how you might run and visualize one of the sample problems:

cd examples/potts
cp ../../src/spk_linux .           # copy SPPARKS executable to this dir
spk_linux < in.potts               # run the problem 

Running the simulation produces the files dump.potts and log.spparks.

If you add dump image line(s) to the input script a series of JPG images will be produced by the run. These can be viewed individually or turned into a movie or animated by tools like ImageMagick or QuickTime or various Windows-based tools. See the dump image doc page for more details. E.g. this Imagemagick command would create a GIF file suitable for viewing in a browser.

% convert -loop 1 *.jpg foo.gif 

There is also a COUPLE directory with examples of how to use SPPARKS as a library, either by itself or in tandem with another code or library. See the COUPLE/README file to get started.