Tracking/saving fields outside of those involved in a PDE #450
-
Hello, I'm working with a system of (2D spatial) equations that looks something like this: I'd also like to keep track of quantities such as the derivatives of these fields (e.g. d_dx(u), d_dx(v)) even though they are not explicitly included in the PDEs to be solved, but could not find any examples in the py-PDE documentation to show how to do this. Is such a task currently possible, or should calculation of gradients be done in post-processing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
You could use the |
Beta Was this translation helpful? Give feedback.
Thank you for providing the code! I can reproduce the error, which is caused by a subtle behavior of py-pde. In essence,
new state.append(div)
actually also modifiesstate.fields
and leads to the error. You could instead useor just
to prevent this error!