Skip to content

[newchem-cpp] cleanup lookup_cool_rate_1d part 1#415

Merged
brittonsmith merged 36 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/lookup_rate_1d_cleanup-interp
Nov 14, 2025
Merged

[newchem-cpp] cleanup lookup_cool_rate_1d part 1#415
brittonsmith merged 36 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/lookup_rate_1d_cleanup-interp

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Sep 9, 2025

Copy link
Copy Markdown
Collaborator

This shouldn't be reviewed until after #412 and #413 are merged


As part of this PR, I

  1. factored all of the logic for interpolation collisional rates out of lookup_cool_rate_1d into a helper function
  2. introduced gr_opaque_storage::used_kcol_rate_indices:
    • during initialization of gr_opaque_storage::kcol_rate_tables, we now only initialize the "ordinary" reaction rates that we use
    • we store the indices of each of these rates initialized rates within gr_opaque_storage::used_kcol_rate_indices. The length of this list is tracked by gr_opaque_storage::n_kcol_rate_indices
  3. refactored the interpolation of every "ordinary reaction rate" so that instead of explicitly naming each reaction rate, we now iterate over entries recorded within gr_opaque_storage::used_kcol_rate_indices
  4. slightly refactored the logic for computing the density-dependent k13 rates to let us avoid heap allocating the scratch space

@mabruzzo mabruzzo changed the base branch from main to newchem-cpp September 9, 2025 15:53
@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Sep 10, 2025
@mabruzzo mabruzzo changed the title [newchem-cpp] WIP: cleanup lookup_cool_rate_1d part 1 [newchem-cpp] cleanup lookup_cool_rate_1d part 1 Sep 10, 2025
@mabruzzo mabruzzo marked this pull request as ready for review September 10, 2025 16:25
@mabruzzo mabruzzo moved this to Awaiting Review in New Chemistry and C++ Transcription Sep 12, 2025
@mabruzzo mabruzzo mentioned this pull request Sep 12, 2025
32 tasks
@mabruzzo

Copy link
Copy Markdown
Collaborator Author

@brittonsmith, this should be ready to go

@brittonsmith brittonsmith merged commit 3e1210d into grackle-project:newchem-cpp Nov 14, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Review to Done in New Chemistry and C++ Transcription Nov 14, 2025
@mabruzzo mabruzzo deleted the ncc/lookup_rate_1d_cleanup-interp branch November 19, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes

Projects

Development

Successfully merging this pull request may close these issues.

2 participants