Skip to main content

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

1use super::{super::Node, SolidElement};
2use crate::{
3    constitutive::{ConstitutiveError, solid::hyperelastic::Hyperelastic},
4    domain::NodalCoordinates,
5    math::Quantity,
6    units::Energy,
7};
8
9pub use crate::domain::block::element::solid::hyperelastic::HyperelasticElement;
10
11impl<C> HyperelasticElement<C> for Node
12where
13    C: Hyperelastic,
14{
15    fn helmholtz_free_energy(
16        &self,
17        constitutive_model: &C,
18        nodal_coordinates: &NodalCoordinates<3>,
19    ) -> Result<Quantity<Energy>, ConstitutiveError> {
20        Ok(constitutive_model
21            .helmholtz_free_energy_density(&self.deformation_gradients(nodal_coordinates))?
22            * self.volume)
23    }
24}