Squashed 'phreeqcpp/' changes from 7e50e98..a377818

a377818 Merge remote-tracking branch 'usgs-coupled/master'
7c3d060 Merged remote-tracking branch 'origin/master'
c6e8aea Fixed DIFF_C and SETDIFF_C. Updated RELEASE.txt
942dc22 Replace (+ with ( for dealing with Fe(+3, so that [Fe+2] is still a legitimate element name

git-subtree-dir: phreeqcpp
git-subtree-split: a3778180a1d258bdccda2d2e3ec1a745f4738c77
This commit is contained in:
Darth Vader 2021-10-31 19:41:44 +00:00
parent a330bc51e3
commit 3765e0cf26
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);
}
}
/* ---------------------------------------------------------------------- */