IMEX Photoionization#1947
Conversation
… and fix radiation deposition
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…nd add reference solution
…flict with test problems
…ling with runtime parameter switches
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Code Review
This pull request updates the Microphysics subproject, adjusts integrator tolerances and network settings in several input files, integrates photochemistry calculations into the radiation subcycling stages, and updates CMake configurations to specify the Rosenbrock solver. A review comment suggests using if constexpr when checking numPassiveScalars to prevent compilation errors when no passive scalars are defined.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| #ifdef PHOTOCHEMISTRY | ||
| for (int nn = 0; nn < Physics_Traits<problem_t>::numPassiveScalars; ++nn) { | ||
| stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) = | ||
| (1.0 - IMEX_alpha) * stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) + | ||
| IMEX_alpha * stateTmp(i, j, k, RadSystem<problem_t>::scalar0_index + nn); | ||
| } | ||
| #endif |
There was a problem hiding this comment.
When Physics_Traits<problem_t>::numPassiveScalars is 0, RadSystem<problem_t>::scalar0_index may not be defined or could be invalid, which can lead to compilation errors during template instantiation. Using if constexpr ensures that this block is only compiled when there are actually passive scalars present.
#ifdef PHOTOCHEMISTRY
if constexpr (Physics_Traits<problem_t>::numPassiveScalars > 0) {
for (int nn = 0; nn < Physics_Traits<problem_t>::numPassiveScalars; ++nn) {
stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) =
(1.0 - IMEX_alpha) * stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) +
IMEX_alpha * stateTmp(i, j, k, RadSystem<problem_t>::scalar0_index + nn);
}
}
#endif
Description
Please write a short paragraph describing what changes this pull request makes to the code. It should provide sufficient context so that a reviewer can efficiently browse the source code changes.
Related issues
Are there any GitHub issues that are fixed by this pull request? Add a link to them here.
Checklist
Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an
xinside the square brackets[ ]in the Markdown source below:/azp run.