-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
119 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
|
||
|
||
def y_center_crack(y_index, atom, n_replications_y, crack_size, atom_index, new_position): | ||
floor = int(n_replications_y//2 - ((crack_size - 1)/2)) | ||
ceiling = int(n_replications_y//2 + ((crack_size - 1)/2)) | ||
if y_index in range(floor, ceiling+1): | ||
def y_center_crack(y_index, atom, n_replications_y, | ||
crack_size, atom_index, new_position): | ||
floor = int(n_replications_y // 2 - ((crack_size - 1) / 2)) | ||
ceiling = int(n_replications_y // 2 + ((crack_size - 1) / 2)) | ||
if y_index in range(floor, ceiling + 1): | ||
atom = 'H' | ||
if (y_index == floor and atom_index in [0, 1, 2, 3, 4, 8, 9]) or (y_index == ceiling and atom_index in [3, 4, 5, 6, 7, 8, 9]): | ||
if (y_index == floor and atom_index in [0, 1, 2, 3, 4, 8, 9]) or ( | ||
y_index == ceiling and atom_index in [3, 4, 5, 6, 7, 8, 9]): | ||
return [atom, new_position] | ||
elif atom_index in [3, 4, 8, 9]: | ||
return [atom, new_position] | ||
else: | ||
return [atom, new_position] | ||
|
||
def x_center_crack(x_index, atom, n_replications_x, crack_size, atom_index, new_position): | ||
floor = int(n_replications_x//2 - ((crack_size - 1)/2)) | ||
ceiling = int(n_replications_x//2 + ((crack_size - 1)/2)) | ||
if x_index in range(floor, ceiling+1): | ||
|
||
|
||
def x_center_crack(x_index, atom, n_replications_x, | ||
crack_size, atom_index, new_position): | ||
floor = int(n_replications_x // 2 - ((crack_size - 1) / 2)) | ||
ceiling = int(n_replications_x // 2 + ((crack_size - 1) / 2)) | ||
if x_index in range(floor, ceiling + 1): | ||
atom = 'H' | ||
if (x_index == floor and atom_index in [0, 1, 2, 8, 9,5,6,7,8,9]) or (x_index == ceiling and atom_index in [0,1,2,3,4,5,6,7]): | ||
if (x_index == floor and atom_index in [0, 1, 2, 8, 9, 5, 6, 7, 8, 9]) or ( | ||
x_index == ceiling and atom_index in [0, 1, 2, 3, 4, 5, 6, 7]): | ||
return [atom, new_position] | ||
elif atom_index in [0,1,2,5,6,7]: | ||
elif atom_index in [0, 1, 2, 5, 6, 7]: | ||
return [atom, new_position] | ||
else: | ||
return [atom, new_position] | ||
|
||
def edge_center_crack(y_index, atom, n_replications_y, crack_size, atom_index, new_position): | ||
|
||
def edge_center_crack(y_index, atom, n_replications_y, | ||
crack_size, atom_index, new_position): | ||
ceiling = crack_size | ||
if y_index in range(ceiling+1): | ||
if y_index in range(ceiling + 1): | ||
atom = 'H' | ||
if (y_index == ceiling and atom_index in [3, 4, 5, 6, 7, 8, 9]): | ||
return [atom, new_position] | ||
elif atom_index in [3, 4, 8, 9]: | ||
return [atom, new_position] | ||
else: | ||
return [atom, new_position] | ||
return [atom, new_position] |
Oops, something went wrong.