Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- grad :: (Vec2 -> Double) -> Vec2 -> Vec2
- divergence :: (Vec2 -> Vec2) -> Vec2 -> Double
- curl :: (Vec2 -> Vec2) -> Vec2 -> Double
- curlZ :: (Vec2 -> Double) -> Vec2 -> Vec2
- laplace :: (Vec2 -> Double) -> Vec2 -> Double
- gradH :: Double -> (Vec2 -> Double) -> Vec2 -> Vec2
- divH :: Double -> (Vec2 -> Vec2) -> Vec2 -> Double
- curlH :: Double -> (Vec2 -> Vec2) -> Vec2 -> Double
- curlZH :: Double -> (Vec2 -> Double) -> Vec2 -> Vec2
- laplaceH :: Double -> (Vec2 -> Double) -> Vec2 -> Double
Operators with default settings
grad :: (Vec2 -> Double) -> Vec2 -> Vec2 Source #
Gradient with predefined sampling distance.
\[ \text{grad}(f) = \begin{pmatrix} \partial_x f \\ \partial_y f \end{pmatrix} \]
The fire-and-forget version of gradH
.
curlZ :: (Vec2 -> Double) -> Vec2 -> Vec2 Source #
Curl of a purely-z-component 3D vector field, which is another common way
(than curl
) to implement a two-dimensional version of \(\text{curl}\):
\[ \text{curl}_z(\psi) = \left[\text{curl}_{3D} \begin{pmatrix}0\\0\\\psi\end{pmatrix}\right]_{\text{2D part}} = \begin{pmatrix}\partial_y\psi\\-\partial_x\psi\end{pmatrix} \]
Because of this, the result is always divergence-free, because \(\forall f. \text{div}(\text{curl}(f))=0\).
Using curlZ
to create divergence
-free flow fields is similar to using grad
to create curl
-free force fields. The argument for curlZ
is known as the
vector or stream potential in fluid dynamics, with the resulting vector field
being known as a
stream function.
The fire-and-forget version of curlZH
.
laplace :: (Vec2 -> Double) -> Vec2 -> Double Source #
Laplacian with predefined sampling distance.
\[ \nabla^2f = \partial^2_x f + \partial^2_y f \]
The fire-and-forget version of laplaceH
.
Operators with configurable step width
Gradient with customizable sampling distance. The configurable version of grad
.
Divergence with customizable sampling distance. The configurable version of divergence
.
Curl with customizable sampling distance. The configurable version of curl
.
Curl of the z component of a 3D vector field, with customizable sampling
distance. The configurable version of curlZ
.