v0.15.0
Loading...
Searching...
No Matches
sdf_hertz_2d_axisymm_sphere.Sphere Class Reference

Public Member Functions

 sDF (r, xc, yc, zc, x, y, z)
 
 gradSdf (xc, yc, zc, x, y, z)
 
 hessSdf (xc, yc, zc, x, y, z)
 

Detailed Description

Definition at line 20 of file sdf_hertz_2d_axisymm_sphere.py.

Member Function Documentation

◆ gradSdf()

sdf_hertz_2d_axisymm_sphere.Sphere.gradSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 24 of file sdf_hertz_2d_axisymm_sphere.py.

24 def gradSdf(xc, yc, zc, x, y, z):
25 c_val_A = 1./np.sqrt((x-xc)**2 + (y-yc)**2 + (z-zc)**2)
26 return np.hstack([(c_val_A * (x-xc)).reshape((-1,1)), (c_val_A * (y-yc)).reshape((-1,1)), (c_val_A * (z-zc)).reshape((-1,1))])
27

◆ hessSdf()

sdf_hertz_2d_axisymm_sphere.Sphere.hessSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 28 of file sdf_hertz_2d_axisymm_sphere.py.

28 def hessSdf(xc, yc, zc, x, y, z):
29 x, y, z = x-xc, y-yc, z-zc
30 denom = (x**2 + y**2 + z**2)**(3/2)
31 sqrt_denom = np.sqrt(x**2 + y**2 + z**2)
32 Hxx = -x**2/denom + 1/sqrt_denom
33 Hzx = -x*z/denom
34 Hxy = -x*y/denom
35 Hyy = -y**2/denom + 1/sqrt_denom
36 Hzy = -y*z/denom
37 Hzz = -z**2/denom + 1/sqrt_denom
38 # xx, yx, zx, yy, zy, zz
39 return np.hstack([Hxx.reshape((-1,1)), Hxy.reshape((-1,1)), Hzx.reshape((-1,1)), Hyy.reshape((-1,1)), Hzy.reshape((-1,1)), Hzz.reshape((-1,1))])

◆ sDF()

sdf_hertz_2d_axisymm_sphere.Sphere.sDF ( r,
xc,
yc,
zc,
x,
y,
z )

Definition at line 21 of file sdf_hertz_2d_axisymm_sphere.py.

21 def sDF(r, xc, yc, zc, x, y, z):
22 return np.sqrt((x - xc)**2 + (y - yc)**2 + (z - zc)**2) - r
23

The documentation for this class was generated from the following file: