Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
species.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef SPECIES_H_
5 #define SPECIES_H_
6 
7 /*The species structure is used to hold information about a particular atom,ion or molecule
8 mentioned in the species.ini file.The name of the atom/ion/molecule is used to obtain the density
9 of molecules in the case of the Leiden Database and along with atomic number and ion stage the
10 density of atoms/ions in the case of the CHIANTI database */
11 class species
12 {
13 public:
15  {
16  chLabel = NULL;
17  database = "";
18  dataset = "";
19  index = INT_MAX;
20  numLevels_max = -INT_MAX;
21  setLevels = -1;
22  numLevels_local = -INT_MAX;
24  fmolweight = realnum(0.);
25  lgMolecular = false;
26  fracType = realnum(0.);
28  CoolTotal = 0.;
29  lgActive = false;
30  maxWN = 0.;
31  lgLTE = false;
32  lgPrtMatrix = false;
33  lgImgMatrix = false;
34  }
36  {
37  delete[] chLabel;
38  }
39  /*Name of the atom/ion/ molecule*/
40  char *chLabel;
41  /* Database origin */
42  string database;
43  /* nickname of alternate dataset, empty string for default set */
44  string dataset;
45  // index in chemistry
46  long index;
47  /*Actual Number of energy levels in the data file*/
49  /*Number of levels defined in "species" command */
50  long setLevels;
51  /*Number of energy levels used locally*/
57  /*Molecular weight*/
59  /* is molecular? */
61  /* fraction in this "type" (e.g. para, ortho) */
63  /* chemical fractionation */
66  double CoolTotal;
68  bool lgActive;
69  /* maximum wavenumber in chianti */
70  double maxWN;
72  bool lgLTE;
77 };
78 
80 {
83  long nBins;
84 };
85 
87 
95 void db_basename_to_spectral( const string& chBasename, string &chElement,
96  char *chSpecLabel );
97 
98 void parsespect(const char* chLabel, long& nelem, long& IonStg);
99 string makeChemical(long nelem, long ion);
100 void makeChemical(char* chLabelChemical, long nelem, long ion);
101 
108 void spectral_to_chemical( char *chLabelSpec, const char* chLabelChem );
109 
116 void spectral_to_chemical( string &chLabelSpec, const char* chLabelChem );
117 
127 bool parse_chemical( const string &chLabelChem,
128  string &chElemMol, long &spCharge );
129 
136 void chemical_to_spectral( const string &chLabelChem, string &chLabelSpec );
137 
150 bool isSpeciesActive( const string &chSpecLabel );
151 
160 bool isAtomicIonValid( const long element_index, const long spCharge );
161 
169 bool isBareNucleus( const long element_index, const long spCharge );
170 
171 #endif /* SPECIES_ */
bool lgImgMatrix
Definition: species.h:76
bool lgPrtMatrix
Definition: species.h:74
bool lgActive
Definition: species.h:68
realnum fmolweight
Definition: species.h:58
long nBins
Definition: species.h:83
void spectral_to_chemical(char *chLabelSpec, const char *chLabelChem)
Definition: species.cpp:796
void chemical_to_spectral(const string &chLabelChem, string &chLabelSpec)
Definition: species.cpp:857
bool isSpeciesActive(const string &chSpecLabel)
Definition: species.cpp:920
realnum wlHi
Definition: species.h:82
double maxWN
Definition: species.h:70
t_pseudo_cont pseudoContDef
Definition: species_pseudo_cont.cpp:17
long setLevels
Definition: species.h:50
long numLevels_masterlist
Definition: species.h:56
realnum fracIsotopologue
Definition: species.h:64
string database
Definition: species.h:42
species()
Definition: species.h:14
void parsespect(const char *chLabel, long &nelem, long &IonStg)
Definition: species.cpp:691
long numLevels_local
Definition: species.h:52
realnum wlLo
Definition: species.h:81
float realnum
Definition: cddefines.h:127
realnum fracType
Definition: species.h:62
bool isAtomicIonValid(const long element_index, const long spCharge)
Definition: species.cpp:720
char * chLabel
Definition: species.h:40
#define NULL
Definition: cddefines.h:115
long index
Definition: species.h:46
Definition: species.h:79
long numLevels_max
Definition: species.h:48
bool lgMolecular
Definition: species.h:60
double CoolTotal
Definition: species.h:66
~species()
Definition: species.h:35
bool isBareNucleus(const long element_index, const long spCharge)
Definition: species.cpp:734
string dataset
Definition: species.h:44
bool parse_chemical(const string &chLabelChem, string &chElemMol, long &spCharge)
Definition: species.cpp:813
string makeChemical(long nelem, long ion)
Definition: species.cpp:748
Definition: species.h:11
void db_basename_to_spectral(const string &chBasename, string &chElement, char *chSpecLabel)
Definition: species.cpp:45
bool lgLTE
Definition: species.h:72