changed all double to LDBLE

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@6038 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2012-01-11 21:13:51 +00:00
parent 9aef1acfe7
commit 7683982877
52 changed files with 474 additions and 471 deletions

View File

@ -127,7 +127,7 @@ ChartObject::Set_axis_scale(CParser & parser)
std::istream::pos_type ptr;
std::istream::pos_type next_char;
std::string token;
double *scale_ptr = NULL;
LDBLE *scale_ptr = NULL;
std::vector<std::string> string_vector;
size_t j = 0;
@ -220,7 +220,7 @@ ChartObject::Set_axis_scale(CParser & parser)
estream << "Maximum must be larger than minimum of axis_scale " << type << "-scale." << "\n";
estream << "Switching values for MIN and MAX. " << "\n";
warning_msg(estream.str().c_str());
double t;
LDBLE t;
t = scale_ptr[0];
scale_ptr[0] = scale_ptr[1];
scale_ptr[1] = scale_ptr[0];
@ -568,7 +568,7 @@ ChartObject::OpenCSVFile(std::string file_name)
}
// x value for all curves
double x_value = atof(tok1.c_str());
LDBLE x_value = atof(tok1.c_str());
// y values for curves
std::string tok2;
@ -1014,7 +1014,7 @@ ChartObject::Finalize_graph_pts(void)
{
if (graph_x != NA)
{
std::map<int, double>::iterator it;
std::map<int, LDBLE>::iterator it;
for (it = graph_y.begin(); it != graph_y.end(); it++)
{
Curves[it->first]->Get_x().push_back(graph_x);
@ -1054,9 +1054,9 @@ ChartObject::Add_new_series(void)
}
void
ChartObject::Add_curve(bool plotxy, std::string id,
double line_width,
LDBLE line_width,
std::string symbol,
double symbol_size,
LDBLE symbol_size,
int y_axis,
std::string color)
{
@ -1120,7 +1120,7 @@ ChartObject::dump(std::ostream & oss, unsigned int indent)
}
// axis_scale_x
double *scale_ptr = this->axis_scale_x;
LDBLE *scale_ptr = this->axis_scale_x;
{
oss << indent1 << "-axis_scale x_axis ";
for (i = 0; i < 4; i++)
@ -1249,8 +1249,8 @@ ChartObject::dump(std::ostream & oss, unsigned int indent)
// temporary storage before stored graph_x/y/sy data are stored in curves
// Initialize_graph_pts and Finalize_graph_pts use this storage.
double graph_x;
std::map<int, double> graph_y;
LDBLE graph_x;
std::map<int, LDBLE> graph_y;
std::map<int, bool> secondary_y;
// temporary plotxy curve definitions before stored in curves

View File

@ -65,18 +65,18 @@ class ChartObject:public cxxNumKeyword
{
return this->axis_titles;
}
// double axis_scale_x[5];
double *Get_axis_scale_x()
// LDBLE axis_scale_x[5];
LDBLE *Get_axis_scale_x()
{
return this->axis_scale_x;
}
// double axis_scale_y[5];
double *Get_axis_scale_y()
// LDBLE axis_scale_y[5];
LDBLE *Get_axis_scale_y()
{
return this->axis_scale_y;
}
// double axis_scale_y2[5];
double *Get_axis_scale_y2()
// LDBLE axis_scale_y2[5];
LDBLE *Get_axis_scale_y2()
{
return this->axis_scale_y2;
}
@ -217,17 +217,17 @@ class ChartObject:public cxxNumKeyword
return this->rate_new_def;
}
// int default_symbol;
//double graph_x;
void Set_graph_x(double d)
//LDBLE graph_x;
void Set_graph_x(LDBLE d)
{
this->graph_x = d;
}
double Get_graph_x()
LDBLE Get_graph_x()
{
return this->graph_x;
}
//std::map<int, double> graph_y;
std::map<int, double> &Get_graph_y()
//std::map<int, LDBLE> graph_y;
std::map<int, LDBLE> &Get_graph_y()
{
return this->graph_y;
}
@ -297,9 +297,9 @@ class ChartObject:public cxxNumKeyword
void Get_color_string_csv(std::string &color);
void Add_new_series(void);
void Add_curve(bool plotxy, std::string id = "",
double line_width = 1.0,
LDBLE line_width = 1.0,
std::string symbol = "",
double symbol_size = 6.0,
LDBLE symbol_size = 6.0,
int y_axis = 1,
std::string color = "");
void dump(std::ostream & s_oss, unsigned int indent);
@ -315,9 +315,9 @@ class ChartObject:public cxxNumKeyword
std::vector<std::string> Color_vector;
std::string chart_title;
std::vector<std::string> axis_titles;
double axis_scale_x[5];
double axis_scale_y[5];
double axis_scale_y2[5];
LDBLE axis_scale_x[5];
LDBLE axis_scale_y[5];
LDBLE axis_scale_y2[5];
int chart_type;
bool graph_initial_solutions;
@ -355,8 +355,8 @@ class ChartObject:public cxxNumKeyword
// temporary storage before stored graph_x/y/sy data are stored in curves
// Initialize_graph_pts and Finalize_graph_pts use this storage.
double graph_x;
std::map<int, double> graph_y;
LDBLE graph_x;
std::map<int, LDBLE> graph_y;
std::map<int, bool> secondary_y;
// temporary plotxy curve definitions before stored in curves

View File

@ -2,7 +2,7 @@
#define CURVEOBJECT_H_INCLUDED
#include <vector>
#include <string>
#include "phrqtype.h"
class CurveObject
{
@ -33,19 +33,19 @@ public:
{
return this->symbol;
}
void Set_symbol_size(double f)
void Set_symbol_size(LDBLE f)
{
this->symbol_size = f;
}
double Get_symbol_size(void)
LDBLE Get_symbol_size(void)
{
return this->symbol_size;
}
void Set_line_w(double f)
void Set_line_w(LDBLE f)
{
this->line_w = f;
}
double Get_line_w(void)
LDBLE Get_line_w(void)
{
return this->line_w;
}
@ -53,11 +53,11 @@ public:
{
this->y_axis = f;
}
std::vector<double> & Get_x()
std::vector<LDBLE> & Get_x()
{
return this->x;
}
std::vector<double> & Get_y()
std::vector<LDBLE> & Get_y()
{
return this->y;
}
@ -76,12 +76,12 @@ public:
protected:
//float *x, *y;
std::vector<double> x, y;
std::vector<LDBLE> x, y;
//int nxy, npoints, npoints_plot, prev_npoints;
std::string id, color, symbol;
int y_axis;
double line_w, symbol_size;
LDBLE line_w, symbol_size;
public:

View File

@ -39,7 +39,7 @@ cxxExchComp::cxxExchComp(PHRQ_io *io)
}
#ifdef SKIP
cxxExchComp::cxxExchComp(std::vector < cxxExchComp > &ec_vector,
std::vector < double >&f_vector)
std::vector < LDBLE >&f_vector)
//
// constructor for cxxExchComp from mixing
//
@ -49,7 +49,7 @@ cxxExchComp::cxxExchComp(std::vector < cxxExchComp > &ec_vector,
//
// check consistency
//
std::vector < double >::iterator it_f;
std::vector < LDBLE >::iterator it_f;
std::vector < cxxExchComp >::iterator it_ec;
// set fixed variables
it_ec = ec_vector.begin();
@ -72,7 +72,7 @@ cxxExchComp::cxxExchComp(std::vector < cxxExchComp > &ec_vector,
}
}
// calculate sum of extensive factors
double sum_extensive = 0;
LDBLE sum_extensive = 0;
for (it_f = f_vector.begin(); it_f != f_vector.end(); it_f++)
{
sum_extensive += *it_f;
@ -87,8 +87,8 @@ cxxExchComp::cxxExchComp(std::vector < cxxExchComp > &ec_vector,
it_f = f_vector.begin();
for (; it_ec != ec_vector.end();)
{
double extensive = *it_f;
double intensive = extensive / sum_extensive;
LDBLE extensive = *it_f;
LDBLE intensive = extensive / sum_extensive;
this->moles += it_ec->moles * extensive;
this->la += it_ec->la * intensive;
this->charge_balance += it_ec->charge_balance * extensive;
@ -416,9 +416,9 @@ cxxExchComp::read_raw(CParser & parser, bool check)
}
}
void
cxxExchComp::add(const cxxExchComp & addee, double extensive)
cxxExchComp::add(const cxxExchComp & addee, LDBLE extensive)
{
double ext1, ext2, f1, f2;
LDBLE ext1, ext2, f1, f2;
if (extensive == 0.0)
return;
if (addee.formula.size() == 0)
@ -452,13 +452,13 @@ cxxExchComp::add(const cxxExchComp & addee, double extensive)
this->formula = addee.formula;
this->formula_totals = addee.formula_totals;
}
//double moles;
//LDBLE moles;
this->moles += addee.moles * extensive;
//cxxNameDouble totals;
this->totals.add_extensive(addee.totals, extensive);
//double la;
//LDBLE la;
this->la = f1 * this->la + f2 * addee.la;
//double charge_balance;
//LDBLE charge_balance;
this->charge_balance += addee.charge_balance * extensive;
//char *phase_name;
@ -490,7 +490,7 @@ cxxExchComp::add(const cxxExchComp & addee, double extensive)
}
else if (this->rate_name.size() != 0)
{
//double phase_proportion;
//LDBLE phase_proportion;
this->phase_proportion =
this->phase_proportion * f1 + addee.phase_proportion * f2;
}
@ -507,27 +507,27 @@ cxxExchComp::add(const cxxExchComp & addee, double extensive)
}
}
void
cxxExchComp::multiply(double extensive)
cxxExchComp::multiply(LDBLE extensive)
{
//char * formula;
//double moles;
//LDBLE moles;
this->moles *= extensive;
//cxxNameDouble formula_totals;
//cxxNameDouble totals;
this->totals.multiply(extensive);
//double la;
//double charge_balance;
//LDBLE la;
//LDBLE charge_balance;
this->charge_balance *= extensive;
//char *phase_name;
//double phase_proportion;
//LDBLE phase_proportion;
this->phase_proportion *= extensive;
//double formula_z;
//LDBLE formula_z;
}
#ifdef USE_MPI
void
cxxExchComp::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
ints.push_back(dictionary.string2int(this->formula));
@ -543,7 +543,7 @@ cxxExchComp::mpi_pack(std::vector < int >&ints,
}
void
cxxExchComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxExchComp::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;

