Skip to content

Commit

Permalink
Use Rosseland/Planck enum in photon MeanVariant.
Browse files Browse the repository at this point in the history
+ Move enum from MeanOpacity class to mean_photon_variant.hpp.
+ Use Rosseland instead of 0 in variant template function defaults.
  • Loading branch information
RyanWollaeger committed Jan 8, 2025
1 parent fa652e8 commit 2357ffb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions singularity-opac/photons/mean_opacity_photons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ class MeanOpacity {
}
Spiner::DataBox<Real> lkappa_;
const char *filename_;
enum OpacityAveraging {
Rosseland = 0,
Planck = 1
};
PlanckDistribution<PC> dist_;
};

Expand Down
10 changes: 8 additions & 2 deletions singularity-opac/photons/mean_photon_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ namespace singularity {
namespace photons {
namespace impl {

// mean-opacity mode
enum OpacityAveraging {
Rosseland = 0,
Planck = 1
};

template <typename... Opacs>
class MeanVariant {
private:
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 2357ffb

Please sign in to comment.