# Simple bouncing molecules in a 3-D system
# molecules leak out of this system

graphics opengl
random_seed 1

dim 3
species A B C	# A,C are particles, B on lattice

color A red
color B green
color C blue

difc all 0.1

time_start 0
time_stop 50
time_step 0.001

boundaries x 0 1 
boundaries y 0 1
boundaries z 0 1

#mol 10 A 0.0-0.5 u u
mol 1 C 0.0-0.5 u u

start_surface periodic_surface
action all front jump
polygon both edge
panel rect +y 0 0 0 1 1 rect0
panel rect -y 0 1 0 1 1 rect1
panel rect +z 0 0 0 1 1 rect2
panel rect -z 0 0 1 1 1 rect3
jump rect0 front <-> rect1 front
jump rect2 front <-> rect3 front
end_surface

start_surface reflective_surface
action front all reflect
color front 0.2 0 0 0.5
color back 0 0 0
polygon both face
panel rect +x 0 0 0 1 1
panel rect -x 1 0 0 1 1
end_surface

reaction fwd  A + B -> C 0.01
reaction back C -> A + B 20.0

reaction_representation fwd lattice + lattice -> particle
reaction_representation back particle -> lattice + lattice

start_port testport
end_port

start_lattice testlattice
type nsv
port testport
boundaries x 0 1
boundaries y 0 1 p
boundaries z 0 1 p
lengthscale 0.05 0.05 0.05
species all
reactions all
#mol 10 B 0.5-1.0 u u
end_lattice


output_files stdout

#cmd n 1000 molcount stdout
cmd n 100 molcountspace A 0 0 1 20 0 1 0 1 500 stdout
#cmd n 100 molcountspace B 0 0 1 20 0 1 0 1 500 bimolecular.dat
#cmd n 100 molcountspace C 0 0 1 20 0 1 0 1 500 bimolecular.dat
#cmd n 1000 printLattice stdout
#cmd n 1000 writeVTK output
end_file

