No update on atom types

30 views
Skip to first unread message

Elias Mahmoudinezhad Zirdehi

unread,
Dec 9, 2021, 10:04:40 PM12/9/21
to MDnalysis discussion
Hello everyone,

I am running a simulation in LAMMPS in which the types of some atoms change with time. The issue is that loading both DCD and text-based dump files into MDA, I do not see any update on the atom types. They remain constant as defined in the topology data file. 

I expected that the atom ids are sufficient to read the topology information, and the other atom properties such as atom types and molecule ids can be read directly from the trajectory file. Does anyone have any suggestion on how to read the current atom types that are saved in the trajectory file (DCD or text-based dump files)? 

I appreciate any hints.

Best regards,
Elias

Irfan Alibay

unread,
Dec 10, 2021, 3:59:07 AM12/10/21
to MDnalysis discussion
Hi,

Dealing with time dependent topology changes is not something that MDAnalysis is currently set up to (or aiming to) be able to do. In theory one could update atom types / elements / masses etc.. whilst looping through a trajectory by manually overwriting the values, but that a) would require a carefully constructed custom implementation, b) would be complicated when dealing with things like bond information, c) would not be possible to change the total number of atoms.

With regards to obtaining topology information from DCD or text-based DUMP trajectory files, the MDAnalysis readers are not set up for this either. As far as I know the DCD format does not store atom types, but in the case of text-based DUMP files you might have some luck by creating a custom version of the existing reader. Whilst I don't think it's something we would want to support, please feel free to raise this as a feature request on github if you would like.

Best regards,

Irfan

Elias Mahmoudinezhad Zirdehi

unread,
Dec 10, 2021, 4:28:08 PM12/10/21
to MDnalysis discussion
Thank you for your reply.

I resolved this issue by writing an extra dump file containing only the atom types. At every frame, this file is loaded into an array (like X) and then update the groups using the atom ids (group_1=u.atoms[X==1]). I should mention that this is much faster than using 'select_atoms("type 1")'.

Best regards,
Elias
Reply all
Reply to author
Forward
0 new messages