Skip to content

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

Merged
WeiqunZhang merged 3 commits into
AMReX-Codes:developmentfrom
WeiqunZhang:abort_robin_reuse
Mar 8, 2024
Merged

Robin BC: Abort if solver is not safe for reuse#3788
WeiqunZhang merged 3 commits into
AMReX-Codes:developmentfrom
WeiqunZhang:abort_robin_reuse

Conversation

@WeiqunZhang

@WeiqunZhang WeiqunZhang commented Mar 5, 2024

Copy link
Copy Markdown
Member

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

cgilet commented Mar 5, 2024

Copy link
Copy Markdown
Member

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

@WeiqunZhang

Copy link
Copy Markdown
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

cgilet commented Mar 6, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@cgilet

cgilet commented Mar 6, 2024

Copy link
Copy Markdown
Member

okay. branch pr3788 on my fork

update.

This appears to be needed to reuse the solver in the MacProjector.
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