The SKIRT project
advanced radiative transfer for astrophysics
GasLineEmission Class Referencefinal

#include <GasLineEmission.hpp>

Classes

struct  AtomicLineRegistry
struct  AtomicModel
struct  ColPartner
struct  Environment
struct  LineDef
struct  RecombRegistry
struct  SpeciesSpec

Public Types

enum  LineIndex : int {
  Lya , Ha , Hb , Hg ,
  Hd , HeBalmer , Paa , Pab ,
  Bra , HeI5876 , HeI6678 , HeI7065 ,
  HeI10830 , HeII1640 , HeII4686 , NII6548 ,
  NII6583 , OI6300 , OI6364 , OII3729 ,
  OII3726 , OIII4363 , OIII4959 , OIII5007 ,
  SII6716 , SII6731 , numLines
}

Public Member Functions

 GasLineEmission ()
 GasLineEmission (const GasLineEmission &)=delete
 ~GasLineEmission ()
const AtomicModelatomicModel (int slot) const
double collisionalLineLuminosity (int lineIdx, double T, double ne, double nIon, double V_cm3) const
double hydrogenLineLuminosity (int lineIdx, double T, double ne, double gammaHI, double nHI, double V_cm3) const
void initialize (const SimulationItem *item)
void initializeAtomicModels ()
void initializeExtendedLineRegistry (const vector< SpeciesSpec > &species)
void initializeRecombinationTables ()
vector< double > lineEmissivities (const AtomicModel &model, const vector< double > &pops) const
int lineModelSlot (int lineIdx) const
const vector< LineDef > & lineRegistry () const
int lineTransition (int lineIdx) const
void loadAtomicModel (const string &speciesName, const vector< string > &partnerNames, int maxNumLevels, AtomicModel &model) const
GasLineEmissionoperator= (const GasLineEmission &)=delete
double recombinationLineLuminosity (int lineIdx, double T, double ne, double nIon, double gammaHI, double nHI, double V_cm3) const
vector< double > solveLevelPopulations (const AtomicModel &model, const Environment &env) const

Private Attributes

AtomicLineRegistry _atomicRegistry
const SimulationItem_item
Log_log
RecombRegistry _recombRegistry
vector< LineDef_registry

Detailed Description

GasLineEmission is a helper class that provides species-agnostic building blocks for gas line emission, offered for use by material mixes:

  • Line inventory: 26 built-in lines (H and He recombination lines, optical forbidden metal lines) indexed by LineIndex, plus the extended inventory appended at setup by initializeExtendedLineRegistry().
  • Recombination lines (Case B): L = eps(T, n_e) n_e n_ion V from emissivity tables (Storey & Sochi 2015 for H I, Porter et al. 2012 for He I, Storey & Hummer 1995 for He II) loaded by initializeRecombinationTables(); without tables the H lines use the legacy P_B form (Storey & Hummer 1995; Hui & Gnedin 1997; McClymont, Smith & Tacchella 2025) and the He lines are zero. Lyman-alpha always uses the legacy form (the Case B tables exclude the Lyman series).
  • Collisional lines in the nebular limit (level populations set by electron collisions at the local T and n_e, no radiative pumping): the statistical-equilibrium solver on atomic models loaded by initializeAtomicModels(), or the legacy precomputed q_col(T, n_e) tables if this function has not been called.
  • Statistical equilibrium: the general level-population solver (collisions with any set of partners, spontaneous decay, optional radiative pumping) on atomic models read from the NonLTELineGasMix species files. The solver follows Kosei Matsumoto's NonLTELineGasMix implementation (Matsumoto et al. 2023) and is shared by NonLTELineGasMix and DiffuseIonizedGasMix.

Clients should construct a GasLineEmission instance as data member and call initialize() before calling any other functions on the instance. All initilization must be performed during setup in the master thread. Once the instance is initialized, all other functions\ are thread-safe.

Member Enumeration Documentation

◆ LineIndex

Line indices for the emission line array.

Constructor & Destructor Documentation

◆ GasLineEmission() [1/2]

GasLineEmission::GasLineEmission ( )

The constructor initializes the instance to an invalid state. Call initialize() before calling any other functions. Failing to do so causes undefined behavior.

◆ ~GasLineEmission()

GasLineEmission::~GasLineEmission ( )

The destructor releases any resources acquired by this class instance.

◆ GasLineEmission() [2/2]

GasLineEmission::GasLineEmission ( const GasLineEmission & )
delete

The copy constructor and copy assignment operator are deleted because an instance may own resources (such as stored tables) that cannot be meaningfully shared by naive member-wise copying.

Member Function Documentation

◆ atomicModel()

const AtomicModel & GasLineEmission::atomicModel ( int slot) const

Returns the atomic model loaded by initializeAtomicModels() into the given slot (see lineModelSlot()).

◆ collisionalLineLuminosity()

double GasLineEmission::collisionalLineLuminosity ( int lineIdx,
double T,
double ne,
double nIon,
double V_cm3 ) const

Returns nebular-limit line luminosity [W] for a collisional line (NII6548 through SII6731, or an extended-inventory line): level populations from electron collisions at (T, ne) without radiative pumping, times nIon V. Uses the atomic models when loaded, else the legacy q_col tables. Densities in cm^-3, volume in cm^3.

◆ hydrogenLineLuminosity()

double GasLineEmission::hydrogenLineLuminosity ( int lineIdx,
double T,
double ne,
double gammaHI,
double nHI,
double V_cm3 ) const

Returns legacy H line luminosity [W] (Lya through Bra): h nu P_B(T, n_e) gammaHI nHI V, with P_B the Case B probability that a recombination emits the line. Densities in cm^-3, volume in cm^3.

◆ initialize()

void GasLineEmission::initialize ( const SimulationItem * item)

Initializes the line registry with the built-in lines (the first numLines entries, in LineIndex order). The item argument is remembered for use throughout the class to retrieve the logger and the units system. This function must be called before calling any other function.

◆ initializeAtomicModels()

void GasLineEmission::initializeAtomicModels ( )

Loads the atomic models of the built-in collisional lines' carrier species and maps each line to its transition by nearest wavelength. Does nothing after being called once.

◆ initializeExtendedLineRegistry()

void GasLineEmission::initializeExtendedLineRegistry ( const vector< SpeciesSpec > & species)

Calls initializeRecombinationTables() and initializeAtomicModels() and then appends every recombination table listed in the specified per-set wavelength index files and every radiative transition of each species loadable from resources. Absent species are silently skipped and built-in lines are not duplicated. Does nothing after being called once.

◆ initializeRecombinationTables()

void GasLineEmission::initializeRecombinationTables ( )

Loads the Case B emissivity tables from resources as memory mapped stored tables. Does nothing after being called once.

◆ lineEmissivities()

vector< double > GasLineEmission::lineEmissivities ( const AtomicModel & model,
const vector< double > & pops ) const

Returns the line power densities [W m^-3] for all radiative transitions: n_up A h c / lambda.

◆ lineModelSlot()

int GasLineEmission::lineModelSlot ( int lineIdx) const

Returns the model slot of the species carrying the given registry line, or -1 if the line is not served by a loaded atomic model. Lines with the same slot share one solve.

◆ lineRegistry()

const vector< LineDef > & GasLineEmission::lineRegistry ( ) const

Returns a reference to the line registry: the first numLines entries are the built-in lines (LineIndex order), followed by any lines added by initializeExtendedLineRegistry().

◆ lineTransition()

int GasLineEmission::lineTransition ( int lineIdx) const

Returns the transition index of the given registry line within its model (valid when lineModelSlot() >= 0).

◆ loadAtomicModel()

void GasLineEmission::loadAtomicModel ( const string & speciesName,
const vector< string > & partnerNames,
int maxNumLevels,
AtomicModel & model ) const

Fills the atomic model from the resource files NAME_Mass.txt, NAME_Energy.txt, NAME_Rad_Coeff.txt and NAME_Col_PARTNER_Temp.txt / NAME_Col_PARTNER_Coeff.txt (NAME the species name, PARTNER each collision partner), keeping at most maxNumLevels levels. The resource files are opened silently, so a caller should issue its own summary log message for the operation as a whole after loading a species or a group of species.

◆ recombinationLineLuminosity()

double GasLineEmission::recombinationLineLuminosity ( int lineIdx,
double T,
double ne,
double nIon,
double gammaHI,
double nHI,
double V_cm3 ) const

Returns H or He recombination line luminosity [W] (Lya through HeII4686): eps(T, ne) ne nIon V from the emissivity tables when loaded, else the legacy form for H (which uses gammaHI, nHI) and zero for He. nIon is the recombining ion density (H II, He II or He III). Densities in cm^-3, volume in cm^3.

◆ solveLevelPopulations()

vector< double > GasLineEmission::solveLevelPopulations ( const AtomicModel & model,
const Environment & env ) const

Solves the statistical-equilibrium rate matrix and returns level populations [m^-3] normalized to env.nTotal. Throws FatalError if the matrix is singular or the solution is not finite.


The documentation for this class was generated from the following file: