def pd_init(self): self.net.net.write(self.net.name + '_init.txyz', ftype='txyz') self.pd = pydlpoly.pydlpoly(self.net.name) self.pd.control["cut"] = 0.5 self.pd.control["no link"] = " " self.pd.setup(xyz=self.net.name + "_init.txyz", key=self.net.name + ".key", local=True, bcond=3) return
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import pydlpoly import molsys # initialize a pydlpoly instance m = molsys.mol() m.read("bdc_0opt.mfpx") m.addon("ff") m.ff.read("bdc_0") pd = pydlpoly.pydlpoly("test") pd.control["shift"] = "" pd.control["spme"] = "precision 1.0d-6" pd.setup(mol=m, local=False) # set field pd.set_efield([0.00, 0.0, 0.0], use_ref=False, const_D=False) pd.set_atoms_moved() pd.calc_energy_force() # equilibrate temperature pd.MD_init("equil", T=150, ensemble="nvt", thermo="ber", relax=[0.2]) pd.MD_run(100000, printout=100) # sampling pd.MD_init("cons", T=150, ensemble="nvt",
from molsys.util import ff2pydlpoly import cma # specify a name name = "ph-ph" # initialize a molsys object m = molsys.mol.fromFile("ph-ph.mfpx") # add ff addon and read in the fpar and ric file m.addon("ff") m.ff.read(name, fit=True) # setup pydlpoly wm = ff2pydlpoly.wrapper(m) pd = pydlpoly.pydlpoly(name) pd.setup(web=wm) # initialize ric addon, need to be done after pydlpoly setup m.addon("ric") m.ric.setup_rics(full=False) # initialize ric_fit objective ric = ric_fit.ric_fit(only_diag=False) # initialize FFgen ff = ff_gen.ff_gen(name, pd, objective=ric, minimize=True) # set maxiter and inititialize CMA-ES on the problem miter = 10 es = cma.CMAEvolutionStrategy(ff.initials, 0.2, {
import pydlpoly pd = pydlpoly.pydlpoly("dut49") # enforce triclinic -> otherwise all is orthorombic pd.setup(bcond=3) # do a first round of NVT with a quick/fast Berendsen Thermostat pd.MD_init("equil_NVT", T=300.0, p=0.001, startup=True, ensemble="nvt", thermo="ber", relax=(0.1,)) pd.MD_run(20000) # now start up NsT with a Hoover thermostat .. first for equlibrating pd.MD_init("equil_NPT", T=300.0, p=0.001, ensemble="npt", thermo="hoover", relax=(1.0, 2.0)) pd.MD_run(1000000) # finally sample NsT with a Hoover thermostat pd.MD_init("sample_NPT", T=300.0, p=0.001, ensemble="npt", thermo="hoover", relax=(1.0, 2.0), traj=["cell", "xyz"], tnstep=10) pd.MD_run(5000000)