1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! Elastic laws — identity, contract, and the integration structure they share.
//!
//! `<physique>/law.rs` : the enum an archive stores, the trait the physics
//! drives, and the single `match` relating the two.
use crateResult;
use crateMatRead;
use crateContinuum;
use crateMaterialSymmetry;
use ;
/// Which elastic law an [`Elasticity`](super::Elasticity) evaluates.
///
/// One variant for now. The axis exists because it is the one the two sibling
/// physics already have, and because the next elastic law — a hyperelastic one —
/// is a law, not a physics: same DOFs, same modelling, same layouts.
///
/// New variants go at the end: `bincode` serialises the index.
///
/// ```
/// # use pyrucast::models::elasticity::law::ElasticLaw;
/// # use pyrucast::named::Named;
/// // Réciproque exacte de `from_name`, comme pour les deux autres familles.
/// assert!(ElasticLaw::ALL.iter().all(|l| ElasticLaw::from_name(l.name()) == Some(*l)));
/// assert_eq!(ElasticLaw::default(), ElasticLaw::Linear);
/// ```
/// The **stateless** family of constitutive laws: `σ = f(ε)`, with no previous
/// state and no time increment.
///
/// The trait is named after that **integration structure**, not after a physical
/// family, because the structure is what fixes its signature — a strain in, a
/// stress out, and nothing to carry between steps. Linear elasticity lives here;
/// a hyperelastic law (`σ = ∂W/∂ε`), being path-independent, would join it. Its
/// siblings are `ReturnMapLawKind` (elastic predictor plus projection) and
/// `DirectUpdateLawKind` (state, but no predictor).
///
/// Same division of labour as [`SubModelKind`](crate::models::SubModelKind) one
/// level up: the enum [`ElasticLaw`] carries the **physical identity** — what an
/// archive stores — and the trait carries the **integration structure**, so a
/// single `match` ([`ElasticLaw::as_law`]) relates the two.
///
/// Adding a law: a unit struct and its `impl` in the law's own file, plus one
/// arm in `as_law`.
pub