v0.16.3
Loading...
Searching...
No Matches
auxiliary_logarithmic_stress_patch.py
Go to the documentation of this file.
1"""Affine patch with three unequal principal stretches and a finite rotation."""
2
3import numpy as np
4
5
6LOG_STRETCH = np.array([0.04, -0.015, 0.005])
7ROTATION = np.array([0.02, -0.015, 0.01])
8C10 = 1.7
9K = 8.5
10
11
13 angle = np.linalg.norm(ROTATION)
14 x, y, z = ROTATION
15 # MoFEM uses hat(omega)_ij = epsilon_ijk omega_k.
16 skew = np.array([[0, z, -y], [-z, 0, x], [y, -x, 0]])
17 rotation = (np.eye(3) + np.sin(angle) / angle * skew
18 + (1 - np.cos(angle)) / angle**2 * skew @ skew)
19 return rotation @ np.diag(np.exp(LOG_STRETCH))
20
21
22def analytical_disp(delta_t, t, x, y, z, tx, ty, tz, block_name):
23 points = np.column_stack((x, y, z))
24 return np.ascontiguousarray(t * points @ (deformation_gradient() - np.eye(3)).T)
25
26
27def analytical_traction(delta_t, t, x, y, z, tx, ty, tz, block_name):
28 gradient = np.eye(3) + t * (deformation_gradient() - np.eye(3))
29 jacobian = np.linalg.det(gradient)
30 inverse_transpose = np.linalg.inv(gradient).T
31 stress = (2 * C10 * jacobian**(-2 / 3)
32 * (gradient - np.sum(gradient**2) / 3 * inverse_transpose)
33 + K * jacobian * (jacobian - 1) * inverse_transpose)
34 normals = np.column_stack((tx, ty, tz))
35 normals /= np.linalg.norm(normals, axis=1)[:, None]
36 return np.ascontiguousarray(normals @ stress.T)
37
38
39def analytical_external_strain(delta_t, t, x, y, z, block_name):
40 return np.zeros((len(x), 1))
41
42
43def analytical_elastic(delta_t, t, x, y, z, block_name):
44 return np.ones((len(x), 1))
analytical_elastic(delta_t, t, x, y, z, block_name)
analytical_external_strain(delta_t, t, x, y, z, block_name)
analytical_disp(delta_t, t, x, y, z, tx, ty, tz, block_name)
analytical_traction(delta_t, t, x, y, z, tx, ty, tz, block_name)