conspire/constitutive/solid/hyperelastic_viscoplastic/canonical/
mod.rs1#[cfg(test)]
2mod test;
3
4use crate::{
5 constitutive::{
6 ConstitutiveError,
7 canonical::Canonical,
8 fluid::viscoplastic::Viscoplastic,
9 solid::{hyperelastic::Hyperelastic, hyperelastic_viscoplastic::HyperelasticViscoplastic},
10 },
11 math::{Differentiable, Quantity, Tensor},
12 mechanics::{DeformationGradient, DeformationGradientPlastic},
13 units::EnergyDensity,
14};
15
16impl<C1, C2, Y2> HyperelasticViscoplastic<Y2> for Canonical<C1, C2>
17where
18 C1: Hyperelastic,
19 C2: Viscoplastic<Y2>,
20 Y2: Differentiable + Tensor,
21{
22 fn helmholtz_free_energy_density(
23 &self,
24 deformation_gradient: &DeformationGradient,
25 deformation_gradient_p: &DeformationGradientPlastic,
26 ) -> Result<Quantity<EnergyDensity>, ConstitutiveError> {
27 let deformation_gradient_e = deformation_gradient * deformation_gradient_p.inverse();
28 self.0
29 .helmholtz_free_energy_density(&deformation_gradient_e.into())
30 }
31}