Skip to content

[newchem-cpp] Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView - #562

Open
mabruzzo wants to merge 20 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/SpeciesFieldAdaptor
Open

[newchem-cpp] Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView#562
mabruzzo wants to merge 20 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/SpeciesFieldAdaptor

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR depends on changes from #561

NOTE: This PR needs to rebased atop the more recent version of #561 (the more recent version includes changes from #575)


This PR introduces FieldAdaptorManager and SpeciesMultiView:

  • SpeciesMultiView<T> is just an alias for Multi1DView<T> (introduced in PR [newchem-cpp] Introduce Multi1dView #561)
  • I'm using an alias because I could imagine using Multi1DView<T> in a few other places and using the type alias will make it easy for us to change the definition for SpeciesMultiView<T> (e.g. if we, as we've discussed before, ever decide to copy the species values into a temporary contiguous 2d array)
  • The FieldAdaptorManager is a tool that actually facilitates the creation of a SpeciesMultiView from a grackle_field_data pointer
    • I decided to try to keep the implementation as simple as possible (but there are a bunch of improvements that could be made)

In order to avoid making this PR too big, I have primarily focused on just using this new machinery to replace the old, very hacky SpeciesLUTFieldAdaptor machinery

@mabruzzo
mabruzzo force-pushed the ncc/SpeciesFieldAdaptor branch from e1d601d to 2ed79c3 Compare June 23, 2026 15:36
@mabruzzo mabruzzo changed the title [newchem-cpp] WIP: Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView [newchem-cpp] Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView Jun 24, 2026
mabruzzo added 4 commits July 22, 2026 11:26
All changes in this commit are a search-and-replace (plus some automated
reformatting since the number of characters is changing)
@mabruzzo
mabruzzo marked this pull request as draft July 23, 2026 14:31
@mabruzzo
mabruzzo force-pushed the ncc/SpeciesFieldAdaptor branch from 9eb8599 to 9fb8034 Compare July 23, 2026 20:52
@mabruzzo
mabruzzo marked this pull request as ready for review July 24, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant