Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optical generator data and update pre-generators #1182

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

amandalund
Copy link
Contributor

This adds the pre-step data and buffers needed for generating and storing the optical distribution data and updates the pre-generators in preparation for #1173.

@amandalund amandalund added the physics Particles, processes, and stepping algorithms label Apr 8, 2024
@sethrj sethrj mentioned this pull request Apr 10, 2024
25 tasks
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amandalund ! Feel free to accept or reject the two suggestions and merge when you decide.

* Immutable problem data for generating optical photon distributions.
*/
template<Ownership W, MemSpace M>
struct OpticalGenParamsData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all these data are scalars, I think you might be able to define an OpticalGenParamsScalars and then add

template<Ownership, MemSpace>
using OpticalGenParamsData = OpticalGenParamsScalars;

Then you won't have to write the operator=? Or maybe that's not worth it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that, but get some errors when using it in the StreamStore so maybe I'll hold off, unless you see what I'm missing?

/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh: In instantiation of ‘S<celeritas::Ownership::reference, M>& celeritas::StreamStore<P, S>::state(celeritas::StreamId, celeritas::size_type) [with celeritas::MemSpace M = celeritas::MemSpace::host; P = celeritas::OpticalGenParamsData; S = celeritas::OpticalGenStateData; celeritas::StreamId = celeritas::OpaqueId<celeritas::Stream_>; celeritas::size_type = unsigned int]’:
/home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:126:69:   required from here
/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh:206:21: error: no match for ‘operator=’ (operand types are ‘celeritas::CollectionStateStore<celeritas::OpticalGenStateData, celeritas::MemSpace::host>’ and ‘<brace-enclosed initializer list>’)
  206 |         state_store = {this->params<MemSpace::host>(), stream_id, size};
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/alund/celeritas_project/celeritas/src/celeritas/global/CoreState.hh:14,
                 from /home/alund/celeritas_project/celeritas/src/celeritas/global/ActionLauncher.hh:17,
                 from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:13:
/home/alund/celeritas_project/celeritas/src/corecel/data/CollectionStateStore.hh:77:34: note: candidate: ‘template<celeritas::Ownership W2, celeritas::MemSpace M2> celeritas::CollectionStateStore<S, M>& celeritas::CollectionStateStore<S, M>::operator=(const S<W2, M2>&) [with celeritas::Ownership W2 = W2; celeritas::MemSpace M2 = M2; S = celeritas::OpticalGenStateData; celeritas::MemSpace M = celeritas::MemSpace::host]’
   77 |     inline CollectionStateStore& operator=(S<W2, M2> const& other);
      |                                  ^~~~~~~~
/home/alund/celeritas_project/celeritas/src/corecel/data/CollectionStateStore.hh:77:34: note:   template argument deduction/substitution failed:
In file included from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/OpticalGenStorage.hh:12,
                 from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:22:
/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh:206:21: note:   couldn’t deduce template parameter ‘W2’
  206 |         state_store = {this->params<MemSpace::host>(), stream_id, size};
...

src/celeritas/optical/ScintillationPreGenerator.hh Outdated Show resolved Hide resolved
@amandalund amandalund merged commit bb6fc2a into celeritas-project:develop Apr 11, 2024
25 of 26 checks passed
@amandalund amandalund deleted the pre-gen-updates branch April 11, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physics Particles, processes, and stepping algorithms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants