Script for inserting dislocations

The script insert_dislocation_adv.py can be used to insert one or more straight dislocations into a configuration given as Lammps dump or data file.

Usage

python insert_dislocation_adv.py CONFIGURATION_FILE

Where CONFIGURATION_FILE is a plain text file which contains information on files, dislocations, etc. See the documentation below.

scripts.insert_dislocation_adv.insert(*args, **kwargs)

Insert dislocations into an anisotropic medium.

Read atom coordinates from a Lammps file and insert one or more dislocations by applying their anisotropic-elastic displacement field. The field is calculated with Stroh’s advanced straight dislocation formalism [1], or with Barnett and Lothe’s integral formalism [2]. The two formalisms are closely related, see Hirth and Lothe’s book [3], and the review of Bacon etal. [4].

The variables of the elastic problem are given similar names as in [3] and [4].

The configuration file CONFIGURATION_FILE contains three mandatory sections [simulation cell], [elastic constants], and [files], with the following values:

[simulation cell]

Parameters
  • x (array-like) – crystal direction that is parallel to the x-direction of the cell

  • y (array-like) – crystal direction that is parallel to the y-direction of the cell

  • z (array-like) – crystal direction that is parallel to the z-direction of the cell

  • boundary_style (array-like) – Boundary style as used by the Lammps ‘boundary’ command, e.g. ‘s s p’.

Note

The components of the vectors should be separated by whitespace and the vectors do not need to be normalized.

[elastic  constants]

Parameters
  • c11 (float) – cubic elastic constant \(C_{11}\)

  • c12 (float) – cubic elastic constant \(C_{12}\)

  • c44 (float) – cubic elastic constant \(C_{44}\)

Note

These should be the components relative to the [100]-[010]-[001] CRYSTAL coordinate system; NOT relative to the simulation cell. The program performs all the required tensor rotations!

[files]

Parameters
  • format (str) – ‘dump’ or ‘data’

  • input (str) – path to input file

  • output (str) – path to output file

  • append_displacements (bool) – if True, the displacement field will be appended to the output file (as the last three columns). ‘ux uy uz’ will be appended to the ITEM:ATOMS header line.

The mandatory sections are followed by an arbitrary number of sections with the name [dislocationX], where X is an integer. Each [dislocationX] section defines a dislocation. If there are several such sections, then the integers X decide in which sequence the displacement fields will be applied (ascending order, i.e. dislocation1 would be inserted before dislocation2). Parameters in a dislocation-section:

Parameters
  • b (array-like) – Burgers vector (distance units)

  • xi (array-like) – Line direction, does not need to be normalized

  • center (array-like) – Center of dislocation in simulation cell coordinates

Parm array-like m

(optional) first direction in the dislocation coordinate system, expressed in crystal coordinates. This vector is parallel to the normal of the plane along which the cut would be made to insert the dislocation.

Parm str solution_method

Method for solving for the displacements. Recognized choices are: “stroh” (for Stroh’s formalism), “symbolical_integral_method” (for the Barnett-Lothe formalism, using symbolical math), as well as “numerical_integral_method” (for the Barnett-Lothe formalism, using numerical math). The symbolical backend is faster than the numerical one.

Example

[simulation cell]
x =  1 -2  1
y = -1 -1 -1
z =  1  0 -1
boundary_style = s s p
[elastic constants]
c11 = 170.221549146026319
c12 = 122.600531649638015
c44 = 75.848200859164038
[files]
format = dump
input  = Cu_parallelepiped.atom
output = Cu_parallelepiped_with_screw_dislocation.atom
append_displacements = True
[dislocation1]
b   =  -1.807500856188893   0.000000000000000   1.807500856188893
xi  =  -1 0 1
m   =   1 2 1
center = 125.444552873685 88.702693999897 0.0
solution_method = stroh

Notes

Currently, Lammps dump and data files are supported. Input dump files must contain the columns ‘id’, ‘type’, ‘x’, ‘y’, and ‘z’, in this order. They must contain a single snapshot. Data files are currently read and written using the Lammps Python API, i.e. Lammps is actually called.

References

  1. Stroh, A.N. J. Math. Phys., 41: 77 (1962)

  2. Barnett, D.M.; Lothe, J. Phys. Norvegica, 7 (1973)

  3. Hirth, J.P.; Lothe, J. Theory of Dislocations, 2nd Edition; John Wiley and Sons, 1982. pp 467

  4. Bacon, D. J.; Barnett, D. M.; Scattergood, R. O. Progress in Materials Science 1978, 23, 51-262.

scripts.insert_dislocation_adv.get_m_direction(xi)

Find two directions which are perpendicular to the line direction.

Parameters

(numpy.ndarray) (xi) –

Returns

m (numpy.ndarray)

Return type

vector perpendicular to xi