intermol.lammps.lammps_parser module¶
- class intermol.lammps.lammps_parser.LammpsParser(in_file, system=None, unit_set='real')[source]¶
Bases: object
A class containing methods to read and write LAMMPS files.
- SCALE_FROM = 0.5¶
- SCALE_INTO = 2.0¶
- canonical_angle(kwds, angle, direction)[source]¶
Convert from the canonical form of this interaction.
- canonical_bond(kwds, bond, direction='into')[source]¶
Convert to/from the canonical form of this interaction.
- canonical_dihedral(params, dihedral, direction='into')[source]¶
Convert from the canonical form of this interaction.
- lammps_angle_types = {'charmm': <class 'intermol.forces.urey_bradley_angle_type.UreyBradleyAngleType'>, 'cosine': <class 'intermol.forces.cosine_angle_type.CosineAngleType'>, 'harmonic': <class 'intermol.forces.harmonic_angle_type.HarmonicAngleType'>}¶
- lammps_angles = {'charmm': <class 'intermol.forces.urey_bradley_angle_type.UreyBradleyAngle'>, 'cosine': <class 'intermol.forces.cosine_angle_type.CosineAngle'>, 'harmonic': <class 'intermol.forces.harmonic_angle_type.HarmonicAngle'>}¶
- lammps_bond_types = {'nonlinear': <class 'intermol.forces.nonlinear_bond_type.NonlinearBondType'>, 'quartic': <class 'intermol.forces.quartic_breakable_bond_type.QuarticBreakableBondType'>, 'morse': <class 'intermol.forces.morse_bond_type.MorseBondType'>, 'harmonic': <class 'intermol.forces.harmonic_bond_type.HarmonicBondType'>, 'fene/expand': <class 'intermol.forces.fene_expandable_bond_type.FeneExpandableBondType'>, 'class2': <class 'intermol.forces.quartic_bond_type.QuarticBondType'>}¶
- lammps_bonds = {'nonlinear': <class 'intermol.forces.nonlinear_bond_type.NonlinearBond'>, 'quartic': <class 'intermol.forces.quartic_breakable_bond_type.QuarticBreakableBond'>, 'morse': <class 'intermol.forces.morse_bond_type.MorseBond'>, 'harmonic': <class 'intermol.forces.harmonic_bond_type.HarmonicBond'>, 'fene/expand': <class 'intermol.forces.fene_expandable_bond_type.FeneExpandableBond'>, 'class2': <class 'intermol.forces.quartic_bond_type.QuarticBond'>}¶
- lammps_dihedral_types = {'charmm': <class 'intermol.forces.proper_periodic_dihedral_type.ProperPeriodicDihedralType'>, 'multi/harmonic': <class 'intermol.forces.rb_dihedral_type.RbDihedralType'>, 'opls': <class 'intermol.forces.fourier_dihedral_type.FourierDihedralType'>}¶
- lammps_dihedrals = {'charmm': <class 'intermol.forces.proper_periodic_dihedral_type.ProperPeriodicDihedral'>, 'multi/harmonic': <class 'intermol.forces.rb_dihedral_type.RbDihedral'>, 'opls': <class 'intermol.forces.fourier_dihedral_type.FourierDihedral'>}¶
- lammps_improper_types = {'cvff': <class 'intermol.forces.trig_dihedral_type.TrigDihedralType'>, 'harmonic': <class 'intermol.forces.improper_harmonic_dihedral_type.ImproperHarmonicDihedralType'>}¶
- lammps_impropers = {'cvff': <class 'intermol.forces.trig_dihedral_type.TrigDihedral'>, 'harmonic': <class 'intermol.forces.improper_harmonic_dihedral_type.ImproperHarmonicDihedral'>}¶
- lookup_lammps_angles = {<class 'intermol.forces.urey_bradley_angle_type.UreyBradleyAngle'>: 'charmm', <class 'intermol.forces.harmonic_angle_type.HarmonicAngle'>: 'harmonic', <class 'intermol.forces.cosine_angle_type.CosineAngle'>: 'cosine'}¶
- lookup_lammps_bonds = {<class 'intermol.forces.quartic_breakable_bond_type.QuarticBreakableBond'>: 'quartic', <class 'intermol.forces.quartic_bond_type.QuarticBond'>: 'class2', <class 'intermol.forces.fene_expandable_bond_type.FeneExpandableBond'>: 'fene/expand', <class 'intermol.forces.morse_bond_type.MorseBond'>: 'morse', <class 'intermol.forces.harmonic_bond_type.HarmonicBond'>: 'harmonic', <class 'intermol.forces.harmonic_potential_bond_type.HarmonicPotentialBond'>: 'harmonic', <class 'intermol.forces.nonlinear_bond_type.NonlinearBond'>: 'nonlinear'}¶
- lookup_lammps_dihedrals = {<class 'intermol.forces.proper_periodic_dihedral_type.ProperPeriodicDihedral'>: 'charmm', <class 'intermol.forces.rb_dihedral_type.RbDihedral'>: 'multi/harmonic', <class 'intermol.forces.trig_dihedral_type.TrigDihedral'>: 'Trig', <class 'intermol.forces.fourier_dihedral_type.FourierDihedral'>: 'opls'}¶
- lookup_lammps_impropers = {<class 'intermol.forces.trig_dihedral_type.TrigDihedral'>: 'cvff', <class 'intermol.forces.improper_harmonic_dihedral_type.ImproperHarmonicDihedral'>: 'harmonic'}¶
- parse_box(line, dim)[source]¶
Read box information from data file.
Parameters: - line (str) – Current line in input file.
- dim (int) – Dimension specified in line.
- parse_force(data_lines, force_classes, forceSet, n=0)[source]¶
Read bonds, angles, dihedrals, impropers from data file.
- parse_force_coeffs(data_lines, force_name, force_classes, force_style, lammps_forces, canonical_force)[source]¶
Read force coefficients from data file.
- read()[source]¶
Reads a LAMMPS input file and a data file specified within.
Parameters: input_file (str) – Name of LAMMPS input file to read in.
- read_data(data_file)[source]¶
Reads a LAMMPS data file.
Parameters: data_file (str) – name of LAMMPS data file to read in.
- read_input()[source]¶
Reads a LAMMPS input file.
Parameters: input_file (str) – Name of LAMMPS input file to read in.
- write(unit_set='real')[source]¶
Writes a LAMMPS data and corresponding input file.
Parameters: - data_file (str) – Name of LAMMPS data file to write to.
- unit_set (str) – LAMMPS unit set for output file.