Skip to content

MRI slow integrator path uses ARKStep-specific API calls on MRIStep memory #5044

@WeiqunZhang

Description

@WeiqunZhang
  • Type: Correctness / API misuse
  • Severity: High
  • Component: SUNDIALS MRI slow-step configuration
  • Location:
    • Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H:414
    • Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H:417
    • Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H:427
    • Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H:441
    • Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H:446

Problem

After creating the slow integrator with MRIStepCreate, the code configures it via ARKStepSet* calls (nonlinear/linear solver, stop time, max steps).

Impact

  • API calls may fail or not apply to MRIStep as intended.
  • Slow MRI solver configuration may be incorrect in implicit IM/IMEX MRI modes.

Suggested patch

Use MRIStep-appropriate setters (or generic ARKode setters for all stepper types when available in the targeted SUNDIALS version).

--- a/Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H
+++ b/Src/Extern/SUNDIALS/AMReX_SundialsIntegrator.H
@@
-                flag = ARKStepSetNonlinearSolver(arkode_mem, NLS);
+                flag = MRIStepSetNonlinearSolver(arkode_mem, NLS);
@@
-            flag = ARKStepSetMaxNonlinIters(arkode_mem, max_nonlinear_iters);
+            flag = MRIStepSetMaxNonlinIters(arkode_mem, max_nonlinear_iters);
@@
-                flag = ARKStepSetLinearSolver(arkode_mem, LS, nullptr);
+                flag = MRIStepSetLinearSolver(arkode_mem, LS, nullptr);
@@
-          flag = ARKStepSetStopTime(arkode_mem, stop_time);
+          flag = MRIStepSetStopTime(arkode_mem, stop_time);
@@
-        flag = ARKStepSetMaxNumSteps(arkode_mem, max_num_steps);
+        flag = MRIStepSetMaxNumSteps(arkode_mem, max_num_steps);

Prepared by Codex

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions