class LammpsRunner(dict_input, input_filename='', bin='lammps')[source]

Bases: object

LAMMPS wrapper

  • dict_input (DictLammpsInput) – lammps input object
  • input_filename (string) – input file name
  • bin (string) – command to run, excluding the input file name

Write the input/data files and run LAMMPS.

class PackmolRunner(mols, param_list, input_file='pack.inp', tolerance=2.0, filetype='xyz', control_params={'maxit': 20, 'nloop': 600}, auto_box=True, output_file='')[source]

Bases: object

Wrapper for the Packmol software that can be used to pack various types of molecules into a one single unit.

  • mols – list of Molecules to pack
  • input_file – name of the packmol input file
  • tolerance – min distance between the atoms
  • filetype – input/output structure file type
  • control_params – packmol control parameters dictionary. Basically all parameters other than structure/atoms
  • param_list – list of parameters containing dicts for each molecule
  • auto_box – put the molecule assembly in a box
  • output_file – output file name. The extension will be adjusted according to the filetype

Write the input file to the scratch directory, run packmol and return the packed molecule.

Parameters:copy_to_current_on_exit (bool) – Whether or not to copy the packmol input/output files from the scratch directory to the current directory.
Returns:Molecule object
class Polymer(start_monomer, s_head, s_tail, monomer, head, tail, end_monomer, e_head, e_tail, n_units, link_distance=1.0, linear_chain=False)[source]

Bases: object

Generate polymer chain via Random walk. At each position there are a total of 5 possible moves(excluding the previous direction).

  • start_monomer (Molecule) – Starting molecule
  • s_head (int) – starting atom index of the start_monomer molecule
  • s_tail (int) – tail atom index of the start_monomer
  • monomer (Molecule) – The monomer
  • head (int) – index of the atom in the monomer that forms the head
  • tail (int) – tail atom index. monomers will be connected from tail to head
  • end_monomer (Molecule) – Terminal molecule
  • e_head (int) – starting atom index of the end_monomer molecule
  • e_tail (int) – tail atom index of the end_monomer
  • n_units (int) – number of monomer units excluding the start and terminal molecules
  • link_distance (float) – distance between consecutive monomers
  • linear_chain (bool) – linear or random walk polymer chain