In reading trajectory file from LAMMPS dump file

Hello,

I’m currently trying to import a LAMMPS dump file of a system with two elements, but dynasor keeps reading my file as a system with only one element. I basically followed your example of aluminum_liquid_dynamic, but since the example has one element, I guess I might have to provide some additional code/file for dynasor to handle two-element system… (or I simply might have made a mistake in the code) Can you help me work this out?

These are the lines that I ran to import dump file:


import numpy as np
import matplotlib.pyplot as plt

from dynasor import compute_dynamic_structure_factors, Trajectory
from dynasor.qpoints import get_spherical_qpoints
from dynasor.post_processing import compute_spherical_qpoint_average
from dynasor.logging_tools import set_logging_level

set_logging_level(‘INFO’)

trajectory_filename = ‘dump_test’
traj = Trajectory(
trajectory_filename,
trajectory_format=‘lammps_internal’,
frame_stop=1)

and this was the output that I got


INFO: Trajectory file: dump_test
INFO: Total number of particles: 816
INFO: Number of atom types: 1
INFO: Number of atoms of type X: 816
INFO: Simulation cell (in Angstrom):
[[26.95202407 0. 0. ]
[ 0. 26.95202407 0. ]
[ 0. 0. 26.95202407]]

and this is first part of my dump file


ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
816
ITEM: BOX BOUNDS pp pp pp
0.0000000000000000e+00 2.6952024070000000e+01
0.0000000000000000e+00 2.6952024070000000e+01
0.0000000000000000e+00 2.6952024070000000e+01
ITEM: ATOMS id type x y z
560 2 5.05721 5.82974 5.58473
532 2 1.34249 0.276115 1.55615
509 2 1.1969 3.94284 5.19856
187 1 3.68259 4.29029 3.64209
771 2 5.53167 5.82983 1.63569

Hi Jimin_Lee,

Only some trajectory types support automatic reading of atomic types. For your case, with a lammps dump file, you need to specify atomic_indices when setting up your Trajectory. This can be done either in the form of a dictionary or in the form of an index file. See here and here for more information.

Feel free to reach out again if you have any further questions.

Thank you for your kind reply!