lammps_step package#
Submodules#
lammps_step.custom module#
A custom script for LAMMPS
lammps_step.custom_parameters module#
Control parameters for a custom step in LAMMPS
- class lammps_step.custom_parameters.CustomParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for Custom dynamics in LAMMPS
- parameters = {'script': {'default': {}, 'default_units': None, 'description': 'Script:', 'enumeration': (), 'format_string': '', 'help_text': 'The custom script.', 'kind': 'string'}}#
lammps_step.custom_step module#
Main module.
lammps_step.energy module#
A single-point energy in LAMMPS
- class lammps_step.energy.Energy(flowchart=None, title='Energy', extension=None, logger=<Logger lammps_step.energy (WARNING)>)[source]#
Bases:
Node
Handle a singlepoint energy calculation in LAMMPS
- analyze(indent='', data={}, table=None, output=[], **kwargs)[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property results#
The storage for the results in the main LAMMPS step.
- property version#
The semantic version of this module.
lammps_step.energy_parameters module#
Control parameters for a single-point energy (SPE) in LAMMPS
- class lammps_step.energy_parameters.EnergyParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for Energy dynamics in LAMMPS
- parameters = {'create tables': {'default': 'yes', 'default_units': None, 'description': 'Create tables as needed:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to create tables as needed for results being saved into tables.', 'kind': 'boolean'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables. ', 'kind': 'dictionary'}}#
lammps_step.energy_step module#
Main module.
lammps_step.heat_flux module#
Non-graphical part of the Heat Flux step in a LAMMPS flowchart
- class lammps_step.heat_flux.HeatFlux(flowchart=None, title='Heat Flux', extension=None, logger=<Logger lammps_step.heat_flux (WARNING)>)[source]#
Bases:
NVE
The non-graphical part of a Heat Flux step in a flowchart.
- parser#
The parser object.
- Type:
configargparse.ArgParser
- options#
It contains a two item tuple containing the populated namespace and the list of remaining argument strings.
- Type:
tuple
- subflowchart#
A SEAMM Flowchart object that represents a subflowchart, if needed.
- Type:
seamm.Flowchart
- parameters#
The control parameters for Heat Flux.
- Type:
See also
TkHeatFlux
,HeatFlux
,HeatFluxParameters
- description_text(P=None)[source]#
Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.
- Parameters:
P (dict) – An optional dictionary of the current values of the control parameters.
- Returns:
A description of the current step.
- Return type:
str
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property version#
The semantic version of this module.
lammps_step.heat_flux_parameters module#
Control parameters for the Heat Flux step in a SEAMM flowchart
- class lammps_step.heat_flux_parameters.HeatFluxParameters(defaults={}, data=None)[source]#
Bases:
NVE_Parameters
The control parameters for Heat Flux.
You need to replace the “time” entry in dictionary below these comments with the definitions of parameters to control this step. The keys are parameters for the current plugin,the values are dictionaries as outlined below.
Examples
parameters = { "time": { "default": 100.0, "kind": "float", "default_units": "ps", "enumeration": tuple(), "format_string": ".1f", "description": "Simulation time:", "help_text": ("The time to simulate in the dynamics run.") }, }
- parameters{str: {str: str}}
A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys:
- parameters[“default”] :
The default value of the parameter, used to reset it.
- parameters[“kind”]enum()
Specifies the kind of a variable. One of “integer”, “float”, “string”, “boolean”, or “enum”
While the “kind” of a variable might be a numeric value, it may still have enumerated custom values meaningful to the user. For instance, if the parameter is a convergence criterion for an optimizer, custom values like “normal”, “precise”, etc, might be adequate. In addition, any parameter can be set to a variable of expression, indicated by having “$” as the first character in the field. For example, $OPTIMIZER_CONV.
- parameters[“default_units”]str
The default units, used for resetting the value.
- parameters[“enumeration”]: tuple
A tuple of enumerated values.
- parameters[“format_string”]: str
A format string for “pretty” output.
- parameters[“description”]: str
A short string used as a prompt in the GUI.
- parameters[“help_text”]: str
A longer string to display as help for the user.
See also
HeatFlux
,TkHeatFlux
,HeatFlux
,Heat
- parameters = {}#
lammps_step.heat_flux_step module#
- class lammps_step.heat_flux_step.HeatFluxStep(flowchart=None, gui=None)[source]#
Bases:
object
Helper class needed for the stevedore integration.
This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.
The dictionary for the description is the class variable just below these comments. The felds are as follows:
- my_description{str, str}
A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.
- my_description[“description”]tuple
A description of the Heat Flux step. It must be clear to non-experts.
- my_description[“group”]str
Which group in the menus to put this step. If the group does not exist it will be created. Common groups are “Building”, “Control”, “Custom”, “Data”, and “Simulations”.
- my_description[“name”]str
The name of this step, to be displayed in the menus.
- create_node(flowchart=None, **kwargs)[source]#
Create and return the new node object.
- Parameters:
flowchart (seamm.Node) – A non-graphical SEAMM node
**kwargs (keyword arguments) – Various keyword arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.
- Return type:
- create_tk_node(canvas=None, **kwargs)[source]#
Create and return the graphical Tk node object.
- Parameters:
canvas (tk.Canvas) – The Tk Canvas widget
**kwargs (keyword arguments) – Various keyword arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.
- Return type:
- description()[source]#
Return a description of what this step does.
- Returns:
description
- Return type:
dict(str, str)
- my_description = {'description': 'A LAMMPS step for calculating the heat flux', 'group': 'Calculations', 'name': 'Heat Flux'}#
lammps_step.initialization module#
A single-point initialization in LAMMPS
- class lammps_step.initialization.Initialization(flowchart=None, title='Initialization', extension=None)[source]#
Bases:
Node
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property kspace_methods#
The list of avilable methods
- property version#
The semantic version of this module.
lammps_step.initialization_parameters module#
Control parameters for the initialization in LAMMPS
- class lammps_step.initialization_parameters.InitializationParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for the initialization in LAMMPS
- parameters = {'charged_atom_fraction_cutoff': {'default': 0.1, 'default_units': '', 'description': 'Cutoff for charged atoms:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The upper limit of the fraction of charged atoms for using methods that exploit sparsity of charges.', 'kind': 'float'}, 'cutoff': {'default': 10.0, 'default_units': 'Å', 'description': 'Cutoff:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The cutoff used for non-bonded and similar interactions.', 'kind': 'float'}, 'ewald_atom_cutoff': {'default': 1000, 'default_units': '', 'description': 'Atom limit for using Ewald summations:', 'enumeration': (), 'format_string': 'd', 'help_text': 'The upper limit of the number of atoms for using Ewald summations by default.', 'kind': 'integer'}, 'fix_XH_bond_lengths': {'default': 'none', 'default_units': '', 'description': 'Fix X-H bond lengths', 'enumeration': ('none', 'all', 'CH'), 'format_string': '', 'help_text': 'Fix the bond lengths for H bonded to X.', 'kind': 'enumeration'}, 'kspace_accuracy': {'default': 1e-05, 'default_units': '', 'description': 'K-space accuracy:', 'enumeration': (), 'format_string': '.2e', 'help_text': 'The target accuracy for the k-space method.', 'kind': 'float'}, 'kspace_method': {'default': 'automatic', 'default_units': '', 'description': 'K-space method:', 'enumeration': ('automatic', 'none', 'Ewald summation method', 'PPPM (Particle-particle particle-mesh) method', 'PPPM method for few charged atoms', 'PPPM method with a staggered mesh', 'PPPM method including dispersion terms', 'MSM (Multilevel summation method)', 'MSM method for few charged atoms'), 'format_string': '', 'help_text': 'The method for handling long-range interactions.', 'kind': 'enumeration'}, 'kspace_smallq': {'default': 1e-05, 'default_units': '', 'description': 'K-space negligable charge:', 'enumeration': (), 'format_string': '.1e', 'help_text': 'The cutoff for the charge on an atom to be considered not zero.', 'kind': 'float'}, 'msm_atom_cutoff': {'default': 5000, 'default_units': '', 'description': 'Lower atom limit for using the MSM method:', 'enumeration': (), 'format_string': 'd', 'help_text': 'The lower limit of the number of atoms for using the MSM method by default.', 'kind': 'integer'}, 'rigid_waters': {'default': 'yes', 'description': 'Keep the internal geometry of water molecules fixed', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Use shake or rattle, as appropriate, to keep the water molecules rigid.', 'kind': 'boolean'}, 'shift_nonbond': {'default': 'no', 'description': 'Shift nonbonded interactions to zero at the cutoff', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Shift the nonbonded interactions to zero at the cutoff distance to avoid energy jumps.', 'kind': 'boolean'}, 'tail_correction': {'default': 'yes', 'description': 'Add tail corrections', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Add tail corrections for neglected long-range van der Waals terms.', 'kind': 'boolean'}}#
lammps_step.initialization_step module#
Main module.
lammps_step.installer module#
Installer for the LAMMPS plug-in.
This handles any further installation needed after installing the Python package lammps-step.
- class lammps_step.installer.Installer(logger=<Logger lammps_step.installer (WARNING)>)[source]#
Bases:
InstallerBase
Handle further installation needed after installing lammps-step.
The Python package lammps-step should already be installed, using pip, conda, or similar. This plug-in-specific installer then checks for the LAMMPS executables, installing them if need be, and registers their location in seamm.ini.
Note
The LAMMPS step and this assume that the LAMMPS executables, if present, are in the same directory. In addition, for the parallel version using MPI it is assumed that mpiexec is either in that same directory, or the correct mpiexec can be found in the PATH.
There are a number of ways to determine which are the correct LAMMPS executables to use. The aim of this installer is to help the user locate the executables. There are a number of possibilities
The correct executables are already available.
If they are already registered in seamm.ini there is nothing else to do.
They may be in the current path, in which case they need to be added to seamm.ini.
If a module system is in use, a module may need to be loaded to give access to LAMMPS.
They cannot be found automatically, so the user needs to locate the executables for the installer.
LAMMPS is not installed on the machine. In this case they can be installed in a Conda environment. There is one choice
They can be installed in a separate environment, seamm-lammps by default.
lammps_step.lammps module#
A node or step for LAMMPS in a flowchart
- class lammps_step.lammps.LAMMPS(flowchart=None, namespace='org.molssi.seamm.lammps', extension=None)[source]#
Bases:
Node
- analyze_trajectory(path, sampling_rate=20, control_properties=None, node=None)[source]#
Read a trajectory file and do the statistical analysis
- angle_table(key, values)[source]#
Create a section of the tabulated angle file.
- Parameters:
key (str) – The name for this section in the file.
values ({str: int, float, or str}) – The dictionary of the constants for this angle term.
- Returns:
[str] – A list of lines of the tabulated angle file.
values looks like this:: –
- {
‘reference’: ‘5’, ‘Eqn’: ‘K/8*(1-cos(n*Theta)) + A/(2*Rb*sin(Theta/2))**12’, ‘K’: 278.4416826003824, ‘n’: 4, ‘Rb’: 1.606, ‘A’: 11.950286806883364, ‘zero-shift’: 0.001
}
- static box_to_cell(lx, ly, lz, xy, xz, yz)[source]#
Convert the LAMMPS box definition to cell parameters.
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- display_title = {'Eke': 'Kinetic Energy', 'Emol': 'Molecular Energy, Valence Terms', 'Epair': 'Pair (Nonbond) Energy', 'Epe': 'Potential Energy', 'Etot': 'Total Energy', 'Jx': 'heat flux in x', 'Jy': 'heat flux in y', 'Jz': 'heat flux in z', 'Kappa': 'thermal conductivity', 'Kappa_x': 'thermal conductivity in x', 'Kappa_y': 'thermal conductivity in y', 'Kappa_z': 'thermal conductivity in z', 'P': 'Pressure', 'T': 'Temperature', 'V': 'Volume', 'a': 'a lattice parameter', 'b': 'b lattice parameter', 'c': 'c lattice parameter', 'density': 'Density', 't': 'Time', 'u': 'atom PE'}#
- display_units = {'Eke': 'kcal/mol', 'Emol': 'kcal/mol', 'Epair': 'kcal/mol', 'Epe': 'kcal/mol', 'Etot': 'kcal/mol', 'Jx': 'W/m^2', 'Jy': 'W/m^2', 'Jz': 'W/m^2', 'Kappa': 'W/K/m', 'Kappa_x': 'W/K/m', 'Kappa_y': 'W/K/m', 'Kappa_z': 'W/K/m', 'P': 'atm', 'T': 'K', 'V': 'Å^3', 'a': 'Å', 'b': 'Å', 'c': 'Å', 'density': 'g/mL', 't': 'fs', 'u': 'kcal/mol'}#
- get_dump(dumpfile)[source]#
Read the LAMMPS dumpfile and return the data.
- Parameters:
dumpfile (str) – The filename (or path) to the dumpfile.
- property git_revision#
The git version of this module.
- read_dump(dumpfile)[source]#
Read the LAMMPS dumpfile and update the system.
- Parameters:
dumpfile (str) – The filename (or path) to the dumpfile.
- property results#
The storage for results.
- shake_fix(P, eex)[source]#
Create the ‘fix shake’ line needed for handling waters and X-H.
- Parameters:
P (dict) – The parameters for the initialization step as a dict.
eex (dict) – The energy expression for this calculation
- Returns:
line – The correct fix line for LAMMPS
- Return type:
str
- structure_data(eex, triclinic=False)[source]#
Create the LAMMPS structure file from the energy expression
- property version#
The semantic version of this module.
- lammps_step.lammps.logging_disabled(highest_level=50)[source]#
A context manager that will prevent any logging messages triggered during the body from being processed.
- Parameters:
highest_level – the maximum logging level in use. This would only need to be changed if a custom level greater than CRITICAL is defined.
From Simon Weber https://gist.github.com/simon-weber/7853144
lammps_step.lammps_step module#
Helper class needed for the stevedore integration. Needs to provide a description() method that returns a dict containing a description of this node, and a factory() method for creating the graphical and non-graphical nodes.
lammps_step.lammps_units module#
Definition of unit systems in LAMMPS.
- lammps_step.lammps_units.from_lammps_units(value, units, quantity=None, unit_system=None)[source]#
Convert the scalar value from LAMMPS units to requested units
lammps_step.metadata module#
This file contains metadata to help describe the results of LAMMPS calculations, etc.
- lammps_step.metadata.metadata = {'results': {'Eke': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Eke,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of kinetic energy sampling', 'dimensionality': 'scalar', 'property': 'kinetic energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Eke,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Eke,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Epair': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'nonbonded (vdW & electrostatic) energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'kcal/mol'}, 'Epair,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of nonbond energy sampling', 'dimensionality': 'scalar', 'type': 'float', 'units': ''}, 'Epair,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of nonbond energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'kcal/mol'}, 'Epair,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of nonbond energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'fs'}, 'Epe': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'potential energy', 'dimensionality': 'scalar', 'property': 'potential energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Epe,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of potential energy sampling', 'dimensionality': 'scalar', 'property': 'potential energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Epe,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of potential energy', 'dimensionality': 'scalar', 'property': 'potential energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Epe,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of potential energy', 'dimensionality': 'scalar', 'property': 'potential energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Etot': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'total energy', 'dimensionality': 'scalar', 'property': 'total energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Etot,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of total energy sampling', 'dimensionality': 'scalar', 'property': 'total energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Etot,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of total energy', 'dimensionality': 'scalar', 'property': 'total energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Etot,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of total energy', 'dimensionality': 'scalar', 'property': 'total energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'P': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'pressure', 'dimensionality': 'scalar', 'property': 'pressure#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'P,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of pressure sampling', 'dimensionality': 'scalar', 'property': 'pressure, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'P,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of pressure', 'dimensionality': 'scalar', 'property': 'pressure, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'P,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of pressure', 'dimensionality': 'scalar', 'property': 'pressure, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'T': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'temperature', 'dimensionality': 'scalar', 'property': 'temperature#LAMMPS#{model}', 'type': 'float', 'units': 'K'}, 'T,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of temperature sampling', 'dimensionality': 'scalar', 'property': 'temperature, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'T,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of temperature', 'dimensionality': 'scalar', 'property': 'temperature, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'K'}, 'T,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of temperature', 'dimensionality': 'scalar', 'property': 'temperature, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'V': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'V', 'dimensionality': 'scalar', 'property': 'volume#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'V,inefficiency': {'calculation': ['npt'], 'description': 'statistical inefficiency of V sampling', 'dimensionality': 'scalar', 'property': 'volume, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'V,stderr': {'calculation': ['npt'], 'description': 'stderr of V', 'dimensionality': 'scalar', 'property': 'volume, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'V,tau': {'calculation': ['npt'], 'description': 'autocorrelation time of V', 'dimensionality': 'scalar', 'property': 'volume, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'a': {'calculation': ['nve', 'nvt', 'npt'], 'description': "cell parameter 'a'", 'dimensionality': 'scalar', 'property': 'cell_a#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'a,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'a' sampling", 'dimensionality': 'scalar', 'property': 'cell_a, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'a,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'a'", 'dimensionality': 'scalar', 'property': 'cell_a, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'a,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'a'", 'dimensionality': 'scalar', 'property': 'cell_a, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'b': {'calculation': ['nve', 'nvt', 'npt'], 'description': "cell parameter 'b'", 'dimensionality': 'scalar', 'property': 'cell_b#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'b,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'b' sampling", 'dimensionality': 'scalar', 'property': 'cell_b, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'b,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'b'", 'dimensionality': 'scalar', 'property': 'cell_b, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'b,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'b'", 'dimensionality': 'scalar', 'property': 'cell_b, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'c': {'calculation': ['nve', 'nvt', 'npt'], 'description': "cell parameter 'c'", 'dimensionality': 'scalar', 'property': 'cell_c#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'c,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'c' sampling", 'dimensionality': 'scalar', 'property': 'cell_c, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'c,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'c'", 'dimensionality': 'scalar', 'property': 'cell_c, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'c,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'c'", 'dimensionality': 'scalar', 'property': 'cell_c, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'density': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'density', 'dimensionality': 'scalar', 'property': 'density#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'density,inefficiency': {'calculation': ['npt'], 'description': 'statistical inefficiency of density sampling', 'dimensionality': 'scalar', 'property': 'density, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'density,stderr': {'calculation': ['npt'], 'description': 'stderr of density', 'dimensionality': 'scalar', 'property': 'density, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'density,tau': {'calculation': ['npt'], 'description': 'autocorrelation time of density', 'dimensionality': 'scalar', 'property': 'density, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'energy': {'calculation': ['energy'], 'description': 'The total energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'kcal/mol'}, 'gradients': {'calculation': ['energy'], 'description': 'The gradients', 'dimensionality': '[3, n_atoms]', 'type': 'float', 'units': 'kcal/mol/Å'}, 'natoms_npt': {'calculation': ['npt'], 'description': 'The number of atoms in the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'natoms_nve': {'calculation': ['nve'], 'description': 'The number of atoms in the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'natoms_nvt': {'calculation': ['nvt'], 'description': 'The number of atoms in the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_npt': {'calculation': ['npt'], 'description': 'The number of processors for the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_nve': {'calculation': ['nve'], 'description': 'The number of processors for the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_nvt': {'calculation': ['nvt'], 'description': 'The number of processors for the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_npt': {'calculation': ['npt'], 'description': 'The number of steps in the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_nve': {'calculation': ['nve'], 'description': 'The number of steps in the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_nvt': {'calculation': ['nvt'], 'description': 'The number of steps in the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 't_lammps_wall': {'calculation': ['energy', 'minimization', 'nve', 'nvt', 'npt'], 'description': 'The wall clock time for LAMMPS', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}, 't_npt': {'calculation': ['npt'], 'description': 'The time for the NPT step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}, 't_nve': {'calculation': ['nve'], 'description': 'The time for the NVE step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}, 't_nvt': {'calculation': ['nvt'], 'description': 'The time for the NVT step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}}}#
Properties that LAMMPS produces, depending on the type of calculation.
lammps_step.minimization module#
Minimization step in LAMMPS
lammps_step.minimization_step module#
Main module.
lammps_step.npt module#
NPT (canonical) dynamics in LAMMPS
- class lammps_step.npt.NPT(flowchart=None, title='NPT dynamics', extension=None)[source]#
Bases:
NVT
- describe(indent='', json_dict=None)[source]#
Write out information about what this node will do If json_dict is passed in, add information to that dictionary so that it can be written out by the controller as appropriate.
- description_text(P=None)[source]#
Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.
- get_pressure_text(P, keep_orthorhombic)[source]#
Work out and return the pressure/stress part of the ‘fix npt’ or ‘fix berendsen’ in LAMMPS
- methods = {'Berendsen': {'documentation': 'https://lammps.sandia.gov/doc/fix_press_berendsen.html', 'references': ['Berendsen']}, 'Nose-Hoover': {'documentation': 'https://lammps.sandia.gov/doc/fix_nh.html#fix-npt-command', 'references': ['Shinoda', 'Tuckerman']}}#
lammps_step.npt_parameters module#
Control parameters for NPT (canonical) dynamics
- class lammps_step.npt_parameters.NPT_Parameters(defaults={}, data=None)[source]#
Bases:
NVT_Parameters
The control parameters for NPT dynamics in LAMMPS
- parameters = {'Panneal': {'default': 'no', 'description': 'Change pressure with time', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Change the pressure linearly with time during the run, i.e. anneal the system.', 'kind': 'boolean'}, 'Pdamp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Pfinal': {'default': 1.0, 'default_units': 'atm', 'description': 'Final pressure:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The final pressure.', 'kind': 'float'}, 'Pinitial': {'default': 1.0, 'default_units': 'atm', 'description': 'Initial pressure:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The initial pressure.', 'kind': 'float'}, 'Sxx damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Sxx damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxx,final': {'default': 1.0, 'default_units': 'atm', 'description': 'Sxx final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxx,initial': {'default': 1.0, 'default_units': 'atm', 'description': 'Sxx initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Sxy damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Sxy damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxy,final': {'default': 0.0, 'default_units': 'atm', 'description': 'Sxy final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxy,initial': {'default': 0.0, 'default_units': 'atm', 'description': 'Sxy initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Sxz damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Sxz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxz,final': {'default': 0.0, 'default_units': 'atm', 'description': 'Sxz final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxz,initial': {'default': 0.0, 'default_units': 'atm', 'description': 'Sxz initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Syy damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Syy damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Syy,final': {'default': 1.0, 'default_units': 'atm', 'description': 'Syy final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Syy,initial': {'default': 1.0, 'default_units': 'atm', 'description': 'Syy initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Syz damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Syz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Syz,final': {'default': 0.0, 'default_units': 'atm', 'description': 'Syz final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Syz,initial': {'default': 0.0, 'default_units': 'atm', 'description': 'Syz initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Szz damp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Szz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Szz,final': {'default': 1.0, 'default_units': 'atm', 'description': 'Szz final:', 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Szz,initial': {'default': 1.0, 'default_units': 'atm', 'description': 'Szz initial:', 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'barostat': {'default': 'Nose-Hoover', 'description': 'Barostat:', 'enumeration': ('Nose-Hoover', 'Berendsen'), 'format_string': 's', 'help_text': 'The barostat used to control the pressure', 'kind': 'string'}, 'couple': {'default': 'x, y and z', 'description': 'Directions to couple:', 'enumeration': ('x, y and z', 'x and y', 'x and z', 'y and z', 'none'), 'format_string': 's', 'help_text': 'The stress in these directions will be averaged and the cell dilated in fixed proportions in these directions.', 'kind': 'enumeration'}, 'keep orthorhombic': {'default': 'yes', 'description': 'Let cell become non-orthorhombic', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Whether the call angles can change from 90 degrees.', 'kind': 'boolean'}, 'modulus': {'default': 50.0, 'default_units': 'GPa', 'description': 'Bulk modulus:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The bulk modulus. For liquids a typical modulus ranges from a fraction of a GPa to a few GPa. For crystalline solids, 25-500 GPa is a reasonable range.', 'kind': 'float'}, 'mtk': {'default': 'yes', 'description': 'Use corrected Hoover barostat', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Include the correction terms due to Martyna, Tuckerman, and Klein in the equations of motion. If not, the original Hoover barostat is used, whose volume probability distribution function differs from the true NPT and NPH ensembles by a factor of 1/V. By default the correct equations are used, but in many cases the difference is negligible.', 'kind': 'boolean'}, 'nreset': {'default': 'never', 'default_units': None, 'description': 'Frequency to reset reference cell:', 'enumeration': ('never',), 'format_string': 'd', 'help_text': 'How often, in number of steps, to reset the reference cell for the strain energy.', 'kind': 'integer'}, 'system type': {'default': 'fluid', 'description': 'Type of system:', 'enumeration': ('fluid', 'solid'), 'format_string': 's', 'help_text': 'Whether the system is a fluid, which flows under shear stress, or a solid, which can resist small shear stresses.', 'kind': 'string'}, 'use_stress': {'default': 'isotropic pressure', 'description': 'Apply', 'enumeration': ('isotropic pressure', 'general stress'), 'format_string': 's', 'help_text': 'Specify whether to apply (isotropic) pressure to the system or explicit stresses for each different direction.', 'kind': 'enumeration'}}#
lammps_step.npt_step module#
Main module.
lammps_step.nve module#
NVE (microcanonical) dynamics in LAMMPS
- class lammps_step.nve.NVE(flowchart=None, title='NVE dynamics', extension=None, logger=<Logger lammps_step.nve (WARNING)>)[source]#
Bases:
Energy
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- timestep(value)[source]#
Get the timestep in the correct units.
This handles the ‘normal’, ‘accurate’ and ‘coarse’ values, which depend on the mass in an empirical fashion.
- Parameters:
value (str or Pint quantity) – The desired timestep, which may be a Pint quantity with units or one of ‘notmal’, ‘accurate but slow’, or ‘coarse but fast’
- Returns:
timestep – The magnitude of the time step in the appropriate LAMMPS units
- Return type:
float
- trajectory_input(P, timestep, nsteps, ncomputes, ndumps, nfixes)[source]#
Create the part of the input handling the trajectories.
- Parameters:
P (dict) – The dictionary of options
timestep (int) – The timestep in LAMMPS units
nsteps (int) – Total number of steps in the run
ncomputes (int) – The counter for the computes
ndumps (int) – The counter for the dumps
nfixes (int) – The counter for the fixes
- Returns:
[str] – The input lines as array
int – The counter for the computes
int – The counter for the dumps
int – The counter for the fixes
lammps_step.nve_parameters module#
Control parameters for NVE (microcanonical) dynamics
- class lammps_step.nve_parameters.NVE_Parameters(defaults={}, data=None)[source]#
Bases:
EnergyParameters
The control parameters for NVE dynamics in LAMMPS
- parameters = {'control_properties': {'default': {}, 'default_units': None, 'description': 'Convergence properties', 'enumeration': (), 'format_string': '', 'help_text': 'The properties to converge when controlling the run automatically.', 'kind': 'special', 'widget': 'seamm_widgets.PropertyTable'}, 'maximum_time': {'default': 1.0, 'default_units': 'ns', 'description': 'Maximum simulation time:', 'format_string': '.1f', 'help_text': 'The maximum time to simulate when converging properties.', 'kind': 'float'}, 'run_control': {'default': 'For a fixed length of simulated time.', 'default_units': None, 'description': 'How long to run? ', 'enumeration': ('Until properties converge to the requested accuracy.', 'For a fixed length of simulated time.'), 'format_string': '', 'help_text': 'How to determine when to stop the simulation. You can give a fixed length of simulation time, e.g. 15 ps, or you can ask to run long enough to determine one or more properties to a given accuracy.', 'kind': 'enumeration'}, 'sampling': {'default': '50', 'default_units': 'fs', 'description': 'Sampling frequency:', 'enumeration': ('none',), 'format_string': '.1f', 'help_text': 'How often to sample the energy, temperature, etc. during the dynamics run. This controls writing to the trajectory files. Faster gives more fidelity to a point, but increases the file size and slows the calculation down.\nYou can ask for no sampling, give a specific interval, or allow the system the choose for you.', 'kind': 'float'}, 'time': {'default': 100.0, 'default_units': 'ps', 'description': 'Simulation time:', 'format_string': '.1f', 'help_text': 'The time to simulate in the dynamics run.', 'kind': 'float'}, 'timestep': {'default': 'normal', 'default_units': 'fs', 'description': 'Timestep:', 'enumeration': ('normal', 'accurate but slow', 'coarse but fast'), 'format_string': '.1f', 'help_text': 'The time step for the numerical integration in the dynamics. 1 fs is safe for most systems, except perhaps at high temperatures. For systems without hydrogen, helium, lithium or other light elements, 2-4 fs steps are reasonable. The timestep needs to be less than 1/10 the highest frequency. 10^14 Hz is a period if 10 fs, and corresponds to a frequency of 3,300 wavenumbers or a wavelength of 3 micrometers.\nYou can enter a value or use the choices, which pick a reasonable timestep based on the calculation.', 'kind': 'float'}}#
- trajectories = {'atomic positions': {'default': 'never', 'description': 'Sample the atom positions:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the positions of the atoms, which can be used for diffusion calculations.', 'kind': 'string'}, 'atomic positions number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the positions of the atoms to collect', 'kind': 'integer'}, 'atomic positions rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the positions of the atoms', 'kind': 'float'}, 'atomic velocities': {'default': 'never', 'description': 'Sample the atom velocities:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the velocities of the atoms, which can be used for diffusion calculations.', 'kind': 'string'}, 'atomic velocities number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the velocities of the atoms to collect', 'kind': 'integer'}, 'atomic velocities rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the velocities of the atoms', 'kind': 'float'}, 'com positions': {'default': 'never', 'description': "Sample the positions of the molecules' COM:", 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': "How to sample the positions of the molecules' COM, which can be used for diffusion calculations.", 'kind': 'string'}, 'com positions number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the positions of the centers of mass of the molecules to collect', 'kind': 'integer'}, 'com positions rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the positions of the centers of mass of the molecules', 'kind': 'float'}, 'com velocities': {'default': 'never', 'description': "Sample the velocities of the molecules' COM:", 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': "How to sample the velocities of the molecules' COM, which can be used for diffusion calculations.", 'kind': 'string'}, 'com velocities number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the velocities of the centers of mass of the molecules to collect', 'kind': 'integer'}, 'com velocities rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the velocities of the centers of mass of the molecules', 'kind': 'float'}, 'heat flux': {'default': 'never', 'description': 'Sample the heat flux:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the heat flux, usually used for thermal conductivity calculations. However, it is recommended to use the heat-flux step instead of using this.', 'kind': 'string'}, 'heat flux number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the heat flux to collect', 'kind': 'integer'}, 'heat flux rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the heat flux', 'kind': 'float'}, 'shear stress': {'default': 'never', 'description': 'Sample the shear stress:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the shear stress, usually used for viscosity calculations.', 'kind': 'string'}, 'shear stress number of samples': {'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the shear stress to collect', 'kind': 'integer'}, 'shear stress rate': {'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the shear stress', 'kind': 'float'}, 'use centroid stress': {'default': 'yes', 'default_units': None, 'description': 'Use centroid/stress/atom:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use centroid/stress/atom', 'kind': 'boolean'}}#
lammps_step.nve_step module#
Main module.
lammps_step.nvt module#
NVT (canonical) dynamics in LAMMPS
- class lammps_step.nvt.NVT(flowchart=None, title='NVT dynamics', extension=None, logger=<Logger lammps_step.nvt (WARNING)>)[source]#
Bases:
NVE
- describe(indent='', json_dict=None)[source]#
Write out information about what this node will do If json_dict is passed in, add information to that dictionary so that it can be written out by the controller as appropriate.
lammps_step.nvt_parameters module#
Control parameters for NVT (canonical) dynamics
- class lammps_step.nvt_parameters.NVT_Parameters(defaults={}, data=None)[source]#
Bases:
NVE_Parameters
The control parameters for NVT dynamics in LAMMPS
- parameters = {'T0': {'default': 298.15, 'default_units': 'K', 'description': 'Temperature:', 'format_string': '.2f', 'help_text': 'The temperature, or initial temperature for simulated annealing.', 'kind': 'float'}, 'T1': {'default': 298.15, 'default_units': 'K', 'description': 'Final temperature:', 'format_string': '.2f', 'help_text': 'The final temperature for simulated annealing.', 'kind': 'float'}, 'Tchain': {'default': 3, 'default_units': None, 'description': 'Thermostat chain:', 'format_string': 'd', 'help_text': 'The number of thermostats in the chain.', 'kind': 'integer'}, 'Tdamp': {'default': 100.0, 'default_units': 'fs', 'description': 'Damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for thermostat', 'kind': 'float'}, 'Tloop': {'default': 1, 'default_units': None, 'description': 'Thermostat iterations:', 'format_string': 'd', 'help_text': 'The number of sub-iterations for the thermostat.', 'kind': 'integer'}, 'drag': {'default': 0.0, 'default_units': None, 'description': 'Drag:', 'format_string': '.1f', 'help_text': 'The amount of drag to apply on the thermostat and barostat if the pressure is controlled. Typically a value of 0.2 - 2.0 is appropriate.', 'kind': 'float'}, 'fraction': {'default': 1.0, 'default_units': None, 'description': 'Fraction to scale:', 'format_string': '.1f', 'help_text': 'The fraction of the temperature difference to correct by scaling the velocities.', 'kind': 'float'}, 'frequency': {'default': 100.0, 'default_units': 'fs', 'description': 'Rescaling frequency:', 'format_string': '.1f', 'help_text': 'The frequency (in time units) for the thermostat to operate.', 'kind': 'float'}, 'seed': {'default': 'random', 'default_units': None, 'description': 'Random seed:', 'enumeration': ('random',), 'format_string': '', 'help_text': "The seed for the random number generator.'random' means to generate a random integer as the seed.", 'kind': 'integer'}, 'thermostat': {'default': 'Nose-Hoover', 'description': 'Thermostat:', 'enumeration': ('Nose-Hoover', 'Berendsen', 'canonical sampling, velocity rescaling (csvr)', 'canonical sampling, langevin dynamics (csld)', 'velocity rescaling', 'Langevin'), 'format_string': 's', 'help_text': 'The thermostat used to control the temperature.', 'kind': 'string'}, 'window': {'default': 20.0, 'default_units': 'K', 'description': 'Temperature window:', 'format_string': '.1f', 'help_text': 'The temperature window to use when rescaling.When the instantaneous temperature is outside the temperature window, the velocities will be rescaled.', 'kind': 'float'}}#
lammps_step.nvt_step module#
Main module.
lammps_step.tk_custom module#
The graphical part of a LAMMPS Custom step
lammps_step.tk_energy module#
The graphical part of a LAMMPS Energy step
lammps_step.tk_heat_flux module#
The graphical part of a Heat Flux step
- class lammps_step.tk_heat_flux.TkHeatFlux(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#
Bases:
TkNVE
The graphical part of a Heat Flux step in a flowchart.
- tk_flowchart#
The flowchart that we belong to.
- Type:
TkFlowchart = None
- node#
The corresponding node of the non-graphical flowchart
- Type:
Node = None
- canvas#
The Tk Canvas to draw on
- Type:
tkCanvas = None
- dialog#
The Pmw dialog object
- Type:
Dialog
- x#
The x-coordinate of the center of the picture of the node
- Type:
int = None
- y#
The y-coordinate of the center of the picture of the node
- Type:
int = None
- w#
The width in pixels of the picture of the node
- Type:
int = 200
- h#
The height in pixels of the picture of the node
- Type:
int = 50
- self[widget]#
A dictionary of tk widgets built using the information contained in Heat Flux_parameters.py
- Type:
dict
See also
HeatFlux
,TkHeatFlux
,HeatFluxParameters
- create_dialog()[source]#
Create the dialog. A set of widgets will be chosen by default based on what is specified in the Heat Flux_parameters module.
- Parameters:
None
- Return type:
None
See also
- reset_dialog(widget=None)[source]#
Layout the widgets in the dialog.
The widgets are chosen by default from the information in Heat Flux_parameter.
This function simply lays them out row by row with aligned labels. You may wish a more complicated layout that is controlled by values of some of the control parameters. If so, edit or override this method
- Parameters:
widget (Tk Widget = None)
- Return type:
None
See also
lammps_step.tk_initialization module#
The graphical part of a LAMMPS Initialization step
- class lammps_step.tk_initialization.TkInitialization(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_initialization (WARNING)>)[source]#
Bases:
TkNode
lammps_step.tk_lammps module#
The graphical part of a LAMMPS step
- class lammps_step.tk_lammps.TkLAMMPS(tk_flowchart=None, node=None, namespace='org.molssi.seamm.lammps.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#
Bases:
TkNode
The node_class is the class of the ‘real’ node that this class is the Tk graphics partner for
lammps_step.tk_minimization module#
The graphical part of a LAMMPS minimization step
lammps_step.tk_npt module#
The graphical part of a LAMMPS Energy step
- class lammps_step.tk_npt.TkNPT(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#
Bases:
TkNVT
- create_dialog(title='Edit NPT dynamics parameters')[source]#
Create the edit dialog!
This is reasonably complicated, so a bit of description is in order. The superclasses NVT and NVE create the dialog along with the basic runtime and timestep (from NVE) and the setting the temperature and thermostat (NVT).
This method adds a third frame with the pressure and barostat.
The layout is handled in part by the NVT superclass, which handles the temperature frame. Our part is handled by three methods:
reset_dialog does the general layout of the large blocks
reset_pressure_frame handles the layout of the pressure section except for the detail of the actual pressure/stress which is handled by…
reset_stress_frame which does the detailed layout of their stress or pressure terms, depending on whether we are annealing, and the coupling between directions.
- handle_dialog(result)[source]#
Handle when the user clicks a button on the dialog, which can either be ‘Cancel’, ‘Help’ or ‘OK’, or they can close the dialog with the ‘x’ button == ‘Cancel’
- reset_pressure_frame(widget=None)[source]#
Layout the widgets for the pressure/stress control as needed for the current state
- reset_stress_frame(widget=None)[source]#
Layout the widgets for the pressure/stress as needed for the current state.
We use labels across the top and left side of the table of stresses, then hide the labels and units of all the entries, except for the last entry in the row, which displays the units too.
It is a bit tricky getting the column labels to lign up for the last item in the row because it is wider with the units displaying. The weird stuff with the columnspan=3 and setting the ‘uniform’ attribute of the columns does this. There might be better ways, but this works … just be careful changing it :-).
lammps_step.tk_nve module#
The graphical part of a LAMMPS Energy step
lammps_step.tk_nvt module#
The graphical part of a LAMMPS NVT dynamics step
- class lammps_step.tk_nvt.TkNVT(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_nvt (WARNING)>)[source]#
Bases:
TkNVE
- create_dialog(title='Edit NVT dynamics parameters')[source]#
Create the edit dialog!
This is reasonably complicated, so a bit of description is in order. The superclass NVE creates the dialog along with the basic runtime and timestep.
This method adds a second frame for setting the temperature and thermostat (this is the T part of NVT).
The layout is handled in part by the NVT superclass, which handles the temperature frame. Our part is handled by two methods:
reset_dialog does the general layout of the large blocks
reset_temperature_frame handles the layout of the temperature section except
lammps_step.tk_velocities module#
The graphical part of a LAMMPS velocities step
lammps_step.velocities module#
Set the velocities on the atoms
- class lammps_step.velocities.Velocities(flowchart=None, title='Velocities', extension=None)[source]#
Bases:
Node
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property version#
The semantic version of this module.
lammps_step.velocities_parameters module#
Control parameters for NVT (canonical) dynamics
- class lammps_step.velocities_parameters.VelocitiesParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for NVT dynamics in LAMMPS
- parameters = {'T': {'default': 298.15, 'default_units': 'K', 'description': 'Temperature:', 'format_string': '.2f', 'help_text': 'The temperature corresponding to the velocities.', 'kind': 'float'}, 'method': {'default': 'using a random distribution', 'description': 'Set the temperature', 'enumeration': ('using a random distribution', 'scaling current velocities'), 'format_string': 's', 'help_text': 'The method to use to adjuust the velocities and hence the temperature.', 'kind': 'enumeration'}, 'remove_momentum': {'default': 'remove any translational and, for molecular systems, rotational momentum (default).', 'description': 'Momentum:', 'enumeration': ('remove any translational and, for molecular systems, rotational momentum (default)', 'remove translational but not rotational momentum', 'remove rotational but not translational momentum', 'remove both translational and rotational momentum', 'remove neither translational nor rotational momentum'), 'format_string': 's', 'help_text': 'Ensure that there is no overall linear momentum so the system does not translate.', 'kind': 'enumeration'}, 'seed': {'default': 'random', 'default_units': None, 'description': 'Random seed:', 'enumeration': ('random',), 'format_string': '', 'help_text': "The seed for the random number generator.'random' means to generate a random integer as the seed.", 'kind': 'integer'}}#
lammps_step.velocities_step module#
Main module.
Module contents#
lammps_step A step for running molecular dynamics using LAMMPS.