conspire/constitutive/hybrid/elastic/multiplicative/viscoplastic/
mod.rs1#[cfg(test)]
2mod test;
3
4use crate::{
5 constitutive::{
6 ConstitutiveError,
7 fluid::{
8 plastic::Plastic,
9 viscoplastic::{Viscoplastic, ViscoplasticStateVariables},
10 },
11 hybrid::ElasticMultiplicativeViscoplastic,
12 solid::{
13 Solid,
14 elastic::Elastic,
15 elastic_viscoplastic::{ElasticPlasticOrViscoplastic, ElasticViscoplastic},
16 },
17 },
18 math::{
19 ContractFirstSecondIndicesWithSecondIndicesOf, ContractSecondIndexWithFirstIndexOf, Rank2,
20 Scalar, Tensor,
21 },
22 mechanics::{
23 CauchyStress, CauchyTangentStiffness, CauchyTangentStiffnessElastic, DeformationGradient,
24 DeformationGradientPlastic, FirstPiolaKirchhoffStress, FirstPiolaKirchhoffStressElastic,
25 FirstPiolaKirchhoffTangentStiffness, FirstPiolaKirchhoffTangentStiffnessElastic,
26 MandelStressElastic, SecondPiolaKirchhoffStress, SecondPiolaKirchhoffStressElastic,
27 SecondPiolaKirchhoffTangentStiffness, SecondPiolaKirchhoffTangentStiffnessElastic,
28 },
29};
30
31impl<C1, C2, Y2> Solid for ElasticMultiplicativeViscoplastic<C1, C2, Y2>
32where
33 C1: Elastic,
34 C2: Viscoplastic<Y2>,
35 Y2: Tensor,
36{
37 fn bulk_modulus(&self) -> Scalar {
38 self.0.bulk_modulus()
39 }
40 fn shear_modulus(&self) -> Scalar {
41 self.0.shear_modulus()
42 }
43}
44
45impl<C1, C2, Y2> Plastic for ElasticMultiplicativeViscoplastic<C1, C2, Y2>
46where
47 C1: Elastic,
48 C2: Viscoplastic<Y2>,
49 Y2: Tensor,
50{
51 fn initial_yield_stress(&self) -> Scalar {
52 self.1.initial_yield_stress()
53 }
54 fn hardening_slope(&self) -> Scalar {
55 self.1.hardening_slope()
56 }
57}
58
59impl<C1, C2, Y2> Viscoplastic<Y2> for ElasticMultiplicativeViscoplastic<C1, C2, Y2>
60where
61 C1: Elastic,
62 C2: Viscoplastic<Y2>,
63 Y2: Tensor,
64{
65 fn initial_state(&self) -> ViscoplasticStateVariables<Y2> {
66 self.1.initial_state()
67 }
68 fn plastic_evolution(
69 &self,
70 mandel_stress: MandelStressElastic,
71 state_variables: &ViscoplasticStateVariables<Y2>,
72 ) -> Result<ViscoplasticStateVariables<Y2>, ConstitutiveError> {
73 self.1.plastic_evolution(mandel_stress, state_variables)
74 }
75 fn rate_sensitivity(&self) -> Scalar {
76 self.1.rate_sensitivity()
77 }
78 fn reference_flow_rate(&self) -> Scalar {
79 self.1.reference_flow_rate()
80 }
81}
82
83impl<C1, C2, Y2> ElasticPlasticOrViscoplastic for ElasticMultiplicativeViscoplastic<C1, C2, Y2>
84where
85 C1: Elastic,
86 C2: Viscoplastic<Y2>,
87 Y2: Tensor,
88{
89 fn cauchy_stress(
90 &self,
91 deformation_gradient: &DeformationGradient,
92 deformation_gradient_p: &DeformationGradientPlastic,
93 ) -> Result<CauchyStress, ConstitutiveError> {
94 self.0
95 .cauchy_stress(&(deformation_gradient * deformation_gradient_p.inverse()).into())
96 }
97 fn cauchy_tangent_stiffness(
98 &self,
99 deformation_gradient: &DeformationGradient,
100 deformation_gradient_p: &DeformationGradientPlastic,
101 ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
102 let deformation_gradient_p_inverse = deformation_gradient_p.inverse();
103 Ok(
104 CauchyTangentStiffnessElastic::from(self.0.cauchy_tangent_stiffness(
105 &(deformation_gradient * &deformation_gradient_p_inverse).into(),
106 )?) * deformation_gradient_p_inverse.transpose(),
107 )
108 }
109 fn first_piola_kirchhoff_stress(
110 &self,
111 deformation_gradient: &DeformationGradient,
112 deformation_gradient_p: &DeformationGradientPlastic,
113 ) -> Result<FirstPiolaKirchhoffStress, ConstitutiveError> {
114 let deformation_gradient_p_inverse = deformation_gradient_p.inverse();
115 Ok(
116 FirstPiolaKirchhoffStressElastic::from(self.0.first_piola_kirchhoff_stress(
117 &(deformation_gradient * &deformation_gradient_p_inverse).into(),
118 )?) * deformation_gradient_p_inverse.transpose(),
119 )
120 }
121 fn first_piola_kirchhoff_tangent_stiffness(
122 &self,
123 deformation_gradient: &DeformationGradient,
124 deformation_gradient_p: &DeformationGradientPlastic,
125 ) -> Result<FirstPiolaKirchhoffTangentStiffness, ConstitutiveError> {
126 let deformation_gradient_p_inverse = deformation_gradient_p.inverse();
127 let deformation_gradient_p_inverse_transpose = deformation_gradient_p_inverse.transpose();
128 Ok((FirstPiolaKirchhoffTangentStiffnessElastic::from(
129 self.0.first_piola_kirchhoff_tangent_stiffness(
130 &(deformation_gradient * &deformation_gradient_p_inverse).into(),
131 )?,
132 ) * &deformation_gradient_p_inverse_transpose)
133 .contract_second_index_with_first_index_of(&deformation_gradient_p_inverse_transpose))
134 }
135 fn second_piola_kirchhoff_stress(
136 &self,
137 deformation_gradient: &DeformationGradient,
138 deformation_gradient_p: &DeformationGradientPlastic,
139 ) -> Result<SecondPiolaKirchhoffStress, ConstitutiveError> {
140 let deformation_gradient_p_inverse = deformation_gradient_p.inverse();
141 Ok(&deformation_gradient_p_inverse
142 * SecondPiolaKirchhoffStressElastic::from(self.0.second_piola_kirchhoff_stress(
143 &(deformation_gradient * &deformation_gradient_p_inverse).into(),
144 )?)
145 * deformation_gradient_p_inverse.transpose())
146 }
147 fn second_piola_kirchhoff_tangent_stiffness(
148 &self,
149 deformation_gradient: &DeformationGradient,
150 deformation_gradient_p: &DeformationGradientPlastic,
151 ) -> Result<SecondPiolaKirchhoffTangentStiffness, ConstitutiveError> {
152 let deformation_gradient_p_inverse = deformation_gradient_p.inverse();
153 Ok((SecondPiolaKirchhoffTangentStiffnessElastic::from(
154 self.0.second_piola_kirchhoff_tangent_stiffness(
155 &(deformation_gradient * &deformation_gradient_p_inverse).into(),
156 )?,
157 ) * deformation_gradient_p_inverse.transpose())
158 .contract_first_second_indices_with_second_indices_of(
159 &deformation_gradient_p_inverse,
160 &deformation_gradient_p_inverse,
161 ))
162 }
163}
164
165impl<C1, C2, Y2> ElasticViscoplastic<Y2> for ElasticMultiplicativeViscoplastic<C1, C2, Y2>
166where
167 C1: Elastic,
168 C2: Viscoplastic<Y2>,
169 Y2: Tensor,
170{
171}