1# Simple virus model. 2# 3 4units lj 5dimension 3 6boundary f f f 7 8atom_style angle 9pair_style lj/cut 4.0 10pair_modify shift yes 11bond_style harmonic 12angle_style harmonic 13 14neigh_modify binsize 5.0 15 16read_data init.data 17 18group NC type 1 19group rest type 2 3 4 20group CA type 3 21 22 23timestep 0.0001 24variable R equal "ramp(v_R0,v_R1)" 25 26variable RF equal ${R1} 27variable Rw equal "v_RF - 0.5" 28 29print "**** R scales from ${R0} to ${R1} and wall is at ${Rw} ****" 30 31variable rr atom "sqrt( x*x + y*y + z*z )" 32compute ravg CA reduce ave v_rr 33 34region my_sphere sphere 0 0 0 v_Rw side out 35fix wall all wall/region my_sphere lj126 1.0 1.0 1.1225 36 37 38variable U equal pe 39variable epair equal epair 40fix U all ave/time 2000 1 2000 v_U v_R v_epair 41variable t equal time 42variable ravg equal c_ravg 43 44variable T equal 0.25 45 46variable pU equal f_U[1] 47variable pE equal f_U[3] 48 49fix out all print 2000 "$t ${pU} $R ${ravg} ${pE}" file thermo.${DATA}.dat screen no 50 51fix step1 rest nvt temp $T $T 1.0 52fix step2 NC nvt/manifold/rattle 1e-4 10 sphere v_R temp $T $T 1.0 53 54special_bonds lj 0 0 0 55 56angle_coeff 1 250.0 180.0 57 58thermo_style custom time step pe v_pU ke etotal epair temp v_R 59thermo 10000 60 61 62 63compute pe all pe/atom 64fix pe_avg all ave/atom 100 50 5000 c_pe 65 66 67dump traj_all all custom 5000 virus.dump id type x y z f_pe_avg 68 69run 2500000 70unfix out 71 72fix step1 rest nvt temp $T $T 1.0 73fix step2 NC nvt/manifold/rattle 1e-4 10 sphere ${R1} temp $T $T 1.0 74 75run 1000000 76