Moved Isotope to SolutionIsotope

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@793 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2006-02-16 20:09:24 +00:00
parent 39494b0287
commit c42d985558
5 changed files with 67 additions and 65 deletions

View File

@ -143,7 +143,7 @@ COMMON_CXXOBJS = \
ExchComp.o \
GasPhase.o \
ISolution.o \
Isotope.o \
SolutionIsotope.o \
KineticsComp.o \
KineticsCxx.o \
Mix.o \
@ -193,18 +193,16 @@ GasPhase.o: ../GasPhase.cxx ../Utils.h ../GasPhase.h ../NumKeyword.h \
../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
ISolutionComp.o: ../ISolutionComp.cxx ../ISolutionComp.h ../Utils.h \
../char_star.h ../ISolution.h ../ISolutionComp.h ../NumKeyword.h \
../Parser.h ../char_star.h ../Solution.h ../NumKeyword.h ../Isotope.h \
../Parser.h ../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../char_star.h ../Parser.h ../char_star.h ../Utils.h \
../phreeqc/phrqproto.h ../phreeqc/phqalloc.h
../Parser.h ../char_star.h ../Solution.h ../NumKeyword.h \
../SolutionIsotope.h ../Parser.h ../NameDouble.h ../phreeqc/global.h \
../phreeqc/phrqtype.h ../char_star.h ../Parser.h ../char_star.h \
../Utils.h ../phreeqc/phrqproto.h ../phreeqc/phqalloc.h
ISolution.o: ../ISolution.cxx ../ISolution.h ../ISolutionComp.h \
../Utils.h ../char_star.h ../NumKeyword.h ../Parser.h ../char_star.h \
../Solution.h ../NumKeyword.h ../Isotope.h ../Parser.h ../NameDouble.h \
../phreeqc/global.h ../phreeqc/phrqtype.h ../char_star.h ../Parser.h \
../char_star.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
Isotope.o: ../Isotope.cxx ../Isotope.h ../Parser.h ../char_star.h \
../Utils.h ../Parser.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
../Solution.h ../NumKeyword.h ../SolutionIsotope.h ../Parser.h \
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../char_star.h ../Parser.h ../char_star.h ../phreeqc/phqalloc.h \
../phreeqc/phrqproto.h
KineticsComp.o: ../KineticsComp.cxx ../Utils.h ../KineticsComp.h \
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../char_star.h ../Parser.h ../char_star.h ../char_star.h \
@ -238,27 +236,9 @@ Reaction.o: ../Reaction.cxx ../Utils.h ../Reaction.h ../NumKeyword.h \
../phreeqc/phrqtype.h ../char_star.h ../Parser.h ../char_star.h \
../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
ReadClass.o: ../ReadClass.cxx ../Parser.h ../char_star.h ../Solution.h \
../NumKeyword.h ../Parser.h ../Isotope.h ../Parser.h ../NameDouble.h \
../phreeqc/global.h ../phreeqc/phrqtype.h ../char_star.h ../Parser.h \
../char_star.h ../Exchange.h ../NumKeyword.h ../char_star.h \
../ExchComp.h ../NameDouble.h ../char_star.h ../Surface.h \
../NumKeyword.h ../char_star.h ../SurfComp.h ../NameDouble.h \
../char_star.h ../SurfCharge.h ../NameDouble.h ../char_star.h \
../PPassemblage.h ../NumKeyword.h ../char_star.h ../PPassemblageComp.h \
../NameDouble.h ../char_star.h ../KineticsCxx.h ../NumKeyword.h \
../char_star.h ../KineticsComp.h ../NameDouble.h ../char_star.h \
../SSassemblage.h ../NumKeyword.h ../char_star.h ../SSassemblageSS.h \
../NameDouble.h ../char_star.h ../GasPhase.h ../NumKeyword.h \
../NameDouble.h ../char_star.h ../Reaction.h ../NumKeyword.h \
../NameDouble.h ../char_star.h ../Mix.h ../NumKeyword.h ../char_star.h \
../Temperature.h ../NumKeyword.h ../char_star.h ../phreeqc/phqalloc.h \
../phreeqc/output.h ../phreeqc/phrqproto.h
Solution.o: ../Solution.cxx ../Utils.h ../Solution.h ../NumKeyword.h \
../Parser.h ../char_star.h ../Isotope.h ../Parser.h ../NameDouble.h \
../phreeqc/global.h ../phreeqc/phrqtype.h ../char_star.h ../Parser.h \
../char_star.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h \
../ISolution.h ../ISolutionComp.h ../Utils.h ../char_star.h \
../NumKeyword.h ../Solution.h ../Exchange.h ../NumKeyword.h \
../NumKeyword.h ../Parser.h ../SolutionIsotope.h ../Parser.h \
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../char_star.h ../Parser.h ../char_star.h ../Exchange.h ../NumKeyword.h \
../char_star.h ../ExchComp.h ../NameDouble.h ../char_star.h \
../Surface.h ../NumKeyword.h ../char_star.h ../SurfComp.h \
../NameDouble.h ../char_star.h ../SurfCharge.h ../NameDouble.h \
@ -269,7 +249,29 @@ Solution.o: ../Solution.cxx ../Utils.h ../Solution.h ../NumKeyword.h \
../SSassemblageSS.h ../NameDouble.h ../char_star.h ../GasPhase.h \
../NumKeyword.h ../NameDouble.h ../char_star.h ../Reaction.h \
../NumKeyword.h ../NameDouble.h ../char_star.h ../Mix.h ../NumKeyword.h \
../char_star.h ../Temperature.h ../NumKeyword.h ../char_star.h
../char_star.h ../Temperature.h ../NumKeyword.h ../char_star.h \
../phreeqc/phqalloc.h ../phreeqc/output.h ../phreeqc/phrqproto.h
Solution.o: ../Solution.cxx ../Utils.h ../Solution.h ../NumKeyword.h \
../Parser.h ../char_star.h ../SolutionIsotope.h ../Parser.h \
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
../char_star.h ../Parser.h ../char_star.h ../phreeqc/phqalloc.h \
../phreeqc/phrqproto.h ../ISolution.h ../ISolutionComp.h ../Utils.h \
../char_star.h ../NumKeyword.h ../Solution.h ../Exchange.h \
../NumKeyword.h ../char_star.h ../ExchComp.h ../NameDouble.h \
../char_star.h ../Surface.h ../NumKeyword.h ../char_star.h \
../SurfComp.h ../NameDouble.h ../char_star.h ../SurfCharge.h \
../NameDouble.h ../char_star.h ../PPassemblage.h ../NumKeyword.h \
../char_star.h ../PPassemblageComp.h ../NameDouble.h ../char_star.h \
../KineticsCxx.h ../NumKeyword.h ../char_star.h ../KineticsComp.h \
../NameDouble.h ../char_star.h ../SSassemblage.h ../NumKeyword.h \
../char_star.h ../SSassemblageSS.h ../NameDouble.h ../char_star.h \
../GasPhase.h ../NumKeyword.h ../NameDouble.h ../char_star.h \
../Reaction.h ../NumKeyword.h ../NameDouble.h ../char_star.h ../Mix.h \
../NumKeyword.h ../char_star.h ../Temperature.h ../NumKeyword.h \
../char_star.h
SolutionIsotope.o: ../SolutionIsotope.cxx ../SolutionIsotope.h \
../Parser.h ../char_star.h ../Utils.h ../Parser.h ../phreeqc/global.h \
../phreeqc/phrqtype.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
SSassemblage.o: ../SSassemblage.cxx ../Utils.h ../SSassemblage.h \
../NumKeyword.h ../Parser.h ../char_star.h ../phreeqc/global.h \
../phreeqc/phrqtype.h ../char_star.h ../SSassemblageSS.h \

