[newchem-cpp] Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView#562
Open
mabruzzo wants to merge 27 commits into
Open
[newchem-cpp] Replace SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView#562mabruzzo wants to merge 27 commits into
SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView#562mabruzzo wants to merge 27 commits into
Conversation
…data Currently, `time_deriv_0d` works by preparing a context pack with all of the infrastructure for creating a 1-element version of grackle_field_data. This was a pragmatic choice early during transcription, but it's hacky & inefficient. Before this PR: - the `time_derivative_0d::derivative` function would overwrite `pack.field.internal_energy` and `pack.field.e_density`, `pack.field.HI_density`, `pack.field.HII_density`, ... to point to the buffers provided in the function arguments - now, the context pack will pre-allocate the evolved buffers tracked within the 1-element version `grackle_field_data` and we will just copy over the values from the function arguments Aside: for all fields that aren't evolved (e.g. `density`, `dust_density`, `volumetric_heating_rate`, RT-fields, etc.) the 1-zone `grackle_field_data` instance just points to the appropriate location in the full 3D field.
This is inadvisable, but will be necessary to achieve reasonable performance in step_rate_newton_raphson
e1d601d to
2ed79c3
Compare
SpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiViewSpeciesLUTFieldAdaptor with FieldAdaptorManager and SpeciesMultiView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR depends on changes from #558 and #561
This PR introduces
FieldAdaptorManagerandSpeciesMultiView:SpeciesMultiView<T>is just an alias forMulti1DView<T>(introduced in PR [newchem-cpp] IntroduceMulti1dView#561)Multi1DView<T>in a few other places and using the type alias will make it easy for us to change the definition forSpeciesMultiView<T>(e.g. if we, as we've discussed before, ever decide to copy the species values into a temporary contiguous 2d array)FieldAdaptorManageris a tool that actually facilitates the creation of aSpeciesMultiViewfrom agrackle_field_datapointerIn order to avoid making this PR too big, I have primarily focused on just using this new machinery to replace the old, very hacky
SpeciesLUTFieldAdaptormachinery