From 08dfff7e794685acfa8f44c67b8dc02bac4ffb37 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Wollaeger Date: Tue, 7 Jan 2025 18:31:34 -0700 Subject: [PATCH] Move mean opacity enum to its own header: mean_photon_types.hpp. --- .../photons/mean_photon_types.hpp | 31 +++++++++++++++++++ .../photons/mean_photon_variant.hpp | 7 +---- singularity-opac/photons/non_cgs_photons.hpp | 5 +-- 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 singularity-opac/photons/mean_photon_types.hpp diff --git a/singularity-opac/photons/mean_photon_types.hpp b/singularity-opac/photons/mean_photon_types.hpp new file mode 100644 index 0000000..763a3af --- /dev/null +++ b/singularity-opac/photons/mean_photon_types.hpp @@ -0,0 +1,31 @@ +// ====================================================================== +// © 2025. Triad National Security, LLC. All rights reserved. This +// program was produced under U.S. Government contract +// 89233218CNA000001 for Los Alamos National Laboratory (LANL), which +// is operated by Triad National Security, LLC for the U.S. +// Department of Energy/National Nuclear Security Administration. All +// rights in the program are reserved by Triad National Security, LLC, +// and the U.S. Department of Energy/National Nuclear Security +// Administration. The Government is granted for itself and others +// acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +// license in this material to reproduce, prepare derivative works, +// distribute copies to the public, perform publicly and display +// publicly, and to permit others to do so. +// ====================================================================== + +#ifndef SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_ +#define SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_ + +namespace singularity { +namespace photons { + +// mean-opacity mode +enum OpacityAveraging { + Rosseland = 0, + Planck = 1 +}; + +} // namespace photons +} // namespace singularity + +#endif // SINGULARITY_OPAC_PHOTONS_MEAN_PHOTON_TYPES_ diff --git a/singularity-opac/photons/mean_photon_variant.hpp b/singularity-opac/photons/mean_photon_variant.hpp index 63f7ec4..a307d0f 100644 --- a/singularity-opac/photons/mean_photon_variant.hpp +++ b/singularity-opac/photons/mean_photon_variant.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -28,12 +29,6 @@ namespace singularity { namespace photons { namespace impl { -// mean-opacity mode -enum OpacityAveraging { - Rosseland = 0, - Planck = 1 -}; - template class MeanVariant { private: diff --git a/singularity-opac/photons/non_cgs_photons.hpp b/singularity-opac/photons/non_cgs_photons.hpp index 6b62cb0..4d29001 100644 --- a/singularity-opac/photons/non_cgs_photons.hpp +++ b/singularity-opac/photons/non_cgs_photons.hpp @@ -22,6 +22,7 @@ #include #include +#include namespace singularity { namespace photons { @@ -289,14 +290,14 @@ class MeanNonCGSUnits { PORTABLE_INLINE_FUNCTION Real AbsorptionCoefficient(const Real rho, const Real temp, - const int gmode = 0) const { + const int gmode = Rosseland) const { const Real alpha = mean_opac_.AbsorptionCoefficient(rho, temp, gmode); return alpha * length_unit_; } PORTABLE_INLINE_FUNCTION Real Emissivity(const Real rho, const Real temp, - const int gmode = 0, + const int gmode = Rosseland, Real *lambda = nullptr) const { const Real J = mean_opac_.Emissivity(rho, temp, gmode); return J * inv_emiss_unit_ * time_unit_;