View File

@ -69,7 +69,7 @@ species_gamma(solution_ptr->species_gamma, solution_ptr->count_species_gamma, cx
// Isotopes
for (i = 0; i < solution_ptr->count_isotopes; i++) {
cxxIsotope iso(&solution_ptr->isotopes[i]);
cxxSolutionIsotope iso(&solution_ptr->isotopes[i]);
isotopes.push_back(iso);
}
@ -123,7 +123,7 @@ struct solution *cxxSolution::cxxSolution2solution()
// isotopes
solution_ptr->isotopes = (struct isotope *) free_check_null(solution_ptr->isotopes);
solution_ptr->isotopes = cxxIsotope::list2isotope(this->isotopes);
solution_ptr->isotopes = cxxSolutionIsotope::list2isotope(this->isotopes);
solution_ptr->count_isotopes = this->isotopes.size();
return(solution_ptr);
@ -223,7 +223,7 @@ void cxxSolution::dump_xml(std::ostream& s_oss, unsigned int indent)const
}
*/
for (std::list<cxxIsotope>::const_iterator it = this->isotopes.begin(); it != isotopes.end(); ++it) {
for (std::list<cxxSolutionIsotope>::const_iterator it = this->isotopes.begin(); it != isotopes.end(); ++it) {
it->dump_xml(s_oss, indent + 1);
}
@ -326,7 +326,7 @@ void cxxSolution::dump_raw(std::ostream& s_oss, unsigned int indent)const
s_oss << indent1;
s_oss << "-Isotopes" << std::endl;
{
for (std::list<cxxIsotope>::const_iterator it = this->isotopes.begin(); it != isotopes.end(); ++it) {
for (std::list<cxxSolutionIsotope>::const_iterator it = this->isotopes.begin(); it != isotopes.end(); ++it) {
it->dump_raw(s_oss, indent + 2);
}
}
@ -429,7 +429,7 @@ void cxxSolution::read_raw(CParser& parser)
case 3: // isotopes
{
cxxIsotope iso;
cxxSolutionIsotope iso;
if ( iso.read_raw(parser) != CParser::PARSER_OK) {
parser.incr_input_error();
parser.error_msg("Expected data for isotopes.", CParser::OT_CONTINUE);

View File

@ -2,7 +2,7 @@
#define SOLUTION_H_INCLUDED
#include "NumKeyword.h"
#include "Isotope.h"
#include "SolutionIsotope.h"
#include "NameDouble.h"
#define EXTERNAL extern
#include "global.h"
@ -76,7 +76,7 @@ protected:
double mass_water;
double total_alkalinity;
cxxNameDouble totals;
std::list<cxxIsotope> isotopes;
std::list<cxxSolutionIsotope> isotopes;
cxxNameDouble master_activity;
cxxNameDouble species_gamma;
public:

View File

@ -1,7 +1,7 @@
#ifdef _DEBUG
#pragma warning(disable : 4786) // disable truncation warning (Only used by debugger)
#endif
#include "Isotope.h"
#include "SolutionIsotope.h"
#include "Utils.h"
#include "Parser.h"
#define EXTERNAL extern
@ -11,12 +11,12 @@
#include <cassert>
#include <sstream> // std::ostrstream
cxxIsotope::cxxIsotope(void)
cxxSolutionIsotope::cxxSolutionIsotope(void)
: isotope_number(0.0)
{
}
cxxIsotope::cxxIsotope(struct isotope *isotope_ptr)
cxxSolutionIsotope::cxxSolutionIsotope(struct isotope *isotope_ptr)
{
isotope_number = isotope_ptr->isotope_number;
elt_name = isotope_ptr->elt_name;
@ -26,12 +26,12 @@ cxxIsotope::cxxIsotope(struct isotope *isotope_ptr)
ratio_uncertainty = isotope_ptr->ratio_uncertainty;
}
cxxIsotope::~cxxIsotope(void)
cxxSolutionIsotope::~cxxSolutionIsotope(void)
{
}
struct isotope *cxxIsotope::list2isotope(std::list <cxxIsotope> &isolist)
// takes a std::list of cxxIsotope structures
struct isotope *cxxSolutionIsotope::list2isotope(std::list <cxxSolutionIsotope> &isolist)
// takes a std::list of cxxSolutionIsotope structures
// returns array of isotope structures
{
struct isotope *iso;
@ -41,7 +41,7 @@ struct isotope *cxxIsotope::list2isotope(std::list <cxxIsotope> &isolist)
iso = (struct isotope *) PHRQ_malloc((size_t) ((isolist.size()) * sizeof(struct isotope)));
if (iso == NULL) malloc_error();
int i = 0;
for (std::list <cxxIsotope>::iterator it = isolist.begin(); it != isolist.end(); ++it) {
for (std::list <cxxSolutionIsotope>::iterator it = isolist.begin(); it != isolist.end(); ++it) {
iso[i].isotope_number = it->isotope_number;
iso[i].elt_name = it->elt_name;
iso[i].total = it->total;
@ -56,7 +56,7 @@ struct isotope *cxxIsotope::list2isotope(std::list <cxxIsotope> &isolist)
}
#ifdef SKIP
std::string cxxIsotope::get_name()const
std::string cxxSolutionIsotope::get_name()const
{
std::ostringstream oss;
//std::ostrstream oss;
@ -65,7 +65,7 @@ std::string cxxIsotope::get_name()const
}
#endif
void cxxIsotope::dump_xml(std::ostream& s_oss, unsigned int indent)const
void cxxSolutionIsotope::dump_xml(std::ostream& s_oss, unsigned int indent)const
{
unsigned int i;
@ -99,7 +99,7 @@ void cxxIsotope::dump_xml(std::ostream& s_oss, unsigned int indent)const
s_oss << "\">" << std::endl;
}
void cxxIsotope::dump_raw(std::ostream& s_oss, unsigned int indent)const
void cxxSolutionIsotope::dump_raw(std::ostream& s_oss, unsigned int indent)const
{
unsigned int i;
@ -118,7 +118,7 @@ void cxxIsotope::dump_raw(std::ostream& s_oss, unsigned int indent)const
s_oss << std::endl;
}
CParser::STATUS_TYPE cxxIsotope::read_raw(CParser& parser)
CParser::STATUS_TYPE cxxSolutionIsotope::read_raw(CParser& parser)
{
std::string token;
std::istream::pos_type next_char;
@ -168,25 +168,25 @@ CParser::STATUS_TYPE cxxIsotope::read_raw(CParser& parser)
return CParser::PARSER_OK;
}
bool cxxIsotope::operator<(const cxxIsotope& isotope)const
bool cxxSolutionIsotope::operator<(const cxxSolutionIsotope& isotope)const
{
int i = Utilities::strcmp_nocase(this->elt_name, isotope.elt_name);
if (i != 0) return (i < 0);
return ( this->isotope_number < isotope.isotope_number );
}
struct master *cxxIsotope::master(void)
struct master *cxxSolutionIsotope::master(void)
{
return (master_bsearch(this->elt_name));
}
struct master *cxxIsotope::primary(void)
struct master *cxxSolutionIsotope::primary(void)
{
return (master_bsearch_primary(this->elt_name));
}
#ifdef SKIP
cxxIsotope::STATUS cxxIsotope::read(CParser& parser)
cxxSolutionIsotope::STATUS cxxSolutionIsotope::read(CParser& parser)
{
if ( !(parser.get_iss() >> this->isotope_number) ) {
assert(parser.get_iss().fail());

View File

@ -1,25 +1,25 @@
#if !defined(ISOTOPE_H_INCLUDED)
#define ISOTOPE_H_INCLUDED
#if !defined(SOLUTIONISOTOPE_H_INCLUDED)
#define SOLUTIONISOTOPE_H_INCLUDED
#include "Parser.h"
#include <ostream> // std::ostream
#include <string> // std::string
#include <list> // std::list
class cxxIsotope
class cxxSolutionIsotope
{
public:
cxxIsotope(void);
cxxIsotope(struct isotope *isotope_ptr);
~cxxIsotope(void);
cxxSolutionIsotope(void);
cxxSolutionIsotope(struct isotope *isotope_ptr);
~cxxSolutionIsotope(void);
enum STATUS {
ERROR = 0,
OK = 1
};
//cxxIsotope::STATUS read(CParser& parser);
static struct isotope * list2isotope(std::list<cxxIsotope> &t);
//cxxSolutionIsotope::STATUS read(CParser& parser);
static struct isotope * list2isotope(std::list<cxxSolutionIsotope> &t);
void dump_xml(std::ostream& os, unsigned int indent)const;
void dump_raw(std::ostream& os, unsigned int indent)const;
@ -37,7 +37,7 @@ public:
bool get_ratio_uncertainty_defined()const { return this->ratio_uncertainty_defined; }
bool operator<(const cxxIsotope& conc)const;
bool operator<(const cxxSolutionIsotope& conc)const;
struct master *master(void);
struct master *primary(void);
@ -53,4 +53,4 @@ private:
//struct master *primary;
bool ratio_uncertainty_defined;
};
#endif // ISOTOPE_H_INCLUDED
#endif // SOLUTIONISOTOPE_H_INCLUDED