Cloudy
Spectral Synthesis Code for Astrophysics
|
#include "cdstd.h"
#include "cddefines.h"
#include "deuterium.h"
#include "elementnames.h"
#include "h2.h"
#include "hmi.h"
#include "dense.h"
#include "grainvar.h"
#include "trace.h"
#include "abund.h"
#include "mole_priv.h"
#include "mole.h"
#include "parse_species.h"
Namespaces | |
mole_priv | |
Typedefs | |
typedef map< string, size_t > ::iterator | chem_nuclide_i |
Enumerations | |
enum | spectype { MOLECULE, OTHER } |
Functions | |
STATIC void | read_species_file (string filename, bool lgCreateIsotopologues=true) |
STATIC void | newelement (const char label[], int ipion) |
STATIC void | newisotope (const shared_ptr< chem_element > &el, int massNumberA, realnum mass_amu, double frac) |
STATIC realnum | MeanMassOfElement (const shared_ptr< chem_element > &el) |
STATIC molecule * | newspecies (const char label[], enum spectype type, enum mole_state state, realnum form_enthalpy) |
STATIC molecule * | newspecies (const char label[], enum spectype type, enum mole_state state, realnum form_enthalpy, bool lgCreateIsotopologues) |
STATIC bool | isactive (const molecule &mol) |
STATIC bool | ispassive (const molecule &mol) |
STATIC void | SetIsotopeFractions (const vector< bool > &lgResolveNelem) |
void | mole_make_list () |
void | create_isotopologues (ChemNuclideList &atoms, vector< int > &numNuclides, string atom_old, string atom_new, string embellishments, vector< string > &newLabels) |
void | create_isotopologues_one_position (unsigned position, ChemNuclideList &atoms, vector< int > &numNuclides, string atom_old, string atom_new, string embellishments, string &newLabel) |
bool | parse_species_label (const char label[], ChemNuclideList &nuclidesLeftToRight, vector< int > &numNuclides, string &embellishments) |
bool | parse_species_label (const char label[], ChemNuclideList &nuclidesLeftToRight, vector< int > &numNuclides, string &embellishments, bool &lgExcit, int &charge, bool &lgGas_Phase) |
bool | lgDifferByExcitation (const molecule &mol1, const molecule &mol2) |
molecule * | findspecies (const char buf[]) |
molecule * | findspecies_validate (const char buf[]) |
molezone * | findspecieslocal (const char buf[]) |
molezone * | findspecieslocal_validate (const char buf[]) |
shared_ptr< chem_nuclide > | findnuclide (const char buf[]) |
void | mole_update_species_cache (void) |
realnum | mole_return_cached_species (const GroupMap &) |
void | total_molecule_deut (realnum &total_f) |
void | total_molecule_elems (realnum total[LIMELM]) |
realnum | total_molecules (void) |
realnum | total_molecules_gasphase (void) |
realnum | species_gasphase_density (const string &chSpecies) |
void | mole_make_groups (void) |
bool | isSpecies (const string &chSpecies) |
bool | isMolecule (const string &chSpecies) |
void | test_isMolecule () |
void | getMolecules (vector< string > &allMolecules) |
Variables | |
map< string, size_t > | nuclidetab |
molecule * | null_mole |
molezone * | null_molezone |
molezone | null_molezone_impl |
chem_nuclide * | null_nuclide |
chem_nuclide | null_nuclide_impl |
ChemElementList | element_list |
ChemNuclideList | nuclide_list |
vector< molecule * > | groupspecies |
typedef map<string,size_t >::iterator chem_nuclide_i |
enum spectype |
void create_isotopologues | ( | ChemNuclideList & | atoms, |
vector< int > & | numNuclides, | ||
string | atom_old, | ||
string | atom_new, | ||
string | embellishments, | ||
vector< string > & | newLabels | ||
) |
References create_isotopologues_one_position(), DEBUG_ENTRY, and fixit.
Referenced by mole_generate_isotopologue_reactions(), and newspecies().
void create_isotopologues_one_position | ( | unsigned | position, |
ChemNuclideList & | atoms, | ||
vector< int > & | numNuclides, | ||
string | atom_old, | ||
string | atom_new, | ||
string | embellishments, | ||
string & | newLabel | ||
) |
References ASSERT, and DEBUG_ENTRY.
Referenced by create_isotopologues(), and mole_generate_isotopologue_reactions().
shared_ptr<chem_nuclide> findnuclide | ( | const char | buf[] | ) |
References DEBUG_ENTRY, nuclide_list, nuclidetab, and NULL.
Referenced by mole_effects(), mole_generate_isotopologue_reactions(), mole_h_rate_diagnostics(), parse_species_label(), and PrtZone().
molecule* findspecies | ( | const char | buf[] | ) |
version for species we know are valid, but may not be present in calculation
References DEBUG_ENTRY, null_mole, and mole_priv::spectab.
Referenced by t_mole_local::chem_heat(), ConvBase(), CoolHeatError(), database_readin(), t_mole_local::dissoc_rate(), findspecieslocal(), diatomics::init(), isMolecule(), iso_allocate(), isSpecies(), lgElemsConserved(), lgNetEdenSrcSmall(), t_mole_global::make_species(), mole_make_list(), mole_save(), parse_reaction(), parse_udfa(), prt_smooth_predictions(), radius_increment(), SaveDo(), t_mole_local::sink_rate_tot(), t_mole_local::source_rate_tot(), species_gasphase_density(), and states_nelemfill().
molecule* findspecies_validate | ( | const char | buf[] | ) |
version for user-supplied species which may not be valid
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and mole_priv::spectab.
Referenced by findspecieslocal_validate().
molezone* findspecieslocal | ( | const char | buf[] | ) |
version for species we know are valid, but may not be present in calculation
References DEBUG_ENTRY, findspecies(), molecule::index, mole, null_molezone, and t_mole_local::species.
Referenced by AgeCheck(), t_gaunt::brems_sum_ions(), cdColm(), check_co_ion_converge(), ConvBase(), CoolEvaluate(), dBaseAbund(), DynaPunchTimeDep(), getLevelsGeneric(), GrainCollHeating(), diatomics::H2_PunchDo(), diatomics::H2_X_coll_rate_evaluate(), HeatSum(), InitSimPostparse(), IonHydro(), iso_level(), iter_end_check(), IterRestart(), lines_molecules(), mole_effects(), diatomics::mole_H2_form(), mole_h_fixup(), mole_h_rate_diagnostics(), mole_h_reactions(), OpacityAddTotal(), PrtAllTau(), PrtComment(), PrtZone(), radius_increment(), radius_next(), RT_continuum(), RT_OTS(), RT_tau_inc(), SaveDo(), SaveLineData(), SecIoniz(), t_mole_local::set_ion_locations(), and ShowMe().
molezone* findspecieslocal_validate | ( | const char | buf[] | ) |
version for user-supplied species which may not be valid
References DEBUG_ENTRY, findspecies_validate(), molecule::index, mole, and t_mole_local::species.
Referenced by iter_end_check(), radius_first(), and radius_next().
void getMolecules | ( | vector< string > & | allMolecules | ) |
getMolecules - Get a list of all active molecules.
allMolecules | [in,out] List of molecule strings. |
References DEBUG_ENTRY, isMolecule(), t_mole_global::list, and mole_global.
Referenced by t_mean::setup_molecules(), and test_cdTemp_molecules().
References DEBUG_ENTRY, MOLE_ACTIVE, and molecule::state.
Referenced by mole_make_list().
bool isMolecule | ( | const string & | chSpecies | ) |
isMolecule - Tell if the input string corresponds to a valid & active molecule.
chSpecies | [in] Species string |
References DEBUG_ENTRY, findspecies(), molecule::isMolecule(), and molecule::label.
Referenced by cdTemp(), getMolecules(), and test_isMolecule().
References DEBUG_ENTRY, MOLE_PASSIVE, and molecule::state.
Referenced by mole_make_list().
bool isSpecies | ( | const string & | chSpecies | ) |
isSpecies - Tell if the input string corresponds to a valid & active species.
chSpecies | [in] Species string |
References DEBUG_ENTRY, findspecies(), molecule::isMolecule(), molecule::isMonatomic(), and molecule::label.
Referenced by cdTemp().
References molecule::label.
Referenced by register_reaction_vectors().
STATIC realnum MeanMassOfElement | ( | const shared_ptr< chem_element > & | el | ) |
References ASSERT, t_dense::AtomicWeight, DEBUG_ENTRY, dense, and fp_equal().
Referenced by t_mole_global::make_species().
void mole_make_groups | ( | void | ) |
References ASSERT, DEBUG_ENTRY, groupspecies, LIMELM, t_mole_global::list, mole_global, t_mole_global::num_calc, and t_mole_global::num_compacted.
Referenced by t_mole_global::init().
void mole_make_list | ( | void | ) |
References ASSERT, molecule::charge, DEBUG_ENTRY, findspecies(), isactive(), molecule::isMonatomic(), ispassive(), molecule::lgGas_Phase, t_mole_global::list, mole_global, molecule::nNuclide, t_mole_global::num_calc, t_mole_global::num_total, t_mole_global::sort(), and mole_priv::spectab.
Referenced by t_mole_global::init().
References ASSERT, dense, deut, t_mole_local::elec, frac(), t_dense::gas_phase, lgElemsConserved(), t_mole_global::list, mole, MOLE_ACTIVE, mole_global, NULL, t_mole_global::num_calc, t_mole_global::num_total, SDIV(), t_mole_local::species, t_deuterium::updateXMolecules(), and t_dense::updateXMolecules().
Referenced by mole_solve().
void mole_update_species_cache | ( | void | ) |
References ASSERT, GrainVar::bin, DEBUG_ENTRY, fprintf(), t_mole_local::grain_area, t_mole_local::grain_density, t_mole_local::grain_saturation, gv, ioQQQ, GrainVar::lgDustOn(), t_mole_global::list, mole, mole_global, NULL, t_mole_global::num_total, t_mole_local::set_isotope_abundances(), and t_mole_local::species.
Referenced by diatomics::H2_LevelPops(), mole_drive(), and mole_update_sources().
STATIC void newelement | ( | const char | label[], |
int | ipion | ||
) |
References DEBUG_ENTRY, element_list, mole_priv::elemtab, and exists().
Referenced by t_mole_global::make_species().
STATIC void newisotope | ( | const shared_ptr< chem_element > & | el, |
int | massNumberA, | ||
realnum | mass_amu, | ||
double | frac | ||
) |
References ASSERT, DEBUG_ENTRY, frac(), LIMELM, nuclide_list, and nuclidetab.
Referenced by t_mole_global::make_species(), and SetIsotopeFractions().
STATIC molecule * newspecies | ( | const char | label[], |
enum spectype | type, | ||
enum mole_state | state, | ||
realnum | form_enthalpy | ||
) |
Referenced by t_mole_global::make_species(), newspecies(), and read_species_file().
STATIC molecule * newspecies | ( | const char | label[], |
enum spectype | type, | ||
enum mole_state | state, | ||
realnum | form_enthalpy, | ||
bool | lgCreateIsotopologues | ||
) |
References ASSERT, create_isotopologues(), DEBUG_ENTRY, exists(), fprintf(), ioQQQ, ipHYDROGEN, t_mole_global::lgNoHeavyMole, t_mole_global::lgNoMole, t_trace::lgTraceMole, t_mole_global::lgTreatIsotopes, MOLE_ACTIVE, mole_global, MOLE_NULL, MOLECULE, newspecies(), NULL, t_mole_global::num_calc, t_mole_global::num_total, molecule::parentLabel, parse_species_label(), speciesOff(), mole_priv::spectab, and trace.
bool parse_species_label | ( | const char | label[], |
ChemNuclideList & | nuclidesLeftToRight, | ||
vector< int > & | numNuclides, | ||
string & | embellishments | ||
) |
Referenced by mole_generate_isotopologue_reactions(), and newspecies().
bool parse_species_label | ( | const char | label[], |
ChemNuclideList & | nuclidesLeftToRight, | ||
vector< int > & | numNuclides, | ||
string & | embellishments, | ||
bool & | lgExcit, | ||
int & | charge, | ||
bool & | lgGas_Phase | ||
) |
References ASSERT, CHARS_ISOTOPE_SYM, dense, findnuclide(), fprintf(), ioQQQ, t_dense::lgElmtOn, t_trace::lgTraceMole, NULL, and trace.
STATIC void read_species_file | ( | string | filename, |
bool | lgCreateIsotopologues = true |
||
) |
References ASSERT, DEBUG_ENTRY, mode_r, MOLE_ACTIVE, MOLECULE, newspecies(), and open_data().
Referenced by t_mole_global::make_species().
STATIC void SetIsotopeFractions | ( | const vector< bool > & | lgResolveNelem | ) |
References abund, DEBUG_ENTRY, element_list, frac(), isotope::getAbn(), isotope::getAiso(), isotope::getMass(), isotope::getNiso(), ipCARBON, t_abund::IsoAbn, LIMELM, and newisotope().
Referenced by t_mole_global::make_species().
realnum species_gasphase_density | ( | const string & | chSpecies | ) |
species_gasphase_density - Report gas phase density of requested species
chSpecies | [in] species to process |
References DEBUG_ENTRY, findspecies(), molecule::index, mole, and t_mole_local::species.
Referenced by t_mean::MeanInc().
void test_isMolecule | ( | ) |
test_isMolecule() - Test function isMolecule()
References cdEXIT, DEBUG_ENTRY, EXIT_SUCCESS, fprintf(), ioQQQ, isMolecule(), t_mole_global::list, and mole_global.
void total_molecule_deut | ( | realnum & | total_f | ) |
References DEBUG_ENTRY, deut, t_deuterium::lgElmtOn, t_mole_global::list, mole, mole_global, NULL, t_mole_global::num_calc, and t_mole_local::species.
Referenced by t_deuterium::updateXMolecules().
void total_molecule_elems | ( | realnum | total[LIMELM] | ) |
References ASSERT, DEBUG_ENTRY, ipHYDROGEN, LIMELM, t_mole_global::list, mole, mole_global, NULL, t_mole_global::num_calc, and t_mole_local::species.
Referenced by t_dense::updateXMolecules().
realnum total_molecules | ( | void | ) |
References DEBUG_ENTRY, t_mole_global::list, mole, mole_global, NULL, t_mole_global::num_calc, and t_mole_local::species.
realnum total_molecules_gasphase | ( | void | ) |
References DEBUG_ENTRY, t_mole_global::list, mole, mole_global, NULL, t_mole_global::num_calc, and t_mole_local::species.
Referenced by SumDensities().
ChemElementList element_list |
Referenced by t_mole_global::make_species(), newelement(), and SetIsotopeFractions().
vector<molecule *> groupspecies |
Referenced by funjac(), grouped_elems(), mole_make_groups(), mole_solve(), mole_system_error(), newton_step(), GroupMap::setup(), and GroupMap::updateMolecules().
ChemNuclideList nuclide_list |
Referenced by findnuclide(), funjac(), grouped_elems(), lgElemsConserved(), lgNucleiConserved(), t_mole_global::make_species(), mole_create_react(), mole_eval_sources(), mole_h_rate_diagnostics(), mole_ion_trim(), mole_solve(), newisotope(), t_mole_local::set_ion_locations(), t_mole_local::set_isotope_abundances(), GroupMap::setup(), and GroupMap::updateMolecules().
map<string,size_t > nuclidetab |
Referenced by findnuclide(), and newisotope().
molecule* null_mole |
molezone* null_molezone |
molezone null_molezone_impl |
Referenced by t_mole_global::make_species().
chem_nuclide* null_nuclide |
Referenced by molecule::heavyAtom(), IterRestart(), molcol(), mole_update_limiting_reactants(), and molezone::zero().
chem_nuclide null_nuclide_impl |
Referenced by t_mole_global::make_species().