`atomsk --nye <file1> <file2> [options] [<outputfile>] [formats]`

This mode computes the per-atom strain tensor, and then the Nye tensor, a quantity related to the strain gradient around an atom. The Nye tensor can be useful for visualizing lattice defects such as point defects, dislocations, or planar defects (stacking faults, twins, grain boundaries).

This mode requires two files: a <file1> containing the reference system, and a <file2> that contains the system to analyze. The reference system may be:

**a full reference system**, i.e. a supercell of bulk, undeformed and defect-free material that has the same number of atoms as the analyzed system (<file2>). In addition, atom indices should match between the two files, and their positions should not change too much. For example, if one wishes to analyze a <file2> containing a screw dislocation, then the <file1> should be a supercell of perfect material with the same number of atoms.**a unit cell**of the system to analyze. The unit cell should have the same crystal orientation as the system to analyze. Atomsk will construct the reference atomic environments from the unit cell, and compare them with the actual atomic environments in the system to study.**NULL**, meaning that no reference is provided. Atomsk will construct reference atomic environments on-the-fly, by averaging the environments found in the system to analyze. Environments where atoms have an odd number of neighbors are discarded (not included in the averaging).

The two files <file1> and <file2> may be of the same format, or of different formats, as long as these formats are supported by Atomsk.

The calculation follows the method described in C.S. Hartley, Y. Mishin, *Acta Mater.* **53** (2005) 1313. Given a reference lattice defined by a set of atom positions **P** and a distorted lattice defined by **Q**, the lattice correspondance tensor is defined so as to transform one lattice into the other:

**P** = **Q** · **G**

Once the tensor **G** is computed for each atom, Atomsk uses it to compute the strain tensor for each atom (where the Kronecker symbol δ_{ij}=1 if i=j, and 0 otherwise):

**ε**_{ij} = ½ [ (δ_{ij} − **G**_{ij}) + (δ_{ji} − **G**_{ji}) ]

From there the strain invariants are also computed:

*I*_{1} = Trace(**ε**)

*I*_{2} = ½ [ Trace(**ε**)^{2} − Trace(**ε**^{2}) ]

*I*_{3} = Det(**ε**)

From **G**, the per-atom rotation tensor is also computed:

**R**_{ij} = ½ [ (δ_{ij} − **G**_{ij}) − (δ_{ji} − **G**_{ji}) ]

Finally, the Nye tensor **α** is computed from its spatial derivatives (ε_{imk} is the Levi-Civita permutation symbol):

**α**_{jk} = ε_{imk} ∂_{m}**G**_{ij}

Note that the original published article by Hartley and Mishin cited above contained a mistake in this equation. The equation implemented in Atomsk was verified to yield the correct Burgers vector after integration of the Nye tensor.

To perform the calculation, neighbors up to the distance **NeighFactor × d _{3}** are used, where d

The values of the parameters NeighFactor and θ_{max} can be modified by creating a configuration file named "atomsk.conf" in the working directory where the calculation is performed, and containing the following lines:

`Nye NeighFactor 1.25`

Nye theta_max 27

The values defined in this file will be used for the calculation, instead of the default ones.

This mode outputs several files containing the results:

***_G.cfg**contains the lattice correspondance tensor**G**(a 3×3 tensor) for each atom;***_strain.cfg**contains the strain tensor**ε**(a 3×3 tensor) for each atom, as well as the strain invariants*I*_{1},*I*_{2},*I*_{3};***_rot.cfg**contains the rotation tensor (a 3×3 tensor) for each atom;***_Nye.cfg**contains the Nye tensor**α**(a 3×3 tensor) for each atom.

All these quantities are output in Atomeye CFG format for easy visualization e.g. with OVITO.

If you use this mode with one or several options they will be applied to the <file1> and <file2> *before* the Nye tensor is computed.

Note that this mode assumes that the atom coordinates are *wrapped*, i.e. that all atoms are inside of the simulation box. If it is not the case then the calculation may be wrong. Coordinates can be wrapped thanks to the option `-wrap`

.

`atomsk --nye reference.xsf dislocation.cfg nye.cfg`

This will compute the Nye tensor due to the displacements in the file

`dislocation.cfg`

, using`reference.xsf`

as a reference system. The positions and Nye tensors of atoms will be written to`nye.cfg`

.`atomsk --nye unitcell.xsf mysystem.cfg nye.cfg`

In this example, a unit cell is provided as reference system. Atomsk will construct reference atomic environments from the file

`unitcell.xsf`

, and then proceed with computing the Nye tensor. The final result will be written into`nye.cfg`

.`atomsk --nye NULL mysystem.cfg nye.cfg`

In this example the reference system is specified as "NULL", i.e. no reference is provided. Atomsk will read atom positions from the file

`mysystem.cfg`

, and average their environments to construct the reference. Then, it will compute the Nye tensor and write the result into`nye.cfg`

.-
##### atomsk.conf

`# Change values of parameters for Nye tensor calculation`

Nye NeighFactor 1.2

Nye theta_max 45

If a file named "atomsk.conf" exists in current directory, then Atomsk will use the values of the parameters NeighFactor and theta_max defined in this file.