Added new functions to allow multiply.

Now multiply to account for changes in pore volume due to
storage.




git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2098 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2007-06-21 19:50:55 +00:00
parent c5d2d6d80d
commit 1848045bd9
6 changed files with 28 additions and 0 deletions

View File

@ -907,6 +907,20 @@ void cxxSolution::add(const cxxSolution &addee, double extensive)
this->species_gamma.add_intensive(addee.species_gamma, f1, f2);
this->isotopes.add(addee.isotopes, f2, extensive);
}
void cxxSolution::multiply(double extensive)
//
// Multiply existing solution by extensive
//
{
if (extensive == 0.0 || extensive == 1.0) return;
this->total_h *= extensive;
this->total_o *= extensive;
this->cb *= extensive;
this->mass_water *= extensive;
this->total_alkalinity *= extensive;
this->totals.multiply(extensive);
this->isotopes.multiply(extensive);
}
double cxxSolution::get_total(char *string)const
{
cxxNameDouble::const_iterator it = this->totals.find(string);

View File

@ -83,6 +83,7 @@ public:
void write_orchestra(std::ostream& headings, std::ostream& input_data)const;
void read_raw(CParser& parser);
void multiply(double extensive);
#ifdef USE_MPI

View File

@ -197,6 +197,10 @@ void cxxSolutionIsotope::add(const cxxSolutionIsotope &isotope_ptr, double inten
this->ratio_uncertainty_defined = (this->ratio_uncertainty_defined || isotope_ptr.ratio_uncertainty_defined);
}
}
void cxxSolutionIsotope::multiply(double extensive)
{
this->total *= extensive;
}
#ifdef SKIP
cxxSolutionIsotope::STATUS cxxSolutionIsotope::read(CParser& parser)

View File

@ -48,6 +48,7 @@ public:
struct master *primary(void);
void add(const cxxSolutionIsotope &isotope_ptr, double intensive, double extensive);
void multiply(double extensive);
protected:
friend class cxxSolutionIsotopeList;

View File

@ -61,6 +61,13 @@ void cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, double intensive, d
}
}
}
void cxxSolutionIsotopeList::multiply(double extensive)
{
for (cxxSolutionIsotopeList::iterator it = this->begin(); it != this->end(); ++it)
{
it->total *= extensive;
}
}
struct isotope * cxxSolutionIsotopeList::cxxSolutionIsotopeList2isotope()
{
struct isotope *iso;

View File

@ -24,6 +24,7 @@ public:
struct isotope *cxxSolutionIsotopeList2isotope();
void add(cxxSolutionIsotopeList oldlist, double intensive, double extensive);
void multiply(double extensive);
protected: