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
//! Operators as mathematical tags; discretizations as policies.
//!
//! `Grid + Discretization → Operators`
//! with an *open* universe of operators. Instead of one `Discretization`
//! trait with a fixed method list (which every new operator would break),
//! each (policy, operator, grid) triple is a separate impl of
//! [`Discretizes`]:
//!
//! ```text
//! impl Discretizes<CartesianGrid<2>, Laplacian> for FiniteDifference { … }
//! impl Discretizes<QuadTree, Laplacian> for FiniteVolume { … }
//! ```
//!
//! A model states its requirements as bounds — e.g. a diffusion model is
//! `impl<G, D> Model<G, D> for Diffusion where D: Discretizes<G, Laplacian>`
//! — and never learns which scheme satisfied them. Everything resolves at
//! compile time; there is no operator registry and no dynamic dispatch.
//!
//! Operator tags may carry mathematical parameters (e.g. a gradient
//! component index) but never numerical ones — those belong to the policy.
use Stencil;
use crateGrid;
/// ∇²
;
/// ∂/∂`x_d` — one component of ∇.
;
/// ∇· of a face-flux function (the finite-volume workhorse; an anisotropic
/// surface-energy term is a `Divergence` with a nonlinear flux).
;
/// ∇·[A(n)² ∇φ − A(n)A′(n) ∂⊥φ] — the anisotropic surface-energy divergence
/// of phase-field models, with m-fold anisotropy A(θ) = ā(1 + ε′ cos mθ).
///
/// `eps4` is the 4-fold anisotropy strength (a *mathematical* parameter, so
/// it lives on the tag); regularization thresholds are numerical and belong
/// to the policy.
/// A discretization policy that knows how to realize operator `Op` on grid
/// `G` as a concrete [`Stencil`].