pymatgen.io.lammps.input module

class DictLammpsInput(name, config_dict, lammps_data=None, data_filename='in.data', user_lammps_settings={})[source]

Bases: monty.json.MSONable

Implementation of LammpsInputSet that is initialized from a dict settings. It is typically used by other LammpsInputSets for initialization from json or yaml source files.

Parameters:
  • name (str) – A name for the input set.
  • config_dict (dict) – The config dictionary to use.
  • lammps_data (LammpsData) – LammpsData object
  • data_filename (str) – name of the the lammps data file
  • user_lammps_settings (dict) – User lammps settings. This allows a user to override lammps settings, e.g., setting a different force field or bond type.
as_dict()[source]
classmethod from_dict(d)[source]
classmethod from_file(name, filename, lammps_data=None, data_filename='in.data', user_lammps_settings={}, is_forcefield=False)[source]

Reads lammps style and JSON style input files putting the settings in an ordered dict (config_dict). Note: with monty.serialization.loadfn the order of paramters in the json file is not preserved

Parameters:
  • filename (string) – name of the file with the lamps control paramters
  • lammps_data (string/LammpsData/LammpsForceFieldData) – path to the data file or an appropriate object
  • data_filename (string) – name of the the lammps data file
  • user_lammps_settings (dict) – User lammps settings
  • is_forcefield (bool) – whether the data file has forcefield and topology info in it. This is required only if lammps_data is a path to the data file instead of a data object
Returns:

DictLammpsInput

write_input(filename, data_filename=None)[source]

Get the string representation of the main input file and write it. Also writes the data file if the lammps_data attribute is set.

Parameters:
  • filename (string) – name of the input file
  • data_filename (string) – override the data file name with this