Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

To be reviewed after #428 and #451 are merged


This is a lightweight PR that refactors GrainSpeciesInfo to make use of FrozenKeyIdxBiMap. This is useful for PR #447 and some other things I have planned.

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
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`.
@mabruzzo mabruzzo changed the base branch from main to newchem-cpp December 10, 2025 01:35
@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