calc_dislocation_monopole.py
Calculation script functions

anneal_info
(temperature=0.0, runsteps=None, randomseed=None, units='metal') 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

disl_relax
(lammps_command, system, potential, mpi_command=None, annealtemp=0.0, annealsteps=None, randomseed=None, etol=0.0, ftol=1e06, maxiter=10000, maxeval=100000, dmax=0.01) 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

dislocationmonopole
(lammps_command, ucell, potential, C, burgers, ξ_uvw, slip_hkl, mpi_command=None, m=[0, 1, 0], n=[0, 0, 1], sizemults=None, amin=None, bmin=None, cmin=None, shift=None, shiftscale=False, shiftindex=None, tol=1e08, etol=0.0, ftol=0.0, maxiter=10000, maxeval=100000, dmax=0.01, annealtemp=0.0, annealsteps=None, randomseed=None, boundaryshape='cylinder', boundarywidth=0.0, boundaryscale=False) 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 (arraylike object) – The dislocation’s Burgers vector given as a Miller or MillerBravais vector relative to ucell.
ξ_uvw (arraylike object) – The dislocation’s line direction given as a Miller or MillerBravais vector relative to ucell.
slip_hkl (arraylike object) – The dislocation’s slip plane given as a Miller or MillerBravais 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 (arraylike object, optional) – The m unit vector for the dislocation solution. m, n, and ξ (dislocation line) should be righthand orthogonal. Default value is [0,1,0] (yaxis).
n (arraylike object, optional) – The n unit vector for the dislocation solution. m, n, and ξ (dislocation line) should be righthand orthogonal. Default value is [0,0,1] (zaxis). 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 nonperiodic directions must be even. If not given, the default multipliers will be 2 for the nonperiodic 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 nonperiodic 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 nonperiodic 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 nonperiodic 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 nonplanar 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 nonboundary 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 elementmodel 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 elementmodel 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

process_input
(input_dict, UUID=None, build=True) Processes str input parameters, assigns default values if needed, and generates new, more complex terms as used by the calculation.
 Parameters
input_dict (dict) – Dictionary containing the calculation input parameters with string values. The allowed keys depends on the calculation style.
UUID (str, optional) – Unique identifier to use for the calculation instance. If not given and a ‘UUID’ key is not in input_dict, then a random UUID4 hash tag will be assigned.
build (bool, optional) – Indicates if all complex terms are to be built. A value of False allows for default values to be assigned even if some inputs required by the calculation are incomplete. (Default is True.)