[ase-users] ase.Atoms set_initial_charges() issue
Ask Hjorth Larsen
asklarsen at gmail.com
Sun Dec 20 23:48:21 CET 2020
Dear Noel,
Am So., 20. Dez. 2020 um 07:51 Uhr schrieb Noel Jakse via ase-users <
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, 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
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201220/d2ec10cf/attachment.htm>
More information about the ase-users
mailing list