mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Fixes for cxx version of xsolution_save (constructor(n_user))
git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2066 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
8a84d79562
commit
4145b60e10
20
Solution.cxx
20
Solution.cxx
@ -917,7 +917,25 @@ double cxxSolution::get_total(char *string)const
|
||||
return(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
double cxxSolution::get_total_element(char *string)const
|
||||
{
|
||||
cxxNameDouble::const_iterator it;
|
||||
double d = 0.0;
|
||||
for (it = this->totals.begin(); it != this->totals.end(); ++it)
|
||||
{
|
||||
char token[MAX_LENGTH], token1[MAX_LENGTH];
|
||||
int n;
|
||||
char *ptr;
|
||||
strcpy(token, it->first);
|
||||
replace("(", "", token);
|
||||
ptr = token;
|
||||
copy_token(token1, &ptr, &n);
|
||||
if (strcmp(token1, string) == 0) {
|
||||
d += it->second;
|
||||
}
|
||||
}
|
||||
return(d);
|
||||
}
|
||||
void cxxSolution::set_total(char *string, double d)
|
||||
{
|
||||
this->totals[string] = d;
|
||||
|
||||
@ -59,8 +59,13 @@ public:
|
||||
void set_total_alkalinity(double total_alkalinity) {this->total_alkalinity = total_alkalinity;}
|
||||
|
||||
double get_total(char *string)const;
|
||||
double get_total_element(char *string)const;
|
||||
void set_total(char *string, double value);
|
||||
|
||||
void set_totals(cxxNameDouble &nd) {this->totals = nd; this->totals.type = cxxNameDouble::ND_ELT_MOLES;}
|
||||
void clear_totals() {this->totals.clear();}
|
||||
|
||||
|
||||
double get_master_activity(char *string)const;
|
||||
void set_master_activity(char *string, double value);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user