[ase-users] Mixing calculator

nancy zhw941018 at hotmail.com
Tue Jun 30 14:30:37 CEST 2020


Dear Ask

Thank you for your reply. My solvent only includes water molecules, but when I ran using TIP4P calculator to the solvent, I have the error 
File "/home/dirac/tmcs/newc5888/ase/ase/calculators/tip4p.py", line 53, in calculate 
assert (atoms.numbers[::3] == 8).all() AssertionError

My full code is

solution = read('solvated_1.xyz')
solution.set_cell((12,12,12))
solution.set_pbc(True)

sigW = sigma0
epsW = epsilon0
epsilonMg = 0.011 * units.kcal / units.mol
sigmaMg = 2* 3.012 /2**(1 / 6.)

sigma_t = (sigW+sigmaMg)/2
epsilon_t = (epsW*epsilonMg)**(1/2)

metal=solution[list(range(19))]
solvent=solution[1:]
write("solvent.xyz",solvent)

metal.center()

metal.calc=LennardJones(sigma=sigma_t, epsilon=epsilon_t, rc=2.3)
solvent.calc=TIP4P(rc=4)
solution.calc=SumCalculator([metal.calc, solvent.calc])

#solution.calc=LennardJones()
md = Langevin(solution, 1 * units.fs, temperature=300 * units.kB,
              friction=0.01, logfile=tag + '.log',
              trajectory=tag + '.traj', loginterval=1)
md.run(1000)
print('done')


If I run MD for solvent file by TIP4P calculator, it works

> 2020年6月29日 下午8:41,Ask Hjorth Larsen <asklarsen at gmail.com> 写道:
> 
> Am Mo., 29. Juni 2020 um 18:21 Uhr schrieb nancy via ase-users
> <ase-users at listserv.fysik.dtu.dk>:
>> 
>> Hi,
>> 
>> I am writing a MD code for one metal ions solves in water. I want to use different calculator for ion-water interaction and solute. Therefore I use mixing calculator (SumCalculator). I have code:
>> 
>> atoms=read(‘file of the whole system')
>> atoms_metal=atoms[list(range(19))]
>> atoms_solution=atoms[1:]
>> atoms_metal.cal=LennardJones(sigma=sigma_t, epsilon=epsilon_t)
> 
> atoms_metal.calc =
> 
> Best regards
> Ask

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200630/2866fe3d/attachment-0001.html>


More information about the ase-users mailing list