Added diff_c function to basic.

Added test case diff_c to mytest.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@9072 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2014-11-18 18:29:27 +00:00
parent 77aa5ae5a9
commit 8262d5f224
4 changed files with 32 additions and 2 deletions

View File

@ -1590,6 +1590,9 @@ listtokens(FILE * f, tokenrec * l_buf)
case tokcallback:
output_msg("CALLBACK");
break;
case tokdiff_c:
output_msg("DIFF_C");
break;
}
l_buf = l_buf->next;
}
@ -3528,6 +3531,13 @@ factor(struct LOC_exec * LINK)
}
break;
case tokdiff_c:
{
const char * str = stringfactor(STR1, LINK);
n.UU.val = (parse_all) ? 1 : PhreeqcPtr->diff_c(str);
}
break;
case tokval:
l_s = strfactor(LINK);
tok1 = LINK->t;
@ -6819,7 +6829,8 @@ const std::map<const std::string, PBasic::BASIC_TOKEN>::value_type temp_tokens[]
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("species_formula$", PBasic::tokspecies_formula_),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("eq_frac", PBasic::tokeq_frac),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("equiv_frac", PBasic::tokeq_frac),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("callback", PBasic::tokcallback)
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("callback", PBasic::tokcallback),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("diff_c", PBasic::tokdiff_c)
};
std::map<const std::string, PBasic::BASIC_TOKEN> PBasic::command_tokens(temp_tokens, temp_tokens + sizeof temp_tokens / sizeof temp_tokens[0]);

View File

@ -321,7 +321,8 @@ public:
tokstr_e_,
tokeq_frac,
tokequiv_frac,
tokcallback
tokcallback,
tokdiff_c
};
#if !defined(PHREEQCI_GUI)

View File

@ -92,6 +92,7 @@ public:
LDBLE activity_coefficient(const char *species_name);
LDBLE log_activity_coefficient(const char *species_name);
LDBLE aqueous_vm(const char *species_name);
LDBLE diff_c(const char *species_name);
LDBLE calc_SC(void);
/* VP: Density Start */
LDBLE calc_dens(void);

View File

@ -98,7 +98,24 @@ aqueous_vm(const char *species_name)
}
return (g);
}
LDBLE Phreeqc::
diff_c(const char *species_name)
/* ---------------------------------------------------------------------- */
{
struct species *s_ptr;
LDBLE g;
s_ptr = s_search(species_name);
if (s_ptr != NULL && s_ptr->in != FALSE && s_ptr->type < EMINUS)
{
g = s_ptr->dw;
}
else
{
g = 0;
}
return (g);
}
/* ---------------------------------------------------------------------- */
LDBLE Phreeqc::
calc_SC(void)