Skip to content

Add Rosenbrock-2S method#1994

Draft
BenWibking wants to merge 6 commits into
AMReX-Astro:developmentfrom
BenWibking:rosenbrock-2
Draft

Add Rosenbrock-2S method#1994
BenWibking wants to merge 6 commits into
AMReX-Astro:developmentfrom
BenWibking:rosenbrock-2

Conversation

@BenWibking
Copy link
Copy Markdown
Collaborator

@BenWibking BenWibking commented May 11, 2026

This adds the ROS2S integrator from https://doi.org/10.1016/j.apnum.2012.08.001.

It is a three-stage, second-order, stiffly-accurate, L-stable Rosenbrock-Wanner method with an embedded error estimator.

@BenWibking BenWibking changed the base branch from main to development May 11, 2026 20:15
@BenWibking BenWibking changed the title Rosenbrock 2 Add Rosenbrock-2 method May 11, 2026
@BenWibking
Copy link
Copy Markdown
Collaborator Author

@zingale Here's the draft PR. This does not have all the performance optimizations that I tried.

@BenWibking
Copy link
Copy Markdown
Collaborator Author

BenWibking commented May 11, 2026

This version wins by a few percent on CPU [Mac laptop] over VODE for primordial_chem when building both with Clang (which is much faster than gcc on CPU for these problems).

The performance delta is significantly larger on a Hopper GPU (in favor of Rosenbrock).

@BenWibking BenWibking changed the title Add Rosenbrock-2 method Add Rosenbrock-2S method May 11, 2026
@zingale
Copy link
Copy Markdown
Member

zingale commented May 13, 2026

this gets an FPE if I build and run test_react as:

make INTEGRATOR_DIR=ROS2S DEBUG=TRUE
./main3d.gnu.DEBUG.ex inputs_aprox13  amrex.fpe_trap_invalid=1

@zingale
Copy link
Copy Markdown
Member

zingale commented May 13, 2026

it seems to be that it is generating really negative mass fractions and that's causing the failure, so we probably need more step rejection logic.

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