diff --git a/matscipy/fracture_mechanics/thin_strip_utils.py b/matscipy/fracture_mechanics/thin_strip_utils.py index 5d6dd118..caf6a6b2 100644 --- a/matscipy/fracture_mechanics/thin_strip_utils.py +++ b/matscipy/fracture_mechanics/thin_strip_utils.py @@ -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 diff --git a/scripts/fracture_mechanics/thin_strip_lammps.py b/scripts/fracture_mechanics/thin_strip_lammps.py index 518d4be5..a511352d 100644 --- a/scripts/fracture_mechanics/thin_strip_lammps.py +++ b/scripts/fracture_mechanics/thin_strip_lammps.py @@ -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): @@ -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