mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Save only aqueous species in phreeqc species_map.
Added species_map to copy operator made mg/L default for Solution.cxx default species_save_on is false. Added some defaults to documentation added species_cpp test. bug in species_utility_cpp.txt git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8543 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
3f0cd06d6e
commit
f10f513716
16
Solution.cxx
16
Solution.cxx
@ -78,6 +78,7 @@ cxxSolution::operator =(const cxxSolution &rhs)
|
||||
this->master_activity = rhs.master_activity;
|
||||
this->species_gamma = rhs.species_gamma;
|
||||
this->isotopes = rhs.isotopes;
|
||||
this->species_map = rhs.species_map;
|
||||
if (this->initial_data)
|
||||
delete initial_data;
|
||||
if (rhs.initial_data != NULL)
|
||||
@ -1279,6 +1280,21 @@ cxxSolution::add(const cxxSolution & addee, LDBLE extensive)
|
||||
this->master_activity.add_log_activities(addee.master_activity, f1, f2);
|
||||
this->species_gamma.add_intensive(addee.species_gamma, f1, f2);
|
||||
this->Add_isotopes(addee.isotopes, f2, extensive);
|
||||
{
|
||||
// Add species
|
||||
std::map<int, double>::const_iterator it = addee.species_map.begin();
|
||||
for ( ; it != addee.species_map.end(); it++)
|
||||
{
|
||||
if (this->species_map.find(it->first) != this->species_map.end())
|
||||
{
|
||||
this->species_map[it->first] = this->species_map[it->first] * f1 + it->second * f2;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->species_map[it->first] = it->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -1596,10 +1596,14 @@ xsolution_save(int n_user)
|
||||
#endif
|
||||
if (this->save_species)
|
||||
{
|
||||
// saves mol/L
|
||||
temp_solution.Get_species_map().clear();
|
||||
for (int i = 0; i < this->count_s_x; i++)
|
||||
{
|
||||
temp_solution.Get_species_map()[s_x[i]->number] = s_x[i]->moles;
|
||||
if (s_x[i]->type <= H2O)
|
||||
{
|
||||
temp_solution.Get_species_map()[s_x[i]->number] = s_x[i]->moles / temp_solution.Get_soln_vol();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user