# calc_stacking_fault_map_2D.py

## Calculation script functions

main(*args)

Main function called when script is executed directly.

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

stackingfaultmap(lammps_command, ucell, potential, hkl, mpi_command=None, sizemults=None, minwidth=None, even=False, a1vect_uvw=None, a2vect_uvw=None, conventional_setting='p', cutboxvector='c', faultpos_rel=None, faultpos_cart=None, num_a1=10, num_a2=10, atomshift=None, shiftindex=None, etol=0.0, ftol=0.0, maxiter=10000, maxeval=100000, dmax=0.01)

Computes a generalized stacking fault map for shifts along a regular 2D grid.

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

• ucell (atomman.System) – The crystal unit cell to use as the basis of the stacking fault configurations.

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

• hkl (array-like object) – The Miller(-Bravais) crystal fault plane relative to ucell.

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

• sizemults (list or tuple, optional) – The three System.supersize multipliers [a_mult, b_mult, c_mult] to use on the rotated cell to build the final system. Note that the cutboxvector sizemult must be an integer and not a tuple. Default value is [1, 1, 1].

• minwidth (float, optional) – If given, the sizemult along the cutboxvector will be selected such that the width of the resulting final system in that direction will be at least this value. If both sizemults and minwidth are given, then the larger of the two in the cutboxvector direction will be used.

• even (bool, optional) – A True value means that the sizemult for cutboxvector will be made an even number by adding 1 if it is odd. Default value is False.

• a1vect_uvw (array-like object, optional) – The crystal vector to use for one of the two shifting vectors. If not given, will be set to the shortest in-plane lattice vector.

• a2vect_uvw (array-like object, optional) – The crystal vector to use for one of the two shifting vectors. If not given, will be set to the shortest in-plane lattice vector not parallel to a1vect_uvw.

• conventional_setting (str, optional) – Allows for rotations of a primitive unit cell to be determined from (hkl) indices specified relative to a conventional unit cell. Allowed settings: ‘p’ for primitive (no conversion), ‘f’ for face-centered, ‘i’ for body-centered, and ‘a’, ‘b’, or ‘c’ for side-centered. Default behavior is to perform no conversion, i.e. take (hkl) relative to the given ucell.

• cutboxvector (str, optional) – Indicates which of the three system box vectors, ‘a’, ‘b’, or ‘c’, to cut with a non-periodic boundary (default is ‘c’).

• faultpos_rel (float, optional) – The position to place the slip plane within the system given as a relative coordinate along the out-of-plane direction. faultpos_rel and faultpos_cart cannot both be given. Default value is 0.5 if faultpos_cart is also not given.

• faultpos_cart (float, optional) – The position to place the slip plane within the system given as a Cartesian coordinate along the out-of-plane direction. faultpos_rel and faultpos_cart cannot both be given.

• num_a1 (int, optional) – The number of fractional coordinates to evaluate along a1vect_uvw. Default value is 10.

• num_a2 (int, optional) – The number of fractional coordinates to evaluate along a2vect_uvw. Default value is 10.

• atomshift (array-like object, optional) – A Cartesian vector shift to apply to all atoms. Can be used to shift atoms perpendicular to the fault plane to allow different termination planes to be cut. Cannot be given with shiftindex.

• shiftindex (int, optional) – Allows for selection of different termination planes based on the preferred shift values determined by the underlying fault generation. Cannot be given with atomshift. If neither atomshift nor shiftindex given, then shiftindex will be set to 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).

Returns

Dictionary of results consisting of keys:

• ’A_fault’ (float) - The area of the fault surface.

• ’gamma’ (atomman.defect.GammaSurface) - A gamma surface plotting object.

Return type

dict

stackingfaultrelax(lammps_command, system, potential, mpi_command=None, sim_directory=None, cutboxvector='c', etol=0.0, ftol=0.0, maxiter=10000, maxeval=100000, dmax=0.01, lammps_date=None)

Perform a stacking fault relaxation simulation for a single faultshift.

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

• system (atomman.System) – The system containing a stacking fault.

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

• sim_directory (str, optional) – The path to the directory to perform the simulation in. If not given, will use the current working directory.

• cutboxvector (str, optional) – Indicates which of the three system box vectors, ‘a’, ‘b’, or ‘c’, has the non-periodic boundary (default is ‘c’). Fault plane normal is defined by the cross of the other two box vectors.

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

• lammps_date (datetime.date or None, optional) – The date version of the LAMMPS executable. If None, will be identified from the lammps_command (default is None).

Returns

Dictionary of results consisting of keys:

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

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

• ’system’ (atomman.System) - The relaxed system.

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

Return type

dict

Raises

ValueError – For invalid cutboxvectors.