pysimm.lmps
¶
Module Contents¶
Classes¶
pysimm.lmps.Init |
|
pysimm.lmps.Region |
|
pysimm.lmps.CreateBox |
|
pysimm.lmps.Group |
|
pysimm.lmps.Velocity |
|
pysimm.lmps.OutputSettings |
|
pysimm.lmps.MolecularDynamics |
|
pysimm.lmps.MolecularDynamics |
|
pysimm.lmps.MolecularDynamics |
|
pysimm.lmps.Minimization |
|
pysimm.lmps.CustomInput |
|
pysimm.lmps.Simulation |
|
pysimm.lmps.LogFile |
Functions¶
|
pysimm.lmps.enqueue_output |
|
pysimm.lmps.call_lammps |
|
pysimm.lmps.qeq |
|
pysimm.lmps.quick_md |
|
pysimm.lmps.quick_min |
|
pysimm.lmps.energy |
Attributes¶
- class pysimm.lmps.Init(**kwargs)[source]¶
Bases:
object
pysimm.lmps.Init
Template 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(self, sim=None)[source]¶
pysimm.lmps.Init.write
Prepare LAMMPS input with initialization settings
- Parameters
sim –
Simulation
object reference- Returns
string of LAMMPS input
- class pysimm.lmps.Region(name='all', style='block', *args, **kwargs)[source]¶
Bases:
pysimm.utils.Item
pysimm.lmps.Region
Template 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.CreateBox(n=1, region=Region(), *args, **kwargs)[source]¶
Bases:
pysimm.utils.Item
pysimm.lmps.CreateBox
Template 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.Group(name='all', style='id', *args, **kwargs)[source]¶
Bases:
pysimm.utils.Item
pysimm.lmps.Group
Template 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.Velocity(group=Group('all'), style='create', *args, **kwargs)[source]¶
Bases:
pysimm.utils.Item
pysimm.lmps.Velocity
Template 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
- class pysimm.lmps.OutputSettings(**kwargs)[source]¶
Bases:
object
pysimm.lmps.OutputSettings
Template 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:
object
pysimm.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(self, sim=None)[source]¶
pysimm.lmps.Qeq.write
Create LAMMPS input for a charge equilibration calculation
- Parameters
sim –
Simulation
object reference- Returns
input string
- class pysimm.lmps.MolecularDynamics(**kwargs)[source]¶
Bases:
object
pysimm.lmps.MolecularDynamics
Template 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.SteeredMolecularDynamics(**kwargs)[source]¶
Bases:
MolecularDynamics
pysimm.lmps.MolecularDynamics
Template 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
- write(self, sim=None)[source]¶
pysimm.lmps.SteeredMolecularDynamics.write
Create LAMMPS input for a steered molecular dynamics simulation.
- Parameters
sim –
Simulation
object reference- Returns
input string
- class pysimm.lmps.Minimization(**kwargs)[source]¶
Bases:
object
pysimm.lmps.Minimization
Template 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(self, sim=None)[source]¶
pysimm.lmps.Minimization.write
Create LAMMPS input for an energy minimization simulation.
- Parameters
sim –
Simulation
object reference- Returns
input string
- class pysimm.lmps.CustomInput(custom_input)[source]¶
Bases:
object
pysimm.lmps.CustomInput
Template object to contain custom LAMMPS input.
- custom_input¶
custom input string
- class pysimm.lmps.Simulation(s, **kwargs)[source]¶
Bases:
object
pysimm.lmps.Simulation
Organizational object for LAMMPS simulation. Should contain combination of
MolecularDynamics
,Minimization
, and/orCustomInput
object.- 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_qeq(self, template=None, **kwargs)[source]¶
pysimm.lmps.Simulation.add_qeq
Add
Qeq
template to simulation
- add_md(self, template=None, **kwargs)[source]¶
pysimm.lmps.Simulation.add_md
Add
MolecularDyanmics
template to simulation- Parameters
template –
MolecularDynamics
object reference**kwargs – if template is None these are passed to
MolecularDynamics
constructor to create new template
- add_min(self, template=None, **kwargs)[source]¶
pysimm.lmps.Simulation.add_min
Add
Minimization
template to simulation- Parameters
template –
Minimization
object reference**kwargs – if template is None these are passed to
Minimization
constructor to create new template
- add_custom(self, custom='')[source]¶
pysimm.lmps.Simulation.add_custom
Add custom input string to simulation
- Parameters
custom – custom LAMMPS input string to add to Simulation
- write_input(self, init=True)[source]¶
pysimm.lmps.Simulation.write_input
Creates LAMMPS input string including initialization and input from templates/custom input
- Parameters
None –
- Returns
None
- run(self, np=None, nanohub=None, save_input=True, prefix='mpiexec')[source]¶
pysimm.lmps.Simulation.run
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)
- pysimm.lmps.enqueue_output(out, queue)[source]¶
pysimm.lmps.enqueue_output
Helps queue output for printing to screen during simulation.
- pysimm.lmps.call_lammps(simulation, np, nanohub, prefix='mpiexec')[source]¶
pysimm.lmps.call_lammps
Wrapper to call LAMMPS using executable name defined in pysimm.lmps module.
- Parameters
simulation –
Simulation
object referencenp – number of threads to use
nanohub – dictionary containing nanohub resource information default=None
prefix – prefix for running LAMMPS (i.e. - mpiexec)
- Returns
None
- pysimm.lmps.qeq(s, np=None, nanohub=None, **kwargs)[source]¶
pysimm.lmps.qeq
Convenience function to call a qeq calculation. kwargs are passed to
Qeq
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_md(s, np=None, nanohub=None, **kwargs)[source]¶
pysimm.lmps.quick_md
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]¶
pysimm.lmps.quick_min
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
- pysimm.lmps.energy(s, all=False, np=None, **kwargs)[source]¶
pysimm.lmps.energy
Convenience function to calculate energy of a given
System
object.- 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