Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Dec 10, 2025

This PR should be reviewed after #447 has been merged.


This PR introduces the temporary InjectPathFieldPack type. 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).

For some context, PR #480 will remove the temporary InjectPathFieldPack type.

There is some unforunate consequences, but if we don't do this you end
up with some pretty confusing looking code... (the confusion primarily
arises if new_FrozenKeyIdxBiMap or drop_FrozenKeyIdxBiMap has different
behavior from other functions with similar names). I really think it
would be better to make this into a simple C++ class with a constructor
and destructor, but thats a topic for another time
…InfoEntry

This information will only be used after we transcribe
`calc_grain_size_increment_1d` (at which point we will remove the
corresponding constants from phys_constants.h and can entirely delete
the dust_const.def file
I moved them from initialize_dust_yields.cpp where the comments were out
of place to dust/grain_species_info.cpp
There's still a lot of work to be done (the type is incomplete and isn't
filled by anything at all)
It turns out that `gr_N[1]` is accessed in a lot of places!
One minor change involved formally making it illegal to construct a
GrainSpeciesInfo instance that holds 0 dust species. That's perfectly
fine. `GrainSpeciesInfo` holds some redundant info that we will remove
in the a subsequent commit
Modify tests to start using `FrozenKeyIdxBiMap` rather than
`GrainSpeciesInfoEntry::onlygrainsp_idx` and
`GrainSpeciesInfoEntry::name`. In the next commit, we'll remove these
members from `GrainSpeciesInfoEntry`
Delete `GrainSpeciesInfoEntry::onlygrainsp_idx` and
`GrainSpeciesInfoEntry::name`.
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 10, 2025
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

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant