Dear Forum,
I tried to access a derivative of my solution, say gfu.Diff(x).
However, while my solution gfu is clearly non-zero and its derivative should clearly not be, the differentiation gfu.Diff(x) leads to 0.
Any idea of why this is happening and how to get around that simple problem?
Thanking you in advance for your help,
Kind regards,
Vincent
Without a minimal example it is hard to tell what happening.
best
Hello Christopher,
Yes indeed, sorry.
Please find attached a minimal example of my problem with one of the Poisson examples of your documentation.
Poisson_minimal_working_example.ipynb (4.2 KB)
Do you have any idea? I would like to avoid unnecessary post-processing.
Thank you,
Vincent
Diff only works with differentiating a cf with respect to another one by using autodiff capabilities and pointer comparisions. so the cf object you derive by must be explicitly in the function you differentiate. You can do something like this for gridfunctions
dx_cf = my_cf.Diff(gfu) * grad(gfu)[0]
best
1 Like