Skip to content

[newchem-cpp] transcribe calc_grain_size_increment_1d#464

Merged
brittonsmith merged 37 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/transcribe_calc_grain_size_increment_1d
Feb 27, 2026
Merged

[newchem-cpp] transcribe calc_grain_size_increment_1d#464
brittonsmith merged 37 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/transcribe_calc_grain_size_increment_1d

Conversation

@mabruzzo

Copy link
Copy Markdown
Collaborator

To be reviewed after PR #463 is merged


This PR transcribes calc_grain_size_increment_1d. I couldn't help myself -- I cleaned up a bunch of logic (folding lots of logic that was explicitly repeated for every kind of injection pathway or for every kind of dust species into for-loops).

As of this PR, there is no logic outside of the inject_model subdirectory that directly references injection pathways by name. In other words, we are pretty close to being able to let users load an arbitrary set of injection pathways.

Essentially, this type holds pointers to the various injection pathway
fields in the order that is implicitly assumed throughout the codebase.
This change helps simplify make_consistent and it will also simplify
`calc_grain_size_increment_1d` (once transcribed). Longer term, I have a
plan that will let use dispose of this ``InjectPathFieldPack`` type
(but, we need to make a few changes before we get to that).
Introduce the start_idx and stop_idx members to the struct
Use the start_idx and stop_idx members to simplify make_consistent
@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Dec 11, 2025
@mabruzzo mabruzzo changed the title [newchem-cpp] calc_grain_size_increment_1d [newchem-cpp] transcribe calc_grain_size_increment_1d Dec 11, 2025
@mabruzzo mabruzzo changed the base branch from main to newchem-cpp December 11, 2025 14:28
I was expecting this to cause gold-standard drift (but that doesn't seem
to be the case)
@mabruzzo mabruzzo force-pushed the ncc/transcribe_calc_grain_size_increment_1d branch from 554e23a to 1671ee3 Compare December 11, 2025 16:56
@mabruzzo

Copy link
Copy Markdown
Collaborator Author

ASIDE: I noticed that the dust-grain freefall test all systematically take slightly less time (think 0.2-0.4 seconds) than on the current HEAD of newchem-cpp. It's hard to definitively identify the source of speedup, but I think its because I cut a lot of unnecessary allocations out of this function

ChristopherBignamini added a commit to ChristopherBignamini/grackle that referenced this pull request Jan 18, 2026
@brittonsmith brittonsmith merged commit 71290e0 into grackle-project:newchem-cpp Feb 27, 2026
5 checks passed
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