kaolin.physics.materials¶
API¶
- class kaolin.physics.materials.NeohookeanElasticMaterial(mu, lam, integration_pt_volume, reparameterize_lame=False)¶
Bases:
objectNeohookean elastic material class.
- __init__(mu, lam, integration_pt_volume, reparameterize_lame=False)¶
Initializes a NeohookeanElasticMaterial object.
- Parameters
mu (wp.array(dtype=wp.float32)) – Lame coefficient mu
lam (wp.array(dtype=wp.float32)) – Lame coefficient lambda
integration_pt_volume (wp.array(dtype=wp.float32)) – Volume distributed across each point
reparameterize_lame (bool) – If True, reparameterize the Lame coefficients (\(\lambda \leftarrow \lambda + \mu\)) so that the Neo-Hookean energy matches linear elasticity when linearized. See Stable Neo-Hookean Flesh Simulation for details. Default: False.
- energy(defo_grads, coeff=1.0, wp_energy=None)¶
Returns the neohookean elastic energy at each integration primitive.
- Parameters
defo_grads (wp.array(dtype=wp.mat33)) – Deformation gradient of size \((\text{num_pts}, 3, 3)\)
coeff (float) – Coefficient
- Returns
Neohookean elastic energy.
- Return type
wp.array(dtype=wp.float32)
- gradient(defo_grads, coeff=1.0, gradients=None)¶
Returns the neohookean elastic gradient at each integration primitive.
- Parameters
defo_grads (wp.array(dtype=wp.mat33)) – Deformation gradient of size \((\text{num_pts}, 3, 3)\)
coeff (float) – Coefficient
- Returns
Neohookean elastic gradient of size \((\text{num_pts}, 9)\)
- Return type
wp.array(dtype=wp.mat33)
- hessian(defo_grads, coeff=1.0)¶
Returns the neohookean elastic hessian at each integration primitive.
- Parameters
defo_grads (wp.array(dtype=wp.mat33)) – Deformation gradient of size \((\text{num_pts}, 3, 3)\)
coeff (float) – Coefficient
- Returns
Neohookean elastic hessian of size \((\text{num_pts}, 9, 9)\).
- Return type
wps.bsr_matrix
- kaolin.physics.materials.get_defo_grad(wp_z, wp_dFdz)¶
Get the deformation gradient per-sample point.
- Parameters
wp_z (wp.array(dtype=wp.float)) – Warp array of the deformation gradient Jacobian. Vector of size \((12\text{handles},)\)
wp_dFdz (wp.sparse.bsr_matrix) – Sparse matrix of the deformation gradient Jacobian. Sparse matrix size \((9 \text{num_points}, 12 \text{handles})\). Block shape \((9, 4)\)
- Returns
Warp array of wp.mat33 deformation gradients.
- Return type
wp.array(dtype=wp.mat33)
- kaolin.physics.materials.to_lame(yms, prs)¶
Converts youngs modulus and poissons ratio to lame parameters
- Parameters
yms (torch.Tensor) – tensor of youngs modulus (in \(kg/m/s^2\))
prs (torch.Tensor) – tensor of poisson ratios
- Returns
lame parameter mu and lamda
- Return type