diff --git a/examples/COUPLE/lammps_spparks/Makefile.mpi b/examples/COUPLE/lammps_spparks/Makefile.mpi index 009d915a62..103551e1e9 100644 --- a/examples/COUPLE/lammps_spparks/Makefile.mpi +++ b/examples/COUPLE/lammps_spparks/Makefile.mpi @@ -2,11 +2,13 @@ SHELL = /bin/sh -# System-specific settings +# Paths to your local LAMMPS and SPPARKS home directories LAMMPS = /home/sjplimp/lammps/git SPPARKS = /home/sjplimp/spparks/git +# System-specific settings + CC = mpicxx CCFLAGS = -g -O -DMPICH_IGNORE_CXX_SEEK -I../library DEPFLAGS = -M diff --git a/examples/COUPLE/lammps_spparks/README b/examples/COUPLE/lammps_spparks/README index 248ee023ee..4a8fbe8acf 100644 --- a/examples/COUPLE/lammps_spparks/README +++ b/examples/COUPLE/lammps_spparks/README @@ -23,17 +23,45 @@ in.spparks SPPARKS input script, without the run command lmppath.h contains path to LAMMPS home directory spkpath.h contains path to SPPARKS home directory -After editing the Makefile.g++, lmppath.h, and spkpath.h files to make -them suitable for your box, type: +----------------------------------- -make -f Makefile.g++ +(1) To build and run this coupled application, you must have SPPARKS +built on your system. It's WWW site is https://spparks.github.io and +it can be downloaded as a tarball or cloned as a local Git repo. -and you should get a lmpspk executable. +To build SPPARKS, do the following: -NOTE: To build and run this coupled application, you must of course, -have SPPARKS built on your system. It's WWW site is -http://www.sandia.gov/~sjplimp/spparks.html. It is an open-source -code. +% cd spparks/src +% make mpi +% make mode=lib mpi # build SPPARKS as a library + +----------------------------------- + +(2) You must also build the coupling library in +lammps/examples/COUPLE/library. + +To build the coupling library, do the following: + +% cd lammps/examples/COUPLE/library +% make -f Makefile.mpi + +----------------------------------- + +(3) Edit the Makefile.mpi, lmppath.h, and spkpath.h files in this +directory to make them suitable for your box. Each of the 3 files +has a comment telling you what to do. + +----------------------------------- + +(4) Build the coupled lmpspk application in this directory. + +% make -f Makefile.mpi + +This should give you a lmpspk executable. + +----------------------------------- + +(5) Run the test simulation You can run lmpspk in serial or parallel as: @@ -65,11 +93,15 @@ The driver code launches both SPPARKS and LAMMPS in parallel and they both decompose their spatial domains in the same manner. The datums in SPPARKS (lattice sites) are the same as the datums in LAMMPS (coarse-grained particles). If this were not the case, more -sophisticated inter-code communication could be performed. +sophisticated inter-code communication could be performed. Note that +the in.lammps and data.lammps files are not inputs; they are generated +by the lmpspk driver. -You can look at the log files in the directory to see sample LAMMPS -and SPPARKS output for this simulation. Dump files produced by the -run are stored as dump.mc and dump.md. The image*.png files show -snapshots from both the LAMMPS and SPPARKS output. Note that the -in.lammps and data.lammps files are not inputs; they are generated by -the lmpspk driver. +You can look at the log files in the directory to see LAMMPS and +SPPARKS output for this simulation run on 1 and 4 processors. Dump +files produced by the run are named dump.mc and dump.md. The image +PPM files show snapshots from the SPPARKS and LAMMPS output. Compare +the image_spparks.0019.ppm and image_lammps.0190.ppm file. They were +written at the same point in the simulation by both codes. The color +maps for the 2 codes are not the same, but the morphology of the +grains is. diff --git a/examples/COUPLE/lammps_spparks/in.lammps b/examples/COUPLE/lammps_spparks/in.lammps index 892ee492eb..103206de68 100644 --- a/examples/COUPLE/lammps_spparks/in.lammps +++ b/examples/COUPLE/lammps_spparks/in.lammps @@ -111,4 +111,6 @@ pair_coeff 100 100 1.0 1.0 compute da all displace/atom dump 1 all atom 10 dump.md +dump 2 all image 10 image_lammps.*.ppm type type zoom 1.6 +dump_modify 2 pad 4 acolor * red/green/blue/aqua/magenta/yellow thermo 1 diff --git a/examples/COUPLE/lammps_spparks/in.spparks b/examples/COUPLE/lammps_spparks/in.spparks index 755354e2b7..ddd200a210 100644 --- a/examples/COUPLE/lammps_spparks/in.spparks +++ b/examples/COUPLE/lammps_spparks/in.spparks @@ -21,3 +21,7 @@ temperature 1.0 stats 10.0 dump 1 text 10.0 dump.mc id site x y + +dump 2 image 1000 image_spparks.*.ppm site site view 0 0 box no 0.1 & + crange 1 100 drange 1 1 shape cube zoom 1.5 size 512 512 +dump_modify 2 pad 4 diff --git a/examples/COUPLE/lammps_spparks/lmppath.h b/examples/COUPLE/lammps_spparks/lmppath.h index dffe4b42ec..0d47e71319 100644 --- a/examples/COUPLE/lammps_spparks/lmppath.h +++ b/examples/COUPLE/lammps_spparks/lmppath.h @@ -1 +1,3 @@ +// path to your LAMMPS home directory + #define LMPPATH /home/sjplimp/lammps/git diff --git a/examples/COUPLE/lammps_spparks/lmpspk.cpp b/examples/COUPLE/lammps_spparks/lmpspk.cpp index 5138a9aa5c..045a4a05a8 100644 --- a/examples/COUPLE/lammps_spparks/lmpspk.cpp +++ b/examples/COUPLE/lammps_spparks/lmpspk.cpp @@ -130,6 +130,8 @@ int main(int narg, char **arg) fprintf(fp,"compute da all displace/atom\n\n"); fprintf(fp,"dump 1 all atom 10 dump.md\n"); + fprintf(fp,"dump 2 all image 10 image_lammps.*.ppm type type zoom 1.6\n"); + fprintf(fp,"dump_modify 2 pad 4 acolor * red/green/blue/aqua/magenta/yellow\n"); fprintf(fp,"thermo 1\n"); fclose(fp); diff --git a/examples/COUPLE/lammps_spparks/spkpath.h b/examples/COUPLE/lammps_spparks/spkpath.h index 3c65c9fe84..1e13273451 100644 --- a/examples/COUPLE/lammps_spparks/spkpath.h +++ b/examples/COUPLE/lammps_spparks/spkpath.h @@ -1 +1,3 @@ +// path to your SPPARKS home directory + #define SPKPATH /home/sjplimp/spparks/git