45 for( i=0; i < num_total; i++ )
69 b[sp->
index] -= rate_tot;
78 b[sp->
index] += rate_tot;
98 const double rated = rate_deriv[j];
124 long int i, j, nelem, ion, ion2;
131 for( i=0; i < num_total; i++ )
136 for( nelem=0; nelem<
LIMELM; ++nelem )
139 for( ion=0; ion<nelem+2; ++ion )
142 for( ion2=0; ion2<nelem+2; ++ion2 )
152 rate = &(*p->second);
181 long otherIndex = 1-i;
191 nelem = (*atom)->el->Z-1;
216 const long int nelem=(*atom)->el->Z-1;
220 for (
long int ion=0;ion<nelem+2;ion++)
222 if ((*atom)->ipMl[ion] != -1)
242 bool checkAllOK =
true;
250 map<chem_atom*, long> atom_to_index;
251 for (
unsigned long j=0; j<
atom_list.size(); ++j )
253 atom_to_index[
atom_list[j].get_ptr()] = j;
262 ccache[nc] = c[i][j];
269 for (molecule::nAtomsMap::const_iterator el =
mole_global.
list[j]->nAtom.begin();
272 long natom = atom_to_index[el->first.get_ptr()];
273 const int nAtomj = el->second;
274 for (
long i=0;i<nc;i++)
276 const double term = ccache[i] * nAtomj;
277 test[natom][ncache[i]] += term;
278 tot[natom][ncache[i]] += fabs(term);
284 for(
unsigned long natom=0; natom <
atom_list.size(); ++natom)
289 ( fabs(test[natom][i]) <=
MAX2(1e-10*tot[natom][i], 1e10*DBL_MIN) );
293 fprintf(stdout,
"Network conservation error %s %s %g %g %g %g\n",
294 atom->
label().c_str(),
297 test[natom][i]/tot[natom][i],
314 double snkx=0.,srcx=0.;
319 rate = &(*p->second);
341 if (sp == debug_species && rate->
pvector[i] == NULL)
343 if (fabs(rate_tot) > srcx)
353 if (sp == debug_species && rate->
rvector[i] == NULL)
355 if (fabs(rate_deriv[i]) > snkx)
357 snkx = rate_deriv[i];
370 fprintf( ioOut,
"%20.20s src %13.7g of %13.7g [",
372 for (j=0;j<ratesrc->nreactants;j++)
376 fprintf( ioOut,
"," );
378 fprintf( ioOut,
"%-6.6s %13.7g",
379 ratesrc->reactants[j]->label.c_str(),
382 fprintf( ioOut,
"]" );
386 fprintf( ioOut,
"%20.20s snk %13.7g of %13.7g [",
393 fprintf( ioOut,
"," );
395 fprintf( ioOut,
"%-6.6s %13.7g",
399 fprintf( ioOut,
"]" );
402 fprintf( ioOut,
"\n" );
molecule * reactants[MAXREACTANTS]
t_mole_global mole_global
vector< double > reaction_rks
void mole_dominant_rates(const molecule *debug_species, FILE *ioOut)
STATIC bool lgNucleiConserved(const multi_arr< double, 2 > &c)
map< string, count_ptr< mole_reaction > > reactab
molecule * products[MAXPRODUCTS]
molecule * rvector[MAXREACTANTS]
map< string, count_ptr< mole_reaction > >::iterator mole_reaction_i
realnum *** xMoleChTrRate
valarray< class molezone > species
void mole_eval_sources(long int num_total)
molecule * pvector[MAXPRODUCTS]
void mole_eval_balance(long int num_total, double *b, bool lgJac, multi_arr< double, 2 > &c)
bool isMonatomic(void) const
#define DEBUG_ENTRY(funcname)
ChemAtomList unresolved_atom_list