if vec_sepm <= rcutoff: pe_mod = Particle3D.Lj_pot(particles[j], vec_sepm) f_mod = Particle3D.Lj_force(particles[j], vec_sep, vec_sepm) force = force + f_mod pe = pe + pe_mod #position update using the velocity verlet algorithim is done p1 = j + 1 particles[j].leapPos2nd(dt, force) particles[j].position = Particle3D.PBC(particles[j], boxSize) #As the particle position is calcualted the mean square displacement is calculated and put into a array to be plotted, data calcualted every 100 timesteps if i % 100 == 0: bb = 0 for aa in range(len(particles)): seppy = Particle3D.MsD(particles[aa], particles1[bb]) sum_seppy = seppy + seppy bb = bb + 1 #data is written and outputted for the vmd program and is formated and outputted outfile1_0.write( str(p1) + " " + str(particles[j].position[0]) + " " + str(particles[j].position[1]) + " " + str(particles[j].position[2]) + "\n") if i % 100 == 0: MsD = (1 / nAt) * sum_seppy tvalue.append(gg) gg = gg + 1 MSSD.append(MsD) #count = copy.deepcopy(RDF(particles,n,maxr,dr,count,rho)) #print count
p1 = j+1 particles[j].leapPos2nd(dt,force) particles[j].position = Particle3D.PBC(particles[j],boxSize) #As the particle position is calcualted the mean square displacement is calculated and put into a array to be plotted, data calcualted every 100 timesteps if i%20 == 0: #data is written and outputted for the vmd program and is formated and outputted outfile1_0.write(str(p1) + " " + str(particles[j].position[0]) + " " + str(particles[j].position[1]) + " " + str(particles[j].position[2]) + "\n") for r in range(len(particles)): if r != 0: dist = Particle3D.vec_sep(particles[0],particles[r],boxSize) vec_sepr = np.linalg.norm(dist) rdf.append(vec_sepr) if i%20 == 0: for aa in range(len(particles)): seppy = Particle3D.MsD(particles[aa],particles1[aa],boxSize) sum_seppy = seppy + seppy MsD = (1/nAt)*sum_seppy tValueM.append(gg*20) tValue.append(gg*20) gg = gg + 1 MSSD.append(MsD) if i%100 == 0: print(str((i/10000.0)*100.0)+ '%' ) #count = copy.deepcopy(RDF(particles,n,maxr,dr,count,rho)) #print count