pyiron_atomistics.lammps.output.remap_indices

Contents

pyiron_atomistics.lammps.output.remap_indices#

pyiron_atomistics.lammps.output.remap_indices(lammps_indices: np.ndarray | List, potential_elements: np.ndarray | List, structure: Atoms) np.ndarray[source]#

Give the Lammps-dumped indices, re-maps these back onto the structure’s indices to preserve the species.

The issue is that for an N-element potential, Lammps dumps the chemical index from 1 to N based on the order that these species are written in the Lammps input file. But the indices for a given structure are based on the order in which chemical species were added to that structure, and run from 0 up to the number of species currently in that structure. Therefore we need to be a little careful with mapping.

Parameters:
  • lammps_indices (numpy.ndarray/list) – The Lammps-dumped integers.

  • potential_elements (numpy.ndarray/list)

  • structure (pyiron_atomistics.atomistics.structure.Atoms)

Returns:

Those integers mapped onto the structure.

Return type:

numpy.ndarray