mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
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:
parent
77aa5ae5a9
commit
8262d5f224
13
PBasic.cpp
13
PBasic.cpp
@ -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]);
|
||||
|
||||
|
||||
3
PBasic.h
3
PBasic.h
@ -321,7 +321,8 @@ public:
|
||||
tokstr_e_,
|
||||
tokeq_frac,
|
||||
tokequiv_frac,
|
||||
tokcallback
|
||||
tokcallback,
|
||||
tokdiff_c
|
||||
};
|
||||
|
||||
#if !defined(PHREEQCI_GUI)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user