# Simulation file of basic diffusion and reaction
# This file is used to test and demonstrate observation commands

graphics opengl
graphic_iter 1
graphic_delay 10
accuracy 5

dim 3
boundaries x 0 100 r
boundaries y 0 100 r
boundaries z 0 100 r

species red blue
molperbox 4

time_start 0
time_stop 200
time_step 0.1

output_files stdout
#output_format csv
output_precision 6

cmd e warnescapee all stdout
cmd e ifmore red 95 echo stdout ">95 red molecules\n"
cmd @ 10 echo stdout "...simulation paused, press spacebar...\n"
cmd @ 10 pause
cmd @ 12 echo stdout "...molmoments...\n"
cmd i 12 18 0.1 molmoments blue stdout
cmd @ 20 echo stdout "...beeping...\n"
cmd @ 20 beep
cmd @ 20 beep
cmd @ 20 echo stdout "...keypress =...\n"
cmd i 20 30 0.1 keypress r
cmd @ 30 echo stdout "...molcountheader =...\n"
cmd @ 30 molcountheader stdout
cmd @ 30 echo stdout "...molcount =...\n"
cmd i 30 40 1 molcount stdout
cmd @ 45 echo stdout "...molcountinbox =...\n"
cmd i 45 55 1 molcountinbox 0 50 50 100 -20 30
cmd @ 60 echo stdout "...listmols =...\n"
cmd @ 60 listmols stdout
cmd @ 61 echo stdout "...listmols2 =...\n"
cmd @ 61 listmols2 stdout
cmd @ 62 echo stdout "...listmols3 =...\n"
cmd @ 62 listmols3 red stdout
cmd @ 65 echo stdout "meansqrdisp...\n"
cmd i 65 75 1 meansqrdisp blue all stdout
cmd @ 75 echo stdout "current simulation and execution time: "
cmd @ 75 executiontime stdout
cmd n 100 ifless red 2 ifmore red 0 echo stdout "last red molecule\n"
cmd e ifno red stop
cmd a ifno red echo stdout "no red molecules; stopping.\n"

difc red 1
difc blue 1
color red red
color blue blue

mol 100 red u u u
mol 10 blue 50 50 50

reaction rxn red -> 0 0.04

end_file

