def test_BussiThermostat():
    system, positions, topology = readSystem('emim_BCN4_Jiung2014')
    dof = atomsmm.countDegreesOfFreedom(system)
    NVE = atomsmm.VelocityVerletPropagator()
    thermostat = atomsmm.VelocityRescalingPropagator(300*unit.kelvin, dof, 0.1*unit.picoseconds)
    integrator = atomsmm.GlobalThermostatIntegrator(1*unit.femtoseconds, NVE, thermostat, 1)
    execute(integrator, -13064.351037463852)
def test_Chained():
    system, positions, topology = readSystem('emim_BCN4_Jiung2014')
    dof = atomsmm.countDegreesOfFreedom(system)
    NVE = atomsmm.VelocityVerletPropagator()
    thermostat = atomsmm.VelocityRescalingPropagator(300*unit.kelvin, dof, 0.1*unit.picoseconds)
    integrator = atomsmm.ChainedPropagator(NVE, thermostat).integrator(1*unit.femtoseconds)
    integrator.setRandomNumberSeed(1)
    execute(integrator, -13064.756951334914)
def test_TrotterSuzuki():
    system, positions, topology = readSystem('emim_BCN4_Jiung2014')
    dof = atomsmm.countDegreesOfFreedom(system)
    NVE = atomsmm.VelocityVerletPropagator()
    thermostat = atomsmm.VelocityRescalingPropagator(300*unit.kelvin, dof, 0.1*unit.picoseconds)
    combined = atomsmm.TrotterSuzukiPropagator(NVE, thermostat)
    integrator = combined.integrator(1*unit.femtoseconds)
    integrator.setRandomNumberSeed(1)
    execute(integrator, -13064.351037463852)
def test_NoseHooverPropagator():
    system, positions, topology = readSystem('emim_BCN4_Jiung2014')
    dof = atomsmm.countDegreesOfFreedom(system)
    NVE = atomsmm.VelocityVerletPropagator()
    thermostat = atomsmm.NoseHooverPropagator(300*unit.kelvin, dof, 10*unit.femtoseconds, 2)
    thermostat = atomsmm.SuzukiYoshidaPropagator(thermostat, 3)
    combined = atomsmm.TrotterSuzukiPropagator(NVE, thermostat)
    integrator = combined.integrator(1*unit.femtoseconds)
    integrator.setRandomNumberSeed(1)
    execute(integrator, -13067.685398497035)
def test_VelocityVerlet():
    NVE = atomsmm.VelocityVerletPropagator()
    integrator = atomsmm.GlobalThermostatIntegrator(1*unit.femtoseconds, NVE)
    execute(integrator, -13069.385589639898)
Exemple #6
0
                                            shift).setForceGroup(1)
    outerForce = atomsmm.FarNonbondedForce(innerForce, rcut,
                                           rswitch).setForceGroup(2)
    for force in [exceptions, innerForce, outerForce]:
        force.importFrom(nbforce)
        force.addTo(system)
    NVE = atomsmm.RespaPropagator([2, 2, 1])
    integrator = atomsmm.GlobalThermostatIntegrator(dt, NVE)
else:
    nbforce = system.getForce(nbforceIndex)
    nbforce.setUseSwitchingFunction(True)
    nbforce.setSwitchingDistance(rswitch)
    # thermostat = atomsmm.VelocityRescalingPropagator(temp, dof, 1/friction)
    thermostat = atomsmm.NoseHooverLangevinPropagator(temp, dof, 1 / friction,
                                                      friction)
    NVE = atomsmm.VelocityVerletPropagator()
    integrator = atomsmm.TrotterSuzukiPropagator(NVE,
                                                 thermostat).integrator(dt)
    integrator.setRandomNumberSeed(seed)

integrator.pretty_print()

for (term,
     energy) in atomsmm.utils.splitPotentialEnergy(system, pdb.topology,
                                                   pdb.positions).items():
    print(term + ":", energy)

platform = openmm.Platform.getPlatformByName('CUDA')
properties = {"Precision": "mixed"}
simulation = app.Simulation(pdb.topology, system, integrator, platform,
                            properties)