Skip to content

Towards Multigroup API#71

Merged
pdmullen merged 17 commits into
mainfrom
pdmullen/multigroup-api
Jul 14, 2026
Merged

Towards Multigroup API#71
pdmullen merged 17 commits into
mainfrom
pdmullen/multigroup-api

Conversation

@pdmullen

@pdmullen pdmullen commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

This PR and PR summary text used generative AI.

Add photon multigroup absorption & scattering API

Adds a multigroup radiation API for photons by unifying multigroup support into the existing mean-opacity classes
(absorption and scattering) rather than adding new types. With ngroups=1 and bounds [0, ∞) these reduce exactly to
gray opacities; ngroups>1 enables multigroup transport.

  • Group coefficients on (rho, T, group), built from a monochromatic model + group bounds or loaded from Spiner/SP5
    tables
  • Half-open group bounds [nu_g, nu_{g+1}) with lower/upper tail groups (0. and IEEE +inf); frequency-entry APIs
    (GroupOfNu, ...FromNu); non-CGS wrappers preserved
  • Shared helpers factored into mean_photon_utils.hpp; removed leftover ASCII loading

Full suite passes with tests + HDF5 on (686 assertions, 36 cases). Deferred to follow-ups: neutrino multigroup,
integrated multigroup emissivity.

@pdmullen
pdmullen changed the base branch from main to pdmullen/powerlaw-nudep April 9, 2026 18:42
@Yurlungur

Copy link
Copy Markdown
Collaborator

@pdmullen is this ready for review?

@Yurlungur Yurlungur self-assigned this May 26, 2026
@pdmullen pdmullen changed the title WIP: Towards Multigroup API Towards Multigroup API Jun 2, 2026
@pdmullen
pdmullen changed the base branch from pdmullen/powerlaw-nudep to main June 2, 2026 19:16
@RyanWollaeger
RyanWollaeger self-requested a review June 30, 2026 22:16
Comment thread plan_histories/71.md
Comment thread singularity-opac/photons/mean_opacity_photons.hpp
Comment thread test/test_mean_opacities.cpp
Comment thread singularity-opac/photons/mean_opacity_photons.hpp Outdated
Comment thread singularity-opac/photons/mean_opacity_photons.hpp Outdated
@RyanWollaeger

Copy link
Copy Markdown
Collaborator

Looks like test_mean_opacities.cpp got modified on main - it should be straightforward to resolve that branch conflict.

@RyanWollaeger

Copy link
Copy Markdown
Collaborator

Since the gray MeanOpacity class has been extended to multigroup here, does it make sense to support overloads of the opacity accessors that don't take a group index in the event that there is only one group (i.e. the tables are gray)? Or should that be a concern of the downstream codes?

@Yurlungur Yurlungur left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some nitpicks but my comments are non-blocking.

Comment thread singularity-opac/neutrinos/mean_opacity_neutrinos.hpp
Comment thread singularity-opac/photons/mean_opacity_photons.hpp
Comment thread singularity-opac/photons/mean_opacity_photons.hpp
Comment thread singularity-opac/photons/mean_s_opacity_photons.hpp Outdated
Comment thread singularity-opac/photons/mean_s_opacity_photons.hpp Outdated
@pdmullen

pdmullen commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Since the gray MeanOpacity class has been extended to multigroup here, does it make sense to support overloads of the opacity accessors that don't take a group index in the event that there is only one group (i.e. the tables are gray)? Or should that be a concern of the downstream codes?

These exist in this changeset already, I believe. However, I did have some concern that someone might accidentally use them with a multigroup opacity (ngroups > 1) which would result in the behavior of accessing the zeroth group, not a true frequency integrated opacity. Therefore, I added a PORTABLE_REQUIRE in 33103fb such that a user can only make these "gray" calls with a single group (i.e., gray) opacity.

@Yurlungur

Copy link
Copy Markdown
Collaborator

👍 merge when ready

Comment thread singularity-opac/photons/mean_s_opacity_photons.hpp Outdated
Comment thread singularity-opac/photons/non_cgs_photons.hpp

@RyanWollaeger RyanWollaeger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM - one minor residual question, but feel free to ignore.

@pdmullen
pdmullen merged commit 31ec436 into main Jul 14, 2026
1 check passed
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.

3 participants