diff --git a/ISolution.cxx b/ISolution.cxx index dc19c17f..93f9e5f2 100644 --- a/ISolution.cxx +++ b/ISolution.cxx @@ -731,6 +731,8 @@ void cxxISolution::ORCH_write_chemistry_minerals(std::ostream &chemistry_dat) } } } + //chemistry_dat << "@mineral(Quartz)" << std::endl; + //chemistry_dat << "@sreaction(Quartz, 10139.1138573668, -2.0, H2O, 1.0, H4SiO4)" << std::endl; } void cxxISolution::ORCH_write_input(std::ostream &input_dat) { @@ -854,7 +856,7 @@ void cxxISolution::ORCH_write_input(std::ostream &input_dat) return; } -void cxxISolution::ORCH_write_output(std::ostream &outstream) +void cxxISolution::ORCH_write_output_vars(std::ostream &outstream) { outstream << "Var:"; outstream << "\tnr_iter"; @@ -928,31 +930,3 @@ void cxxISolution::ORCH_write_output(std::ostream &outstream) outstream << std::endl; return; } - -void cxxISolution::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; - } - } -} diff --git a/ISolution.h b/ISolution.h index 3574983b..b629f013 100644 --- a/ISolution.h +++ b/ISolution.h @@ -43,8 +43,7 @@ public: void ConvertUnits(); void ORCH_write_chemistry(std::ostream &chemistry_dat); void ORCH_write_input(std::ostream &input_dat); - void ORCH_write_output(std::ostream &input_dat); - void ORCH_store_global(std::map < std::string, double > output_map); + void ORCH_write_output_vars(std::ostream &input_dat); protected: friend class cxxISolutionComp; // for this->pe access diff --git a/Solution.cxx b/Solution.cxx index a090fde9..04cc70e5 100644 --- a/Solution.cxx +++ b/Solution.cxx @@ -964,6 +964,7 @@ double cxxSolution::get_master_activity(char *string)const return(it->second); } } + void cxxSolution::ORCH_read(std::vector > output_vector, std::vector < std::pair < std::string, double > >::iterator &it) { this->tc = it->second; it++; @@ -1038,6 +1039,35 @@ void cxxSolution::ORCH_read(std::vector > outpu 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; + } + } +} + #ifdef USE_MPI #include /* ---------------------------------------------------------------------- */ diff --git a/Solution.h b/Solution.h index 7c3b44f2..ef519e4d 100644 --- a/Solution.h +++ b/Solution.h @@ -85,7 +85,7 @@ public: void multiply(double extensive); void ORCH_write(std::ostream& headings, std::ostream& input_data)const; void ORCH_read(std::vector > output_vector, std::vector < std::pair < std::string, double > >::iterator &it); - + void ORCH_store_global(std::map < std::string, double > output_map); #ifdef USE_MPI void mpi_pack(std::vector& ints, std::vector& doubles);