New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better support for using Operator Aliases #130
Comments
The way I would do this without additional parsing code would be to deduce the definition of vector calculus operators using e.g. oscillator = @decapode begin
X::Form0
V::Form0
∂ₜ(X) == V
∂ₜ(V) == -k(X) + div(V)
end
osc2D = infer_types!(resolve_overloads!(oscillator))
@test osc2D == @decapode begin
X::Form0
V::Form0
∂ₜ(X) == V
∂ₜ(V) == -k(X) + div_0(V)
end |> infer_types! |> resolve_overloads!
, where I suppose that this would not work if in one 2D Decapode, the result of |
I think it is probably fine to both update the parser code to allow definitions of new operators as composites of operators and to add a We could then use a |
Although PR #142 addresses some of these concerns, it does not One can consider that PR as providing reasonable defaults for Further, carrying around these operators throughout the lifetime of a Decapode object will best be handled via nested Decapodes. This will likely require Decapodes which contain
Going off of the selection provided by the "Punctuation" section of the manual, I think that |
The goal here is to use familiar
Div, Grad, Curl, Lapl
operators in their familiar role in vector calculus. What support do we need in the Decapodes language for that? Probably and alias operator like:=
Then we can update all the docs examples to use these operators when appropriate. We can't uniformly introduce a exterior calculus definitions of div, grad, curl because of things like how gradient of Pressure should be
dP
but gradient of concentration should be⋆dC
. Unless we can dispatch on expected return type in the type inference code, I think that we can just introduce a manual aliasing operator into the decapode macro, and then have local aliases in each example.The text was updated successfully, but these errors were encountered: