From 7e52b0c345e53c1d58dc7595a0c526ab8becb49f Mon Sep 17 00:00:00 2001 From: David L Parkhurst Date: Fri, 19 Mar 2010 01:00:01 +0000 Subject: [PATCH] Did not pick up redox species from solution. Do not include H and O here. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@4175 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- Phreeqc.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Phreeqc.cpp b/Phreeqc.cpp index f46410b6..a22a1fa8 100644 --- a/Phreeqc.cpp +++ b/Phreeqc.cpp @@ -405,8 +405,8 @@ size_t Phreeqc::list_components(std::list &list_c) */ { cxxNameDouble accumulator; - accumulator.add("H", 1); - accumulator.add("O", 1); + //accumulator.add("H", 1); + //accumulator.add("O", 1); int i; @@ -473,14 +473,30 @@ size_t Phreeqc::list_components(std::list &list_c) accumulator.add_extensive(entity.get_totals(), 1.0); } - // print list + // Put in all primaries cxxNameDouble::iterator it; for (it = accumulator.begin(); it != accumulator.end(); it++) + { + if (it->first == "Charge") continue; + char string[MAX_LENGTH]; + strcpy(string, it->first.c_str()); + struct master *master_ptr = master_bsearch_primary(string); + if (master_ptr == NULL) continue; + if (master_ptr->type != AQ) continue; + //std::string name(master_ptr->elt->name); + //char + accumulator.add(master_ptr->elt->name, 1); + } + // print list + for (it = accumulator.begin(); it != accumulator.end(); it++) { struct master *master_ptr = master_bsearch(it->first.c_str()); if (master_ptr == NULL) continue; if (master_ptr->type != AQ) continue; if (master_ptr->primary == 0) continue; + if (it->first == "Charge") continue; + if (it->first == "O") continue; + if (it->first == "H") continue; list_c.push_back(it->first); } return(list_c.size());