use crate::units::Stress;
use crate::{constitutive::ConstitutiveError, math::Quantity};
use std::fmt::Debug;
pub trait Plastic
where
Self: Clone + Debug,
{
fn initial_yield_stress(&self) -> Quantity<Stress>;
fn hardening_slope(&self) -> Quantity<Stress>;
fn yield_stress(
&self,
equivalent_plastic_strain: Quantity,
) -> Result<Quantity<Stress>, ConstitutiveError> {
Ok(self.initial_yield_stress() + self.hardening_slope() * equivalent_plastic_strain)
}
}