More changes for Marco.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8374 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2014-01-15 15:59:50 +00:00
parent 2a37e80674
commit 6f849b215f

View File

@ -1913,7 +1913,7 @@ convert_units(cxxSolution *solution_ptr)
if (!solution_ptr->Get_new_def() || !solution_ptr->Get_initial_data())
{
input_error++;
error_msg("Missing data for convert_units");
error_msg("Missing data for convert_units", 1);
}
/*
* Convert units
@ -2783,32 +2783,21 @@ write_mass_action_eqn_x(int stop)
trxn.token[i].coef, FALSE);
if (equal(coef_e, 0.0, TOL) == FALSE)
{
assert(pe_x.find(trxn.token[i].s->secondary->pe_rxn) != pe_x.end());
cxxChemRxn &rxn_ref = pe_x[trxn.token[i].s->secondary->pe_rxn];
trxn_add(rxn_ref, trxn.token[i].coef * coef_e, FALSE);
#ifdef SKIP
// Bugfix
// Prevent inserting entry with empty string key in pe_x map
// This will result in "Cannot find master species for redox couple"
// in function tidy_redox which in turn will result in non-convergence e.g. in deck GCM_1D_STflash_CPA.INP.
// This differs from the 2.18 behaviour where pe_x array is never
// updated as a side effect of a lookup operation.
std::map < std::string, cxxChemRxn >::iterator chemRxnIt = pe_x.find(trxn.token[i].s->secondary->pe_rxn);
if ( chemRxnIt == pe_x.end() )
{
cxxChemRxn &rxn_ref = pe_x[trxn.token[i].s->secondary->pe_rxn];
trxn_add(rxn_ref, trxn.token[i].coef * coef_e, FALSE);
// Create temporary rxn object and add reactions together
cxxChemRxn rxn;
trxn_add(rxn, trxn.token[i].coef * coef_e, FALSE);
}
else
{
// Get reaction referred to by iterator and add reactions together
trxn_add(chemRxnIt->second, trxn.token[i].coef * coef_e, FALSE);
}
#endif
std::map < std::string, cxxChemRxn >::iterator chemRxnIt = pe_x.find(trxn.token[i].s->secondary->pe_rxn);
if ( chemRxnIt == pe_x.end() )
{
error_msg("pe undefined in Phreeqc::write_mass_action_eqn_x", 1);
cxxChemRxn &rxn_ref = pe_x[trxn.token[i].s->secondary->pe_rxn];
trxn_add(rxn_ref, trxn.token[i].coef * coef_e, FALSE);
// Create temporary rxn object and add reactions together
cxxChemRxn rxn;
trxn_add(rxn, trxn.token[i].coef * coef_e, FALSE);
}
else
{
// Get reaction referred to by iterator and add reactions together
trxn_add(chemRxnIt->second, trxn.token[i].coef * coef_e, FALSE);
}
}
}
}