relax_static.py
Calculation functions
- relax_static(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, dispmult: float = 0.0, etol: float = 0.0, ftol: float = 0.0, maxiter: int = 100000, maxeval: int = 1000000, dmax: float = 0.01, maxcycles: int = 100, ctol: float = 1e-10) dict
Repeatedly runs the ELASTIC example distributed with LAMMPS until box dimensions converge within a tolerance.
- 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.
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).
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).
dispmult (float, optional) – Multiplier for applying a random displacement to all atomic positions prior to relaxing. Default value is 0.0.
etol (float, optional) – The energy tolerance for the structure minimization. This value is unitless. (Default is 0.0).
ftol (float, optional) – The force tolerance for the structure minimization. This value is in units of force. (Default is 0.0).
maxiter (int, optional) – The maximum number of minimization iterations to use (default is 10000).
maxeval (int, optional) – The maximum number of minimization evaluations to use (default is 100000).
dmax (float, optional) – The maximum distance in length units that any atom is allowed to relax in any direction during a single minimization iteration (default is 0.01 Angstroms).
pressure_unit (str, optional) – The unit of pressure to calculate the elastic constants in (default is ‘GPa’).
maxcycles (int, optional) – The maximum number of times the minimization algorithm is called. Default value is 100.
ctol (float, optional) – The relative tolerance used to determine if the lattice constants have converged (default is 1e-10).
- 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.
’lx’ (float) - The relaxed lx box length.
’ly’ (float) - The relaxed ly box length.
’lz’ (float) - The relaxed lz box length.
’xy’ (float) - The relaxed xy box tilt.
’xz’ (float) - The relaxed xz box tilt.
’yz’ (float) - The relaxed yz box tilt.
’E_pot’ (float) - The potential energy per atom for the final configuration.
’measured_pxx’ (float) - The measured x tensile pressure component for the final configuration.
’measured_pyy’ (float) - The measured y tensile pressure component for the final configuration.
’measured_pzz’ (float) - The measured z tensile pressure component for the final configuration.
’measured_pxy’ (float) - The measured xy shear pressure component for the final configuration.
’measured_pxz’ (float) - The measured xz shear pressure component for the final configuration.
’measured_pyz’ (float) - The measured yz shear pressure component for the final configuration.
- Return type: