v0.14.0
sdf_hertz_2d_axisymm_plane.py
Go to the documentation of this file.
1 import math
2 import numpy as np
3 
4 d = 0.01 # indentation depth
5 
6 xc = 0
7 yc = 0
8 zc = 0
9 
10 def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
11  return yPlane.sDF(xc, yc - d * t, zc, x, y, z)
12 
13 def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
14  return yPlane.gradSdf(xc, yc - d * t, zc, x, y, z)
15 
16 def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
17  return yPlane.hessSdf(xc, yc - d * t, zc, x, y, z)
18 
19 class yPlane:
20  def sDF(xc, yc, zc, x, y, z):
21  return np.subtract(yc, y)
22 
23  def gradSdf(xc, yc, zc, x, y, z):
24  dx = np.zeros_like(x).reshape((-1, 1))
25  dy = np.full_like(y, -1).reshape((-1, 1))
26  dz = np.zeros_like(z).reshape((-1, 1))
27  return np.hstack([dx, dy, dz])
28 
29  def hessSdf(xc, yc, zc, x, y, z):
30  zeros = np.zeros_like(x).reshape((-1, 1))
31  return np.hstack([zeros for _ in range(6)]) # xx, yx, zx, yy, zy, zz
sdf_hertz_2d_axisymm_plane.yPlane.gradSdf
def gradSdf(xc, yc, zc, x, y, z)
Definition: sdf_hertz_2d_axisymm_plane.py:23
sdf_hertz_2d_axisymm_plane.yPlane
Definition: sdf_hertz_2d_axisymm_plane.py:19
sdf_hertz_2d_axisymm_plane.hess_sdf
def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_hertz_2d_axisymm_plane.py:16
sdf_hertz_2d_axisymm_plane.yPlane.sDF
def sDF(xc, yc, zc, x, y, z)
Definition: sdf_hertz_2d_axisymm_plane.py:20
sdf_hertz_2d_axisymm_plane.sdf
def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_hertz_2d_axisymm_plane.py:10
sdf_hertz_2d_axisymm_plane.yPlane.hessSdf
def hessSdf(xc, yc, zc, x, y, z)
Definition: sdf_hertz_2d_axisymm_plane.py:29
sdf_hertz_2d_axisymm_plane.grad_sdf
def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_hertz_2d_axisymm_plane.py:13