[ase-users] Format of setting external stresses in NPT
Ask Hjorth Larsen
asklarsen at gmail.com
Tue Sep 4 16:11:13 CEST 2018
Dear Riping, (re-added mailing list to recipients)
Am Di., 4. Sep. 2018 um 11:20 Uhr schrieb Wang Riping <wangriping at outlook.com>:
>
> Dear Larsen,
>
>
> Thank you very much for answer me two questions.
>
>
> I stil have difficulty in setting the NPT calculations following the manual.
>
>
> I do not know how to give a full expression for setting NPT, for example, I have the following error in setting temperature.
>
>
> [gyig_rpwang2_1 at lon26%tianhe2-H md2]$ python Cu.py
> File "Cu.py", line 54
> dyn = NPT(atoms, timestep=5*units.fs, temperature=300, numpy.array([-100,-100,-100,0,0,0]), None, None)
If you name some arguments you must also name the subsequent ones:
temperature=300 * units.kB, # (like in the other mail),
externalstress=...,
trajectory=....,
You can omit the Nones. Those things will become None anyway.
> SyntaxError: non-keyword arg after keyword arg
> [gyig_rpwang2_1 at lon26%tianhe2-H md2]$
>
>
> Before setting the temperaure in NPT arguments, do I need to initialize ion velocity using the follwoing lines?
>
> from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
>
> MaxwellBoltzmannDistribution(atoms, T * units.kB)
>
>
> It is better to show me a full example of setting the NPT calculations.
>
> Is it possible?
There's a full example using the Langevin somewhere. The differences
with NPT should be quite small.
Best regards
Ask
>
>
> Thank you very much.
>
>
> Riping Wang
>
> 2018.9.4
>
>
More information about the ase-users
mailing list