[ase-users] Format of setting external stresses in NPT

Ask Hjorth Larsen asklarsen at gmail.com
Sat Sep 1 18:15:00 CEST 2018


Dear Riping Wang,

Den lør. 1. sep. 2018 kl. 15.19 skrev Wang Riping via ase-users
<ase-users at listserv.fysik.dtu.dk>:
>
> Dear ASE
>
> when I set    dyn = NPT(atoms, 5*units.fs, 0, (-100,-100,-100,0,0,0), None, None),

The code assumes that you provide an array:

NPT(atoms, 5*units.fs, 0, np.array([-100,-100,-100,0,0,0]), ...)

I will make it less picky for next release.

Best regards
Ask

> it reports the following error.
>
> WARNING: NPT: Setting the center-of-mass momentum to zero (was 0.370581 35.7431 -20.9148)
> Traceback (most recent call last):
>   File "Cu.py", line 53, in <module>
>     dyn = NPT(atoms, 5*units.fs, 0, (-100,-100,-100,0,0,0), None, None)
>   File "/BIGDATA1/gyig_rpwang2_1/software/ase-3.16.2/ase/md/npt.py", line 150, in __init__
>     self.set_stress(externalstress)
>   File "/BIGDATA1/gyig_rpwang2_1/software/ase-3.16.2/ase/md/npt.py", line 174, in set_stress
>     elif stress.shape == (3, 3):
> AttributeError: 'tuple' object has no attribute 'shape'
>
> Anyone can give me examples of setting stresses with 6*1 or 3*3 array format?
>
> Thank you very much.
>
> Riping Wang
> 2018.9.1
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list