Added SYS("equi", count, name$, type$, moles).

Equi option was never implemented.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@9388 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2015-03-24 19:41:09 +00:00
parent 66f047f9c4
commit ffd459c6db
2 changed files with 32 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public:
int system_total_ex(void);
int system_total_surf(void);
int system_total_gas(void);
int system_total_equi(void);
int system_total_ss(void);
int system_total_elt(const char *total_name);
int system_total_elt_secondary(const char *total_name);

View File

@ -2580,6 +2580,10 @@ system_total(const char *total_name, LDBLE * count, char ***names,
{
system_total_gas();
}
else if (strcmp_nocase(total_name, "equi") == 0)
{
system_total_equi();
}
else
{
if (strstr(total_name, "(") == NULL)
@ -2973,6 +2977,33 @@ system_total_gas(void)
}
/* ---------------------------------------------------------------------- */
int Phreeqc::
system_total_equi(void)
/* ---------------------------------------------------------------------- */
{
/*
* Equilibrium phases
*/
if (use.Get_pp_assemblage_ptr() == NULL)
return (OK);
std::map <std::string, cxxPPassemblageComp > comps = use.Get_pp_assemblage_ptr()->Get_pp_assemblage_comps();
std::map <std::string, cxxPPassemblageComp >::iterator it = comps.begin();
for ( ; it != comps.end(); it++)
{
cxxPPassemblageComp *comp_ptr = &(it->second);
int l;
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
sys[count_sys].name = string_duplicate(phase_ptr->name);
sys[count_sys].moles = comp_ptr->Get_moles();
sys_tot += sys[count_sys].moles;
sys[count_sys].type = string_duplicate("equi");
count_sys++;
space((void **) ((void *) &sys), count_sys, &max_sys,
sizeof(struct system_species));
}
return (OK);
}
/* ---------------------------------------------------------------------- */
int Phreeqc::
system_total_ss(void)
/* ---------------------------------------------------------------------- */
{