Module for writing LAMMPS input files.

Module Contents



Construct Lammps data file.


Construct LAMMPS input.

class jarvis.io.lammps.inputs.LammpsData(lammps_box=[], species=[], charges=[], cart_coords=[], element_order=[])[source]

Bases: object

Construct Lammps data file.


Convert Lammps data to Atoms object.

atoms_to_lammps(self, atoms, origin=(0, 0, 0))[source]

Convert Atoms object to Lammps data.

read_data(self, filename='lammps.data', element_order=[], potential_file='pot.mod', verbose=True, has_charges=True)[source]

Read Lammps data file.

write_file(self, filename='lammps.data')[source]

Write Lammps data input file.


Convert the infor to a dictionary.

classmethod from_dict(self, d={})[source]

Construct from a dictionary.

__repr__(self, indent=4)[source]

Print method.

class jarvis.io.lammps.inputs.LammpsInput(LammpsDataObj=None, pbc=['p', 'p', 'p'])[source]

Bases: object

Construct LAMMPS input.


Convert to a dictionary.

classmethod from_dict(self, d={})[source]

Costruct class from a dictionary.

write_lammps_in(self, lammps_in='init.mod', lammps_in1='potential.mod', lammps_in2='in.main', lammps_trj=None, lammps_data=None, parameters={})[source]

Write lammps input file.

From ase with custom modifications LAMMPS input is devided into three parts


lammps_in: generally”init.mod”, with unit and conversion factor information

lammps_in1: generally “potential.mod”, with force-field/potential style and element type information

lammps_in2: generally “in.elastic”, a generic main input file to be fed in LAMMPS usin lmp_*<…,parameters[‘exec’]

parameters: input parameters