Class Laplacian
The Laplacian is the divergence of the gradient: ∇²f = ∇·(∇f)
Definition: ∇²f = ∂²f/∂x₲ + ∂²f/∂x₂² + ... + ∂²f/∂xₙ²
Physical interpretation and applications: - Heat equation: ∂T/∂t = α∇²T (heat diffusion) - Wave equation: ∂²u/∂t² = c²∇²u (wave propagation) - Laplace's equation: ∇²Ã†= 0 (electrostatics, gravity) - Poisson's equation: ∇²Ã†= -ÃÂ/ε₀ (electrostatics with charges) - Schrödinger equation: iâ„Â∂È/∂t = -Ⅎ/(2m)∇²Ãˆ + VÈ - Harmonic functions: functions where ∇²f = 0
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScalarField<PointND> asField(ScalarField<PointND> field, Real h) Returns a scalar field representing the Laplacian of the input field.static Realcompute(ScalarField<PointND> field, PointND point, Real h) Computes the Laplacian of a scalar field at a point.computeVector(VectorField<PointND> field, PointND point, Real h) Computes the vector Laplacian of a vector field.
-
Constructor Details
-
Laplacian
public Laplacian()
-
-
Method Details
-
compute
Computes the Laplacian of a scalar field at a point.Uses second-order central difference: ∂²f/∂xᵢ² ≈ (f(x + h*eᵢ) - 2f(x) + f(x - h*eᵢ)) / h²
- Parameters:
field- the scalar fieldpoint- the point at which to compute Laplacianh- the step size for numerical differentiation- Returns:
- the Laplacian (scalar value)
-
asField
Returns a scalar field representing the Laplacian of the input field.- Parameters:
field- the scalar fieldh- the step size for numerical differentiation- Returns:
- the Laplacian as a scalar field
-
computeVector
Computes the vector Laplacian of a vector field.For a vector field F, the vector Laplacian is: ∇²F = (∇²Fâ‚Â, ∇²Fâ‚‚, ..., ∇²Fâ‚™)
Note: In some contexts, ∇²F = ∇(∇·F) - ∇×(∇×F), but this is only equivalent in 3D and for certain coordinate systems.
- Parameters:
field- the vector fieldpoint- the pointh- the step size- Returns:
- the vector Laplacian
-