pysimm.lmps module¶
-
class
pysimm.lmps.CreateBox(n=1, region=<pysimm.lmps.Region object>, *args, **kwargs)[source]¶ Bases:
pysimm.utils.ItemTemplate object to create a box in a LAMMPS simulation. See LAMMPS documentation for further information
-
n¶ number of atom types
-
**kwargs optional kwargs for create_box command (replace / with _)
-
-
class
pysimm.lmps.CustomInput(custom_input)[source]¶ Bases:
objectTemplate object to contain custom LAMMPS input.
-
custom_input¶ custom input string
-
-
class
pysimm.lmps.Group(name='all', style='id', *args, **kwargs)[source]¶ Bases:
pysimm.utils.ItemTemplate object to define a group in a LAMMPS simulation. See LAMMPS documentation for further information
-
name¶ name for the group
-
style¶ style for the group
-
*args arguments for the given style
-
-
class
pysimm.lmps.Init(**kwargs)[source]¶ Bases:
objectTemplate object to contain LAMMPS initialization settings
-
forcefield¶ name of a supported force field; simulation settings will be chosen based on the force field name
-
units¶ LAMMPS set of units to use during simulation; default=real
-
atom_style¶ LAMMPS aomt_style to use during simulation; default=full
-
charge¶ option to define if any particles in system a non-zero charge
-
kspace_style¶ LAMMPS kspace_style to use during simulation if system has charges; default=pppm 1e-4
-
cutoff¶ dictionary of cutoff distances for nonbonded interactions; default={‘lj’: 12.0, ‘coul’: 12.0, ‘inner_lj’: 10.0}
-
pair_style¶ LAMMPS pair_style to use during simulation
-
bond_style¶ LAMMPS bond_style to use during simulation
-
angle_style¶ LAMMPS angle_style to use during simulation
-
dihedral_style¶ LAMMPS dihedral_style to use during simulation
-
improper_style¶ LAMMPS improper_style to use during simulation
-
special_bonds¶ LAMMPS special_bonds to use during simulation
-
pair_modify¶ LAMMPS pair_modify to use during simulation
-
write(sim=None)[source]¶ Prepare LAMMPS input with initialization settings
Parameters: sim – Simulationobject referenceReturns: string of LAMMPS input
-
-
class
pysimm.lmps.LogFile(fname)[source]¶ Bases:
objectClass to read LAMMPS log file into Pandas DataFrame stored in LogFile.data
-
fname¶ filename of log file
-
data¶ resulting DataFrame with log file data
-
-
class
pysimm.lmps.Minimization(**kwargs)[source]¶ Bases:
objectTemplate object to contain LAMMPS energy minimization settings.
-
min_style¶ LAMMPS minimization style default=’sd’
-
dmax¶ how far any atom can move in a single line search in any dimension
-
etol¶ energy tolerance default=1e-3
-
ftol¶ force tolerance default=1e-3
-
maxiter¶ maximum iterations default=10000
-
max eval maximum force evaluations default=100000
-
write(sim=None)[source]¶ Create LAMMPS input for an energy minimization simulation.
Parameters: sim – Simulationobject referenceReturns: input string
-
-
class
pysimm.lmps.MolecularDynamics(**kwargs)[source]¶ Bases:
objectTemplate object to contain LAMMPS MD settings
-
name¶ name to identify MD
-
timestep¶ timestep value to use during MD
-
ensemble¶ ‘nvt’ or ‘npt’ or ‘nve’; default=nve
-
limit¶ numerical value to use with nve when limiting particle displacement
-
temperature¶ dictionary of settings for temperature (start, stop, damp)
-
pressure¶ dictionary of settings for pressure (start, stop, damp)
-
run¶ length of MD simulation in number of timesteps or False to omit run command
-
unfix¶ True to include command to unfix integrator after run
-
rigid¶ dictionary of settings for a rigid simulation
-
extra_keywords¶ dictionary of extra keywords to append at the end of the LAMMPS fix integrator
-
-
class
pysimm.lmps.OutputSettings(**kwargs)[source]¶ Bases:
objectTemplate object to define thermo and dump output settings in a LAMMPS simulation. See LAMMPS documentation for further information
-
thermo¶ dictionary of settings for thermo output
-
dump¶ dictionary of settings for dump output
-
-
class
pysimm.lmps.Qeq(**kwargs)[source]¶ Bases:
objectpysimm.lmps.MolecularDynamics
Template object to contain LAMMPS qeq settings
-
cutoff¶ distance cutoff for charge equilibration
-
tol¶ tolerance (precision) for charge equilibration
-
max_iter¶ maximum iterations
-
qfile¶ file with qeq parameters (leave undefined for defaults)
-
write(sim=None)[source]¶ Create LAMMPS input for a charge equilibration calculation
Parameters: sim – Simulationobject referenceReturns: input string
-
-
class
pysimm.lmps.Region(name='all', style='block', *args, **kwargs)[source]¶ Bases:
pysimm.utils.ItemTemplate object to create a region in a LAMMPS simulation. See LAMMPS documentation for further information
-
name¶ name id for region
-
style¶ LAMMPS region style
-
*args args for given style
-
**kwargs optional kwargs for region command
-
-
class
pysimm.lmps.Simulation(s, **kwargs)[source]¶ Bases:
objectOrganizational object for LAMMPS simulation. Should contain combination of
MolecularDynamics,Minimization, and/orCustomInputobject.-
forcefield¶ name of force field for simulation settings
-
name¶ name for simulation
-
log¶ LAMMPS log filename
-
write¶ file name to write final LAMMPS data file default=None
-
print_to_screen¶ True to have LAMMPS output printed to stdout after simulation ends
-
debug¶ True to have LAMMPS output streamed to stdout during simulation (WARNING: this may degrade performance)
-
custom¶ option to flag simulation as purley custom input to skip prepaing initialization
-
add_custom(custom='')[source]¶ Add custom input string to simulation
Parameters: custom – custom LAMMPS input string to add to Simulation
-
add_md(template=None, **kwargs)[source]¶ Add
MolecularDyanmicstemplate to simulationParameters: - template –
MolecularDynamicsobject reference - **kwargs – if template is None these are passed to
MolecularDynamicsconstructor to create new template
- template –
-
add_min(template=None, **kwargs)[source]¶ Add
Minimizationtemplate to simulationParameters: - template –
Minimizationobject reference - **kwargs – if template is None these are passed to
Minimizationconstructor to create new template
- template –
-
input¶
-
run(np=None, nanohub=None, save_input=True, prefix='mpiexec')[source]¶ Begin LAMMPS simulation.
Parameters: - np – number of threads to use (serial by default) default=None
- nanohub – dictionary containing nanohub resource information default=None
- init – True to write initialization part of LAMMPS input script (set to False if using complete custom input)
- save_input – True to save input as pysimm.sim.in
- prefix – prefix for running LAMMPS (i.e. - mpiexec)
-
-
class
pysimm.lmps.SteeredMolecularDynamics(**kwargs)[source]¶ Bases:
pysimm.lmps.MolecularDynamics-
write(sim=None)[source]¶ Create LAMMPS input for a steered molecular dynamics simulation.
Parameters: sim – Simulationobject referenceReturns: input string
-
-
class
pysimm.lmps.Velocity(group=<pysimm.lmps.Group object>, style='create', *args, **kwargs)[source]¶ Bases:
pysimm.utils.ItemTemplate object to define velocity initialization in a LAMMPS simulation. See LAMMPS documentation for further information
-
group¶ group for velocity command
-
style¶ style for the velocity command
-
*args arguments for the given style
-
-
pysimm.lmps.call_lammps(simulation, np, nanohub, prefix='mpiexec')[source]¶ Wrapper to call LAMMPS using executable name defined in pysimm.lmps module.
Parameters: - simulation –
Simulationobject reference - np – number of threads to use
- nanohub – dictionary containing nanohub resource information default=None
- prefix – prefix for running LAMMPS (i.e. - mpiexec)
Returns: None
- simulation –
-
pysimm.lmps.energy(s, all=False, np=None, **kwargs)[source]¶ Convenience function to calculate energy of a given
Systemobject.Parameters: - s – system to calculate energy
- all – returns decomposition of energy if True (default: False)
- np – number of threads to use for simulation
Returns: total energy or disctionary of energy components
-
pysimm.lmps.enqueue_output(out, queue)[source]¶ Helps queue output for printing to screen during simulation.
-
pysimm.lmps.qeq(s, np=None, nanohub=None, **kwargs)[source]¶ Convenience function to call a qeq calculation. kwargs are passed to
QeqconstructorParameters: - s – system to perform simulation on
- np – number of threads to use
- nanohub – dictionary containing nanohub resource information default=None
Returns: None
-
pysimm.lmps.quick_md(s, np=None, nanohub=None, **kwargs)[source]¶ Convenience function to call an individual MD simulation. kwargs are passed to MD constructor
Parameters: - s – system to perform simulation on
- np – number of threads to use
- nanohub – dictionary containing nanohub resource information default=None
Returns: None
-
pysimm.lmps.quick_min(s, np=None, nanohub=None, **kwargs)[source]¶ Convenience function to call an individual energy minimization simulation. kwargs are passed to min constructor
Parameters: - s – system to perform simulation on
- np – number of threads to use
- nanohub – dictionary containing nanohub resource information default=None
Returns: None