View File

@ -33,27 +33,27 @@ class cxxExchComp: public PHRQ_base
else
this->formula.clear();
}
double Get_moles() const
LDBLE Get_moles() const
{
return this->moles;
}
void Set_moles(double d)
void Set_moles(LDBLE d)
{
this->moles = d;
}
double Get_la() const
LDBLE Get_la() const
{
return this->la;
}
void Set_la(double d)
void Set_la(LDBLE d)
{
this->la = d;
}
double Get_charge_balance() const
LDBLE Get_charge_balance() const
{
return this->charge_balance;
}
void Set_charge_balance(double d)
void Set_charge_balance(LDBLE d)
{
this->charge_balance = d;
}
@ -68,11 +68,11 @@ class cxxExchComp: public PHRQ_base
else
this->phase_name.clear();
}
double Get_phase_proportion() const
LDBLE Get_phase_proportion() const
{
return this->phase_proportion;
}
void Set_phase_proportion(double d)
void Set_phase_proportion(LDBLE d)
{
this->phase_proportion = d;
}
@ -87,11 +87,11 @@ class cxxExchComp: public PHRQ_base
else
this->rate_name.clear();
}
double Get_formula_z() const
LDBLE Get_formula_z() const
{
return this->formula_z;
}
void Set_formula_z(double d)
void Set_formula_z(LDBLE d)
{
this->formula_z = d;
}
@ -124,25 +124,25 @@ class cxxExchComp: public PHRQ_base
cxxNameDouble & Get_formula_totals(void) {return this->formula_totals;}
void add(const cxxExchComp & comp, double extensive);
void multiply(double extensive);
void add(const cxxExchComp & comp, LDBLE extensive);
void multiply(LDBLE extensive);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
protected:
std::string formula;
double moles;
LDBLE moles;
cxxNameDouble formula_totals;
cxxNameDouble totals;
double la;
double charge_balance;
LDBLE la;
LDBLE charge_balance;
std::string phase_name;
double phase_proportion;
LDBLE phase_proportion;
std::string rate_name;
double formula_z; // charge on formula
LDBLE formula_z; // charge on formula
public:

View File

