daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from __future__ import print_function
  2. from simtk.openmm import app
  3. import simtk.openmm as mm
  4. from simtk import unit
  5. from sys import stdout
  6. import mbpol
  7.  
  8. simulation_name = "w2"
  9. pdb = app.PDBFile('w2.pdb')
  10. temperature = float(190)*unit.kelvin
  11. forcefield = mm.app.ForceField("/opt/conda/miniconda2/envs/openmm_env/lib/python3.6/site-packages/mbpol-1.0-py3.6-linux-x86_64.egg/mbpol.xml")
  12. nonbonded = mm.app.CutoffNonPeriodic
  13. timestep = 0.2*unit.femtoseconds
  14. equilib_steps = 200
  15. equilib_steps1 = 5
  16.  
  17. ################################## NVT
  18.  
  19. system = forcefield.createSystem(pdb.topology, nonbondedMethod=nonbonded,
  20.     nonbondedCutoff=3.0*unit.nanometers)
  21.  
  22. from openmmtools.integrators import GeodesicBAOABIntegrator
  23. integrator = GeodesicBAOABIntegrator(temperature, 1.0/unit.picoseconds, timestep)
  24. integrator.setRandomNumberSeed(1)
  25.  
  26. platform = mm.Platform.getPlatformByName('Reference')
  27. simulation = app.Simulation(pdb.topology, system, integrator, platform)
  28. simulation.context.setPositions(pdb.positions)
  29. simulation.context.computeVirtualSites()
  30.  
  31. simulation.context.setVelocitiesToTemperature(temperature)
  32.  
  33. simulation.reporters.append(app.PDBReporter('traj_nvt.pdb', 1))
  34.  
  35. simulation.reporters.append(app.StateDataReporter(simulation_name + "_nvt.log", 1, step=True,
  36.     time=True, potentialEnergy=True, kineticEnergy=True, totalEnergy=True, temperature=True,
  37.     progress=True, remainingTime=True, speed=True, totalSteps=equilib_steps,
  38.     separator=' '))
  39.  
  40.  
  41. print('Equilibrating...')
  42. simulation.step(equilib_steps)
  43. simulation.saveState('nvt.xml')
  44. simulation.step(equilib_steps1)
  45. simulation.saveState('nvt1.xml')
  46. simulation.step(equilib_steps1)
  47. simulation.saveState('nvt2.xml')
  48. simulation.step(equilib_steps1)
  49. simulation.saveState('nvt3.xml')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top