mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
Merge commit '639490d0610cc02b8618567d95ff30833eafd6c2'
This commit is contained in:
commit
8c32ad1adb
@ -1318,7 +1318,7 @@ ChartObject::dump(std::ostream & oss, unsigned int indent)
|
||||
oss << indent1 << "-end" << "\n";
|
||||
|
||||
/*
|
||||
struct rate *user_graph;
|
||||
class rate *user_graph;
|
||||
// C++ for rate struct
|
||||
std::string rate_name;
|
||||
std::list<std::string> rate_command_list;
|
||||
|
||||
@ -230,11 +230,11 @@ class ChartObject:public cxxNumKeyword
|
||||
{
|
||||
return this->point_added;
|
||||
}
|
||||
struct rate *Get_user_graph()
|
||||
class rate *Get_user_graph()
|
||||
{
|
||||
return this->user_graph;
|
||||
}
|
||||
const struct rate *Get_user_graph()const
|
||||
const class rate *Get_user_graph()const
|
||||
{
|
||||
return this->user_graph;
|
||||
}
|
||||
@ -399,8 +399,8 @@ class ChartObject:public cxxNumKeyword
|
||||
bool curve_added;
|
||||
bool point_added;
|
||||
|
||||
struct rate *user_graph;
|
||||
// C++ for rate struct
|
||||
class rate *user_graph;
|
||||
// C++ for rate class
|
||||
std::string rate_name;
|
||||
std::list<std::string> rate_command_list;
|
||||
std::list<std::string> rate_command_list_original;
|
||||
|
||||
@ -458,7 +458,7 @@ cxxGasPhase::totalize(Phreeqc * phreeqc_ptr)
|
||||
// component structures
|
||||
for (size_t i = 0; i < this->gas_comps.size(); i++)
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
phase_ptr = phreeqc_ptr-> phase_bsearch(this->gas_comps[i].Get_phase_name().c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
|
||||
@ -29,11 +29,11 @@ cxxNameDouble::cxxNameDouble()
|
||||
{
|
||||
this->type = ND_ELT_MOLES;
|
||||
}
|
||||
cxxNameDouble::cxxNameDouble(const std::vector<struct elt_list>& el)
|
||||
cxxNameDouble::cxxNameDouble(const std::vector<class elt_list>& el)
|
||||
// constructor for cxxNameDouble from vector of elt_list
|
||||
{
|
||||
size_t i;
|
||||
const struct elt_list* elt_list_ptr = &el[0];
|
||||
const class elt_list* elt_list_ptr = &el[0];
|
||||
for (i = 0; elt_list_ptr[i].elt != NULL; i++)
|
||||
{
|
||||
(*this)[elt_list_ptr[i].elt->name] = elt_list_ptr[i].coef;
|
||||
@ -74,7 +74,7 @@ cxxNameDouble::cxxNameDouble(std::map < std::string, cxxISolutionComp > &comps)
|
||||
}
|
||||
this->type = ND_ELT_MOLES;
|
||||
}
|
||||
cxxNameDouble::cxxNameDouble(struct name_coef *nc, int count)
|
||||
cxxNameDouble::cxxNameDouble(class name_coef *nc, int count)
|
||||
//
|
||||
// constructor for cxxNameDouble from list of elt_list
|
||||
//
|
||||
|
||||
@ -28,10 +28,10 @@ class IPQ_DLL_EXPORT cxxNameDouble:public
|
||||
};
|
||||
|
||||
cxxNameDouble();
|
||||
cxxNameDouble(const std::vector<struct elt_list>& el);
|
||||
cxxNameDouble(const std::vector<class elt_list>& el);
|
||||
cxxNameDouble(std::map < std::string, cxxISolutionComp > &comps);
|
||||
|
||||
cxxNameDouble(struct name_coef *nc, int count);
|
||||
cxxNameDouble(class name_coef *nc, int count);
|
||||
cxxNameDouble(const cxxNameDouble & old, LDBLE factor);
|
||||
~cxxNameDouble();
|
||||
|
||||
|
||||
@ -315,7 +315,7 @@ cxxPPassemblageComp::totalize(Phreeqc * phreeqc_ptr)
|
||||
// component structures
|
||||
if (this->add_formula.size() != 0)
|
||||
return;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
phase_ptr = phreeqc_ptr-> phase_bsearch(this->name.c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
|
||||
@ -15,24 +15,40 @@
|
||||
#include "Temperature.h"
|
||||
#include "SSassemblage.h"
|
||||
|
||||
const struct const_iso Phreeqc::iso_defaults[] = {
|
||||
{"13C", -10, 1},
|
||||
{"13C(4)", -10, 1},
|
||||
{"13C(-4)", -50, 5},
|
||||
{"34S", 10, 1},
|
||||
{"34S(6)", 10, 1},
|
||||
{"34S(-2)", -30, 5},
|
||||
{"2H", -28, 1},
|
||||
{"2H(1)", -28, 1},
|
||||
{"2H(0)", -28, 1},
|
||||
{"18O", -5, .1},
|
||||
{"18O(-2)", -5, .1},
|
||||
{"18O(0)", -5, .1},
|
||||
{"87Sr", .71, .01},
|
||||
{"11B", 20, 5}
|
||||
//const const_iso Phreeqc::iso_defaults[] = {
|
||||
// {"13C", -10, 1},
|
||||
// {"13C(4)", -10, 1},
|
||||
// {"13C(-4)", -50, 5},
|
||||
// {"34S", 10, 1},
|
||||
// {"34S(6)", 10, 1},
|
||||
// {"34S(-2)", -30, 5},
|
||||
// {"2H", -28, 1},
|
||||
// {"2H(1)", -28, 1},
|
||||
// {"2H(0)", -28, 1},
|
||||
// {"18O", -5, .1},
|
||||
// {"18O(-2)", -5, .1},
|
||||
// {"18O(0)", -5, .1},
|
||||
// {"87Sr", .71, .01},
|
||||
// {"11B", 20, 5}
|
||||
//};
|
||||
const const_iso Phreeqc::iso_defaults[] = {
|
||||
const_iso("13C", -10, 1),
|
||||
const_iso("13C(4)", -10, 1),
|
||||
const_iso("13C(-4)", -50, 5),
|
||||
const_iso("34S", 10, 1),
|
||||
const_iso("34S(6)", 10, 1),
|
||||
const_iso("34S(-2)", -30, 5),
|
||||
const_iso("2H", -28, 1),
|
||||
const_iso("2H(1)", -28, 1),
|
||||
const_iso("2H(0)", -28, 1),
|
||||
const_iso("18O", -5, .1),
|
||||
const_iso("18O(-2)", -5, .1),
|
||||
const_iso("18O(0)", -5, .1),
|
||||
const_iso("87Sr", .71, .01),
|
||||
const_iso("11B", 20, 5)
|
||||
};
|
||||
|
||||
const int Phreeqc::count_iso_defaults = (sizeof(iso_defaults) / sizeof(struct const_iso));
|
||||
const int Phreeqc::count_iso_defaults = (sizeof(iso_defaults) / sizeof(class const_iso));
|
||||
|
||||
Phreeqc::~Phreeqc(void)
|
||||
{
|
||||
@ -150,7 +166,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
if (it->first == "Charge") continue;
|
||||
char string[MAX_LENGTH];
|
||||
strcpy(string, it->first.c_str());
|
||||
struct master *master_ptr = master_bsearch_primary(string);
|
||||
class master *master_ptr = master_bsearch_primary(string);
|
||||
if (master_ptr == NULL) continue;
|
||||
if (master_ptr->type != AQ) continue;
|
||||
accumulator.add(master_ptr->elt->name, 1);
|
||||
@ -158,7 +174,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
// print list
|
||||
for (it = accumulator.begin(); it != accumulator.end(); it++)
|
||||
{
|
||||
struct master *master_ptr = master_bsearch(it->first.c_str());
|
||||
class 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;
|
||||
@ -385,7 +401,7 @@ size_t Phreeqc::list_Exchangers(std::list<std::string> &list_exname)
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
for (; it != nd.end(); it++)
|
||||
{
|
||||
struct master *m = master_bsearch(it->first.c_str());
|
||||
class master *m = master_bsearch(it->first.c_str());
|
||||
if (m != NULL)
|
||||
{
|
||||
if (m->type == EX)
|
||||
@ -769,7 +785,7 @@ void Phreeqc::init(void)
|
||||
fpunchf_user_buffer[0] = 0;
|
||||
|
||||
#if defined PHREEQ98
|
||||
struct rate *user_graph;
|
||||
class rate *user_graph;
|
||||
char **user_graph_headings;
|
||||
int user_graph_count_headings;
|
||||
#endif
|
||||
@ -1172,19 +1188,19 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
use_kinetics_limiter = pSrc->use_kinetics_limiter;
|
||||
save_values = pSrc->save_values;
|
||||
save = pSrc->save;
|
||||
//struct copier copy_solution;
|
||||
//struct copier copy_pp_assemblage;
|
||||
//struct copier copy_exchange;
|
||||
//struct copier copy_surface;
|
||||
//struct copier copy_ss_assemblage;
|
||||
//struct copier copy_gas_phase;
|
||||
//struct copier copy_kinetics;
|
||||
//struct copier copy_mix;
|
||||
//struct copier copy_reaction;
|
||||
//struct copier copy_temperature;
|
||||
//struct copier copy_pressure;
|
||||
//class copier copy_solution;
|
||||
//class copier copy_pp_assemblage;
|
||||
//class copier copy_exchange;
|
||||
//class copier copy_surface;
|
||||
//class copier copy_ss_assemblage;
|
||||
//class copier copy_gas_phase;
|
||||
//class copier copy_kinetics;
|
||||
//class copier copy_mix;
|
||||
//class copier copy_reaction;
|
||||
//class copier copy_temperature;
|
||||
//class copier copy_pressure;
|
||||
// Inverse not implemented
|
||||
//std::vector<struct inverse> inverse;
|
||||
//std::vector<class inverse> inverse;
|
||||
count_inverse = 0;
|
||||
// Mix
|
||||
Rxn_mix_map = pSrc->Rxn_mix_map;
|
||||
@ -1213,14 +1229,14 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
Rxn_ss_assemblage_map = pSrc->Rxn_ss_assemblage_map;
|
||||
Rxn_pp_assemblage_map = pSrc->Rxn_pp_assemblage_map;
|
||||
|
||||
std::vector<struct species_list> species_list;
|
||||
std::vector<class species_list> species_list;
|
||||
// will be rebuilt
|
||||
//std::vector<struct list0> sum_jacob0;
|
||||
//std::vector<struct list1> sum_mb1;
|
||||
//std::vector<struct list1> sum_jacob1;
|
||||
//std::vector<struct list2> sum_mb2;
|
||||
//std::vector<struct list2> sum_jacob2;
|
||||
//std::vector<struct list2> sum_delta;
|
||||
//std::vector<class list0> sum_jacob0;
|
||||
//std::vector<class list1> sum_mb1;
|
||||
//std::vector<class list1> sum_jacob1;
|
||||
//std::vector<class list2> sum_mb2;
|
||||
//std::vector<class list2> sum_jacob2;
|
||||
//std::vector<class list2> sum_delta;
|
||||
// Solution
|
||||
Rxn_solution_map = pSrc->Rxn_solution_map;
|
||||
unnumbered_solutions = pSrc->unnumbered_solutions;
|
||||
@ -1336,7 +1352,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
for (int i = 0; i < (int)pSrc->elements.size(); i++)
|
||||
{
|
||||
const char* ptr = string_hsave(pSrc->elements[i]->name);
|
||||
struct element* elt_ptr = element_store(ptr);
|
||||
class element* elt_ptr = element_store(ptr);
|
||||
elt_ptr->gfw = pSrc->elements[i]->gfw;
|
||||
}
|
||||
element_h_one = element_store("H(1)");
|
||||
@ -1348,15 +1364,15 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
//logk.clear();
|
||||
//for (size_t i = 0; i < pSrc->logk.size(); i++)
|
||||
//{
|
||||
// struct logk* tlk = new struct logk;
|
||||
// class logk* tlk = new class logk;
|
||||
// *tlk = *pSrc->logk[i];
|
||||
// tlk->name = string_hsave(pSrc->logk[i]->name);
|
||||
// logk.push_back(tlk);
|
||||
//}
|
||||
for (int i = 0; i < (int)pSrc->logk.size(); i++)
|
||||
{
|
||||
struct logk* logk_ptr = logk_store(pSrc->logk[i]->name, FALSE);
|
||||
//memcpy(logk_ptr, pSrc->logk[i], sizeof(struct logk));
|
||||
class logk* logk_ptr = logk_store(pSrc->logk[i]->name, FALSE);
|
||||
//memcpy(logk_ptr, pSrc->logk[i], sizeof(class logk));
|
||||
*logk_ptr = *pSrc->logk[i];
|
||||
logk_ptr->name = string_hsave(pSrc->logk[i]->name);
|
||||
logk_ptr->add_logk.resize(pSrc->logk[i]->add_logk.size());
|
||||
@ -1369,8 +1385,8 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
// s, species
|
||||
for (int i = 0; i < (int)pSrc->s.size(); i++)
|
||||
{
|
||||
struct species* s_ptr = s_store(pSrc->s[i]->name, pSrc->s[i]->z, FALSE);
|
||||
//memcpy(s_ptr, pSrc->s[i], sizeof(struct species));
|
||||
class species* s_ptr = s_store(pSrc->s[i]->name, pSrc->s[i]->z, FALSE);
|
||||
//memcpy(s_ptr, pSrc->s[i], sizeof(class species));
|
||||
*s_ptr = *pSrc->s[i];
|
||||
// fix up all pointers
|
||||
s_ptr->name = string_hsave(pSrc->s[i]->name);
|
||||
@ -1410,8 +1426,8 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
*---------------------------------------------------------------------- */
|
||||
for (int i = 0; i < (int)pSrc->phases.size(); i++)
|
||||
{
|
||||
struct phase* phase_ptr = phase_store(pSrc->phases[i]->name);
|
||||
//memcpy(phase_ptr, pSrc->phases[i], sizeof(struct phase));
|
||||
class phase* phase_ptr = phase_store(pSrc->phases[i]->name);
|
||||
//memcpy(phase_ptr, pSrc->phases[i], sizeof(class phase));
|
||||
*phase_ptr = *pSrc->phases[i];
|
||||
// clean up pointers
|
||||
phase_ptr->name = string_hsave(pSrc->phases[i]->name);
|
||||
@ -1435,8 +1451,8 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
for (size_t i = 0; i < pSrc->master.size(); i++)
|
||||
{
|
||||
master.resize(i + 1);
|
||||
master[i] = new struct master;
|
||||
//memcpy(master[i], pSrc->master[i], sizeof(struct master));
|
||||
master[i] = new class master;
|
||||
//memcpy(master[i], pSrc->master[i], sizeof(class master));
|
||||
*master[i] = *pSrc->master[i];
|
||||
// clean up pointers
|
||||
master[i]->gfw_formula = string_hsave(pSrc->master[i]->gfw_formula);
|
||||
@ -1470,7 +1486,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
//gas_unknowns;
|
||||
//mb_unknowns
|
||||
// Reaction work space
|
||||
// struct reaction_temp trxn;
|
||||
// class reaction_temp trxn;
|
||||
count_trxn = 0;
|
||||
// Print
|
||||
pr = pSrc->pr;
|
||||
@ -1530,7 +1546,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
//delta,
|
||||
//residual
|
||||
input_error = 0;
|
||||
Keywords::KEYWORDS next_keyword = Keywords::KEY_NONE;
|
||||
next_keyword = Keywords::KEY_NONE;
|
||||
parse_error = 0;
|
||||
paren_count = 0;
|
||||
iterations = 0;
|
||||
@ -1602,7 +1618,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
std::map<int, UserPunch>::iterator it = UserPunch_map.begin();
|
||||
for (; it != UserPunch_map.end(); it++)
|
||||
{
|
||||
struct rate* rate_new = new struct rate;
|
||||
class rate* rate_new = new class rate;
|
||||
rate_new = rate_copy(it->second.Get_rate());
|
||||
it->second.Set_rate(rate_new);
|
||||
it->second.Set_PhreeqcPtr(this);
|
||||
@ -1613,18 +1629,18 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
spread_length = pSrc->spread_length;
|
||||
//maps set by store below
|
||||
//std::map<std::string, std::string*> strings_map;
|
||||
//std::map<std::string, struct element*> elements_map;
|
||||
//std::map<std::string, struct species*> species_map;
|
||||
//std::map<std::string, struct phase*> phases_map;
|
||||
//std::map<std::string, struct logk*> logk_map;
|
||||
//std::map<std::string, struct master_isotope*> master_isotope_map;
|
||||
//std::map<std::string, class element*> elements_map;
|
||||
//std::map<std::string, class species*> species_map;
|
||||
//std::map<std::string, class phase*> phases_map;
|
||||
//std::map<std::string, class logk*> logk_map;
|
||||
//std::map<std::string, class master_isotope*> master_isotope_map;
|
||||
/* ----------------------------------------------------------------------
|
||||
* ISOTOPES
|
||||
* ---------------------------------------------------------------------- */
|
||||
for (int i = 0; i < (int)pSrc->master_isotope.size(); i++)
|
||||
{
|
||||
struct master_isotope* master_isotope_ptr = master_isotope_store(pSrc->master_isotope[i]->name, FALSE);
|
||||
memcpy(master_isotope_ptr, pSrc->master_isotope[i], sizeof(struct master_isotope));
|
||||
class master_isotope* master_isotope_ptr = master_isotope_store(pSrc->master_isotope[i]->name, FALSE);
|
||||
memcpy(master_isotope_ptr, pSrc->master_isotope[i], sizeof(class master_isotope));
|
||||
master_isotope_ptr->name = string_hsave(pSrc->master_isotope[i]->name);
|
||||
int n;
|
||||
master_isotope_ptr->master = NULL;
|
||||
@ -1651,27 +1667,27 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
// Calculate values
|
||||
for (int i = 0; i < pSrc->calculate_value.size(); i++)
|
||||
{
|
||||
struct calculate_value* calculate_value_ptr = calculate_value_store(pSrc->calculate_value[i]->name, FALSE);
|
||||
class calculate_value* calculate_value_ptr = calculate_value_store(pSrc->calculate_value[i]->name, FALSE);
|
||||
calculate_value_ptr->value = pSrc->calculate_value[i]->value;
|
||||
calculate_value[i]->commands = pSrc->calculate_value[i]->commands;
|
||||
}
|
||||
// More isotopes
|
||||
for (int i = 0; i < (int)pSrc->isotope_ratio.size(); i++)
|
||||
{
|
||||
struct isotope_ratio* isotope_ratio_ptr = isotope_ratio_store(pSrc->isotope_ratio[i]->name, FALSE);
|
||||
class isotope_ratio* isotope_ratio_ptr = isotope_ratio_store(pSrc->isotope_ratio[i]->name, FALSE);
|
||||
isotope_ratio_ptr->name = string_hsave(pSrc->isotope_ratio[i]->name);
|
||||
isotope_ratio_ptr->isotope_name = string_hsave(pSrc->isotope_ratio[i]->isotope_name);
|
||||
isotope_ratio_ptr->ratio = pSrc->isotope_ratio[i]->ratio;
|
||||
isotope_ratio_ptr->converted_ratio = pSrc->isotope_ratio[i]->converted_ratio;
|
||||
}
|
||||
//std::map<std::string, struct isotope_ratio*> isotope_ratio_map;
|
||||
//std::map<std::string, class isotope_ratio*> isotope_ratio_map;
|
||||
for (int i = 0; i < (int)pSrc->isotope_alpha.size(); i++)
|
||||
{
|
||||
struct isotope_alpha* isotope_alpha_ptr = isotope_alpha_store(pSrc->isotope_alpha[i]->name, FALSE);
|
||||
class isotope_alpha* isotope_alpha_ptr = isotope_alpha_store(pSrc->isotope_alpha[i]->name, FALSE);
|
||||
isotope_alpha_ptr->named_logk = string_hsave(pSrc->isotope_alpha[i]->named_logk);
|
||||
isotope_alpha_ptr->value = pSrc->isotope_alpha[i]->value;
|
||||
}
|
||||
//std::map<std::string, struct isotope_alpha*> isotope_alpha_map;
|
||||
//std::map<std::string, class isotope_alpha*> isotope_alpha_map;
|
||||
// Misc
|
||||
phreeqc_mpi_myself = 0;
|
||||
first_read_input = pSrc->first_read_input;
|
||||
@ -1838,7 +1854,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
{
|
||||
size_t count_theta_params = theta_params.size();
|
||||
theta_params.resize(count_theta_params + 1);
|
||||
theta_params[count_theta_params] = new struct theta_param;
|
||||
theta_params[count_theta_params] = new class theta_param;
|
||||
*theta_params[count_theta_params] = *pSrc->theta_params[i];
|
||||
}
|
||||
use_etheta = pSrc->use_etheta;
|
||||
|
||||
@ -284,26 +284,26 @@ public:
|
||||
int inverse_models(void);
|
||||
int add_to_file(const char* filename, const char* string);
|
||||
int bit_print(unsigned long bits, int l);
|
||||
int carbon_derivs(struct inverse* inv_ptr);
|
||||
int check_isotopes(struct inverse* inv_ptr);
|
||||
int check_solns(struct inverse* inv_ptr);
|
||||
bool set_isotope_unknowns(struct inverse* inv_ptrs);
|
||||
int carbon_derivs(class inverse* inv_ptr);
|
||||
int check_isotopes(class inverse* inv_ptr);
|
||||
int check_solns(class inverse* inv_ptr);
|
||||
bool set_isotope_unknowns(class inverse* inv_ptrs);
|
||||
cxxSolutionIsotope* get_isotope(cxxSolution* solution_ptr, const char* elt);
|
||||
LDBLE get_inv_total(cxxSolution* solution_ptr, const char* elt);
|
||||
int isotope_balance_equation(struct inverse* inv_ptr, int row, int n);
|
||||
int isotope_balance_equation(class inverse* inv_ptr, int row, int n);
|
||||
int post_mortem(void);
|
||||
bool test_cl1_solution(void);
|
||||
unsigned long get_bits(unsigned long bits, int position, int number);
|
||||
unsigned long minimal_solve(struct inverse* inv_ptr,
|
||||
unsigned long minimal_solve(class inverse* inv_ptr,
|
||||
unsigned long minimal_bits);
|
||||
void dump_netpath(struct inverse* inv_ptr);
|
||||
int dump_netpath_pat(struct inverse* inv_ptr);
|
||||
int next_set_phases(struct inverse* inv_ptr, int first_of_model_size,
|
||||
void dump_netpath(class inverse* inv_ptr);
|
||||
int dump_netpath_pat(class inverse* inv_ptr);
|
||||
int next_set_phases(class inverse* inv_ptr, int first_of_model_size,
|
||||
int model_size);
|
||||
int phase_isotope_inequalities(struct inverse* inv_ptr);
|
||||
int print_model(struct inverse* inv_ptr);
|
||||
int punch_model_heading(struct inverse* inv_ptr);
|
||||
int punch_model(struct inverse* inv_ptr);
|
||||
int phase_isotope_inequalities(class inverse* inv_ptr);
|
||||
int print_model(class inverse* inv_ptr);
|
||||
int punch_model_heading(class inverse* inv_ptr);
|
||||
int punch_model(class inverse* inv_ptr);
|
||||
void print_isotope(FILE* netpath_file, cxxSolution* solution_ptr,
|
||||
const char* elt, const char* string);
|
||||
void print_total(FILE* netpath_file, cxxSolution* solution_ptr,
|
||||
@ -315,54 +315,54 @@ public:
|
||||
|
||||
void print_total_pat(FILE* netpath_file, const char* elt,
|
||||
const char* string);
|
||||
int range(struct inverse* inv_ptr, unsigned long cur_bits);
|
||||
int range(class inverse* inv_ptr, unsigned long cur_bits);
|
||||
int save_bad(unsigned long bits);
|
||||
int save_good(unsigned long bits);
|
||||
int save_minimal(unsigned long bits);
|
||||
unsigned long set_bit(unsigned long bits, int position, int value);
|
||||
int setup_inverse(struct inverse* inv_ptr);
|
||||
int setup_inverse(class inverse* inv_ptr);
|
||||
int set_initial_solution(int n_user_old, int n_user_new);
|
||||
int set_ph_c(struct inverse* inv_ptr,
|
||||
int set_ph_c(class inverse* inv_ptr,
|
||||
int i, cxxSolution* soln_ptr_orig, int n_user_new,
|
||||
LDBLE d_alk, LDBLE ph_factor, LDBLE alk_factor);
|
||||
int shrink(struct inverse* inv_ptr, LDBLE* array_in,
|
||||
int shrink(class inverse* inv_ptr, LDBLE* array_in,
|
||||
LDBLE* array_out, int* k, int* l, int* m, int* n,
|
||||
unsigned long cur_bits, LDBLE* delta_l, int* col_back_l,
|
||||
int* row_back_l);
|
||||
int solve_inverse(struct inverse* inv_ptr);
|
||||
int solve_with_mask(struct inverse* inv_ptr, unsigned long cur_bits);
|
||||
int solve_inverse(class inverse* inv_ptr);
|
||||
int solve_with_mask(class inverse* inv_ptr, unsigned long cur_bits);
|
||||
int subset_bad(unsigned long bits);
|
||||
int subset_minimal(unsigned long bits);
|
||||
int superset_minimal(unsigned long bits);
|
||||
int write_optimize_names(struct inverse* inv_ptr);
|
||||
int write_optimize_names(class inverse* inv_ptr);
|
||||
|
||||
// isotopes.cpp -------------------------------
|
||||
int add_isotopes(cxxSolution& solution_ptr);
|
||||
int calculate_values(void);
|
||||
int calculate_isotope_moles(struct element* elt_ptr,
|
||||
int calculate_isotope_moles(class element* elt_ptr,
|
||||
cxxSolution* solution_ptr, LDBLE total_moles);
|
||||
LDBLE convert_isotope(struct master_isotope* master_isotope_ptr, LDBLE ratio);
|
||||
int from_pcil(struct master_isotope* master_isotope_ptr);
|
||||
int from_permil(struct master_isotope* master_isotope_ptr, LDBLE major_total);
|
||||
int from_pct(struct master_isotope* master_isotope_ptr, LDBLE major_total);
|
||||
int from_tu(struct master_isotope* master_isotope_ptr);
|
||||
struct calculate_value* calculate_value_alloc(void);
|
||||
int calculate_value_free(struct calculate_value* calculate_value_ptr);
|
||||
struct calculate_value* calculate_value_search(const char* name);
|
||||
struct calculate_value* calculate_value_store(const char* name,
|
||||
LDBLE convert_isotope(class master_isotope* master_isotope_ptr, LDBLE ratio);
|
||||
int from_pcil(class master_isotope* master_isotope_ptr);
|
||||
int from_permil(class master_isotope* master_isotope_ptr, LDBLE major_total);
|
||||
int from_pct(class master_isotope* master_isotope_ptr, LDBLE major_total);
|
||||
int from_tu(class master_isotope* master_isotope_ptr);
|
||||
class calculate_value* calculate_value_alloc(void);
|
||||
int calculate_value_free(class calculate_value* calculate_value_ptr);
|
||||
class calculate_value* calculate_value_search(const char* name);
|
||||
class calculate_value* calculate_value_store(const char* name,
|
||||
int replace_if_found);
|
||||
struct isotope_alpha* isotope_alpha_alloc(void);
|
||||
struct isotope_alpha* isotope_alpha_search(const char* name);
|
||||
struct isotope_alpha* isotope_alpha_store(const char* name,
|
||||
class isotope_alpha* isotope_alpha_alloc(void);
|
||||
class isotope_alpha* isotope_alpha_search(const char* name);
|
||||
class isotope_alpha* isotope_alpha_store(const char* name,
|
||||
int replace_if_found);
|
||||
struct isotope_ratio* isotope_ratio_alloc(void);
|
||||
struct isotope_ratio* isotope_ratio_search(const char* name);
|
||||
struct isotope_ratio* isotope_ratio_store(const char* name,
|
||||
class isotope_ratio* isotope_ratio_alloc(void);
|
||||
class isotope_ratio* isotope_ratio_search(const char* name);
|
||||
class isotope_ratio* isotope_ratio_store(const char* name,
|
||||
int replace_if_found);
|
||||
struct master_isotope* master_isotope_store(const char* name,
|
||||
class master_isotope* master_isotope_store(const char* name,
|
||||
int replace_if_found);
|
||||
struct master_isotope* master_isotope_alloc(void);
|
||||
struct master_isotope* master_isotope_search(const char* name);
|
||||
class master_isotope* master_isotope_alloc(void);
|
||||
class master_isotope* master_isotope_search(const char* name);
|
||||
int print_initial_solution_isotopes(void);
|
||||
int print_isotope_ratios(void);
|
||||
int print_isotope_alphas(void);
|
||||
@ -372,10 +372,10 @@ public:
|
||||
int read_isotopes(void);
|
||||
int read_isotope_ratios(void);
|
||||
int read_isotope_alphas(void);
|
||||
int calculate_value_init(struct calculate_value* calculate_value_ptr);
|
||||
int isotope_alpha_init(struct isotope_alpha* isotope_alpha_ptr);
|
||||
int isotope_ratio_init(struct isotope_ratio* isotope_ratio_ptr);
|
||||
int master_isotope_init(struct master_isotope* master_isotope_ptr);
|
||||
int calculate_value_init(class calculate_value* calculate_value_ptr);
|
||||
int isotope_alpha_init(class isotope_alpha* isotope_alpha_ptr);
|
||||
int isotope_ratio_init(class isotope_ratio* isotope_ratio_ptr);
|
||||
int master_isotope_init(class master_isotope* master_isotope_ptr);
|
||||
|
||||
// kinetics.cpp -------------------------------
|
||||
void cvode_init(void);
|
||||
@ -476,7 +476,7 @@ public:
|
||||
int get_elts_in_species(const char** t_ptr, LDBLE coef);
|
||||
int get_num(const char** t_ptr, LDBLE* num);
|
||||
int get_secondary_in_species(const char** t_ptr, LDBLE coef);
|
||||
int parse_eq(char* eqn, std::vector<struct elt_list>& new_elt_list, int association);
|
||||
int parse_eq(char* eqn, std::vector<class elt_list>& new_elt_list, int association);
|
||||
int get_coef(LDBLE* coef, const char** eqnaddr);
|
||||
int get_secondary(const char** t_ptr, char* element, int* i);
|
||||
int get_species(const char** ptr);
|
||||
@ -498,11 +498,11 @@ public:
|
||||
public:
|
||||
|
||||
// pitzer.cpp -------------------------------
|
||||
struct pitz_param* pitz_param_read(char* string, int n);
|
||||
void pitz_param_store(const struct pitz_param* pzp_ptr);
|
||||
void sit_param_store(const struct pitz_param* pzp_ptr);
|
||||
struct pitz_param* pitz_param_copy(const struct pitz_param* src);
|
||||
struct theta_param* theta_param_search(LDBLE zj, LDBLE zk);
|
||||
class pitz_param* pitz_param_read(char* string, int n);
|
||||
void pitz_param_store(const class pitz_param* pzp_ptr);
|
||||
void sit_param_store(const class pitz_param* pzp_ptr);
|
||||
class pitz_param* pitz_param_copy(const class pitz_param* src);
|
||||
class theta_param* theta_param_search(LDBLE zj, LDBLE zk);
|
||||
void pitzer_make_lists(void);
|
||||
int gammas_pz(bool exch_a_f);
|
||||
int model_pz(void);
|
||||
@ -512,7 +512,7 @@ public:
|
||||
int pitzer_tidy(void);
|
||||
int read_pitzer(void);
|
||||
int set_pz(int initial);
|
||||
int calc_pitz_param(struct pitz_param* pz_ptr, LDBLE TK, LDBLE TR);
|
||||
int calc_pitz_param(class pitz_param* pz_ptr, LDBLE TK, LDBLE TR);
|
||||
int check_gammas_pz(void);
|
||||
int ISPEC(const char* name);
|
||||
LDBLE G(LDBLE Y);
|
||||
@ -542,15 +542,15 @@ public:
|
||||
int build_species_list(int n);
|
||||
int build_min_surface(void);
|
||||
LDBLE calc_lk_phase(phase* p_ptr, LDBLE TK, LDBLE pa);
|
||||
LDBLE calc_PR(std::vector<struct phase*> phase_ptrs, LDBLE P, LDBLE TK, LDBLE V_m);
|
||||
LDBLE calc_PR(std::vector<class phase*> phase_ptrs, LDBLE P, LDBLE TK, LDBLE V_m);
|
||||
LDBLE calc_PR();
|
||||
int calc_vm(LDBLE tc, LDBLE pa);
|
||||
int clear(void);
|
||||
int convert_units(cxxSolution* solution_ptr);
|
||||
struct unknown* find_surface_charge_unknown(std::string& str_ptr, int plane);
|
||||
std::vector<struct master*> get_list_master_ptrs(const char* cptr, struct master* master_ptr);
|
||||
class unknown* find_surface_charge_unknown(std::string& str_ptr, int plane);
|
||||
std::vector<class master*> get_list_master_ptrs(const char* cptr, class master* master_ptr);
|
||||
int inout(void);
|
||||
int is_special(struct species* spec);
|
||||
int is_special(class species* spec);
|
||||
int mb_for_species_aq(int n);
|
||||
int mb_for_species_ex(int n);
|
||||
int mb_for_species_surf(int n);
|
||||
@ -560,7 +560,7 @@ public:
|
||||
int setup_exchange(void);
|
||||
int setup_gas_phase(void);
|
||||
int setup_fixed_volume_gas(void);
|
||||
int setup_master_rxn(const std::vector<struct master*>& master_ptr_list,
|
||||
int setup_master_rxn(const std::vector<class master*>& master_ptr_list,
|
||||
const std::string& pe_rxn);
|
||||
int setup_pure_phases(void);
|
||||
int adjust_setup_pure_phases(void);
|
||||
@ -575,7 +575,7 @@ public:
|
||||
int store_jacob(LDBLE* source, LDBLE* target, LDBLE coef);
|
||||
int store_jacob0(int row, int column, LDBLE coef);
|
||||
int store_mb(LDBLE* source, LDBLE* target, LDBLE coef);
|
||||
int store_mb_unknowns(struct unknown* unknown_ptr, LDBLE* LDBLE_ptr,
|
||||
int store_mb_unknowns(class unknown* unknown_ptr, LDBLE* LDBLE_ptr,
|
||||
LDBLE coef, LDBLE* gamma_ptr);
|
||||
int store_sum_deltas(LDBLE* source, LDBLE* target, LDBLE coef);
|
||||
int tidy_redox(void);
|
||||
@ -588,8 +588,8 @@ public:
|
||||
LDBLE k_calc(LDBLE* logk, LDBLE tempk, LDBLE presPa);
|
||||
int prep(void);
|
||||
int reprep(void);
|
||||
int rewrite_master_to_secondary(struct master* master_ptr1,
|
||||
struct master* master_ptr2);
|
||||
int rewrite_master_to_secondary(class master* master_ptr1,
|
||||
class master* master_ptr2);
|
||||
int switch_bases(void);
|
||||
int write_phase_sys_total(int n);
|
||||
|
||||
@ -673,9 +673,9 @@ public:
|
||||
int read_gas_phase(void);
|
||||
int read_incremental_reactions(void);
|
||||
int read_inverse(void);
|
||||
int read_inv_balances(struct inverse* inverse_ptr, const char* next_char);
|
||||
int read_inv_isotopes(struct inverse* inverse_ptr, const char* cptr);
|
||||
int read_inv_phases(struct inverse* inverse_ptr, const char* next_char);
|
||||
int read_inv_balances(class inverse* inverse_ptr, const char* next_char);
|
||||
int read_inv_isotopes(class inverse* inverse_ptr, const char* cptr);
|
||||
int read_inv_phases(class inverse* inverse_ptr, const char* next_char);
|
||||
int read_kinetics(void);
|
||||
bool read_vector_doubles(const char** ptr, std::vector<double>& v);
|
||||
bool read_vector_ints(const char** cptr, std::vector<int>& v, int positive);
|
||||
@ -749,7 +749,7 @@ public:
|
||||
int sit_tidy(void);
|
||||
int read_sit(void);
|
||||
int set_sit(int initial);
|
||||
int calc_sit_param(struct pitz_param* pz_ptr, LDBLE TK, LDBLE TR);
|
||||
int calc_sit_param(class pitz_param* pz_ptr, LDBLE TK, LDBLE TR);
|
||||
int check_gammas_sit(void);
|
||||
int sit_ISPEC(const char* name);
|
||||
/*int DH_AB (LDBLE TK, LDBLE *A, LDBLE *B);*/
|
||||
@ -764,18 +764,18 @@ public:
|
||||
int copy_token_tab(std::string& token, const char** cptr);
|
||||
int get_option_string(const char** opt_list, int count_opt_list,
|
||||
const char** next_char);
|
||||
int spread_row_free(struct spread_row* spread_row_ptr);
|
||||
int spread_row_to_solution(struct spread_row* heading,
|
||||
struct spread_row* units,
|
||||
struct spread_row* data,
|
||||
struct defaults defaults);
|
||||
struct spread_row* string_to_spread_row(char* string);
|
||||
int spread_row_free(class spread_row* spread_row_ptr);
|
||||
int spread_row_to_solution(class spread_row* heading,
|
||||
class spread_row* units,
|
||||
class spread_row* data,
|
||||
class defaults defaults);
|
||||
class spread_row* string_to_spread_row(char* string);
|
||||
#ifdef PHREEQCI_GUI
|
||||
void add_row(struct spread_row* spread_row_ptr);
|
||||
void copy_defaults(struct defaults* dest_ptr,
|
||||
struct defaults* src_ptr);
|
||||
void add_row(class spread_row* spread_row_ptr);
|
||||
void copy_defaults(class defaults* dest_ptr,
|
||||
class defaults* src_ptr);
|
||||
void free_spread(void);
|
||||
struct spread_row* copy_row(struct spread_row* spread_row_ptr);
|
||||
class spread_row* copy_row(class spread_row* spread_row_ptr);
|
||||
#endif
|
||||
|
||||
// step.cpp -------------------------------
|
||||
@ -802,61 +802,61 @@ public:
|
||||
int clean_up(void);
|
||||
int reinitialize(void);
|
||||
|
||||
int copier_add(struct copier* copier_ptr, int n_user, int start, int end);
|
||||
int copier_clear(struct copier* copier_ptr);
|
||||
int copier_add(class copier* copier_ptr, int n_user, int start, int end);
|
||||
int copier_clear(class copier* copier_ptr);
|
||||
//
|
||||
CReaction CReaction_internal_copy(CReaction& rxn_ref);
|
||||
double rxn_find_coef(CReaction& r_ptr, const char* str);
|
||||
//
|
||||
static int element_compare(const void* ptr1, const void* ptr2);
|
||||
struct element* element_store(const char* element);
|
||||
class element* element_store(const char* element);
|
||||
//
|
||||
int add_elt_list(const cxxNameDouble& nd, LDBLE coef);
|
||||
int add_elt_list(const std::vector<struct elt_list>& el, double coef);
|
||||
int add_elt_list(const std::vector<class elt_list>& el, double coef);
|
||||
int change_hydrogen_in_elt_list(LDBLE charge);
|
||||
int elt_list_combine(void);
|
||||
static int elt_list_compare(const void* ptr1, const void* ptr2);
|
||||
std::vector<struct elt_list> elt_list_internal_copy(const std::vector<struct elt_list>& el);
|
||||
std::vector<struct elt_list> elt_list_vsave(void);
|
||||
std::vector<class elt_list> elt_list_internal_copy(const std::vector<class elt_list>& el);
|
||||
std::vector<class elt_list> elt_list_vsave(void);
|
||||
cxxNameDouble elt_list_NameDouble(void);
|
||||
//
|
||||
enum entity_type get_entity_enum(char* name);
|
||||
//
|
||||
struct inverse* inverse_alloc(void);
|
||||
class inverse* inverse_alloc(void);
|
||||
int inverse_delete(int i);
|
||||
static int inverse_isotope_compare(const void* ptr1, const void* ptr2);
|
||||
struct inverse* inverse_search(int n_user, int* n);
|
||||
class inverse* inverse_search(int n_user, int* n);
|
||||
int inverse_sort(void);
|
||||
//
|
||||
struct logk* logk_alloc(void);
|
||||
int logk_copy2orig(struct logk* logk_ptr);
|
||||
struct logk* logk_store(const char* name, int replace_if_found);
|
||||
struct logk* logk_search(const char* name);
|
||||
class logk* logk_alloc(void);
|
||||
int logk_copy2orig(class logk* logk_ptr);
|
||||
class logk* logk_store(const char* name, int replace_if_found);
|
||||
class logk* logk_search(const char* name);
|
||||
//
|
||||
struct master* master_alloc(void);
|
||||
class master* master_alloc(void);
|
||||
static int master_compare(const void* ptr1, const void* ptr2);
|
||||
int master_delete(const char* cptr);
|
||||
struct master* master_bsearch(const char* cptr);
|
||||
struct master* master_bsearch_primary(const char* cptr);
|
||||
struct master* master_bsearch_secondary(const char* cptr);
|
||||
struct master* master_search(const char* cptr, int* n);
|
||||
struct master* surface_get_psi_master(const char* name, int plane);
|
||||
class master* master_bsearch(const char* cptr);
|
||||
class master* master_bsearch_primary(const char* cptr);
|
||||
class master* master_bsearch_secondary(const char* cptr);
|
||||
class master* master_search(const char* cptr, int* n);
|
||||
class master* surface_get_psi_master(const char* name, int plane);
|
||||
//
|
||||
struct phase* phase_bsearch(const char* cptr, int* j, int print);
|
||||
class phase* phase_bsearch(const char* cptr, int* j, int print);
|
||||
static int phase_compare(const void* ptr1, const void* ptr2);
|
||||
int phase_delete(int i);
|
||||
struct phase* phase_store(const char* name);
|
||||
class phase* phase_store(const char* name);
|
||||
//
|
||||
struct rate* rate_bsearch(const char* cptr, int* j);
|
||||
int rate_free(struct rate* rate_ptr);
|
||||
struct rate* rate_copy(const struct rate* rate_ptr);
|
||||
struct rate* rate_search(const char* name, int* n);
|
||||
class rate* rate_bsearch(const char* cptr, int* j);
|
||||
int rate_free(class rate* rate_ptr);
|
||||
class rate* rate_copy(const class rate* rate_ptr);
|
||||
class rate* rate_search(const char* name, int* n);
|
||||
int rate_sort(void);
|
||||
//
|
||||
static int s_compare(const void* ptr1, const void* ptr2);
|
||||
int s_delete(int i);
|
||||
struct species* s_search(const char* name);
|
||||
struct species* s_store(const char* name, LDBLE z, int replace_if_found);
|
||||
class species* s_search(const char* name);
|
||||
class species* s_store(const char* name, LDBLE z, int replace_if_found);
|
||||
//
|
||||
static int isotope_compare(const void* ptr1, const void* ptr2);
|
||||
//
|
||||
@ -869,7 +869,7 @@ public:
|
||||
int system_duplicate(int i, int save_old);
|
||||
//
|
||||
//
|
||||
bool phase_rxn_to_trxn(struct phase* phase_ptr, CReaction& rxn_ptr);
|
||||
bool phase_rxn_to_trxn(class phase* phase_ptr, CReaction& rxn_ptr);
|
||||
bool trxn_add(CReaction& r_ptr, double coef, bool combine);
|
||||
bool trxn_add_phase(CReaction& r_ref, double coef, bool combine);
|
||||
int trxn_combine(void);
|
||||
@ -882,24 +882,24 @@ public:
|
||||
int trxn_sort(void);
|
||||
int trxn_swap(const char* token);
|
||||
|
||||
struct unknown* unknown_alloc(void);
|
||||
class unknown* unknown_alloc(void);
|
||||
int unknown_delete(int i);
|
||||
int unknown_free(struct unknown* unknown_ptr);
|
||||
int unknown_free(class unknown* unknown_ptr);
|
||||
int entity_exists(const char* name, int n_user);
|
||||
static int inverse_compare(const void* ptr1, const void* ptr2);
|
||||
int inverse_free(struct inverse* inverse_ptr);
|
||||
int logk_init(struct logk* logk_ptr);
|
||||
int inverse_free(class inverse* inverse_ptr);
|
||||
int logk_init(class logk* logk_ptr);
|
||||
static int master_compare_string(const void* ptr1, const void* ptr2);
|
||||
int master_free(struct master* master_ptr);
|
||||
struct phase* phase_alloc(void);
|
||||
int master_free(class master* master_ptr);
|
||||
class phase* phase_alloc(void);
|
||||
static int phase_compare_string(const void* ptr1, const void* ptr2);
|
||||
int phase_free(struct phase* phase_ptr);
|
||||
int phase_init(struct phase* phase_ptr);
|
||||
int phase_free(class phase* phase_ptr);
|
||||
int phase_init(class phase* phase_ptr);
|
||||
static int rate_compare(const void* ptr1, const void* ptr2);
|
||||
static int rate_compare_string(const void* ptr1, const void* ptr2);
|
||||
struct species* s_alloc(void);
|
||||
int s_free(struct species* s_ptr);
|
||||
int s_init(struct species* s_ptr);
|
||||
class species* s_alloc(void);
|
||||
int s_free(class species* s_ptr);
|
||||
int s_init(class species* s_ptr);
|
||||
static int species_list_compare(const void* ptr1, const void* ptr2);
|
||||
|
||||
void Use2cxxStorageBin(cxxStorageBin& sb);
|
||||
@ -922,8 +922,8 @@ public:
|
||||
int store_tally_table(LDBLE* array, int row_dim, int col_dim,
|
||||
LDBLE fill_factor);
|
||||
int zero_tally_table(void);
|
||||
int elt_list_to_tally_table(struct tally_buffer* buffer_ptr);
|
||||
int master_to_tally_table(struct tally_buffer* buffer_ptr);
|
||||
int elt_list_to_tally_table(class tally_buffer* buffer_ptr);
|
||||
int master_to_tally_table(class tally_buffer* buffer_ptr);
|
||||
int get_all_components(void);
|
||||
int print_tally_table(void);
|
||||
int set_reaction_moles(int n_user, LDBLE moles);
|
||||
@ -931,8 +931,8 @@ public:
|
||||
int set_kinetics_time(int n_user, LDBLE step);
|
||||
|
||||
// tidy.cpp -------------------------------
|
||||
int add_other_logk(LDBLE* source_k, std::vector<struct name_coef>& add_logk);
|
||||
int add_logks(struct logk* logk_ptr, int repeats);
|
||||
int add_other_logk(LDBLE* source_k, std::vector<class name_coef>& add_logk);
|
||||
int add_logks(class logk* logk_ptr, int repeats);
|
||||
LDBLE halve(LDBLE f(LDBLE x, void*), LDBLE x0, LDBLE x1, LDBLE tol);
|
||||
int replace_solids_gases(void);
|
||||
int ss_prep(LDBLE t, cxxSS* ss_ptr, int print);
|
||||
@ -942,11 +942,11 @@ public:
|
||||
int tidy_punch(void);
|
||||
int tidy_model(void);
|
||||
int check_species_input(void);
|
||||
LDBLE coef_in_master(struct master* master_ptr);
|
||||
LDBLE coef_in_master(class master* master_ptr);
|
||||
int reset_last_model(void);
|
||||
int rewrite_eqn_to_primary(void);
|
||||
int rewrite_eqn_to_secondary(void);
|
||||
int species_rxn_to_trxn(struct species* s_ptr);
|
||||
int species_rxn_to_trxn(class species* s_ptr);
|
||||
int tidy_logk(void);
|
||||
int tidy_exchange(void);
|
||||
int tidy_min_exchange(void);
|
||||
@ -993,7 +993,7 @@ public:
|
||||
LDBLE moles_from_redox_states(cxxSolution* sptr, const char* name);
|
||||
LDBLE moles_from_donnan_layer(cxxSurface* sptr, const char* name, LDBLE moles_needed);
|
||||
LDBLE add_MCD_moles(LDBLE moles, LDBLE min_mol, int i, cxxSolution* sptr, const char* name);
|
||||
int fill_m_s(struct J_ij* J_ij, int J_ij_count_spec, int i, int stagnant);
|
||||
int fill_m_s(class J_ij* J_ij, int J_ij_count_spec, int i, int stagnant);
|
||||
static int sort_species_name(const void* ptr1, const void* ptr2);
|
||||
int disp_surf(LDBLE stagkin_time);
|
||||
int diff_stag_surf(int mobile_cell);
|
||||
@ -1141,7 +1141,7 @@ protected:
|
||||
* Save
|
||||
*---------------------------------------------------------------------- */
|
||||
std::map<std::string, double> save_values;
|
||||
struct save save;
|
||||
class save save;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Use
|
||||
@ -1151,22 +1151,22 @@ protected:
|
||||
/*----------------------------------------------------------------------
|
||||
* Copy
|
||||
*---------------------------------------------------------------------- */
|
||||
struct copier copy_solution;
|
||||
struct copier copy_pp_assemblage;
|
||||
struct copier copy_exchange;
|
||||
struct copier copy_surface;
|
||||
struct copier copy_ss_assemblage;
|
||||
struct copier copy_gas_phase;
|
||||
struct copier copy_kinetics;
|
||||
struct copier copy_mix;
|
||||
struct copier copy_reaction;
|
||||
struct copier copy_temperature;
|
||||
struct copier copy_pressure;
|
||||
class copier copy_solution;
|
||||
class copier copy_pp_assemblage;
|
||||
class copier copy_exchange;
|
||||
class copier copy_surface;
|
||||
class copier copy_ss_assemblage;
|
||||
class copier copy_gas_phase;
|
||||
class copier copy_kinetics;
|
||||
class copier copy_mix;
|
||||
class copier copy_reaction;
|
||||
class copier copy_temperature;
|
||||
class copier copy_pressure;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Inverse
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct inverse> inverse;
|
||||
std::vector<class inverse> inverse;
|
||||
int count_inverse;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
@ -1218,22 +1218,22 @@ protected:
|
||||
/*----------------------------------------------------------------------
|
||||
* Species_list
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct species_list> species_list;
|
||||
std::vector<class species_list> species_list;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Jacobian and Mass balance lists
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct list0> sum_jacob0; /* array of pointers to targets and coefficients for array */
|
||||
std::vector<class list0> sum_jacob0; /* array of pointers to targets and coefficients for array */
|
||||
|
||||
std::vector<struct list1> sum_mb1; /* array of pointers to sources and targets for mass
|
||||
std::vector<class list1> sum_mb1; /* array of pointers to sources and targets for mass
|
||||
balance summations with coef = 1.0 */
|
||||
std::vector<struct list1> sum_jacob1; /* array of pointers to sources and targets for array
|
||||
std::vector<class list1> sum_jacob1; /* array of pointers to sources and targets for array
|
||||
equations with coef = 1.0 */
|
||||
std::vector<struct list2> sum_mb2; /* array of coefficients and pointers to sources and
|
||||
std::vector<class list2> sum_mb2; /* array of coefficients and pointers to sources and
|
||||
targets for mass balance summations with coef != 1.0 */
|
||||
std::vector<struct list2> sum_jacob2; /* array of coefficients and pointers to sources and
|
||||
std::vector<class list2> sum_jacob2; /* array of coefficients and pointers to sources and
|
||||
targets, coef != 1.0 */
|
||||
std::vector<struct list2> sum_delta; /* array of pointers to sources, targets and coefficients for
|
||||
std::vector<class list2> sum_delta; /* array of pointers to sources, targets and coefficients for
|
||||
summing deltas for mass balance equations */
|
||||
/*----------------------------------------------------------------------
|
||||
* Solution
|
||||
@ -1297,13 +1297,13 @@ protected:
|
||||
LDBLE heat_diffc;
|
||||
int cell;
|
||||
LDBLE mcd_substeps;
|
||||
struct stag_data stag_data;
|
||||
class stag_data stag_data;
|
||||
int print_modulus;
|
||||
int punch_modulus;
|
||||
int dump_in;
|
||||
int dump_modulus;
|
||||
int transport_warnings;
|
||||
std::vector<struct cell_data> cell_data;
|
||||
std::vector<class cell_data> cell_data;
|
||||
int old_cells, max_cells, all_cells;
|
||||
int multi_Dflag; /* signals calc'n of multicomponent diffusion */
|
||||
int interlayer_Dflag; /* multicomponent diffusion and diffusion through interlayer porosity */
|
||||
@ -1345,13 +1345,13 @@ protected:
|
||||
/*----------------------------------------------------------------------
|
||||
* Elements
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct element*> elements;
|
||||
struct element* element_h_one;
|
||||
std::vector<class element*> elements;
|
||||
class element* element_h_one;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Element List
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct elt_list> elt_list;
|
||||
std::vector<class elt_list> elt_list;
|
||||
size_t count_elts = 0; /* number of elements in elt_list = position of next */
|
||||
/*----------------------------------------------------------------------
|
||||
* Reaction
|
||||
@ -1360,70 +1360,70 @@ protected:
|
||||
/*----------------------------------------------------------------------
|
||||
* Species
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct logk*> logk;
|
||||
std::vector<class logk*> logk;
|
||||
|
||||
std::string moles_per_kilogram_string;
|
||||
|
||||
std::vector<struct species*> s;
|
||||
std::vector<class species*> s;
|
||||
std::vector< std::map < std::string, cxxSpeciesDL > > s_diff_layer;
|
||||
std::vector<struct species*> s_x;
|
||||
std::vector<class species*> s_x;
|
||||
|
||||
struct species* s_h2o;
|
||||
struct species* s_hplus;
|
||||
struct species* s_h3oplus;
|
||||
struct species* s_eminus;
|
||||
struct species* s_co3;
|
||||
struct species* s_h2;
|
||||
struct species* s_o2;
|
||||
class species* s_h2o;
|
||||
class species* s_hplus;
|
||||
class species* s_h3oplus;
|
||||
class species* s_eminus;
|
||||
class species* s_co3;
|
||||
class species* s_h2;
|
||||
class species* s_o2;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Phases
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct phase*> phases;
|
||||
std::vector<class phase*> phases;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Master species
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct master*> master;
|
||||
std::vector<class master*> master;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Unknowns
|
||||
*---------------------------------------------------------------------- */
|
||||
std::vector<struct unknown*> x;
|
||||
std::vector<class unknown*> x;
|
||||
size_t count_unknowns;
|
||||
size_t max_unknowns;
|
||||
|
||||
struct unknown* ah2o_unknown;
|
||||
struct unknown* alkalinity_unknown;
|
||||
struct unknown* carbon_unknown;
|
||||
struct unknown* charge_balance_unknown;
|
||||
struct unknown* exchange_unknown;
|
||||
struct unknown* mass_hydrogen_unknown;
|
||||
struct unknown* mass_oxygen_unknown;
|
||||
struct unknown* mb_unknown;
|
||||
struct unknown* mu_unknown;
|
||||
struct unknown* pe_unknown;
|
||||
struct unknown* ph_unknown;
|
||||
struct unknown* pure_phase_unknown;
|
||||
struct unknown* solution_phase_boundary_unknown;
|
||||
struct unknown* surface_unknown;
|
||||
struct unknown* gas_unknown;
|
||||
struct unknown* ss_unknown;
|
||||
std::vector<struct unknown*> gas_unknowns;
|
||||
class unknown* ah2o_unknown;
|
||||
class unknown* alkalinity_unknown;
|
||||
class unknown* carbon_unknown;
|
||||
class unknown* charge_balance_unknown;
|
||||
class unknown* exchange_unknown;
|
||||
class unknown* mass_hydrogen_unknown;
|
||||
class unknown* mass_oxygen_unknown;
|
||||
class unknown* mb_unknown;
|
||||
class unknown* mu_unknown;
|
||||
class unknown* pe_unknown;
|
||||
class unknown* ph_unknown;
|
||||
class unknown* pure_phase_unknown;
|
||||
class unknown* solution_phase_boundary_unknown;
|
||||
class unknown* surface_unknown;
|
||||
class unknown* gas_unknown;
|
||||
class unknown* ss_unknown;
|
||||
std::vector<class unknown*> gas_unknowns;
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Reaction work space
|
||||
*---------------------------------------------------------------------- */
|
||||
struct reaction_temp trxn; /* structure array of working space while reading equations
|
||||
class reaction_temp trxn; /* structure array of working space while reading equations
|
||||
species names are in "temp_strings" */
|
||||
size_t count_trxn; /* number of reactants in trxn = position of next */
|
||||
|
||||
std::vector<struct unknown_list> mb_unknowns;
|
||||
std::vector<class unknown_list> mb_unknowns;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Print
|
||||
* ---------------------------------------------------------------------- */
|
||||
struct prints pr;
|
||||
class prints pr;
|
||||
bool status_on;
|
||||
clock_t status_interval;
|
||||
clock_t status_timer;
|
||||
@ -1433,7 +1433,7 @@ protected:
|
||||
/* ----------------------------------------------------------------------
|
||||
* RATES
|
||||
* ---------------------------------------------------------------------- */
|
||||
std::vector<struct rate> rates;
|
||||
std::vector<class rate> rates;
|
||||
LDBLE rate_m, rate_m0, rate_time, rate_kin_time, rate_sim_time_start,
|
||||
rate_sim_time_end, rate_sim_time, rate_moles, initial_total_time;
|
||||
std::vector<LDBLE> rate_p;
|
||||
@ -1442,7 +1442,7 @@ protected:
|
||||
/* ----------------------------------------------------------------------
|
||||
* USER PRINT COMMANDS
|
||||
* ---------------------------------------------------------------------- */
|
||||
struct rate* user_print = 0;
|
||||
class rate* user_print = 0;
|
||||
int n_user_punch_index;
|
||||
|
||||
int fpunchf_user_s_warning;
|
||||
@ -1552,7 +1552,7 @@ protected:
|
||||
int remove_unstable_phases;
|
||||
std::string screen_string;
|
||||
#ifdef PHREEQCI_GUI
|
||||
struct spread_sheet g_spread_sheet;
|
||||
class spread_sheet g_spread_sheet;
|
||||
#endif
|
||||
int spread_length;
|
||||
|
||||
@ -1562,11 +1562,11 @@ protected:
|
||||
*/
|
||||
|
||||
std::map<std::string, std::string*> strings_map;
|
||||
std::map<std::string, struct element*> elements_map;
|
||||
std::map<std::string, struct species*> species_map;
|
||||
std::map<std::string, struct phase*> phases_map;
|
||||
std::map<std::string, struct logk*> logk_map;
|
||||
std::map<std::string, struct master_isotope*> master_isotope_map;
|
||||
std::map<std::string, class element*> elements_map;
|
||||
std::map<std::string, class species*> species_map;
|
||||
std::map<std::string, class phase*> phases_map;
|
||||
std::map<std::string, class logk*> logk_map;
|
||||
std::map<std::string, class master_isotope*> master_isotope_map;
|
||||
|
||||
#if defined(PHREEQCI_GUI)
|
||||
#include "../../phreeqci_gui.h"
|
||||
@ -1574,14 +1574,14 @@ protected:
|
||||
/* ----------------------------------------------------------------------
|
||||
* ISOTOPES
|
||||
* ---------------------------------------------------------------------- */
|
||||
std::vector<struct master_isotope*> master_isotope;
|
||||
std::vector<class master_isotope*> master_isotope;
|
||||
int initial_solution_isotopes;
|
||||
std::vector<struct calculate_value*> calculate_value;
|
||||
std::map<std::string, struct calculate_value*> calculate_value_map;
|
||||
std::vector<struct isotope_ratio*> isotope_ratio;
|
||||
std::map<std::string, struct isotope_ratio*> isotope_ratio_map;
|
||||
std::vector<struct isotope_alpha*> isotope_alpha;
|
||||
std::map<std::string, struct isotope_alpha*> isotope_alpha_map;
|
||||
std::vector<class calculate_value*> calculate_value;
|
||||
std::map<std::string, class calculate_value*> calculate_value_map;
|
||||
std::vector<class isotope_ratio*> isotope_ratio;
|
||||
std::map<std::string, class isotope_ratio*> isotope_ratio_map;
|
||||
std::vector<class isotope_alpha*> isotope_alpha;
|
||||
std::map<std::string, class isotope_alpha*> isotope_alpha_map;
|
||||
int phreeqc_mpi_myself;
|
||||
int first_read_input;
|
||||
std::string user_database;
|
||||
@ -1597,7 +1597,7 @@ protected:
|
||||
LDBLE cell_porosity;
|
||||
LDBLE cell_volume;
|
||||
LDBLE cell_saturation;
|
||||
std::vector<struct system_species> sys;
|
||||
std::vector<class system_species> sys;
|
||||
LDBLE sys_tot;
|
||||
|
||||
LDBLE V_solutes, rho_0, rho_0_sat, kappa_0, p_sat/*, ah2o_x0*/;
|
||||
@ -1658,7 +1658,7 @@ protected:
|
||||
size_t klmd, nklmd, n2d;
|
||||
int kode, iter;
|
||||
LDBLE toler, error, max_pct, scaled_error;
|
||||
struct master* master_alk;
|
||||
class master* master_alk;
|
||||
std::vector<int> row_back, col_back;
|
||||
std::vector<unsigned long> good, bad, minimal;
|
||||
size_t max_good, max_bad, max_minimal;
|
||||
@ -1710,18 +1710,18 @@ protected:
|
||||
LDBLE COSMOT;
|
||||
LDBLE AW;
|
||||
LDBLE VP, DW0;
|
||||
std::vector<struct pitz_param*> pitz_params;
|
||||
std::vector<class pitz_param*> pitz_params;
|
||||
std::map< std::string, size_t > pitz_param_map;
|
||||
std::vector<struct theta_param*> theta_params;
|
||||
std::vector<class theta_param*> theta_params;
|
||||
int use_etheta;
|
||||
LDBLE OTEMP, OPRESS;
|
||||
LDBLE A0;
|
||||
struct pitz_param* aphi = NULL;
|
||||
std::vector<struct species*> spec;
|
||||
struct species** cations, ** anions, ** neutrals; // pointers to spec
|
||||
class pitz_param* aphi = NULL;
|
||||
std::vector<class species*> spec;
|
||||
class species** cations, ** anions, ** neutrals; // pointers to spec
|
||||
int count_cations, count_anions, count_neutrals;
|
||||
int MAXCATIONS, FIRSTANION, MAXNEUTRAL;
|
||||
struct pitz_param* mcb0, * mcb1, * mcc0;
|
||||
class pitz_param* mcb0, * mcb1, * mcc0;
|
||||
std::vector<int> IPRSNT;
|
||||
std::vector<double> M, LGAMMA;
|
||||
LDBLE BK[23], DK[23];
|
||||
@ -1747,7 +1747,7 @@ protected:
|
||||
std::string dump_file_name_cpp;
|
||||
|
||||
/* sit.cpp ------------------------------- */
|
||||
std::vector<struct pitz_param*> sit_params;
|
||||
std::vector<class pitz_param*> sit_params;
|
||||
std::map< std::string, size_t > sit_param_map;
|
||||
LDBLE sit_A0;
|
||||
int sit_count_cations, sit_count_anions, sit_count_neutrals;
|
||||
@ -1760,19 +1760,19 @@ protected:
|
||||
LDBLE a0, a1, kc, kb;
|
||||
|
||||
/* tally.cpp ------------------------------- */
|
||||
struct tally_buffer* t_buffer;
|
||||
class tally_buffer* t_buffer;
|
||||
size_t tally_count_component;
|
||||
struct tally* tally_table;
|
||||
class tally* tally_table;
|
||||
size_t count_tally_table_columns;
|
||||
size_t count_tally_table_rows;
|
||||
|
||||
/* transport.cpp ------------------------------- */
|
||||
struct sol_D* sol_D;
|
||||
struct sol_D* sol_D_dbg;
|
||||
struct J_ij* J_ij, * J_ij_il;
|
||||
class sol_D* sol_D;
|
||||
class sol_D* sol_D_dbg;
|
||||
class J_ij* J_ij, * J_ij_il;
|
||||
int J_ij_count_spec;
|
||||
|
||||
struct M_S* m_s;
|
||||
class M_S* m_s;
|
||||
int count_m_s;
|
||||
LDBLE tot1_h, tot1_o, tot2_h, tot2_o;
|
||||
LDBLE diffc_max, diffc_tr, J_ij_sum;
|
||||
@ -1805,7 +1805,7 @@ protected:
|
||||
std::vector<int> keycount; // used to mark keywords that have been read
|
||||
|
||||
public:
|
||||
static const struct const_iso iso_defaults[];
|
||||
static const class const_iso iso_defaults[];
|
||||
static const int count_iso_defaults;
|
||||
};
|
||||
#endif /* _INC_PHREEQC_H */
|
||||
|
||||
@ -459,7 +459,7 @@ int Phreeqc::
|
||||
run_as_cells(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct save save_data;
|
||||
class save save_data;
|
||||
LDBLE kin_time;
|
||||
int count_steps, use_mix;
|
||||
char token[2 * MAX_LENGTH];
|
||||
@ -534,7 +534,7 @@ run_as_cells(void)
|
||||
/*
|
||||
* save data for saving solutions
|
||||
*/
|
||||
memcpy(&save_data, &save, sizeof(struct save));
|
||||
memcpy(&save_data, &save, sizeof(class save));
|
||||
/*
|
||||
*Copy everything to -2
|
||||
*/
|
||||
@ -611,7 +611,7 @@ run_as_cells(void)
|
||||
/*
|
||||
* save end of reaction
|
||||
*/
|
||||
memcpy(&save, &save_data, sizeof(struct save));
|
||||
memcpy(&save, &save_data, sizeof(class save));
|
||||
if (use.Get_kinetics_in() == TRUE)
|
||||
{
|
||||
Utilities::Rxn_copy(Rxn_kinetics_map, -2, use.Get_n_kinetics_user());
|
||||
@ -669,7 +669,7 @@ int Phreeqc::
|
||||
run_as_cells(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct save save_data;
|
||||
class save save_data;
|
||||
LDBLE kin_time;
|
||||
int count_steps, use_mix;
|
||||
char token[2 * MAX_LENGTH];
|
||||
@ -745,7 +745,7 @@ run_as_cells(void)
|
||||
/*
|
||||
* save data for saving solutions
|
||||
*/
|
||||
memcpy(&save_data, &save, sizeof(struct save));
|
||||
memcpy(&save_data, &save, sizeof(class save));
|
||||
/*
|
||||
*Copy everything to -2
|
||||
*/
|
||||
@ -825,7 +825,7 @@ run_as_cells(void)
|
||||
/*
|
||||
* save end of reaction
|
||||
*/
|
||||
memcpy(&save, &save_data, sizeof(struct save));
|
||||
memcpy(&save, &save_data, sizeof(class save));
|
||||
if (use.Get_kinetics_in() == TRUE)
|
||||
{
|
||||
Utilities::Rxn_copy(Rxn_kinetics_map, -2, use.Get_n_kinetics_user());
|
||||
|
||||
@ -421,7 +421,7 @@ cxxSS::totalize(Phreeqc * phreeqc_ptr)
|
||||
// component structures
|
||||
for (size_t i = 0; i < this->ss_comps.size(); i++)
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
phase_ptr = phreeqc_ptr-> phase_bsearch(ss_comps[i].Get_name().c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
|
||||
@ -11,7 +11,7 @@ class cxxSolutionIsotope: public PHRQ_base
|
||||
{
|
||||
public:
|
||||
cxxSolutionIsotope(PHRQ_io *io=NULL);
|
||||
cxxSolutionIsotope(struct isotope *isotope_ptr, PHRQ_io *io=NULL);
|
||||
cxxSolutionIsotope(class isotope *isotope_ptr, PHRQ_io *io=NULL);
|
||||
virtual ~cxxSolutionIsotope(void);
|
||||
|
||||
void dump_xml(std::ostream & os, unsigned int indent) const;
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
cxxSurfaceCharge(struct surface_charge *, PHRQ_io *io=NULL);
|
||||
virtual ~cxxSurfaceCharge();
|
||||
|
||||
struct master *Get_psi_master();
|
||||
class master *Get_psi_master();
|
||||
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);
|
||||
|
||||
@ -87,7 +87,7 @@ public:
|
||||
cxxPressure * Get_pressure_ptr(void) const {return this->pressure_ptr;}
|
||||
cxxTemperature * Get_temperature_ptr(void) const {return this->temperature_ptr;}
|
||||
cxxGasPhase * Get_gas_phase_ptr(void) const {return this->gas_phase_ptr;}
|
||||
struct inverse * Get_inverse_ptr(void) const {return this->inverse_ptr;}
|
||||
class inverse * Get_inverse_ptr(void) const {return this->inverse_ptr;}
|
||||
cxxSSassemblage * Get_ss_assemblage_ptr(void) {return this->ss_assemblage_ptr;}
|
||||
|
||||
void Set_solution_ptr(cxxSolution * p) {this->solution_ptr = p;}
|
||||
@ -100,7 +100,7 @@ public:
|
||||
void Set_pressure_ptr(cxxPressure * p) {this->pressure_ptr = p;}
|
||||
void Set_temperature_ptr(cxxTemperature * p) {this->temperature_ptr = p;}
|
||||
void Set_gas_phase_ptr(cxxGasPhase * p) {this->gas_phase_ptr = p;}
|
||||
void Set_inverse_ptr(struct inverse * p) {this->inverse_ptr = p;}
|
||||
void Set_inverse_ptr(class inverse * p) {this->inverse_ptr = p;}
|
||||
void Set_ss_assemblage_ptr(cxxSSassemblage * p) {this->ss_assemblage_ptr = p;}
|
||||
|
||||
protected:
|
||||
@ -143,7 +143,7 @@ protected:
|
||||
|
||||
bool inverse_in;
|
||||
int n_inverse_user;
|
||||
struct inverse *inverse_ptr;
|
||||
class inverse *inverse_ptr;
|
||||
|
||||
bool gas_phase_in;
|
||||
int n_gas_phase_user;
|
||||
|
||||
@ -26,14 +26,14 @@ public:
|
||||
|
||||
// rate
|
||||
//
|
||||
struct rate * Get_rate() {return this->rate;}
|
||||
const struct rate * Get_rate()const {return this->rate;}
|
||||
class rate * Get_rate() {return this->rate;}
|
||||
const class rate * Get_rate()const {return this->rate;}
|
||||
|
||||
void Set_rate(struct rate * r) {this->rate = r;}
|
||||
void Set_rate(class rate * r) {this->rate = r;}
|
||||
|
||||
protected:
|
||||
std::vector <std::string> headings;
|
||||
struct rate * rate;
|
||||
class rate * rate;
|
||||
Phreeqc * PhreeqcPtr;
|
||||
};
|
||||
#endif // !defined(USERPUNCH_H_INCLUDED)
|
||||
@ -16,7 +16,7 @@ LDBLE Phreeqc::
|
||||
activity(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE a;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -44,7 +44,7 @@ LDBLE Phreeqc::
|
||||
activity_coefficient(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE g, dum = 0.0;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -66,7 +66,7 @@ LDBLE Phreeqc::
|
||||
log_activity_coefficient(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE g, dum = 0.0;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -88,7 +88,7 @@ LDBLE Phreeqc::
|
||||
aqueous_vm(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE g;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -107,7 +107,7 @@ LDBLE Phreeqc::
|
||||
phase_vm(const char *phase_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
LDBLE g;
|
||||
|
||||
@ -177,7 +177,7 @@ LDBLE Phreeqc::
|
||||
diff_c(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE g;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -199,7 +199,7 @@ LDBLE Phreeqc::
|
||||
setdiff_c(const char *species_name, double d)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE g;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -470,7 +470,7 @@ calc_dens(void)
|
||||
/* 2 options: original VP, assign the volumes of species with zero molar volume to their master species,
|
||||
but this doubles counts of complexes with -Vm defined. And, cation-OH and H-anion
|
||||
complexes are counted once. Also, must add H+ and OH-... */
|
||||
//struct species *s_ptr;
|
||||
//class species *s_ptr;
|
||||
|
||||
//V_solutes = M_T = 0.0;
|
||||
//for (i = 0; i < count_species_list; i++)
|
||||
@ -586,7 +586,7 @@ calc_solution_volume(void)
|
||||
for (int i = 0; i < (int)master.size(); i++)
|
||||
{
|
||||
if (master[i]->s->type != AQ) continue;
|
||||
struct master *master_ptr = master[i];
|
||||
class master *master_ptr = master[i];
|
||||
if (master_ptr->primary == TRUE && strcmp(master_ptr->elt->name, "Alkalinity"))
|
||||
{
|
||||
total_mass += master_ptr->total_primary * master_ptr->elt->gfw;
|
||||
@ -605,10 +605,10 @@ calc_logk_n(const char *name)
|
||||
char token[MAX_LENGTH];
|
||||
int i;
|
||||
LDBLE lk;
|
||||
struct logk *logk_ptr;
|
||||
class logk *logk_ptr;
|
||||
LDBLE l_logk[MAX_LOG_K_INDICES];
|
||||
struct name_coef add_logk;
|
||||
std::vector<struct name_coef> add_logk_v;
|
||||
class name_coef add_logk;
|
||||
std::vector<class name_coef> add_logk_v;
|
||||
|
||||
for (i = 0; i < MAX_LOG_K_INDICES; i++)
|
||||
{
|
||||
@ -635,7 +635,7 @@ calc_logk_p(const char *name)
|
||||
{
|
||||
int i, j;
|
||||
char token[MAX_LENGTH];
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
LDBLE lk=-999.9;
|
||||
LDBLE l_logk[MAX_LOG_K_INDICES];
|
||||
|
||||
@ -675,7 +675,7 @@ calc_logk_s(const char *name)
|
||||
{
|
||||
int i;
|
||||
char token[MAX_LENGTH];
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE lk, l_logk[MAX_LOG_K_INDICES];
|
||||
|
||||
strcpy(token, name);
|
||||
@ -703,7 +703,7 @@ dh_a0(const char* name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
char token[MAX_LENGTH];
|
||||
struct species* s_ptr;
|
||||
class species* s_ptr;
|
||||
double a = -999.99;
|
||||
|
||||
strcpy(token, name);
|
||||
@ -720,7 +720,7 @@ dh_bdot(const char* name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
char token[MAX_LENGTH];
|
||||
struct species* s_ptr;
|
||||
class species* s_ptr;
|
||||
double b = -999.99;
|
||||
if (llnl_temp.size() > 0)
|
||||
{
|
||||
@ -744,7 +744,7 @@ calc_deltah_p(const char* name)
|
||||
{
|
||||
int i, j;
|
||||
char token[MAX_LENGTH];
|
||||
struct phase* phase_ptr;
|
||||
class phase* phase_ptr;
|
||||
LDBLE lkm, lkp;
|
||||
LDBLE l_logk[MAX_LOG_K_INDICES];
|
||||
double dh = -999.99;
|
||||
@ -785,7 +785,7 @@ calc_deltah_s(const char* name)
|
||||
{
|
||||
int i;
|
||||
char token[MAX_LENGTH];
|
||||
struct species* s_ptr;
|
||||
class species* s_ptr;
|
||||
LDBLE lkm, lkp, l_logk[MAX_LOG_K_INDICES];
|
||||
double dh = -999.99;
|
||||
strcpy(token, name);
|
||||
@ -817,8 +817,8 @@ calc_surface_charge(const char *surface_name)
|
||||
const char* cptr;
|
||||
int i, j, k;
|
||||
LDBLE charge;
|
||||
struct rxn_token_temp *token_ptr;
|
||||
struct master *master_ptr;
|
||||
class rxn_token_temp *token_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Go through species, sum charge
|
||||
*/
|
||||
@ -860,7 +860,7 @@ diff_layer_total(const char *total_name, const char *surface_name)
|
||||
*/
|
||||
cxxSurfaceCharge *surface_charge_ptr1;
|
||||
std::string name, token, surface_name_local;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
LDBLE mass_water_surface;
|
||||
LDBLE molality, moles_excess, moles_surface, charge;
|
||||
@ -1144,7 +1144,7 @@ calc_t_sc(const char *name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
char token[MAX_LENGTH];
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
|
||||
strcpy(token, name);
|
||||
s_ptr = s_search(token);
|
||||
@ -1281,14 +1281,14 @@ LDBLE Phreeqc::
|
||||
equivalent_fraction(const char *name, LDBLE *eq, std::string &elt_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr = s_search(name);
|
||||
class species *s_ptr = s_search(name);
|
||||
*eq = 0;
|
||||
elt_name.clear();
|
||||
LDBLE f = 0;
|
||||
if (s_ptr != NULL && (s_ptr->type == EX || s_ptr->type == SURF))
|
||||
{
|
||||
*eq = s_ptr->equiv;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
LDBLE tot=0.0;
|
||||
for (next_elt = &s_ptr->next_elt[0]; next_elt->elt != NULL; next_elt++)
|
||||
{
|
||||
@ -1320,7 +1320,7 @@ find_gas_comp(const char *gas_comp_name)
|
||||
{
|
||||
if (strcmp_nocase(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(), gas_comp_name) == 0)
|
||||
{
|
||||
struct phase *phase_ptr = phase_bsearch(gas_comp_name, &i, false);
|
||||
class phase *phase_ptr = phase_bsearch(gas_comp_name, &i, false);
|
||||
if (phase_ptr)
|
||||
{
|
||||
return (phase_ptr->moles_x);
|
||||
@ -1461,7 +1461,7 @@ get_calculate_value(const char *name)
|
||||
* return: LDBLE of value
|
||||
*/
|
||||
{
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
calculate_value_ptr = calculate_value_search(name);
|
||||
if (calculate_value_ptr == NULL)
|
||||
{
|
||||
@ -1592,7 +1592,7 @@ LDBLE Phreeqc::
|
||||
log_activity(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE la;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -1621,7 +1621,7 @@ LDBLE Phreeqc::
|
||||
log_molality(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE lm;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -1650,7 +1650,7 @@ LDBLE Phreeqc::
|
||||
molality(const char *species_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
LDBLE m;
|
||||
|
||||
s_ptr = s_search(species_name);
|
||||
@ -1670,7 +1670,7 @@ LDBLE Phreeqc::
|
||||
pr_pressure(const char *phase_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
|
||||
phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
||||
@ -1699,7 +1699,7 @@ LDBLE Phreeqc::
|
||||
pr_phi(const char *phase_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
|
||||
phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
||||
@ -1720,8 +1720,8 @@ LDBLE Phreeqc::
|
||||
saturation_ratio(const char *phase_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
LDBLE si, iap;
|
||||
|
||||
@ -1752,8 +1752,8 @@ int Phreeqc::
|
||||
saturation_index(const char *phase_name, LDBLE * iap, LDBLE * si)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
int l;
|
||||
|
||||
*si = -99.99;
|
||||
@ -1787,7 +1787,7 @@ sum_match_gases(const char *mytemplate, const char *name)
|
||||
{
|
||||
int i;
|
||||
LDBLE tot;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
|
||||
if (use.Get_gas_phase_in() == FALSE || use.Get_gas_phase_ptr() == NULL)
|
||||
return (0);
|
||||
@ -1795,7 +1795,7 @@ sum_match_gases(const char *mytemplate, const char *name)
|
||||
tot = 0;
|
||||
for (size_t j = 0; j < gas_phase_ptr->Get_gas_comps().size(); j++)
|
||||
{
|
||||
struct phase * phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(),
|
||||
class phase * phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(),
|
||||
&i, FALSE);
|
||||
if (match_elts_in_species(phase_ptr->formula, mytemplate) == TRUE)
|
||||
{
|
||||
@ -1827,7 +1827,7 @@ sum_match_species(const char *mytemplate, const char *name)
|
||||
{
|
||||
int i;
|
||||
LDBLE tot;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
@ -1837,7 +1837,7 @@ sum_match_species(const char *mytemplate, const char *name)
|
||||
std::vector<std::string> species_list;
|
||||
for (i = 0; i < (int)this->s_x.size(); i++)
|
||||
{
|
||||
struct species *s_ptr = s_x[i];
|
||||
class species *s_ptr = s_x[i];
|
||||
if (match_elts_in_species(s_ptr->name, mytemplate) == TRUE)
|
||||
{
|
||||
species_list.push_back(s_ptr->name);
|
||||
@ -1848,7 +1848,7 @@ sum_match_species(const char *mytemplate, const char *name)
|
||||
std::vector<std::string> &species_list = (sum_species_map.find(mytemplate))->second;
|
||||
for (size_t i=0; i < species_list.size(); i++)
|
||||
{
|
||||
struct species *s_ptr = s_search(species_list[i].c_str());
|
||||
class species *s_ptr = s_search(species_list[i].c_str());
|
||||
if (s_ptr->in == FALSE) continue;
|
||||
if (name == NULL)
|
||||
{
|
||||
@ -1878,7 +1878,7 @@ sum_match_ss(const char *mytemplate, const char *name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE tot;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
|
||||
if (use.Get_ss_assemblage_in() == FALSE || use.Get_ss_assemblage_ptr() == NULL)
|
||||
return (0);
|
||||
@ -1904,7 +1904,7 @@ sum_match_ss(const char *mytemplate, const char *name)
|
||||
else
|
||||
{
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
for (next_elt = &phase_ptr->next_elt[0]; next_elt->elt != NULL; next_elt++)
|
||||
{
|
||||
if (strcmp(next_elt->elt->name, name) == 0)
|
||||
@ -2290,7 +2290,7 @@ surf_total(const char *total_name, const char *surface_name)
|
||||
if (!match) continue;
|
||||
|
||||
// surface matches, now match element or redox state
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
if (s_x[j]->mole_balance == NULL)
|
||||
{
|
||||
for (rxn_ptr = &s_x[j]->rxn_s.token[0] + 1; rxn_ptr->s != NULL; rxn_ptr++)
|
||||
@ -2436,7 +2436,7 @@ LDBLE Phreeqc::
|
||||
total(const char *total_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE t;
|
||||
|
||||
if (strcmp(total_name, "H") == 0)
|
||||
@ -2505,7 +2505,7 @@ LDBLE Phreeqc::
|
||||
total_mole(const char *total_name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE t;
|
||||
|
||||
if (strcmp(total_name, "H") == 0)
|
||||
@ -2640,7 +2640,7 @@ edl_species(const char *surf_name, LDBLE * count, char ***names, LDBLE ** moles,
|
||||
if (sys.size() > 1)
|
||||
{
|
||||
qsort(&sys[0], sys.size(),
|
||||
sizeof(struct system_species), system_species_compare);
|
||||
sizeof(class system_species), system_species_compare);
|
||||
}
|
||||
/*
|
||||
* malloc space
|
||||
@ -2731,12 +2731,12 @@ system_total(const char *total_name, LDBLE * count, char ***names,
|
||||
if (sys.size() > 1 && isort == 0)
|
||||
{
|
||||
qsort(&sys[0], sys.size(),
|
||||
sizeof(struct system_species), system_species_compare);
|
||||
sizeof(class system_species), system_species_compare);
|
||||
}
|
||||
else if (sys.size() > 1)
|
||||
{
|
||||
qsort(&sys[0], sys.size(),
|
||||
sizeof(struct system_species), system_species_compare_name);
|
||||
sizeof(class system_species), system_species_compare_name);
|
||||
}
|
||||
/*
|
||||
* malloc space
|
||||
@ -2809,7 +2809,7 @@ kinetics_formula(std::string kin_name, cxxNameDouble &stoichiometry)
|
||||
{
|
||||
// Try Phases
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
{
|
||||
add_elt_list(phase_ptr->next_elt, it->second);
|
||||
@ -2845,7 +2845,7 @@ phase_formula(std::string phase_name, cxxNameDouble &stoichiometry)
|
||||
std::string formula;
|
||||
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(phase_name.c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(phase_name.c_str(), &j, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
{
|
||||
formula.append(phase_ptr->formula);
|
||||
@ -2867,7 +2867,7 @@ species_formula(std::string phase_name, cxxNameDouble &stoichiometry)
|
||||
stoichiometry.clear();
|
||||
std::string formula;
|
||||
formula = "none";
|
||||
struct species *s_ptr = s_search(phase_name.c_str());
|
||||
class species *s_ptr = s_search(phase_name.c_str());
|
||||
if (s_ptr != NULL)
|
||||
{
|
||||
cxxNameDouble nd(s_ptr->next_elt);
|
||||
@ -2897,7 +2897,7 @@ system_total_elements(void)
|
||||
int i;
|
||||
LDBLE t;
|
||||
char name[MAX_LENGTH];
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
/*
|
||||
* Include H and O
|
||||
@ -3012,7 +3012,7 @@ system_total_si(void)
|
||||
{
|
||||
int i;
|
||||
LDBLE si, iap;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
char name[MAX_LENGTH];
|
||||
|
||||
sys_tot = -999.9;
|
||||
@ -3140,7 +3140,7 @@ system_total_gas(void)
|
||||
cxxGasPhase *gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||
for (size_t j = 0; j < gas_phase_ptr->Get_gas_comps().size(); j++)
|
||||
{
|
||||
struct phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(),
|
||||
class phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(),
|
||||
&i, FALSE);
|
||||
assert(phase_ptr);
|
||||
size_t count_sys = sys.size();
|
||||
@ -3168,7 +3168,7 @@ system_total_equi(void)
|
||||
{
|
||||
cxxPPassemblageComp *comp_ptr = &(it->second);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
size_t count_sys = sys.size();
|
||||
sys.resize(count_sys + 1);
|
||||
sys[count_sys].name = string_duplicate(phase_ptr->name);
|
||||
@ -3223,7 +3223,7 @@ system_total_ss(void)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[i]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
size_t count_sys = sys.size();
|
||||
sys.resize(count_sys + 1);
|
||||
sys[count_sys].name = string_duplicate(phase_ptr->name);
|
||||
@ -3377,8 +3377,8 @@ system_total_elt(const char *total_name)
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
int j;
|
||||
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||
struct phase * phase_ptr = x[i]->phase;
|
||||
//class phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||
class phase * phase_ptr = x[i]->phase;
|
||||
add_elt_list(phase_ptr->next_elt, x[i]->moles);
|
||||
elt_list_combine();
|
||||
for (j = 0; j < count_elts; j++)
|
||||
@ -3411,7 +3411,7 @@ system_total_elt(const char *total_name)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[i]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
add_elt_list(phase_ptr->next_elt,
|
||||
@ -3443,7 +3443,7 @@ system_total_elt(const char *total_name)
|
||||
cxxGasPhase *gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||
for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
|
||||
{
|
||||
struct phase *phase_ptr =
|
||||
class phase *phase_ptr =
|
||||
phase_bsearch(gas_phase_ptr->Get_gas_comps()[i].Get_phase_name().c_str(), &k, FALSE);
|
||||
assert(phase_ptr);
|
||||
if (phase_ptr->in == TRUE)
|
||||
@ -3623,8 +3623,8 @@ system_total_elt_secondary(const char *total_name)
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
int j;
|
||||
//struct phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||
struct phase * phase_ptr = x[i]->phase;
|
||||
//class phase * phase_ptr = phase_bsearch(x[i]->pp_assemblage_comp_name, &j, FALSE);
|
||||
class phase * phase_ptr = x[i]->phase;
|
||||
add_elt_list(phase_ptr->next_sys_total, x[i]->moles);
|
||||
elt_list_combine();
|
||||
for (j = 0; j < count_elts; j++)
|
||||
@ -3658,7 +3658,7 @@ system_total_elt_secondary(const char *total_name)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
add_elt_list(phase_ptr->next_sys_total,
|
||||
@ -3690,7 +3690,7 @@ system_total_elt_secondary(const char *total_name)
|
||||
cxxGasPhase *gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||
for (size_t j = 0; j < gas_phase_ptr->Get_gas_comps().size(); j++)
|
||||
{
|
||||
struct phase *phase_ptr =
|
||||
class phase *phase_ptr =
|
||||
phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(), &i, FALSE);
|
||||
assert(phase_ptr);
|
||||
if (phase_ptr->in == TRUE)
|
||||
@ -3808,10 +3808,10 @@ int Phreeqc::
|
||||
system_species_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct system_species *a, *b;
|
||||
const class system_species *a, *b;
|
||||
|
||||
a = (const struct system_species *) ptr1;
|
||||
b = (const struct system_species *) ptr2;
|
||||
a = (const class system_species *) ptr1;
|
||||
b = (const class system_species *) ptr2;
|
||||
if (a->moles < b->moles)
|
||||
return (1);
|
||||
if (a->moles > b->moles)
|
||||
@ -3822,10 +3822,10 @@ int Phreeqc::
|
||||
system_species_compare_name(const void* ptr1, const void* ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct system_species* a, * b;
|
||||
const class system_species* a, * b;
|
||||
|
||||
a = (const struct system_species*)ptr1;
|
||||
b = (const struct system_species*)ptr2;
|
||||
a = (const class system_species*)ptr1;
|
||||
b = (const class system_species*)ptr2;
|
||||
return (strncmp(a->name, b->name, MAX_LENGTH));
|
||||
}
|
||||
|
||||
@ -3870,7 +3870,7 @@ system_total_solids(cxxExchange *exchange_ptr,
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[j]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
add_elt_list(phase_ptr->next_elt,
|
||||
comp_ptr->Get_moles());
|
||||
}
|
||||
@ -3881,7 +3881,7 @@ system_total_solids(cxxExchange *exchange_ptr,
|
||||
for (size_t j = 0; j < gas_phase_ptr->Get_gas_comps().size(); j++)
|
||||
{
|
||||
int i;
|
||||
struct phase *phase_ptr =
|
||||
class phase *phase_ptr =
|
||||
phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(), &i, FALSE);
|
||||
add_elt_list(phase_ptr->next_elt, gas_phase_ptr->Get_gas_comps()[j].Get_moles());
|
||||
}
|
||||
@ -3893,7 +3893,7 @@ system_total_solids(cxxExchange *exchange_ptr,
|
||||
for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
|
||||
{
|
||||
int j;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
add_elt_list(phase_ptr->next_elt,
|
||||
it->second.Get_moles());
|
||||
}
|
||||
@ -3941,7 +3941,7 @@ iso_unit(const char *total_name)
|
||||
{
|
||||
int j;
|
||||
char token[MAX_LENGTH], unit[MAX_LENGTH];
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
char my_total_name[MAX_LENGTH];
|
||||
strcpy(token, "");
|
||||
strcpy(my_total_name, total_name);
|
||||
|
||||
@ -22,7 +22,7 @@ setup_fixed_volume_gas(void)
|
||||
{
|
||||
const cxxGasComp *comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
x[count_unknowns]->type = GAS_MOLES;
|
||||
x[count_unknowns]->description = phase_ptr->name;
|
||||
x[count_unknowns]->phase = phase_ptr;
|
||||
@ -57,9 +57,9 @@ build_fixed_volume_gas(void)
|
||||
* mass balance equations for elements contained in gases
|
||||
*/
|
||||
size_t row, col;
|
||||
struct master *master_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
LDBLE coef, coef_elt;
|
||||
|
||||
if (gas_unknown == NULL)
|
||||
@ -69,7 +69,7 @@ build_fixed_volume_gas(void)
|
||||
{
|
||||
const cxxGasComp *comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
/*
|
||||
* Determine elements in gas component
|
||||
*/
|
||||
@ -351,7 +351,7 @@ calc_PR(void)
|
||||
LDBLE r3[4], r3_12, rp, rp3, rq, rz, ri, ri1, one_3 = 0.33333333333333333;
|
||||
LDBLE disct, vinit, v1, ddp, dp_dv, dp_dv2;
|
||||
int it;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
LDBLE V_m = 0, P = 0;
|
||||
|
||||
LDBLE TK = tk_x;
|
||||
@ -413,7 +413,7 @@ calc_PR(void)
|
||||
// continue;
|
||||
b_sum += phase_ptr->fraction_x * phase_ptr->pr_b;
|
||||
size_t i1;
|
||||
struct phase *phase_ptr1;
|
||||
class phase *phase_ptr1;
|
||||
for (i1 = 0; i1 < gas_unknowns.size(); i1++)
|
||||
{
|
||||
phase_ptr1 = gas_unknowns[i1]->phase;
|
||||
@ -609,8 +609,8 @@ calc_fixed_volume_gas_pressures(void)
|
||||
{
|
||||
int n_g = 0;
|
||||
LDBLE lp;
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
bool PR = false, pr_done = false;
|
||||
size_t i;
|
||||
/*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -125,7 +125,7 @@ inverse_models(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
setup_inverse(struct inverse *inv_ptr)
|
||||
setup_inverse(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -139,10 +139,10 @@ setup_inverse(struct inverse *inv_ptr)
|
||||
LDBLE isotope_number;
|
||||
LDBLE f, coef, cb, conc;
|
||||
char token[MAX_LENGTH];
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
cxxSolution *solution_ptr;
|
||||
CReaction *rxn_ptr;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Determine array sizes, row and column positions
|
||||
*/
|
||||
@ -866,7 +866,7 @@ setup_inverse(struct inverse *inv_ptr)
|
||||
std::map < std::string, cxxSolutionIsotope >::iterator kit = solution_ptr->Get_isotopes().begin();
|
||||
for ( ; kit != solution_ptr->Get_isotopes().end(); kit++)
|
||||
{
|
||||
struct master *master_kit = master_bsearch(kit->second.Get_elt_name().c_str());
|
||||
class master *master_kit = master_bsearch(kit->second.Get_elt_name().c_str());
|
||||
if (master_kit == master_ptr &&
|
||||
kit->second.Get_isotope_number() ==
|
||||
isotope_number)
|
||||
@ -988,7 +988,7 @@ setup_inverse(struct inverse *inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
solve_inverse(struct inverse *inv_ptr)
|
||||
solve_inverse(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1253,7 +1253,7 @@ solve_inverse(struct inverse *inv_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
unsigned long Phreeqc::
|
||||
minimal_solve(struct inverse *inv_ptr, unsigned long minimal_bits)
|
||||
minimal_solve(class inverse *inv_ptr, unsigned long minimal_bits)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1329,7 +1329,7 @@ minimal_solve(struct inverse *inv_ptr, unsigned long minimal_bits)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
solve_with_mask(struct inverse *inv_ptr, unsigned long cur_bits)
|
||||
solve_with_mask(class inverse *inv_ptr, unsigned long cur_bits)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1629,7 +1629,7 @@ bit_print(unsigned long bits, int l)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
print_model(struct inverse *inv_ptr)
|
||||
print_model(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1639,7 +1639,7 @@ print_model(struct inverse *inv_ptr)
|
||||
size_t column;
|
||||
int print_msg;
|
||||
cxxSolution *solution_ptr;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE d1, d2, d3, d4;
|
||||
char token[MAX_LENGTH];
|
||||
/*
|
||||
@ -1819,7 +1819,7 @@ print_model(struct inverse *inv_ptr)
|
||||
equal(min_delta[j], 0.0, toler) == TRUE &&
|
||||
equal(max_delta[j], 0.0, toler) == TRUE)
|
||||
continue;
|
||||
std::vector<struct isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
std::vector<class isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
for (size_t j = 0; j < inv_ptr->isotopes.size(); j++)
|
||||
{
|
||||
for (size_t k = 0; k < inv_ptr->phases[i].isotopes.size(); k++)
|
||||
@ -1907,7 +1907,7 @@ print_model(struct inverse *inv_ptr)
|
||||
// appt, calculate and print SI's
|
||||
LDBLE t_i, p_i, iap, lk, t;
|
||||
const char *name;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
CReaction *reaction_ptr;
|
||||
|
||||
output_msg(sformatf( "\n%-25.25s %2s %12.12s %12.12s %-18.18s (Approximate SI in solution ",
|
||||
@ -2018,7 +2018,7 @@ print_model(struct inverse *inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
punch_model_heading(struct inverse *inv_ptr)
|
||||
punch_model_heading(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2095,7 +2095,7 @@ punch_model_heading(struct inverse *inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
punch_model(struct inverse *inv_ptr)
|
||||
punch_model(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2228,7 +2228,7 @@ set_bit(unsigned long bits, int position, int value)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
next_set_phases(struct inverse *inv_ptr,
|
||||
next_set_phases(class inverse *inv_ptr,
|
||||
int first_of_model_size, int model_size)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -2295,7 +2295,7 @@ next_set_phases(struct inverse *inv_ptr,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
range(struct inverse *inv_ptr, unsigned long cur_bits)
|
||||
range(class inverse *inv_ptr, unsigned long cur_bits)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2489,7 +2489,7 @@ range(struct inverse *inv_ptr, unsigned long cur_bits)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
shrink(struct inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
shrink(class inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
int *k, int *l, int *m, int *n,
|
||||
unsigned long cur_bits,
|
||||
LDBLE * delta_l, int *col_back_l, int *row_back_l)
|
||||
@ -2759,7 +2759,7 @@ shrink(struct inverse *inv_ptr, LDBLE * array_in, LDBLE * array_out,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
check_solns(struct inverse *inv_ptr)
|
||||
check_solns(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2767,7 +2767,8 @@ check_solns(struct inverse *inv_ptr)
|
||||
* the given constraints. If not, it is an error and the program will
|
||||
* terminate.
|
||||
*/
|
||||
int i, j;
|
||||
int i;
|
||||
size_t j;
|
||||
int k, l, m, n;
|
||||
int return_value;
|
||||
unsigned long bits;
|
||||
@ -2824,7 +2825,7 @@ check_solns(struct inverse *inv_ptr)
|
||||
/*
|
||||
* Zero out mass balance rows and fraction rows
|
||||
*/
|
||||
for (size_t j = row_mb; j < row_charge; j++)
|
||||
for (j = row_mb; j < row_charge; j++)
|
||||
{
|
||||
memcpy((void *) &(array1[j * max_column_count]),
|
||||
(void *) &(inv_zero[0]),
|
||||
@ -3097,7 +3098,7 @@ test_cl1_solution(void)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
carbon_derivs(struct inverse *inv_ptr)
|
||||
carbon_derivs(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, temp;
|
||||
@ -3199,7 +3200,7 @@ carbon_derivs(struct inverse *inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
set_ph_c(struct inverse *inv_ptr,
|
||||
set_ph_c(class inverse *inv_ptr,
|
||||
int i,
|
||||
cxxSolution *solution_ptr_orig,
|
||||
int n_user_new, LDBLE d_carbon, LDBLE ph_factor, LDBLE c_factor)
|
||||
@ -3238,7 +3239,7 @@ set_ph_c(struct inverse *inv_ptr,
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
isotope_balance_equation(class inverse *inv_ptr, int row, int n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* routine fills in an isotope balance equation
|
||||
@ -3251,7 +3252,7 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
LDBLE isotope_number;
|
||||
size_t column;
|
||||
LDBLE f;
|
||||
struct master *primary_ptr;
|
||||
class master *primary_ptr;
|
||||
cxxSolution *solution_ptr;
|
||||
/*
|
||||
* Determine primary master species and isotope number for
|
||||
@ -3300,7 +3301,7 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
std::map < std::string, cxxSolutionIsotope >::iterator jit = solution_ptr->Get_isotopes().begin();
|
||||
for ( ; jit != solution_ptr->Get_isotopes().end(); jit++)
|
||||
{
|
||||
struct master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
class master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
if (primary_jit == primary_ptr &&
|
||||
jit->second.Get_isotope_number() == isotope_number)
|
||||
{
|
||||
@ -3317,8 +3318,8 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
if (primary_ptr == s_hplus->primary
|
||||
|| primary_ptr == s_h2o->primary)
|
||||
continue;
|
||||
struct master *master_jit = master_bsearch(jit->second.Get_elt_name().c_str());
|
||||
struct master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
class master *master_jit = master_bsearch(jit->second.Get_elt_name().c_str());
|
||||
class master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
if (primary_jit == primary_ptr &&
|
||||
jit->second.Get_isotope_number() == isotope_number)
|
||||
{
|
||||
@ -3338,8 +3339,8 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
jit = solution_ptr->Get_isotopes().begin();
|
||||
for ( ; jit != solution_ptr->Get_isotopes().end(); jit++)
|
||||
{
|
||||
struct master *master_jit = master_bsearch(jit->second.Get_elt_name().c_str());
|
||||
struct master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
class master *master_jit = master_bsearch(jit->second.Get_elt_name().c_str());
|
||||
class master *primary_jit = master_bsearch_primary(jit->second.Get_elt_name().c_str());
|
||||
if (primary_jit == primary_ptr &&
|
||||
jit->second.Get_isotope_number() == isotope_number)
|
||||
{
|
||||
@ -3369,7 +3370,7 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
{
|
||||
if (inv_ptr->phases[i].isotopes.size() == 0)
|
||||
continue;
|
||||
std::vector<struct isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
std::vector<class isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
for (j = 0; j < inv_ptr->phases[i].isotopes.size(); j++)
|
||||
{
|
||||
if (isotope_ref[j].primary == primary_ptr &&
|
||||
@ -3391,7 +3392,7 @@ isotope_balance_equation(struct inverse *inv_ptr, int row, int n)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
bool Phreeqc::
|
||||
set_isotope_unknowns(struct inverse* inv_ptr)
|
||||
set_isotope_unknowns(class inverse* inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -3401,9 +3402,9 @@ set_isotope_unknowns(struct inverse* inv_ptr)
|
||||
*/
|
||||
int i, k;
|
||||
LDBLE isotope_number;
|
||||
struct master* primary_ptr;
|
||||
class master* primary_ptr;
|
||||
size_t count_isotopes;
|
||||
std::vector<struct isotope>& isotopes = inv_ptr->isotope_unknowns;
|
||||
std::vector<class isotope>& isotopes = inv_ptr->isotope_unknowns;
|
||||
|
||||
if (inv_ptr->isotopes.size() == 0)
|
||||
{
|
||||
@ -3475,7 +3476,7 @@ set_isotope_unknowns(struct inverse* inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
check_isotopes(struct inverse *inv_ptr)
|
||||
check_isotopes(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -3485,9 +3486,9 @@ check_isotopes(struct inverse *inv_ptr)
|
||||
int i, ii, j, k, l;
|
||||
int err, found_isotope;
|
||||
LDBLE isotope_number;
|
||||
struct master *master_ptr, *primary_ptr;
|
||||
class master *master_ptr, *primary_ptr;
|
||||
cxxSolution *solution_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
/*
|
||||
@ -3511,7 +3512,7 @@ check_isotopes(struct inverse *inv_ptr)
|
||||
std::map < std::string, cxxSolutionIsotope >::iterator kit = solution_ptr->Get_isotopes().begin();
|
||||
for ( ; kit != solution_ptr->Get_isotopes().end(); kit++)
|
||||
{
|
||||
struct master *primary_kit = master_bsearch_primary(kit->second.Get_elt_name().c_str());
|
||||
class master *primary_kit = master_bsearch_primary(kit->second.Get_elt_name().c_str());
|
||||
if (primary_kit == primary_ptr &&
|
||||
kit->second.Get_isotope_number() ==
|
||||
isotope_number)
|
||||
@ -3550,8 +3551,8 @@ check_isotopes(struct inverse *inv_ptr)
|
||||
std::map < std::string, cxxSolutionIsotope >::iterator kit = solution_ptr->Get_isotopes().begin();
|
||||
for ( ; kit != solution_ptr->Get_isotopes().end(); kit++)
|
||||
{
|
||||
struct master *master_kit = master_bsearch(kit->second.Get_elt_name().c_str());
|
||||
struct master *primary_kit = master_bsearch_primary(kit->second.Get_elt_name().c_str());
|
||||
class master *master_kit = master_bsearch(kit->second.Get_elt_name().c_str());
|
||||
class master *primary_kit = master_bsearch_primary(kit->second.Get_elt_name().c_str());
|
||||
kit->second.Set_x_ratio_uncertainty(NAN);
|
||||
/*
|
||||
* Search for secondary or primary master in inverse uncertainties
|
||||
@ -3703,7 +3704,7 @@ check_isotopes(struct inverse *inv_ptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
phase_isotope_inequalities(struct inverse *inv_ptr)
|
||||
phase_isotope_inequalities(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t column;
|
||||
@ -3810,7 +3811,7 @@ phase_isotope_inequalities(struct inverse *inv_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
write_optimize_names(struct inverse *inv_ptr)
|
||||
write_optimize_names(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, row;
|
||||
@ -3882,7 +3883,7 @@ write_optimize_names(struct inverse *inv_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void Phreeqc::
|
||||
dump_netpath(struct inverse *inverse_ptr)
|
||||
dump_netpath(class inverse *inverse_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
std::string string;
|
||||
@ -4224,7 +4225,7 @@ print_total_multi(FILE * l_netpath_file, cxxSolution *solution_ptr,
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
dump_netpath_pat(struct inverse *inv_ptr)
|
||||
dump_netpath_pat(class inverse *inv_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -4232,7 +4233,7 @@ dump_netpath_pat(struct inverse *inv_ptr)
|
||||
*/
|
||||
int i, j, k;
|
||||
cxxSolution *solution_ptr, *solution_ptr_orig;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE d1, d2, d3;
|
||||
LDBLE sum, sum1, sum_iso, d;
|
||||
std::vector<double> array_save, l_delta_save;
|
||||
@ -4241,11 +4242,11 @@ dump_netpath_pat(struct inverse *inv_ptr)
|
||||
int temp, temp_punch;
|
||||
int solnmap[10][2];
|
||||
FILE *model_file;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
int exch;
|
||||
size_t column;
|
||||
LDBLE f;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
/*
|
||||
* print solution data, epsilons, and revised data
|
||||
*/
|
||||
@ -4932,7 +4933,7 @@ dump_netpath_pat(struct inverse *inv_ptr)
|
||||
|
||||
for (k = 0; k < inv_ptr->phases[i].isotopes.size(); k++)
|
||||
{
|
||||
std::vector<struct isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
std::vector<class isotope>& isotope_ref = inv_ptr->phases[i].isotopes;
|
||||
d1 = isotope_ref[k].ratio;
|
||||
for (j = 0; j < inv_ptr->isotopes.size(); j++)
|
||||
{
|
||||
|
||||
@ -23,9 +23,9 @@ read_isotopes(void)
|
||||
*/
|
||||
|
||||
int l;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
struct element *elt_ptr;
|
||||
class element *elt_ptr;
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
const char* next_char;
|
||||
@ -163,7 +163,7 @@ read_calculate_values(void)
|
||||
int l;
|
||||
int return_value, opt, opt_save;
|
||||
char token[MAX_LENGTH];
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
const char* next_char;
|
||||
const char *opt_list[] = {
|
||||
"start", /* 0 */
|
||||
@ -270,7 +270,7 @@ read_isotope_ratios(void)
|
||||
int l;
|
||||
int return_value, opt, opt_save;
|
||||
char token[MAX_LENGTH];
|
||||
struct isotope_ratio *isotope_ratio_ptr;
|
||||
class isotope_ratio *isotope_ratio_ptr;
|
||||
const char* next_char;
|
||||
const char *opt_list[] = {
|
||||
"no_options" /* 0 */
|
||||
@ -360,7 +360,7 @@ read_isotope_alphas(void)
|
||||
int l;
|
||||
int return_value, opt, opt_save;
|
||||
char token[MAX_LENGTH];
|
||||
struct isotope_alpha *isotope_alpha_ptr;
|
||||
class isotope_alpha *isotope_alpha_ptr;
|
||||
const char* next_char;
|
||||
const char *opt_list[] = {
|
||||
"no_options" /* 0 */
|
||||
@ -428,7 +428,7 @@ add_isotopes(cxxSolution &solution_ref)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
LDBLE total_moles;
|
||||
/*
|
||||
* zero out isotopes
|
||||
@ -481,14 +481,14 @@ add_isotopes(cxxSolution &solution_ref)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
calculate_isotope_moles(struct element *elt_ptr,
|
||||
calculate_isotope_moles(class element *elt_ptr,
|
||||
cxxSolution *solution_ptr, LDBLE total_moles)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, l_iter;
|
||||
int count_isotopes, total_is_major;
|
||||
struct master_isotope *master_isotope_ptr, *master_isotope_ptr1;
|
||||
struct master_isotope list[MAX_ELTS];
|
||||
class master_isotope *master_isotope_ptr, *master_isotope_ptr1;
|
||||
class master_isotope list[MAX_ELTS];
|
||||
LDBLE m_major, tot;
|
||||
/*
|
||||
* Get total concentration of elt_ptr
|
||||
@ -511,7 +511,7 @@ calculate_isotope_moles(struct element *elt_ptr,
|
||||
if ((master_isotope_ptr != NULL) && (master_isotope_ptr->elt == elt_ptr))
|
||||
{
|
||||
memcpy(&(list[count_isotopes]), master_isotope_ptr,
|
||||
sizeof(struct master_isotope));
|
||||
sizeof(class master_isotope));
|
||||
list[count_isotopes].ratio = 1.0;
|
||||
if (list[count_isotopes].minor_isotope == FALSE)
|
||||
{
|
||||
@ -523,7 +523,7 @@ calculate_isotope_moles(struct element *elt_ptr,
|
||||
if ((master_isotope_ptr != NULL) && (master_isotope_ptr->elt == elt_ptr))
|
||||
{
|
||||
memcpy(&(list[count_isotopes]), master_isotope_ptr,
|
||||
sizeof(struct master_isotope));
|
||||
sizeof(class master_isotope));
|
||||
list[count_isotopes].ratio = 1.0;
|
||||
if (list[count_isotopes].minor_isotope == FALSE)
|
||||
{
|
||||
@ -542,7 +542,7 @@ calculate_isotope_moles(struct element *elt_ptr,
|
||||
if (master_isotope_ptr->elt != elt_ptr)
|
||||
continue;
|
||||
memcpy(&(list[count_isotopes]), master_isotope_ptr,
|
||||
sizeof(struct master_isotope));
|
||||
sizeof(class master_isotope));
|
||||
if (list[count_isotopes].minor_isotope == FALSE)
|
||||
{
|
||||
total_is_major = list[count_isotopes].total_is_major;
|
||||
@ -624,7 +624,7 @@ calculate_isotope_moles(struct element *elt_ptr,
|
||||
if (list[i].name == master_isotope[j]->name)
|
||||
{
|
||||
memcpy(master_isotope[j], &(list[i]),
|
||||
sizeof(struct master_isotope));
|
||||
sizeof(class master_isotope));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -658,7 +658,7 @@ calculate_isotope_moles(struct element *elt_ptr,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
from_permil(struct master_isotope *master_isotope_ptr, LDBLE major_total)
|
||||
from_permil(class master_isotope *master_isotope_ptr, LDBLE major_total)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE r;
|
||||
@ -671,7 +671,7 @@ from_permil(struct master_isotope *master_isotope_ptr, LDBLE major_total)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
from_pct(struct master_isotope *master_isotope_ptr, LDBLE total_moles)
|
||||
from_pct(class master_isotope *master_isotope_ptr, LDBLE total_moles)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
master_isotope_ptr->moles =
|
||||
@ -682,7 +682,7 @@ from_pct(struct master_isotope *master_isotope_ptr, LDBLE total_moles)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
from_tu(struct master_isotope *master_isotope_ptr)
|
||||
from_tu(class master_isotope *master_isotope_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
master_isotope_ptr->moles =
|
||||
@ -693,7 +693,7 @@ from_tu(struct master_isotope *master_isotope_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
from_pcil(struct master_isotope *master_isotope_ptr)
|
||||
from_pcil(class master_isotope *master_isotope_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
master_isotope_ptr->moles =
|
||||
@ -782,8 +782,8 @@ punch_isotopes(void)
|
||||
*/
|
||||
//int i;
|
||||
LDBLE iso;
|
||||
struct isotope_ratio *isotope_ratio_ptr;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class isotope_ratio *isotope_ratio_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
|
||||
//if (punch.in == FALSE || punch.isotopes == FALSE)
|
||||
// return (OK);
|
||||
@ -842,7 +842,7 @@ punch_calculate_values(void)
|
||||
*/
|
||||
//int i;
|
||||
LDBLE result;
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
char l_command[] = "run";
|
||||
|
||||
if (current_selected_output->Get_calculate_values().size() == 0)
|
||||
@ -933,8 +933,8 @@ print_isotope_ratios(void)
|
||||
*/
|
||||
int i, j;
|
||||
int print_isotope;
|
||||
struct master *master_ptr;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class master *master_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
|
||||
@ -996,7 +996,7 @@ print_isotope_alphas(void)
|
||||
*/
|
||||
int i, j;
|
||||
int print_isotope;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
LDBLE log_alpha;
|
||||
|
||||
@ -1073,10 +1073,10 @@ calculate_values(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int j;
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
struct isotope_ratio *isotope_ratio_ptr;
|
||||
struct isotope_alpha *isotope_alpha_ptr;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
class isotope_ratio *isotope_ratio_ptr;
|
||||
class isotope_alpha *isotope_alpha_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
char l_command[] = "run";
|
||||
|
||||
|
||||
@ -1219,7 +1219,7 @@ calculate_values(void)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE Phreeqc::
|
||||
convert_isotope(struct master_isotope * master_isotope_ptr, LDBLE ratio)
|
||||
convert_isotope(class master_isotope * master_isotope_ptr, LDBLE ratio)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const char *units;
|
||||
@ -1256,7 +1256,7 @@ convert_isotope(struct master_isotope * master_isotope_ptr, LDBLE ratio)
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master_isotope * Phreeqc::
|
||||
class master_isotope * Phreeqc::
|
||||
master_isotope_store(const char *name, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1281,11 +1281,11 @@ master_isotope_store(const char *name, int replace_if_found)
|
||||
* pointer to master_isotope structure "master_isotope" where "name" can be found.
|
||||
*/
|
||||
int n;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::map<std::string, struct master_isotope*>::iterator mi_it =
|
||||
std::map<std::string, class master_isotope*>::iterator mi_it =
|
||||
master_isotope_map.find(name);
|
||||
if (mi_it != master_isotope_map.end() && replace_if_found == FALSE)
|
||||
{
|
||||
@ -1315,7 +1315,7 @@ master_isotope_store(const char *name, int replace_if_found)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master_isotope * Phreeqc::
|
||||
class master_isotope * Phreeqc::
|
||||
master_isotope_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -1324,7 +1324,7 @@ master_isotope_alloc(void)
|
||||
* return: pointer to a master_isotope structure
|
||||
*/
|
||||
{
|
||||
struct master_isotope *master_isotope_ptr = new struct master_isotope;
|
||||
class master_isotope *master_isotope_ptr = new class master_isotope;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -1335,7 +1335,7 @@ master_isotope_alloc(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
master_isotope_init(struct master_isotope *master_isotope_ptr)
|
||||
master_isotope_init(class master_isotope *master_isotope_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a master_isotope structure
|
||||
@ -1361,7 +1361,7 @@ master_isotope_init(struct master_isotope *master_isotope_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master_isotope * Phreeqc::
|
||||
class master_isotope * Phreeqc::
|
||||
master_isotope_search(const char *name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1375,11 +1375,11 @@ master_isotope_search(const char *name)
|
||||
* pointer to master_isotope structure "master_isotope" where "name" can be found.
|
||||
* or NULL if not found.
|
||||
*/
|
||||
struct master_isotope* master_isotope_ptr = NULL;
|
||||
class master_isotope* master_isotope_ptr = NULL;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::map<std::string, struct master_isotope*>::iterator mi_it =
|
||||
std::map<std::string, class master_isotope*>::iterator mi_it =
|
||||
master_isotope_map.find(name);
|
||||
if (mi_it != master_isotope_map.end())
|
||||
{
|
||||
@ -1394,7 +1394,7 @@ master_isotope_search(const char *name)
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct calculate_value * Phreeqc::
|
||||
class calculate_value * Phreeqc::
|
||||
calculate_value_store(const char *name_in, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1418,13 +1418,13 @@ calculate_value_store(const char *name_in, int replace_if_found)
|
||||
* Returns:
|
||||
* pointer to calculate_value structure "calculate_value" where "name" can be found.
|
||||
*/
|
||||
struct calculate_value *calculate_value_ptr=NULL;
|
||||
class calculate_value *calculate_value_ptr=NULL;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct calculate_value*>::iterator cv_it =
|
||||
std::map<std::string, class calculate_value*>::iterator cv_it =
|
||||
calculate_value_map.find(name);
|
||||
if (cv_it != calculate_value_map.end() && replace_if_found == FALSE)
|
||||
{
|
||||
@ -1455,7 +1455,7 @@ calculate_value_store(const char *name_in, int replace_if_found)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct calculate_value * Phreeqc::
|
||||
class calculate_value * Phreeqc::
|
||||
calculate_value_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -1464,8 +1464,8 @@ calculate_value_alloc(void)
|
||||
* return: pointer to a calculate_value structure
|
||||
*/
|
||||
{
|
||||
struct calculate_value *calculate_value_ptr =
|
||||
new struct calculate_value;
|
||||
class calculate_value *calculate_value_ptr =
|
||||
new class calculate_value;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -1476,7 +1476,7 @@ calculate_value_alloc(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
calculate_value_init(struct calculate_value *calculate_value_ptr)
|
||||
calculate_value_init(class calculate_value *calculate_value_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a calculate_value structure
|
||||
@ -1501,7 +1501,7 @@ calculate_value_init(struct calculate_value *calculate_value_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct calculate_value * Phreeqc::
|
||||
class calculate_value * Phreeqc::
|
||||
calculate_value_search(const char *name_in)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1517,7 +1517,7 @@ calculate_value_search(const char *name_in)
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct calculate_value*>::iterator cv_it =
|
||||
std::map<std::string, class calculate_value*>::iterator cv_it =
|
||||
calculate_value_map.find(name);
|
||||
if (cv_it != calculate_value_map.end())
|
||||
{
|
||||
@ -1528,7 +1528,7 @@ calculate_value_search(const char *name_in)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
calculate_value_free(struct calculate_value *calculate_value_ptr)
|
||||
calculate_value_free(class calculate_value *calculate_value_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1554,7 +1554,7 @@ calculate_value_free(struct calculate_value *calculate_value_ptr)
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_ratio * Phreeqc::
|
||||
class isotope_ratio * Phreeqc::
|
||||
isotope_ratio_store(const char *name_in, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1578,13 +1578,13 @@ isotope_ratio_store(const char *name_in, int replace_if_found)
|
||||
* Returns:
|
||||
* pointer to isotope_ratio structure "isotope_ratio" where "name" can be found.
|
||||
*/
|
||||
struct isotope_ratio *isotope_ratio_ptr;
|
||||
class isotope_ratio *isotope_ratio_ptr;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct isotope_ratio*>::iterator it =
|
||||
std::map<std::string, class isotope_ratio*>::iterator it =
|
||||
isotope_ratio_map.find(name);
|
||||
|
||||
if (it != isotope_ratio_map.end() && replace_if_found == FALSE)
|
||||
@ -1615,7 +1615,7 @@ isotope_ratio_store(const char *name_in, int replace_if_found)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_ratio * Phreeqc::
|
||||
class isotope_ratio * Phreeqc::
|
||||
isotope_ratio_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -1624,8 +1624,8 @@ isotope_ratio_alloc(void)
|
||||
* return: pointer to a isotope_ratio structure
|
||||
*/
|
||||
{
|
||||
struct isotope_ratio* isotope_ratio_ptr =
|
||||
new struct isotope_ratio;
|
||||
class isotope_ratio* isotope_ratio_ptr =
|
||||
new class isotope_ratio;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -1636,7 +1636,7 @@ isotope_ratio_alloc(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
isotope_ratio_init(struct isotope_ratio *isotope_ratio_ptr)
|
||||
isotope_ratio_init(class isotope_ratio *isotope_ratio_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a isotope_ratio structure
|
||||
@ -1657,7 +1657,7 @@ isotope_ratio_init(struct isotope_ratio *isotope_ratio_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_ratio * Phreeqc::
|
||||
class isotope_ratio * Phreeqc::
|
||||
isotope_ratio_search(const char *name_in)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1673,7 +1673,7 @@ isotope_ratio_search(const char *name_in)
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct isotope_ratio*>::iterator it =
|
||||
std::map<std::string, class isotope_ratio*>::iterator it =
|
||||
isotope_ratio_map.find(name);
|
||||
|
||||
if (it != isotope_ratio_map.end())
|
||||
@ -1688,7 +1688,7 @@ isotope_ratio_search(const char *name_in)
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_alpha * Phreeqc::
|
||||
class isotope_alpha * Phreeqc::
|
||||
isotope_alpha_store(const char *name_in, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1712,10 +1712,10 @@ isotope_alpha_store(const char *name_in, int replace_if_found)
|
||||
* Returns:
|
||||
* pointer to isotope_alpha structure "isotope_alpha" where "name" can be found.
|
||||
*/
|
||||
struct isotope_alpha *isotope_alpha_ptr;
|
||||
class isotope_alpha *isotope_alpha_ptr;
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct isotope_alpha*>::iterator it =
|
||||
std::map<std::string, class isotope_alpha*>::iterator it =
|
||||
isotope_alpha_map.find(name);
|
||||
|
||||
if (it != isotope_alpha_map.end() && replace_if_found == FALSE)
|
||||
@ -1745,7 +1745,7 @@ isotope_alpha_store(const char *name_in, int replace_if_found)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_alpha * Phreeqc::
|
||||
class isotope_alpha * Phreeqc::
|
||||
isotope_alpha_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -1754,8 +1754,8 @@ isotope_alpha_alloc(void)
|
||||
* return: pointer to a isotope_alpha structure
|
||||
*/
|
||||
{
|
||||
struct isotope_alpha* isotope_alpha_ptr =
|
||||
new struct isotope_alpha;
|
||||
class isotope_alpha* isotope_alpha_ptr =
|
||||
new class isotope_alpha;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -1766,7 +1766,7 @@ isotope_alpha_alloc(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
isotope_alpha_init(struct isotope_alpha *isotope_alpha_ptr)
|
||||
isotope_alpha_init(class isotope_alpha *isotope_alpha_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a isotope_alpha structure
|
||||
@ -1786,7 +1786,7 @@ isotope_alpha_init(struct isotope_alpha *isotope_alpha_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct isotope_alpha * Phreeqc::
|
||||
class isotope_alpha * Phreeqc::
|
||||
isotope_alpha_search(const char *name_in)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1802,7 +1802,7 @@ isotope_alpha_search(const char *name_in)
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct isotope_alpha*>::iterator it =
|
||||
std::map<std::string, class isotope_alpha*>::iterator it =
|
||||
isotope_alpha_map.find(name);
|
||||
|
||||
if (it != isotope_alpha_map.end())
|
||||
|
||||
@ -53,7 +53,7 @@ calc_kinetic_reaction(cxxKinetics *kinetics_ptr, LDBLE time_step)
|
||||
int j, return_value;
|
||||
LDBLE coef;
|
||||
char l_command[] = "run";
|
||||
struct rate *rate_ptr;
|
||||
class rate *rate_ptr;
|
||||
/*
|
||||
* Go through list and generate list of elements and
|
||||
* coefficient of elements in reaction
|
||||
@ -145,8 +145,8 @@ calc_final_kinetic_reaction(cxxKinetics *kinetics_ptr)
|
||||
* stored in moles in run_kinetics
|
||||
*/
|
||||
LDBLE coef;
|
||||
struct phase *phase_ptr;
|
||||
struct master *master_ptr;
|
||||
class phase *phase_ptr;
|
||||
class master *master_ptr;
|
||||
int count= 0;
|
||||
/*
|
||||
* Go through list and generate list of elements and
|
||||
|
||||
@ -39,7 +39,7 @@ initialize(void)
|
||||
// one stag_data in phreeqc.h, initialized in global_structures
|
||||
|
||||
// user_print
|
||||
user_print = new struct rate;
|
||||
user_print = new class rate;
|
||||
user_print->name = string_hsave("User_print");
|
||||
user_print->commands.clear();
|
||||
user_print->linebase = NULL;
|
||||
@ -556,8 +556,8 @@ initial_gas_phases(int print)
|
||||
int converge, converge1;
|
||||
int last, n_user, print1;
|
||||
char token[2 * MAX_LENGTH];
|
||||
struct phase *phase_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
LDBLE lp;
|
||||
bool PR = false;
|
||||
|
||||
@ -759,7 +759,7 @@ reactions(void)
|
||||
*/
|
||||
int count_steps, use_mix;
|
||||
char token[2 * MAX_LENGTH];
|
||||
struct save save_data;
|
||||
class save save_data;
|
||||
LDBLE kin_time;
|
||||
cxxKinetics *kinetics_ptr;
|
||||
|
||||
@ -803,7 +803,7 @@ reactions(void)
|
||||
/*
|
||||
* save data for saving solutions
|
||||
*/
|
||||
memcpy(&save_data, &save, sizeof(struct save));
|
||||
memcpy(&save_data, &save, sizeof(class save));
|
||||
/*
|
||||
*Copy everything to -2
|
||||
*/
|
||||
@ -866,7 +866,7 @@ reactions(void)
|
||||
/*
|
||||
* save end of reaction
|
||||
*/
|
||||
memcpy(&save, &save_data, sizeof(struct save));
|
||||
memcpy(&save, &save_data, sizeof(class save));
|
||||
if (use.Get_kinetics_in() == TRUE)
|
||||
{
|
||||
Utilities::Rxn_copy(Rxn_kinetics_map, -2, use.Get_n_kinetics_user());
|
||||
@ -890,7 +890,7 @@ reactions(void)
|
||||
// {
|
||||
// cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
// int k;
|
||||
// struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
// class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
// assert(phase_ptr);
|
||||
// phase_ptr->pr_in = false;
|
||||
// }
|
||||
@ -1106,7 +1106,7 @@ xgas_save(int n_user)
|
||||
{
|
||||
cxxGasComp* gc_ptr = &(temp_gas_phase.Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase* phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase* phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
assert(phase_ptr);
|
||||
if (PR)
|
||||
{
|
||||
@ -1224,7 +1224,7 @@ xsolution_save(int n_user)
|
||||
*
|
||||
* input: n_user is user solution number of target
|
||||
*/
|
||||
struct master *master_i_ptr, *master_ptr;
|
||||
class master *master_i_ptr, *master_ptr;
|
||||
/*
|
||||
* Malloc space for solution data
|
||||
*/
|
||||
@ -1341,7 +1341,7 @@ xsolution_save(int n_user)
|
||||
std::map< std::string, cxxSolutionIsotope >::iterator it;
|
||||
for (it = temp_solution.Get_isotopes().begin(); it != temp_solution.Get_isotopes().end(); it++)
|
||||
{
|
||||
struct master *iso_master_ptr = master_bsearch(it->second.Get_elt_name().c_str());
|
||||
class master *iso_master_ptr = master_bsearch(it->second.Get_elt_name().c_str());
|
||||
if (iso_master_ptr != NULL)
|
||||
{
|
||||
it->second.Set_total(iso_master_ptr->total);
|
||||
|
||||
@ -869,7 +869,7 @@ int Phreeqc::gammas_a_f(int i1)
|
||||
LDBLE d2, d3, sum = 0;
|
||||
//char name[MAX_LENGTH];
|
||||
std::string name;
|
||||
//struct master *m_ptr;
|
||||
//class master *m_ptr;
|
||||
|
||||
i = i1;
|
||||
for (j = 1; s_x[i]->rxn_x.token[j].s != NULL; j++)
|
||||
@ -2171,7 +2171,7 @@ mb_ss(void)
|
||||
LDBLE iapc, iapb, l_kc, l_kb, lc, lb, xcaq, xbaq, xb, xc;
|
||||
LDBLE sigmapi_aq, sigmapi_solid;
|
||||
LDBLE total_p;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
/*
|
||||
* Determines whether solid solution equation is needed
|
||||
*/
|
||||
@ -2186,7 +2186,7 @@ mb_ss(void)
|
||||
for (size_t j = 0; j < ss_ptr->Get_ss_comps().size(); j++)
|
||||
{
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[j].Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[j].Get_name().c_str(), &l, FALSE);
|
||||
if (phase_ptr->in == FALSE)
|
||||
{
|
||||
continue;
|
||||
@ -2202,8 +2202,8 @@ mb_ss(void)
|
||||
else if (ss_ptr->Get_a0() != 0.0 || ss_ptr->Get_a1() != 0.0)
|
||||
{
|
||||
int l;
|
||||
struct phase *phase0_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[0].Get_name().c_str(), &l, FALSE);
|
||||
struct phase *phase1_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[1].Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase0_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[0].Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase1_ptr = phase_bsearch(ss_ptr->Get_ss_comps()[1].Get_name().c_str(), &l, FALSE);
|
||||
/*
|
||||
* Calculate IAPc and IAPb
|
||||
*/
|
||||
@ -2285,7 +2285,7 @@ mb_ss(void)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[j]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
if (phase_ptr->in == TRUE)
|
||||
{
|
||||
lp = -phase_ptr->lk;
|
||||
@ -2332,7 +2332,7 @@ molalities(int allow_overflow)
|
||||
*/
|
||||
int i, j;
|
||||
LDBLE total_g;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
/*
|
||||
* la for master species
|
||||
*/
|
||||
@ -2413,7 +2413,7 @@ molalities(int allow_overflow)
|
||||
calc_all_donnan();
|
||||
}
|
||||
|
||||
struct species *s_ptr = NULL;
|
||||
class species *s_ptr = NULL;
|
||||
for (i = 0; i < (int)this->s_x.size(); i++)
|
||||
{
|
||||
s_ptr = s_x[i];
|
||||
@ -2537,8 +2537,8 @@ calc_gas_pressures(void)
|
||||
{
|
||||
int n_g = 0;
|
||||
LDBLE lp, V_m = 0;
|
||||
struct rxn_token *rxn_ptr;
|
||||
std::vector<struct phase *> phase_ptrs;
|
||||
class rxn_token *rxn_ptr;
|
||||
std::vector<class phase *> phase_ptrs;
|
||||
bool PR = false, pr_done = false;
|
||||
/*
|
||||
* moles and partial pressures for gases
|
||||
@ -2562,7 +2562,7 @@ calc_gas_pressures(void)
|
||||
{
|
||||
const cxxGasComp * gas_comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(gas_comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gas_comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||
if (phase_ptr->in == TRUE)
|
||||
{
|
||||
phase_ptrs.push_back(phase_ptr);
|
||||
@ -2631,7 +2631,7 @@ calc_gas_pressures(void)
|
||||
{
|
||||
const cxxGasComp *gas_comp = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(gas_comp->Get_phase_name().c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gas_comp->Get_phase_name().c_str(), &j, FALSE);
|
||||
if (phase_ptr->in == TRUE)
|
||||
{
|
||||
lp = -phase_ptr->lk;
|
||||
@ -2693,7 +2693,7 @@ calc_gas_pressures(void)
|
||||
{
|
||||
const cxxGasComp *gas_comp = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int j;
|
||||
struct phase *phase_ptr = phase_bsearch(gas_comp->Get_phase_name().c_str(), &j, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gas_comp->Get_phase_name().c_str(), &j, FALSE);
|
||||
if (phase_ptr->in == TRUE)
|
||||
{
|
||||
phase_ptr->moles_x *= MAX_P_NONLLNL / gas_phase_ptr->Get_total_p();
|
||||
@ -2744,7 +2744,7 @@ calc_ss_fractions(void)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
moles = comp_ptr->Get_moles();
|
||||
if (moles < 0)
|
||||
{
|
||||
@ -2789,8 +2789,8 @@ ss_binary(cxxSS *ss_ptr)
|
||||
cxxSScomp *comp0_ptr = &(ss_ptr->Get_ss_comps()[0]);
|
||||
cxxSScomp *comp1_ptr = &(ss_ptr->Get_ss_comps()[1]);
|
||||
int l;
|
||||
struct phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &l, FALSE);
|
||||
struct phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &l, FALSE);
|
||||
|
||||
nc = comp0_ptr->Get_moles();
|
||||
xc = nc / n_tot;
|
||||
@ -2920,7 +2920,7 @@ ss_ideal(cxxSS *ss_ptr)
|
||||
{
|
||||
cxxSScomp *compk_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phasek_ptr = phase_bsearch(compk_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phasek_ptr = phase_bsearch(compk_ptr->Get_name().c_str(), &l, FALSE);
|
||||
n_tot1 = 0;
|
||||
for (size_t j = 0; j < ss_ptr->Get_ss_comps().size(); j++)
|
||||
{
|
||||
@ -3774,7 +3774,7 @@ residuals(void)
|
||||
LDBLE sum_residual;
|
||||
LDBLE sinh_constant;
|
||||
LDBLE sum, sum1;
|
||||
struct master *master_ptr, *master_ptr1, *master_ptr2;
|
||||
class master *master_ptr, *master_ptr1, *master_ptr2;
|
||||
LDBLE sigmaddl, negfpsirt;
|
||||
int print_fail;
|
||||
std::vector<LDBLE> cd_psi;
|
||||
@ -4877,7 +4877,7 @@ sum_species(void)
|
||||
* Sums total valence states and stores in master[i]->total.
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Set global variables
|
||||
*/
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
parse_eq(char* eqn, std::vector<struct elt_list>& new_elt_list, int association)
|
||||
parse_eq(char* eqn, std::vector<class elt_list>& new_elt_list, int association)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* function to break equation up into component species
|
||||
|
||||
@ -46,8 +46,8 @@ pitzer_tidy(void)
|
||||
int i0, i1, i2;
|
||||
int count_pos, count_neg, count_neut, count[3], jj;
|
||||
LDBLE z0, z1;
|
||||
struct pitz_param *pzp_ptr;
|
||||
struct theta_param *theta_param_ptr;
|
||||
class pitz_param *pzp_ptr;
|
||||
class theta_param *theta_param_ptr;
|
||||
/*
|
||||
* Ensure new parameters are calculated
|
||||
*/
|
||||
@ -310,7 +310,7 @@ pitzer_tidy(void)
|
||||
{
|
||||
size_t count_theta_param = theta_params.size();
|
||||
theta_params.resize(count_theta_param + 1);
|
||||
theta_params[count_theta_param] = new struct theta_param;
|
||||
theta_params[count_theta_param] = new class theta_param;
|
||||
theta_params[count_theta_param]->zj = z0;
|
||||
theta_params[count_theta_param]->zk = z1;
|
||||
theta_param_ptr = theta_params[count_theta_param];
|
||||
@ -564,7 +564,7 @@ read_pitzer(void)
|
||||
* number of shifts;
|
||||
*/
|
||||
int n;
|
||||
struct pitz_param *pzp_ptr;
|
||||
class pitz_param *pzp_ptr;
|
||||
pitz_param_type pzp_type;
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
@ -773,7 +773,7 @@ C
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
calc_pitz_param(struct pitz_param *pz_ptr, LDBLE TK, LDBLE TR)
|
||||
calc_pitz_param(class pitz_param *pz_ptr, LDBLE TK, LDBLE TR)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE param;
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* ********************************************************************** */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct pitz_param * Phreeqc::
|
||||
class pitz_param * Phreeqc::
|
||||
pitz_param_read(char *string, int n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -23,7 +23,7 @@ pitz_param_read(char *string, int n)
|
||||
int l, i, j, k;
|
||||
const char* cptr;
|
||||
char token[2 * MAX_LENGTH];
|
||||
struct pitz_param pzp, *pzp_ptr;
|
||||
class pitz_param pzp, *pzp_ptr;
|
||||
|
||||
if (n != 2 && n != 3 && n != 0)
|
||||
return (NULL);
|
||||
@ -60,13 +60,13 @@ pitz_param_read(char *string, int n)
|
||||
}
|
||||
if (k <= 0)
|
||||
return (NULL);
|
||||
pzp_ptr = new struct pitz_param;
|
||||
pzp_ptr = new class pitz_param;
|
||||
*pzp_ptr = pzp;
|
||||
return (pzp_ptr);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void Phreeqc::
|
||||
pitz_param_store(const struct pitz_param *pzp_ptr)
|
||||
pitz_param_store(const class pitz_param *pzp_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -78,7 +78,7 @@ pitz_param_store(const struct pitz_param *pzp_ptr)
|
||||
return;
|
||||
if (pzp_ptr->type == TYPE_Other)
|
||||
return;
|
||||
struct pitz_param* dest = pitz_param_copy(pzp_ptr);
|
||||
class pitz_param* dest = pitz_param_copy(pzp_ptr);
|
||||
std::set< std::string > header;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
@ -121,7 +121,7 @@ pitz_param_store(const struct pitz_param *pzp_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void Phreeqc::
|
||||
sit_param_store(const struct pitz_param *pzp_ptr)
|
||||
sit_param_store(const class pitz_param *pzp_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -133,7 +133,7 @@ sit_param_store(const struct pitz_param *pzp_ptr)
|
||||
return;
|
||||
if (pzp_ptr->type == TYPE_Other)
|
||||
return;
|
||||
struct pitz_param* dest = pitz_param_copy(pzp_ptr);
|
||||
class pitz_param* dest = pitz_param_copy(pzp_ptr);
|
||||
|
||||
std::set< std::string > header;
|
||||
for (i = 0; i < 3; i++)
|
||||
@ -175,11 +175,11 @@ sit_param_store(const struct pitz_param *pzp_ptr)
|
||||
sit_param_map[key] = count_sit_param;
|
||||
}
|
||||
}
|
||||
struct pitz_param* Phreeqc::
|
||||
pitz_param_copy(const struct pitz_param* src)
|
||||
class pitz_param* Phreeqc::
|
||||
pitz_param_copy(const class pitz_param* src)
|
||||
{
|
||||
if (src == NULL) return NULL;
|
||||
struct pitz_param* dest = new struct pitz_param;
|
||||
class pitz_param* dest = new class pitz_param;
|
||||
*dest = *src;
|
||||
for (size_t i = 0; i < 3; i++)
|
||||
{
|
||||
@ -198,7 +198,7 @@ pitz_param_copy(const struct pitz_param* src)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct theta_param * Phreeqc::
|
||||
class theta_param * Phreeqc::
|
||||
theta_param_search(LDBLE zj, LDBLE zk)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
|
||||
@ -19,7 +19,7 @@ prep(void)
|
||||
* Input is model defined by the structure use.
|
||||
* Most of routine is skipped if model, as defined by master.total
|
||||
* plus use.pure_phases, is same as previous calculation.
|
||||
* Routine sets up struct unknown for each unknown.
|
||||
* Routine sets up class unknown for each unknown.
|
||||
* Determines elements, species, and phases that are in the model.
|
||||
* Calculates mass-action equations for each species and phase.
|
||||
* Routine builds a set of lists for calculating mass balance and
|
||||
@ -322,8 +322,8 @@ quick_setup(void)
|
||||
cxxNameDouble::iterator lit;
|
||||
for (lit = comp_ptr->Get_totals().begin(); lit != comp_ptr->Get_totals().end(); lit++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(lit->first.c_str());
|
||||
struct master *master_ptr = elt_ptr->master;
|
||||
class element *elt_ptr = element_store(lit->first.c_str());
|
||||
class master *master_ptr = elt_ptr->master;
|
||||
if (master_ptr->type != SURF)
|
||||
continue;
|
||||
if (strcmp_nocase(x[i]->description, lit->first.c_str()) == 0)
|
||||
@ -355,9 +355,9 @@ build_gas_phase(void)
|
||||
* mass balance equations for elements contained in gases
|
||||
*/
|
||||
size_t row, col;
|
||||
struct master *master_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
LDBLE coef, coef_elt;
|
||||
|
||||
if (gas_unknown == NULL)
|
||||
@ -373,7 +373,7 @@ build_gas_phase(void)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
assert(phase_ptr);
|
||||
/*
|
||||
* Determine elements in gas component
|
||||
@ -631,8 +631,8 @@ build_ss_assemblage(void)
|
||||
*/
|
||||
bool stop;
|
||||
size_t row, col;
|
||||
struct master *master_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
const char* cptr;
|
||||
|
||||
if (ss_unknown == NULL)
|
||||
@ -1315,7 +1315,7 @@ build_model(void)
|
||||
* Sort species list, by master only
|
||||
*/
|
||||
if (species_list.size() > 1) qsort(&species_list[0], species_list.size(),
|
||||
sizeof(struct species_list), species_list_compare_master);
|
||||
sizeof(class species_list), species_list_compare_master);
|
||||
/*
|
||||
* Save model description
|
||||
*/
|
||||
@ -1339,8 +1339,8 @@ build_pure_phases(void)
|
||||
bool stop;
|
||||
std::string token;
|
||||
const char* cptr;
|
||||
struct master *master_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
/*
|
||||
* Build into sums the logic to calculate inverse saturation indices for
|
||||
* pure phases
|
||||
@ -1516,8 +1516,8 @@ build_solution_phase_boundaries(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
/*
|
||||
* Build into sums the logic to calculate inverse saturation indices for
|
||||
* solution phase boundaries
|
||||
@ -1590,7 +1590,7 @@ build_species_list(int n)
|
||||
* printing results.
|
||||
*/
|
||||
int j;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Treat species made only with H+, e-, and H2O specially
|
||||
*/
|
||||
@ -1779,7 +1779,7 @@ convert_units(cxxSolution *solution_ptr)
|
||||
* Uses totals.input conc to calculate totals.moles.
|
||||
*/
|
||||
LDBLE sum_solutes;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
std::string token;
|
||||
if (!solution_ptr->Get_new_def() || !solution_ptr->Get_initial_data())
|
||||
{
|
||||
@ -1944,8 +1944,8 @@ convert_units(cxxSolution *solution_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
std::vector<struct master *> Phreeqc::
|
||||
get_list_master_ptrs(const char* cptr, struct master *master_ptr)
|
||||
std::vector<class master *> Phreeqc::
|
||||
get_list_master_ptrs(const char* cptr, class master *master_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1955,8 +1955,8 @@ get_list_master_ptrs(const char* cptr, struct master *master_ptr)
|
||||
*/
|
||||
int j, l, count_list;
|
||||
char token[MAX_LENGTH];
|
||||
std::vector<struct master*> master_ptr_list;
|
||||
struct master *master_ptr0;
|
||||
std::vector<class master*> master_ptr_list;
|
||||
class master *master_ptr0;
|
||||
/*
|
||||
* Make list of master species pointers
|
||||
*/
|
||||
@ -2029,7 +2029,7 @@ inout(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct rxn_token_temp *token_ptr;
|
||||
class rxn_token_temp *token_ptr;
|
||||
/*
|
||||
* Routine goes through trxn to determine if each master species is
|
||||
* in this model.
|
||||
@ -2059,7 +2059,7 @@ inout(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
is_special(struct species *l_spec)
|
||||
is_special(class species *l_spec)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2068,7 +2068,7 @@ is_special(struct species *l_spec)
|
||||
* FALSE if not
|
||||
*/
|
||||
int special;
|
||||
struct rxn_token *token_ptr;
|
||||
class rxn_token *token_ptr;
|
||||
|
||||
special = TRUE;
|
||||
for (token_ptr = &l_spec->rxn_s.token[0] + 1; token_ptr->s != NULL;
|
||||
@ -2086,7 +2086,7 @@ is_special(struct species *l_spec)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
store_mb_unknowns(struct unknown *unknown_ptr, LDBLE * LDBLE_ptr, LDBLE coef,
|
||||
store_mb_unknowns(class unknown *unknown_ptr, LDBLE * LDBLE_ptr, LDBLE coef,
|
||||
LDBLE * gamma_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -2121,8 +2121,8 @@ mb_for_species_aq(int n)
|
||||
* mb_unknowns.coef - coefficient of s[n] in equation or relation
|
||||
*/
|
||||
int i, j;
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
|
||||
mb_unknowns.clear();
|
||||
/*
|
||||
@ -2286,7 +2286,7 @@ mb_for_species_ex(int n)
|
||||
* mb_unknowns.coef - coefficient of s[n] in equation or relation
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
mb_unknowns.clear();
|
||||
/*
|
||||
@ -2376,7 +2376,7 @@ mb_for_species_surf(int n)
|
||||
* mb_unknowns.coef - coefficient of s[n] in equation or relation
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
mb_unknowns.clear();
|
||||
/*
|
||||
@ -2548,7 +2548,7 @@ resetup_master(void)
|
||||
* and special cases for alkalinity, carbon, and pH.
|
||||
*/
|
||||
int i, j;
|
||||
struct master *master_ptr, *master_ptr0;
|
||||
class master *master_ptr, *master_ptr0;
|
||||
|
||||
for (i = 0; i < count_unknowns; i++)
|
||||
{
|
||||
@ -2676,8 +2676,8 @@ add_potential_factor(void)
|
||||
int i;
|
||||
std::string token;
|
||||
LDBLE sum_z;
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
{
|
||||
@ -2776,8 +2776,8 @@ add_cd_music_factors(int n)
|
||||
*/
|
||||
int i;
|
||||
std::string token;
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -2904,8 +2904,8 @@ add_surface_charge_balance(void)
|
||||
const char* cptr;
|
||||
std::string token;
|
||||
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -2971,8 +2971,8 @@ add_cd_music_charge_balances(int n)
|
||||
int i;
|
||||
std::string token;
|
||||
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3048,8 +3048,8 @@ add_cd_music_charge_balances(int n)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
rewrite_master_to_secondary(struct master *master_ptr1,
|
||||
struct master *master_ptr2)
|
||||
rewrite_master_to_secondary(class master *master_ptr1,
|
||||
class master *master_ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -3057,7 +3057,7 @@ rewrite_master_to_secondary(struct master *master_ptr1,
|
||||
* Store result in rxn_secondary of master_ptr.
|
||||
*/
|
||||
LDBLE coef1, coef2;
|
||||
struct master *master_ptr_p1, *master_ptr_p2;
|
||||
class master *master_ptr_p1, *master_ptr_p2;
|
||||
/*
|
||||
* Check that the two master species have the same primary master species
|
||||
*/
|
||||
@ -3102,8 +3102,8 @@ setup_exchange(void)
|
||||
/*
|
||||
* Fill in data for exchanger in unknowns structures
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
std::vector<struct master*> master_ptr_list;
|
||||
class master *master_ptr;
|
||||
std::vector<class master*> master_ptr_list;
|
||||
|
||||
if (use.Get_exchange_ptr() == NULL)
|
||||
return (OK);
|
||||
@ -3232,7 +3232,7 @@ setup_ss_assemblage(void)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptrs[j]->Get_ss_comps()[i]);
|
||||
int l;
|
||||
struct phase* phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase* phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
x[count_unknowns]->type = SS_MOLES;
|
||||
x[count_unknowns]->description = string_hsave(comp_ptr->Get_name().c_str());
|
||||
x[count_unknowns]->moles = 0.0;
|
||||
@ -3270,7 +3270,7 @@ setup_surface(void)
|
||||
/*
|
||||
* Fill in data for surface assemblage in unknown structure
|
||||
*/
|
||||
std::vector<struct master*> master_ptr_list;
|
||||
std::vector<class master*> master_ptr_list;
|
||||
size_t mb_unknown_number;
|
||||
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
@ -3285,8 +3285,8 @@ setup_surface(void)
|
||||
cxxNameDouble::iterator jit;
|
||||
for (jit = comp_ptr->Get_totals().begin(); jit != comp_ptr->Get_totals().end(); jit++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(jit->first.c_str());
|
||||
struct master *master_ptr = elt_ptr->master;
|
||||
class element *elt_ptr = element_store(jit->first.c_str());
|
||||
class master *master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
error_string = sformatf(
|
||||
@ -3336,7 +3336,7 @@ setup_surface(void)
|
||||
* Setup surface-potential unknown
|
||||
*/
|
||||
std::string token = master_ptr->elt->name;
|
||||
struct unknown *unknown_ptr = find_surface_charge_unknown(token, SURF_PSI);
|
||||
class unknown *unknown_ptr = find_surface_charge_unknown(token, SURF_PSI);
|
||||
if (unknown_ptr != NULL)
|
||||
{
|
||||
x[count_unknowns - 1]->potential_unknown = unknown_ptr;
|
||||
@ -3389,7 +3389,7 @@ setup_surface(void)
|
||||
{
|
||||
std::string cb_suffix("_CB");
|
||||
std::string psi_suffix("_psi");
|
||||
struct unknown **unknown_target;
|
||||
class unknown **unknown_target;
|
||||
unknown_target = NULL;
|
||||
int type = SURFACE_CB;
|
||||
switch (plane)
|
||||
@ -3412,7 +3412,7 @@ setup_surface(void)
|
||||
unknown_target = &(x[mb_unknown_number]->potential_unknown2);
|
||||
break;
|
||||
}
|
||||
struct unknown *unknown_ptr = find_surface_charge_unknown(token, plane);
|
||||
class unknown *unknown_ptr = find_surface_charge_unknown(token, plane);
|
||||
if (unknown_ptr != NULL)
|
||||
{
|
||||
*unknown_target = unknown_ptr;
|
||||
@ -3469,7 +3469,7 @@ setup_surface(void)
|
||||
}
|
||||
}
|
||||
/* Add SURFACE unknown to a list for SURF_PSI */
|
||||
struct unknown *unknown_ptr = find_surface_charge_unknown(token, SURF_PSI);
|
||||
class unknown *unknown_ptr = find_surface_charge_unknown(token, SURF_PSI);
|
||||
unknown_ptr->comp_unknowns.push_back(x[mb_unknown_number]);
|
||||
|
||||
}
|
||||
@ -3604,7 +3604,7 @@ setup_surface(void)
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct unknown * Phreeqc::
|
||||
class unknown * Phreeqc::
|
||||
find_surface_charge_unknown(std::string &str, int plane)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -3642,14 +3642,14 @@ find_surface_charge_unknown(std::string &str, int plane)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
setup_master_rxn(const std::vector<struct master *> &master_ptr_list, const std::string &pe_rxn)
|
||||
setup_master_rxn(const std::vector<class master *> &master_ptr_list, const std::string &pe_rxn)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
* Rewrites rxn_secondary for all redox states in list
|
||||
* First, in = TRUE; others, in = REWRITE
|
||||
*/
|
||||
struct master *master_ptr, *master_ptr0;
|
||||
class master *master_ptr, *master_ptr0;
|
||||
/*
|
||||
* Set master_ptr->in, master_ptr->rxn
|
||||
*/
|
||||
@ -3707,7 +3707,7 @@ setup_master_rxn(const std::vector<struct master *> &master_ptr_list, const std:
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE Phreeqc::
|
||||
calc_PR(std::vector<struct phase *> phase_ptrs, LDBLE P, LDBLE TK, LDBLE V_m)
|
||||
calc_PR(std::vector<class phase *> phase_ptrs, LDBLE P, LDBLE TK, LDBLE V_m)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Calculate fugacity and fugacity coefficient for gas pressures if critical T and P
|
||||
are defined.
|
||||
@ -3741,7 +3741,7 @@ calc_PR(std::vector<struct phase *> phase_ptrs, LDBLE P, LDBLE TK, LDBLE V_m)
|
||||
LDBLE r3[4], r3_12, rp, rp3, rq, rz, ri, ri1, one_3 = 0.33333333333333333;
|
||||
LDBLE disct, vinit, v1, ddp, dp_dv, dp_dv2;
|
||||
int it;
|
||||
struct phase *phase_ptr, *phase_ptr1;
|
||||
class phase *phase_ptr, *phase_ptr1;
|
||||
cxxGasPhase * gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||
bool halved;
|
||||
R_TK = R * TK;
|
||||
@ -4045,7 +4045,7 @@ setup_pure_phases(void)
|
||||
{
|
||||
cxxPPassemblageComp * comp_ptr = &(it->second);
|
||||
int j;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
assert(phase_ptr);
|
||||
x[count_unknowns]->type = PP;
|
||||
x[count_unknowns]->description = string_hsave(comp_ptr->Get_name().c_str());
|
||||
@ -4072,7 +4072,7 @@ adjust_setup_pure_phases(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
LDBLE si_org, p, t;
|
||||
/*
|
||||
* Fills in data for pure_phase assemglage in unknown structure
|
||||
@ -4085,7 +4085,7 @@ adjust_setup_pure_phases(void)
|
||||
*/
|
||||
for (i = 0; i < count_unknowns; i++)
|
||||
{
|
||||
std::vector<struct phase *> phase_ptrs;
|
||||
std::vector<class phase *> phase_ptrs;
|
||||
if (x[i]->type == PP)
|
||||
{
|
||||
phase_ptr = x[i]->phase;
|
||||
@ -4118,12 +4118,12 @@ setup_solution(void)
|
||||
/*
|
||||
* Fills in data in unknown structure for the solution
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
cxxSolution *solution_ptr;
|
||||
const char* cptr;
|
||||
std::string token;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
class phase *phase_ptr;
|
||||
|
||||
solution_ptr = use.Get_solution_ptr();
|
||||
count_unknowns = 0;
|
||||
@ -4476,12 +4476,12 @@ adjust_setup_solution(void)
|
||||
* Fills in data in unknown structure for the solution
|
||||
*/
|
||||
int i;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
LDBLE p, t;
|
||||
|
||||
for (i = 0; i < count_unknowns; i++)
|
||||
{
|
||||
std::vector<struct phase *> phase_ptrs;
|
||||
std::vector<class phase *> phase_ptrs;
|
||||
if (x[i]->type == SOLUTION_PHASE_BOUNDARY)
|
||||
{
|
||||
x[count_unknowns]->type = SOLUTION_PHASE_BOUNDARY;
|
||||
@ -4631,7 +4631,7 @@ setup_unknowns(void)
|
||||
x.resize(max_unknowns);
|
||||
for (i = 0; i < max_unknowns; i++)
|
||||
{
|
||||
x[i] = (struct unknown *) unknown_alloc();
|
||||
x[i] = (class unknown *) unknown_alloc();
|
||||
x[i]->number = i;
|
||||
}
|
||||
return (OK);
|
||||
@ -4648,8 +4648,8 @@ store_dn(int k, LDBLE * source, int row, LDBLE coef_in, LDBLE * gamma_source)
|
||||
*/
|
||||
size_t col;
|
||||
LDBLE coef;
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct master *master_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (equal(coef_in, 0.0, TOL) == TRUE)
|
||||
{
|
||||
@ -4833,7 +4833,7 @@ switch_bases(void)
|
||||
int first;
|
||||
int return_value;
|
||||
LDBLE la, la1;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
return_value = FALSE;
|
||||
for (i = 0; i < count_unknowns; i++)
|
||||
@ -4889,7 +4889,7 @@ tidy_redox(void)
|
||||
*
|
||||
*/
|
||||
std::string token, tok1, tok2;
|
||||
struct master *master_ptr1, *master_ptr2;
|
||||
class master *master_ptr1, *master_ptr2;
|
||||
/*
|
||||
* Keep valences of oxygen and hydrogen in model, if not already in
|
||||
*/
|
||||
@ -5009,7 +5009,7 @@ write_mb_eqn_x(void)
|
||||
int count, repeat;
|
||||
int i;
|
||||
size_t count_rxn_orig;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Rewrite any secondary master species flagged REWRITE
|
||||
* Don`t add in any pe reactions
|
||||
@ -5527,7 +5527,7 @@ save_model(void)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
assert(phase_ptr);
|
||||
last_model.gas_phase[i] = phase_ptr;
|
||||
}
|
||||
@ -5568,7 +5568,7 @@ save_model(void)
|
||||
for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
|
||||
{
|
||||
int j;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, false);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, false);
|
||||
assert(phase_ptr);
|
||||
last_model.pp_assemblage[i] = phase_ptr;
|
||||
last_model.add_formula[i] = string_hsave(it->second.Get_add_formula().c_str());
|
||||
@ -5682,7 +5682,7 @@ check_same_model(void)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
assert(phase_ptr);
|
||||
if (last_model.gas_phase[i] != phase_ptr)
|
||||
{
|
||||
@ -5731,7 +5731,7 @@ check_same_model(void)
|
||||
for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
|
||||
{
|
||||
int j;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
|
||||
assert(phase_ptr);
|
||||
if (last_model.pp_assemblage[i] != phase_ptr)
|
||||
{
|
||||
@ -5833,8 +5833,8 @@ build_min_exch(void)
|
||||
*/
|
||||
int j, k, jj;
|
||||
size_t row;
|
||||
struct master *master_ptr;
|
||||
struct unknown *unknown_ptr;
|
||||
class master *master_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
LDBLE coef;
|
||||
|
||||
if (use.Get_exchange_ptr() == NULL)
|
||||
@ -5861,7 +5861,7 @@ build_min_exch(void)
|
||||
// Find exchange master
|
||||
cxxNameDouble nd(comp_ref.Get_totals());
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
struct master *exchange_master = NULL;
|
||||
class master *exchange_master = NULL;
|
||||
for ( ; it != nd.end(); it++)
|
||||
{
|
||||
element * elt_ptr = element_store(it->first.c_str());
|
||||
@ -6006,7 +6006,7 @@ build_min_surface(void)
|
||||
cxxSurfaceComp *comp_ptr = &(surface_ptr->Get_surface_comps()[i]);
|
||||
if (comp_ptr->Get_phase_name().size() == 0)
|
||||
continue;
|
||||
struct element *elt_ptr = element_store(comp_ptr->Get_master_element().c_str());
|
||||
class element *elt_ptr = element_store(comp_ptr->Get_master_element().c_str());
|
||||
/* find unknown number */
|
||||
int j;
|
||||
for (j = (int)count_unknowns - 1; j >= 0; j--)
|
||||
@ -6059,7 +6059,7 @@ build_min_surface(void)
|
||||
#endif
|
||||
for (int jj = 0; jj < count_elts; jj++)
|
||||
{
|
||||
struct master * master_ptr = elt_list[jj].elt->primary;
|
||||
class master * master_ptr = elt_list[jj].elt->primary;
|
||||
if (master_ptr->in == FALSE)
|
||||
{
|
||||
master_ptr = master_ptr->s->secondary;
|
||||
@ -6095,7 +6095,7 @@ build_min_surface(void)
|
||||
}
|
||||
LDBLE coef = elt_list[jj].coef;
|
||||
size_t row;
|
||||
struct unknown *unknown_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
if (master_ptr->s == s_hplus)
|
||||
{
|
||||
row = mass_hydrogen_unknown->number;
|
||||
|
||||
@ -67,7 +67,7 @@ set_pr_in_false(void)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
if (phase_ptr)
|
||||
phase_ptr->pr_in = false;
|
||||
}
|
||||
@ -357,7 +357,7 @@ print_eh(void)
|
||||
*/
|
||||
int i, j, k, first;
|
||||
LDBLE pe, eh;
|
||||
struct master *master_ptr0, *master_ptr1;
|
||||
class master *master_ptr0, *master_ptr1;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
if (pr.eh == FALSE || pr.all == FALSE)
|
||||
@ -436,7 +436,7 @@ print_exchange(void)
|
||||
int i;
|
||||
cxxExchange * exchange_ptr;
|
||||
const char *name, *name1;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE dum, dum2;
|
||||
/*
|
||||
* Print exchange data
|
||||
@ -562,7 +562,7 @@ print_gas_phase(void)
|
||||
* Prints gas phase composition if present
|
||||
*/
|
||||
LDBLE lp, moles, initial_moles, delta_moles;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
char info[MAX_LENGTH];
|
||||
bool PR = false;
|
||||
|
||||
@ -643,7 +643,7 @@ print_gas_phase(void)
|
||||
*/
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[j]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str(), &k, FALSE);
|
||||
if (phase_ptr->in == TRUE)
|
||||
{
|
||||
lp = -phase_ptr->lk;
|
||||
@ -876,7 +876,7 @@ print_reaction(void)
|
||||
cit = reaction_ptr->Get_elementList().begin();
|
||||
for ( ; cit != reaction_ptr->Get_elementList().end(); cit++)
|
||||
{
|
||||
struct element * elt_ptr = element_store(cit->first.c_str());
|
||||
class element * elt_ptr = element_store(cit->first.c_str());
|
||||
assert(elt_ptr);
|
||||
output_msg(sformatf("\t%-15s%13.5f\n",
|
||||
elt_ptr->name,
|
||||
@ -1067,7 +1067,7 @@ print_master_reactions(void)
|
||||
* Debugging print routine to test primary and secondary reactions
|
||||
*/
|
||||
int i;
|
||||
struct rxn_token *next_token;
|
||||
class rxn_token *next_token;
|
||||
|
||||
for (i = 0; i < (int)master.size(); i++)
|
||||
{
|
||||
@ -1177,7 +1177,7 @@ print_saturation_indices(void)
|
||||
LDBLE si, iap;
|
||||
LDBLE lk;
|
||||
LDBLE la_eminus;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
CReaction *reaction_ptr;
|
||||
bool gas = true;
|
||||
|
||||
@ -1295,8 +1295,8 @@ print_pp_assemblage(void)
|
||||
int j, k;
|
||||
LDBLE si, iap, lk;
|
||||
char token[MAX_LENGTH];
|
||||
struct rxn_token *rxn_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
class phase *phase_ptr;
|
||||
|
||||
if (pr.pp_assemblage == FALSE || pr.all == FALSE)
|
||||
return (OK);
|
||||
@ -1413,7 +1413,7 @@ print_species(void)
|
||||
*/
|
||||
int i;
|
||||
const char *name, *name1;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE min;
|
||||
LDBLE lm;
|
||||
|
||||
@ -1538,7 +1538,7 @@ print_surface(void)
|
||||
*/
|
||||
cxxSurface *surface_ptr;
|
||||
std::string name, token;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
LDBLE molfrac, charge;
|
||||
/*
|
||||
* Print surface speciation
|
||||
@ -1829,8 +1829,8 @@ print_surface_cd_music(void)
|
||||
*/
|
||||
cxxSurface *surface_ptr;
|
||||
std::string name;
|
||||
struct master *master_ptr, *master_ptr0, *master_ptr1, *master_ptr2;
|
||||
struct unknown *unknown_ptr0, *unknown_ptr1, *unknown_ptr2;
|
||||
class master *master_ptr, *master_ptr0, *master_ptr1, *master_ptr2;
|
||||
class unknown *unknown_ptr0, *unknown_ptr1, *unknown_ptr2;
|
||||
LDBLE molfrac, charge0, charge1, charge2, sum;
|
||||
/*
|
||||
* Print surface speciation
|
||||
@ -2574,7 +2574,7 @@ punch_gas_phase(void)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[j]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
if (phase_ptr != current_selected_output->Get_gases()[i].second)
|
||||
continue;
|
||||
moles = phase_ptr->moles_x;
|
||||
@ -2684,19 +2684,19 @@ punch_totals(void)
|
||||
{
|
||||
molality = 0.0;
|
||||
}
|
||||
else if (((struct master *) current_selected_output->Get_totals()[j].second)->primary == TRUE)
|
||||
else if (((class master *) current_selected_output->Get_totals()[j].second)->primary == TRUE)
|
||||
{
|
||||
if (strncmp(current_selected_output->Get_totals()[j].first.c_str(), "Alkalinity", 20) == 0)
|
||||
{
|
||||
molality = total_alkalinity / mass_water_aq_x;
|
||||
} else
|
||||
{
|
||||
molality = ((struct master *) current_selected_output->Get_totals()[j].second)->total_primary / mass_water_aq_x;
|
||||
molality = ((class master *) current_selected_output->Get_totals()[j].second)->total_primary / mass_water_aq_x;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
molality = ((struct master *) current_selected_output->Get_totals()[j].second)->total / mass_water_aq_x;
|
||||
molality = ((class master *) current_selected_output->Get_totals()[j].second)->total / mass_water_aq_x;
|
||||
}
|
||||
if (!current_selected_output->Get_high_precision())
|
||||
{
|
||||
@ -2727,9 +2727,9 @@ punch_molalities(void)
|
||||
{
|
||||
molality = 0.0;
|
||||
if (current_selected_output->Get_molalities()[j].second != NULL
|
||||
&& ((struct species *) current_selected_output->Get_molalities()[j].second)->in == TRUE)
|
||||
&& ((class species *) current_selected_output->Get_molalities()[j].second)->in == TRUE)
|
||||
{
|
||||
molality = ((struct species *) current_selected_output->Get_molalities()[j].second)->moles / mass_water_aq_x;
|
||||
molality = ((class species *) current_selected_output->Get_molalities()[j].second)->moles / mass_water_aq_x;
|
||||
}
|
||||
if (!current_selected_output->Get_high_precision())
|
||||
{
|
||||
@ -2760,7 +2760,7 @@ punch_activities(void)
|
||||
{
|
||||
la = -999.999;
|
||||
if (current_selected_output->Get_activities()[j].second != NULL
|
||||
&& ((struct species *) current_selected_output->Get_activities()[j].second)->in == TRUE)
|
||||
&& ((class species *) current_selected_output->Get_activities()[j].second)->in == TRUE)
|
||||
{
|
||||
/*la = punch.activities[j].s->lm + punch.activities[j].s->lg; */
|
||||
la = log_activity(current_selected_output->Get_activities()[j].first.c_str());
|
||||
@ -3194,11 +3194,11 @@ punch_saturation_indices(void)
|
||||
*/
|
||||
//int i;
|
||||
LDBLE si, iap;
|
||||
struct rxn_token *rxn_ptr;
|
||||
class rxn_token *rxn_ptr;
|
||||
|
||||
for (size_t i = 0; i < current_selected_output->Get_si().size(); i++)
|
||||
{
|
||||
if (current_selected_output->Get_si()[i].second == NULL || ((struct phase *) current_selected_output->Get_si()[i].second)->in == FALSE)
|
||||
if (current_selected_output->Get_si()[i].second == NULL || ((class phase *) current_selected_output->Get_si()[i].second)->in == FALSE)
|
||||
{
|
||||
si = -999.999;
|
||||
}
|
||||
@ -3208,12 +3208,12 @@ punch_saturation_indices(void)
|
||||
* Print saturation index
|
||||
*/
|
||||
iap = 0.0;
|
||||
for (rxn_ptr = &(((struct phase *) current_selected_output->Get_si()[i].second)->rxn_x.token[0]) + 1;
|
||||
for (rxn_ptr = &(((class phase *) current_selected_output->Get_si()[i].second)->rxn_x.token[0]) + 1;
|
||||
rxn_ptr->s != NULL; rxn_ptr++)
|
||||
{
|
||||
iap += rxn_ptr->s->la * rxn_ptr->coef;
|
||||
}
|
||||
si = -((struct phase *) current_selected_output->Get_si()[i].second)->lk + iap;
|
||||
si = -((class phase *) current_selected_output->Get_si()[i].second)->lk + iap;
|
||||
}
|
||||
if (!current_selected_output->Get_high_precision())
|
||||
{
|
||||
@ -3312,7 +3312,7 @@ punch_user_punch(void)
|
||||
if (current_user_punch == NULL || !current_selected_output->Get_user_punch())
|
||||
return OK;
|
||||
|
||||
struct rate * user_punch = current_user_punch->Get_rate();
|
||||
class rate * user_punch = current_user_punch->Get_rate();
|
||||
|
||||
if (user_punch->commands.c_str() == 0)
|
||||
return (OK);
|
||||
@ -3576,7 +3576,7 @@ print_alkalinity(void)
|
||||
* order of aqueous species.
|
||||
*/
|
||||
int j;
|
||||
std::vector<struct species_list> alk_list;
|
||||
std::vector<class species_list> alk_list;
|
||||
LDBLE min;
|
||||
|
||||
if (pr.alkalinity == FALSE || pr.all == FALSE)
|
||||
@ -3603,7 +3603,7 @@ print_alkalinity(void)
|
||||
output_msg(sformatf("\t%-15s%12s%12s%10s\n\n", "Species",
|
||||
"Alkalinity", "Molality", "Alk/Mol"));
|
||||
if (alk_list.size() > 1) qsort(&alk_list[0], alk_list.size(),
|
||||
(size_t) sizeof(struct species_list), species_list_compare_alk);
|
||||
(size_t) sizeof(class species_list), species_list_compare_alk);
|
||||
for (size_t i = 0; i < alk_list.size(); i++)
|
||||
{
|
||||
if (fabs(alk_list[i].s->alk * (alk_list[i].s->moles) /
|
||||
|
||||
@ -392,10 +392,10 @@ read_exchange_species(void)
|
||||
int association;
|
||||
char token[MAX_LENGTH];
|
||||
const char* cptr;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
|
||||
struct species *s_ptr;
|
||||
const struct elt_list *next_elt;
|
||||
class species *s_ptr;
|
||||
const class elt_list *next_elt;
|
||||
//LDBLE exchange_coef;
|
||||
LDBLE offset;
|
||||
|
||||
@ -713,7 +713,7 @@ read_exchange_species(void)
|
||||
*/
|
||||
{
|
||||
s_ptr = NULL;
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
if (parse_eq(line, new_elt_list, association) == ERROR)
|
||||
{
|
||||
parse_error++;
|
||||
@ -1061,8 +1061,8 @@ read_exchange_master_species(void)
|
||||
int j, l;
|
||||
const char* cptr, *cptr1;
|
||||
LDBLE l_z;
|
||||
struct element *elts_ptr;
|
||||
struct species *s_ptr;
|
||||
class element *elts_ptr;
|
||||
class species *s_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
for (;;)
|
||||
{
|
||||
@ -1578,14 +1578,14 @@ read_inverse(void)
|
||||
{
|
||||
qsort(&inverse[n].isotopes[0],
|
||||
inverse[n].isotopes.size(),
|
||||
sizeof(struct inv_isotope), inverse_isotope_compare);
|
||||
sizeof(class inv_isotope), inverse_isotope_compare);
|
||||
}
|
||||
|
||||
if (inverse[n].i_u.size() > 1)
|
||||
{
|
||||
qsort(&inverse[n].i_u[0],
|
||||
inverse[n].i_u.size(),
|
||||
(size_t) sizeof(struct inv_isotope), inverse_isotope_compare);
|
||||
(size_t) sizeof(class inv_isotope), inverse_isotope_compare);
|
||||
}
|
||||
|
||||
return (return_value);
|
||||
@ -1593,7 +1593,7 @@ read_inverse(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
read_inv_balances(struct inverse *inverse_ptr, const char* cptr)
|
||||
read_inv_balances(class inverse *inverse_ptr, const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int j, l;
|
||||
@ -1633,7 +1633,7 @@ read_inv_balances(struct inverse *inverse_ptr, const char* cptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
read_inv_isotopes(struct inverse *inverse_ptr, const char* cptr)
|
||||
read_inv_isotopes(class inverse *inverse_ptr, const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j, l, l1, l2;
|
||||
@ -1716,7 +1716,7 @@ read_inv_isotopes(struct inverse *inverse_ptr, const char* cptr)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
read_inv_phases(struct inverse *inverse_ptr, const char* cptr)
|
||||
read_inv_phases(class inverse *inverse_ptr, const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int j, l;
|
||||
@ -1820,7 +1820,7 @@ read_inv_phases(struct inverse *inverse_ptr, const char* cptr)
|
||||
inverse_ptr->phases[count_phases].isotopes.resize(isotopes.size());
|
||||
for (size_t i = 0; i < isotopes.size(); i++)
|
||||
{
|
||||
struct isotope *iso_ptr = &(inverse_ptr->phases[count_phases].isotopes[i]);
|
||||
class isotope *iso_ptr = &(inverse_ptr->phases[count_phases].isotopes[i]);
|
||||
iso_ptr->isotope_number = isotopes[i].Get_isotope_number();
|
||||
iso_ptr->elt_name = string_hsave(isotopes[i].Get_elt_name().c_str());
|
||||
iso_ptr->isotope_name = string_hsave(isotopes[i].Get_isotope_name().c_str());
|
||||
@ -2989,8 +2989,8 @@ read_master_species(void)
|
||||
int j, i, l;
|
||||
const char* cptr, *cptr1;
|
||||
LDBLE l_z;
|
||||
struct element *elts_ptr;
|
||||
struct species *s_ptr;
|
||||
class element *elts_ptr;
|
||||
class species *s_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
elts_ptr = NULL;
|
||||
@ -3439,8 +3439,8 @@ read_phases(void)
|
||||
const char* cptr;
|
||||
char token[MAX_LENGTH];
|
||||
char token1[MAX_LENGTH];
|
||||
struct phase *phase_ptr;
|
||||
struct rxn_token *token_ptr;
|
||||
class phase *phase_ptr;
|
||||
class rxn_token *token_ptr;
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
const char* next_char;
|
||||
@ -3626,7 +3626,7 @@ read_phases(void)
|
||||
error_msg(line_save, CONTINUE);
|
||||
break;
|
||||
}
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
if (parse_eq(line, new_elt_list, association) == ERROR)
|
||||
{
|
||||
parse_error++;
|
||||
@ -5109,8 +5109,8 @@ read_species(void)
|
||||
*/
|
||||
int i;
|
||||
int association;
|
||||
struct species *s_ptr;
|
||||
const struct elt_list *next_elt;
|
||||
class species *s_ptr;
|
||||
const class elt_list *next_elt;
|
||||
const char* cptr;
|
||||
char token[MAX_LENGTH];
|
||||
//bool vm_read = false;
|
||||
@ -5494,7 +5494,7 @@ read_species(void)
|
||||
* Get space for species information and parse equation
|
||||
*/
|
||||
s_ptr = NULL;
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
if (parse_eq(line, new_elt_list, association) == ERROR)
|
||||
{
|
||||
parse_error++;
|
||||
@ -5839,8 +5839,8 @@ read_surface_species(void)
|
||||
const char* cptr;
|
||||
LDBLE offset;
|
||||
|
||||
struct species *s_ptr;
|
||||
const struct elt_list *next_elt;
|
||||
class species *s_ptr;
|
||||
const class elt_list *next_elt;
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
const char* next_char;
|
||||
@ -6116,7 +6116,7 @@ read_surface_species(void)
|
||||
* Get surface species information and parse equation
|
||||
*/
|
||||
s_ptr = NULL;
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
if (parse_eq(line, new_elt_list, association) == ERROR)
|
||||
{
|
||||
parse_error++;
|
||||
@ -6802,7 +6802,7 @@ read_surface_master_species(void)
|
||||
int l, return_value;
|
||||
const char* cptr, *cptr1;
|
||||
LDBLE l_z;
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
char token[MAX_LENGTH], token1[MAX_LENGTH];
|
||||
int opt, opt_save;
|
||||
const char* next_char;
|
||||
@ -6907,8 +6907,8 @@ int Phreeqc::
|
||||
add_psi_master_species(char *token)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct species *s_ptr;
|
||||
struct master *master_ptr;
|
||||
class species *s_ptr;
|
||||
class master *master_ptr;
|
||||
const char* cptr;
|
||||
char token1[MAX_LENGTH];
|
||||
int i, n, plane;
|
||||
@ -8057,7 +8057,7 @@ read_rates(void)
|
||||
int l, n;
|
||||
int return_value, opt, opt_save;
|
||||
char token[MAX_LENGTH];
|
||||
struct rate *rate_ptr;
|
||||
class rate *rate_ptr;
|
||||
const char* next_char;
|
||||
const char *opt_list[] = {
|
||||
"start", /* 0 */
|
||||
@ -8273,7 +8273,7 @@ read_user_punch(void)
|
||||
//}
|
||||
|
||||
// Malloc rate structure
|
||||
struct rate* r = new struct rate;
|
||||
class rate* r = new class rate;
|
||||
r->commands.clear();
|
||||
r->new_def = TRUE;
|
||||
r->linebase = NULL;
|
||||
@ -9128,7 +9128,7 @@ read_named_logk(void)
|
||||
|
||||
int l;
|
||||
int i, empty;
|
||||
struct logk *logk_ptr;
|
||||
class logk *logk_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
|
||||
@ -173,7 +173,7 @@ read_sit(void)
|
||||
* number of shifts;
|
||||
*/
|
||||
int n;
|
||||
struct pitz_param *pzp_ptr;
|
||||
class pitz_param *pzp_ptr;
|
||||
pitz_param_type pzp_type;
|
||||
|
||||
int return_value, opt, opt_save;
|
||||
@ -239,7 +239,7 @@ read_sit(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
calc_sit_param(struct pitz_param *pz_ptr, LDBLE TK, LDBLE TR)
|
||||
calc_sit_param(class pitz_param *pz_ptr, LDBLE TK, LDBLE TR)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE param;
|
||||
|
||||
@ -34,11 +34,11 @@ read_solution_spread(void)
|
||||
* ERROR if error occurred reading data
|
||||
*
|
||||
*/
|
||||
struct spread_row *heading, *row_ptr, *units;
|
||||
class spread_row *heading, *row_ptr, *units;
|
||||
int count, strings, numbers;
|
||||
int spread_lines;
|
||||
const char* cptr;
|
||||
struct defaults soln_defaults;
|
||||
class defaults soln_defaults;
|
||||
int return_value, opt;
|
||||
const char* next_char;
|
||||
const char *opt_list[] = {
|
||||
@ -83,7 +83,7 @@ read_solution_spread(void)
|
||||
|
||||
/* all iso[i].name is hsave'd, so no conflicts */
|
||||
memcpy(&soln_defaults.iso[0], iso_defaults,
|
||||
soln_defaults.iso.size() * sizeof(struct iso));
|
||||
soln_defaults.iso.size() * sizeof(class iso));
|
||||
|
||||
heading = NULL;
|
||||
units = NULL;
|
||||
@ -523,8 +523,8 @@ read_solution_spread(void)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
spread_row_to_solution(struct spread_row *heading, struct spread_row *units,
|
||||
struct spread_row *data, struct defaults defaults)
|
||||
spread_row_to_solution(class spread_row *heading, class spread_row *units,
|
||||
class spread_row *data, class defaults defaults)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
Keywords::KEYWORDS next_keyword_save;
|
||||
@ -805,7 +805,7 @@ spread_row_to_solution(struct spread_row *heading, struct spread_row *units,
|
||||
error_msg(error_string, PHRQ_io::OT_CONTINUE);
|
||||
error_string = sformatf( "\t%s\t%s\n", "line_save: ", line_save);
|
||||
error_msg(error_string, PHRQ_io::OT_CONTINUE);
|
||||
//struct spread_row
|
||||
//class spread_row
|
||||
//{
|
||||
// int count;
|
||||
// int empty, string, number;
|
||||
@ -1032,7 +1032,7 @@ spread_row_to_solution(struct spread_row *heading, struct spread_row *units,
|
||||
return (return_value);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct spread_row * Phreeqc::
|
||||
class spread_row * Phreeqc::
|
||||
string_to_spread_row(char *string)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1042,7 +1042,7 @@ string_to_spread_row(char *string)
|
||||
/*
|
||||
* Allocate space
|
||||
*/
|
||||
struct spread_row* spread_row_ptr = new struct spread_row;
|
||||
class spread_row* spread_row_ptr = new class spread_row;
|
||||
if (spread_row_ptr == NULL)
|
||||
{
|
||||
malloc_error();
|
||||
@ -1094,7 +1094,7 @@ string_to_spread_row(char *string)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
spread_row_free(struct spread_row *spread_row_ptr)
|
||||
spread_row_free(class spread_row *spread_row_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
@ -1275,7 +1275,7 @@ free_spread(void)
|
||||
(const char *)free_check_null((void*)g_spread_sheet.defaults.iso[i].name);
|
||||
}
|
||||
g_spread_sheet.defaults.iso =
|
||||
(struct iso*)free_check_null(g_spread_sheet.defaults.iso);
|
||||
(class iso*)free_check_null(g_spread_sheet.defaults.iso);
|
||||
|
||||
g_spread_sheet.defaults.redox =
|
||||
(const char *)free_check_null((void*)g_spread_sheet.defaults.redox);
|
||||
@ -1290,12 +1290,12 @@ free_spread(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void Phreeqc::
|
||||
add_row(struct spread_row *spread_row_ptr)
|
||||
add_row(class spread_row *spread_row_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
g_spread_sheet.rows =
|
||||
(struct spread_row **) PHRQ_realloc(g_spread_sheet.rows,
|
||||
sizeof(struct spread_row *) *
|
||||
(class spread_row **) PHRQ_realloc(g_spread_sheet.rows,
|
||||
sizeof(class spread_row *) *
|
||||
(g_spread_sheet.count_rows + 1));
|
||||
if (g_spread_sheet.rows == NULL)
|
||||
{
|
||||
@ -1309,17 +1309,17 @@ add_row(struct spread_row *spread_row_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct spread_row * Phreeqc::
|
||||
copy_row(struct spread_row *spread_row_ptr)
|
||||
class spread_row * Phreeqc::
|
||||
copy_row(class spread_row *spread_row_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct spread_row *new_spread_row_ptr;
|
||||
class spread_row *new_spread_row_ptr;
|
||||
/*
|
||||
* Allocate space
|
||||
*/
|
||||
new_spread_row_ptr =
|
||||
(struct spread_row *) PHRQ_malloc((size_t) sizeof(struct spread_row));
|
||||
(class spread_row *) PHRQ_malloc((size_t) sizeof(class spread_row));
|
||||
if (new_spread_row_ptr == NULL)
|
||||
malloc_error();
|
||||
new_spread_row_ptr->char_vector =
|
||||
@ -1353,14 +1353,14 @@ copy_row(struct spread_row *spread_row_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void Phreeqc::
|
||||
copy_defaults(struct defaults *dest_ptr, struct defaults *src_ptr)
|
||||
copy_defaults(class defaults *dest_ptr, class defaults *src_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
dest_ptr->count_iso = src_ptr->count_iso;
|
||||
dest_ptr->density = src_ptr->density;
|
||||
dest_ptr->iso =
|
||||
(struct iso *) PHRQ_malloc(sizeof(struct iso) * src_ptr->count_iso);
|
||||
(class iso *) PHRQ_malloc(sizeof(class iso) * src_ptr->count_iso);
|
||||
if (dest_ptr->iso == NULL)
|
||||
{
|
||||
malloc_error();
|
||||
|
||||
@ -237,8 +237,8 @@ step(LDBLE step_fraction)
|
||||
for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
|
||||
{
|
||||
int n;
|
||||
struct phase *p_ptr = phase_bsearch((it->first).c_str(), &n, FALSE);
|
||||
const struct elt_list *e_ptr;
|
||||
class phase *p_ptr = phase_bsearch((it->first).c_str(), &n, FALSE);
|
||||
const class elt_list *e_ptr;
|
||||
LDBLE min = 1e10;
|
||||
for (e_ptr = &p_ptr->next_elt[0]; e_ptr->elt != NULL; e_ptr++)
|
||||
{
|
||||
@ -264,9 +264,9 @@ step(LDBLE step_fraction)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int n;
|
||||
struct phase *p_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &n, FALSE);
|
||||
class phase *p_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &n, FALSE);
|
||||
|
||||
const struct elt_list *e_ptr;
|
||||
const class elt_list *e_ptr;
|
||||
LDBLE min = 1e10;
|
||||
for (e_ptr = &p_ptr->next_elt[0]; e_ptr->elt != NULL; e_ptr++)
|
||||
{
|
||||
@ -351,8 +351,8 @@ add_solution(cxxSolution *solution_ptr, LDBLE extensive, LDBLE intensive)
|
||||
* extensive is multiplication factor for solution
|
||||
* intensive is fraction of all multiplication factors for all solutions
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
struct species *species_ptr;
|
||||
class master *master_ptr;
|
||||
class species *species_ptr;
|
||||
/*
|
||||
* Add solution to global variables
|
||||
*/
|
||||
@ -425,7 +425,7 @@ add_exchange(cxxExchange *exchange_ptr)
|
||||
/*
|
||||
* Accumulate exchange data in master->totals and _x variables.
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (exchange_ptr == NULL)
|
||||
return (OK);
|
||||
@ -439,7 +439,7 @@ add_exchange(cxxExchange *exchange_ptr)
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
for ( ; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
assert(elt_ptr != NULL && elt_ptr->primary != NULL);
|
||||
master_ptr = elt_ptr->primary;
|
||||
@ -476,7 +476,7 @@ add_exchange(cxxExchange *exchange_ptr)
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
for ( ; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
assert(elt_ptr->master);
|
||||
if (elt_ptr->master->type == EX)
|
||||
{
|
||||
@ -505,12 +505,12 @@ add_surface(cxxSurface *surface_ptr)
|
||||
for (size_t i = 0; i < surface_ptr->Get_surface_comps().size(); i++)
|
||||
{
|
||||
cxxSurfaceComp *comp_ptr = &(surface_ptr->Get_surface_comps()[i]);
|
||||
struct element *elt_ptr = element_store(comp_ptr->Get_master_element().c_str());
|
||||
class element *elt_ptr = element_store(comp_ptr->Get_master_element().c_str());
|
||||
if (elt_ptr->master == NULL)
|
||||
{
|
||||
error_msg(sformatf("Data not defined for master in SURFACE, %s\n", comp_ptr->Get_formula().c_str()), STOP);
|
||||
}
|
||||
struct master *master_i_ptr = elt_ptr->master;
|
||||
class master *master_i_ptr = elt_ptr->master;
|
||||
|
||||
if (surface_ptr->Get_type() == cxxSurface::NO_EDL)
|
||||
{
|
||||
@ -527,8 +527,8 @@ add_surface(cxxSurface *surface_ptr)
|
||||
for (jit = comp_ptr->Get_totals().begin(); jit != comp_ptr->Get_totals().end(); jit++)
|
||||
{
|
||||
LDBLE coef = jit->second;
|
||||
struct element *elt_j_ptr = element_store(jit->first.c_str());
|
||||
struct master *master_j_ptr = elt_j_ptr->primary;
|
||||
class element *elt_j_ptr = element_store(jit->first.c_str());
|
||||
class master *master_j_ptr = elt_j_ptr->primary;
|
||||
if (master_j_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -561,7 +561,7 @@ add_surface(cxxSurface *surface_ptr)
|
||||
}
|
||||
if (!surface_ptr->Get_new_def())
|
||||
{
|
||||
struct master *master_ptr = surface_get_psi_master(charge_ptr->Get_name().c_str(), SURF_PSI);
|
||||
class master *master_ptr = surface_get_psi_master(charge_ptr->Get_name().c_str(), SURF_PSI);
|
||||
master_ptr->s->la = charge_ptr->Get_la_psi();
|
||||
}
|
||||
/*
|
||||
@ -573,8 +573,8 @@ add_surface(cxxSurface *surface_ptr)
|
||||
for (jit = charge_ptr->Get_diffuse_layer_totals().begin(); jit != charge_ptr->Get_diffuse_layer_totals().end(); jit++)
|
||||
{
|
||||
LDBLE coef = jit->second;
|
||||
struct element *elt_j_ptr = element_store(jit->first.c_str());
|
||||
struct master * master_j_ptr = elt_j_ptr->master;
|
||||
class element *elt_j_ptr = element_store(jit->first.c_str());
|
||||
class master * master_j_ptr = elt_j_ptr->master;
|
||||
if (master_j_ptr->s == s_hplus)
|
||||
{
|
||||
total_h_x += coef;
|
||||
@ -664,7 +664,7 @@ add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
|
||||
LDBLE amount_to_add, total;
|
||||
char token[MAX_LENGTH];
|
||||
const char* cptr;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (check_pp_assemblage(pp_assemblage_ptr) == OK)
|
||||
return (OK);
|
||||
@ -684,7 +684,7 @@ add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
|
||||
cxxPPassemblageComp * comp_ptr = &(it->second);
|
||||
if (comp_ptr->Get_precipitate_only()) continue;
|
||||
int l;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
amount_to_add = 0.0;
|
||||
@ -768,13 +768,13 @@ check_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
|
||||
* if all are in model. Return true if all are present,
|
||||
* Return false if one or more is missing.
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
cxxNameDouble nd = pp_assemblage_ptr->Get_eltList();
|
||||
cxxNameDouble::iterator it;
|
||||
for (it = nd.begin(); it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->primary == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
@ -798,7 +798,7 @@ add_reaction(cxxReaction *reaction_ptr, int step_number, LDBLE step_fraction)
|
||||
* Add irreversible reaction
|
||||
*/
|
||||
char c;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Calculate and save reaction
|
||||
*/
|
||||
@ -896,7 +896,7 @@ add_reaction(cxxReaction *reaction_ptr, int step_number, LDBLE step_fraction)
|
||||
cxxNameDouble::const_iterator it = reaction_ptr->Get_elementList().begin();
|
||||
for ( ; it != reaction_ptr->Get_elementList().end(); it++)
|
||||
{
|
||||
struct element * elt_ptr = element_store(it->first.c_str());
|
||||
class element * elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
if (elt_ptr == NULL)
|
||||
{
|
||||
@ -939,7 +939,7 @@ reaction_calc(cxxReaction *reaction_ptr)
|
||||
int return_value;
|
||||
LDBLE coef;
|
||||
const char* cptr;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
/*
|
||||
* Go through list and generate list of elements and
|
||||
* coefficient of elements in reaction
|
||||
@ -996,7 +996,7 @@ add_gas_phase(cxxGasPhase *gas_phase_ptr)
|
||||
* Accumulate gas data in master->totals and _x variables.
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (gas_phase_ptr == NULL)
|
||||
return (OK);
|
||||
@ -1009,7 +1009,7 @@ add_gas_phase(cxxGasPhase *gas_phase_ptr)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
if (phase_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -1061,7 +1061,7 @@ add_ss_assemblage(cxxSSassemblage *ss_assemblage_ptr)
|
||||
*/
|
||||
int i, j, k;
|
||||
LDBLE amount_to_add, total;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
const char* cptr;
|
||||
|
||||
if (ss_assemblage_ptr == NULL)
|
||||
@ -1081,7 +1081,7 @@ add_ss_assemblage(cxxSSassemblage *ss_assemblage_ptr)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[j]);
|
||||
int l;
|
||||
struct phase * phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
|
||||
amount_to_add = 0.0;
|
||||
comp_ptr->Set_delta(0.0);
|
||||
@ -1156,7 +1156,7 @@ add_kinetics(cxxKinetics *kinetics_ptr)
|
||||
/*
|
||||
* Add kinetic reaction
|
||||
*/
|
||||
struct master *master_ptr = NULL;
|
||||
class master *master_ptr = NULL;
|
||||
/*
|
||||
* Add reaction to totals
|
||||
*/
|
||||
@ -1166,7 +1166,7 @@ add_kinetics(cxxKinetics *kinetics_ptr)
|
||||
for (; it != kinetics_ptr->Get_totals().end(); it++)
|
||||
{
|
||||
LDBLE coef = it->second;
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
if (elt_ptr == NULL || (master_ptr = elt_ptr->primary) == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -1201,7 +1201,7 @@ gas_phase_check(cxxGasPhase *gas_phase_ptr)
|
||||
/*
|
||||
* Check for missing elements
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (gas_phase_ptr == NULL)
|
||||
return (OK);
|
||||
@ -1219,7 +1219,7 @@ gas_phase_check(cxxGasPhase *gas_phase_ptr)
|
||||
{
|
||||
cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
if (gc_ptr->Get_moles() <= 0.0)
|
||||
@ -1267,7 +1267,7 @@ pp_assemblage_check(cxxPPassemblage *pp_assemblage_ptr)
|
||||
*/
|
||||
std::string token;
|
||||
const char* cptr;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (check_pp_assemblage(pp_assemblage_ptr) == OK)
|
||||
return (OK);
|
||||
@ -1280,7 +1280,7 @@ pp_assemblage_check(cxxPPassemblage *pp_assemblage_ptr)
|
||||
{
|
||||
cxxPPassemblageComp * comp_ptr = &(it->second);
|
||||
int l;
|
||||
struct phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
if (comp_ptr->Get_moles() <= 0.0)
|
||||
@ -1350,7 +1350,7 @@ ss_assemblage_check(cxxSSassemblage *ss_assemblage_ptr)
|
||||
* Check for missing elements
|
||||
*/
|
||||
int j, k;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
if (ss_assemblage_ptr == NULL)
|
||||
return (OK);
|
||||
@ -1365,7 +1365,7 @@ ss_assemblage_check(cxxSSassemblage *ss_assemblage_ptr)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
count_elts = 0;
|
||||
paren_count = 0;
|
||||
if (comp_ptr->Get_moles() <= 0.0)
|
||||
@ -1425,7 +1425,7 @@ solution_check(void)
|
||||
* Check for missing elements
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
/*
|
||||
* Check that all elements are in solution for phases with zero mass
|
||||
|
||||
@ -300,7 +300,7 @@ rxn_find_coef(CReaction& r_ref, const char* str)
|
||||
* Return: 0.0, if token not found
|
||||
* coefficient of token, if found.
|
||||
*/
|
||||
struct rxn_token* r_token;
|
||||
class rxn_token* r_token;
|
||||
LDBLE coef;
|
||||
|
||||
r_token = &r_ref.token[1];
|
||||
@ -326,16 +326,16 @@ int Phreeqc::
|
||||
element_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct element *element_ptr1, *element_ptr2;
|
||||
element_ptr1 = *(const struct element **) ptr1;
|
||||
element_ptr2 = *(const struct element **) ptr2;
|
||||
const class element *element_ptr1, *element_ptr2;
|
||||
element_ptr1 = *(const class element **) ptr1;
|
||||
element_ptr2 = *(const class element **) ptr2;
|
||||
/* return(strcmp_nocase(element_ptr1->name, element_ptr2->name)); */
|
||||
return (strcmp(element_ptr1->name, element_ptr2->name));
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct element* Phreeqc::
|
||||
class element* Phreeqc::
|
||||
element_store(const char * element)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -357,7 +357,7 @@ element_store(const char * element)
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::map<std::string, struct element *>::const_iterator it;
|
||||
std::map<std::string, class element *>::const_iterator it;
|
||||
it = elements_map.find(element);
|
||||
if (it != elements_map.end())
|
||||
{
|
||||
@ -366,7 +366,7 @@ element_store(const char * element)
|
||||
/*
|
||||
* Save new element structure and return pointer to it
|
||||
*/
|
||||
struct element *elt_ptr = new struct element;
|
||||
class element *elt_ptr = new class element;
|
||||
elt_ptr->name = string_hsave(element);
|
||||
elt_ptr->master = NULL;
|
||||
elt_ptr->primary = NULL;
|
||||
@ -399,10 +399,10 @@ add_elt_list(const cxxNameDouble& nd, LDBLE coef)
|
||||
return (OK);
|
||||
}
|
||||
int Phreeqc::
|
||||
add_elt_list(const std::vector<struct elt_list>& el, double coef)
|
||||
add_elt_list(const std::vector<class elt_list>& el, double coef)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct elt_list* elt_list_ptr = &el[0];
|
||||
const class elt_list* elt_list_ptr = &el[0];
|
||||
|
||||
for (; elt_list_ptr->elt != NULL; elt_list_ptr++)
|
||||
{
|
||||
@ -480,7 +480,7 @@ elt_list_combine(void)
|
||||
return (OK);
|
||||
}
|
||||
qsort(&elt_list[0], count_elts,
|
||||
sizeof(struct elt_list), Phreeqc::elt_list_compare);
|
||||
sizeof(class elt_list), Phreeqc::elt_list_compare);
|
||||
j = 0;
|
||||
for (i = 1; i < count_elts; i++)
|
||||
{
|
||||
@ -506,20 +506,20 @@ int Phreeqc::
|
||||
elt_list_compare(const void* ptr1, const void* ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct elt_list* a, * b;
|
||||
const class elt_list* a, * b;
|
||||
|
||||
a = (const struct elt_list*)ptr1;
|
||||
b = (const struct elt_list*)ptr2;
|
||||
a = (const class elt_list*)ptr1;
|
||||
b = (const class elt_list*)ptr2;
|
||||
return (strncmp(a->elt->name, b->elt->name, MAX_LENGTH));
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
std::vector<struct elt_list> Phreeqc::
|
||||
elt_list_internal_copy(const std::vector<struct elt_list>& el)
|
||||
std::vector<class elt_list> Phreeqc::
|
||||
elt_list_internal_copy(const std::vector<class elt_list>& el)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
if (el.size() == 0) return new_elt_list;
|
||||
const struct elt_list* elt_list_ptr = &el[0];
|
||||
const class elt_list* elt_list_ptr = &el[0];
|
||||
|
||||
new_elt_list.resize(el.size());
|
||||
size_t count = 0;
|
||||
@ -533,7 +533,7 @@ elt_list_internal_copy(const std::vector<struct elt_list>& el)
|
||||
return new_elt_list;
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
std::vector<struct elt_list> Phreeqc::
|
||||
std::vector<class elt_list> Phreeqc::
|
||||
elt_list_vsave(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -543,7 +543,7 @@ elt_list_vsave(void)
|
||||
* new structure.
|
||||
*/
|
||||
size_t j;
|
||||
std::vector<struct elt_list> new_elt_list;
|
||||
std::vector<class elt_list> new_elt_list;
|
||||
/*
|
||||
* Sort elements in reaction and combine
|
||||
*/
|
||||
@ -582,7 +582,7 @@ elt_list_NameDouble(void)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct inverse * Phreeqc::
|
||||
class inverse * Phreeqc::
|
||||
inverse_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -594,7 +594,7 @@ inverse_alloc(void)
|
||||
* return: OK
|
||||
*/
|
||||
{
|
||||
struct inverse *inverse_ptr = NULL;
|
||||
class inverse *inverse_ptr = NULL;
|
||||
inverse.resize(count_inverse + 1);
|
||||
inverse_ptr = &(inverse[count_inverse++]);
|
||||
/*
|
||||
@ -618,11 +618,11 @@ inverse_compare(const void *ptr1, const void *ptr2)
|
||||
/*
|
||||
* Compare inverse values for n_user
|
||||
*/
|
||||
const struct inverse *nptr1;
|
||||
const struct inverse *nptr2;
|
||||
const class inverse *nptr1;
|
||||
const class inverse *nptr2;
|
||||
|
||||
nptr1 = (const struct inverse *) ptr1;
|
||||
nptr2 = (const struct inverse *) ptr2;
|
||||
nptr1 = (const class inverse *) ptr1;
|
||||
nptr2 = (const class inverse *) ptr2;
|
||||
if (nptr1->n_user > nptr2->n_user)
|
||||
return (1);
|
||||
if (nptr1->n_user < nptr2->n_user)
|
||||
@ -649,7 +649,7 @@ inverse_delete(int i)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
inverse_free(struct inverse *inverse_ptr)
|
||||
inverse_free(class inverse *inverse_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -709,10 +709,10 @@ inverse_isotope_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
const struct inv_isotope *iso_ptr1, *iso_ptr2;
|
||||
const class inv_isotope *iso_ptr1, *iso_ptr2;
|
||||
|
||||
iso_ptr1 = (const struct inv_isotope *) ptr1;
|
||||
iso_ptr2 = (const struct inv_isotope *) ptr2;
|
||||
iso_ptr1 = (const class inv_isotope *) ptr1;
|
||||
iso_ptr2 = (const class inv_isotope *) ptr2;
|
||||
i = strcmp_nocase(iso_ptr1->elt_name, iso_ptr2->elt_name);
|
||||
if (i != 0)
|
||||
return (i);
|
||||
@ -728,7 +728,7 @@ inverse_isotope_compare(const void *ptr1, const void *ptr2)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct inverse * Phreeqc::
|
||||
class inverse * Phreeqc::
|
||||
inverse_search(int n_user, int *n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -769,7 +769,7 @@ inverse_sort(void)
|
||||
if (count_inverse > 1)
|
||||
{
|
||||
qsort(&inverse[0], (size_t) count_inverse,
|
||||
sizeof(struct inverse), inverse_compare);
|
||||
sizeof(class inverse), inverse_compare);
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
@ -780,7 +780,7 @@ inverse_sort(void)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
master_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -789,7 +789,7 @@ master_alloc(void)
|
||||
* return: pointer to a master structure
|
||||
*/
|
||||
{
|
||||
struct master *ptr = new struct master;
|
||||
class master *ptr = new class master;
|
||||
/*
|
||||
* set pointers in structure to NULL
|
||||
*/
|
||||
@ -841,7 +841,7 @@ master_delete(const char* cptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
master_free(struct master *master_ptr)
|
||||
master_free(class master *master_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -855,7 +855,7 @@ master_free(struct master *master_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
master_bsearch(const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -875,13 +875,13 @@ master_bsearch(const char* cptr)
|
||||
void_ptr = bsearch((const char *) cptr,
|
||||
(char *) &master[0],
|
||||
master.size(),
|
||||
sizeof(struct master *), master_compare_string);
|
||||
sizeof(class master *), master_compare_string);
|
||||
if (void_ptr == NULL)
|
||||
{
|
||||
void_ptr = bsearch(cptr,
|
||||
(char*)&master[0],
|
||||
master.size(),
|
||||
sizeof(struct master*), master_compare_string);
|
||||
sizeof(class master*), master_compare_string);
|
||||
}
|
||||
if (void_ptr == NULL)
|
||||
{
|
||||
@ -889,7 +889,7 @@ master_bsearch(const char* cptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*(struct master **) void_ptr);
|
||||
return (*(class master **) void_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -899,10 +899,10 @@ master_compare_string(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const char *string_ptr;
|
||||
const struct master *master_ptr;
|
||||
const class master *master_ptr;
|
||||
|
||||
string_ptr = (const char *) ptr1;
|
||||
master_ptr = *(const struct master **) ptr2;
|
||||
master_ptr = *(const class master **) ptr2;
|
||||
return (strcmp_nocase(string_ptr, master_ptr->elt->name));
|
||||
}
|
||||
|
||||
@ -911,14 +911,14 @@ int Phreeqc::
|
||||
master_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct master *master_ptr1, *master_ptr2;
|
||||
master_ptr1 = *(const struct master **) ptr1;
|
||||
master_ptr2 = *(const struct master **) ptr2;
|
||||
const class master *master_ptr1, *master_ptr2;
|
||||
master_ptr1 = *(const class master **) ptr1;
|
||||
master_ptr2 = *(const class master **) ptr2;
|
||||
return (strcmp_nocase(master_ptr1->elt->name, master_ptr2->elt->name));
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
master_bsearch_primary(const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -928,7 +928,7 @@ master_bsearch_primary(const char* cptr)
|
||||
*/
|
||||
int l;
|
||||
const char* cptr1;
|
||||
struct master *master_ptr_primary;
|
||||
class master *master_ptr_primary;
|
||||
/*
|
||||
* Find element name
|
||||
*/
|
||||
@ -951,7 +951,7 @@ master_bsearch_primary(const char* cptr)
|
||||
return (master_ptr_primary);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
master_bsearch_secondary(const char* cptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -962,7 +962,7 @@ master_bsearch_secondary(const char* cptr)
|
||||
int l;
|
||||
const char* cptr1;
|
||||
std::string elt;
|
||||
struct master *master_ptr_primary, *master_ptr=NULL, *master_ptr_secondary=NULL;
|
||||
class master *master_ptr_primary, *master_ptr=NULL, *master_ptr_secondary=NULL;
|
||||
/*
|
||||
* Find element name
|
||||
*/
|
||||
@ -1020,7 +1020,7 @@ master_bsearch_secondary(const char* cptr)
|
||||
return (master_ptr_secondary);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
master_search(const char* cptr, int *n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1030,7 +1030,7 @@ master_search(const char* cptr, int *n)
|
||||
* Returns NULL if not found.
|
||||
*/
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
/*
|
||||
* Search master species list
|
||||
*/
|
||||
@ -1052,7 +1052,7 @@ master_search(const char* cptr, int *n)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct phase * Phreeqc::
|
||||
class phase * Phreeqc::
|
||||
phase_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1061,11 +1061,11 @@ phase_alloc(void)
|
||||
* arguments: void
|
||||
* return: pointer to new phase structure
|
||||
*/
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
/*
|
||||
* Allocate space
|
||||
*/
|
||||
phase_ptr = new struct phase;
|
||||
phase_ptr = new class phase;
|
||||
/*
|
||||
* Initialize space
|
||||
*/
|
||||
@ -1081,9 +1081,9 @@ phase_compare(const void *ptr1, const void *ptr2)
|
||||
/*
|
||||
* Compares names of phases for sort
|
||||
*/
|
||||
const struct phase *phase_ptr1, *phase_ptr2;
|
||||
phase_ptr1 = *(const struct phase **) ptr1;
|
||||
phase_ptr2 = *(const struct phase **) ptr2;
|
||||
const class phase *phase_ptr1, *phase_ptr2;
|
||||
phase_ptr1 = *(const class phase **) ptr1;
|
||||
phase_ptr2 = *(const class phase **) ptr2;
|
||||
return (strcmp_nocase(phase_ptr1->name, phase_ptr2->name));
|
||||
}
|
||||
|
||||
@ -1093,9 +1093,9 @@ phase_compare_string(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const char *char_ptr;
|
||||
const struct phase *phase_ptr;
|
||||
const class phase *phase_ptr;
|
||||
char_ptr = (const char *) ptr1;
|
||||
phase_ptr = *(const struct phase **) ptr2;
|
||||
phase_ptr = *(const class phase **) ptr2;
|
||||
return (strcmp_nocase(char_ptr, phase_ptr->name));
|
||||
}
|
||||
|
||||
@ -1117,7 +1117,7 @@ phase_delete(int i)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
phase_free(struct phase *phase_ptr)
|
||||
phase_free(class phase *phase_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1134,7 +1134,7 @@ phase_free(struct phase *phase_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct phase * Phreeqc::
|
||||
class phase * Phreeqc::
|
||||
phase_bsearch(const char* cptr, int *j, int print)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1159,7 +1159,7 @@ phase_bsearch(const char* cptr, int *j, int print)
|
||||
bsearch((char *) cptr,
|
||||
(char *) &phases[0],
|
||||
phases.size(),
|
||||
sizeof(struct phase *), phase_compare_string);
|
||||
sizeof(class phase *), phase_compare_string);
|
||||
}
|
||||
if (void_ptr == NULL && print == TRUE)
|
||||
{
|
||||
@ -1173,13 +1173,13 @@ phase_bsearch(const char* cptr, int *j, int print)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
*j = (int) ((struct phase **) void_ptr - &phases[0]);
|
||||
return (*(struct phase **) void_ptr);
|
||||
*j = (int) ((class phase **) void_ptr - &phases[0]);
|
||||
return (*(class phase **) void_ptr);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
phase_init(struct phase *phase_ptr)
|
||||
phase_init(class phase *phase_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* set pointers in phase structure to NULL
|
||||
@ -1229,7 +1229,7 @@ phase_init(struct phase *phase_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct phase * Phreeqc::
|
||||
class phase * Phreeqc::
|
||||
phase_store(const char *name_in)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1250,13 +1250,13 @@ phase_store(const char *name_in)
|
||||
* If phase existed, it is reinitialized. The structure returned
|
||||
* contains only the name of the phase.
|
||||
*/
|
||||
struct phase *phase_ptr = NULL;
|
||||
class phase *phase_ptr = NULL;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct phase*>::iterator p_it =
|
||||
std::map<std::string, class phase*>::iterator p_it =
|
||||
phases_map.find(name);
|
||||
if (p_it != phases_map.end())
|
||||
{
|
||||
@ -1286,7 +1286,7 @@ phase_store(const char *name_in)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct rate * Phreeqc::
|
||||
class rate * Phreeqc::
|
||||
rate_bsearch(const char* cptr, int *j)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1313,7 +1313,7 @@ rate_bsearch(const char* cptr, int *j)
|
||||
bsearch((char *) cptr,
|
||||
(char *) &rates[0],
|
||||
rates.size(),
|
||||
sizeof(struct rate *), rate_compare_string);
|
||||
sizeof(class rate *), rate_compare_string);
|
||||
|
||||
if (void_ptr == NULL)
|
||||
{
|
||||
@ -1321,8 +1321,8 @@ rate_bsearch(const char* cptr, int *j)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
*j = (int) ((struct rate *) void_ptr - &rates[0]);
|
||||
return ((struct rate *) void_ptr);
|
||||
*j = (int) ((class rate *) void_ptr - &rates[0]);
|
||||
return ((class rate *) void_ptr);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -1333,9 +1333,9 @@ rate_compare(const void *ptr1, const void *ptr2)
|
||||
/*
|
||||
* Compares names of rates for sort
|
||||
*/
|
||||
const struct rate *rate_ptr1, *rate_ptr2;
|
||||
rate_ptr1 = *(const struct rate **) ptr1;
|
||||
rate_ptr2 = *(const struct rate **) ptr2;
|
||||
const class rate *rate_ptr1, *rate_ptr2;
|
||||
rate_ptr1 = *(const class rate **) ptr1;
|
||||
rate_ptr2 = *(const class rate **) ptr2;
|
||||
return (strcmp_nocase(rate_ptr1->name, rate_ptr2->name));
|
||||
}
|
||||
|
||||
@ -1345,15 +1345,15 @@ rate_compare_string(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const char *char_ptr;
|
||||
const struct rate *rate_ptr;
|
||||
const class rate *rate_ptr;
|
||||
char_ptr = (const char *) ptr1;
|
||||
rate_ptr = *(const struct rate **) ptr2;
|
||||
rate_ptr = *(const class rate **) ptr2;
|
||||
return (strcmp_nocase(char_ptr, rate_ptr->name));
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
rate_free(struct rate *rate_ptr)
|
||||
rate_free(class rate *rate_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1378,8 +1378,8 @@ rate_free(struct rate *rate_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct rate * Phreeqc::
|
||||
rate_copy(const struct rate *rate_ptr)
|
||||
class rate * Phreeqc::
|
||||
rate_copy(const class rate *rate_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1387,7 +1387,7 @@ rate_copy(const struct rate *rate_ptr)
|
||||
*/
|
||||
if (rate_ptr == NULL)
|
||||
return (NULL);
|
||||
struct rate* rate_new = new struct rate;
|
||||
class rate* rate_new = new class rate;
|
||||
rate_new->name = string_hsave(rate_ptr->name);
|
||||
rate_new->commands = rate_ptr->commands;
|
||||
rate_new->new_def = TRUE;
|
||||
@ -1398,7 +1398,7 @@ rate_copy(const struct rate *rate_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct rate * Phreeqc::
|
||||
class rate * Phreeqc::
|
||||
rate_search(const char *name_in, int *n)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1456,7 +1456,7 @@ rate_sort(void)
|
||||
*/
|
||||
if (rates.size() > 1)
|
||||
{
|
||||
qsort(&rates[0], rates.size(), sizeof(struct rate),
|
||||
qsort(&rates[0], rates.size(), sizeof(class rate),
|
||||
rate_compare);
|
||||
}
|
||||
return (OK);
|
||||
@ -1467,7 +1467,7 @@ rate_sort(void)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct species * Phreeqc::
|
||||
class species * Phreeqc::
|
||||
s_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -1476,8 +1476,8 @@ s_alloc(void)
|
||||
* return: pointer to a species structure
|
||||
*/
|
||||
{
|
||||
struct species *s_ptr;
|
||||
s_ptr = new struct species;
|
||||
class species *s_ptr;
|
||||
s_ptr = new class species;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -1491,9 +1491,9 @@ int Phreeqc::
|
||||
s_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct species *s_ptr1, *s_ptr2;
|
||||
s_ptr1 = *(const struct species **) ptr1;
|
||||
s_ptr2 = *(const struct species **) ptr2;
|
||||
const class species *s_ptr1, *s_ptr2;
|
||||
s_ptr1 = *(const class species **) ptr1;
|
||||
s_ptr2 = *(const class species **) ptr2;
|
||||
return (strcmp(s_ptr1->name, s_ptr2->name));
|
||||
|
||||
}
|
||||
@ -1507,14 +1507,14 @@ s_delete(int i)
|
||||
* Delete species i: free memory and renumber array of pointers, s.
|
||||
*/
|
||||
s_free(s[i]);
|
||||
s[i] = (struct species *) free_check_null(s[i]);
|
||||
s[i] = (class species *) free_check_null(s[i]);
|
||||
s.erase(s.begin() + i);
|
||||
return (OK);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
s_free(struct species *s_ptr)
|
||||
s_free(class species *s_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -1531,7 +1531,7 @@ s_free(struct species *s_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
s_init(struct species *s_ptr)
|
||||
s_init(class species *s_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a species structure
|
||||
@ -1605,7 +1605,7 @@ s_init(struct species *s_ptr)
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct species* Phreeqc::
|
||||
class species* Phreeqc::
|
||||
s_search(const char* name)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1619,8 +1619,8 @@ s_search(const char* name)
|
||||
* If found, pointer to the appropriate species structure is returned.
|
||||
* else, NULL pointer is returned.
|
||||
*/
|
||||
struct species* s_ptr = NULL;
|
||||
std::map<std::string, struct species*>::iterator s_it =
|
||||
class species* s_ptr = NULL;
|
||||
std::map<std::string, class species*>::iterator s_it =
|
||||
species_map.find(name);
|
||||
if (s_it != species_map.end())
|
||||
{
|
||||
@ -1629,7 +1629,7 @@ s_search(const char* name)
|
||||
return (s_ptr);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct species * Phreeqc::
|
||||
class species * Phreeqc::
|
||||
s_store(const char *name, LDBLE l_z, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -1660,7 +1660,7 @@ s_store(const char *name, LDBLE l_z, int replace_if_found)
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
struct species* s_ptr = NULL;
|
||||
class species* s_ptr = NULL;
|
||||
s_ptr = s_search(name);
|
||||
if (s_ptr != NULL && replace_if_found == FALSE)
|
||||
{
|
||||
@ -1694,10 +1694,10 @@ isotope_compare(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
const struct isotope *iso_ptr1, *iso_ptr2;
|
||||
const class isotope *iso_ptr1, *iso_ptr2;
|
||||
|
||||
iso_ptr1 = (const struct isotope *) ptr1;
|
||||
iso_ptr2 = (const struct isotope *) ptr2;
|
||||
iso_ptr1 = (const class isotope *) ptr1;
|
||||
iso_ptr2 = (const class isotope *) ptr2;
|
||||
i = strcmp_nocase(iso_ptr1->elt_name, iso_ptr2->elt_name);
|
||||
if (i != 0)
|
||||
return (i);
|
||||
@ -1723,10 +1723,10 @@ species_list_compare(const void *ptr1, const void *ptr2)
|
||||
{
|
||||
int j;
|
||||
const char *name1, *name2;
|
||||
const struct species_list *nptr1, *nptr2;
|
||||
const class species_list *nptr1, *nptr2;
|
||||
|
||||
nptr1 = (const struct species_list *) ptr1;
|
||||
nptr2 = (const struct species_list *) ptr2;
|
||||
nptr1 = (const class species_list *) ptr1;
|
||||
nptr2 = (const class species_list *) ptr2;
|
||||
|
||||
/*
|
||||
* Put H+ first
|
||||
@ -1797,11 +1797,11 @@ int Phreeqc::
|
||||
species_list_compare_alk(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct species_list *nptr1, *nptr2;
|
||||
const class species_list *nptr1, *nptr2;
|
||||
LDBLE alk1, alk2;
|
||||
|
||||
nptr1 = (const struct species_list *) ptr1;
|
||||
nptr2 = (const struct species_list *) ptr2;
|
||||
nptr1 = (const class species_list *) ptr1;
|
||||
nptr2 = (const class species_list *) ptr2;
|
||||
/*
|
||||
* Else, descending order by log molality
|
||||
*/
|
||||
@ -1827,10 +1827,10 @@ species_list_compare_master(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const char *name1, *name2;
|
||||
const struct species_list *nptr1, *nptr2;
|
||||
const class species_list *nptr1, *nptr2;
|
||||
|
||||
nptr1 = (const struct species_list *) ptr1;
|
||||
nptr2 = (const struct species_list *) ptr2;
|
||||
nptr1 = (const class species_list *) ptr1;
|
||||
nptr2 = (const class species_list *) ptr2;
|
||||
|
||||
/*
|
||||
* Put H+ first
|
||||
@ -1886,7 +1886,7 @@ species_list_sort(void)
|
||||
if (species_list.size() > 1)
|
||||
{
|
||||
qsort(&species_list[0], species_list.size(),
|
||||
sizeof(struct species_list), species_list_compare);
|
||||
sizeof(class species_list), species_list_compare);
|
||||
}
|
||||
return (OK);
|
||||
}
|
||||
@ -1916,11 +1916,11 @@ change_surf_alloc(int count)
|
||||
return (change_surf);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct master * Phreeqc::
|
||||
class master * Phreeqc::
|
||||
surface_get_psi_master(const char *name, int plane)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
std::string token;
|
||||
|
||||
if (name == NULL)
|
||||
@ -1951,7 +1951,7 @@ surface_get_psi_master(const char *name, int plane)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
bool Phreeqc::
|
||||
phase_rxn_to_trxn(struct phase* phase_ptr, CReaction& rxn_ref)
|
||||
phase_rxn_to_trxn(class phase* phase_ptr, CReaction& rxn_ref)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2021,7 +2021,7 @@ trxn_add(CReaction& r_ref, double coef, bool combine)
|
||||
/*
|
||||
* Copy equation into work space
|
||||
*/
|
||||
struct rxn_token* next_token = &r_ref.token[0];
|
||||
class rxn_token* next_token = &r_ref.token[0];
|
||||
while (next_token->s != NULL)
|
||||
{
|
||||
if (count_trxn + 1 > trxn.token.size())
|
||||
@ -2056,7 +2056,7 @@ trxn_add_phase(CReaction& r_ref, double coef, bool combine)
|
||||
* like terms combined.
|
||||
*/
|
||||
int i;
|
||||
struct rxn_token* next_token;
|
||||
class rxn_token* next_token;
|
||||
/*
|
||||
* Accumulate log k for reaction
|
||||
*/
|
||||
@ -2164,9 +2164,9 @@ int Phreeqc::
|
||||
trxn_compare(const void* ptr1, const void* ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct rxn_token_temp* rxn_token_temp_ptr1, * rxn_token_temp_ptr2;
|
||||
rxn_token_temp_ptr1 = (const struct rxn_token_temp*)ptr1;
|
||||
rxn_token_temp_ptr2 = (const struct rxn_token_temp*)ptr2;
|
||||
const class rxn_token_temp* rxn_token_temp_ptr1, * rxn_token_temp_ptr2;
|
||||
rxn_token_temp_ptr1 = (const class rxn_token_temp*)ptr1;
|
||||
rxn_token_temp_ptr2 = (const class rxn_token_temp*)ptr2;
|
||||
return (strcmp(rxn_token_temp_ptr1->name, rxn_token_temp_ptr2->name));
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -2347,7 +2347,7 @@ trxn_sort(void)
|
||||
{
|
||||
qsort(&trxn.token[1],
|
||||
(size_t)count_trxn - 1,
|
||||
sizeof(struct rxn_token_temp),
|
||||
sizeof(class rxn_token_temp),
|
||||
trxn_compare);
|
||||
}
|
||||
return (OK);
|
||||
@ -2416,7 +2416,7 @@ trxn_swap(const char *token)
|
||||
*
|
||||
* ********************************************************************** */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct unknown * Phreeqc::
|
||||
class unknown * Phreeqc::
|
||||
unknown_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -2425,11 +2425,11 @@ unknown_alloc(void)
|
||||
* arguments: void
|
||||
* return: pointer to an "unknown" structure
|
||||
*/
|
||||
struct unknown *unknown_ptr;
|
||||
class unknown *unknown_ptr;
|
||||
/*
|
||||
* Allocate space
|
||||
*/
|
||||
unknown_ptr = new struct unknown;
|
||||
unknown_ptr = new class unknown;
|
||||
/*
|
||||
* set pointers in structure to NULL
|
||||
*/
|
||||
@ -2488,7 +2488,7 @@ unknown_delete(int i)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
unknown_free(struct unknown *unknown_ptr)
|
||||
unknown_free(class unknown *unknown_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2532,7 +2532,7 @@ system_duplicate(int i, int save_old)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct logk * Phreeqc::
|
||||
class logk * Phreeqc::
|
||||
logk_store(const char *name_in, int replace_if_found)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -2559,10 +2559,10 @@ logk_store(const char *name_in, int replace_if_found)
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
struct logk* logk_ptr = NULL;
|
||||
class logk* logk_ptr = NULL;
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct logk*>::iterator it =
|
||||
std::map<std::string, class logk*>::iterator it =
|
||||
logk_map.find(name);
|
||||
|
||||
if (it != logk_map.end() && replace_if_found == FALSE)
|
||||
@ -2593,7 +2593,7 @@ logk_store(const char *name_in, int replace_if_found)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct logk * Phreeqc::
|
||||
class logk * Phreeqc::
|
||||
logk_alloc(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
@ -2602,8 +2602,8 @@ logk_alloc(void)
|
||||
* return: pointer to a logk structure
|
||||
*/
|
||||
{
|
||||
struct logk *logk_ptr;
|
||||
logk_ptr = new struct logk;
|
||||
class logk *logk_ptr;
|
||||
logk_ptr = new class logk;
|
||||
/*
|
||||
* set pointers in structure to NULL, variables to zero
|
||||
*/
|
||||
@ -2614,7 +2614,7 @@ logk_alloc(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
logk_init(struct logk *logk_ptr)
|
||||
logk_init(class logk *logk_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* return: pointer to a logk structure
|
||||
@ -2640,7 +2640,7 @@ logk_init(struct logk *logk_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
logk_copy2orig(struct logk *logk_ptr)
|
||||
logk_copy2orig(class logk *logk_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* Copies log k data to logk_original
|
||||
@ -2655,7 +2655,7 @@ logk_copy2orig(struct logk *logk_ptr)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
struct logk * Phreeqc::
|
||||
class logk * Phreeqc::
|
||||
logk_search(const char *name_in)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
@ -2669,13 +2669,13 @@ logk_search(const char *name_in)
|
||||
* pointer to logk structure "logk" where "name" can be found.
|
||||
* or NULL if not found.
|
||||
*/
|
||||
struct logk *logk_ptr;
|
||||
class logk *logk_ptr;
|
||||
/*
|
||||
* Search list
|
||||
*/
|
||||
std::string name = name_in;
|
||||
str_tolower(name);
|
||||
std::map<std::string, struct logk*>::iterator l_it =
|
||||
std::map<std::string, class logk*>::iterator l_it =
|
||||
logk_map.find(name);
|
||||
if (l_it != logk_map.end())
|
||||
{
|
||||
@ -2866,7 +2866,7 @@ get_entity_enum(char *name)
|
||||
*/
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
copier_add(struct copier *copier_ptr, int n_user, int start, int end)
|
||||
copier_add(class copier *copier_ptr, int n_user, int start, int end)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* add new set of copy instructions
|
||||
@ -2879,7 +2879,7 @@ copier_add(struct copier *copier_ptr, int n_user, int start, int end)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
copier_clear(struct copier* copier_ptr)
|
||||
copier_clear(class copier* copier_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/*
|
||||
* clear copier
|
||||
|
||||
@ -117,8 +117,8 @@ get_all_components(void)
|
||||
* Buffer contains an entry for every primary master
|
||||
* species that can be used in the transport problem.
|
||||
*/
|
||||
t_buffer = (struct tally_buffer *) PHRQ_malloc(
|
||||
(size_t)tally_count_component * sizeof(struct tally_buffer));
|
||||
t_buffer = (class tally_buffer *) PHRQ_malloc(
|
||||
(size_t)tally_count_component * sizeof(class tally_buffer));
|
||||
|
||||
// store alkalinity
|
||||
j = 0;
|
||||
@ -320,12 +320,12 @@ free_tally_table(void)
|
||||
tally_table[i].formula.clear();
|
||||
for (k = 0; k < 3; k++)
|
||||
{
|
||||
tally_table[i].total[k] = (struct tally_buffer *) free_check_null(
|
||||
tally_table[i].total[k] = (class tally_buffer *) free_check_null(
|
||||
tally_table[i].total[k]);
|
||||
}
|
||||
}
|
||||
tally_table = (struct tally *) free_check_null(tally_table);
|
||||
t_buffer = (struct tally_buffer *) free_check_null(t_buffer);
|
||||
tally_table = (class tally *) free_check_null(tally_table);
|
||||
t_buffer = (class tally_buffer *) free_check_null(t_buffer);
|
||||
return (OK);
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
||||
cxxNameDouble::iterator jit = solution_ptr->Get_totals().begin();
|
||||
for ( ; jit != solution_ptr->Get_totals().end(); jit++)
|
||||
{
|
||||
struct master *master_ptr = master_bsearch(jit->first.c_str());
|
||||
class master *master_ptr = master_bsearch(jit->first.c_str());
|
||||
master_ptr->total = jit->second;
|
||||
}
|
||||
|
||||
@ -594,7 +594,7 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
||||
{
|
||||
comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
if (phase_ptr->name == tally_table[i].name)
|
||||
break;
|
||||
if (strcmp_nocase(phase_ptr->name, tally_table[i].name) == 0)
|
||||
@ -632,7 +632,7 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
||||
for (size_t l = 0; l < gc->size(); l++)
|
||||
{
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch((*gc)[l].Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch((*gc)[l].Get_phase_name().c_str(), &k, FALSE);
|
||||
|
||||
add_elt_list(phase_ptr->next_elt, (*gc)[l].Get_moles());
|
||||
}
|
||||
@ -690,7 +690,7 @@ fill_tally_table(int *n_user, int index_conservative, int n_buffer)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
elt_list_to_tally_table(struct tally_buffer *buffer_ptr)
|
||||
elt_list_to_tally_table(class tally_buffer *buffer_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j;
|
||||
@ -735,7 +735,7 @@ elt_list_to_tally_table(struct tally_buffer *buffer_ptr)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
master_to_tally_table(struct tally_buffer *buffer_ptr)
|
||||
master_to_tally_table(class tally_buffer *buffer_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j;
|
||||
@ -789,7 +789,7 @@ build_tally_table(void)
|
||||
int j, k, l, p, save_print_use;
|
||||
size_t n;
|
||||
int count_tt_pure_phase, count_tt_ss_phase, count_tt_kinetics;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
char token[MAX_LENGTH];
|
||||
const char* cptr;
|
||||
/*
|
||||
@ -877,7 +877,7 @@ build_tally_table(void)
|
||||
{
|
||||
cxxPPassemblageComp * comp_ptr = &(jit->second);
|
||||
int l;
|
||||
struct phase * phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
class phase * phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
/*
|
||||
* check if already in tally_table
|
||||
*/
|
||||
@ -939,7 +939,7 @@ build_tally_table(void)
|
||||
{
|
||||
cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
|
||||
/*
|
||||
* check if already in tally_table
|
||||
*/
|
||||
@ -1155,7 +1155,7 @@ calc_dummy_kinetic_reaction_tally(cxxKinetics *kinetics_ptr)
|
||||
*/
|
||||
LDBLE coef;
|
||||
const char* cptr;
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
/*
|
||||
* Go through list and generate list of elements and
|
||||
* coefficient of elements in reaction
|
||||
@ -1205,14 +1205,14 @@ extend_tally_table(void)
|
||||
* adds another column to tally_table
|
||||
* increments number of columns
|
||||
*/
|
||||
tally_table = (struct tally *) PHRQ_realloc((void *) tally_table,
|
||||
(count_tally_table_columns + 1) * sizeof(struct tally));
|
||||
tally_table = (class tally *) PHRQ_realloc((void *) tally_table,
|
||||
(count_tally_table_columns + 1) * sizeof(class tally));
|
||||
if (tally_table == NULL)
|
||||
malloc_error();
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
tally_table[count_tally_table_columns].total[i] = (struct tally_buffer *)
|
||||
PHRQ_malloc(count_tally_table_rows * sizeof(struct tally_buffer));
|
||||
tally_table[count_tally_table_columns].total[i] = (class tally_buffer *)
|
||||
PHRQ_malloc(count_tally_table_rows * sizeof(class tally_buffer));
|
||||
if (tally_table[count_tally_table_columns].total[i] == NULL)
|
||||
malloc_error();
|
||||
for (j = 0; j < count_tally_table_rows; j++)
|
||||
|
||||
@ -150,14 +150,14 @@ tidy_model(void)
|
||||
/* species */
|
||||
if (new_model == TRUE)
|
||||
{
|
||||
if (s.size() > 1) qsort(&s[0], s.size(), sizeof(struct species *), s_compare);
|
||||
if (s.size() > 1) qsort(&s[0], s.size(), sizeof(class species *), s_compare);
|
||||
|
||||
/* master species */
|
||||
if (master.size() > 1) qsort(&master[0], master.size(), sizeof(struct master *), master_compare);
|
||||
if (master.size() > 1) qsort(&master[0], master.size(), sizeof(class master *), master_compare);
|
||||
/* elements */
|
||||
if (elements.size() > 1) qsort(&elements[0], elements.size(), sizeof(struct element *), element_compare);
|
||||
if (elements.size() > 1) qsort(&elements[0], elements.size(), sizeof(class element *), element_compare);
|
||||
/* phases */
|
||||
if (phases.size() > 1) qsort(&phases[0], phases.size(), sizeof(struct phase *), phase_compare);
|
||||
if (phases.size() > 1) qsort(&phases[0], phases.size(), sizeof(class phase *), phase_compare);
|
||||
|
||||
}
|
||||
|
||||
@ -550,12 +550,12 @@ tidy_logk(void)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
add_other_logk(LDBLE * source_k, std::vector<struct name_coef> &add_logk)
|
||||
add_other_logk(LDBLE * source_k, std::vector<class name_coef> &add_logk)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int j;
|
||||
bool analytic;
|
||||
struct logk *logk_ptr;
|
||||
class logk *logk_ptr;
|
||||
LDBLE coef;
|
||||
|
||||
for (size_t i = 0; i < add_logk.size(); i++)
|
||||
@ -563,7 +563,7 @@ add_other_logk(LDBLE * source_k, std::vector<struct name_coef> &add_logk)
|
||||
coef = add_logk[i].coef;
|
||||
std::string token = add_logk[i].name;
|
||||
str_tolower(token);
|
||||
std::map<std::string, struct logk *>::iterator l_it = logk_map.find(token);
|
||||
std::map<std::string, class logk *>::iterator l_it = logk_map.find(token);
|
||||
if (l_it == logk_map.end())
|
||||
{
|
||||
input_error++;
|
||||
@ -605,11 +605,11 @@ add_other_logk(LDBLE * source_k, std::vector<struct name_coef> &add_logk)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
add_logks(struct logk *logk_ptr, int repeats)
|
||||
add_logks(class logk *logk_ptr, int repeats)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j;
|
||||
struct logk *next_logk_ptr;
|
||||
class logk *next_logk_ptr;
|
||||
LDBLE coef;
|
||||
/*
|
||||
* Adds in other named_expressions to get complete log K
|
||||
@ -628,7 +628,7 @@ add_logks(struct logk *logk_ptr, int repeats)
|
||||
coef = logk_ptr->add_logk[i].coef;
|
||||
std::string token = logk_ptr->add_logk[i].name;
|
||||
str_tolower(token);
|
||||
std::map<std::string, struct logk*>::iterator l_it = logk_map.find(token);
|
||||
std::map<std::string, class logk*>::iterator l_it = logk_map.find(token);
|
||||
if (l_it == logk_map.end())
|
||||
{
|
||||
input_error++;
|
||||
@ -658,14 +658,14 @@ add_logks(struct logk *logk_ptr, int repeats)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
LDBLE Phreeqc::
|
||||
coef_in_master(struct master * master_ptr)
|
||||
coef_in_master(class master * master_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int l;
|
||||
LDBLE coef;
|
||||
const char* cptr;
|
||||
std::string elt_name;
|
||||
const struct elt_list *next_elt;
|
||||
const class elt_list *next_elt;
|
||||
|
||||
coef = 0.0;
|
||||
cptr = master_ptr->elt->name;
|
||||
@ -693,7 +693,7 @@ rewrite_eqn_to_secondary(void)
|
||||
*/
|
||||
LDBLE coef;
|
||||
int repeat, i, add_count;
|
||||
struct rxn_token_temp *token_ptr;
|
||||
class rxn_token_temp *token_ptr;
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@ -754,8 +754,8 @@ replace_solids_gases(void)
|
||||
LDBLE coef;
|
||||
int n;
|
||||
int repeat, i, add_count;
|
||||
struct rxn_token_temp *token_ptr;
|
||||
struct phase *phase_ptr;
|
||||
class rxn_token_temp *token_ptr;
|
||||
class phase *phase_ptr;
|
||||
int replaced;
|
||||
char token[MAX_LENGTH];
|
||||
/*
|
||||
@ -914,7 +914,7 @@ tidy_gas_phase(void)
|
||||
for (size_t j = 0; j < gas_phase_ptr->Get_gas_comps().size(); j++)
|
||||
{
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j].Get_phase_name().c_str(), &k, FALSE);
|
||||
if (phase_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -1016,13 +1016,13 @@ tidy_gas_phase(void)
|
||||
|
||||
if (PR && P > 0)
|
||||
{
|
||||
std::vector<struct phase *> phase_ptrs;
|
||||
std::vector<class phase *> phase_ptrs;
|
||||
size_t j_PR;
|
||||
std::vector<cxxGasComp> &gc = gas_phase_ptr->Get_gas_comps();
|
||||
for (j_PR = 0; j_PR < gas_phase_ptr->Get_gas_comps().size(); j_PR++)
|
||||
{
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j_PR].Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gas_phase_ptr->Get_gas_comps()[j_PR].Get_phase_name().c_str(), &k, FALSE);
|
||||
if (gc[j_PR].Get_p_read() == 0)
|
||||
{
|
||||
gc[j_PR].Set_moles(0.0);
|
||||
@ -1046,7 +1046,7 @@ tidy_gas_phase(void)
|
||||
for (j_PR = 0; j_PR < gas_phase_ptr->Get_gas_comps().size(); j_PR++)
|
||||
{
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(gc[j_PR].Get_phase_name().c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(gc[j_PR].Get_phase_name().c_str(), &k, FALSE);
|
||||
if (gc[j_PR].Get_p_read() == 0)
|
||||
{
|
||||
gc[j_PR].Set_moles(0.0);
|
||||
@ -1102,9 +1102,9 @@ tidy_inverse(void)
|
||||
int i, j, k, l;
|
||||
int count_in;
|
||||
LDBLE value;
|
||||
struct master *master_ptr;
|
||||
struct master *master_alk_ptr;
|
||||
const struct elt_list *elt_list_ptr;
|
||||
class master *master_ptr;
|
||||
class master *master_alk_ptr;
|
||||
const class elt_list *elt_list_ptr;
|
||||
master_alk_ptr = master_bsearch("Alkalinity");
|
||||
for (i = 0; i < count_inverse; i++)
|
||||
{
|
||||
@ -1259,7 +1259,7 @@ tidy_inverse(void)
|
||||
}
|
||||
qsort(&inverse[i].phases[j].isotopes[0],
|
||||
inverse[i].phases[j].isotopes.size(),
|
||||
sizeof(struct isotope), isotope_compare);
|
||||
sizeof(class isotope), isotope_compare);
|
||||
}
|
||||
add_elt_list(inverse[i].phases[j].phase->next_elt, 1.0);
|
||||
|
||||
@ -1336,7 +1336,7 @@ tidy_inverse(void)
|
||||
/*
|
||||
* Save list of master species in inv_elts structure
|
||||
*/
|
||||
std::vector<struct inv_elts> inv_elts;
|
||||
std::vector<class inv_elts> inv_elts;
|
||||
inv_elts.resize(count_in);
|
||||
count_in = 0;
|
||||
for (j = 0; j < (int)master.size(); j++)
|
||||
@ -1547,7 +1547,7 @@ tidy_pp_assemblage(void)
|
||||
for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
|
||||
{
|
||||
int k;
|
||||
struct phase *phase_ptr = phase_bsearch(it->first.c_str(), &k, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(it->first.c_str(), &k, FALSE);
|
||||
if (phase_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -1610,7 +1610,7 @@ int Phreeqc::
|
||||
tidy_ss_assemblage(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
struct phase *phase_ptr;
|
||||
class phase *phase_ptr;
|
||||
LDBLE nb, nc, n_tot, xb, xc, dnb, dnc, l_a0, l_a1;
|
||||
LDBLE xb2, xb3, xb4, xc2, xc3;
|
||||
LDBLE moles;
|
||||
@ -2242,7 +2242,7 @@ tidy_species(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i, j;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
char c;
|
||||
const char* cptr;
|
||||
/*
|
||||
@ -2610,8 +2610,8 @@ tidy_surface(void)
|
||||
cxxNameDouble::iterator jit = comp_ptr->Get_totals().begin();
|
||||
for ( ; jit != comp_ptr->Get_totals().end(); jit++ )
|
||||
{
|
||||
struct element *elt_ptr = element_store(jit->first.c_str());
|
||||
struct master *master_ptr = elt_ptr->master;
|
||||
class element *elt_ptr = element_store(jit->first.c_str());
|
||||
class master *master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -2713,7 +2713,7 @@ tidy_solutions(void)
|
||||
* Define n_user for any solutions read by solution_spread that
|
||||
* don`t have n_user defined
|
||||
*/
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
/*
|
||||
* Calculate solution numbers
|
||||
@ -2806,7 +2806,7 @@ tidy_solutions(void)
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
species_rxn_to_trxn(struct species *s_ptr)
|
||||
species_rxn_to_trxn(class species *s_ptr)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/*
|
||||
@ -2841,7 +2841,7 @@ tidy_isotopes(void)
|
||||
* Isotope ratios for each element or element valence state
|
||||
*/
|
||||
LDBLE isotope_number;
|
||||
struct master *master_ptr, *primary_ptr;
|
||||
class master *master_ptr, *primary_ptr;
|
||||
|
||||
size_t primary_number = 0;
|
||||
primary_ptr = NULL;
|
||||
@ -3049,7 +3049,7 @@ tidy_kin_exchange(void)
|
||||
for (; kit != nd.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element *elt_ptr = element_store(kit->first.c_str());
|
||||
class element *elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3155,7 +3155,7 @@ update_kin_exchange(void)
|
||||
for (; kit != nd.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(kit->first.c_str());
|
||||
class element* elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3230,7 +3230,7 @@ update_kin_exchange(void)
|
||||
for (kit = nd_formula.begin(); kit != nd_formula.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(kit->first.c_str());
|
||||
class element* elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr->master->type == EX)
|
||||
{
|
||||
comp_coef = kit->second;
|
||||
@ -3297,7 +3297,7 @@ tidy_min_exchange(void)
|
||||
for (; kit != nd.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element *elt_ptr = element_store(kit->first.c_str());
|
||||
class element *elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3371,7 +3371,7 @@ tidy_min_exchange(void)
|
||||
get_elts_in_species(&cptr, -comp_ref.Get_phase_proportion());
|
||||
}
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
{
|
||||
cptr = phase_ptr->formula;
|
||||
@ -3440,7 +3440,7 @@ update_min_exchange(void)
|
||||
for (; kit != nd.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(kit->first.c_str());
|
||||
class element* elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3514,7 +3514,7 @@ update_min_exchange(void)
|
||||
for (kit = nd_formula.begin(); kit != nd_formula.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(kit->first.c_str());
|
||||
class element* elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr->master->type == EX)
|
||||
{
|
||||
comp_coef = kit->second;
|
||||
@ -3541,7 +3541,7 @@ update_min_exchange(void)
|
||||
get_elts_in_species(&cptr, -comp_ref.Get_phase_proportion());
|
||||
}
|
||||
int l;
|
||||
struct phase* phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
class phase* phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
if (phase_ptr != NULL)
|
||||
{
|
||||
cptr = phase_ptr->formula;
|
||||
@ -3619,8 +3619,8 @@ tidy_min_surface(void)
|
||||
for (it = surface_comp_ptr->Get_totals().begin(); it != surface_comp_ptr->Get_totals().end(); it++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
struct master *master_ptr = elt_ptr->master;
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
class master *master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3676,7 +3676,7 @@ tidy_min_surface(void)
|
||||
continue;
|
||||
}
|
||||
int l;
|
||||
struct phase *phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
class phase *phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
if (phase_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3739,7 +3739,7 @@ tidy_min_surface(void)
|
||||
{
|
||||
|
||||
// Warn if not master species and charge balanced
|
||||
struct element *elt_ptr = element_store(comp_jj_ptr->Get_master_element().c_str());
|
||||
class element *elt_ptr = element_store(comp_jj_ptr->Get_master_element().c_str());
|
||||
if (elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3798,7 +3798,7 @@ tidy_min_surface(void)
|
||||
//&& elt_list[jj].elt->primary->s != s_h2o
|
||||
)
|
||||
{
|
||||
struct element *elt_ptr = element_store(surface_comp_ptr->Get_master_element().c_str());
|
||||
class element *elt_ptr = element_store(surface_comp_ptr->Get_master_element().c_str());
|
||||
error_string = sformatf(
|
||||
"Element %s in sum of surface sites,\n"
|
||||
"\t including %s * %g mol sites/mol phase,\n"
|
||||
@ -3857,8 +3857,8 @@ update_min_surface(void)
|
||||
for (it = surface_comp_ptr->Get_totals().begin(); it != surface_comp_ptr->Get_totals().end(); it++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(it->first.c_str());
|
||||
struct master* master_ptr = elt_ptr->master;
|
||||
class element* elt_ptr = element_store(it->first.c_str());
|
||||
class master* master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3914,7 +3914,7 @@ update_min_surface(void)
|
||||
continue;
|
||||
}
|
||||
int l;
|
||||
struct phase* phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
class phase* phase_ptr = phase_bsearch(jit->first.c_str(), &l, FALSE);
|
||||
if (phase_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -3972,8 +3972,8 @@ tidy_kin_surface(void)
|
||||
*/
|
||||
{
|
||||
cxxKinetics *kinetics_ptr;
|
||||
struct phase *phase_ptr;
|
||||
std::vector<struct elt_list> elt_list_kinetics;
|
||||
class phase *phase_ptr;
|
||||
std::vector<class elt_list> elt_list_kinetics;
|
||||
size_t count_elts_kinetics;
|
||||
|
||||
//std::map<int, cxxSurface>::iterator it;
|
||||
@ -4008,8 +4008,8 @@ tidy_kin_surface(void)
|
||||
for (kit = comp_ptr->Get_totals().begin(); kit != comp_ptr->Get_totals().end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element *elt_ptr = element_store(kit->first.c_str());
|
||||
struct master *master_ptr = elt_ptr->master;
|
||||
class element *elt_ptr = element_store(kit->first.c_str());
|
||||
class master *master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -4262,8 +4262,8 @@ update_kin_surface(void)
|
||||
for (kit = comp_ptr->Get_totals().begin(); kit != comp_ptr->Get_totals().end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element* elt_ptr = element_store(kit->first.c_str());
|
||||
struct master* master_ptr = elt_ptr->master;
|
||||
class element* elt_ptr = element_store(kit->first.c_str());
|
||||
class master* master_ptr = elt_ptr->master;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -4395,8 +4395,8 @@ ss_prep(LDBLE t, cxxSS *ss_ptr, int print)
|
||||
ag1 = a1 * rt;
|
||||
cxxSScomp *comp0_ptr = &(ss_ptr->Get_ss_comps()[0]);
|
||||
cxxSScomp *comp1_ptr = &(ss_ptr->Get_ss_comps()[1]);
|
||||
struct phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &k, FALSE);
|
||||
struct phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &k, FALSE);
|
||||
class phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &k, FALSE);
|
||||
class phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &k, FALSE);
|
||||
kc = exp(k_calc(phase0_ptr->rxn.logk, t, REF_PRES_PASCAL) * LOG_10);
|
||||
kb = exp(k_calc(phase1_ptr->rxn.logk, t, REF_PRES_PASCAL) * LOG_10);
|
||||
crit_pt = fabs(a0) + fabs(a1);
|
||||
@ -5006,8 +5006,8 @@ ss_calc_a0_a1(cxxSS *ss_ptr)
|
||||
cxxSScomp *comp0_ptr = &(ss_ptr->Get_ss_comps()[0]);
|
||||
cxxSScomp *comp1_ptr = &(ss_ptr->Get_ss_comps()[1]);
|
||||
int k;
|
||||
struct phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &k, FALSE);
|
||||
struct phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &k, FALSE);
|
||||
class phase *phase0_ptr = phase_bsearch(comp0_ptr->Get_name().c_str(), &k, FALSE);
|
||||
class phase *phase1_ptr = phase_bsearch(comp1_ptr->Get_name().c_str(), &k, FALSE);
|
||||
if (phase0_ptr == NULL || phase1_ptr == NULL)
|
||||
{
|
||||
input_error++;
|
||||
@ -5356,7 +5356,7 @@ tidy_master_isotope(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
class master *master_ptr;
|
||||
|
||||
for (i = 0; i < (int)master_isotope.size(); i++)
|
||||
{
|
||||
@ -5392,9 +5392,9 @@ tidy_isotope_ratios(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct master *master_ptr;
|
||||
struct master_isotope *master_isotope_ptr;
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
class master *master_ptr;
|
||||
class master_isotope *master_isotope_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
|
||||
for (i = 0; i < (int)isotope_ratio.size(); i++)
|
||||
{
|
||||
@ -5439,8 +5439,8 @@ tidy_isotope_alphas(void)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
int i;
|
||||
struct calculate_value *calculate_value_ptr;
|
||||
struct logk *logk_ptr;
|
||||
class calculate_value *calculate_value_ptr;
|
||||
class logk *logk_ptr;
|
||||
|
||||
for (i = 0; i < (int)isotope_alpha.size(); i++)
|
||||
{
|
||||
@ -5533,7 +5533,7 @@ tidy_exchange(void)
|
||||
for (; kit != nd.end(); kit++)
|
||||
{
|
||||
/* Find master species */
|
||||
struct element *elt_ptr = element_store(kit->first.c_str());
|
||||
class element *elt_ptr = element_store(kit->first.c_str());
|
||||
if (elt_ptr == NULL || elt_ptr->master == NULL)
|
||||
{
|
||||
input_error++;
|
||||
|
||||
@ -39,9 +39,9 @@ struct CT /* summed parts of V_M and mcd transfer in a timestep for all cells, f
|
||||
LDBLE A_ij_il, Dz2c_il, mixf_il;
|
||||
int J_ij_count_spec, J_ij_il_count_spec;
|
||||
struct V_M *v_m, *v_m_il;
|
||||
struct J_ij *J_ij, *J_ij_il;
|
||||
class J_ij *J_ij, *J_ij_il;
|
||||
int count_m_s;
|
||||
struct M_S *m_s;
|
||||
class M_S *m_s;
|
||||
int v_m_size, J_ij_size, m_s_size;
|
||||
} *ct = NULL;
|
||||
struct MOLES_ADDED /* total moles added to balance negative conc's */
|
||||
@ -97,7 +97,7 @@ transport(void)
|
||||
|
||||
if (multi_Dflag)
|
||||
{
|
||||
sol_D = (struct sol_D *) PHRQ_malloc((size_t) (all_cells)* sizeof(struct sol_D));
|
||||
sol_D = (class sol_D *) PHRQ_malloc((size_t) (all_cells)* sizeof(class sol_D));
|
||||
if (sol_D == NULL)
|
||||
malloc_error();
|
||||
for (i = 0; i < all_cells; i++)
|
||||
@ -994,16 +994,16 @@ transport_cleanup(void)
|
||||
{
|
||||
for (i = 0; i < all_cells; i++)
|
||||
{
|
||||
sol_D[i].spec = (struct spec *) free_check_null(sol_D[i].spec);
|
||||
sol_D[i].spec = (class spec *) free_check_null(sol_D[i].spec);
|
||||
}
|
||||
sol_D = (struct sol_D *) free_check_null(sol_D);
|
||||
sol_D = (class sol_D *) free_check_null(sol_D);
|
||||
for (int i = 0; i < all_cells; i++)
|
||||
{
|
||||
ct[i].v_m = (struct V_M *) free_check_null(ct[i].v_m);
|
||||
ct[i].v_m_il = (struct V_M *) free_check_null(ct[i].v_m_il);
|
||||
ct[i].J_ij = (struct J_ij *) free_check_null(ct[i].J_ij);
|
||||
ct[i].J_ij_il = (struct J_ij *) free_check_null(ct[i].J_ij_il);
|
||||
ct[i].m_s = (struct M_S *) free_check_null(ct[i].m_s);
|
||||
ct[i].J_ij = (class J_ij *) free_check_null(ct[i].J_ij);
|
||||
ct[i].J_ij_il = (class J_ij *) free_check_null(ct[i].J_ij_il);
|
||||
ct[i].m_s = (class M_S *) free_check_null(ct[i].m_s);
|
||||
}
|
||||
ct = (struct CT *) free_check_null(ct);
|
||||
for (int i = 0; i < count_moles_added; i++)
|
||||
@ -1796,8 +1796,8 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
int i, i1, i2, i3, count_spec, count_exch_spec, size_xt;
|
||||
char token[MAX_LENGTH];
|
||||
const char * name;
|
||||
struct species *s_ptr, *s_ptr2;
|
||||
struct master *master_ptr;
|
||||
class species *s_ptr, *s_ptr2;
|
||||
class master *master_ptr;
|
||||
LDBLE dum, dum2;
|
||||
LDBLE lm;
|
||||
LDBLE por, por_il, viscos_f, viscos_il_f, viscos;
|
||||
@ -1813,15 +1813,15 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
dif_spec_names.clear();
|
||||
size_xt = 5;
|
||||
|
||||
//sol_D[l_cell_no].spec = (struct spec *) free_check_null(sol_D[l_cell_no].spec);
|
||||
//sol_D[l_cell_no].spec = (class spec *) free_check_null(sol_D[l_cell_no].spec);
|
||||
if (sol_D[l_cell_no].spec == NULL)
|
||||
{
|
||||
sol_D[l_cell_no].spec = (struct spec *) PHRQ_malloc((species_list.size() + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[l_cell_no].spec = (class spec *) PHRQ_malloc((species_list.size() + (size_t)size_xt) * sizeof(class spec));
|
||||
sol_D[l_cell_no].spec_size = (int)species_list.size() + size_xt;
|
||||
}
|
||||
else if ((int)species_list.size() + size_xt > sol_D[l_cell_no].spec_size)
|
||||
{
|
||||
sol_D[l_cell_no].spec = (struct spec *) PHRQ_realloc(sol_D[l_cell_no].spec, (species_list.size() + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[l_cell_no].spec = (class spec *) PHRQ_realloc(sol_D[l_cell_no].spec, (species_list.size() + (size_t)size_xt) * sizeof(class spec));
|
||||
sol_D[l_cell_no].spec_size = (int)species_list.size() + size_xt;
|
||||
}
|
||||
if (sol_D[l_cell_no].spec == NULL)
|
||||
@ -1885,7 +1885,7 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
if (species_list.size() > 1)
|
||||
{
|
||||
qsort(&species_list[0], species_list.size(),
|
||||
sizeof(struct species_list), sort_species_name);
|
||||
sizeof(class species_list), sort_species_name);
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)species_list.size(); i++)
|
||||
@ -2025,15 +2025,15 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
i3 = i2 - i1;
|
||||
if (i3 + count_spec + 1 > sol_D[l_cell_no].spec_size)
|
||||
{
|
||||
sol_D[l_cell_no].spec = (struct spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
((size_t)i3 + count_spec + 1 + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[l_cell_no].spec = (class spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
((size_t)i3 + count_spec + 1 + (size_t)size_xt) * sizeof(class spec));
|
||||
if (sol_D[l_cell_no].spec == NULL)
|
||||
malloc_error();
|
||||
sol_D[l_cell_no].spec_size = i3 + count_spec + 1 + size_xt;
|
||||
}
|
||||
for (; i1 < i2; i1++) // i1 is loop variable
|
||||
{
|
||||
memmove(&sol_D[l_cell_no].spec[i1], &sol_D[ref_cell].spec[i1], sizeof(struct spec));
|
||||
memmove(&sol_D[l_cell_no].spec[i1], &sol_D[ref_cell].spec[i1], sizeof(class spec));
|
||||
sol_D[l_cell_no].spec[i1].c = 0.0;
|
||||
sol_D[l_cell_no].spec[i1].a = 0.0;
|
||||
sol_D[l_cell_no].spec[i1].lm = min_dif_LM;
|
||||
@ -2047,8 +2047,8 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
}
|
||||
if (count_spec >= sol_D[l_cell_no].spec_size)
|
||||
{
|
||||
sol_D[l_cell_no].spec = (struct spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
(count_spec + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[l_cell_no].spec = (class spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
(count_spec + (size_t)size_xt) * sizeof(class spec));
|
||||
if (sol_D[l_cell_no].spec == NULL)
|
||||
malloc_error();
|
||||
sol_D[l_cell_no].spec_size = count_spec + size_xt;
|
||||
@ -2099,8 +2099,8 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
i2 = sol_D[i1].count_spec + 1;
|
||||
if (i2 > sol_D[i1].spec_size)
|
||||
{
|
||||
sol_D[i1].spec = (struct spec *) PHRQ_realloc(sol_D[i1].spec,
|
||||
((size_t)i2 + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[i1].spec = (class spec *) PHRQ_realloc(sol_D[i1].spec,
|
||||
((size_t)i2 + (size_t)size_xt) * sizeof(class spec));
|
||||
if (sol_D[i1].spec == NULL)
|
||||
malloc_error();
|
||||
sol_D[i1].spec_size = i2 + size_xt;
|
||||
@ -2109,7 +2109,7 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
for (; i2 > i3; i2--) // i2 is loop variable
|
||||
sol_D[i1].spec[i2] = sol_D[i1].spec[i2 - 1];
|
||||
|
||||
memmove(&sol_D[i1].spec[i2], &sol_D[l_cell_no].spec[i2], sizeof(struct spec));
|
||||
memmove(&sol_D[i1].spec[i2], &sol_D[l_cell_no].spec[i2], sizeof(class spec));
|
||||
sol_D[i1].spec[i2].a = 0.0;
|
||||
sol_D[i1].spec[i2].lm = min_dif_LM;
|
||||
sol_D[i1].spec[i2].lg = -0.04;
|
||||
@ -2128,15 +2128,15 @@ fill_spec(int l_cell_no, int ref_cell)
|
||||
i3 = (int) dif_spec_names.size();
|
||||
if (i3 > sol_D[l_cell_no].spec_size)
|
||||
{
|
||||
sol_D[l_cell_no].spec = (struct spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
((size_t)i3 + (size_t)size_xt) * sizeof(struct spec));
|
||||
sol_D[l_cell_no].spec = (class spec *) PHRQ_realloc(sol_D[l_cell_no].spec,
|
||||
((size_t)i3 + (size_t)size_xt) * sizeof(class spec));
|
||||
if (sol_D[l_cell_no].spec == NULL)
|
||||
malloc_error();
|
||||
sol_D[l_cell_no].spec_size = i3 + size_xt;
|
||||
}
|
||||
for (i1 = count_spec; i1 < i3; i1++)
|
||||
{
|
||||
memmove(&sol_D[l_cell_no].spec[i1], &sol_D[ref_cell].spec[i1], sizeof(struct spec));
|
||||
memmove(&sol_D[l_cell_no].spec[i1], &sol_D[ref_cell].spec[i1], sizeof(class spec));
|
||||
sol_D[l_cell_no].spec[i1].c = 0.0;
|
||||
sol_D[l_cell_no].spec[i1].a = 0.0;
|
||||
sol_D[l_cell_no].spec[i1].lm = min_dif_LM;
|
||||
@ -2176,10 +2176,10 @@ int Phreeqc::
|
||||
sort_species_name(const void *ptr1, const void *ptr2)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
const struct species_list *nptr1, *nptr2;
|
||||
const class species_list *nptr1, *nptr2;
|
||||
|
||||
nptr1 = (const struct species_list *) ptr1;
|
||||
nptr2 = (const struct species_list *) ptr2;
|
||||
nptr1 = (const class species_list *) ptr1;
|
||||
nptr2 = (const class species_list *) ptr2;
|
||||
|
||||
return (strcmp(nptr1->s->name, nptr2->s->name));
|
||||
}
|
||||
@ -2846,15 +2846,15 @@ diffuse_implicit(LDBLE DDt, int stagnant)
|
||||
// Translate transport of the solute species into master species...
|
||||
ct[i].count_m_s = count_m_s;
|
||||
if (ct[i].m_s_size == 0 && ct[i].m_s != NULL)
|
||||
ct[i].m_s = (struct M_S *) free_check_null(ct[i].m_s);
|
||||
ct[i].m_s = (class M_S *) free_check_null(ct[i].m_s);
|
||||
if (ct[i].m_s == NULL)
|
||||
{
|
||||
ct[i].m_s = (struct M_S *) PHRQ_malloc((count_m_s + 5) * sizeof(struct M_S));
|
||||
ct[i].m_s = (class M_S *) PHRQ_malloc((count_m_s + 5) * sizeof(class M_S));
|
||||
ct[i].m_s_size = count_m_s + 5;
|
||||
}
|
||||
else if (count_m_s > ct[i].m_s_size)
|
||||
{
|
||||
ct[i].m_s = (struct M_S *) PHRQ_realloc(ct[i].m_s, (count_m_s + 5) * sizeof(struct M_S));
|
||||
ct[i].m_s = (class M_S *) PHRQ_realloc(ct[i].m_s, (count_m_s + 5) * sizeof(class M_S));
|
||||
ct[i].m_s_size = count_m_s + 5;
|
||||
}
|
||||
if (ct[i].m_s == NULL)
|
||||
@ -3385,11 +3385,11 @@ multi_D(LDBLE DDt, int mobile_cell, int stagnant)
|
||||
if (!il_calcs)
|
||||
{
|
||||
tot1_h = tot1_o = tot2_h = tot2_o = 0.0;
|
||||
m_s = (struct M_S *) free_check_null(m_s);
|
||||
m_s = (class M_S *) free_check_null(m_s);
|
||||
count_m_s = (ct[icell].J_ij_count_spec < count_moles_added ?
|
||||
ct[icell].J_ij_count_spec : count_moles_added);
|
||||
m_s = (struct M_S *) PHRQ_malloc((size_t) count_m_s *
|
||||
sizeof(struct M_S));
|
||||
m_s = (class M_S *) PHRQ_malloc((size_t) count_m_s *
|
||||
sizeof(class M_S));
|
||||
if (m_s == NULL)
|
||||
malloc_error();
|
||||
for (i1 = 0; i1 < count_m_s; i1++)
|
||||
@ -3564,15 +3564,15 @@ multi_D(LDBLE DDt, int mobile_cell, int stagnant)
|
||||
}
|
||||
}
|
||||
|
||||
m_s = (struct M_S *) free_check_null(m_s);
|
||||
m_s = (class M_S *) free_check_null(m_s);
|
||||
|
||||
for (i = first_c; i < last_c2; i++)
|
||||
{
|
||||
if (stagnant && i > first_c && i <= count_cells + first_c)
|
||||
continue;
|
||||
ct[i].J_ij = (struct J_ij *) free_check_null(ct[i].J_ij);
|
||||
ct[i].J_ij = (class J_ij *) free_check_null(ct[i].J_ij);
|
||||
if (il_calcs)
|
||||
ct[i].J_ij_il = (struct J_ij *) free_check_null(ct[i].J_ij_il);
|
||||
ct[i].J_ij_il = (class J_ij *) free_check_null(ct[i].J_ij_il);
|
||||
ct[i].v_m = (struct V_M *) free_check_null(ct[i].v_m);
|
||||
}
|
||||
if (dVtemp && stagnant)
|
||||
@ -3585,7 +3585,7 @@ multi_D(LDBLE DDt, int mobile_cell, int stagnant)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int Phreeqc::
|
||||
fill_m_s(struct J_ij *l_J_ij, int l_J_ij_count_spec, int icell, int stagnant)
|
||||
fill_m_s(class J_ij *l_J_ij, int l_J_ij_count_spec, int icell, int stagnant)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
/* sum up the primary or secondary master_species from solute species
|
||||
@ -4042,12 +4042,12 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant)
|
||||
|
||||
if (ct[icell].J_ij == NULL)
|
||||
{
|
||||
ct[icell].J_ij = (struct J_ij *) PHRQ_malloc((size_t)(k) * sizeof(struct J_ij));
|
||||
ct[icell].J_ij = (class J_ij *) PHRQ_malloc((size_t)(k) * sizeof(class J_ij));
|
||||
ct[icell].J_ij_size = k;
|
||||
}
|
||||
else if (k > ct[icell].J_ij_size)
|
||||
{
|
||||
ct[icell].J_ij = (struct J_ij *) PHRQ_realloc(ct[icell].J_ij, (size_t)(k) * sizeof(struct J_ij));
|
||||
ct[icell].J_ij = (class J_ij *) PHRQ_realloc(ct[icell].J_ij, (size_t)(k) * sizeof(class J_ij));
|
||||
ct[icell].J_ij_size = k;
|
||||
}
|
||||
if (ct[icell].J_ij == NULL)
|
||||
@ -4085,8 +4085,8 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant)
|
||||
/* also for interlayer cations */
|
||||
k = sol_D[icell].count_exch_spec + sol_D[jcell].count_exch_spec;
|
||||
|
||||
ct[icell].J_ij_il = (struct J_ij *) free_check_null(ct[icell].J_ij_il);
|
||||
ct[icell].J_ij_il = (struct J_ij *) PHRQ_malloc((size_t) k * sizeof(struct J_ij));
|
||||
ct[icell].J_ij_il = (class J_ij *) free_check_null(ct[icell].J_ij_il);
|
||||
ct[icell].J_ij_il = (class J_ij *) PHRQ_malloc((size_t) k * sizeof(class J_ij));
|
||||
if (ct[icell].J_ij_il == NULL)
|
||||
malloc_error();
|
||||
|
||||
@ -4539,9 +4539,9 @@ dV_dcell2:
|
||||
|
||||
/* express the transfer in elemental moles... */
|
||||
tot1_h = tot1_o = tot2_h = tot2_o = 0.0;
|
||||
m_s = (struct M_S *) free_check_null(m_s);
|
||||
m_s = (struct M_S *) PHRQ_malloc((size_t) count_moles_added *
|
||||
sizeof(struct M_S));
|
||||
m_s = (class M_S *) free_check_null(m_s);
|
||||
m_s = (class M_S *) PHRQ_malloc((size_t) count_moles_added *
|
||||
sizeof(class M_S));
|
||||
if (m_s == NULL)
|
||||
malloc_error();
|
||||
for (i1 = 0; i1 < count_moles_added; i1++)
|
||||
@ -4580,7 +4580,7 @@ dV_dcell2:
|
||||
/* transfer O and H... */
|
||||
for (; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
if (strcmp("H", elt_ptr->name) == 0)
|
||||
{
|
||||
@ -4620,7 +4620,7 @@ dV_dcell2:
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
for (; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
if (strcmp(m_s[j].name, elt_ptr->name) != 0)
|
||||
continue;
|
||||
@ -4665,7 +4665,7 @@ dV_dcell2:
|
||||
/* transfer O and H... */
|
||||
for (; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
|
||||
if (strcmp("H", elt_ptr->name) == 0)
|
||||
@ -4705,7 +4705,7 @@ dV_dcell2:
|
||||
cxxNameDouble::iterator it = nd.begin();
|
||||
for (; it != nd.end(); it++)
|
||||
{
|
||||
struct element *elt_ptr = element_store(it->first.c_str());
|
||||
class element *elt_ptr = element_store(it->first.c_str());
|
||||
LDBLE coef = it->second;
|
||||
if (strcmp(m_s[j].name, elt_ptr->name) != 0)
|
||||
continue;
|
||||
@ -6033,7 +6033,7 @@ calc_vm_Cl(void)
|
||||
*/
|
||||
LDBLE V_Cl = 0;
|
||||
LDBLE pb_s = 2600. + patm_x * 1.01325, TK_s = tc_x + 45.15, sqrt_mu = sqrt(mu_x);
|
||||
struct species *s_ptr;
|
||||
class species *s_ptr;
|
||||
|
||||
s_ptr = s_search("Cl-");
|
||||
if (!s_ptr)
|
||||
|
||||
@ -13,10 +13,10 @@ calc_alk(CReaction& rxn_ref)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
LDBLE return_value;
|
||||
struct master* master_ptr;
|
||||
class master* master_ptr;
|
||||
|
||||
return_value = 0.0;
|
||||
struct rxn_token* r_token = &rxn_ref.token[1];
|
||||
class rxn_token* r_token = &rxn_ref.token[1];
|
||||
while (r_token->s != NULL)
|
||||
{
|
||||
master_ptr = r_token->s->secondary;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user