# two monomer nylon example
# reaction produces a condensed water molecule

units real

boundary p p p

atom_style full

kspace_style pppm 1.0e-4

pair_style lj/class2/coul/long 8.5

angle_style class2

bond_style class2

dihedral_style class2

improper_style class2

read_data tiny_nylon.data

velocity all create 300.0 4928459 dist gaussian

molecule mol1 rxn1_stp1_unreacted.data_template
molecule mol2 rxn1_stp1_reacted.data_template
molecule mol3 rxn1_stp2_unreacted.data_template
molecule mol4 rxn1_stp2_reacted.data_template

thermo 50

# dump 1 all xyz 1 test_vis.xyz
variable freq index 10 9 8 7 6 5 4 3 2 1
print "freq ${freq} " screen yes


fix myrxns all bond/react stabilization yes statted_grp .03 &
  react rxn1 all ${freq} 0.0 2.9 mol1 mol2 rxn1_stp1_map &
  react rxn2 all ${freq}  0.0 5.0 mol3 mol4 rxn1_stp2_map

fix 1 statted_grp_REACT nvt temp 300 300 100

fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1

thermo_style custom step temp press density # f_myrxns[1] f_myrxns[2]

# restart 100 restart1 restart2

run 10000

unfix 1
unfix 4
unfix myrxns
group statted_grp_REACT delete
group bond_react_MASTER_group delete

variable a loop 2
label oloop

next freq

print "freq ${freq} " screen yes

fix myrxns all bond/react stabilization yes statted_grp .03 &
  react rxn1 all ${freq} 0.0 2.9 mol1 mol2 rxn1_stp1_map &
  react rxn2 all ${freq} 0.0 5.0 mol3 mol4 rxn1_stp2_map

fix 1 statted_grp_REACT nvt temp 300 300 100

fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1

thermo_style custom step temp press density f_myrxns[1] f_myrxns[2]

run 10000
unfix 1
unfix 4
unfix myrxns
group statted_grp_REACT delete
group bond_react_MASTER_group delete

next a 
jump SELF oloop




# write_restart restart_longrun
# write_data restart_longrun.data
