abbrev
definition
ScalarField
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.NavierStokes.DiscreteNSOperator on GitHub at line 36.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
backwardDiff -
conservativeTransportField -
CoreNSOperator -
forwardDiff -
IncompressibleNSOperator -
scalarLaplacian -
total_conservativeTransportField_zero -
kinetic_action -
kinetic_nonneg -
potential_action -
add -
add_comm -
constant -
deriv_add -
deriv_smul -
directional_deriv -
eval -
field_squared -
field_squared_nonneg -
gradient -
gradient_squared -
gradient_squared_minkowski -
ScalarField -
smul -
smul_zero -
zero -
ScalarField -
expand_action_around_FRW -
RefreshField
formal source
33
34abbrev Axis := Fin 3
35
36abbrev ScalarField (siteCount : ℕ) := Fin siteCount → ℝ
37
38abbrev VectorField (siteCount : ℕ) := Fin siteCount → Axis → ℝ
39
40structure LatticeTopology (siteCount : ℕ) where
41 plus : Axis → Fin siteCount → Fin siteCount
42 minus : Axis → Fin siteCount → Fin siteCount
43
44def forwardDiff {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
45 (f : ScalarField siteCount) (j : Axis) (x : Fin siteCount) : ℝ :=
46 (f (Λ.plus j x) - f x) / h
47
48def backwardDiff {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
49 (f : ScalarField siteCount) (j : Axis) (x : Fin siteCount) : ℝ :=
50 (f x - f (Λ.minus j x)) / h
51
52def scalarLaplacian {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
53 (f : ScalarField siteCount) (x : Fin siteCount) : ℝ :=
54 ∑ j : Axis, forwardDiff Λ h (backwardDiff Λ h f j) j x
55
56def vectorLaplacian {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
57 (u : VectorField siteCount) (x : Fin siteCount) (i : Axis) : ℝ :=
58 scalarLaplacian Λ h (fun y => u y i) x
59
60def divergence {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
61 (u : VectorField siteCount) (x : Fin siteCount) : ℝ :=
62 ∑ j : Axis, forwardDiff Λ h (fun y => u y j) j x
63
64def advection {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
65 (u : VectorField siteCount) (x : Fin siteCount) (i : Axis) : ℝ :=
66 ∑ j : Axis, u x j * forwardDiff Λ h (fun y => u y i) j x