atomlib.defect
A collection of functions for inserting dislocations into structures.
CutType
module-attribute
CutType: TypeAlias = Literal['shift', 'add', 'rm']
Cut plane to use when creating a (non-screw) dislocation.
ellip_pi
Complete elliptic integral of the third kind, \(\Pi(n | m)\).
Follows the definition of Wolfram Mathworld.
Source code in atomlib/defect.py
stacking_fault
Add a stacking fault to the structure.
The fault plane will pass through the position pos
, with normal plane
.
Atoms above plane
will be shifted by the vector shift
.
If there is a component of shift
parallel to plane
, applying the shift
will create (or remove) volume. In this case, atoms are added (or removed)
accordingly. If shift
\(\cdot\) plane
is positive, atoms are added.
In general, adding a stacking fault will not preserve a cell's periodicity. Please verify this for your usecase.
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add fault to
TYPE:
|
pos
|
Position on fault plane
TYPE:
|
shift
|
Vector to shift by
TYPE:
|
plane
|
Normal to fault plane
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with a stacking fault added |
Source code in atomlib/defect.py
disloc_edge
disloc_edge(
atoms: HasAtomsT,
center: VecLike,
b: VecLike,
t: VecLike,
cut: Union[CutType, VecLike] = "shift",
*,
poisson: float = 0.25
) -> HasAtomsT
Add a Volterra edge dislocation to the structure.
The dislocation will pass through center
, with line vector t
and Burgers vector b
.
t
will be modified such that it is perpendicular to b
.
The cut
parameter defines the cut (discontinuity) plane used to displace the atoms.
By default, cut
is 'shift'
, which defines the cut plane to contain b
, ensuring no atoms
need to be added or removed.
Instead, 'add'
or 'rm'
may be specified, which defines the cut plane as containing
\(\mathbf{b} \times \mathbf{t}\). In this mode, atoms will be added or removed
in the plane of b
to create the dislocation. Alternatively, a vector cut
may be supplied. The cut plane will contain this vector.
In the coordinate system where t
is along \(z\), and b
is along \(+x\), the displacement
due to the edge dislocation can be calculated as follows:
Where \(x\) and \(y\) are distances from the dislocation center. This creates a discontinuity along the \(-x\) axis. This coordinate system is rotated to support branches along an arbitrary axis.
The dislocation is defined by the FS/RH convention: Performing one loop of positive sense
relative to the tangent vector displaces the real crystal one b
relative to a reference
crystal.
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add edge dislocation to
TYPE:
|
center
|
Position on dislocation line
TYPE:
|
b
|
Burgers vector of dislocation (FS/RH convention)
TYPE:
|
t
|
Tangent vector of dislocation
TYPE:
|
cut
|
Cut plane to create dislocation on |
poisson
|
Poisson ratio of material
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with an edge dislocation added |
Source code in atomlib/defect.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
disloc_screw
disloc_screw(
atoms: HasAtomsT,
center: VecLike,
b: VecLike,
cut: Optional[VecLike] = None,
sign: bool = True,
) -> HasAtomsT
Add a Volterra screw dislocation to the structure.
The dislocation will pass through center
, with Burgers vector b
.
The cut
parameter defines the cut (discontinuity) plane used to displace the atoms.
By default, cut
is chosen automtically, but it may also be specified as a vector
which points from the dislocation core towards the cut plane (not normal to the cut plane!)
The screw dislocation in an isotropic medium has a particularily simple form, given by:
for a dislocation along \(+z\) with cut plane along \(-x\). To support arbitrary cut planes,
\(x\) and \(y\) are replaced by the components of \(r\) parallel and perpendicular to the cut plane,
evaluated in the plane of b
.
The dislocation is defined by the FS/RH convention: Performing one loop of positive sense
relative to the tangent vector displaces the real crystal one b
relative to a reference
crystal.
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add screw dislocation to
TYPE:
|
center
|
Position on dislocation line
TYPE:
|
b
|
Burgers vector of dislocation (FS/RH convention)
TYPE:
|
cut
|
Cut plane to create dislocation on |
sign
|
Sign of screw dislocation (True means positive)
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with a screw dislocation added |
Source code in atomlib/defect.py
disloc_loop_z
disloc_loop_z(
atoms: HasAtomsT,
center: VecLike,
b: VecLike,
loop_r: float,
*,
poisson: float = 0.25
) -> HasAtomsT
Add a circular dislocation loop to the structure, assuming an elastically isotropic material.
The loop will have radius loop_r
, be centered at center
, and oriented along the z-axis.
The dislocation's sign is defined such that travelling upwards through the loop results in a displacement of b
.
poisson
is the material's poisson ratio, which affects the shape of dislocations with an edge component.
Adding the loop creates (or removes) a volume of \(\mathbf{b} \cdot \mathbf{n}A\), where \(\mathbf{n}A\) is the loop's normal times its area. Consequently, this function adds or remove atoms to effect this volume change.
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add dislocation loop to
TYPE:
|
center
|
Center of dislocation loop
TYPE:
|
b
|
Burgers vector of dislocation (defined so travelling upwards leads to a plastic displacment of
TYPE:
|
loop_r
|
Radius of dislocation loop
TYPE:
|
poisson
|
Poisson ratio of material
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with a dislocation loop added |
Source code in atomlib/defect.py
disloc_square_z
disloc_square_z(
atoms: HasAtomsT,
center: VecLike,
b: VecLike,
loop_r: float,
*,
poisson: float = 0.25
) -> HasAtomsT
Add a square dislocation loop to the structure, assuming an elastically isotropic material.
The dislocation's sign is defined such that traveling upwards through the loop results in a displacement of b
.
poisson
is the material's poisson ratio, which affects the shape of dislocations with an edge component.
Adding the loop creates (or removes) a volume of \(\mathbf{b} \cdot \mathbf{n}A\), where \(\mathbf{n}A\) is the loop's normal times its area. Consequently, this function adds or remove atoms to effect this volume change.
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add dislocation loop to
TYPE:
|
center
|
Center of dislocation loop
TYPE:
|
b
|
Burgers vector of dislocation (defined so travelling upwards leads to a plastic displacment of
TYPE:
|
loop_r
|
Radius (side length/2) of dislocation loop
TYPE:
|
poisson
|
Poisson ratio of material
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with a dislocation loop added |
Source code in atomlib/defect.py
disloc_poly_z
disloc_poly_z(
atoms: HasAtomsT,
b: VecLike,
poly: ArrayLike,
center: Optional[VecLike] = None,
*,
poisson: float = 0.25
) -> HasAtomsT
Add a dislocation loop defined by the polygon poly
, assuming an elastically isotropic material.
poly
should be a 2d polygon (shape (N, 2)
). It will be placed at center
, in the plane z=center[2]
.
For CCW winding order, traveling upwards through the plane of the loop results in a displacement of b
.
poisson
is the material's poisson ratio, which affects the shape of dislocations with an edge component.
Adding the loop creates (or removes) a volume of \(\mathbf{b} \cdot \mathbf{n}A\), where \(\mathbf{n}A\) is the loop's normal times its area. Consequently, this function adds or remove atoms to effect this volume change.
Follows the solution in Hirth, J. P. & Lothe, J. (1982). Theory of Dislocations. ISBN 0-89464-617-6
PARAMETER | DESCRIPTION |
---|---|
atoms
|
Structure to add dislocation loop to
TYPE:
|
b
|
Burgers vector of dislocation (defined so travelling upwards leads to a plastic displacment of
TYPE:
|
poly
|
2D polygon defining dislocation line. It is placed in the plane
TYPE:
|
center
|
Center of dislocation loop (defaults to zero, applying no displacement to the gven polygon). |
poisson
|
Poisson ratio of material
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HasAtomsT
|
Structure with a dislocation loop added |