use crate::{
constitutive::ConstitutiveError,
math::{Scalar, TensorTuple, TensorTupleVec},
mechanics::DeformationGradientPlastic,
};
use std::fmt::Debug;
pub type StateVariables = TensorTuple<DeformationGradientPlastic, Scalar>;
pub type StateVariablesHistory = TensorTupleVec<DeformationGradientPlastic, Scalar>;
pub trait Plastic
where
Self: Clone + Debug,
{
fn initial_yield_stress(&self) -> Scalar;
fn hardening_slope(&self) -> Scalar;
fn yield_stress(&self, equivalent_plastic_strain: Scalar) -> Result<Scalar, ConstitutiveError> {
Ok(self.initial_yield_stress() + self.hardening_slope() * equivalent_plastic_strain)
}
}