@ -40,8 +40,8 @@ cxxNumKeyword(io)
//
// Mix exchangers
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -310,7 +310,7 @@ cxxExchange::read_raw(CParser & parser, bool check)
}
}
void
cxxExchange::add(const cxxExchange & addee, double extensive)
cxxExchange::add(const cxxExchange & addee, LDBLE extensive)
//
// Add existing exchange to "this" exchange
//
@ -340,7 +340,7 @@ cxxExchange::add(const cxxExchange & addee, double extensive)
/* ---------------------------------------------------------------------- */
void
cxxExchange::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
/* ---------------------------------------------------------------------- */
{
/* int n_user; */
@ -357,7 +357,7 @@ cxxExchange::mpi_pack(std::vector < int >&ints,
/* ---------------------------------------------------------------------- */
void
cxxExchange::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxExchange::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
/* ---------------------------------------------------------------------- */
{
int i = *ii;

View File

@ -47,11 +47,11 @@ public:
std::vector<cxxExchComp *> Vectorize(void);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
protected:
void add(const cxxExchange & addee, double extensive);
void add(const cxxExchange & addee, LDBLE extensive);
// not written
void dump_xml(std::ostream & os, unsigned int indent = 0) const;

View File

@ -218,7 +218,7 @@ cxxGasComp::add(const cxxGasComp & addee, LDBLE extensive)
assert(this->phase_name == addee.phase_name);
//double moles;
//LDBLE moles;
this->p_read += addee.p_read * extensive;
this->moles += addee.moles * extensive;
this->initial_moles += addee.initial_moles * extensive;

View File

@ -35,8 +35,8 @@ class cxxGasComp: public PHRQ_base
void multiply(LDBLE extensive);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
protected:
std::string phase_name;

View File

@ -54,8 +54,8 @@ cxxGasPhase::cxxGasPhase(std::map < int, cxxGasPhase > &entity_map,
std::map<std::string, cxxGasComp> comp_map;
std::map<std::string, cxxGasComp>::iterator comp_it;
const std::map < int, double > & mixcomps = mx.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE > & mixcomps = mx.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
const cxxGasPhase *entity_ptr = &(entity_map.find(it->first)->second);
@ -133,8 +133,8 @@ cxxNumKeyword(io)
// Mix
//
//cxxNameDouble gasPhaseComps;
const std::map < int, double > & mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE > & mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -144,8 +144,8 @@ cxxNumKeyword(io)
this->gasPhaseComps.add_extensive(entity_ptr->gasPhaseComps,
it->second);
//GP_TYPE type;
//double total_p;
//double volume;
//LDBLE total_p;
//LDBLE volume;
if (first)
{
this->type = entity_ptr->type;
@ -529,7 +529,7 @@ cxxGasPhase::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxGasPhase::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
ints.push_back(this->n_user);
this->gasPhaseComps.mpi_pack(ints, doubles);
@ -548,7 +548,7 @@ cxxGasPhase::mpi_pack(std::vector < int >&ints,
}
void
cxxGasPhase::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxGasPhase::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
int i = *ii;
int d = *dd;

View File

@ -35,8 +35,8 @@ class cxxGasPhase:public cxxNumKeyword
void read_raw(CParser & parser, bool check = true);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
void totalize(PHREEQC_PTR_ARG);
@ -50,10 +50,10 @@ class cxxGasPhase:public cxxNumKeyword
GP_TYPE Get_type(void) const {return type;};
void Set_type(GP_TYPE t) {type = t;};
double Get_total_p(void) const {return total_p;};
double Get_volume(void) const {return volume;};
LDBLE Get_total_p(void) const {return total_p;};
LDBLE Get_volume(void) const {return volume;};
void Set_volume(LDBLE v) {volume = v;};
double Get_v_m(void) const {return v_m;};
LDBLE Get_v_m(void) const {return v_m;};
void Set_v_m(LDBLE v) {v_m = v;};
bool Get_pr_in(void) const {return pr_in;};
void Set_pr_in(bool tf) {pr_in = tf;};
@ -74,7 +74,7 @@ class cxxGasPhase:public cxxNumKeyword
LDBLE Calc_total_moles(void);
protected:
void add(const cxxGasPhase & addee, double extensive);
void add(const cxxGasPhase & addee, LDBLE extensive);
protected:
bool new_def;

View File

@ -43,7 +43,7 @@ cxxISolution::ConvertUnits(PHREEQC_PTR_ARG)
// Converts from input units to moles per kilogram water
//
{
double sum_solutes = 0;
LDBLE sum_solutes = 0;
// foreach conc
std::map < std::string, cxxISolutionComp >::iterator iter =
this->comps.begin();
@ -61,7 +61,7 @@ cxxISolution::ConvertUnits(PHREEQC_PTR_ARG)
/*
* Convert liters to kg solution
*/
double moles = iter->second.get_input_conc();
LDBLE moles = iter->second.get_input_conc();
if (this->units.find("/l") != std::string::npos)
{
moles /= this->density;
@ -107,7 +107,7 @@ cxxISolution::ConvertUnits(PHREEQC_PTR_ARG)
/*
* Convert /kgs to /kgw
*/
double l_mass_water;
LDBLE l_mass_water;
if ((this->units.find("kgs") != std::string::npos) ||
(this->units.find("/l") != std::string::npos))
{

View File

@ -23,11 +23,11 @@ class cxxISolution:public cxxSolution
//static cxxISolution& read(CParser& parser);
//void add(cxxISolutionComp conc) { this->concs.push_back(conc); }
double Get_density() const
LDBLE Get_density() const
{
return this->density;
}
void Set_density(double l_density)
void Set_density(LDBLE l_density)
{
this->density = l_density;
}
@ -54,7 +54,7 @@ class cxxISolution:public cxxSolution
protected:
friend class cxxISolutionComp; // for this->pe access
double density;
LDBLE density;
std::string units;
std::map < std::string, cxxISolutionComp > comps;
struct pe_data *pes;

View File

@ -34,20 +34,20 @@ class cxxISolutionComp: public PHRQ_base
this->description.clear();
}
double Get_moles() const
LDBLE Get_moles() const
{
return this->moles;
}
void Set_moles(double l_moles)
void Set_moles(LDBLE l_moles)
{
this->moles = l_moles;
}
double Get_input_conc() const
LDBLE Get_input_conc() const
{
return this->input_conc;
}
void Set_input_conc(double l_input_conc)
void Set_input_conc(LDBLE l_input_conc)
{
this->input_conc = l_input_conc;
}
@ -77,7 +77,7 @@ class cxxISolutionComp: public PHRQ_base
}
double Get_phase_si() const
LDBLE Get_phase_si() const
{
return this->phase_si;
}
@ -107,12 +107,12 @@ class cxxISolutionComp: public PHRQ_base
this->as.clear();
}
//double get_gfw()const {return this->gfw;}
double Get_gfw() const
//LDBLE get_gfw()const {return this->gfw;}
LDBLE Get_gfw() const
{
return this->gfw;
};
void Set_gfw(double l_gfw)
void Set_gfw(LDBLE l_gfw)
{
this->gfw = l_gfw;
}
@ -125,14 +125,14 @@ class cxxISolutionComp: public PHRQ_base
protected:
std::string description;
double moles;
double input_conc;
LDBLE moles;
LDBLE input_conc;
std::string units;
std::string equation_name;
double phase_si;
LDBLE phase_si;
int n_pe;
std::string as;
double gfw;
LDBLE gfw;
};
#endif // ISOLUTIONCOMP_H_INCLUDED

View File

@ -136,7 +136,7 @@ cxxKineticsComp::dump_raw(std::ostream & s_oss, unsigned int indent) const
{
int i = 0;
s_oss << indent2;
for (std::vector < double >::const_iterator it = d_params.begin();
for (std::vector < LDBLE >::const_iterator it = d_params.begin();
it != d_params.end(); it++)
{
if (i++ == 5)
@ -155,7 +155,7 @@ void
cxxKineticsComp::read_raw(CParser & parser, bool check)
{
std::string str;
double d;
LDBLE d;
static std::vector < std::string > vopts;
if (vopts.empty())
@ -175,7 +175,7 @@ cxxKineticsComp::read_raw(CParser & parser, bool check)
std::string token;
int opt_save;
std::vector < double > temp_d_params;
std::vector < LDBLE > temp_d_params;
opt_save = CParser::OPT_ERROR;
bool rate_name_defined(false);
bool tol_defined(false);
@ -336,7 +336,7 @@ cxxKineticsComp::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxKineticsComp::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
ints.push_back(dictionary.string2int(this->rate_name));
@ -346,14 +346,14 @@ cxxKineticsComp::mpi_pack(std::vector < int >&ints,
doubles.push_back(this->m0);
doubles.push_back(this->moles);
ints.push_back((int) this->d_params.size());
for (std::vector < double >::iterator it = this->d_params.begin();
for (std::vector < LDBLE >::iterator it = this->d_params.begin();
it != this->d_params.end(); it++)
{
doubles.push_back(*it);
}
}
void
cxxKineticsComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxKineticsComp::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;
@ -375,7 +375,7 @@ cxxKineticsComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
}
#endif
void
cxxKineticsComp::add(const cxxKineticsComp & addee, double extensive)
cxxKineticsComp::add(const cxxKineticsComp & addee, LDBLE extensive)
{
if (extensive == 0.0)
return;
@ -390,27 +390,27 @@ cxxKineticsComp::add(const cxxKineticsComp & addee, double extensive)
//char * rate_name;
assert(this->rate_name == addee.rate_name);
//cxxNameDouble namecoef;
//double tol;
//double m;
//LDBLE tol;
//LDBLE m;
this->m += addee.m * extensive;
//double m0;
//LDBLE m0;
this->m0 += addee.m0 * extensive;
//double moles;
//LDBLE moles;
this->moles += addee.moles * extensive;
//std::vector<double> d_params;
//std::vector<LDBLE> d_params;
}
void
cxxKineticsComp::multiply(double extensive)
cxxKineticsComp::multiply(LDBLE extensive)
{
//char * rate_name;
//cxxNameDouble namecoef;
//double tol;
//double m;
//LDBLE tol;
//LDBLE m;
this->m *= extensive;
//double m0;
//LDBLE m0;
this->m0 *= extensive;
//double moles;
//LDBLE moles;
this->moles *= extensive;
//std::vector<double> d_params;
//std::vector<LDBLE> d_params;
}

View File

@ -36,27 +36,27 @@ public:
}
const cxxNameDouble &Get_namecoef(void) const {return namecoef;};
double Get_tol(void) const {return tol;};
double Get_m(void) const {return m;};
double Get_m0(void) const {return m0;};
double Get_moles(void) const {return moles;};
const std::vector < double > &Get_d_params(void) const {return d_params;};
LDBLE Get_tol(void) const {return tol;};
LDBLE Get_m(void) const {return m;};
LDBLE Get_m0(void) const {return m0;};
LDBLE Get_moles(void) const {return moles;};
const std::vector < LDBLE > &Get_d_params(void) const {return d_params;};
#ifdef USE_MPI
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
#endif
void add(const cxxKineticsComp & comp, double extensive);
void multiply(double extensive);
void add(const cxxKineticsComp & comp, LDBLE extensive);
void multiply(LDBLE extensive);
protected:
std::string rate_name;
cxxNameDouble namecoef; //stoichiometry of reaction
double tol;
double m;
double m0;
double moles;
std::vector < double >d_params;
LDBLE tol;
LDBLE m;
LDBLE m0;
LDBLE moles;
std::vector < LDBLE >d_params;
public:

View File

@ -59,8 +59,8 @@ cxxNumKeyword(io)
//
// Mix
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -246,7 +246,7 @@ cxxPPassemblage::read_raw(CParser & parser, bool check)
/* ---------------------------------------------------------------------- */
void
cxxPPassemblage::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
/* ---------------------------------------------------------------------- */
{
/* int n_user; */
@ -263,7 +263,7 @@ cxxPPassemblage::mpi_pack(std::vector < int >&ints,
/* ---------------------------------------------------------------------- */
void
cxxPPassemblage::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxPPassemblage::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
/* ---------------------------------------------------------------------- */
{
int i = *ii;
@ -303,7 +303,7 @@ cxxPPassemblage::totalize(PHREEQC_PTR_ARG)
}
void
cxxPPassemblage::add(const cxxPPassemblage & addee, double extensive)
cxxPPassemblage::add(const cxxPPassemblage & addee, LDBLE extensive)
//
// Add to existing ppassemblage to "this" ppassemblage
//

View File

@ -48,14 +48,14 @@ class cxxPPassemblage:public cxxNumKeyword
cxxPPassemblageComp *Find(const std::string name);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
void totalize(PHREEQC_PTR_ARG);
protected:
void add(const cxxPPassemblage & addee, double extensive);
void add(const cxxPPassemblage & addee, LDBLE extensive);
// not written
void dump_xml(std::ostream & os, unsigned int indent = 0) const;

View File

@ -375,7 +375,7 @@ cxxPPassemblageComp::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxPPassemblageComp::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
@ -392,7 +392,7 @@ cxxPPassemblageComp::mpi_pack(std::vector < int >&ints,
}
void
cxxPPassemblageComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxPPassemblageComp::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;
@ -436,9 +436,9 @@ cxxPPassemblageComp::totalize(PHREEQC_PTR_ARG)
void
cxxPPassemblageComp::add(const cxxPPassemblageComp & addee, double extensive)
cxxPPassemblageComp::add(const cxxPPassemblageComp & addee, LDBLE extensive)
{
double ext1, ext2, f1, f2;
LDBLE ext1, ext2, f1, f2;
if (extensive == 0.0)
return;
if (addee.name.size() == 0)
@ -475,15 +475,15 @@ cxxPPassemblageComp::add(const cxxPPassemblageComp & addee, double extensive)
error_msg(oss.str().c_str(), CONTINUE);
return;
}
//double si;
//LDBLE si;
this->si = this->si * f1 + addee.si * f2;
//double si_org;
//LDBLE si_org;
this->si_org = this->si_org * f1 + addee.si_org * f2;
//double moles;
//LDBLE moles;
this->moles += addee.moles * extensive;
//double delta;
//LDBLE delta;
this->delta += addee.delta * extensive;
//double initial_moles;
//LDBLE initial_moles;
this->initial_moles += addee.initial_moles * extensive;
//bool force_equality;
//bool dissolve_only;
@ -491,16 +491,16 @@ cxxPPassemblageComp::add(const cxxPPassemblageComp & addee, double extensive)
}
void
cxxPPassemblageComp::multiply(double extensive)
cxxPPassemblageComp::multiply(LDBLE extensive)
{
//char * name;
//char *add_formula;
//double si;
//double moles;
//LDBLE si;
//LDBLE moles;
this->moles *= extensive;
//double delta;
//LDBLE delta;
this->delta *= extensive;
//double initial_moles;
//LDBLE initial_moles;
this->initial_moles *= extensive;
//bool force_equality;
//bool dissolve_only;

View File

@ -42,15 +42,15 @@ class cxxPPassemblageComp: public PHRQ_base
void totalize(PHREEQC_PTR_ARG);
const cxxNameDouble & Get_totals() const {return (this->totals);}
void Get_totals(cxxNameDouble & nd) {this->totals = nd;}
double Get_si() const {return this->si;}
LDBLE Get_si() const {return this->si;}
void Set_si(LDBLE t) {this->si = t;}
double Get_si_org() const {return this->si_org;}
LDBLE Get_si_org() const {return this->si_org;}
void Set_si_org(LDBLE t) {this->si_org = t;}
double Get_moles() const {return this->moles;}
LDBLE Get_moles() const {return this->moles;}
void Set_moles(LDBLE t) {this->moles = t;}
double Get_delta() const {return this->delta;}
LDBLE Get_delta() const {return this->delta;}
void Set_delta(LDBLE t) {this->delta = t;}
double Get_initial_moles() const {return this->initial_moles;}
LDBLE Get_initial_moles() const {return this->initial_moles;}
void Set_initial_moles(LDBLE t) {this->initial_moles = t;}
bool Get_force_equality() const {return this->force_equality;}
@ -61,21 +61,21 @@ class cxxPPassemblageComp: public PHRQ_base
void Set_precipitate_only(bool tf) {this->precipitate_only = tf;}
void add(const cxxPPassemblageComp & comp, double extensive);
void multiply(double extensive);
void add(const cxxPPassemblageComp & comp, LDBLE extensive);
void multiply(LDBLE extensive);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
protected:
std::string name;
std::string add_formula;
double si;
double si_org;
double moles;
double delta;
double initial_moles;
LDBLE si;
LDBLE si_org;
LDBLE moles;
LDBLE delta;
LDBLE initial_moles;
bool force_equality;
bool dissolve_only;
bool precipitate_only;

View File

@ -1075,12 +1075,12 @@ CParser::STATUS_TYPE CParser::parse_couple(std::string & token)
return PARSER_OK;
}
CParser::STATUS_TYPE CParser::addPair(std::map < std::string, double >&totals,
CParser::STATUS_TYPE CParser::addPair(std::map < std::string, LDBLE >&totals,
std::istream::pos_type & pos)
{
std::string token;
//char * ctoken;
double
LDBLE
d;
CParser::TOKEN_TYPE j;

View File

@ -3,7 +3,7 @@
#if defined(WIN32)
#include <windows.h>
#endif
#include "phrqtype.h"
#include <string> // std::string
#include <map> // std::map
#include <vector> // std::vector
@ -16,6 +16,7 @@
class CParser: public PHRQ_base
{
public:
@ -242,7 +243,7 @@ class CParser: public PHRQ_base
STATUS_TYPE parse_couple(std::string & token);
STATUS_TYPE addPair(std::map < std::string, double >&totals,
STATUS_TYPE addPair(std::map < std::string, LDBLE >&totals,
std::istream::pos_type & pos);
protected:

View File

@ -180,7 +180,7 @@ cxxPressure::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) con
{
int i = 0;
s_oss << indent2;
for (std::vector < double >::const_iterator it = this->pressures.begin();
for (std::vector < LDBLE >::const_iterator it = this->pressures.begin();
it != this->pressures.end(); it++)
{
if (i++ == 5)
@ -200,7 +200,7 @@ cxxPressure::read_raw(CParser & parser)
{
// clear steps for modify operation, if pressures are read
bool cleared_once = false;
double d;
LDBLE d;
CParser::TOKEN_TYPE k;
static std::vector < std::string > vopts;
if (vopts.empty())

View File

@ -23,14 +23,14 @@ class cxxPressure:public cxxNumKeyword
int read(CParser & parser);
void read_raw(CParser & parser);
LDBLE Pressure_for_step(int step_number);
std::vector<double> & Get_pressures(void) {return pressures;}
std::vector<LDBLE> & Get_pressures(void) {return pressures;}
int Get_count(void) const;
void Set_count(int i) {count = i;}
bool Get_equalIncrements(void) const {return equalIncrements;}
void Set_equalIncrements(bool tf) {equalIncrements = tf;}
protected:
std::vector < double >pressures;
std::vector < LDBLE >pressures;
int count;
bool equalIncrements;

View File

@ -104,7 +104,7 @@ cxxReaction::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) con
{
int i = 0;
s_oss << indent2;
for (std::vector < double >::const_iterator it = this->steps.begin();
for (std::vector < LDBLE >::const_iterator it = this->steps.begin();
it != this->steps.end(); it++)
{
if (i++ == 5)
@ -132,7 +132,7 @@ cxxReaction::read_raw(CParser & parser, const bool check)
{
int j;
double d;
LDBLE d;
CParser::TOKEN_TYPE k;
static std::vector < std::string > vopts;
if (vopts.empty())

View File

@ -25,7 +25,7 @@ class cxxReaction:public cxxNumKeyword
const cxxNameDouble &Get_elementList(void) const {return this->elementList;}
void Set_elementList(cxxNameDouble nd) {this->elementList = nd;}
cxxNameDouble &Get_reactantList(void) {return this->reactantList;}
std::vector < double > &Get_steps(void) {return this->steps;}
std::vector < LDBLE > &Get_steps(void) {return this->steps;}
void Set_steps(std::vector<LDBLE> &v) {steps = v;}
int Get_actualSteps(void) const;
int Get_countSteps(void) const {return this->countSteps;}
@ -45,7 +45,7 @@ class cxxReaction:public cxxNumKeyword
protected:
cxxNameDouble reactantList;
cxxNameDouble elementList;
std::vector < double >steps;
std::vector < LDBLE >steps;
int countSteps;
bool equalIncrements;
std::string units;

View File

@ -1445,7 +1445,7 @@ run_as_cells(void)
run_info.Set_run_cells(true);
dup_print("Beginning of run as cells.", TRUE);
double initial_total_time_save;
LDBLE initial_total_time_save;
if (run_info.Get_start_time() != NA)
{
initial_total_time_save = run_info.Get_start_time();

22
SS.cxx
View File

@ -36,7 +36,7 @@ PHRQ_base(io)
xb1 = 0;
xb2 = 0;
//SS_PARAMETER_TYPE type = SS_PARM_NONE;
//double p[4];
//LDBLE p[4];
}
cxxSS::cxxSS(struct s_s *s_s_ptr, PHRQ_io *io)
@ -421,7 +421,7 @@ cxxSS::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxSS::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
ints.push_back(dictionary.string2int(this->name));
@ -436,7 +436,7 @@ cxxSS::mpi_pack(std::vector < int >&ints,
}
void
cxxSS::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSS::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;
@ -480,7 +480,7 @@ cxxSS::totalize(PHREEQC_PTR_ARG)
}
void
cxxSS::add(const cxxSS & addee, double extensive)
cxxSS::add(const cxxSS & addee, LDBLE extensive)
{
if (extensive == 0.0)
return;
@ -492,20 +492,20 @@ cxxSS::add(const cxxSS & addee, double extensive)
//char *name;
//cxxNameDouble comps;
this->comps.add_extensive(addee.comps, extensive);
//double a0, a1;
//double ag0, ag1;
//LDBLE a0, a1;
//LDBLE ag0, ag1;
//bool miscibility;
//double xb1, xb2;
//LDBLE xb1, xb2;
}
void
cxxSS::multiply(double extensive)
cxxSS::multiply(LDBLE extensive)
{
//char *name;
//cxxNameDouble comps;
this->comps.multiply(extensive);
//double a0, a1;
//double ag0, ag1;
//LDBLE a0, a1;
//LDBLE ag0, ag1;
//bool miscibility;
//double xb1, xb2;
//LDBLE xb1, xb2;
}

27
SS.h
View File

@ -6,6 +6,7 @@
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "phrqtype.h"
#include "NameDouble.h"
#include "Phreeqc_class.h"
@ -61,26 +62,26 @@ class cxxSS: public PHRQ_base
};
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
void add(const cxxSS & comp, double extensive);
void multiply(double extensive);
double Get_a0() const {return (this->a0);};
double Get_a1() const {return (this->a1);};
double Get_ag0() const {return (this->ag0);};
double Get_ag1() const {return (this->ag1);};
void add(const cxxSS & comp, LDBLE extensive);
void multiply(LDBLE extensive);
LDBLE Get_a0() const {return (this->a0);};
LDBLE Get_a1() const {return (this->a1);};
LDBLE Get_ag0() const {return (this->ag0);};
LDBLE Get_ag1() const {return (this->ag1);};
bool Get_miscibility() const {return (this->miscibility);};
double Get_xb1() const {return (this->xb1);};
double Get_xb2() const {return (this->xb2);};
LDBLE Get_xb1() const {return (this->xb1);};
LDBLE Get_xb2() const {return (this->xb2);};
protected:
std::string name;
cxxNameDouble comps;
double a0, a1;
double ag0, ag1;
LDBLE a0, a1;
LDBLE ag0, ag1;
bool miscibility;
double xb1, xb2;
LDBLE xb1, xb2;
cxxNameDouble totals;
public:

View File

@ -56,8 +56,8 @@ cxxNumKeyword(io)
//
// Mix
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -223,7 +223,7 @@ cxxSSassemblage::read_raw(CParser & parser, bool check)
/* ---------------------------------------------------------------------- */
void
cxxSSassemblage::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
/* ---------------------------------------------------------------------- */
{
/* int n_user; */
@ -239,7 +239,7 @@ cxxSSassemblage::mpi_pack(std::vector < int >&ints,
/* ---------------------------------------------------------------------- */
void
cxxSSassemblage::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSSassemblage::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
/* ---------------------------------------------------------------------- */
{
int i = *ii;
@ -277,7 +277,7 @@ cxxSSassemblage::totalize(PHREEQC_PTR_ARG)
return;
}
void
cxxSSassemblage::add(const cxxSSassemblage & addee, double extensive)
cxxSSassemblage::add(const cxxSSassemblage & addee, LDBLE extensive)
//
// Add to existing ssassemblage to "this" ssassemblage
//

View File

@ -38,8 +38,8 @@ public:
};
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
void totalize(PHREEQC_PTR_ARG);
@ -50,7 +50,7 @@ public:
protected:
void add(const cxxSSassemblage & addee, double extensive);
void add(const cxxSSassemblage & addee, LDBLE extensive);
protected:
std::map < std::string, cxxSS > ssAssemblageSSs;

View File

@ -107,8 +107,8 @@ isotopes(io)
//
// Mix solutions
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
std::map < int, cxxSolution >::const_iterator sol =
@ -196,7 +196,7 @@ cxxSolution::dump_xml(std::ostream & s_oss, unsigned int indent) const
this->master_activity.dump_xml(s_oss, indent + 1);
/*
{
for (std::map <char *, double>::const_iterator it = master_activity.begin(); it != master_activity.end(); ++it) {
for (std::map <char *, LDBLE>::const_iterator it = master_activity.begin(); it != master_activity.end(); ++it) {
s_oss << indent1;
s_oss << "<soln_m_a";
s_oss << " m_a_desc=\"" << it->first << "\"" ;
@ -209,7 +209,7 @@ cxxSolution::dump_xml(std::ostream & s_oss, unsigned int indent) const
this->species_gamma.dump_xml(s_oss, indent + 1);
/*
{
for (std::map <char *, double>::const_iterator it = species_gamma.begin(); it != species_gamma.end(); ++it) {
for (std::map <char *, LDBLE>::const_iterator it = species_gamma.begin(); it != species_gamma.end(); ++it) {
s_oss << indent1;
s_oss << "<soln_s_g";
s_oss << " m_a_desc=\"" << it->first << "\"" ;
@ -314,7 +314,7 @@ cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) con
this->master_activity.dump_raw(s_oss, indent + 2);
/*
{
for (std::map <char *, double>::const_iterator it = master_activity.begin(); it != master_activity.end(); ++it) {
for (std::map <char *, LDBLE>::const_iterator it = master_activity.begin(); it != master_activity.end(); ++it) {
s_oss << indent2;
s_oss << it->first << " " << it->second << "\n";
}
@ -327,7 +327,7 @@ cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) con
/*
{
{
for (std::map <char *, double>::const_iterator it = species_gamma.begin(); it != species_gamma.end(); ++it) {
for (std::map <char *, LDBLE>::const_iterator it = species_gamma.begin(); it != species_gamma.end(); ++it) {
s_oss << indent2;
s_oss << it->first << " " << it->second << "\n";
}
@ -704,17 +704,17 @@ cxxSolution::zero()
}
void
cxxSolution::add(const cxxSolution & addee, double extensive)
cxxSolution::add(const cxxSolution & addee, LDBLE extensive)
//
// Add existing solution to "this" solution
//
{
if (extensive == 0.0)
return;
double ext1 = this->mass_water;
double ext2 = addee.mass_water * extensive;
double f1 = ext1 / (ext1 + ext2);
double f2 = ext2 / (ext1 + ext2);
LDBLE ext1 = this->mass_water;
LDBLE ext2 = addee.mass_water * extensive;
LDBLE f1 = ext1 / (ext1 + ext2);
LDBLE f2 = ext2 / (ext1 + ext2);
this->tc = f1 * this->tc + f2 * addee.tc;
this->ph = f1 * this->ph + f2 * addee.ph;
this->pe = f1 * this->pe + f2 * addee.pe;
@ -732,7 +732,7 @@ cxxSolution::add(const cxxSolution & addee, double extensive)
}
void
cxxSolution::multiply(double extensive)
cxxSolution::multiply(LDBLE extensive)
//
// Multiply existing solution by extensive
//
@ -748,7 +748,7 @@ cxxSolution::multiply(double extensive)
this->isotopes.multiply(extensive);
}
double
LDBLE
cxxSolution::Get_total(char *string) const
{
cxxNameDouble::const_iterator it = this->totals.find(string);
@ -761,11 +761,11 @@ cxxSolution::Get_total(char *string) const
return (it->second);
}
}
double
LDBLE
cxxSolution::Get_total_element(const char *string) const
{
cxxNameDouble::const_iterator it;
double d = 0.0;
LDBLE d = 0.0;
for (it = this->totals.begin(); it != this->totals.end(); ++it)
{
// C++ way to do it
@ -786,12 +786,12 @@ cxxSolution::Get_total_element(const char *string) const
}
void
cxxSolution::Set_total(char *string, double d)
cxxSolution::Set_total(char *string, LDBLE d)
{
this->totals[string] = d;
}
double
LDBLE
cxxSolution::Get_master_activity(char *string) const
{
cxxNameDouble::const_iterator it = this->master_activity.find(string);
@ -809,7 +809,7 @@ cxxSolution::Get_master_activity(char *string) const
/* ---------------------------------------------------------------------- */
void
cxxSolution::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
/* ---------------------------------------------------------------------- */
{
/*
@ -846,7 +846,7 @@ cxxSolution::mpi_pack(std::vector < int >&ints,
int i = ints.size();
int int_array[i];
int d = doubles.size();
double double_array[d];
LDBLE double_array[d];
for (int j = 0; j < i; j++) {
int_array[j] = ints[j];
}
@ -866,7 +866,7 @@ cxxSolution::mpi_pack(std::vector < int >&ints,
/* ---------------------------------------------------------------------- */
void
cxxSolution::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSolution::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
/* ---------------------------------------------------------------------- */
{
int i = *ii;
@ -909,10 +909,10 @@ cxxSolution::mpi_send(int task_number)
//int count_totals, count_totals_position, count_activity, count_activity_position;
int max_size, member_size, position;
//int ints[MESSAGE_MAX_NUMBERS];
//double doubles[MESSAGE_MAX_NUMBERS];
//LDBLE doubles[MESSAGE_MAX_NUMBERS];
void *buffer;
std::vector < int >ints;
std::vector < double >doubles;
std::vector < LDBLE >doubles;
/*
* Make list of list of ints and doubles from solution structure
* This list is not the complete structure, but only enough
@ -972,7 +972,7 @@ cxxSolution::mpi_send(int task_number)
int i = (int) ints.size();
int *int_array = new int[i];
int d = (int) doubles.size();
double *double_array = new double[d];
LDBLE *double_array = new LDBLE[d];
for (int j = 0; j < i; j++)
{
int_array[j] = ints[j];
@ -1034,7 +1034,7 @@ cxxSolution::mpi_recv(int task_number)
int count_doubles;
MPI_Unpack(buffer, msg_size, &position, &count_doubles, 1, MPI_INT,
MPI_COMM_WORLD);
double *doubles = new double[count_doubles];
LDBLE *doubles = new LDBLE[count_doubles];
MPI_Unpack(buffer, msg_size, &position, doubles, count_doubles,
MPI_DOUBLE, MPI_COMM_WORLD);
buffer = free_check_null(buffer);
@ -1083,7 +1083,7 @@ cxxSolution::mpi_recv(int task_number)
}
#endif
void
cxxSolution::Set_master_activity(char *string, double d)
cxxSolution::Set_master_activity(char *string, LDBLE d)
{
this->master_activity[string] = d;
}
@ -1116,7 +1116,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
// redox element erase and replace
if (master_ptr_secondary != master_ptr)
{
double d = it->second;
LDBLE d = it->second;
orig_master_activity.erase(orig_master_activity.find(master_ptr->elt->name));
orig_master_activity[master_ptr_secondary->elt->name] = d;
redo = true;
@ -1149,7 +1149,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
// redox element erase and replace
if (master_ptr_secondary != master_ptr)
{
double d = it->second;
LDBLE d = it->second;
mod_master_activity.erase(mod_master_activity.find(master_ptr->elt->name));
mod_master_activity[master_ptr_secondary->elt->name] = d;
redo = true;
@ -1183,7 +1183,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
}
if (strcmp(ename, "H") == 0 || strcmp(ename, "O") == 0) continue;
double d_mod, d_orig;
LDBLE d_mod, d_orig;
d_mod = this->Get_total_element(ename);
if (d_mod <= 0) continue;
@ -1199,7 +1199,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
}
// case where total for both orig and modified are greater than 0
double lratio = log10(d_mod / d_orig);
LDBLE lratio = log10(d_mod / d_orig);
int j;
j = master_primary_ptr->number;
@ -1224,7 +1224,7 @@ cxxSolution::modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & origina
it1 = orig_master_activity.find(P_INSTANCE_POINTER master[j]->elt->name);
if (it1 != orig_master_activity.end())
{
double d = it1->second;
LDBLE d = it1->second;
mod_master_activity[P_INSTANCE_POINTER master[j]->elt->name] = d + lratio;
}
else
@ -1279,8 +1279,8 @@ cxxSolution::modify_activities(const cxxSolution & original)
{
// valence in current and element in original
ename = it->first.substr(0, indexCh);
double orig_tot = original.Get_total_element(ename.c_str());
double tot = this->Get_total_element(ename.c_str());
LDBLE orig_tot = original.Get_total_element(ename.c_str());
LDBLE tot = this->Get_total_element(ename.c_str());
if (tot > 0 && orig_tot > 0)
{
factor[ename] = log10(tot/orig_tot);
@ -1290,7 +1290,7 @@ cxxSolution::modify_activities(const cxxSolution & original)
{
// element in current and valence in original
ename = it->first;
double orig_tot = original.Get_total_element(ename.c_str());
LDBLE orig_tot = original.Get_total_element(ename.c_str());
if (it->second > 0 && orig_tot > 0)
{
factor[ename] = log10(it->second/orig_tot);
@ -1306,7 +1306,7 @@ cxxSolution::modify_activities(const cxxSolution & original)
if (orig_it != original.Get_master_activity().end())
{
// Found exact match
double d = orig_it->second + it->second;
LDBLE d = orig_it->second + it->second;
updated_orig_activities[it->first.c_str()] = d;
}
else
@ -1319,7 +1319,7 @@ cxxSolution::modify_activities(const cxxSolution & original)
{
if (strstr(orig_it->first.c_str(), v_name.c_str()) == orig_it->first.c_str())
{
double d = orig_it->second + it->second;
LDBLE d = orig_it->second + it->second;
updated_orig_activities[orig_it->first.c_str()] = d;
}
}
@ -1417,12 +1417,12 @@ cxxSolution::Update(const cxxNameDouble &nd)
// Exact match
if ( it->first == sol_it->first)
{
double d = sol_it->second + it->second;
LDBLE d = sol_it->second + it->second;
updated_activities[it->first.c_str()] = d;
}
else if (strstr(v_name.c_str(), sol_it->first.c_str()) == sol_it->first.c_str())
{
double d = sol_it->second + it->second;
LDBLE d = sol_it->second + it->second;
updated_activities[sol_it->first.c_str()] = d;
}
}

View File

@ -24,99 +24,99 @@ class cxxSolution:public cxxNumKeyword
cxxMix & mx, int n_user, PHRQ_io *io=NULL);
~cxxSolution();
double Get_tc() const
LDBLE Get_tc() const
{
return this->tc;
}
void Set_tc(double l_tc)
void Set_tc(LDBLE l_tc)
{
this->tc = l_tc;
}
double Get_ph() const
LDBLE Get_ph() const
{
return this->ph;
}
void Set_ph(double pH)
void Set_ph(LDBLE pH)
{
this->ph = pH;
}
double Get_pe() const
LDBLE Get_pe() const
{
return this->pe;
}
void Set_pe(double l_pe)
void Set_pe(LDBLE l_pe)
{
this->pe = l_pe;
}
double Get_mu() const
LDBLE Get_mu() const
{
return this->mu;
}
void Set_mu(double l_mu)
void Set_mu(LDBLE l_mu)
{
this->mu = l_mu;
}
double Get_ah2o() const
LDBLE Get_ah2o() const
{
return this->ah2o;
}
void Set_ah2o(double l_ah2o)
void Set_ah2o(LDBLE l_ah2o)
{
this->ah2o = l_ah2o;
}
double Get_total_h() const
LDBLE Get_total_h() const
{
return this->total_h;
}
void Set_total_h(double l_total_h)
void Set_total_h(LDBLE l_total_h)
{
this->total_h = l_total_h;
}
double Get_total_o() const
LDBLE Get_total_o() const
{
return this->total_o;
}
void Set_total_o(double l_total_o)
void Set_total_o(LDBLE l_total_o)
{
this->total_o = l_total_o;
}
double Get_cb() const
LDBLE Get_cb() const
{
return this->cb;
}
void Set_cb(double l_cb)
void Set_cb(LDBLE l_cb)
{
this->cb = l_cb;
}
double Get_mass_water() const
LDBLE Get_mass_water() const
{
return this->mass_water;
}
void Set_mass_water(long double l_mass_water)
void Set_mass_water(LDBLE l_mass_water)
{
this->mass_water = l_mass_water;
}
double Get_total_alkalinity() const
LDBLE Get_total_alkalinity() const
{
return this->total_alkalinity;
}
void Set_total_alkalinity(double l_total_alkalinity)
void Set_total_alkalinity(LDBLE l_total_alkalinity)
{
this->total_alkalinity = l_total_alkalinity;
}
double Get_total(char *string) const;
double Get_total_element(const char *string) const;
void Set_total(char *string, double value);
LDBLE Get_total(char *string) const;
LDBLE Get_total_element(const char *string) const;
void Set_total(char *string, LDBLE value);
const cxxNameDouble & Get_totals(void) const
{
@ -144,41 +144,41 @@ class cxxSolution:public cxxNumKeyword
{
return this->species_gamma;
}
double Get_master_activity(char *string) const;
void Set_master_activity(char *string, double value);
LDBLE Get_master_activity(char *string) const;
void Set_master_activity(char *string, LDBLE value);
const cxxSolutionIsotopeList & Get_isotopes(void) const {return isotopes;};
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);
void multiply(double extensive);
void multiply(LDBLE extensive);
//void modify_activities(PHREEQC_PTR_ARG_COMMA const cxxSolution & original);
void modify_activities(const cxxSolution & original);
void Simplify_totals();
void Update(const cxxNameDouble &nd);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
void mpi_send(int task_number);
void mpi_recv(int task_number);
#endif
protected:
void zero();
void add(const cxxSolution & addee, double extensive);
void add(const cxxSolution & addee, LDBLE extensive);
// not checked
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
double tc;
double ph;
double pe;
double mu;
double ah2o;
double total_h;
double total_o;
double cb;
double mass_water;
double total_alkalinity;
LDBLE tc;
LDBLE ph;
LDBLE pe;
LDBLE mu;
LDBLE ah2o;
LDBLE total_h;
LDBLE total_o;
LDBLE cb;
LDBLE mass_water;
LDBLE total_alkalinity;
cxxNameDouble totals;
//std::list<cxxSolutionIsotope> isotopes;
cxxNameDouble master_activity;

View File

@ -214,7 +214,7 @@ cxxSolutionIsotope::operator<(const cxxSolutionIsotope & isotope) const
void
cxxSolutionIsotope::add(const cxxSolutionIsotope & isotope_ptr,
double intensive, double extensive)
LDBLE intensive, LDBLE extensive)
{
if ((this->isotope_number == isotope_ptr.isotope_number) &&
(this->elt_name == isotope_ptr.elt_name) &&
@ -229,7 +229,7 @@ cxxSolutionIsotope::add(const cxxSolutionIsotope & isotope_ptr,
}
}
void
cxxSolutionIsotope::multiply(double extensive)
cxxSolutionIsotope::multiply(LDBLE extensive)
{
this->total *= extensive;
}

View File

@ -18,11 +18,11 @@ class cxxSolutionIsotope: public PHRQ_base
CParser::STATUS_TYPE read_raw(CParser & parser, std::istream::pos_type next_char);
double Get_isotope_number() const
LDBLE Get_isotope_number() const
{
return this->isotope_number;
}
void Set_isotope_number(double d)
void Set_isotope_number(LDBLE d)
{
this->isotope_number = d;
}
@ -48,21 +48,21 @@ class cxxSolutionIsotope: public PHRQ_base
else
this->isotope_name.clear();
}
double Get_total() const
LDBLE Get_total() const
{
return this->total;
}
void Set_total(double d)
void Set_total(LDBLE d)
{
this->total = d;
}
double Get_ratio() const
LDBLE Get_ratio() const
{
return this->ratio;
}
double Get_ratio_uncertainty() const
LDBLE Get_ratio_uncertainty() const
{
return this->ratio_uncertainty;
}
@ -73,18 +73,18 @@ class cxxSolutionIsotope: public PHRQ_base
}
bool operator<(const cxxSolutionIsotope & conc) const;
void add(const cxxSolutionIsotope & isotope_ptr, double intensive,
double extensive);
void multiply(double extensive);
void add(const cxxSolutionIsotope & isotope_ptr, LDBLE intensive,
LDBLE extensive);
void multiply(LDBLE extensive);
protected:
friend class cxxSolutionIsotopeList;
double isotope_number;
LDBLE isotope_number;
std::string elt_name;
std::string isotope_name;
double total;
double ratio;
double ratio_uncertainty;
LDBLE total;
LDBLE ratio;
LDBLE ratio_uncertainty;
bool ratio_uncertainty_defined;
};
#endif // SOLUTIONISOTOPE_H_INCLUDED

View File

@ -37,8 +37,8 @@ cxxSolutionIsotopeList::~cxxSolutionIsotopeList()
{
}
void
cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, double intensive,
double extensive)
cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, LDBLE intensive,
LDBLE extensive)
{
for (cxxSolutionIsotopeList::const_iterator itold = old.begin();
itold != old.end(); ++itold)
@ -75,7 +75,7 @@ cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, double intensive,
}
}
void
cxxSolutionIsotopeList::multiply(double extensive)
cxxSolutionIsotopeList::multiply(LDBLE extensive)
{
for (cxxSolutionIsotopeList::iterator it = this->begin();
it != this->end(); ++it)

View File

@ -18,8 +18,8 @@ public:
~cxxSolutionIsotopeList();
void add(cxxSolutionIsotopeList oldlist, double intensive, double extensive);
void multiply(double extensive);
void add(cxxSolutionIsotopeList oldlist, LDBLE intensive, LDBLE extensive);
void multiply(LDBLE extensive);
protected:

View File

@ -904,7 +904,7 @@ cxxStorageBin::mix_cxxSolutions(cxxMix & mixmap)
* mixes solutions based on cxxMix structure, returns new solution
* return solution must be freed by calling method
*/
double intensive, extensive;
LDBLE intensive, extensive;
cxxSolution *cxxsoln_ptr, *cxxsoln_ptr1;
/*
* Zero out global solution data
@ -915,9 +915,9 @@ cxxStorageBin::mix_cxxSolutions(cxxMix & mixmap)
*/
extensive = 0.0;
std::map < int, double >*mixcomps = mixmap.comps();
std::map < int, LDBLE >*mixcomps = mixmap.comps();
std::map < int, double >::const_iterator it;
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps->begin(); it != mixcomps->end(); it++)
{
extensive += it->second;
@ -1049,7 +1049,7 @@ cxxStorageBin::mpi_send(int n, int task_number)
// Send data for system n to task_number
//
std::vector < int >ints;
std::vector < double >doubles;
std::vector < LDBLE >doubles;
// Solution
if (this->getSolution(n) != NULL)
@ -1152,7 +1152,7 @@ cxxStorageBin::mpi_send(int n, int task_number)
int i = (int) ints.size();
//int int_array[i];
int d = (int) doubles.size();
//double double_array[d];
//LDBLE double_array[d];
/*
for (int j = 0; j < i; j++) {
int_array[j] = ints[j];
@ -1222,7 +1222,7 @@ cxxStorageBin::mpi_recv(int task_number)
int count_doubles;
MPI_Unpack(buffer, msg_size, &position, &count_doubles, 1, MPI_INT,
MPI_COMM_WORLD);
double *doubles = new double[count_doubles];
LDBLE *doubles = new LDBLE[count_doubles];
if (count_doubles > 0)
{
MPI_Unpack(buffer, msg_size, &position, doubles, count_doubles,
@ -1318,8 +1318,8 @@ cxxStorageBin::mix_cxxExchange(cxxMix & mixmap)
*/
new_exch_ptr = new cxxExchange();
std::map < int, double >::const_iterator it_mix;
std::map < int, double >*mixcomps = mixmap.comps();
std::map < int, LDBLE >::const_iterator it_mix;
std::map < int, LDBLE >*mixcomps = mixmap.comps();
// Pitzer_exchange_gammas
it_mix = mixcomps->begin();
@ -1338,7 +1338,7 @@ cxxStorageBin::mix_cxxExchange(cxxMix & mixmap)
* Make list of ExchComps
*/
std::vector < cxxExchComp > ec_vector;
std::vector < double >f_vector;
std::vector < LDBLE >f_vector;
//
// make list of all exchange components and their mix fractions
//
@ -1372,9 +1372,9 @@ cxxStorageBin::mix_cxxExchange(cxxMix & mixmap)
{
std::vector < cxxExchComp > ec_subvector;
std::vector < double >f_subvector;
std::vector < LDBLE >f_subvector;
std::vector < cxxExchComp >::iterator it_ec = ec_vector.begin();
std::vector < double >::iterator it_f = f_vector.begin();
std::vector < LDBLE >::iterator it_f = f_vector.begin();
current_formula = NULL;
for (; it_ec != ec_vector.end(); it_ec++)
{

View File

@ -95,8 +95,8 @@ cxxNumKeyword(io)
//
// Mix exchangers
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -657,7 +657,7 @@ cxxSurface::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
/* ---------------------------------------------------------------------- */
void
cxxSurface::mpi_pack(std::vector < int >&ints, std::vector < double >&doubles)
cxxSurface::mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles)
/* ---------------------------------------------------------------------- */
{
/* int n_user; */
@ -691,7 +691,7 @@ cxxSurface::mpi_pack(std::vector < int >&ints, std::vector < double >&doubles)
/* ---------------------------------------------------------------------- */
void
cxxSurface::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSurface::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
/* ---------------------------------------------------------------------- */
{
int i = *ii;
@ -751,7 +751,7 @@ cxxSurface::totalize()
}
void
cxxSurface::add(const cxxSurface & addee, double extensive)
cxxSurface::add(const cxxSurface & addee, LDBLE extensive)
//
// Add surface to "this" exchange
//
@ -768,13 +768,13 @@ cxxSurface::add(const cxxSurface & addee, double extensive)
this->sites_units = addee.sites_units;
//bool only_counter_ions;
this->only_counter_ions = addee.only_counter_ions;
//double thickness;
//LDBLE thickness;
this->thickness = addee.thickness;
//double debye_lengths;
//LDBLE debye_lengths;
this->debye_lengths = addee.debye_lengths;
//double DDL_viscosity;
//LDBLE DDL_viscosity;
this->DDL_viscosity = addee.DDL_viscosity;
//double DDL_limit;
//LDBLE DDL_limit;
this->DDL_limit = addee.DDL_limit;
//bool transport;
this->transport = addee.transport;

View File

@ -40,21 +40,21 @@ class cxxSurface:public cxxNumKeyword
};
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
void add(const cxxSurface & addee, double extensive);
void add(const cxxSurface & addee, LDBLE extensive);
const std::map < std::string, cxxSurfaceComp > & Get_surfaceComps() const {return this->surfaceComps;};
const std::map < std::string, cxxSurfaceCharge > & Get_surfaceCharges() const {return this->surfaceCharges;};
SURFACE_TYPE Get_type(void) const {return this->type;};
DIFFUSE_LAYER_TYPE Get_dl_type(void) const {return dl_type;};
SITES_UNITS Get_sites_units(void) const {return sites_units;};
bool Get_only_counter_ions(void) const {return only_counter_ions;};
double Get_thickness(void) const {return thickness;};
double Get_debye_lengths(void) const {return debye_lengths;};
double Get_DDL_viscosity(void) const {return DDL_viscosity;};
double Get_DDL_limit(void) const {return DDL_limit;};
LDBLE Get_thickness(void) const {return thickness;};
LDBLE Get_debye_lengths(void) const {return debye_lengths;};
LDBLE Get_DDL_viscosity(void) const {return DDL_viscosity;};
LDBLE Get_DDL_limit(void) const {return DDL_limit;};
bool Get_transport(void) const {return transport;};
protected:
@ -64,10 +64,10 @@ protected:
enum DIFFUSE_LAYER_TYPE dl_type;
enum SITES_UNITS sites_units;
bool only_counter_ions;
double thickness;
double debye_lengths;
double DDL_viscosity;
double DDL_limit;
LDBLE thickness;
LDBLE debye_lengths;
LDBLE DDL_viscosity;
LDBLE DDL_limit;
bool transport;
cxxNameDouble totals;

View File

@ -424,7 +424,7 @@ cxxSurfaceCharge::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxSurfaceCharge::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
@ -442,7 +442,7 @@ cxxSurfaceCharge::mpi_pack(std::vector < int >&ints,
}
void
cxxSurfaceCharge::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSurfaceCharge::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;
@ -463,17 +463,17 @@ cxxSurfaceCharge::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
}
#endif
void
cxxSurfaceCharge::add(const cxxSurfaceCharge & addee, double extensive)
cxxSurfaceCharge::add(const cxxSurfaceCharge & addee, LDBLE extensive)
{
if (extensive == 0.0)
return;
//char * name;
//double specific_area;
//double grams;
//double charge_balance;
//double mass_water;
//double la_psi, la_psi1, la_psi2;
//double capacitance[2];
//LDBLE specific_area;
//LDBLE grams;
//LDBLE charge_balance;
//LDBLE mass_water;
//LDBLE la_psi, la_psi1, la_psi2;
//LDBLE capacitance[2];
//char * name;
if (this->name.size() == 0 && addee.name.size() == 0)
@ -482,7 +482,7 @@ cxxSurfaceCharge::add(const cxxSurfaceCharge & addee, double extensive)
}
assert(this->name == addee.name);
double ext1, ext2, f1, f2;
LDBLE ext1, ext2, f1, f2;
ext1 = this->specific_area * this->grams;
ext2 = addee.specific_area * addee.grams * extensive;
if (ext1 + ext2 != 0)
@ -496,19 +496,19 @@ cxxSurfaceCharge::add(const cxxSurfaceCharge & addee, double extensive)
f2 = 0.5;
}
//double specific_area;
//LDBLE specific_area;
this->specific_area = f1 * this->specific_area + f2 * addee.specific_area;
//double grams;
//LDBLE grams;
this->grams += addee.grams * extensive;
//double charge_balance;
//LDBLE charge_balance;
this->charge_balance += addee.charge_balance * extensive;
//double mass_water;
//LDBLE mass_water;
this->mass_water += addee.mass_water * extensive;
//double la_psi, la_psi1, la_psi2;
//LDBLE la_psi, la_psi1, la_psi2;
this->la_psi = this->la_psi * f1 + addee.la_psi * f2;
this->la_psi1 = this->la_psi1 * f1 + addee.la_psi1 * f2;
this->la_psi2 = this->la_psi2 * f1 + addee.la_psi2 * f2;
//double capacitance[2];
//LDBLE capacitance[2];
this->capacitance[0] =
this->capacitance[0] * f1 + this->capacitance[0] * f2;
this->capacitance[1] =
@ -516,18 +516,18 @@ cxxSurfaceCharge::add(const cxxSurfaceCharge & addee, double extensive)
}
void
cxxSurfaceCharge::multiply(double extensive)
cxxSurfaceCharge::multiply(LDBLE extensive)
{
//char * name;
//double specific_area;
//double grams;
//LDBLE specific_area;
//LDBLE grams;
this->grams *= extensive;
//double charge_balance;
//LDBLE charge_balance;
this->charge_balance *= extensive;
//double mass_water;
//LDBLE mass_water;
this->mass_water *= extensive;
//double la_psi, la_psi1, la_psi2;
//double capacitance[2];
//LDBLE la_psi, la_psi1, la_psi2;
//LDBLE capacitance[2];
//cxxNameDouble diffuse_layer_totals;
this->diffuse_layer_totals.multiply(extensive);
}

View File

@ -37,32 +37,32 @@ public:
else
this->name.clear();
}
void add(const cxxSurfaceCharge & comp, double extensive);
void multiply(double extensive);
void add(const cxxSurfaceCharge & comp, LDBLE extensive);
void multiply(LDBLE extensive);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
double Get_specific_area() const {return this->specific_area;};
double Get_grams() const {return this->grams;};
double Get_charge_balance() const {return this->charge_balance;};
double Get_mass_water() const {return this->mass_water;};
double Get_la_psi() const {return this->la_psi;};
double Get_la_psi1() const {return this->la_psi1;};
double Get_la_psi2() const {return this->la_psi2;};
double Get_capacitance0() const {return this->capacitance[0];};
double Get_capacitance1() const {return this->capacitance[1];};
LDBLE Get_specific_area() const {return this->specific_area;};
LDBLE Get_grams() const {return this->grams;};
LDBLE Get_charge_balance() const {return this->charge_balance;};
LDBLE Get_mass_water() const {return this->mass_water;};
LDBLE Get_la_psi() const {return this->la_psi;};
LDBLE Get_la_psi1() const {return this->la_psi1;};
LDBLE Get_la_psi2() const {return this->la_psi2;};
LDBLE Get_capacitance0() const {return this->capacitance[0];};
LDBLE Get_capacitance1() const {return this->capacitance[1];};
const cxxNameDouble & Get_diffuse_layer_totals(void) const {return this->diffuse_layer_totals;};
protected:
std::string name;
double specific_area;
double grams;
double charge_balance;
double mass_water;
double la_psi, la_psi1, la_psi2;
double capacitance[2];
//std::map<double, cxxSurfDL> g;
LDBLE specific_area;
LDBLE grams;
LDBLE charge_balance;
LDBLE mass_water;
LDBLE la_psi, la_psi1, la_psi2;
LDBLE capacitance[2];
//std::map<LDBLE, cxxSurfDL> g;
//char * psi_master_name;
cxxNameDouble diffuse_layer_totals;

View File

@ -423,7 +423,7 @@ cxxSurfaceComp::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxSurfaceComp::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
extern cxxDictionary dictionary;
@ -442,7 +442,7 @@ cxxSurfaceComp::mpi_pack(std::vector < int >&ints,
}
void
cxxSurfaceComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxSurfaceComp::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
extern cxxDictionary dictionary;
int i = *ii;
@ -464,7 +464,7 @@ cxxSurfaceComp::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
}
#endif
void
cxxSurfaceComp::add(const cxxSurfaceComp & addee, double extensive)
cxxSurfaceComp::add(const cxxSurfaceComp & addee, LDBLE extensive)
{
if (extensive == 0.0)
return;
@ -487,7 +487,7 @@ cxxSurfaceComp::add(const cxxSurfaceComp & addee, double extensive)
// this and addee must have same formula
// otherwise generate a new exchcomp with multiply
double ext1, ext2, f1, f2;
LDBLE ext1, ext2, f1, f2;
ext1 = this->moles;
ext2 = addee.moles * extensive;
if (ext1 + ext2 != 0)
@ -500,16 +500,16 @@ cxxSurfaceComp::add(const cxxSurfaceComp & addee, double extensive)
f1 = 0.5;
f2 = 0.5;
}
//double formula_z;
//LDBLE formula_z;
//double moles;
//LDBLE moles;
this->moles += addee.moles * extensive;
//cxxNameDouble totals;
this->totals.add_extensive(addee.totals, extensive);
//double la;
//LDBLE la;
this->la = f1 * this->la + f2 * addee.la;
//int charge_number;
//double charge_balance;
//LDBLE charge_balance;
this->charge_balance += addee.charge_balance * extensive;
//char *phase_name;
@ -540,7 +540,7 @@ cxxSurfaceComp::add(const cxxSurfaceComp & addee, double extensive)
}
else if (this->rate_name.size() != 0)
{
//double phase_proportion;
//LDBLE phase_proportion;
this->phase_proportion =
this->phase_proportion * f1 + addee.phase_proportion * f2;
}
@ -554,27 +554,27 @@ cxxSurfaceComp::add(const cxxSurfaceComp & addee, double extensive)
error_msg(oss.str().c_str(), CONTINUE);
return;
}
//double Dw;
//LDBLE Dw;
}
void
cxxSurfaceComp::multiply(double extensive)
cxxSurfaceComp::multiply(LDBLE extensive)
{
//char * formula;
//cxxNameDouble formula_totals;
//double formula_z;
//double moles;
//LDBLE formula_z;
//LDBLE moles;
this->moles *= extensive;
//cxxNameDouble totals;
this->totals.multiply(extensive);
//double la;
//LDBLE la;
//int charge_number;
//double charge_balance;
//LDBLE charge_balance;
this->charge_balance *= extensive;
//char *phase_name;
//double phase_proportion;
//LDBLE phase_proportion;
//char *rate_name;
//double Dw;
//LDBLE Dw;
}
const std::string &
cxxSurfaceComp::Get_phase_name() const
@ -615,13 +615,13 @@ cxxSurfaceComp::Set_formula(const char * f)
else
this->formula.clear();
}
double
LDBLE
cxxSurfaceComp::Get_charge_balance() const
{
return this->charge_balance;
}
void
cxxSurfaceComp::Set_charge_balance(double d)
cxxSurfaceComp::Set_charge_balance(LDBLE d)
{
this->charge_balance = d;
}

View File

@ -24,39 +24,39 @@ public:
void Set_rate_name(const char * f);
const std::string &Get_formula() const;
void Set_formula(const char * f);
double Get_charge_balance() const;
void Set_charge_balance(double d);
LDBLE Get_charge_balance() const;
void Set_charge_balance(LDBLE d);
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);
const cxxNameDouble & Get_totals() const;
const cxxNameDouble & Get_formula_totals() const;
double Get_formula_z(void) const {return formula_z;};
double Get_moles(void) const {return moles;};
double Get_la(void) const {return la;};
double Get_phase_proportion(void) const {return phase_proportion;};
double Get_Dw(void) const {return Dw;};
void add(const cxxSurfaceComp & comp, double extensive);
void multiply(double extensive);
LDBLE Get_formula_z(void) const {return formula_z;};
LDBLE Get_moles(void) const {return moles;};
LDBLE Get_la(void) const {return la;};
LDBLE Get_phase_proportion(void) const {return phase_proportion;};
LDBLE Get_Dw(void) const {return Dw;};
void add(const cxxSurfaceComp & comp, LDBLE extensive);
void multiply(LDBLE extensive);
#ifdef USE_MPI
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
#endif
protected:
std::string formula;
cxxNameDouble formula_totals;
double formula_z;
double moles;
LDBLE formula_z;
LDBLE moles;
cxxNameDouble totals;
double la;
LDBLE la;
//int charge_number;
double charge_balance;
LDBLE charge_balance;
std::string phase_name;
double phase_proportion;
LDBLE phase_proportion;
std::string rate_name;
double Dw;
LDBLE Dw;
public:
};

View File

@ -215,7 +215,7 @@ cxxTemperature::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out)
{
int i = 0;
s_oss << indent2;
for (std::vector < double >::const_iterator it = this->temps.begin();
for (std::vector < LDBLE >::const_iterator it = this->temps.begin();
it != this->temps.end(); it++)
{
if (i++ == 5)
@ -233,7 +233,7 @@ cxxTemperature::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out)
void
cxxTemperature::read_raw(CParser & parser)
{
double d;
LDBLE d;
CParser::TOKEN_TYPE k;
// clear steps for modify operation, if pressures are read
bool cleared_once = false;

View File

@ -23,14 +23,14 @@ class cxxTemperature:public cxxNumKeyword
void read_raw(CParser & parser);
int read(CParser & parser);
LDBLE Temperature_for_step(int step_number);
std::vector<double> & Get_temps(void) {return temps;}
std::vector<LDBLE> & Get_temps(void) {return temps;}
int Get_countTemps(void) const;
void Set_countTemps(int i) {countTemps = i;}
bool Get_equalIncrements(void) const {return equalIncrements;}
void Set_equalIncrements(bool tf) {equalIncrements = tf;}
protected:
std::vector < double >temps;
std::vector < LDBLE >temps;
int countTemps;
bool equalIncrements;

View File

@ -92,13 +92,13 @@ Utilities::squeeze_white(std::string & s_l)
s_l = str;
}
//+NAN double: 7ff8000000000000
//-NAN double: fff8000000000000
//+NAN LDBLE: 7ff8000000000000
//-NAN LDBLE: fff8000000000000
/*
double Utilities::get_nan(void)
LDBLE Utilities::get_nan(void)
{
unsigned long long raw = 0x7ff0000000000000;
double d = *( double* )&raw;
LDBLE d = *( LDBLE* )&raw;
return(d);
}

View File

@ -31,7 +31,7 @@ namespace Utilities
void squeeze_white(std::string & s_l);
double get_nan(void);
LDBLE get_nan(void);
//void error_msg(const std::string&, const int stopflag);

View File

@ -95,8 +95,8 @@ cxxNumKeyword(io)
//
// Mix
//
const std::map < int, double >&mixcomps = mix.Get_mixComps();
std::map < int, double >::const_iterator it;
const std::map < int, LDBLE >&mixcomps = mix.Get_mixComps();
std::map < int, LDBLE >::const_iterator it;
for (it = mixcomps.begin(); it != mixcomps.end(); it++)
{
if (entities.find(it->first) != entities.end())
@ -209,7 +209,7 @@ cxxKinetics::dump_raw(std::ostream & s_oss, unsigned int indent, int * n_out) co
{
int i = 0;
s_oss << indent2;
for (std::vector < double >::const_iterator it = this->steps.begin();
for (std::vector < LDBLE >::const_iterator it = this->steps.begin();
it != this->steps.end(); it++)
{
if (i++ == 5)
@ -229,7 +229,7 @@ void
cxxKinetics::read_raw(CParser & parser, bool check)
{
double d;
LDBLE d;
static std::vector < std::string > vopts;
if (vopts.empty())
{
@ -251,7 +251,7 @@ cxxKinetics::read_raw(CParser & parser, bool check)
std::string token;
int opt_save;
bool useLastLine(false);
std::vector < double > temp_steps;
std::vector < LDBLE > temp_steps;
// Read kinetics number and description
this->read_number_description(parser);
@ -527,7 +527,7 @@ cxxKinetics::read_raw(CParser & parser, bool check)
#ifdef USE_MPI
void
cxxKinetics::mpi_pack(std::vector < int >&ints,
std::vector < double >&doubles)
std::vector < LDBLE >&doubles)
{
ints.push_back(this->n_user);
ints.push_back((int) this->kineticsComps.size());
@ -544,7 +544,7 @@ cxxKinetics::mpi_pack(std::vector < int >&ints,
}
*/
ints.push_back((int) this->steps.size());
for (std::vector < double >::iterator it = this->steps.begin();
for (std::vector < LDBLE >::iterator it = this->steps.begin();
it != this->steps.end(); it++)
{
doubles.push_back(*it);
@ -559,7 +559,7 @@ cxxKinetics::mpi_pack(std::vector < int >&ints,
}
void
cxxKinetics::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
cxxKinetics::mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd)
{
int i = *ii;
int d = *dd;
@ -595,7 +595,7 @@ cxxKinetics::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
}
#endif
void
cxxKinetics::add(const cxxKinetics & addee, double extensive)
cxxKinetics::add(const cxxKinetics & addee, LDBLE extensive)
//
// Add to existing ppassemblage to "this" ppassemblage
//
@ -630,10 +630,10 @@ cxxKinetics::add(const cxxKinetics & addee, double extensive)
this->kineticsComps.push_back(entity);
}
}
//std::vector<double> steps;
//std::vector<LDBLE> steps;
this->steps = addee.steps;
//cxxNameDouble totals;
//double step_divide;
//LDBLE step_divide;
this->step_divide = addee.step_divide;
//int rk;
this->rk = addee.rk;

View File

@ -6,7 +6,7 @@
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "phrqtype.h"
#include "NumKeyword.h"
#include "KineticsComp.h"
#include "PHRQ_base.h"
@ -31,8 +31,8 @@ class cxxKinetics:public cxxNumKeyword
//bool Get_related_phases(void) const;
//bool Get_related_rate(void) const;
const std::vector < double > &Get_steps(void) const {return steps;};
double Get_step_divide(void) const {return step_divide;};
const std::vector < LDBLE > &Get_steps(void) const {return steps;};
LDBLE Get_step_divide(void) const {return step_divide;};
int Get_rk(void) const {return rk;};
int Get_bad_step_max(void) const {return bad_step_max;};
bool Get_use_cvode(void) const {return use_cvode;};
@ -44,18 +44,18 @@ class cxxKinetics:public cxxNumKeyword
#ifdef USE_MPI
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void mpi_unpack(int *ints, int *ii, LDBLE *doubles, int *dd);
void mpi_pack(std::vector < int >&ints, std::vector < LDBLE >&doubles);
#endif
protected:
void add(const cxxKinetics & addee, double extensive);
void add(const cxxKinetics & addee, LDBLE extensive);
protected:
std::list < cxxKineticsComp > kineticsComps;
std::vector < double >steps;
std::vector < LDBLE >steps;
int equal_steps;
cxxNameDouble totals;
double step_divide;
LDBLE step_divide;
int rk;
int bad_step_max;
bool use_cvode;

View File

@ -86,7 +86,7 @@ cxxMix::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "MIX " << n_user_local << " " << this->description << "\n";
for (std::map < int, double >::const_iterator it = this->mixComps.begin();
for (std::map < int, LDBLE >::const_iterator it = this->mixComps.begin();
it != this->mixComps.end(); it++)
{
s_oss << indent1 << it->first << " " << it->second << "\n";
@ -98,7 +98,7 @@ cxxMix::read_raw(CParser & parser)
{
int i;
double d;
LDBLE d;
static std::vector < std::string > vopts;
if (vopts.empty())
{
@ -181,7 +181,7 @@ void cxxMix::Vectorize(std::vector<int> &n, std::vector<LDBLE> &f)
{
n.clear();
f.clear();
for (std::map < int, double >::const_iterator it = this->mixComps.begin();
for (std::map < int, LDBLE >::const_iterator it = this->mixComps.begin();
it != this->mixComps.end(); it++)
{
n.push_back(it->first);

View File

@ -3,6 +3,7 @@
#include <set> // std::set
#include <string> // std::string
#include "phrqtype.h"
#include "StorageBinList.h"
#include "PHRQ_base.h"
class CParser;
@ -15,14 +16,14 @@ public:
virtual ~runner(void);
bool Read(CParser & parser);
StorageBinListItem & Get_cells(void) { return(this->cells); };
double Get_time_step() { return(this->time_step); };
double Get_start_time() { return(this->start_time); };
LDBLE Get_time_step() { return(this->time_step); };
LDBLE Get_start_time() { return(this->start_time); };
bool Get_run_cells() { return(this->run_cells); };
void Set_run_cells(bool tf) { this->run_cells = tf; };
protected:
double time_step;
double start_time;
LDBLE time_step;
LDBLE start_time;
StorageBinListItem cells;
bool run_cells;
};