Skip to content

Automate source wrap #4971

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

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Automate source wrap #4971

wants to merge 4 commits into from

Conversation

ArivoliR
Copy link

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes #1410

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@rtimms
Copy link
Contributor

rtimms commented Apr 19, 2025

Thanks taking this on! For it to work properly we need to wrap all the terms that aren’t a spatial operator in source, eg see

I’m not sure this is what your solution does. Can you add a test to show that pybamm.laplacian(a) + b gets turned into pybamm.laplacian(a) + pybamm.source(b) to show this works in the simplest case? Then we can go from there.

@ArivoliR
Copy link
Author

ArivoliR commented May 1, 2025

Okay I've made a huge mistake clearly, will try to figure out if there's a way to handle all these cases by just modifying the wrap_source function that I've made. Have my final exams going on, will continue my attempt at solving this issue in a few weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate source terms in FEM
2 participants