Skip to content

[BUG] Bug in reading lammps trajectory files with random type id #375

@MabinogiX

Description

@MabinogiX

dpdata assumes the types of elements in one file are the same, which is not true in some cases. For example, the trajectory file cannot be loaded correctly:

ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
3
ITEM: BOX BOUNDS xy xz yz pp pp pp
0.0000000000000000e+00 6.8043376809999998e+00 2.5385198599999999e-02
0.0000000000000000e+00 6.7821075796999999e+00 1.8630761460000000e-01
0.0000000000000000e+00 6.6801861338000004e+00 6.5204177000000002e-02
ITEM: ATOMS id type x y z
1 1 3.48873 0.0697213 6.67774
2 2 3.38621 0.033338 3.34239
3 3 1.79424 1.7281 5.01015
ITEM: TIMESTEP
10
ITEM: NUMBER OF ATOMS
3
ITEM: BOX BOUNDS xy xz yz pp pp pp
3.0951719137647604e-02 6.7713982144168243e+00 2.5146837349522749e-02
3.1535098850918430e-02 6.7499602284333751e+00 1.8455822840494820e-01
3.1362715442244227e-02 6.6488234183577575e+00 6.4591924584292706e-02
ITEM: ATOMS id type x y z
1 3 6.63593 3.49936 3.46086
2 2 3.44881 6.57204 3.4593
3 1 1.85117 5.11268 4.96295

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions