forked from Hatomzre/2dDDD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialSystem.m
More file actions
31 lines (25 loc) · 1.11 KB
/
initialSystem.m
File metadata and controls
31 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function rn = initialSystem(numofDislocation)
% This function give the initial structure of dislocation system
%----About Box-------------------------------------------------------------
boxsize = 50;
%----Initial rn------------------------------------------------------------
rn = zeros(numofDislocation, 7);
%----Initial The Position of Dislocation-----------------------------------
for i = 1:numofDislocation
rn(i, 1:2) = boxsize*rand(1, 2);
for j = 1:i-1
%----No The Same Position------------------------------------------
while rn(i, 1) == rn(j, 1) && rn(i, 2) == rn(j, 2)
rn(i, :) = boxsize*rand(1, 2);
end
end
end
%----Initial The Burgers Vector For Dislocation----------------------------
rn(1:numofDislocation/2, 3) = 1;
rn(numofDislocation/4+1:numofDislocation/2, 3) = -1;
rn(numofDislocation/2+1:numofDislocation, 4) = 1;
rn(3*numofDislocation/4+1:numofDislocation, 4) = -1;
%----Initial Glide Plane Normal For Dislocation----------------------------
rn(1:numofDislocation/2, 7) = 1;
rn(numofDislocation/2+1:numofDislocation, 6) = 1;
end