# Demonstration of compartments
# This file shows a compartment comprised with logic

random_seed 1

graphics opengl

dim 2
species red green blue
boxsize 20

difc all 3

color red 1 0 0
color green 0 1 0
color blue 0 0 1
display_size all 3

time_start 0
time_stop 10
time_step 0.01

boundaries 0 0 100
boundaries 1 0 100
frame_thickness 0


start_surface walls
action both all r
color both 0 0 0
panel r +0 0 0 100
panel r -0 100 0 100
panel r +1 0 0 100
panel r -1 0 100 100
end_surface

start_surface left
action both all reflect
color both 0.6 0.6 0.6
thickness 1
panel s 40 50 30 30
end_surface

start_surface right
action both all reflect
color both 0 0 0
thickness 1
panel s 60 50 30 30
end_surface


start_compartment left
surface left
point 30 50
end_compartment

start_compartment right
surface right
point 70 50
end_compartment

start_compartment intersection
compartment equal left
compartment and right
end_compartment

start_compartment either
compartment equal left
compartment xor right
end_compartment

start_compartment outside
compartment equalnot left
compartment andnot right
end_compartment

compartment_mol 500 red intersection
compartment_mol 500 green either
compartment_mol 500 blue outside

ifdefine OUTFILE
  output_files OUTFILE
  cmd a listmols OUTFILE
endif

end_file

