11 def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
12 return Sphere.sDF(R, xc, yc, zc - d * t, x, y, z)
14 def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
15 return Sphere.gradSdf(xc, yc, zc - d * t, x, y, z)
17 def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
18 return Sphere.hessSdf(xc, yc, zc - d * t, x, y, z)
21 def sDF(r, xc, yc, zc, x, y, z):
22 dx = np.subtract(x, xc)
23 dy = np.subtract(y, yc)
24 dz = np.subtract(z, zc)
25 a = dx**2 + dy**2 + dz**2
30 a = (x-xc)**2 + (y-yc)**2 + (z-zc)**2
33 c_val_dx = c_val_A * (x-xc)
34 c_val_dy = c_val_A * (y-yc)
35 c_val_dz = c_val_A * (z-zc)
37 c_val_dx = c_val_dx.reshape((-1,1))
38 c_val_dy = c_val_dy.reshape((-1,1))
39 c_val_dz = c_val_dz.reshape((-1,1))
40 grad_array = np.hstack([c_val_dx,c_val_dy,c_val_dz])
47 Hxx = -x**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
48 Hzx = -x*z/(x**2 + y**2 + z**2)**(3/2)
49 Hxy = -x*y/(x**2 + y**2 + z**2)**(3/2)
50 Hyy = -y**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
51 Hzy = -y*z/(x**2 + y**2 + z**2)**(3/2)
52 Hzz = -z**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
54 Hxx = Hxx.reshape((-1,1))
55 Hzx = Hzx.reshape((-1,1))
56 Hxy = Hxy.reshape((-1,1))
57 Hyy = Hyy.reshape((-1,1))
58 Hzy = Hzy.reshape((-1,1))
59 Hzz = Hzz.reshape((-1,1))
60 hess_array = np.hstack([Hxx, Hxy, Hzx, Hyy, Hzy, Hzz])