Cloudy
Spectral Synthesis Code for Astrophysics
|
#include "cddefines.h"
#include "species.h"
#include "taulines.h"
#include "input.h"
#include "dense.h"
#include "atmdat.h"
#include "elementnames.h"
#include "version.h"
#include "save.h"
#include "mole.h"
#include "service.h"
#include "parser.h"
#include "parse_species.h"
#include "prt.h"
#include "warnings.h"
Functions | |
STATIC void | states_popfill (void) |
STATIC void | states_nelemfill (void) |
STATIC void | database_prep (int) |
STATIC void | trim_levels (long) |
STATIC void | set_fractionation (species *sp) |
STATIC void | states_propprint (void) |
void | db_basename_to_spectral (const string &chBasename, string &chElement, char *chSpecLabel) |
void | database_readin (void) |
void | parsespect (const char *chLabel, long &nelem, long &IonStg) |
bool | isAtomicIonValid (const long element_index, const long spCharge) |
bool | isBareNucleus (const long element_index, const long spCharge) |
string | makeChemical (long nelem, long ion) |
void | makeChemical (char *chLabelChemical, long nelem, long ion) |
STATIC void | spectral_to_chemical (char *chLabelChemical, const char *chLabel, long &nelem, long &IonStg) |
void | spectral_to_chemical (char *chLabelChemical, const char *chLabel) |
void | spectral_to_chemical (string &chemicalLabel, const char *chLabel) |
bool | parse_chemical (const string &chLabelChem, string &chElemMol, long &spCharge) |
void | chemical_to_spectral (const string &chLabelChem, string &chLabelSpec) |
bool | isSpeciesActive (const string &chLabelChem) |
Variables | |
static const bool | DEBUGSTATE = false |
void chemical_to_spectral | ( | const string & | chLabelChem, |
string & | chLabelSpec | ||
) |
chemical_to_spectral - Convert a chemical label to spectral.
chLabelChem[in] | Chemical label, e.g., "C+" |
chLabelSpec[out] | Spectral label, e.g., "C 2" |
References DEBUG_ENTRY, elem_symbol_to_index(), isAtomicIonValid(), isBareNucleus(), isElementSym(), and parse_chemical().
Referenced by SaveAllSpeciesLabelsLevels(), SaveSpeciesLines(), and band_emission::setup().
STATIC void database_prep | ( | int | intSpIndex | ) |
References atmdat, BIGFLOAT, dBaseSpecies, dBaseStates, dBaseTrans, DEBUG_ENTRY, ipCRD, ipCRDW, ipIRON, ipPRD, t_atmdat::ipSpecIon, and SMALLFLOAT.
Referenced by database_readin().
void database_readin | ( | void | ) |
References AllTransitions, ASSERT, atmdat, atmdat_CHIANTI_readin(), atmdat_LAMDA_readin(), atmdat_STOUT_readin(), AtmolCollRateCoeff, AtmolCollSplines, CHARS_SPECIES, t_atmdat::chCloudyChiantiFile, t_atmdat::chdBaseSources, t_cpu_i::chDirSeparator(), DataParser::checkEOL(), DataParser::checkMagic(), t_elementnames::chElementSym, t_atmdat::chLamdaFile, t_atmdat::chStoutFile, t_atmdat::chVersion, cpu, database_prep(), db_basename_to_spectral(), dBaseSpecies, dBaseStates, dBaseTrans, DEBUG_ENTRY, DEBUGSTATE, elementnames, DataParser::errorAbort(), ES_NONE, findspecies(), fixit, fprintf(), DataParser::getline(), DataParser::getToken(), DataParser::getTokenOptional(), t_cpu::i(), Singleton< t_version >::Inst(), ioQQQ, ipdBaseTrans, ipNCOLLIDER, t_save::ipSDSFile, t_atmdat::lgCalpgmOn, t_atmdat::lgChiantiOn, t_atmdat::lgdBaseSourceExists, t_atmdat::lgLamdaOn, t_prt::lgPrintTime, t_save::lgSDSOn, t_atmdat::lgStoutOn, LIMELM, notein(), nSpecies, null_mole, DataParser::open(), prt, save, set_fractionation(), speciesCheck(), states_nelemfill(), states_popfill(), states_propprint(), StoutCollData, TotalInsanity(), trim_levels(), and trimTrailingWhiteSpace().
Referenced by atmdat_readin().
void db_basename_to_spectral | ( | const string & | chBasename, |
string & | chElement, | ||
char * | chSpecLabel | ||
) |
db_basename_to_spectral - Convert the species basename in Stout or Chianti to a spectral label.
chBasename[in] | File basename, e.g., "c_2" |
chElement[out] | Extracted element name, e.g., "C" |
chSpecLabel[out] | Spectral label, e.g., "C 2" |
References ASSERT, DEBUG_ENTRY, toupper(), and uncaps().
Referenced by database_readin().
bool isAtomicIonValid | ( | const long | element_index, |
const long | spCharge | ||
) |
isAtomicIonValid - Tell if an atomic ion is has a charge consistent with its atomic number.
element_index[in] | Zero-offset index for element; 0 for H, 29 for Zn |
spCharge[in] | Species charge |
References ASSERT, and DEBUG_ENTRY.
Referenced by cdTemp(), and chemical_to_spectral().
bool isBareNucleus | ( | const long | element_index, |
const long | spCharge | ||
) |
isBareNucleus - Tell if the given ion is a bare nucleus.
element_index[in] | Zero-offset index for element; 0 for H, 29 for Zn |
spCharge[in] | Species charge |
References ASSERT, and DEBUG_ENTRY.
Referenced by chemical_to_spectral().
bool isSpeciesActive | ( | const string & | chSpecLabel | ) |
isSpeciesActive - Tell if the species is enabled
An atomic/ionic species may be inactive if the relevant element is disabled. Likewise, a molecular species may be inactive if one of its constituents elements is disabled. This function reports on the given species. If not found, the result is false.
chLabelChem | [in] Chemical label, e.g., "C+2", or "HCl" |
References DEBUG_ENTRY, t_mole_global::list, mole, mole_global, NULL, and t_mole_local::species.
Referenced by SpeciesBandsCreate().
string makeChemical | ( | long | nelem, |
long | ion | ||
) |
References t_elementnames::chElementSym, DEBUG_ENTRY, and elementnames.
Referenced by InitCoreloadPostparse(), iso_allocate(), iso_level(), lines(), makeChemical(), save_opacity(), setProperties(), and spectral_to_chemical().
void makeChemical | ( | char * | chLabelChemical, |
long | nelem, | ||
long | ion | ||
) |
References CHARS_SPECIES, DEBUG_ENTRY, and makeChemical().
bool parse_chemical | ( | const string & | chLabelChem, |
string & | chElemMol, | ||
long & | spCharge | ||
) |
parse_chemical - Parse the element and charge of a chemical label.
chLabelChem[in] | Chemical label, e.g., "C+2", or "HCl" |
chElemMol[out] | Element or molecule, e.g., "C", or "HCl" |
spCharge[out] | Species charge, e.g., 2, or 0 |
References DEBUG_ENTRY, fprintf(), and ioQQQ.
Referenced by cdTemp(), and chemical_to_spectral().
void parsespect | ( | const char * | chLabel, |
long & | nelem, | ||
long & | IonStg | ||
) |
References t_elementnames::chElementSym, DEBUG_ENTRY, elementnames, and LIMELM.
Referenced by lines(), setProperties(), and spectral_to_chemical().
References species::chLabel, DEBUG_ENTRY, fixit, species::fracIsotopologue, and species::fracType.
Referenced by database_readin().
STATIC void spectral_to_chemical | ( | char * | chLabelChemical, |
const char * | chLabel, | ||
long & | nelem, | ||
long & | IonStg | ||
) |
References ASSERT, cdEXIT, t_elementnames::chElementSym, DEBUG_ENTRY, elementnames, EXIT_FAILURE, fprintf(), ioQQQ, LIMELM, makeChemical(), NISO, and parsespect().
Referenced by atmdat_CHIANTI_readin(), atmdat_STOUT_readin(), Atom_LevelN::operator()(), spectral_to_chemical(), and states_nelemfill().
void spectral_to_chemical | ( | char * | chLabelSpec, |
const char * | chLabelChem | ||
) |
spectral_to_chemical - Convert a spectral label to chemical.
chLabelSpec[in] | Spectral label, e.g., "C 2" |
chLabelChem[out] | Chemical label, e.g., "C+" |
References DEBUG_ENTRY, and spectral_to_chemical().
void spectral_to_chemical | ( | string & | chLabelSpec, |
const char * | chLabelChem | ||
) |
spectral_to_chemical - Convert a spectral label to chemical.
chLabelSpec[in] | Spectral label, e.g., "C 2" |
chLabelChem[out] | Chemical label, e.g., "C+" |
References DEBUG_ENTRY, NCHLAB, and spectral_to_chemical().
STATIC void states_nelemfill | ( | void | ) |
References atmdat, t_dense::AtomicWeight, CHARS_SPECIES, dBaseSpecies, dBaseStates, dBaseTrans, DEBUG_ENTRY, dense, findspecies(), fixit, fprintf(), t_save::img_matrix, molecule::index, ioQQQ, ipHYDROGEN, t_atmdat::ipSpecIon, t_atmdat::lgChiantiLvl2Hybrid, t_dense::lgElmtOn, t_dense::lgIonChiantiOn, t_dense::lgIonStoutOn, t_atmdat::lgStoutLvl2Hybrid, t_prt::matrix, t_dense::maxWN, mole, nSpecies, null_mole, prt, save, t_prt_matrix::species, t_mole_local::species, spectral_to_chemical(), and TotalInsanity().
Referenced by database_readin().
STATIC void states_popfill | ( | void | ) |
References dBaseSpecies, dBaseStates, DEBUG_ENTRY, and nSpecies.
Referenced by database_readin().
STATIC void states_propprint | ( | void | ) |
References dBaseSpecies, dBaseStates, DEBUG_ENTRY, energy(), and nSpecies.
Referenced by database_readin().
STATIC void trim_levels | ( | long | ipSpecies | ) |
trim_levels: Trim the highest energy levels until there is a transition out of the highest level with an Aul value that is not the default. The default value of 1e-30 is used when no Aul is given in the database.
References atmdat, t_atmdat::aulThreshold, cdEXIT, dBaseSpecies, dBaseStates, dBaseTrans, DEBUG_ENTRY, DEBUGSTATE, EXIT_FAILURE, fprintf(), ioQQQ, ipdBaseTrans, t_atmdat::lgChiantiPrint, t_atmdat::lgLamdaPrint, and t_atmdat::lgStoutPrint.
Referenced by database_readin().
|
static |
Referenced by database_readin(), and trim_levels().