dislocation_monopole.py

Calculation functions

anneal_info(temperature: float = 0.0, runsteps: int | None = None, randomseed: int | None = None, units: str = 'metal') str

Generates LAMMPS commands for thermo anneal.

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

  • 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 performing a dynamic relax. Will be ‘’ if temperature==0.0.

Return type:

str

disl_relax(lammps_command: str, system: System, potential: Potential, mpi_command: str | None = None, annealtemp: float = 0.0, annealsteps: int | None = None, randomseed: int | None = None, etol: float = 0.0, ftol: float = 1e-06, maxiter: int = 10000, maxeval: int = 100000, dmax: float = 0.01) dict

Sets up and runs the disl_relax.in LAMMPS script for relaxing a dislocation monopole system.

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.

  • annealtemp (float, optional) – The temperature to perform a dynamic relaxation at. Default is 0.0, which will skip the dynamic relaxation.

  • annealsteps (int, optional) – The number of time steps to run the dynamic relaxation for. Default is None, which will run for 10000 steps if annealtemp is not 0.0.

  • 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.

  • 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.

Returns:

Dictionary of results consisting of keys:

  • ’logfile’ (str) - The name of the LAMMPS log file.

  • ’dumpfile’ (str) - The name of the LAMMPS dump file for the relaxed system.

  • ’E_total’ (float) - The total potential energy for the relaxed system.

Return type:

dict

dislocation_monopole(lammps_command: str, ucell: System, potential: Potential, C: ElasticConstants, burgers: list | ndarray, ξ_uvw: list | ndarray, slip_hkl: list | ndarray, mpi_command: str | None = None, m: list | ndarray = [0, 1, 0], n: list | ndarray = [0, 0, 1], sizemults=None, amin: float = None, bmin: float = None, cmin: float = None, shift: list | ndarray | None = None, shiftscale: bool = False, shiftindex: int = None, tol: float = 1e-08, etol: float = 0.0, ftol: float = 0.0, maxiter: int = 10000, maxeval: int = 100000, dmax: float = 0.01, annealtemp: float = 0.0, annealsteps: int | None = None, randomseed: int | None = None, boundaryshape: str = 'cylinder', boundarywidth: float = 0.0, boundaryscale: bool = False) dict

Creates and relaxes a dislocation monopole system.

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

  • ucell (atomman.System) – The unit cell to use as the seed for generating the dislocation monopole system.

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

  • C (atomman.ElasticConstants) – The elastic constants associated with the bulk crystal structure for ucell.

  • burgers (array-like object) – The dislocation’s Burgers vector given as a Miller or Miller-Bravais vector relative to ucell.

  • ξ_uvw (array-like object) – The dislocation’s line direction given as a Miller or Miller-Bravais vector relative to ucell.

  • slip_hkl (array-like object) – The dislocation’s slip plane given as a Miller or Miller-Bravais plane relative to ucell.

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

  • m (array-like object, optional) – The m unit vector for the dislocation solution. m, n, and ξ (dislocation line) should be right-hand orthogonal. Default value is [0,1,0] (y-axis).

  • n (array-like object, optional) – The n unit vector for the dislocation solution. m, n, and ξ (dislocation line) should be right-hand orthogonal. Default value is [0,0,1] (z-axis). n is normal to the dislocation slip plane.

  • sizemults (tuple, optional) – The size multipliers to use when generating the system. Values are limited to being positive integers. The multipliers for the two non-periodic directions must be even. If not given, the default multipliers will be 2 for the non-periodic directions and 1 for the periodic direction.

  • amin (float, optional) – A minimum thickness to use for the a box vector direction of the final system. Default value is 0.0. For the non-periodic directions, the resulting vector multiplier will be even. If both amin and sizemults is given, then the larger multiplier for the two will be used.

  • bmin (float, optional) – A minimum thickness to use for the b box vector direction of the final system. Default value is 0.0. For the non-periodic directions, the resulting vector multiplier will be even. If both bmin and sizemults is given, then the larger multiplier for the two will be used.

  • cmin (float, optional) – A minimum thickness to use for the c box vector direction of the final system. Default value is 0.0. For the non-periodic directions, the resulting vector multiplier will be even. If both cmin and sizemults is given, then the larger multiplier for the two will be used.

  • shift (float, optional) – A rigid body shift to apply to the rotated cell prior to inserting the dislocation. Should be selected such that the ideal slip plane does not correspond to any atomic planes. Is taken as absolute if shiftscale is False, or relative to the rotated cell’s box vectors if shiftscale is True. Cannot be given with shiftindex. If neither shift nor shiftindex is given then shiftindex = 0 is used.

  • shiftindex (float, optional) – The index of the identified optimum shifts based on the rotated cell to use. Different values allow for the selection of different atomic planes neighboring the slip plane. Note that shiftindex values only apply shifts normal to the slip plane; best shifts for non-planar dislocations (like bcc screw) may also need a shift in the slip plane. Cannot be given with shiftindex. If neither shift nor shiftindex is given then shiftindex = 0 is used.

  • shiftscale (bool, optional) – If False (default), a given shift value will be taken as absolute Cartesian. If True, a given shift will be taken relative to the rotated cell’s box vectors.

  • tol (float) – A cutoff tolerance used with obtaining the dislocation solution. Only needs to be changed if there are issues with obtaining a solution.

  • 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.

  • annealtemp (float, optional) – The temperature to perform a dynamic relaxation at. Default is 0.0, which will skip the dynamic relaxation.

  • annealsteps (int, optional) – The number of time steps to run the dynamic relaxation for. Default is None, which will run for 10000 steps if annealtemp is not 0.0.

  • 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.

  • boundaryshape (str, optional) – Indicates the shape of the boundary region to use. Options are ‘cylinder’ (default) and ‘box’. For ‘cylinder’, the non-boundary region is defined by a cylinder with axis along the dislocation line and a radius that ensures the boundary is at least boundarywidth thick. For ‘box’, the boundary region will be exactly boundarywidth thick all around.

  • boundarywidth (float, optional) – The width of the boundary region to apply. Default value is 0.0, i.e. no boundary region. All atoms in the boundary region will have their atype values changed.

  • boundaryscale (bool, optional) – If False (Default), the boundarywidth will be taken as absolute. If True, the boundarywidth will be taken relative to the magnitude of the unit cell’s a box vector.

Returns:

Dictionary of results consisting of keys:

  • ’dumpfile_base’ (str) - The filename of the LAMMPS dump file for the relaxed base system.

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

  • ’dumpfile_disl’ (str) - The filename of the LAMMPS dump file for the relaxed dislocation monopole system.

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

  • ’dislocation’ (atomman.defect.Dislocation) - The Dislocation object used to generate the monopole system.

  • ’E_total_disl’ (float) - The total potential energy of the dislocation monopole system.

Return type:

dict