[ase-users] ase.Atoms set_initial_charges() issue

Noel Jakse noel.jakse at grenoble-inp.fr
Mon Dec 28 06:52:15 CET 2020


Dear Ask, dear all

Here is the dump file with configurations 0 to 2 and the corresponding 
py script that produce the error and leads to false pbc upon loading.

Don't hesitate to contact me for any missing information

Happy seasons greetings
Best
Noel


Le 20/12/2020 à 23:48, Ask Hjorth Larsen a écrit :
> Dear Noel,
>
>
> Am So., 20. Dez. 2020 um 07:51 Uhr schrieb Noel Jakse via ase-users 
> <ase-users at listserv.fysik.dtu.dk 
> <mailto:ase-users at listserv.fysik.dtu.dk>>:
>
>     Hello everyone !
>
>     I got the two following problems in loading a Lammps dump file for
>     2400 atoms of Alumina (Al203) which is a charged system, using the
>     ase.io.lammpsrun module.
>
>     ** *first problem :* It produces the following error:
>
>
> Would you be able to reproduce this for a lammpsdump file with 0-2 
> atoms and provide the full example (minimal lammpsdump file and load it)?
>
>     _______________
>         self.new_array(name, a, dtype, shape)
>       File
>     "/home/noel/.local/lib/python3.6/site-packages/ase/atoms.py", line
>     477, in new_array
>         (a.name <http://a.name>, a.shape, (a.shape[0:1] + shape)))
>     AttributeError: 'numpy.ndarray' object has no attribute 'name'
>     _________________
>
>     I found that this is a problem with set_initial_charges()  in
>     "atoms.py" and the solution which works fine is changing
>
>     self.set_array('initial_charges', charges, float, ())
>
>     to
>
>     self.set_array('initial_charges', charges, float, charges.shape[1:])
>
>     I think it could be worth making the correction in the next
>     release and I can provide all the necessary files to ASE
>     developers for testing purpose.
>
>     ** *second problem:* after loading successfully the dump.file I
>     got the list of 1000 Atoms objects. But all of them stayed with 
>     pbc= [False, False, False] even if the system is purely periodic
>     (see the dump file below)
>
>     For sure I can correct this manually by applying to all Atoms
>     objects set_pbc([True,True,True] )
>
>     Please let me know if I missed something when calling the
>     read_lammps_dump_text() module (see Python code below) or there is
>     another error ?
>
>
> It would be nice to fix this.  Can you supply a minimal self-contained 
> script with 0-2 atoms or so which demonstrates the problem?
>
> Best regards
> Ask
>
>     All the best
>
>     Noel
>
>     Here is the dump file header :
>
>     ____________________
>     ITEM: TIMESTEP
>     0
>     ITEM: NUMBER OF ATOMS
>     2400
>     ITEM: BOX BOUNDS pp pp pp
>     -1.7262580576050883e+00 3.1158258057573136e+01
>     -1.7262580576050883e+00 3.1158258057573136e+01
>     -1.7262580576050883e+00 3.1158258057573136e+01
>     ITEM: ATOMS id type q x y z
>     313 2 1.8 2.7509 0.333675 0.636952
>     665 2 1.8 4.2387 3.46046 0.192756
>     ...
>     ____________________
>
>
>     here are the python command lines :
>
>     _____________________________________
>
>     specorder = ['Ca', 'Al', 'O', 'Ti']
>     dump_file = 'Dump.pos'
>     dfile = open(dump_file, 'r')
>     atom_list=lmpdump.read_lammps_dump_text(dfile,slice(0, -1,
>     None),specorder=specorder)
>
>
>
>     <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>     	Garanti sans virus. www.avast.com
>     <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
>
>     <#m_-1370208898350607178_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>     _______________________________________________
>     ase-users mailing list
>     ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>     https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>     <https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users>
>



-- 
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201228/760cfae4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dump_0-2.pos.gz
Type: application/x-gzip
Size: 102588 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201228/760cfae4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dumptoase.py
Type: text/x-python
Size: 1373 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201228/760cfae4/attachment-0001.py>


More information about the ase-users mailing list