From 2357ffb98679cb4d9fe3e8c60717710cb2801703 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Wollaeger Date: Thu, 19 Dec 2024 16:05:01 -0700 Subject: [PATCH] Use Rosseland/Planck enum in photon MeanVariant. + Move enum from MeanOpacity class to mean_photon_variant.hpp. + Use Rosseland instead of 0 in variant template function defaults. --- singularity-opac/photons/mean_opacity_photons.hpp | 4 ---- singularity-opac/photons/mean_photon_variant.hpp | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/singularity-opac/photons/mean_opacity_photons.hpp b/singularity-opac/photons/mean_opacity_photons.hpp index f98dbfe..9e97557 100644 --- a/singularity-opac/photons/mean_opacity_photons.hpp +++ b/singularity-opac/photons/mean_opacity_photons.hpp @@ -323,10 +323,6 @@ class MeanOpacity { } Spiner::DataBox lkappa_; const char *filename_; - enum OpacityAveraging { - Rosseland = 0, - Planck = 1 - }; PlanckDistribution dist_; }; diff --git a/singularity-opac/photons/mean_photon_variant.hpp b/singularity-opac/photons/mean_photon_variant.hpp index d56e705..63f7ec4 100644 --- a/singularity-opac/photons/mean_photon_variant.hpp +++ b/singularity-opac/photons/mean_photon_variant.hpp @@ -28,6 +28,12 @@ namespace singularity { namespace photons { namespace impl { +// mean-opacity mode +enum OpacityAveraging { + Rosseland = 0, + Planck = 1 +}; + template class MeanVariant { private: @@ -94,7 +100,7 @@ class MeanVariant { PORTABLE_INLINE_FUNCTION Real AbsorptionCoefficient(const Real rho, const Real temp, - const int gmode = 0) const { + const int gmode = Rosseland) const { return mpark::visit( [=](const auto &opac) { return opac.AbsorptionCoefficient(rho, temp, gmode); @@ -104,7 +110,7 @@ class MeanVariant { PORTABLE_INLINE_FUNCTION Real Emissivity(const Real rho, const Real temp, - const int gmode = 0, + const int gmode = Rosseland, Real *lambda = nullptr) const { return mpark::visit( [=](const auto &opac) {