00001
00002
00003
00004 #ifndef MOLE_PRIV_H_
00005 #define MOLE_PRIV_H_
00006
00007
00008 #include "count_ptr.h"
00009
00010 class mole_reaction;
00011 class chem_atom;
00012
00013 namespace mole_priv {
00014 extern map <string,count_ptr<molecule> > spectab;
00015 extern map <string,count_ptr<mole_reaction> > reactab;
00016 extern map <string,count_ptr<chem_element> > elemtab;
00017 extern map <string,count_ptr<chem_atom> > atomtab;
00018 extern map <string,count_ptr<mole_reaction> > functab;
00019 };
00020
00021 class GroupMap {
00022 public:
00023 multi_arr<double,2> fion;
00024 valarray<double> molElems;
00025 void updateMolecules(const valarray<double> &b2);
00026 void setup(double *b0vec);
00027 GroupMap (size_t size)
00028 {
00029 molElems.resize( size );
00030 fion.reserve(size);
00031 for( unsigned long i = 0; i < size; ++i )
00032 fion.reserve(i,size+1);
00033 fion.alloc();
00034 }
00035 };
00036
00037 typedef map<string,count_ptr<mole_reaction> >::iterator mole_reaction_i;
00038 typedef map<string,count_ptr<mole_reaction> >::const_iterator mole_reaction_ci;
00039 typedef map<string,count_ptr<molecule> >::iterator molecule_i;
00040 typedef map<string,count_ptr<chem_element> >::iterator chem_element_i;
00041 typedef map<string,count_ptr<chem_atom> >::iterator chem_atom_i;
00042
00043 extern molecule **groupspecies;
00044
00045 #define MAXREACTANTS 3
00046 #define MAXPRODUCTS 4
00047
00048
00049 class mole_reaction {
00050 public:
00051 string label;
00052 int nreactants, nproducts, photon;
00053 molecule *reactants[MAXREACTANTS];
00054 molecule *rvector[MAXREACTANTS];
00055 molecule *rvector_excit[MAXREACTANTS];
00056 molecule *products[MAXPRODUCTS];
00057 molecule *pvector[MAXPRODUCTS];
00058 molecule *pvector_excit[MAXPRODUCTS];
00059 double reduced_mass, a, b, c;
00060 int udfastate;
00061 int source;
00062 long index;
00063 virtual double rk() const = 0;
00064 virtual mole_reaction* Create() const = 0;
00065 virtual const char *name() = 0;
00066 virtual ~mole_reaction() {};
00067 };
00068
00069 enum udfastate {ABSENT, CORRECT, CONFLICT};
00070
00071 extern void mole_dominant_rates( const molecule *debug_species, FILE *ioOut );
00072
00075 extern void mole_eval_balance(long int n, double *b, bool lgJac, multi_arr<double,2> &c);
00078 extern double mole_solve( void );
00079
00080 extern void mole_eval_sources(long int num_total);
00081
00082 extern realnum mole_return_cached_species(void);
00083
00084 extern double frac_H2star_hminus();
00085
00087 extern void mole_update_rks( void );
00088
00089 #endif
00090