-
-
Notifications
You must be signed in to change notification settings - Fork 551
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
[Bug]: post-processing variables require pybamm.Symbol to have a mesh #4637
Comments
this doesn't normally pop up as we seem to add mesh somewhere in the pipeline, but it seems to occur if you add the new variable after the model is discretised |
We could try to process the variable with an empty disc, e.g. disc = pybamm.Discretisation()
disc.process_symboll(variable) We do this in the solver if you try to solve a model that isn't yet discredited, and throw a Seems like it would be best practice to add the variable to the model before discretising though. |
I think the main issue with our current approach is that |
Got it, makes sense. There are a lot of places where attributes get added outside of the |
I know :( but this was a particularly blatent example that I thought we should clean up |
Agreed! |
* bug: make sure symbol always has required mesh attribute * #4637 add to changelog
PyBaMM Version
develop
Python Version
3.10
Describe the bug
Adding a variable to a pre-built pybamm model causes a failure in
pybamm.solvers.processed_variable.py::process_variable()
because it doesn't have amesh
attributeSteps to Reproduce
Relevant log output
The text was updated successfully, but these errors were encountered: