Skip to main content

conspire/domain/cbm/block/node/solid/hyperelastic_viscoplastic/
mod.rs

1use super::{super::Node, SolidElement};
2use crate::{
3    constitutive::{ConstitutiveError, solid::hyperelastic_viscoplastic::HyperelasticViscoplastic},
4    domain::{NodalCoordinates, block::element::solid::viscoplastic::ViscoplasticStateVariables},
5    math::{Differentiable, Quantity, Tensor},
6    units::Energy,
7};
8
9pub use crate::domain::block::element::solid::hyperelastic_viscoplastic::HyperelasticViscoplasticElement;
10
11impl<C, Y> HyperelasticViscoplasticElement<C, 1, Y> for Node
12where
13    C: HyperelasticViscoplastic<Y>,
14    Y: Differentiable + Tensor,
15{
16    fn helmholtz_free_energy(
17        &self,
18        constitutive_model: &C,
19        nodal_coordinates: &NodalCoordinates<3>,
20        state_variables: &ViscoplasticStateVariables<1, Y>,
21    ) -> Result<Quantity<Energy>, ConstitutiveError> {
22        let (deformation_gradient_p, _) = (&state_variables[0]).into();
23        Ok(constitutive_model.helmholtz_free_energy_density(
24            &self.deformation_gradients(nodal_coordinates),
25            deformation_gradient_p,
26        )? * self.volume)
27    }
28}