Class Divergence
java.lang.Object
org.episteme.core.mathematics.analysis.vectorcalculus.Divergence
Computes the divergence of a vector field.
The divergence measures the magnitude of a field's source or sink at a given point.
Definition: ∇·F = ∂F₁/∂x₁ + ∂F₂/∂x₂ + ... + ∂Fₙ/∂xₙ
Physical interpretation: - Positive divergence: source (field lines emanating outward) - Negative divergence: sink (field lines converging inward) - Zero divergence: incompressible flow - Gauss's law: ∇·E = ρ/ε₀ (electric field divergence equals charge density) - Continuity equation: ∂ρ/∂t + ∇·(ρv) = 0
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScalarField<PointND> asField(VectorField<PointND> field, Real h) Returns a scalar field representing the divergence of the vector field.static Realcompute(VectorField<PointND> field, PointND point, Real h) Computes the divergence of a vector field at a point using finite differences.
-
Constructor Details
-
Divergence
public Divergence()
-
-
Method Details
-
compute
Computes the divergence of a vector field at a point using finite differences.Uses central difference for each component: ∂Fᵢ/∂xᵢ ≈ (Fᵢ(x + h*eᵢ) - Fᵢ(x - h*eᵢ)) / (2h)
- Parameters:
field- the vector fieldpoint- the point at which to compute divergenceh- the step size for numerical differentiation- Returns:
- the divergence (scalar value)
-
asField
Returns a scalar field representing the divergence of the vector field.- Parameters:
field- the vector fieldh- the step size for numerical differentiation- Returns:
- the divergence as a scalar field
-