v0.14.0
Public Member Functions | Public Attributes | List of all members
sdf.CylinderZ Class Reference

Public Member Functions

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

Public Attributes

 Xc
 
 Yc
 
 Zc
 
 xc
 
 yc
 
 zc
 
 radius
 
 normal
 
 dNormal
 

Detailed Description

Definition at line 37 of file sdf.py.

Constructor & Destructor Documentation

◆ __init__() [1/3]

def sdf.CylinderZ.__init__ (   self,
  Xc,
  Yc,
  Zc,
  diameter 
)

Definition at line 85 of file sdf.py.

85  def __init__(self, Xc, Yc, Zc, diameter):
86  # Initial Centroid
87  self.Xc = Xc
88  self.Yc = Yc
89  self.Zc = Zc
90 
91  # Current Centroid
92  self.xc = Xc
93  self.yc = Yc
94  self.zc = Zc
95 
96  # Indenter Dimensions
97  self.radius = diameter/2
98 

◆ __init__() [2/3]

def sdf.CylinderZ.__init__ (   self,
  Xc,
  Yc,
  Zc,
  diameter 
)

Definition at line 55 of file sdf.py.

55  def __init__(self, Xc, Yc, Zc, diameter):
56  # Initial Centroid
57  self.Xc = Xc
58  self.Yc = Yc
59  self.Zc = Zc
60 
61  # Current Centroid
62  self.xc = Xc
63  self.yc = Yc
64  self.zc = Zc
65 
66  # Indenter Dimensions
67  self.radius = diameter/2
68 

◆ __init__() [3/3]

def sdf.CylinderZ.__init__ (   self,
  Xc,
  Yc,
  Zc,
  diameter 
)

Definition at line 85 of file sdf.py.

85  def __init__(self, Xc, Yc, Zc, diameter):
86  # Initial Centroid
87  self.Xc = Xc
88  self.Yc = Yc
89  self.Zc = Zc
90 
91  # Current Centroid
92  self.xc = Xc
93  self.yc = Yc
94  self.zc = Zc
95 
96  # Indenter Dimensions
97  self.radius = diameter/2
98 

Member Function Documentation

◆ gradSdf() [1/4]

def sdf.CylinderZ.gradSdf (   self,
  x,
  y,
  z 
)

Definition at line 72 of file sdf.py.

72  def gradSdf(self, x, y, z):
73  a = (x-self.xc)**2 + (y-self.yc)**2
74  c_val_A = 1./np.sqrt(a)
75  c_val_dx = c_val_A * (x-self.xc)
76  c_val_dy = c_val_A * (y-self.yc)
77  c_val_dz = np.zeros_like(c_val_dy)
78  # x, y, z
79  return np.hstack([c_val_dx.reshape((-1,1)), c_val_dy.reshape((-1,1)), c_val_dz.reshape((-1,1))])
80 

◆ gradSdf() [2/4]

def sdf.CylinderZ.gradSdf (   self,
  x,
  y,
  z 
)

Definition at line 108 of file sdf.py.

108  def gradSdf(self, x, y, z):
109  a = (x-self.xc)**2 + (y-self.yc)**2
110  c_val = np.sqrt(a)
111  c_val_A = 1./c_val
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)
115  # x, y, z
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])
120  return grad_array
121 

◆ gradSdf() [3/4]

def sdf.CylinderZ.gradSdf (   self,
  x,
  y,
  z 
)

Definition at line 108 of file sdf.py.

108  def gradSdf(self, x, y, z):
109  a = (x-self.xc)**2 + (y-self.yc)**2
110  c_val = np.sqrt(a)
111  c_val_A = 1./c_val
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)
115  # x, y, z
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])
120  return grad_array
121 

◆ gradSdf() [4/4]

def sdf.CylinderZ.gradSdf (   xc,
  yc,
  x,
  y 
)

Definition at line 44 of file sdf.py.

44  def gradSdf(xc, yc, x, y):
45  a = pow(x-xc, 2)+pow(y-yc, 2)
46  c_val = math.sqrt(a)
47  c_val_A = 1/c_val
48  c_val_dx = c_val_A * (x-xc)
49  c_val_dy = c_val_A * (y-yc)
50  # x, y, z
51  return [c_val_dx, c_val_dy, 0]
52 

◆ hessSdf() [1/4]

def sdf.CylinderZ.hessSdf (   self,
  x,
  y,
  z 
)

Definition at line 81 of file sdf.py.

