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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
//! Functions to perform numerical integration using Shapes
//!
//! # Definitions
//!
//! * `ngauss` -- number of integration (Gauss) points
//! * `|J|` -- the determinant of the Jacobian dx/dξ
//! * `||J||` -- the norm of the Jacobian vector for lines in multi-dimensions
//! * `ξ` -- ksi (or xi) -- coordinates in the reference space
//! * `ιᵖ := ξᵖ` -- (**iota**-p gets ksi-p (or xi-p)) --
//! the coordinate of the integration point on the reference (natural) space
//! * `wᵖ` -- the weight of the p-th integration point
//! * Xᵀ -- Transposed matrix of coordinates
//! * N -- Shape functions
//! * L -- Derivatives of shape functions
//! * J -- Jacobian tensor
//! * J⁻¹ -- Inverse Jacobian matrix (only available if geo_ndim = space_ndim)
//! * B -- Gradients of shape functions (derivatives w.r.t real coordinates x)
//! * see also the subsection named **Expressions** below
//!
//! # Integration of scalar field over a geometric shape
//!
//! Function [scalar_field()]
//!
//! ```text
//! ⌠ → →
//! I = │ s(x(ξ)) dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! # Vector results: Integration of some combinations involving N and B resulting in vectors
//!
//! ## VEC 01: Shape(N) times scalar(S)
//!
//! Function [vec_01_ns()]
//!
//! ```text
//! ⌠ → → →
//! aᵐ = │ Nᵐ(x(ξ)) s(x) dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## VEC 01(bry): Shape(N) times scalar(S) (boundary integral version)
//!
//! Function [vec_01_ns_bry()]
//!
//! ```text
//! ⌠ → → →
//! aᵐ = │ Nᵐ(x(ξ)) s(x) dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## VEC 02: Shape(N) times vector(V)
//!
//! Function [vec_02_nv()]
//!
//! ```text
//! → ⌠ → → → →
//! bᵐ = │ Nᵐ(x(ξ)) v(x) dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## VEC 02(bry): Shape(N) times vector(V) (boundary integral version)
//!
//! Function [vec_02_nv_bry()]
//!
//! ```text
//! → ⌠ → → → →
//! bᵐ = │ Nᵐ(x(ξ)) v(x) dΓ
//! ⌡
//! Γₑ
//! ```
//!
//! ## VEC 03: Vector(V) dot gradient(B)
//!
//! Function [vec_03_bv()]
//!
//! ```text
//! ⌠ → → → → →
//! cᵐ = │ Bᵐ(x(ξ)) · w(x) dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## VEC 04: gradient(B) dot transpose tensor(T)
//!
//! Function [vec_04_bt()]
//!
//! ```text
//! → ⌠ → → → → ⌠ → → → →
//! dᵐ = │ Bᵐ(x(ξ)) · σᵀ(x) dΩ │ σ(x) · Bᵐ(x(ξ)) dΩ
//! ⌡ ▔ ⌡ ▔
//! Ωₑ Ωₑ
//! ```
//!
//! # Matrix results: Integration of some combinations involving N, tensors, and B, resulting in matrices
//!
//! 
//!
//! ## MAT 01: Shape(N) times scalar(S) times shape(N) (e.g., diffusion matrix)
//!
//! Function [mat_01_nsn()]
//!
//! ```text
//! ⌠
//! Kᵐⁿ = │ Nᵐ s Nⁿ dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 02: Gradient(B) dot vector(V) times shape(N) (e.g., compressibility matrix)
//!
//! Function [mat_02_bvn()]
//!
//! ```text
//! ⌠ → →
//! Kᵐⁿ = │ Bᵐ ⋅ v Nⁿ dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 03: Gradient(B) dot tensor(T) dot gradient(B) (e.g., conductivity matrix)
//!
//! Function [mat_03_btb()]
//!
//! ```text
//! ⌠ → →
//! Kᵐⁿ = │ Bᵐ ⋅ T ⋅ Bⁿ dΩ
//! ⌡ ▔
//! Ωₑ
//! ```
//!
//! ## MAT 04: shape(Nb) times scalar(S) times gradient(B) (e.g., coupling matrix)
//!
//! Function [mat_04_nsb()]
//!
//! ```text
//! → ⌠ →
//! Kᵐⁿ = │ Nbᵐ s Bⁿ dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 05: Gradient(Bb) times tensor(T) times shape(N) (e.g., coupling matrix)
//!
//! Function [mat_05_btn()]
//!
//! ```text
//! → ⌠ →
//! Kᵐⁿ = │ Bbᵐ ⋅ T Nⁿ dΩ
//! ⌡ ▔
//! Ωₑ
//! ```
//!
//! ## MAT 06: Shape(N) times vector(V) times shape(Nb) (e.g., coupling matrix)
//!
//! Function [mat_06_nvn()]
//!
//! ```text
//! → ⌠ →
//! Kᵐⁿ = │ Nᵐ v Nbⁿ dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 07: Gradient(B) times scalar(S) times shape(Nb) (e.g., coupling matrix)
//!
//! Function [mat_07_bsn()]
//!
//! ```text
//! → ⌠ →
//! Kᵐⁿ = │ Bᵐ s Nbⁿ dΩ
//! ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 08: Shape(N) times tensor(T) times shape(N) (e.g., mass matrix)
//!
//! Function [mat_08_ntn()]
//!
//! ```text
//! ⌠
//! Kᵐⁿ = │ Nᵐ T Nⁿ dΩ
//! ▔ ⌡ ▔
//! Ωₑ
//! ```
//!
//! ## MAT 09: Shape(N) times vector(V) dot gradient(B) (e.g., variable density matrix)
//!
//! Function [mat_09_nvb()]
//!
//! ```text
//! ⌠ → →
//! Kᵐⁿ = │ Nᵐ v ⊗ Bⁿ dΩ
//! ▔ ⌡
//! Ωₑ
//! ```
//!
//! ## MAT 10: Gradient(B) dot 4th-tensor(D) dot gradient(B) (e.g., stiffness matrix)
//!
//! Function [mat_10_bdb()]
//!
//! ```text
//! ⌠ → →
//! Kᵐⁿ = │ Σ Σ Σ Σ Bᵐₖ Dᵢₖⱼₗ Bⁿₗ eᵢ ⊗ eⱼ dΩ
//! ▔ ⌡ i j k l
//! Ωₑ
//! ```
//!
//! # Expressions
//!
//! See also [crate::shapes]
//!
//! ## Xᵀ: Transposed matrix of coordinates
//!
//! ```text
//! ┌ ┐ superscript = node
//! | x⁰₀ x¹₀ x²₀ x³₀ xᴹ₀ | subscript = space dimension
//! Xᵀ = | x⁰₁ x¹₁ x²₁ x³₁ ... xᴹ₁ |
//! | x⁰₂ x¹₂ x²₂ x³₂ xᴹ₂ |
//! └ ┘_(space_ndim,nnode)
//! where `M = nnode - 1`
//! ```
//!
//! ## N: Shape functions
//!
//! Shape function of node m at ξ (ksi; i.e., xi):
//!
//! ```text
//! Nᵐ(ξ)
//! matrix notation: N is an (nnode) vector
//! ```
//!
//! ## L: Derivatives of shape functions
//!
//! Derivatives of shape functions with respect to the natural coordinates:
//!
//! ```text
//! →
//! → → dNᵐ(ξ)
//! Lᵐ(ξ) = ——————
//! →
//! dξ
//! matrix notation: L is an (nnode,geo_ndim) matrix
//! ```
//!
//! ## Isoparametric formula
//!
//! ```text
//! → → → →
//! x(ξ) = Σ Nᵐ(ξ) xᵐ
//! m
//! matrix notation: x = Xᵀ ⋅ N
//! ```
//!
//! ## J: Jacobian tensor (SOLID case with geo_ndim = space_ndim = 2 or 3)
//!
//! ```text
//! →
//! → dx → →
//! J(ξ) = —— = Σ xᵐ ⊗ Lᵐ
//! → m
//! dξ
//! matrix notation: J = Xᵀ · L
//! J is a (space_ndim,geo_ndim) matrix
//! ```
//!
//! ## J: Jacobian vector (CABLE case with geo_ndim = 1 and space_ndim = 2 or 3)
//!
//! ```text
//! →
//! → → → → → dx
//! J := Jcable(ξ) = g₁(ξ) = ——
//! dξ
//! matrix notation: J = Jcable = Xᵀ · L
//! J is a (space_ndim,1) matrix; i.e., a vector
//! ```
//!
//! ## J: Jacobian matrix (SHELL case with geo_ndim = 2 and space_ndim = 3)
//!
//! ```text
//! dx
//! J(ξ) = Jshell = ——
//! dξ
//! matrix notation: J = Jshell = Xᵀ · L
//! J is a (3,2) matrix
//! ```
//!
//! ## B: Gradients of shape functions (derivatives w.r.t real coordinates x) (only for SOLID case)
//!
//! ```text
//! →
//! → → dNᵐ(ξ)
//! Bᵐ(ξ) = ——————
//! →
//! dx
//! matrix notation: B = L · J⁻¹
//! B is an (nnode,space_ndim) matrix
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;