Squashed 'src/' changes from f274a34a..c41c4e02

c41c4e02 Merge commit 'e26566584588855e782e2ab4cdd467984a185890'
e2656658 Squashed 'phreeqcpp/' changes from a377818..a376a40
30169e61 Merge commit '3765e0cf266655280d362cdf5de35c25892959b6'
3765e0cf Squashed 'phreeqcpp/' changes from 7e50e98..a377818

git-subtree-dir: src
git-subtree-split: c41c4e0230326ce7c5ac95d4db35396957ea98e4
This commit is contained in:
Darth Vader 2021-10-31 19:43:08 +00:00
parent 3ce6dfc59f
commit 141cad0190
4 changed files with 10 additions and 9 deletions

View File

@ -195,7 +195,7 @@ diff_c(const char *species_name)
g = s_ptr->dw;
if (s_ptr->dw_t)
g *= exp(s_ptr->dw_t / tk_x - s_ptr->dw_t / 298.15);
g *= viscos_0_25 / viscos;
g *= viscos_0_25 / viscos * tk_x / 298.15;
}
else
{
@ -218,7 +218,7 @@ setdiff_c(const char *species_name, double d)
g = s_ptr->dw;
if (s_ptr->dw_t)
g *= exp(s_ptr->dw_t / tk_x - s_ptr->dw_t / 298.15);
g *= viscos_0_25 / viscos;
g *= viscos_0_25 / viscos * tk_x / 298.15;;
}
else
{
@ -2457,7 +2457,7 @@ total(const char *total_name)
return (total_o_x / mass_water_aq_x);
}
std::string noplus = total_name;
replace(noplus, "+", "");
replace(noplus, "(+", "(");
master_ptr = master_bsearch(noplus.c_str());
t = 0.0;
if (master_ptr == NULL)
@ -2528,7 +2528,7 @@ total_mole(const char *total_name)
return (total_o_x);
}
std::string noplus = total_name;
replace(noplus, "+", "");
replace(noplus, "(+", "(");
master_ptr = master_bsearch(noplus.c_str());
t = 0.0;
if (master_ptr == NULL)

View File

@ -899,7 +899,7 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
return PARSER_OK;
}
while (Utilities::replace("+", "", token));
while (Utilities::replace("(+", "(", token));
std::string::iterator ptr = token.begin();
std::string elt1;

View File

@ -1825,7 +1825,7 @@ tidy_punch(void)
{
std::pair< std::string, void *> &pair_ptr = current_selected_output->Get_totals()[i];
std::string noplus = pair_ptr.first;
replace(noplus, "+", "");
replace(noplus, "(+", "(");
pair_ptr.second = master_bsearch(noplus.c_str());
}

View File

@ -660,7 +660,7 @@ parse_couple(char *token)
str_tolower(token);
return (OK);
}
while (replace("+", "", token) == TRUE);
while (replace("(+", "(", token) == TRUE);
cptr = token;
get_elt(&cptr, elt1, &e1);
if (*cptr != '(')
@ -848,9 +848,10 @@ replace(const char *str1, const char *str2, char *str)
void Phreeqc::
replace(std::string &stds, const char* str1, const char* str2)
{
size_t pos;
size_t pos, l;
l = strlen(str1);
while ((pos = stds.find(str1)) != std::string::npos) {
stds.replace(pos, 1, str2);
stds.replace(pos, l, str2);
}
}
/* ---------------------------------------------------------------------- */