v0.14.0
Public Member Functions | Public Attributes | List of all members
sdf_ydirection.Sphere Class Reference

Public Member Functions

def __init__ (self, Xc, Yc, Zc, diameter, indentationDepth)
 
def sDF (self, x, y, z)
 
def gradSdf (self, x, y, z)
 
def hessSdf (self, x, y, z)
 

Public Attributes

 t
 
 Xc
 
 Yc
 
 Zc
 
 xc
 
 yc
 
 zc
 
 radius
 

Detailed Description

Definition at line 104 of file sdf_ydirection.py.

Constructor & Destructor Documentation

◆ __init__()

def sdf_ydirection.Sphere.__init__ (   self,
  Xc,
  Yc,
  Zc,
  diameter,
  indentationDepth 
)

Definition at line 105 of file sdf_ydirection.py.

105  def __init__(self, Xc, Yc, Zc, diameter, indentationDepth):
106  # Initial time
107  self.t = 0
108 
109  # Initial Centroid
110  self.Xc = Xc
111  self.Yc = Yc
112  self.Zc = Zc
113 
114  # Current Centroid
115  self.xc = Xc
116  self.yc = Yc
117  self.zc = Zc
118 
119  # Indenter Dimensions
120  self.radius = diameter/2
121 

Member Function Documentation

◆ gradSdf()

def sdf_ydirection.Sphere.gradSdf (   self,
  x,
  y,
  z 
)

Definition at line 125 of file sdf_ydirection.py.

125  def gradSdf(self, x, y, z):
126  a = (x-self.xc)**2 + (y-self.yc)**2 + (z-self.zc)**2
127  c_val_A = 1./np.sqrt(a)
128  c_val_dx = c_val_A * (x-self.xc)
129  c_val_dy = c_val_A * (y-self.yc)
130  c_val_dz = c_val_A * (z-self.zc)
131  # x, y, z
132  return np.hstack([c_val_dx.reshape((-1,1)), c_val_dy.reshape((-1,1)), c_val_dz.reshape((-1,1))])
133 

◆ hessSdf()

def sdf_ydirection.Sphere.hessSdf (   self,
  x,
  y,
  z 
)

Definition at line 134 of file sdf_ydirection.py.

134  def hessSdf(self, x, y, z):
135  x, y, z = x-self.xc, y-self.yc, z-self.zc
136  denom = (x**2 + y**2 + z**2)**(3/2)
137  sqrt_denom = np.sqrt(x**2 + y**2 + z**2)
138  Hxx = -x**2/denom + 1/sqrt_denom
139  Hzx = -x*z/denom
140  Hxy = -x*y/denom
141  Hyy = -y**2/denom + 1/sqrt_denom
142  Hzy = -y*z/denom
143  Hzz = -z**2/denom + 1/sqrt_denom
144  # xx, yx, zx, yy, zy, zz
145  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))])
146 
147 # Define Indenter motion

◆ sDF()

def sdf_ydirection.Sphere.sDF (   self,
  x,
  y,
  z 
)

Definition at line 122 of file sdf_ydirection.py.

122  def sDF(self, x, y, z):
123  return np.sqrt((x - self.xc)**2 + (y - self.yc)**2 + (z - self.zc)**2) - self.radius
124 

Member Data Documentation

◆ radius

sdf_ydirection.Sphere.radius

Definition at line 120 of file sdf_ydirection.py.

◆ t

sdf_ydirection.Sphere.t

Definition at line 107 of file sdf_ydirection.py.

◆ Xc

sdf_ydirection.Sphere.Xc

Definition at line 110 of file sdf_ydirection.py.

◆ xc

sdf_ydirection.Sphere.xc

Definition at line 115 of file sdf_ydirection.py.

◆ Yc

sdf_ydirection.Sphere.Yc

Definition at line 111 of file sdf_ydirection.py.

◆ yc

sdf_ydirection.Sphere.yc

Definition at line 116 of file sdf_ydirection.py.

◆ Zc

sdf_ydirection.Sphere.Zc

Definition at line 112 of file sdf_ydirection.py.

◆ zc

sdf_ydirection.Sphere.zc

Definition at line 117 of file sdf_ydirection.py.


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