Skip to content

Commit

Permalink
WIP: Returned tip y position from crack tip finder
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser-Birks committed Mar 11, 2024
1 parent 9fe2956 commit 4e5ef82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion matscipy/fracture_mechanics/thin_strip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def find_strip_crack_tip(self,final_crack_state,bondlength,bulk_nn,step_tolerant

print(f'Found crack tip at position {tip_pos}')

return tip_pos
return tip_pos, tip_pos_y

def write_potential_and_buffer(atoms,lammps_filename):
#get the potential and buffer array from atoms
Expand Down
8 changes: 4 additions & 4 deletions scripts/fracture_mechanics/thin_strip_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@
# raise RuntimeError('Lost crack tip!')
# tip_pos = tip_pos[0]
# print(f'Found crack tip at position {tip_pos}')
tip_pos = tsb.find_strip_crack_tip(final_crack_state,bondlength,bulk_nn,calculate_midpoint=True,step_tolerant=step_tolerant)

tip_pos,tip_pos_y = tsb.find_strip_crack_tip(final_crack_state,bondlength,bulk_nn,step_tolerant=step_tolerant)
print('y pos', tip_pos_y)
# ------------check for an arrested crack ------------ #
#only start checking after the first initial_damping steps
if (i >= initial_damping_time) or (not initial_damp):
Expand Down Expand Up @@ -340,8 +340,8 @@
simple_strip = tsb.build_thin_strip(strip_width,strip_height,strip_thickness,vacuum)
x_pos = simple_strip.get_positions()[:,0]
y_pos = simple_strip.get_positions()[:,1]
tip_x_pos = x_pos[bond_atoms[0]]
tip_y_pos = [y_pos[bond_atoms[0]], y_pos[bond_atoms[1]]]
tip_x_pos = tip_pos
tip_y_pos = tip_pos_y
full_mask = (x_pos>(tip_x_pos-10)) & (x_pos<(tip_x_pos+40))

#mask is full mask and atoms which have a y position equal to that of the crack tip within numerical resolution
Expand Down

0 comments on commit 4e5ef82

Please sign in to comment.