-
Notifications
You must be signed in to change notification settings - Fork 230
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
Sympy standard function with our types #984
Comments
I think the only possibility is to import them all and subclass them such that they get a different new just like Add, Mul, ... I don't think it's bad, it's just a little tedious but it shouldn't take an insane amount of time... I'd add all nonlinear functions here: https://fenicsproject.org/docs/ufl/1.4.0/ufl.html#id2 it's roughly more than 20, so it's doable |
Yes it is just tidious I don't mind that way just takes time |
sympy/sympy/functions/elementary/miscellaneous.py
sympy/sympy/functions/elementary/complexes.py
sympy/functions/elementary/exponential.py
sympy/functions/special/error_functions.py
sympy/functions/elementary/trigonometric.py
sympy/functions/elementary/hyperbolic.py
|
@btrb would you like to give this a go? as a simple self-contained exercise? |
oh, yes. sure! although i don't quite have a clear picture of a solution
add it to
add the corresponding decorator to
then include
and finally override the sympy operator in
i'm aware that it should not be that trivial though |
I would avoid to go through diffify too much and clutter it with too much stuff. Most of these are |
This "update" would also be a good time to enforce types on these functions in the generated code (cos/cosf, sin/sinf,....) as we currently have the double precisions ones (cos, sin,...) always (unless I missed something) |
Started in #1549 , not all of it though, will need to add the other ones the same way. |
So basically the issue is that all of sympy standard functions ignore our type or transform into their own
For example
sqrt(u)
is asympy.Pow
while we would want aDifferentiable.Pow
. I am unsure how to proceed about this, most of the ideas I would require to import everything in Devito and add our own version and would break the moment someone uses a function we didn;t think of (there is like 100 in sympy so not gonna redo everything)Open to suggestions
The text was updated successfully, but these errors were encountered: