Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
mole_species.cpp File Reference
#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"
Include dependency graph for mole_species.cpp:

Namespaces

namespace  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 moleculenewspecies (const char label[], enum spectype type, enum mole_state state, realnum form_enthalpy)
 
STATIC moleculenewspecies (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)
 
moleculefindspecies (const char buf[])
 
moleculefindspecies_validate (const char buf[])
 
molezonefindspecieslocal (const char buf[])
 
molezonefindspecieslocal_validate (const char buf[])
 
shared_ptr< chem_nuclidefindnuclide (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
 
moleculenull_mole
 
molezonenull_molezone
 
molezone null_molezone_impl
 
chem_nuclidenull_nuclide
 
chem_nuclide null_nuclide_impl
 
ChemElementList element_list
 
ChemNuclideList nuclide_list
 
vector< molecule * > groupspecies
 

Typedef Documentation

◆ chem_nuclide_i

typedef map<string,size_t>::iterator chem_nuclide_i

Enumeration Type Documentation

◆ spectype

enum spectype
Enumerator
MOLECULE 
OTHER 

Function Documentation

◆ create_isotopologues()

void create_isotopologues ( ChemNuclideList & atoms,
vector< int > & numNuclides,
string atom_old,
string atom_new,
string embellishments,
vector< string > & newLabels )

References atoms, create_isotopologues_one_position(), DEBUG_ENTRY, and fixit.

Referenced by mole_generate_isotopologue_reactions(), and newspecies().

Here is the call graph for this function:

◆ create_isotopologues_one_position()

void create_isotopologues_one_position ( unsigned position,
ChemNuclideList & atoms,
vector< int > & numNuclides,
string atom_old,
string atom_new,
string embellishments,
string & newLabel )

◆ findnuclide()

◆ findspecies()

◆ findspecies_validate()

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().

Here is the call graph for this function:

◆ findspecieslocal()

◆ findspecieslocal_validate()

molezone * findspecieslocal_validate ( const char buf[])

version for user-supplied species which may not be valid

References DEBUG_ENTRY, findspecies_validate(), molecule::index, and mole.

Referenced by iter_end_check(), radius_first(), and radius_next().

Here is the call graph for this function:

◆ getMolecules()

void getMolecules ( vector< string > & allMolecules)

getMolecules - Get a list of all active molecules.

Parameters
allMolecules[in,out] List of molecule strings.

References DEBUG_ENTRY, isMolecule(), and mole_global.

Referenced by t_mean::setup_molecules(), and test_cdTemp_molecules().

Here is the call graph for this function:

◆ isactive()

STATIC bool isactive ( const molecule & mol)

References DEBUG_ENTRY, MOLE_ACTIVE, molecule::state, and STATIC.

Referenced by mole_make_list().

◆ isMolecule()

bool isMolecule ( const string & chSpecies)

isMolecule - Tell if the input string corresponds to a valid & active molecule.

Parameters
chSpecies[in] Species string
Returns
bool value: true, if a valid molecule; false, otherwise

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::isMolecule(), molecule::label, and null_mole.

Referenced by cdTemp(), getMolecules(), and test_isMolecule().

Here is the call graph for this function:

◆ ispassive()

STATIC bool ispassive ( const molecule & mol)

References DEBUG_ENTRY, MOLE_PASSIVE, molecule::state, and STATIC.

Referenced by mole_make_list().

◆ isSpecies()

bool isSpecies ( const string & chSpecies)

isSpecies - Tell if the input string corresponds to a valid & active species.

Parameters
chSpecies[in] Species string
Returns
bool value: true, if a valid species; false, otherwise

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::isMolecule(), molecule::isMonatomic(), molecule::label, and null_mole.

Referenced by cdTemp().

Here is the call graph for this function:

◆ lgDifferByExcitation()

bool lgDifferByExcitation ( const molecule & mol1,
const molecule & mol2 )

References molecule::label.

Referenced by register_reaction_vectors().

◆ MeanMassOfElement()

STATIC realnum MeanMassOfElement ( const shared_ptr< chem_element > & el)

References ASSERT, DEBUG_ENTRY, dense, fp_equal(), and STATIC.

Referenced by t_mole_global::make_species().

Here is the call graph for this function:

◆ mole_make_groups()

void mole_make_groups ( void )

◆ mole_make_list()

◆ mole_return_cached_species()

realnum mole_return_cached_species ( const GroupMap & MoleMap)

References ASSERT, dense, deut, frac(), lgElemsConserved(), mole, MOLE_ACTIVE, mole_global, NULL, and SDIV().

Referenced by mole_solve().

Here is the call graph for this function:

◆ mole_update_species_cache()

void mole_update_species_cache ( void )

References ASSERT, DEBUG_ENTRY, fprintf(), gv, ioQQQ, mole, mole_global, and NULL.

Referenced by diatomics::H2_LevelPops(), mole_drive(), and mole_update_sources().

Here is the call graph for this function:

◆ newelement()

STATIC void newelement ( const char label[],
int ipion )

References DEBUG_ENTRY, element_list, mole_priv::elemtab, exists(), and STATIC.

Referenced by t_mole_global::make_species().

Here is the call graph for this function:

◆ newisotope()

STATIC void newisotope ( const shared_ptr< chem_element > & el,
int massNumberA,
realnum mass_amu,
double frac )

References ASSERT, DEBUG_ENTRY, frac(), LIMELM, nuclide_list, nuclidetab, and STATIC.

Referenced by t_mole_global::make_species(), and SetIsotopeFractions().

Here is the call graph for this function:

◆ newspecies() [1/2]

STATIC molecule * newspecies ( const char label[],
enum spectype type,
enum mole_state state,
realnum form_enthalpy )

References newspecies(), and STATIC.

Referenced by t_mole_global::make_species(), newspecies(), newspecies(), and read_species_file().

Here is the call graph for this function:

◆ newspecies() [2/2]

STATIC molecule * newspecies ( const char label[],
enum spectype type,
enum mole_state state,
realnum form_enthalpy,
bool lgCreateIsotopologues )

◆ parse_species_label() [1/2]

bool parse_species_label ( const char label[],
ChemNuclideList & nuclidesLeftToRight,
vector< int > & numNuclides,
string & embellishments )

References parse_species_label().

Referenced by mole_generate_isotopologue_reactions(), newspecies(), and parse_species_label().

Here is the call graph for this function:

◆ parse_species_label() [2/2]

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, NULL, and trace.

Here is the call graph for this function:

◆ read_species_file()

STATIC void read_species_file ( string filename,
bool lgCreateIsotopologues = true )

References ASSERT, DEBUG_ENTRY, mode_r, MOLE_ACTIVE, MOLECULE, newspecies(), open_data(), and STATIC.

Referenced by t_mole_global::make_species().

Here is the call graph for this function:

◆ SetIsotopeFractions()

STATIC void SetIsotopeFractions ( const vector< bool > & lgResolveNelem)

References abund, DEBUG_ENTRY, element_list, frac(), ipCARBON, LIMELM, newisotope(), and STATIC.

Referenced by t_mole_global::make_species().

Here is the call graph for this function:

◆ species_gasphase_density()

realnum species_gasphase_density ( const string & chSpecies)

species_gasphase_density - Report gas phase density of requested species

Parameters
chSpecies[in] species to process
Returns
density of species in the current zone

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::index, mole, and null_mole.

Referenced by t_mean::MeanInc().

Here is the call graph for this function:

◆ test_isMolecule()

void test_isMolecule ( )

test_isMolecule() - Test function isMolecule()

References cdEXIT, DEBUG_ENTRY, EXIT_SUCCESS, fprintf(), ioQQQ, isMolecule(), and mole_global.

Here is the call graph for this function:

◆ total_molecule_deut()

void total_molecule_deut ( realnum & total_f)

◆ total_molecule_elems()

void total_molecule_elems ( realnum total[LIMELM])

◆ total_molecules()

realnum total_molecules ( void )

References DEBUG_ENTRY, mole, mole_global, and NULL.

◆ total_molecules_gasphase()

realnum total_molecules_gasphase ( void )

References DEBUG_ENTRY, mole, mole_global, and NULL.

Referenced by SumDensities().

Variable Documentation

◆ element_list

◆ groupspecies

◆ nuclide_list

◆ nuclidetab

map<string,size_t > nuclidetab

Referenced by findnuclide(), and newisotope().

◆ null_mole

◆ null_molezone

◆ null_molezone_impl

molezone null_molezone_impl

◆ null_nuclide

◆ null_nuclide_impl

chem_nuclide null_nuclide_impl