Example #1
0
ind = 0
a = aV[ind]
R = RV[ind]
w = wV[ind]
L = dfm.set_L(gammadot,R)

## Test some functions so make sure they run (not if they are right)
print("\n TESTING FORCE FUNCTIONS \n")

# Test py_set_farg 
print('\n set_farg \n')
farg = frc.py_set_farg(a, w, L, p0, mu)
print('runs')
# Test py_scale_triangulation 
print('\n scale_triangulations \n')
srf_cV_scaled, srf_areas_scaled, srf_normals_scaled = frc.py_scale_triangulations(a)
print('runs')
# Test py_set_force_facets
print('\n set_force_facets \n')
fonfTest = frc.py_set_force_facets(farg, srf_normals_scaled, srf_areas_scaled)
print('runs')
# Test set_fonfV
print('\n set_fonfV \n')
farg,fonfV,cV,srf_areas_scaled = frc.set_fonfV(a, w, R, gammadot, p0, mu)
print('runs')


###############################################################################
###############################################################################
#####################          TEST STRESS FUNCTIONS       ####################
###############################################################################
Example #2
0
t0,t1,dt,tau,cap = dfm.set_tau_cap(a0, lam, mu, gammadot, Gamma)
t1 = .025*t1
dt = .025*dt
# get the rotations, axes and angular velocity
aV, RV, wV, T = dfm.deform(t0,t1,dt,a0,lam,mu,gammadot,Gamma)

# test force_facets, which sets the force on the centers of the facets
# for a fixed time point
time_ind = 75
a = aV[time_ind]
w = wV[time_ind]
R = RV[time_ind]
fonfV, cV = frc.set_fonfV(a, w, R, gammadot, p0, mu)

# get the centers of the facets
cV, trash, srf_normals_scaled = frc.py_scale_triangulations(a)



# get the corrected magnitude of the stress for a sample intersecting plane
pn = np.array([1.0,0.0,0.0])
#px = np.zeros(3)
#px = np.array([-0.003-6.26 ,0.0,0.0])
#px2 = np.array([-0.004-6.26 ,0.0,0.0])
pnp = np.random.rand(3)
pn = pnp/np.linalg.norm(pnp)
pxp = np.random.rand(3)
px = .5*a0*pxp
N = np.shape(fonfV)[0]
nf = np.zeros(N)
for i in range(N):