81  def hessSdf(self, x, y, z):
82  a = (x-self.xc)**2 + (y-self.yc)**2
83  c_val_A = 1./np.sqrt(a)
84  c_val_B = 1./(a**(3./2.))
85  Hxx = c_val_A - c_val_B * (x-self.xc)**2
86  Hxy = -c_val_B * (x-self.xc)*(y-self.yc)
87  Hyy = c_val_A - c_val_B * (y-self.yc)**2
88  zeros = np.zeros_like(Hxx).reshape((-1,1))
89  # Hxx, Hxy, Hzx, Hyy, Hzy, Hzz
90  return np.hstack([Hxx.reshape((-1,1)), Hxy.reshape((-1,1)), zeros, Hyy.reshape((-1,1)), zeros, zeros])
91 

◆ hessSdf() [2/4]

def sdf.CylinderZ.hessSdf (   self,
  x,
  y,
  z 
)

Definition at line 122 of file sdf.py.

122  def hessSdf(self, x, y, z):
123  a = (x-self.xc)**2 + (y-self.yc)**2
124  c_val = np.sqrt(a)
125  c_val_A = 1./c_val
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
130 
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])
138 
139  return hess_array
140 

◆ hessSdf() [3/4]

def sdf.CylinderZ.hessSdf (   self,
  x,
  y,
  z 
)

Definition at line 122 of file sdf.py.

122  def hessSdf(self, x, y, z):
123  a = (x-self.xc)**2 + (y-self.yc)**2
124  c_val = np.sqrt(a)
125  c_val_A = 1./c_val
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
130 
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])
138 
139  return hess_array
140 

◆ hessSdf() [4/4]

def sdf.CylinderZ.hessSdf (   xc,
  yc,
  x,
  y 
)

Definition at line 53 of file sdf.py.

53  def hessSdf(xc, yc, x, y):
54  a = pow(x-xc, 2)+pow(y-yc, 2)
55  c_val = math.sqrt(a)
56  c_val_A = 1./c_val
57  c_val_B = 1./pow(a, 3./2.)
58  c_val_dx_dx = c_val_A - c_val_B * pow(x-xc, 2)
59  c_val_dx_dy = -c_val_B * (x-xc)*(y-yc)
60  c_val_dy_dy = c_val_A - c_val_B * pow(y-yc, 2)
61  # xx, yx, zx, yy, zy, zz
62  return [c_val_dx_dx, c_val_dx_dy, 0, c_val_dy_dy, 0, 0]

◆ sDF() [1/4]

def sdf.CylinderZ.sDF (   r,
  xc,
  yc,
  x,
  y 
)

Definition at line 39 of file sdf.py.

39  def sDF(r, xc, yc, x, y):
40  a = pow(x-xc, 2)+pow(y-yc, 2)
41  c_val = math.sqrt(a)-r
42  return c_val
43 

◆ sDF() [2/4]

def sdf.CylinderZ.sDF (   self,
  x,
  y,
  z 
)

Definition at line 69 of file sdf.py.

69  def sDF(self, x, y, z):
70  return np.sqrt((x - self.xc)**2 + (y - self.yc)**2) - self.radius
71 

◆ sDF() [3/4]

def sdf.CylinderZ.sDF (   self,
  x,
  y,
  z 
)

Definition at line 99 of file sdf.py.

99  def sDF(self, x, y, z):
100  a = (x-self.xc)**2 + (y-self.yc)**2
101  gap = np.sqrt(a)-self.radius
102 
103  self.normal = self.gradSdf(x,y,z)
104  self.dNormal = self.hessSdf(x,y,z)
105 
106  return gap
107 

◆ sDF() [4/4]

def sdf.CylinderZ.sDF (   self,
  x,
  y,
  z 
)

Definition at line 99 of file sdf.py.

99  def sDF(self, x, y, z):
100  a = (x-self.xc)**2 + (y-self.yc)**2
101  gap = np.sqrt(a)-self.radius
102 
103  self.normal = self.gradSdf(x,y,z)
104  self.dNormal = self.hessSdf(x,y,z)
105 
106  return gap
107 

Member Data Documentation

◆ dNormal

sdf.CylinderZ.dNormal

Definition at line 104 of file sdf.py.

◆ normal

sdf.CylinderZ.normal

Definition at line 103 of file sdf.py.

◆ radius

sdf.CylinderZ.radius

Definition at line 97 of file sdf.py.

◆ Xc

sdf.CylinderZ.Xc

Definition at line 87 of file sdf.py.

◆ xc

sdf.CylinderZ.xc

Definition at line 92 of file sdf.py.

◆ Yc

sdf.CylinderZ.Yc

Definition at line 88 of file sdf.py.

◆ yc

sdf.CylinderZ.yc

Definition at line 93 of file sdf.py.

◆ Zc

sdf.CylinderZ.Zc

Definition at line 89 of file sdf.py.

◆ zc

sdf.CylinderZ.zc

Definition at line 94 of file sdf.py.


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