SciML / DiffEqOperators.jl

Linear operators for discretizations of differential equations and scientific machine learning (SciML)
https://docs.sciml.ai/DiffEqOperators/stable/
Other
284 stars 74 forks source link

VectorCalculusOperators: Is this the right package for these operators? #146

Open xtalax opened 5 years ago

xtalax commented 5 years ago

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 :

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): image

Then the Div operator is simply the trace of the Jacobian above

The Curl Operator can be implemented from its definition: image

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.

ChrisRackauckas commented 5 years ago

Yes, these operators would be great to have!