relax_dynamic.py

Calculation functions

integrator_info(integrator: str | None = None, p_xx: float = 0.0, p_yy: float = 0.0, p_zz: float = 0.0, p_xy: float = 0.0, p_xz: float = 0.0, p_yz: float = 0.0, temperature: float = 0.0, velocity_temperature: float | None = None, randomseed: int | None = None, units: str = 'metal', lammps_date=None) str

Generates LAMMPS commands for velocity creation and fix integrators.

Parameters:
  • integrator (str or None, optional) – The integration method to use. Options are ‘npt’, ‘nvt’, ‘nph’, ‘nve’, ‘nve+l’, ‘nph+l’. The +l options use Langevin thermostat. (Default is None, which will use ‘nph+l’ for temperature == 0, and ‘npt’ otherwise.)

  • p_xx (float, optional) – The value to relax the x tensile pressure component to (default is 0.0).

  • p_yy (float, optional) – The value to relax the y tensile pressure component to (default is 0.0).

  • p_zz (float, optional) – The value to relax the z tensile pressure component to (default is 0.0).

  • p_xy (float, optional) – The value to relax the xy shear pressure component to (default is 0.0).

  • p_xz (float, optional) – The value to relax the xz shear pressure component to (default is 0.0).

  • p_yz (float, optional) – The value to relax the yz shear pressure component to (default is 0.0).

  • temperature (float, optional) – The temperature to relax at (default is 0.0).

  • velocity_temperature (float or None, optional) – The temperature to use for generating initial atomic velocities with integrators containing thermostats. If None (default) then it will be set to 2 * temperature + 1. If 0.0 then the velocities will not be (re)set.

  • randomseed (int or None, optional) – Random number seed used by LAMMPS in creating velocities and with the Langevin thermostat. (Default is None which will select a random int between 1 and 900000000.)

  • units (str, optional) – The LAMMPS units style to use (default is ‘metal’).

Returns:

The generated LAMMPS input lines for velocity create and fix integration commands.

Return type:

str

relax_dynamic(lammps_command: str, system: System, potential: Potential, mpi_command: str | None = None, p_xx: float = 0.0, p_yy: float = 0.0, p_zz: float = 0.0, p_xy: float = 0.0, p_xz: float = 0.0, p_yz: float = 0.0, temperature: float = 0.0, integrator: str | None = None, runsteps: int = 220000, thermosteps: int = 100, dumpsteps: int | None = None, restartsteps: int | None = None, equilsteps: int = 20000, randomseed: int | None = None) dict

Performs a full dynamic relax on a given system at the given temperature to the specified pressure state.

Parameters:
  • lammps_command (str) – Command for running LAMMPS.

  • system (atomman.System) – The system to perform the calculation on.

  • potential (atomman.lammps.Potential) – The LAMMPS implemented potential to use.

  • symbols (list of str) – The list of element-model symbols for the Potential that correspond to system’s atypes.

  • mpi_command (str, optional) – The MPI command for running LAMMPS in parallel. If not given, LAMMPS will run serially.

  • p_xx (float, optional) – The value to relax the x tensile pressure component to (default is 0.0).

  • p_yy (float, optional) – The value to relax the y tensile pressure component to (default is 0.0).

  • p_zz (float, optional) – The value to relax the z tensile pressure component to (default is 0.0).

  • temperature (float, optional) – The temperature to relax at (default is 0.0).

  • runsteps (int, optional) – The number of integration steps to perform (default is 220000).

  • integrator (str or None, optional) – The integration method to use. Options are ‘npt’, ‘nvt’, ‘nph’, ‘nve’, ‘nve+l’, ‘nph+l’. The +l options use Langevin thermostat. (Default is None, which will use ‘nph+l’ for temperature == 0, and ‘npt’ otherwise.)

  • thermosteps (int, optional) – Thermo values will be reported every this many steps (default is 100).

  • dumpsteps (int or None, optional) – Dump files will be saved every this many steps (default is None, which sets dumpsteps equal to runsteps).

  • restartsteps (int or None, optional) – Restart files will be saved every this many steps (default is None, which sets restartsteps equal to runsteps).

  • equilsteps (int, optional) – The number of timesteps at the beginning of the simulation to exclude when computing average values (default is 20000).

  • randomseed (int or None, optional) – Random number seed used by LAMMPS in creating velocities and with the Langevin thermostat. (Default is None which will select a random int between 1 and 900000000.)

Returns:

Dictionary of results consisting of keys:

  • ’dumpfile_initial’ (str) - The name of the initial dump file created.

  • ’symbols_initial’ (list) - The symbols associated with the initial dump file.

  • ’dumpfile_final’ (str) - The name of the final dump file created.

  • ’symbols_final’ (list) - The symbols associated with the final dump file.

  • ’nsamples’ (int) - The number of thermodynamic samples included in the mean and standard deviation estimates. Can also be used to estimate standard error values assuming that the thermo step size is large enough (typically >= 100) to assume the samples to be independent.

  • ’E_pot’ (float) - The mean measured potential energy.

  • ’measured_pxx’ (float) - The measured x tensile pressure of the relaxed system.

  • ’measured_pyy’ (float) - The measured y tensile pressure of the relaxed system.

  • ’measured_pzz’ (float) - The measured z tensile pressure of the relaxed system.

  • ’measured_pxy’ (float) - The measured xy shear pressure of the relaxed system.

  • ’measured_pxz’ (float) - The measured xz shear pressure of the relaxed system.

  • ’measured_pyz’ (float) - The measured yz shear pressure of the relaxed system.

  • ’temp’ (float) - The mean measured temperature.

  • ’E_pot_std’ (float) - The standard deviation in the measured potential energy values.

  • ’measured_pxx_std’ (float) - The standard deviation in the measured x tensile pressure of the relaxed system.

  • ’measured_pyy_std’ (float) - The standard deviation in the measured y tensile pressure of the relaxed system.

  • ’measured_pzz_std’ (float) - The standard deviation in the measured z tensile pressure of the relaxed system.

  • ’measured_pxy_std’ (float) - The standard deviation in the measured xy shear pressure of the relaxed system.

  • ’measured_pxz_std’ (float) - The standard deviation in the measured xz shear pressure of the relaxed system.

  • ’measured_pyz_std’ (float) - The standard deviation in the measured yz shear pressure of the relaxed system.

  • ’temp_std’ (float) - The standard deviation in the measured temperature values.

Return type:

dict