Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mole_priv.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2023 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef MOLE_PRIV_H_
5 #define MOLE_PRIV_H_
6 
7 #include "container_classes.h"
8 
9 class molecule;
10 class mole_reaction;
11 class chem_element;
12 class chem_nuclide;
13 
14 namespace mole_priv {
15  extern map <string,shared_ptr<molecule> > spectab;
16  extern map <string,shared_ptr<mole_reaction> > reactab;
17  extern map <string,shared_ptr<chem_element> > elemtab;
18  extern map <string,shared_ptr<mole_reaction> > functab;
19 }
20 
21 class GroupMap {
22 public:
24  valarray<double> molElems;
25  void updateMolecules(const valarray<double> &b2);
26  void setup(double *b0vec);
27  GroupMap (size_t size)
28  {
29  molElems.resize( size );
30  fion.reserve(size);
31  for( unsigned long i = 0; i < size; ++i )
32  fion.reserve(i,size+1);
33  fion.alloc();
34  }
35 };
36 
37 typedef map<string,shared_ptr<mole_reaction> >::iterator mole_reaction_i;
38 typedef map<string,shared_ptr<mole_reaction> >::const_iterator mole_reaction_ci;
39 typedef map<string,shared_ptr<molecule> >::iterator molecule_i;
40 typedef map<string,shared_ptr<chem_element> >::iterator chem_element_i;
41 
42 extern vector<molecule *> groupspecies;
43 
44 #define MAXREACTANTS 3
45 #define MAXPRODUCTS 4
46 
47 /* Structure containing reaction data */
49  public:
50  string label;
58  double reduced_mass, a, b, c;
59  int udfastate;
60  int source;
61  long index;
62  virtual double rk() const = 0;
63  virtual mole_reaction* Create() const = 0;
64  virtual const char *name() = 0;
65  virtual ~mole_reaction() {};
66 };
67 
69 
72 extern void mole_eval_balance(long int n, double *b, bool lgJac, multi_arr<double,2> &c);
75 extern double mole_solve( void );
76 
77 extern void mole_eval_sources(long int num_total);
78 
79 extern realnum mole_return_cached_species(const GroupMap &MoleMap);
80 
81 extern double frac_H2star_hminus();
82 
84 extern void mole_update_rks( void );
85 
86 #endif /* MOLE_PRIV_H_ */
87 
molecule * reactants[MAXREACTANTS]
Definition: mole_priv.h:52
long index
Definition: mole_priv.h:61
void mole_eval_sources(long int num_total)
Definition: mole_eval_balance.cpp:151
Definition: mole_priv.h:68
int udfastate
Definition: mole_priv.h:59
Definition: mole_priv.h:48
GroupMap(size_t size)
Definition: mole_priv.h:27
void alloc()
Definition: container_classes.h:1078
virtual const char * name()=0
map< string, shared_ptr< chem_element > > elemtab
Definition: mole_species.cpp:43
Definition: mole.h:23
int nreactants
Definition: mole_priv.h:51
#define MAXREACTANTS
Definition: mole_priv.h:44
map< string, shared_ptr< molecule > > spectab
Definition: mole_species.cpp:41
void setup(double *b0vec)
Definition: mole_solve.cpp:579
double c
Definition: mole_priv.h:58
Definition: mole.h:145
map< string, shared_ptr< chem_element > >::iterator chem_element_i
Definition: mole_priv.h:40
Definition: mole_priv.h:68
map< string, shared_ptr< mole_reaction > >::const_iterator mole_reaction_ci
Definition: mole_priv.h:38
map< string, shared_ptr< mole_reaction > > functab
Definition: mole_species.cpp:44
molecule * products[MAXPRODUCTS]
Definition: mole_priv.h:55
valarray< double > molElems
Definition: mole_priv.h:24
void updateMolecules(const valarray< double > &b2)
Definition: mole_solve.cpp:684
string label
Definition: mole_priv.h:50
static double b2[63]
Definition: atmdat_3body.cpp:18
molecule * rvector[MAXREACTANTS]
Definition: mole_priv.h:53
float realnum
Definition: cddefines.h:127
virtual double rk() const =0
Definition: mole_priv.h:68
int source
Definition: mole_priv.h:60
realnum mole_return_cached_species(const GroupMap &MoleMap)
Definition: mole_species.cpp:925
multi_arr< double, 2 > fion
Definition: mole_priv.h:23
double a
Definition: mole_priv.h:58
void mole_eval_balance(long int n, double *b, bool lgJac, multi_arr< double, 2 > &c)
Definition: mole_eval_balance.cpp:36
udfastate
Definition: mole_priv.h:68
map< string, shared_ptr< molecule > >::iterator molecule_i
Definition: mole_priv.h:39
double frac_H2star_hminus()
Definition: mole_reactions.cpp:714
double reduced_mass
Definition: mole_priv.h:58
molecule * pvector[MAXPRODUCTS]
Definition: mole_priv.h:56
void reserve(size_type i1)
Definition: container_classes.h:1042
Definition: mole.h:41
int nproducts
Definition: mole_priv.h:51
void mole_update_rks(void)
Definition: mole_reactions.cpp:3006
double b
Definition: mole_priv.h:58
map< string, shared_ptr< mole_reaction > >::iterator mole_reaction_i
Definition: mole_priv.h:37
vector< molecule * > groupspecies
Definition: mole_species.cpp:57
double mole_solve(void)
Definition: mole_solve.cpp:46
virtual ~mole_reaction()
Definition: mole_priv.h:65
molecule * rvector_excit[MAXREACTANTS]
Definition: mole_priv.h:54
virtual mole_reaction * Create() const =0
Definition: mole_priv.h:21
map< string, shared_ptr< mole_reaction > > reactab
Definition: mole_species.cpp:42
#define MAXPRODUCTS
Definition: mole_priv.h:45
molecule * pvector_excit[MAXPRODUCTS]
Definition: mole_priv.h:57
int photon
Definition: mole_priv.h:51