def modify_mesh(x, insert_1, insert_2):
 return np.sort(np.hstack((x, (0.5 * (x[insert_1] + x[(insert_1 + 1)])), (((2 * x[insert_2]) + x[(insert_2 + 1)]) / 3), ((x[insert_2] + (2 * x[(insert_2 + 1)])) / 3))))

def modify_mesh ( x , insert_1 , insert_2 ) : return np . sort ( np . hstack ( ( x , ( 0.5 * ( x [ insert_1 ] + x [ ( insert_1 + 1 ) ] ) ) , ( ( ( 2 * x [ insert_2 ] ) + x [ ( insert_2 + 1 ) ] ) / 3 ) , ( ( x [ insert_2 ] + ( 2 * x [ ( insert_2 + 1 ) ] ) ) / 3 ) ) ) )
insert nodes into a mesh .