Skip to content
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

Robin BC: Abort if solver is not safe for reuse #3788

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Mar 5, 2024

Because the coefficients stored inside LinOp objects are irreversibly modified for Robin BC, it's unsafe to reuse the solver when there is Robin BC, unless the scalars and the coefficients are reset.

Because the coefficients stored inside LinOp objects are irreversibly
modified for Robin BC, it's unsafe to reuse the solver when there is Robin
BC.
@WeiqunZhang WeiqunZhang requested a review from cgilet March 5, 2024 16:33
@cgilet
Copy link
Contributor

cgilet commented Mar 5, 2024

If setACoef and setScalars were re-called before every solve/apply, could it work to reuse the solver?

@WeiqunZhang
Copy link
Member Author

Yes that could work. Maybe we should try to be clever here.

@WeiqunZhang WeiqunZhang changed the title Robin BC: Abort if solver is reused Robin BC: Abort if solver is not safe for reuse Mar 5, 2024
@cgilet
Copy link
Contributor

cgilet commented Mar 6, 2024

I think we need to add applyRobinBCTermsCoeffs(); in update() for both ABecLap and EBABecLap. Do you know if I edit the file on github, does that create changes for you to approve or not, or does it just push a commit?

@WeiqunZhang
Copy link
Member Author

If you push the change to your fork and let me know, I will cherry pick it.

@cgilet
Copy link
Contributor

cgilet commented Mar 6, 2024

okay. branch pr3788 on my fork

update.

This appears to be needed to reuse the solver in the MacProjector.
@WeiqunZhang WeiqunZhang merged commit 5961a48 into AMReX-Codes:development Mar 8, 2024
68 of 69 checks passed
@WeiqunZhang WeiqunZhang deleted the abort_robin_reuse branch March 8, 2024 02:17
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.

2 participants