conspire/constitutive/hybrid/
mod.rs1mod elastic;
4mod elastic_viscoplastic;
5mod hyperelastic;
6mod hyperelastic_viscoplastic;
7
8pub use self::{
9 elastic::{
10 additive::ElasticAdditive,
11 multiplicative::{ElasticMultiplicative, ElasticMultiplicativeViscoplastic},
12 },
13 elastic_viscoplastic::additive::{
14 ElasticViscoplasticAdditiveElastic, ElasticViscoplasticAdditiveViscoplastic,
15 },
16};
17
18use std::{
19 any::type_name,
20 fmt::{self, Debug, Formatter},
21};
22
23#[derive(Clone)]
25pub struct Additive<C1, C2>(C1, C2);
26
27#[derive(Clone)]
29pub struct Multiplicative<C1, C2>(C1, C2);
30
31impl<C1, C2> Debug for Additive<C1, C2> {
32 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
33 write!(
34 f,
35 "Additive({}, {})",
36 type_name::<C1>()
37 .rsplit("::")
38 .next()
39 .unwrap()
40 .split("<")
41 .next()
42 .unwrap(),
43 type_name::<C2>()
44 .rsplit("::")
45 .next()
46 .unwrap()
47 .split("<")
48 .next()
49 .unwrap()
50 )
51 }
52}
53
54impl<C1, C2> Debug for Multiplicative<C1, C2> {
55 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
56 write!(
57 f,
58 "Multiplicative({}, {})",
59 type_name::<C1>()
60 .rsplit("::")
61 .next()
62 .unwrap()
63 .split("<")
64 .next()
65 .unwrap(),
66 type_name::<C2>()
67 .rsplit("::")
68 .next()
69 .unwrap()
70 .split("<")
71 .next()
72 .unwrap()
73 )
74 }
75}