Example #1
0
def test_amber_minimization(clean_files):
    simulation = Simulation()
    simulation.path = os.path.join("tmp")

    shutil.copy(os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.prmtop"), "tmp")
    shutil.copy(os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.rst7"), "tmp")

    simulation.executable = "sander"
    simulation.restraint_file = None

    simulation.prefix = "minimize"
    simulation.topology = "k-cl.prmtop"
    simulation.inpcrd = "k-cl.rst7"

    simulation.config_gb_min()
    # Turn off GB for now.
    simulation.cntrl["igb"] = 0
    simulation.cntrl["ntb"] = 0

    simulation.run()

    mdout = parse_mdout(os.path.join("tmp", "minimize.out"))

    assert pytest.approx(mdout["Bond"][-1]) == 0
    assert pytest.approx(mdout["Angle"][-1]) == 0
    assert pytest.approx(mdout["Dihedral"][-1]) == 0
    assert pytest.approx(mdout["V14"][-1]) == 0
    assert pytest.approx(mdout["E14"][-1]) == 0

    assert pytest.approx(mdout["VDW"][0], 0.1) == 6.5734
    assert pytest.approx(mdout["Ele"][0], 0.1) == -211.7616
Example #2
0
# Minimization
sim.executable = 'pmemd.cuda'
sim.topology = 'solvate.prmtop'
sim.prefix = 'minimize'
sim.inpcrd = 'solvate.rst7'
sim.path = './'
sim.ref = 'solvate.rst7'
sim.config_pbc_min()
sim.cntrl['maxcyc'] = 500
sim.cntrl['ncyc'] = 400
sim.cntrl['ntr'] = 1
sim.cntrl['restraint_wt'] = 50.0
sim.cntrl['restraintmask'] = "'@DUM'"
sim.cntrl['cut'] = 9.0
sim.restraint_file = 'disang.rest'
sim.run(fail_ok=False)

# Equilibration
sim.config_pbc_md()
sim.executable = 'pmemd.cuda'
sim.topology = 'solvate.prmtop'
sim.path = './'
sim.restraint_file = 'disang.rest'

sim.cntrl['nstlim'] = nstlim
sim.cntrl['ntwx'] = 250
sim.cntrl['ntwprt'] = ntwprt
sim.cntrl['ntwr'] = 250
sim.cntrl['cut'] = 9.0
Example #3
0
# Minimization
sim.executable = "pmemd.cuda"
sim.topology = "smirnoff.prmtop"
sim.prefix = "minimize"
sim.inpcrd = "smirnoff.inpcrd"
sim.path = "./"
sim.ref = "smirnoff.inpcrd"
sim.config_pbc_min()
sim.cntrl["maxcyc"] = 500
sim.cntrl["ncyc"] = 400
sim.cntrl["ntr"] = 1
sim.cntrl["restraint_wt"] = 50.0
sim.cntrl["restraintmask"] = "'@Pb'"
sim.cntrl["cut"] = 9.0
sim.restraint_file = "disang.rest"
sim.run(fail_ok=False)

# Equilibration
sim.config_pbc_md()
sim.executable = "pmemd.cuda"
sim.topology = "smirnoff.prmtop"
sim.path = "./"
sim.restraint_file = "disang.rest"

sim.cntrl["nstlim"] = nstlim
sim.cntrl["ntwx"] = 250
sim.cntrl["ntwr"] = 250
sim.cntrl["cut"] = 9.0

iteration = 0