lanl / singularity-opac

Performance portable routines for opacity, emissivity, and scattering
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

Remove variants? #35

Open brryan opened 2 years ago

brryan commented 2 years ago

We use a variant just for units vs. not units, especially in scattering opacities. It would be nice to find a way around this, something like @Yurlungur 's

I was imagining that in Phoebus, we just always have units. And non-cgs units just sets the conversion factor to 1? Is there a reason that wouldn't work? We could even do something like

typedef MeanS = MeanSWithUnits<MeanSGray>;

or something silly like that

brryan commented 2 years ago

Because of the issue with NonCGS opacities not being acceptable to the MeanOpacity constructor, maybe MeanOpacity should be subsumed into the regular Opacity object, removing some variants.

Also, it might be nice to be able to enroll non-standard opacities as an end user. E.g. toy opacity models that don't necessarily belong in this repository. This would probably require some kind of preprocessor-like scripting but might not be too bad.

Yurlungur commented 2 years ago

I like keeping the toy models here---I think that's useful. I agree we should reduce the number of variants somehow.

brryan commented 2 years ago

Also worth revisiting how we handle rho -> n conversions, especially in scattering opacities. It may be worth e.g. providing X, Y, and Z (hydrogen, helium, other) mass fractions through *lambda, possibly also with some notion of ionization state? Once we get to ionization state, though, opacities may just be tabulated anyway.