cloudy  trunk
 All Data Structures 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-2022 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 "count_ptr.h"
8 #include "container_classes.h"
9 
10 class molecule;
11 class mole_reaction;
12 class chem_element;
13 class chem_nuclide;
14 
15 namespace mole_priv {
16  extern map <string,count_ptr<molecule> > spectab;
17  extern map <string,count_ptr<mole_reaction> > reactab;
18  extern map <string,count_ptr<chem_element> > elemtab;
19  extern map <string,count_ptr<mole_reaction> > functab;
20 }
21 
22 class GroupMap {
23 public:
25  valarray<double> molElems;
26  void updateMolecules(const valarray<double> &b2);
27  void setup(double *b0vec);
28  GroupMap (size_t size)
29  {
30  molElems.resize( size );
31  fion.reserve(size);
32  for( unsigned long i = 0; i < size; ++i )
33  fion.reserve(i,size+1);
34  fion.alloc();
35  }
36 };
37 
38 typedef map<string,count_ptr<mole_reaction> >::iterator mole_reaction_i;
39 typedef map<string,count_ptr<mole_reaction> >::const_iterator mole_reaction_ci;
40 typedef map<string,count_ptr<molecule> >::iterator molecule_i;
41 typedef map<string,count_ptr<chem_element> >::iterator chem_element_i;
42 
43 extern vector<molecule *> groupspecies;
44 
45 #define MAXREACTANTS 3
46 #define MAXPRODUCTS 4
47 
48 /* Structure containing reaction data */
50  public:
51  string label;
59  double reduced_mass, a, b, c;
60  int udfastate;
61  int source;
62  long index;
63  virtual double rk() const = 0;
64  virtual mole_reaction* Create() const = 0;
65  virtual const char *name() = 0;
66  virtual ~mole_reaction() {};
67 };
68 
70 
73 extern void mole_eval_balance(long int n, double *b, bool lgJac, multi_arr<double,2> &c);
76 extern double mole_solve( void );
77 
78 extern void mole_eval_sources(long int num_total);
79 
80 extern realnum mole_return_cached_species(const GroupMap &MoleMap);
81 
82 extern double frac_H2star_hminus();
83 
85 extern void mole_update_rks( void );
86 
87 #endif /* MOLE_PRIV_H_ */
88 
molecule * reactants[MAXREACTANTS]
Definition: mole_priv.h:53
GroupMap(size_t size)
Definition: mole_priv.h:28
map< string, count_ptr< molecule > >::iterator molecule_i
Definition: mole_priv.h:40
virtual const char * name()=0
int nreactants
Definition: mole_priv.h:52
#define MAXREACTANTS
Definition: mole_priv.h:45
map< string, count_ptr< mole_reaction > > reactab
void setup(double *b0vec)
Definition: mole_solve.cpp:584
double c
Definition: mole_priv.h:59
Definition: mole.h:142
molecule * products[MAXPRODUCTS]
Definition: mole_priv.h:56
valarray< double > molElems
Definition: mole_priv.h:25
void updateMolecules(const valarray< double > &b2)
Definition: mole_solve.cpp:684
string label
Definition: mole_priv.h:51
static double b2[63]
molecule * rvector[MAXREACTANTS]
Definition: mole_priv.h:54
map< string, count_ptr< chem_element > > elemtab
map< string, count_ptr< mole_reaction > >::iterator mole_reaction_i
Definition: mole_priv.h:38
float realnum
Definition: cddefines.h:124
virtual double rk() const =0
void mole_eval_sources(long int num_total)
map< string, count_ptr< mole_reaction > > functab
realnum mole_return_cached_species(const GroupMap &MoleMap)
multi_arr< double, 2 > fion
Definition: mole_priv.h:24
double a
Definition: mole_priv.h:59
udfastate
Definition: mole_priv.h:69
double frac_H2star_hminus()
double reduced_mass
Definition: mole_priv.h:59
molecule * pvector[MAXPRODUCTS]
Definition: mole_priv.h:57
void mole_eval_balance(long int num_total, double *b, bool lgJac, multi_arr< double, 2 > &c)
map< string, count_ptr< mole_reaction > >::const_iterator mole_reaction_ci
Definition: mole_priv.h:39
void reserve(size_type i1)
void mole_update_rks(void)
double b
Definition: mole_priv.h:59
vector< molecule * > groupspecies
double mole_solve(void)
Definition: mole_solve.cpp:46
virtual ~mole_reaction()
Definition: mole_priv.h:66
molecule * rvector_excit[MAXREACTANTS]
Definition: mole_priv.h:55
virtual mole_reaction * Create() const =0
map< string, count_ptr< molecule > > spectab
map< string, count_ptr< chem_element > >::iterator chem_element_i
Definition: mole_priv.h:41
#define MAXPRODUCTS
Definition: mole_priv.h:46
molecule * pvector_excit[MAXPRODUCTS]
Definition: mole_priv.h:58