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
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
//! The per-term energy budget of the DEC Navier–Stokes rate (the
//! dec-ns-stability capability's diagnostic).
//!
//! For a state `u`, each field is the M-inner product `⟨u, term⟩_M`
//! (`Σ_e u_e (⋆term)_e`) of the state against one term of the marched
//! rate, **with the rate's signs** — so every entry reads directly as an
//! energy contribution: along the semi-discrete flow,
//! `dE/dt = ⟨u, P(rate)⟩_M`, and for a divergence-free state the
//! M-orthogonal projector drops out of the inner product, so
//! `projected ≈ convective + viscous + body_force` to solve tolerance.
//!
//! The diagnostic exists to *localize* energy injection: unforced
//! viscous flow must have `viscous ≤ 0` and `convective ≈ 0` (the
//! continuum convective term is energy-neutral); a term whose cumulative
//! contribution turns positive on a marched trajectory is the defect
//! (the 2026-06-12 TGV instability finding).
use RealField;
/// Per-term M-inner products of a state against the marched rate's
/// terms; see the module doc for the sign convention.