Finished SSassemblage.cxx

Cleaned up other files some.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5655 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-09-27 23:36:52 +00:00
parent e42590e581
commit 9561576af7
20 changed files with 104 additions and 324 deletions

View File

@ -7,6 +7,7 @@
#include "Parser.h"
#include "ChartObject.h"
#include "PHRQ_base.h"
#include "phreeqc_class.h"
class ChartHandler: public PHRQ_base
{

View File

@ -12,8 +12,10 @@
#include <fstream>
#include <math.h>
#include <iomanip>
#ifdef PHREEQC_CLASS
#ifdef PHREEQC_CPP
#include "Phreeqc_class.h"
#endif
#ifdef PHREEQC_CLASS
#include "Phreeqc.h"
#else
#include "phqalloc.h"

View File

@ -5,7 +5,6 @@
#include <map> // std::map
#include <vector>
#include <set>
#include "Phreeqc_class.h"
#include "PHRQ_base.h"
// forward declarations
class cxxISolution; // reqd for read and dump_xml

View File

@ -7,7 +7,6 @@
#include <sstream> // std::istringstream std::ostringstream
#include <ostream> // std::ostream
#include <istream> // std::istream
#include "Phreeqc_class.h"
#include "PHRQ_base.h"
class CParser: public PHRQ_base

View File

@ -456,7 +456,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
for (i = 0; i < count_solution; i++)
{
cxxSolution entity(solution[i], &phrq_io);
accumulator.add_extensive(entity.get_totals(), 1.0);
accumulator.add_extensive(entity.Get_totals(), 1.0);
}
// irreversible reactions

View File

@ -48,6 +48,8 @@ class cxxPPassemblageComp;
class cxxReaction;
class cxxSolution;
class cxxSolutionIsotopeList;
class cxxSSassemblage;
class cxxSSassemblageSS;
class Phreeqc
{
@ -1258,6 +1260,8 @@ struct pure_phase * cxxPPassemblageComp2pure_phase(const std::map < std::string,
struct irrev * cxxReaction2irrev(const cxxReaction * rxn);
struct solution * cxxSolution2solution(const cxxSolution * sol);
struct isotope * cxxSolutionIsotopeList2isotope(const cxxSolutionIsotopeList * il);
struct s_s_assemblage * cxxSSassemblage2s_s_assemblage(const cxxSSassemblage * ss);
struct s_s * cxxSSassemblageSS2s_s(const std::map < std::string, cxxSSassemblageSS > * sscomp);
struct conc * cxxNameDouble2conc(const cxxNameDouble *nd);
struct elt_list * cxxNameDouble2elt_list(const cxxNameDouble * nd);
struct name_coef * cxxNameDouble2name_coef(const cxxNameDouble * nd);

View File

@ -588,7 +588,8 @@ read_solid_solutions_raw(void)
cxxSSassemblage ex;
ex.read_raw(parser);
struct s_s_assemblage *s_s_assemblage_ptr = ex.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
//struct s_s_assemblage *s_s_assemblage_ptr = ex.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
struct s_s_assemblage *s_s_assemblage_ptr = cxxSSassemblage2s_s_assemblage(&ex);
int n;
/*
@ -1722,7 +1723,8 @@ read_solid_solutions_modify(void)
entity.read_raw(parser, false);
// save entity
struct s_s_assemblage *entity_ptr = entity.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
//struct s_s_assemblage *entity_ptr = entity.cxxSSassemblage2s_s_assemblage(PHREEQC_THIS);
struct s_s_assemblage *entity_ptr = cxxSSassemblage2s_s_assemblage(&entity);
s_s_assemblage_free(&(s_s_assemblage[n]));
s_s_assemblage_copy(entity_ptr, &(s_s_assemblage[n]), entity_ptr->n_user);
free_check_null(s_s_assemblage[n].description);

View File

@ -47,7 +47,7 @@ cxxNumKeyword(io)
for (i = 0; i < s_s_assemblage_ptr->count_s_s; i++)
{
cxxSSassemblageSS ssSS(&(s_s_assemblage_ptr->s_s[i]), this->Get_io());
std::string str(ssSS.get_name());
std::string str(ssSS.Get_name());
ssAssemblageSSs[str] = ssSS;
}
}
@ -78,6 +78,7 @@ cxxSSassemblage::~cxxSSassemblage()
{
}
#ifdef MOVE_TO_STRUCTURES
struct s_s_assemblage *
cxxSSassemblage::cxxSSassemblage2s_s_assemblage(PHREEQC_PTR_ARG)
//
@ -95,6 +96,7 @@ cxxSSassemblage::cxxSSassemblage2s_s_assemblage(PHREEQC_PTR_ARG)
cxxSSassemblageSS::cxxSSassemblageSS2s_s(P_INSTANCE_COMMA this->ssAssemblageSSs);
return (s_s_assemblage_ptr);
}
#endif
#ifdef SKIP
void
@ -246,16 +248,16 @@ cxxSSassemblage::read_raw(CParser & parser, bool check)
CParser reread(is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->ssAssemblageSSs.find(ec.get_name()) != this->ssAssemblageSSs.end())
if (this->ssAssemblageSSs.find(ec.Get_name()) != this->ssAssemblageSSs.end())
{
cxxSSassemblageSS & ec1 = this->ssAssemblageSSs.find(ec.get_name())->second;
cxxSSassemblageSS & ec1 = this->ssAssemblageSSs.find(ec.Get_name())->second;
ec1.read_raw(reread, false);
}
else
{
cxxSSassemblageSS ec1(this->Get_io());
ec1.read_raw(reread, false);
std::string str(ec1.get_name());
std::string str(ec1.Get_name());
this->ssAssemblageSSs[str] = ec1;
}
}
@ -320,7 +322,7 @@ cxxSSassemblage::totalize(PHREEQC_PTR_ARG)
ssAssemblageSSs.begin(); it != ssAssemblageSSs.end(); ++it)
{
(*it).second.totalize(P_INSTANCE);
this->totals.add_extensive((*it).second.get_totals(), 1.0);
this->totals.add_extensive((*it).second.Get_totals(), 1.0);
}
return;
}
@ -382,7 +384,7 @@ cxxSSassemblage::add(const cxxSSassemblage & addee, double extensive)
{
cxxSSassemblageSS entity = (*itadd).second;
entity.multiply(extensive);
std::string str(entity.get_name());
std::string str(entity.Get_name());
this->ssAssemblageSSs[str] = entity;
}
}

View File

@ -8,7 +8,6 @@
#include <list> // std::list
#include <vector> // std::vector
#include "Phreeqc_class.h"
#include "NumKeyword.h"
#include "NameDouble.h"
class cxxSSassemblageSS;
@ -26,16 +25,16 @@ public:
cxxMix & mx, int n_user, PHRQ_io * io = NULL);
~cxxSSassemblage();
struct s_s_assemblage *cxxSSassemblage2s_s_assemblage(PHREEQC_PTR_ARG);
//struct s_s_assemblage *cxxSSassemblage2s_s_assemblage(PHREEQC_PTR_ARG);
struct s_s *cxxSSassemblageComp2s_s();
//struct s_s *cxxSSassemblageComp2s_s();
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void read_raw(CParser & parser, bool check = true);
std::map <std::string, cxxSSassemblageSS > & get_ssAssemblageSSs()
const std::map <std::string, cxxSSassemblageSS > & get_ssAssemblageSSs() const
{
return this->ssAssemblageSSs;
};

View File

@ -52,7 +52,7 @@ PHRQ_base(io) //
// constructor for cxxSSassemblageSS from struct s_s
//
{
this->set_name(s_s_ptr->name);
this->Set_name(s_s_ptr->name);
//total_moles = s_s_ptr->total_moles;
a0 = s_s_ptr->a0;
a1 = s_s_ptr->a1;
@ -80,6 +80,7 @@ cxxSSassemblageSS::~cxxSSassemblageSS()
{
}
#ifdef MOVE_TO_STRUCTURES
struct s_s *
cxxSSassemblageSS::cxxSSassemblageSS2s_s(PHREEQC_PTR_ARG_COMMA std::map < std::string, cxxSSassemblageSS > &el)
//
@ -170,6 +171,7 @@ cxxSSassemblageSS::cxxSSassemblageSS2s_s(PHREEQC_PTR_ARG_COMMA std::map < std::s
}
return (s_s_ptr);
}
#endif
#ifdef SKIP
void

View File

@ -6,9 +6,7 @@
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "NameDouble.h"
#include "Phreeqc_class.h"
class cxxSSassemblageSS: public PHRQ_base
{
@ -33,8 +31,8 @@ class cxxSSassemblageSS: public PHRQ_base
SS_PARM_MARGULES = 9
};
static struct s_s *cxxSSassemblageSS2s_s(PHREEQC_PTR_ARG_COMMA std::map < std::string, cxxSSassemblageSS >
&el);
//static struct s_s *cxxSSassemblageSS2s_s(PHREEQC_PTR_ARG_COMMA std::map < std::string, cxxSSassemblageSS >
// &el);
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
@ -42,11 +40,11 @@ class cxxSSassemblageSS: public PHRQ_base
void read_raw(CParser & parser, bool check = true);
const std::string &get_name() const
const std::string &Get_name() const
{
return this->name;
}
void set_name (const char * s)
void Set_name (const char * s)
{
if (s != NULL)
this->name = std::string(s);
@ -55,11 +53,11 @@ class cxxSSassemblageSS: public PHRQ_base
}
void totalize(PHREEQC_PTR_ARG);
const cxxNameDouble & get_totals() const
const cxxNameDouble & Get_totals() const
{
return (this->totals);
};
const cxxNameDouble & get_comps() const
const cxxNameDouble & Get_comps() const
{
return (this->comps);
};
@ -71,7 +69,13 @@ class cxxSSassemblageSS: public PHRQ_base
void add(const cxxSSassemblageSS & comp, double extensive);
void multiply(double extensive);
double Get_a0() const {return (this->a0);};
double Get_a1() const {return (this->a1);};
double Get_ag0() const {return (this->ag0);};
double Get_ag1() const {return (this->ag1);};
bool Get_miscibility() const {return (this->miscibility);};
double Get_xb1() const {return (this->xb1);};
double Get_xb2() const {return (this->xb2);};
protected:
std::string name;
cxxNameDouble comps;

View File

@ -701,7 +701,7 @@ cxxSolution::read_raw(CParser & parser, bool check)
}
else
{
if (iso.get_isotope_name().size() != 0)
if (iso.Get_isotope_name().size() != 0)
{
this->isotopes.push_back(iso);
}
@ -977,7 +977,7 @@ cxxSolution::multiply(double extensive)
}
double
cxxSolution::get_total(char *string) const
cxxSolution::Get_total(char *string) const
{
cxxNameDouble::const_iterator it = this->totals.find(string);
if (it == this->totals.end())
@ -990,7 +990,7 @@ cxxSolution::get_total(char *string) const
}
}
double
cxxSolution::get_total_element(char *string) const
cxxSolution::Get_total_element(char *string) const
{
cxxNameDouble::const_iterator it;
double d = 0.0;
@ -1014,13 +1014,13 @@ cxxSolution::get_total_element(char *string) const
}
void
cxxSolution::set_total(char *string, double d)
cxxSolution::Set_total(char *string, double d)
{
this->totals[string] = d;
}
double
cxxSolution::get_master_activity(char *string) const
cxxSolution::Get_master_activity(char *string) const
{
cxxNameDouble::const_iterator it = this->master_activity.find(string);
if (it == this->master_activity.end())
@ -1033,233 +1033,6 @@ cxxSolution::get_master_activity(char *string) const
}
}
#ifdef ORCHESTRA
void
cxxSolution::ORCH_write(std::ostream & headings, std::ostream & data) const const
{
data.precision(DBL_DIG - 1);
// Solution element and attributes
//s_oss << "SOLUTION_RAW " << this->n_user << " " << this->description << std::endl;
//s_oss << "-temp " << this->tc << std::endl;
//s_oss << "-pH " << this->ph << std::endl;
headings << "pH\t";
data << this->ph << "\t";
//s_oss << "-pe " << this->pe << std::endl;
headings << "pe\t";
data << this->pe << "\t";
//s_oss << "-mu " << this->mu << std::endl;
//s_oss << "-ah2o " << this->ah2o << std::endl;
headings << "H2O.act\t";
data << 1 << "\t";
//s_oss << "-total_h " << this->total_h << std::endl;
//s_oss << "-total_o " << this->total_o << std::endl;
//s_oss << "-cb " << this->cb << std::endl;
//s_oss << "-mass_water " << this->mass_water << std::endl;
//s_oss << "-total_alkalinity " << this->total_alkalinity << std::endl;
// soln_total conc structures
//this->totals.dump_raw(s_oss, indent + 2);
//this->totals.write_orchestra(headings, s_oss);
for (std::map < char *, double, CHARSTAR_LESS >::const_iterator it =
totals.begin(); it != totals.end(); ++it)
{
std::string master_name;
struct master *master_ptr;
master_ptr = master_bsearch(it->first);
if (master_ptr != NULL)
{
//headings << it->first << ".tot" << "\t";
headings << master_ptr->s->name << ".diss" << "\t";
data << it->second << "\t";
}
else
{
assert(false);
}
}
// master_activity map
//this->master_activity.dump_raw(s_oss, indent + 2);
/*
{
for (std::map <char *, double>::const_iterator it = master_activity.begin(); it != master_activity.end(); ++it) {
s_oss << indent2;
s_oss << it->first << " " << it->second << std::endl;
}
}
*/
// species_gamma map
//this->species_gamma.dump_raw(s_oss, indent + 2);
/*
{
{
for (std::map <char *, double>::const_iterator it = species_gamma.begin(); it != species_gamma.end(); ++it) {
s_oss << indent2;
s_oss << it->first << " " << it->second << std::endl;
}
}
}
*/
// Isotopes
//s_oss << "-Isotopes" << std::endl;
/*
{
for (std::list<cxxSolutionIsotope>::const_iterator it = this->isotopes.begin(); it != isotopes.end(); ++it) {
it->dump_raw(s_oss, indent + 2);
}
}
*/
return;
}
void
cxxSolution::ORCH_read(std::vector < std::pair < std::string,
double >>output_vector,
std::vector < std::pair < std::string,
double >>::iterator & it)
{
this->tc = it->second;
it++;
this->ph = it->second;
it++;
this->pe = it->second;
it++;
this->mu = it->second;
it++;
this->ah2o = it->second;
it++;
this->total_h = it->second;
it++;
this->total_o = it->second;
it++;
this->cb = it->second;
it++;
this->mass_water = it->second * gfw_water;
it++;
this->mass_water = 1.0;
this->total_alkalinity = it->second;
it++;
it++; //orch total H+
it++; //orch total e-
it++; //orch total H2O
//cxxNameDouble totals;
char token[MAX_LENGTH];
while (it->first.compare("end_totals") != 0)
{
strcpy(token, it->first.c_str());
replace(".diss", "", token);
struct species *s_ptr = s_search(token);
if (s_ptr == NULL)
error_msg("Species not found in orchestra read", STOP);
if (s_ptr->secondary != NULL)
{
this->totals[s_ptr->secondary->elt->name] = it->second;
}
else if (s_ptr->primary != NULL)
{
this->totals[s_ptr->primary->elt->name] = it->second;
}
else
{
error_msg
("Species not secondary or primary master species in orchestra read",
STOP);
}
it++;
}
//cxxNameDouble master_activity;
it++;
while (it->first.compare("end_master_activities") != 0)
{
strcpy(token, it->first.c_str());
replace(".act", "", token);
struct species *s_ptr = s_search(token);
if (s_ptr == NULL)
error_msg("Species not found in orchestra read", STOP);
if (s_ptr->secondary != NULL)
{
this->master_activity[s_ptr->secondary->elt->name] =
log10(it->second);
}
else if (s_ptr->primary != NULL)
{
this->master_activity[s_ptr->primary->elt->name] =
log10(it->second);
}
else
{
error_msg
("Species not secondary or primary master species in orchestra read",
STOP);
}
it++;
}
//cxxNameDouble species_gamma;
//cxxSolutionIsotopeList isotopes;
//
// Also process aqueous species data
//
it++;
while (it->first.compare("end_species") != 0)
{
strcpy(token, it->first.c_str());
replace(".act", "", token);
while (replace("[", "(", token));
while (replace("]", ")", token));
struct species *s_ptr = s_search(token);
if (s_ptr == NULL)
error_msg("Species not found in orchestra read", STOP);
s_ptr->la = log10(it->second);
it++;
s_ptr->moles = it->second * this->mass_water;
s_ptr->lm = log10(it->second);
it++;
s_ptr->lg = s_ptr->la - s_ptr->lm;
}
}
void
cxxSolution::ORCH_store_global(std::map < std::string, double >output_map)
{
int i;
tc_x = this->tc;
mass_water_aq_x = this->mass_water;
mu_x = this->mu;
s_h2o->moles = output_map["H2O.con"];
s_h2o->la = log10(output_map["H2O.act"]);
s_h2o->lm = s_h2o->la;
s_h2o->lg = 0;
for (i = 0; i < count_unknowns; i++)
{
residual[i] = 0;
// MB, ALK, CB, SOLUTION_PHASE_BOUNDARY, MU, AH2O
switch (x[i]->type)
{
case MB:
case CB:
case SOLUTION_PHASE_BOUNDARY:
x[i]->sum = this->totals[x[i]->description] * mass_water_aq_x;
break;
case ALK:
x[i]->f = this->total_alkalinity * mass_water_aq_x;
break;
}
}
}
#endif
#ifdef USE_MPI
/* ---------------------------------------------------------------------- */
void
@ -1538,7 +1311,7 @@ cxxSolution::mpi_recv(int task_number)
}
#endif
void
cxxSolution::set_master_activity(char *string, double d)
cxxSolution::Set_master_activity(char *string, double d)
{
this->master_activity[string] = d;
}
@ -1552,7 +1325,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
// to standardize, convert element to valence state if needed
// for original activity list (probably not needed)
cxxNameDouble orig_master_activity(original.get_master_activity());
cxxNameDouble orig_master_activity(original.Get_master_activity());
cxxNameDouble::const_iterator it;
bool redo=true;
while (redo)
@ -1638,10 +1411,10 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
if (strcmp(ename, "H") == 0 || strcmp(ename, "O") == 0) continue;
double d_mod, d_orig;
d_mod = this->get_total_element(ename);
d_mod = this->Get_total_element(ename);
if (d_mod <= 0) continue;
d_orig = original.get_total_element(ename);
d_orig = original.Get_total_element(ename);
if (d_orig <= 0)
{
// add estimate for la based on concentration if not in list

View File

@ -26,105 +26,105 @@ class cxxSolution:public cxxNumKeyword
//static cxxSolution& read(CParser& parser);
double get_tc() const
double Get_tc() const
{
return this->tc;
}
void set_tc(double l_tc)
void Set_tc(double l_tc)
{
this->tc = l_tc;
}
double get_ph() const
double Get_ph() const
{
return this->ph;
}
void set_ph(double pH)
void Set_ph(double pH)
{
this->ph = pH;
}
double get_pe() const
double Get_pe() const
{
return this->pe;
}
void set_pe(double l_pe)
void Set_pe(double l_pe)
{
this->pe = l_pe;
}
double get_mu() const
double Get_mu() const
{
return this->mu;
}
void set_mu(double l_mu)
void Set_mu(double l_mu)
{
this->mu = l_mu;
}
double get_ah2o() const
double Get_ah2o() const
{
return this->ah2o;
}
void set_ah2o(double l_ah2o)
void Set_ah2o(double l_ah2o)
{
this->ah2o = l_ah2o;
}
double get_total_h() const
double Get_total_h() const
{
return this->total_h;
}
void set_total_h(double l_total_h)
void Set_total_h(double l_total_h)
{
this->total_h = l_total_h;
}
double get_total_o() const
double Get_total_o() const
{
return this->total_o;
}
void set_total_o(double l_total_o)
void Set_total_o(double l_total_o)
{
this->total_o = l_total_o;
}
double get_cb() const
double Get_cb() const
{
return this->cb;
}
void set_cb(double l_cb)
void Set_cb(double l_cb)
{
this->cb = l_cb;
}
double get_mass_water() const
double Get_mass_water() const
{
return this->mass_water;
}
void set_mass_water(long double l_mass_water)
void Set_mass_water(long double l_mass_water)
{
this->mass_water = l_mass_water;
}
double get_total_alkalinity() const
double Get_total_alkalinity() const
{
return this->total_alkalinity;
}
void set_total_alkalinity(double l_total_alkalinity)
void Set_total_alkalinity(double l_total_alkalinity)
{
this->total_alkalinity = l_total_alkalinity;
}
double get_total(char *string) const;
double get_total_element(char *string) const;
void set_total(char *string, double value);
double Get_total(char *string) const;
double Get_total_element(char *string) const;
void Set_total(char *string, double value);
const cxxNameDouble & get_totals(void) const
const cxxNameDouble & Get_totals(void) const
{
return this->totals;
}
void set_totals(cxxNameDouble & nd)
void Set_totals(cxxNameDouble & nd)
{
this->totals = nd;
this->totals.type = cxxNameDouble::ND_ELT_MOLES;
@ -138,26 +138,18 @@ class cxxSolution:public cxxNumKeyword
this->master_activity.clear();
}
const cxxNameDouble & get_master_activity(void) const
const cxxNameDouble & Get_master_activity(void) const
{
return this->master_activity;
}
const cxxNameDouble & get_species_gamma(void) const
const cxxNameDouble & Get_species_gamma(void) const
{
return this->species_gamma;
}
double get_master_activity(char *string) const;
void set_master_activity(char *string, double value);
double Get_master_activity(char *string) const;
void Set_master_activity(char *string, double value);
const cxxSolutionIsotopeList & Get_isotopes(void) const {return isotopes;};
/*
double get_species_gamma(char *string)const;
void set_species_gamma(char *string, double value);
double get_isotope(char *string)const;
void set_isotope(char *string, double value);
*/
//struct solution *cxxSolution2solution(PHREEQC_PTR_ARG);
void dump_raw(std::ostream & s_oss, unsigned int indent) const;

View File

@ -34,10 +34,10 @@ cxxSolutionIsotope::cxxSolutionIsotope(struct isotope *isotope_ptr, PHRQ_io *io)
PHRQ_base(io)
{
isotope_number = isotope_ptr->isotope_number;
this->set_elt_name(isotope_ptr->elt_name);
this->Set_elt_name(isotope_ptr->elt_name);
std::ostringstream name;
name << isotope_ptr->isotope_number << isotope_ptr->elt_name;
this->set_isotope_name(name.str().c_str());
this->Set_isotope_name(name.str().c_str());
total = isotope_ptr->total;
ratio = isotope_ptr->ratio;
ratio_uncertainty = isotope_ptr->ratio_uncertainty;
@ -169,7 +169,7 @@ CParser::STATUS_TYPE cxxSolutionIsotope::read_raw(CParser & parser, std::istream
this->isotope_name.clear();
return (CParser::PARSER_OK);
}
this->set_isotope_name(token.c_str());
this->Set_isotope_name(token.c_str());
// isotope_number
if (!(parser.get_iss() >> isotope_number))
@ -182,7 +182,7 @@ CParser::STATUS_TYPE cxxSolutionIsotope::read_raw(CParser & parser, std::istream
{
return CParser::PARSER_ERROR;
}
this->set_elt_name(token.c_str());
this->Set_elt_name(token.c_str());
// total
if (!(parser.get_iss() >> this->total))

View File

@ -5,7 +5,6 @@
#include <string> // std::string
#include <list> // std::list
#include "Parser.h"
#include "Phreeqc_class.h"
class cxxSolutionIsotope: public PHRQ_base
{
@ -28,56 +27,56 @@ class cxxSolutionIsotope: public PHRQ_base
CParser::STATUS_TYPE read_raw(CParser & parser, std::istream::pos_type next_char);
double get_isotope_number() const
double Get_isotope_number() const
{
return this->isotope_number;
}
void set_isotope_number(double d)
void Set_isotope_number(double d)
{
this->isotope_number = d;
}
const std::string &get_elt_name() const
const std::string &Get_elt_name() const
{
return this->elt_name;
}
void set_elt_name(const char *cstring)
void Set_elt_name(const char *cstring)
{
if (cstring != NULL)
this->elt_name = std::string(cstring);
else
this->elt_name.clear();
}
const std::string &get_isotope_name() const
const std::string &Get_isotope_name() const
{
return this->isotope_name;
}
void set_isotope_name(const char *cstring)
void Set_isotope_name(const char *cstring)
{
if (cstring != NULL)
this->isotope_name = std::string(cstring);
else
this->isotope_name.clear();
}
double get_total() const
double Get_total() const
{
return this->total;
}
void set_total(double d)
void Set_total(double d)
{
this->total = d;
}
double get_ratio() const
double Get_ratio() const
{
return this->ratio;
}
double get_ratio_uncertainty() const
double Get_ratio_uncertainty() const
{
return this->ratio_uncertainty;
}
bool get_ratio_uncertainty_defined() const
bool Get_ratio_uncertainty_defined() const
{
return this->ratio_uncertainty_defined;
}

View File

@ -6,7 +6,6 @@
#include <list> // std::list
#include "SolutionIsotope.h"
#include "Phreeqc_class.h"
class cxxSolutionIsotopeList:public
std::list < cxxSolutionIsotope >, public PHRQ_base

View File

@ -1083,8 +1083,11 @@ cxxStorageBin::cxxStorageBin2phreeqc(PHREEQC_PTR_ARG_COMMA int n)
this->SSassemblages.find(n);
if (it != this->SSassemblages.end())
{
//struct s_s_assemblage *s_s_assemblage_ptr =
// (it->second).cxxSSassemblage2s_s_assemblage(P_INSTANCE);
struct s_s_assemblage *s_s_assemblage_ptr =
(it->second).cxxSSassemblage2s_s_assemblage(P_INSTANCE);
P_INSTANCE_POINTER cxxSSassemblage2s_s_assemblage(&(it->second));
P_INSTANCE_POINTER s_s_assemblage_copy(s_s_assemblage_ptr, &P_INSTANCE_POINTER s_s_assemblage[0], n);
P_INSTANCE_POINTER count_s_s_assemblage++;
P_INSTANCE_POINTER s_s_assemblage_free(s_s_assemblage_ptr);
@ -1315,8 +1318,10 @@ cxxStorageBin::cxxStorageBin2system(PHREEQC_PTR_ARG_COMMA int n)
// SSassemblages
if (this->getSSassemblage(n) != NULL)
{
//system_ptr->s_s_assemblage =
// (this->getSSassemblage(n))->cxxSSassemblage2s_s_assemblage(P_INSTANCE);
system_ptr->s_s_assemblage =
(this->getSSassemblage(n))->cxxSSassemblage2s_s_assemblage(P_INSTANCE);
P_INSTANCE_POINTER cxxSSassemblage2s_s_assemblage((this->getSSassemblage(n)));
}
else
{

View File

@ -64,12 +64,12 @@ cxxSystem::totalize(PHREEQC_PTR_ARG)
{
char token[MAX_LENGTH];
strcpy(token, "O");
this->totals[token] = this->solution->get_total_o();
this->totals[token] = this->solution->Get_total_o();
strcpy(token, "H");
this->totals[token] = this->solution->get_total_h();
this->totals[token] = this->solution->Get_total_h();
strcpy(token, "Charge");
this->totals[token] = this->solution->get_cb();
this->totals.add_extensive(this->solution->get_totals(), 1.0);
this->totals[token] = this->solution->Get_cb();
this->totals.add_extensive(this->solution->Get_totals(), 1.0);
}
if (this->exchange != NULL)
{

View File

@ -8,7 +8,6 @@
#include <vector> // std::vector
#include "NumKeyword.h"
#include "Phreeqc_class.h"
class cxxTemperature:public cxxNumKeyword
{

View File

@ -6,7 +6,6 @@
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "Phreeqc_class.h"
#include "NumKeyword.h"
#include "PHRQ_base.h"