Skip to content

Plugin LAMMPS Input Generator

Hiromichi Yokoyama edited this page Nov 26, 2026 · 2 revisions

Plugin: LAMMPS Input Generator

LAMMPS Input Generator writes a LAMMPS data file and a matching in.* script for the structure open in MoleditPy, with a live preview of both files and a list of checks before you save.

Repository moleditpy_lammps_input_generator
Author HiroYokoyama
Supported OS Windows, macOS, Linux, WSL
Supported Python >=3.10, <3.15
Supported MoleditPy >=5.0.0, <6.0.0
First-party plugin license LGPL-3.0-or-later
Menu location File ▸ Export ▸ LAMMPS Input (data + in script)...
Extra dependencies none (LAMMPS is needed only to run the files)

See Official Plugins for the full catalogue, and MD System Builder for the whole MD workflow.

Input script preview with an mdff force field


1. Force-field sources

  • moleditpy-mdff file from Force Field Builder: charges, Lennard-Jones, bonds, angles, proper and improper torsions, rigid water and constraints, converted from GROMACS units to LAMMPS real units. The atoms must follow the order of the file's system list; a file with a single molecule type is matched by atom count.
  • UFF from RDKit: bonds, angles, torsions and inversions from RDKit's UFF, with Gasteiger, MMFF94 or zero charges. The cosine angle terms are approximated by harmonic ones, so UFF is for quick tests, not production runs.
  • ReaxFF or another potential: an atomic or charge data file and a script template that points at your own potential file (ffield.*, *.eam, *.tersoff, ...).

How the mdff terms map to LAMMPS styles:

mdff LAMMPS (real)
bond k, r0 bond_style harmonic
angle k, theta0 angle_style harmonic
torsion dihedral_style charmm (weight 0), or fourier when a phase is not a whole degree
improper with phase 0 or 180 improper_style cvff; other impropers are written as dihedrals
combination_rule 2 / 1, 3 pair_modify mix arithmetic / geometric
fudge_lj, fudge_qq special_bonds lj 0 0 f coul 0 0 f
SETTLE water, constraints fix shake

Periodic systems with charges use lj/cut/coul/long with pppm (or ewald); non-periodic boxes use lj/cut/coul/cut with shrink-wrapped boundaries.


2. Box

The box is taken from, in this order: the molecule's moleditpy_cell property, the cell of the structure open in CIF Viewer, or a box you set (padding around the molecule, or lengths and angles, periodic or not). Triclinic cells are rotated into the LAMMPS restricted form, tilt factors are reduced where LAMMPS would refuse them, and atoms are wrapped into the box with image flags that keep molecules whole. The plugin keeps the cell in the project, since MoleditPy drops moleditpy_cell on undo and save.


3. Run, output and checks

  • Run: minimisation, NVE, NVT or NPT; Nose-Hoover, Langevin, CSVR or Berendsen thermostats; Nose-Hoover or Berendsen barostats (iso, aniso, or tri for a triclinic box); an optional minimisation before MD; SHAKE on bonds to hydrogen; temperature, pressure, time step, steps and seed.
  • Output: thermo interval, a multi-frame XYZ dump with element symbols (opens in Large System Viewer) or a custom lammpstrj, restart files, and a final write_data / write_restart.
  • Checks: data-file counts and type ids, charge neutrality, box size against the cut-off, SHAKE cluster limits, NPT without periodicity and an unusually large time step.
  • 0-step check: if lmp (or lmp_serial, lmp_mpi, ...) is on PATH or chosen, the input is run with run 0 in a temporary folder and LAMMPS errors and warnings are shown.

Presets are saved in the plugin's settings.json.

Run tab and the checks


4. Typical workflow

  1. Build the system with MD System Builder and assign parameters with Force Field Builder.
  2. Open File ▸ Export ▸ LAMMPS Input... and choose the force-field source.
  3. Check the cell on the Box tab, set the Run and Output tabs, and read the Checks tab.
  4. Save Files... (Ctrl+S) writes <job>.data and in.<job>; run lmp -in in.<job>.

LAMMPS packages used: MOLECULE (always), KSPACE (pppm, ewald), RIGID (fix shake), EXTRA-MOLECULE (dihedral_style fourier), EXTRA-FIX (fix temp/csvr), REAXFF (ReaxFF).


5. See also


This page documents LAMMPS Input Generator v0.1.2, and was last updated on 2026-11-26. See REGISTRY/plugins.json for the current version.

Clone this wiki locally