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

MRI-adaptivity #564

Open
wants to merge 280 commits into
base: develop
Choose a base branch
from
Open

MRI-adaptivity #564

wants to merge 280 commits into from

Conversation

drreynolds
Copy link
Collaborator

@drreynolds drreynolds commented Sep 5, 2024

I think that this PR is now ready for full review.

Note: I removed all of the changesets that I'd pulled from @Steven-Roberts's PR #547 to simplify the review process for this PR.

@drreynolds
Copy link
Collaborator Author

I believe that I've finished addressing all PR comments. Aside from Jenkins, this is passing all CI tests, so once I VPN in to identify/resolve those (likely changes in some .out files), I'll request re-review.

@drreynolds drreynolds dismissed gardner48’s stale review November 4, 2024 18:38

dismissing previous review, since GitHub can no longer show me any remaining requested changes.

Copy link
Member

@balos1 balos1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave this a relatively quick look through (since David and Steven are going through or have gone through in depth) and it looks good.

examples/arkode/C_serial/ark_kpr_mri_1_0_0.01.out Outdated Show resolved Hide resolved
balos1
balos1 previously approved these changes Nov 8, 2024
doc/arkode/guide/source/Mathematics.rst Outdated Show resolved Hide resolved
doc/arkode/guide/source/Mathematics.rst Outdated Show resolved Hide resolved
doc/arkode/guide/source/Mathematics.rst Outdated Show resolved Hide resolved
doc/arkode/guide/source/Mathematics.rst Outdated Show resolved Hide resolved
doc/arkode/guide/source/Mathematics.rst Outdated Show resolved Hide resolved
src/arkode/arkode_mristep.c Outdated Show resolved Hide resolved
src/arkode/arkode_mristep.c Outdated Show resolved Hide resolved
Comment on lines 4711 to 4713
/* Signal that any pre-existing RHS vector is no longer current, since it
has a stale forcing function */
ark_mem->fn_is_current = SUNFALSE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still needed. Since the forcing changed the stored fn is now invalid.

src/arkode/arkode.c Outdated Show resolved Hide resolved
Co-authored-by: David Gardner <gardner48@llnl.gov>
Copy link
Collaborator Author

@drreynolds drreynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gardner48: I accepted your more obvious suggestions, but I have questions about others (see comments below).

/* if the method had a stiffly-accurate internal stage, use the
already-computed RHS vectors */
sa_stage = -1;
for (i = 1; i < step_mem->stages; i++)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so. Since the embedding stage is stored in the last row of the tables, it is possible that the "stiffly accurate" stage is the next-to-last one stored. I'll test whether I can shorten this loop to check.

}
ark_mem->fn_is_current = SUNTRUE;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully understand your concern here, but I am confident that this suggestion is not the way to proceed.

fn is only ever used with the Hermite interpolation module, when temporal root-finding is enabled, or by steppers that wish to leverage its data directly (e.g., ERKStep); notably, fn is never directly used by MRIStep. Thus, depending on the choice of interpolation module and temporal rootfinding, it is possible that fn may be NULL, so we should not copy data into it directly.

To ensure that I can understand your concern, let me explain what I think you're saying. Since the TakeStep routines do not call FullRHS directly in ARK_FULLRHS_START mode, then ark_mem->fn may not be current at the start of the step. Thus, anything inside the step that assumes fn is up-to-date will be accurate? Given that we already disallow users from calling ARKodeGetDky from inside a current step, then I suppose the only real concern would be if the Hermite interpolation module is used for higher-order implicit predictors? Are there other contexts where you think that fn needs to be current from inside the step calculation?

Separately, if fn may not be current at the start of the step, are you concerned that it might not be updated correctly at the end of the step (i.e., before ARKodeGetDky and temporal root-finding are used)?

potentially get inner dsm on all non-embedding stages */
/* Reset the inner stepper on the first stage within all but the
first stage group due to "stage-restart" structure */
if ((stage > 1) && (is == 0))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so, yes.

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

Successfully merging this pull request may close these issues.

4 participants