Skip to content

[newchem-cpp] Refactor such that SpLUT is implemented with XMacros#353

Merged
brittonsmith merged 7 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024transcribe/Implement-SpLUT-with-XMacros
Aug 13, 2025
Merged

[newchem-cpp] Refactor such that SpLUT is implemented with XMacros#353
brittonsmith merged 7 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024transcribe/Implement-SpLUT-with-XMacros

Conversation

@mabruzzo
Copy link
Copy Markdown
Collaborator

This PR was originally proposed as brittonsmith#27


This PR must be reviewed after #333 is merged


Previously, the SpLUT was implemented as a manually maintained list of all possible primordial, metal and dust species.

This PR consists of 4 commits:

  1. I renamed the members of SpLUT corresponding to dust grains so that they are more consistent with the names tracked in grackle_field_data. For the sake of consistency, I made the same modification to members of OnlyGrainSpLUT
    • SpLUT::SiO2D is now SpLUT::SiO2_dust (be aware, this is distinct from the SpLUT::SiO2 entry)
    • SpLUT::reforg is now SpLUT::ref_org_dust
    • SpLUT::volorg is now SpLUT::vol_org_dust
    • SpLUT::H20ice is now SpLUT::H2O_ice_dust
    • all the other dust-grain name entries now end in _dust (e.g. SpLUT::SiM is now SpLUT::SiM_dust)
  2. I divided grackle_field_data_fdatamembers.def into 2 files.[^1]
    1. field_data_evolved_species.def contains all species fields that are evolved by grackle. In other words, these are the primordial species, dust species, and grain species (these all have corresponding entries within SpLUT
    2. field_data_misc_fdatamembers.def contains all of the other fields
  3. Finally, I refactored SpLUT to actually make use of the XMacros from field_data_evolved_species.def
  4. I started allowing clang-format to format src/clib/LUT.hpp

@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Jun 11, 2025
@mabruzzo mabruzzo moved this to Awaiting Review in New Chemistry and C++ Transcription Jun 11, 2025
@brittonsmith brittonsmith changed the base branch from newchem-cpp to main August 13, 2025 13:20
@brittonsmith brittonsmith changed the base branch from main to newchem-cpp August 13, 2025 13:20
@brittonsmith brittonsmith merged commit 1fd5000 into grackle-project:newchem-cpp Aug 13, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Review to Done in New Chemistry and C++ Transcription Aug 13, 2025
@mabruzzo mabruzzo deleted the gen2024transcribe/Implement-SpLUT-with-XMacros branch August 19, 2025 19:59
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