DiffEqOperators.jl
DiffEqOperators.jl copied to clipboard
VectorCalculusOperators: Is this the right package for these operators?
I've thinking about the possibility of extending this package to be able to perform Vector/Tensor calculus operations.
A suitable discretization of a vector field is an Array{SVector{N, T},N}
.
The most common vector differential operators are :
- Grad:
∇
- Div:
∇⋅
- Curl
∇×
One way to implement these would be to give DerivativeOperator an is_vector_operator
type parameter, and then vector_component
type parameter/field to determine which vector component of u
it acts on.
Grad can then be defined from its definition, (A
is used here instead of u
):
Then the Div operator is simply the trace of the Jacobian above
The Curl Operator can be implemented from its definition:
Optionally, fast methods can be written for Div and Curl that fuse all loops. See a rough draft for the interior convolution when stencils in all directions are the same here, at the bottom of convolutions.jl.
The question is, whether this package should support this kind of functionality, or whether this should be in an additional package that extends DiffEqOperators.
Yes, these operators would be great to have!