[ase-users] Mixing calculator

Ask Hjorth Larsen asklarsen at gmail.com
Tue Jun 30 17:07:44 CEST 2020


Dear Nancy,

Am Di., 30. Juni 2020 um 14:30 Uhr schrieb nancy <zhw941018 at hotmail.com>:
>
> 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

The tip4p calculator requires the atoms to be O, H, H, O, H, H, O, H, H, ...

One of the atoms was something else.

Try print(atoms.symbols) right before.

Best regards
Ask

>
> 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
>
>



More information about the ase-users mailing list