12 def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
13 return list_indenters[0].
sDF(x,y,z)
16 def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
17 return list_indenters[0].
gradSdf(x,y,z)
20 def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
21 return list_indenters[0].
hessSdf(x,y,z)
27 def sDF(self, x, y, z):
28 return np.ones_like(x)
31 zeros = np.zeros_like(x)
32 zeros = zeros.reshape((-1,1))
34 grad_array = np.hstack([zeros, zeros, zeros])
38 zeros = np.zeros_like(x)
39 zeros = zeros.reshape((-1,1))
41 hess_array = np.hstack([zeros, zeros, zeros, zeros, zeros, zeros])
62 def sDF(self, x, y, z):
63 return np.subtract(y,self.
shift)
69 dx = dx.reshape((-1,1))
70 dy = dy.reshape((-1,1))
71 dz = dz.reshape((-1,1))
72 grad_array = np.hstack([dx, dy, dz])
76 zeros = np.zeros_like(x)
77 zeros = zeros.reshape((-1,1))
79 hess_array = np.hstack([zeros, zeros, zeros, zeros, zeros, zeros])
99 def sDF(self, x, y, z):
100 a = (x-self.
xc)**2 + (y-self.
yc)**2
101 gap = np.sqrt(a)-self.
radius
109 a = (x-self.
xc)**2 + (y-self.
yc)**2
112 c_val_dx = c_val_A * (x-self.
xc)
113 c_val_dy = c_val_A * (y-self.
yc)
114 c_val_dz = np.zeros_like(c_val_dy)
116 c_val_dx = c_val_dx.reshape((-1,1))
117 c_val_dy = c_val_dy.reshape((-1,1))
118 c_val_dz = c_val_dz.reshape((-1,1))
119 grad_array = np.hstack([c_val_dx,c_val_dy,c_val_dz])
123 a = (x-self.
xc)**2 + (y-self.
yc)**2
126 c_val_B = 1./(a**(3./2.))
127 Hxx = c_val_A - c_val_B * (x-self.
xc)**2
128 Hxy = -c_val_B * (x-self.
xc)*(y-self.
yc)
129 Hyy = c_val_A - c_val_B * (y-self.
yc)**2
131 Hxx = Hxx.reshape((-1,1))
132 Hzx = np.zeros_like(Hxx)
133 Hxy = Hxy.reshape((-1,1))
134 Hyy = Hyy.reshape((-1,1))
135 Hzy = np.zeros_like(Hxx)
136 Hzz = np.zeros_like(Hxx)
137 hess_array = np.hstack([Hxx, Hxy, Hzx, Hyy, Hzy, Hzz])
157 dx = np.subtract(x, self.
xc)
158 dy = np.subtract(y, self.
yc)
159 dz = np.subtract(z, self.
zc)
160 a = (dx)**2+(dy)**2 + (dz)**2
161 gap = np.sqrt(a) - self.
radius
166 a = (x-self.
xc)**2 + (y-self.
yc)**2 + (z-self.
zc)**2
169 c_val_dx = c_val_A * (x-self.
xc)
170 c_val_dy = c_val_A * (y-self.
yc)
171 c_val_dz = c_val_A * (z-self.
zc)
175 c_val_dx = c_val_dx.reshape((-1,1))
176 c_val_dy = c_val_dy.reshape((-1,1))
177 c_val_dz = c_val_dz.reshape((-1,1))
178 grad_array = np.hstack([c_val_dx,c_val_dy,c_val_dz])
185 Hxx = -x**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
186 Hzx = -x*z/(x**2 + y**2 + z**2)**(3/2)
187 Hxy = -x*y/(x**2 + y**2 + z**2)**(3/2)
188 Hyy = -y**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
189 Hzy = -y*z/(x**2 + y**2 + z**2)**(3/2)
190 Hzz = -z**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
192 Hxx = Hxx.reshape((-1,1))
193 Hzx = Hzx.reshape((-1,1))
194 Hxy = Hxy.reshape((-1,1))
195 Hyy = Hyy.reshape((-1,1))
196 Hzy = Hzy.reshape((-1,1))
197 Hzz = Hzz.reshape((-1,1))
198 hess_array = np.hstack([Hxx, Hxy, Hzx, Hyy, Hzy, Hzz])