pymatgen.io.lammps.output module

class LammpsLog(log_file='log.lammps')[source]

Bases: object

Parser for LAMMPS log file.

Parameters:log_file (string) – path to the loag file
class LammpsRun(data_file, trajectory_file, log_file='log.lammps', is_forcefield=False)[source]

Bases: object

Parse the lammps data file, trajectory file and the log file to extract useful info about the system.

Parameters:
  • data_file (str) – path to the data file
  • trajectory_file (str) – path to the trajectory file
  • log_file (str) – path to the log file
box_lengths
get_diffusion_analyzer(specie, temperature, time_step, step_skip, smoothed=None, min_obs=30, avg_nsteps=1000)[source]
Parameters:
  • specie (Element/Specie) – Specie to calculate diffusivity for as a String. E.g., “Li”.
  • temperature (float) – Temperature of the diffusion run in Kelvin.
  • time_step (int) – Time step between measurements.
  • step_skip (int) – Sampling frequency of the displacements ( time_step is multiplied by this number to get the real time between measurements)
  • the other parameters please see the (For) –
  • documentation. (pymatgen.analysis.diffusion_analyzer.DiffusionAnalyzer) –
Returns:

DiffusionAnalyzer

get_displacements()[source]

Return the initial structure and displacements for each time step. Used to interface witht the DiffusionAnalyzer.

Returns:Structure object, numpy array of displacements
get_structures_from_trajectory()[source]

Convert the coordinates in each time step to a structure(boxed molecule). Used to construct DiffusionAnalyzer object.

Returns:list of Structure objects
mol_trajectory

Compute the weighted average trajectory of each molecule at each timestep

Returns:2D numpy array ((n_timesteps*mols_number) x 3)
mol_velocity

Compute the weighted average velcoity of each molecule at each timestep.

Returns:2D numpy array ((n_timesteps*mols_number) x 3)
natoms
traj_timesteps

trajectory time steps in time units. e.g. for units = real, time units = fmsec

pbc_wrap(array, box_lengths)[source]

wrap the array for molecule coordinates around the periodic boundary.

Parameters:
  • array (numpy.ndarray) – molecule coordinates, [[x1,y1,z1],[x2,y2,z2],..]
  • box_lengths (list) – [x_length, y_length, z_length]