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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
//! SiC/SiC — **orthotropic** damage of a woven ceramic-matrix composite.
//!
//! A SiC/SiC composite is a silicon-carbide matrix reinforced by SiC fibre tows,
//! usually woven. It fails nothing like a metal or like concrete: the matrix
//! cracks first, in planes normal to the tow directions, while the fibres keep
//! carrying load across those cracks. The stiffness therefore falls **by
//! direction**, and by very different amounts in each.
//!
//! No isotropic damage variable can express that. This law carries **one damage
//! per material direction**:
//!
//! ```text
//! d_i = d_max,i · (1 − exp(−(⟨ε_i⟩₊ − ε_0,i)/ε_c,i)) for ⟨ε_i⟩₊ > ε_0,i
//! ```
//!
//! and degrades the orthotropic stiffness direction by direction. The positive
//! part is what matters: a matrix crack opens in **extension** and closes again
//! in compression, so a direction under compression is not degraded at all.
//!
//! ## The material frame is the weave
//!
//! The damage directions are the **material axes**, supplied exactly as for
//! [orthotropic elasticity](crate::models::symmetry) — by the vectors `V1`, `V2`
//! carried in the material field. That is not a coincidence: for a woven
//! composite they *are* the tow directions, and reusing the same frame means a
//! curved part (a wound tube, a shaped panel) gets its damage directions right
//! for free, cell by cell.
//!
//! ## Saturation, not failure
//!
//! Each `d_i` saturates at `d_max,i` rather than reaching one. That is the
//! physical statement that matrix cracking **does not** take the whole
//! stiffness: the fibres remain, and a saturated composite still carries load
//! along its tows. A law that let the damage reach one would predict a collapse
//! that does not happen.
use crateResult;
use crate;
use cratesymmetry;
use Matrix3;
/// The law's material contract: the elastic constants, then a threshold, a
/// characteristic strain and a saturation per direction — plus the material
/// frame, which the assembler resolves like any other component.
///
/// ```
/// # use pyrucast::aggregate::Aggregate;
/// # use pyrucast::atoms::{ElementType, Node};
/// # use pyrucast::containers::element_field::SubElementField;
/// # use pyrucast::containers::finite_element_space::FiniteElementSpace;
/// # use pyrucast::containers::mesh::{Mesh, SubMesh};
/// # use pyrucast::coords::Coords;
/// # use pyrucast::handle::Handle;
/// # use pyrucast::models::damage::{self, DamageLaw, MatRead};
/// # let coords = Handle::new(Coords::new(2).unwrap());
/// # let n: Vec<Node> = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
/// # .iter().map(|p| Node::create_in(coords.clone(), p).unwrap()).collect();
/// # let mut sm = SubMesh::new(coords.clone(), ElementType::TRI3);
/// # sm.add_cell(&[n[0].id(), n[1].id(), n[2].id()]).unwrap();
/// # let fes = FiniteElementSpace::lagrange1(&Mesh::from_submesh(sm)).unwrap();
/// # let materiau = SubElementField::from_uniform_per_component(
/// # fes.get(0).unwrap(), vec!["E".into(), "nu".into(), "eps_0_1".into(), "eps_c_1".into(), "d_max_1".into(), "eps_0_2".into(), "eps_c_2".into(), "d_max_2".into(), "eps_0_3".into(), "eps_c_3".into(), "d_max_3".into(), "V1X".into(), "V1Y".into()], &[200000.0, 0.2, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 1.0, 0.0]).unwrap();
/// # let mat = MatRead { field: &materiau, cell: 0 };
/// // Trois directions de tissage, chacune avec son seuil, sa saturation et
/// // son endommagement maximal — plus l'axe du repère matériau.
/// assert!(damage::sic_sic::MATERIAL_2D.contains(&"V1X"));
/// assert!(!damage::sic_sic::MATERIAL_2D.contains(&"V2X")); // 2-D : un seul axe
/// # Ok::<(), pyrucast::PyrucastError>(())
/// ```
pub const MATERIAL_2D: & = &;
/// The same, with the two axes a 3-D frame needs.
///
/// ```
/// # use pyrucast::aggregate::Aggregate;
/// # use pyrucast::atoms::{ElementType, Node};
/// # use pyrucast::containers::element_field::SubElementField;
/// # use pyrucast::containers::finite_element_space::FiniteElementSpace;
/// # use pyrucast::containers::mesh::{Mesh, SubMesh};
/// # use pyrucast::coords::Coords;
/// # use pyrucast::handle::Handle;
/// # use pyrucast::models::damage::{self, DamageLaw, MatRead};
/// # let coords = Handle::new(Coords::new(2).unwrap());
/// # let n: Vec<Node> = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
/// # .iter().map(|p| Node::create_in(coords.clone(), p).unwrap()).collect();
/// # let mut sm = SubMesh::new(coords.clone(), ElementType::TRI3);
/// # sm.add_cell(&[n[0].id(), n[1].id(), n[2].id()]).unwrap();
/// # let fes = FiniteElementSpace::lagrange1(&Mesh::from_submesh(sm)).unwrap();
/// # let materiau = SubElementField::from_uniform_per_component(
/// # fes.get(0).unwrap(), vec!["E".into(), "nu".into(), "eps_0_1".into(), "eps_c_1".into(), "d_max_1".into(), "eps_0_2".into(), "eps_c_2".into(), "d_max_2".into(), "eps_0_3".into(), "eps_c_3".into(), "d_max_3".into(), "V1X".into(), "V1Y".into()], &[200000.0, 0.2, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 1.0, 0.0]).unwrap();
/// # let mat = MatRead { field: &materiau, cell: 0 };
/// // En 3-D, le repère demande deux axes ; le troisième est V1 × V2.
/// assert!(damage::sic_sic::MATERIAL_3D.contains(&"V2X"));
/// assert!(damage::sic_sic::MATERIAL_3D.len() > damage::sic_sic::MATERIAL_2D.len());
/// # Ok::<(), pyrucast::PyrucastError>(())
/// ```
pub const MATERIAL_3D: & = &;
/// One SiC/SiC step.
///
/// `prev` carries the three history variables `κ_i = max_t ⟨ε_i⟩₊`, one per
/// material direction.
///
/// ```
/// # use pyrucast::aggregate::Aggregate;
/// # use pyrucast::atoms::{ElementType, Node};
/// # use pyrucast::containers::element_field::SubElementField;
/// # use pyrucast::containers::finite_element_space::FiniteElementSpace;
/// # use pyrucast::containers::mesh::{Mesh, SubMesh};
/// # use pyrucast::coords::Coords;
/// # use pyrucast::handle::Handle;
/// # use pyrucast::models::damage::{self, DamageLaw, MatRead};
/// # let coords = Handle::new(Coords::new(2).unwrap());
/// # let n: Vec<Node> = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
/// # .iter().map(|p| Node::create_in(coords.clone(), p).unwrap()).collect();
/// # let mut sm = SubMesh::new(coords.clone(), ElementType::TRI3);
/// # sm.add_cell(&[n[0].id(), n[1].id(), n[2].id()]).unwrap();
/// # let fes = FiniteElementSpace::lagrange1(&Mesh::from_submesh(sm)).unwrap();
/// # let materiau = SubElementField::from_uniform_per_component(
/// # fes.get(0).unwrap(), vec!["E".into(), "nu".into(), "eps_0_1".into(), "eps_c_1".into(), "d_max_1".into(), "eps_0_2".into(), "eps_c_2".into(), "d_max_2".into(), "eps_0_3".into(), "eps_c_3".into(), "d_max_3".into(), "V1X".into(), "V1Y".into()], &[200000.0, 0.2, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 0.0001, 0.01, 0.9, 1.0, 0.0]).unwrap();
/// # let mat = MatRead { field: &materiau, cell: 0 };
/// // Un endommagement **par direction de tissage** : l'état en porte six,
/// // trois seuils et trois endommagements.
/// let u = damage::sic_sic::update(&[1e-3, 0.0, 0.0, 0.0, 0.0, 0.0], &[0.0; 6], &mat, 2)?;
/// assert_eq!(u.vars.len(), 6);
/// // Une traction selon le premier axe n'endommage que celui-là.
/// assert!(u.vars[3] > 0.0);
/// assert_eq!(u.vars[4], 0.0);
/// # Ok::<(), pyrucast::PyrucastError>(())
/// ```