gs.materials.FEM.Elastic#
- class genesis.engine.materials.FEM.elastic.Elastic(E=1000000.0, nu=0.2, rho=1000.0, hydroelastic_modulus=10000000.0, friction_mu=0.1, model='linear')[source]#
Bases:
BaseThe elastic material class for FEM.
- Parameters:
E (float, optional) – Young’s modulus, which controls stiffness. Default is 1e6.
nu (float, optional) – Poisson ratio, describing the material’s volume change under stress. Default is 0.2.
rho (float, optional) – Material density (kg/m^3). Default is 1000.
hydroelastic_modulus (float, optional) – Hydroelastic modulus for hydroelastic contact. Default is 1e7.
friction_mu (float, optional) – Friction coefficient. Default is 0.1.
model (str, optional) – Constitutive model to use for stress computation. Options are: - ‘linear’: Linear elasticity model - ‘stable_neohookean’: A numerically stable Neo-Hookean model - ‘linear_corotated’: Linear corotated elasticity model Default is ‘linear’.
- compute_energy_gradient_hessian_linear(mu, lam, J, F, actu, m_dir, i_e, i_b, hessian_field)[source]#
Compute the energy, gradient, and Hessian for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
hessian_field (ti.Matrix) – The Hessian of the energy with respect to the deformation gradient F.
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- compute_energy_gradient_linear(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy, gradient for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- compute_energy_linear(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
- Returns:
energy – The computed energy.
- Return type:
float
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- compute_energy_gradient_hessian_stable_neohookean(mu, lam, J, F, actu, m_dir, i_e, i_b, hessian_field)[source]#
Compute the energy, gradient, and Hessian for the stable Neo-Hookean model.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in stable Neo-Hookean).
m_dir (ti.Matrix) – The material direction (not used in stable Neo-Hookean).
hessian_field (ti.Matrix) – The Hessian of the energy with respect to the deformation gradient F.
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
- Raises:
NotImplementedError – This implementation does not compute the Hessian for the stable Neo-Hookean model. The Hessian needs SVD decomposition for accurate computation, which is not implemented here.
Notes
This implementation is adapted from the HOBAKv1 stable Neo-Hookean model: theodorekim/HOBAKv1
- compute_energy_gradient_stable_neohookean(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy, gradient for the stable Neo-Hookean model.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in stable Neo-Hookean).
m_dir (ti.Matrix) – The material direction (not used in stable Neo-Hookean).
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
- Raises:
NotImplementedError – This implementation does not compute the Gradient for the stable Neo-Hookean model.
Notes
This implementation is adapted from the HOBAKv1 stable Neo-Hookean model: theodorekim/HOBAKv1
- compute_energy_stable_neohookean(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy for the stable Neo-Hookean model.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in stable Neo-Hookean).
m_dir (ti.Matrix) – The material direction (not used in stable Neo-Hookean).
- Returns:
energy – The computed energy.
- Return type:
float
Notes
This implementation is adapted from the HOBAKv1 stable Neo-Hookean model: theodorekim/HOBAKv1
- compute_energy_gradient_hessian_linear_corotated(mu, lam, J, F, actu, m_dir, i_e, i_b, hessian_field)[source]#
Compute the energy, gradient, and Hessian for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
hessian_field (ti.Matrix) – The Hessian of the energy with respect to the deformation gradient F.
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- compute_energy_gradient_linear_corotated(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy, gradient for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
- Returns:
energy (float) – The computed energy.
gradient (ti.Matrix) – The gradient of the energy with respect to the deformation gradient F.
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- compute_energy_linear_corotated(mu, lam, J, F, actu, m_dir, i_e, i_b)[source]#
Compute the energy for linear elasticity.
- Parameters:
mu (float) – The first Lame parameter (shear modulus).
lam (float) – The second Lame parameter (related to volume change).
J (float) – The determinant of the deformation gradient F.
F (ti.Matrix) – The deformation gradient matrix.
actu (ti.Matrix) – The activation matrix (not used in linear elasticity).
m_dir (ti.Matrix) – The material direction (not used in linear elasticity).
- Returns:
energy – The computed energy.
- Return type:
float
Notes
This implementation assumes small deformations and linear stress-strain relationship. It is adapted from the HOBAKv1 implementation for linear elasticity: theodorekim/HOBAKv1
- property model#
The name of the constitutive model (‘linear’ or ‘stable_neohookean’).