Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
shift = True
mts = False
# mts = True

# case = 'q-SPC-FW'
case = 'emim_BCN4_Jiung2014'

pdb = app.PDBFile('../../tests/data/%s.pdb' % case)
forcefield = app.ForceField('../../tests/data/%s.xml' % case)
system = forcefield.createSystem(pdb.topology,
                                 nonbondedMethod=openmm.app.PME,
                                 nonbondedCutoff=rcut,
                                 rigidWater=False)

nbforceIndex = atomsmm.findNonbondedForce(system)
dof = atomsmm.countDegreesOfFreedom(system)
if mts:
    nbforce = atomsmm.hijackForce(system, nbforceIndex)
    exceptions = atomsmm.NonbondedExceptionsForce().setForceGroup(0)
    innerForce = atomsmm.NearNonbondedForce(rcutIn, rswitchIn,
                                            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)