mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
indented header files.
removed ^M from System.h git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@3169 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
3313c814a9
commit
d37ed2c6ae
19
Dictionary.h
19
Dictionary.h
@ -12,33 +12,34 @@
|
|||||||
class cxxDictionary
|
class cxxDictionary
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxDictionary();
|
cxxDictionary();
|
||||||
|
|
||||||
~cxxDictionary();
|
~cxxDictionary();
|
||||||
|
|
||||||
void add_phreeqc();
|
void add_phreeqc();
|
||||||
|
|
||||||
int size() {
|
int size()
|
||||||
|
{
|
||||||
return (int) stringkey.size();
|
return (int) stringkey.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int putString(std::string str);
|
int putString(std::string str);
|
||||||
int putString(char * str);
|
int putString(char *str);
|
||||||
|
|
||||||
int string2int(std::string str);
|
int string2int(std::string str);
|
||||||
|
|
||||||
int string2int(char * str);
|
int string2int(char *str);
|
||||||
|
|
||||||
std::string *int2string(int i);
|
std::string * int2string(int i);
|
||||||
|
|
||||||
char *int2char(int i);
|
char *int2char(int i);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::map<std::string, int> stringkey;
|
std::map < std::string, int >stringkey;
|
||||||
std::map<int, std::string> intkey;
|
std::map < int, std::string > intkey;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
127
ExchComp.h
127
ExchComp.h
@ -15,66 +15,127 @@
|
|||||||
class cxxExchComp
|
class cxxExchComp
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxExchComp();
|
cxxExchComp();
|
||||||
cxxExchComp(struct exch_comp *);
|
cxxExchComp(struct exch_comp *);
|
||||||
~cxxExchComp();
|
~cxxExchComp();
|
||||||
|
|
||||||
struct master *get_master();
|
struct master *get_master();
|
||||||
|
|
||||||
static struct exch_comp *cxxExchComp2exch_comp(std::list<cxxExchComp>& el);
|
static struct exch_comp *cxxExchComp2exch_comp(std::list < cxxExchComp >
|
||||||
|
&el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
char * get_formula()const { return this->formula;}
|
char *get_formula() const
|
||||||
void set_formula(char * cstring) { this->formula = cstring;}
|
{
|
||||||
double get_moles()const { return this->moles;}
|
return this->formula;
|
||||||
void set_moles(double d) { this->moles = d;}
|
}
|
||||||
double get_la()const { return this->la;}
|
void set_formula(char *cstring)
|
||||||
void set_la(double d) { this->la = d;}
|
{
|
||||||
double get_charge_balance()const { return this->charge_balance;}
|
this->formula = cstring;
|
||||||
void set_charge_balance(double d) { this->charge_balance = d;}
|
}
|
||||||
char * get_phase_name()const { return this->phase_name;}
|
double get_moles() const
|
||||||
void set_phase_name(char * cstring) { this->phase_name = cstring;}
|
{
|
||||||
double get_phase_proportion()const { return this->phase_proportion;}
|
return this->moles;
|
||||||
void set_phase_proportion(double d) { this->phase_proportion = d;}
|
}
|
||||||
char * get_rate_name()const { return this->rate_name;}
|
void set_moles(double d)
|
||||||
void set_rate_name(char * cstring) { this->rate_name = cstring;}
|
{
|
||||||
double get_formula_z()const { return this->formula_z;}
|
this->moles = d;
|
||||||
void set_formula_z(double d) { this->formula_z = d;}
|
}
|
||||||
|
double get_la() const
|
||||||
|
{
|
||||||
|
return this->la;
|
||||||
|
}
|
||||||
|
void set_la(double d)
|
||||||
|
{
|
||||||
|
this->la = d;
|
||||||
|
}
|
||||||
|
double get_charge_balance() const
|
||||||
|
{
|
||||||
|
return this->charge_balance;
|
||||||
|
}
|
||||||
|
void set_charge_balance(double d)
|
||||||
|
{
|
||||||
|
this->charge_balance = d;
|
||||||
|
}
|
||||||
|
char *get_phase_name() const
|
||||||
|
{
|
||||||
|
return this->phase_name;
|
||||||
|
}
|
||||||
|
void set_phase_name(char *cstring)
|
||||||
|
{
|
||||||
|
this->phase_name = cstring;
|
||||||
|
}
|
||||||
|
double get_phase_proportion() const
|
||||||
|
{
|
||||||
|
return this->phase_proportion;
|
||||||
|
}
|
||||||
|
void set_phase_proportion(double d)
|
||||||
|
{
|
||||||
|
this->phase_proportion = d;
|
||||||
|
}
|
||||||
|
char *get_rate_name() const
|
||||||
|
{
|
||||||
|
return this->rate_name;
|
||||||
|
}
|
||||||
|
void set_rate_name(char *cstring)
|
||||||
|
{
|
||||||
|
this->rate_name = cstring;
|
||||||
|
}
|
||||||
|
double get_formula_z() const
|
||||||
|
{
|
||||||
|
return this->formula_z;
|
||||||
|
}
|
||||||
|
void set_formula_z(double d)
|
||||||
|
{
|
||||||
|
this->formula_z = d;
|
||||||
|
}
|
||||||
void set_totals(struct elt_list *e_l, int count)
|
void set_totals(struct elt_list *e_l, int count)
|
||||||
{this->totals = cxxNameDouble(e_l, count);}
|
{
|
||||||
|
this->totals = cxxNameDouble(e_l, count);
|
||||||
|
}
|
||||||
void set_totals(struct elt_list *e_l)
|
void set_totals(struct elt_list *e_l)
|
||||||
{this->totals = cxxNameDouble(e_l);}
|
{
|
||||||
|
this->totals = cxxNameDouble(e_l);
|
||||||
|
}
|
||||||
void set_totals(cxxNameDouble nd)
|
void set_totals(cxxNameDouble nd)
|
||||||
{this->totals = nd;}
|
{
|
||||||
|
this->totals = nd;
|
||||||
|
}
|
||||||
void set_formula_totals(struct elt_list *e_l, int count)
|
void set_formula_totals(struct elt_list *e_l, int count)
|
||||||
{this->formula_totals = cxxNameDouble(e_l, count);}
|
{
|
||||||
|
this->formula_totals = cxxNameDouble(e_l, count);
|
||||||
|
}
|
||||||
void set_formula_totals(struct elt_list *e_l)
|
void set_formula_totals(struct elt_list *e_l)
|
||||||
{this->formula_totals = cxxNameDouble(e_l);}
|
{
|
||||||
|
this->formula_totals = cxxNameDouble(e_l);
|
||||||
|
}
|
||||||
void set_formula_totals(cxxNameDouble nd)
|
void set_formula_totals(cxxNameDouble nd)
|
||||||
{this->formula_totals = nd;}
|
{
|
||||||
|
this->formula_totals = nd;
|
||||||
|
}
|
||||||
|
|
||||||
const cxxNameDouble &get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return (this->totals);
|
return (this->totals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void add(const cxxExchComp &comp, double extensive);
|
void add(const cxxExchComp & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
protected:
|
protected:
|
||||||
char * formula;
|
char *formula;
|
||||||
double moles;
|
double moles;
|
||||||
cxxNameDouble formula_totals;
|
cxxNameDouble formula_totals;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
@ -85,7 +146,7 @@ protected:
|
|||||||
char *rate_name;
|
char *rate_name;
|
||||||
double formula_z; // charge on formula
|
double formula_z; // charge on formula
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
38
Exchange.h
38
Exchange.h
@ -11,59 +11,63 @@
|
|||||||
#include "ExchComp.h"
|
#include "ExchComp.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxExchange : public cxxNumKeyword
|
class cxxExchange:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxExchange();
|
cxxExchange();
|
||||||
cxxExchange(int n_user);
|
cxxExchange(int n_user);
|
||||||
cxxExchange(struct exchange *);
|
cxxExchange(struct exchange *);
|
||||||
cxxExchange(const std::map<int, cxxExchange> &exchange_map, cxxMix &mx, int n_user);
|
cxxExchange(const std::map < int, cxxExchange > &exchange_map,
|
||||||
|
cxxMix & mx, int n_user);
|
||||||
~cxxExchange();
|
~cxxExchange();
|
||||||
|
|
||||||
struct exchange *cxxExchange2exchange();
|
struct exchange *cxxExchange2exchange();
|
||||||
|
|
||||||
struct exch_comp *cxxExchComp2exch_comp();
|
struct exch_comp *cxxExchComp2exch_comp();
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
bool get_related_phases(void);
|
bool get_related_phases(void);
|
||||||
|
|
||||||
bool get_related_rate(void);
|
bool get_related_rate(void);
|
||||||
|
|
||||||
bool get_pitzer_exchange_gammas() {
|
bool get_pitzer_exchange_gammas()
|
||||||
|
{
|
||||||
return this->pitzer_exchange_gammas;
|
return this->pitzer_exchange_gammas;
|
||||||
}
|
}
|
||||||
void set_pitzer_exchange_gammas(bool b) {
|
void set_pitzer_exchange_gammas(bool b)
|
||||||
|
{
|
||||||
this->pitzer_exchange_gammas = b;
|
this->pitzer_exchange_gammas = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<cxxExchComp> &get_exchComps(void) {
|
std::list < cxxExchComp > &get_exchComps(void)
|
||||||
return(this->exchComps);
|
{
|
||||||
|
return (this->exchComps);
|
||||||
}
|
}
|
||||||
void totalize();
|
void totalize();
|
||||||
|
|
||||||
const cxxNameDouble& get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return totals;
|
return totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
void add(const cxxExchange &addee, double extensive);
|
void add(const cxxExchange & addee, double extensive);
|
||||||
// not written
|
// not written
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<cxxExchComp> exchComps;
|
std::list < cxxExchComp > exchComps;
|
||||||
bool pitzer_exchange_gammas;
|
bool pitzer_exchange_gammas;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
26
GasPhase.h
26
GasPhase.h
@ -14,16 +14,18 @@
|
|||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxGasPhase : public cxxNumKeyword
|
class cxxGasPhase:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxGasPhase();
|
cxxGasPhase();
|
||||||
cxxGasPhase(struct gas_phase *);
|
cxxGasPhase(struct gas_phase *);
|
||||||
cxxGasPhase(const std::map<int, cxxGasPhase> &entity_map, cxxMix &mx, int n_user);
|
cxxGasPhase(const std::map < int, cxxGasPhase > &entity_map,
|
||||||
|
cxxMix & mx, int n_user);
|
||||||
~cxxGasPhase();
|
~cxxGasPhase();
|
||||||
|
|
||||||
enum GP_TYPE {
|
enum GP_TYPE
|
||||||
|
{
|
||||||
GP_PRESSURE = 0,
|
GP_PRESSURE = 0,
|
||||||
GP_VOLUME = 1
|
GP_VOLUME = 1
|
||||||
};
|
};
|
||||||
@ -34,33 +36,33 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void totalize();
|
void totalize();
|
||||||
|
|
||||||
const cxxNameDouble& get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return this->totals;
|
return this->totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void add(const cxxGasPhase &addee, double extensive);
|
void add(const cxxGasPhase & addee, double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cxxNameDouble gasPhaseComps;
|
cxxNameDouble gasPhaseComps;
|
||||||
GP_TYPE type;
|
GP_TYPE type;
|
||||||
double total_p;
|
double total_p;
|
||||||
double volume;
|
double volume;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxGasPhase>& map;
|
//static std::map<int, cxxGasPhase>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
51
ISolution.h
51
ISolution.h
@ -15,10 +15,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
class cxxISolution : public cxxSolution
|
class cxxISolution:public cxxSolution
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxISolution();
|
cxxISolution();
|
||||||
cxxISolution(struct solution *);
|
cxxISolution(struct solution *);
|
||||||
//cxxISolution(const cxxISolution&);
|
//cxxISolution(const cxxISolution&);
|
||||||
@ -30,11 +30,23 @@ public:
|
|||||||
|
|
||||||
struct solution *cxxISolution2solution();
|
struct solution *cxxISolution2solution();
|
||||||
|
|
||||||
double get_density()const {return this->density;}
|
double get_density() const
|
||||||
void set_density(double density) {this->density = density;}
|
{
|
||||||
|
return this->density;
|
||||||
|
}
|
||||||
|
void set_density(double density)
|
||||||
|
{
|
||||||
|
this->density = density;
|
||||||
|
}
|
||||||
|
|
||||||
std::string get_units()const {return units;}
|
std::string get_units() const
|
||||||
void set_units(std::string units) {units = units;}
|
{
|
||||||
|
return units;
|
||||||
|
}
|
||||||
|
void set_units(std::string units)
|
||||||
|
{
|
||||||
|
units = units;
|
||||||
|
}
|
||||||
|
|
||||||
//char * get_redox()const {return this->pe[this->default_pe].get_name();}
|
//char * get_redox()const {return this->pe[this->default_pe].get_name();}
|
||||||
|
|
||||||
@ -43,27 +55,28 @@ public:
|
|||||||
void ConvertUnits();
|
void ConvertUnits();
|
||||||
|
|
||||||
#ifdef ORCHESTRA
|
#ifdef ORCHESTRA
|
||||||
void ORCH_write(std::ostream &chemistry_dat, std::ostream &input_dat, std::ostream &output_dat);
|
void ORCH_write(std::ostream & chemistry_dat, std::ostream & input_dat,
|
||||||
void ORCH_write_chemistry(std::ostream &chemistry_dat);
|
std::ostream & output_dat);
|
||||||
void ORCH_write_input(std::ostream &input_dat);
|
void ORCH_write_chemistry(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_output_vars(std::ostream &input_dat);
|
void ORCH_write_input(std::ostream & input_dat);
|
||||||
private:
|
void ORCH_write_output_vars(std::ostream & input_dat);
|
||||||
void ORCH_write_chemistry_water(std::ostream &chemistry_dat);
|
private:
|
||||||
void ORCH_write_chemistry_primary(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_water(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_chemistry_total_O_H(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_primary(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_chemistry_alkalinity(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_total_O_H(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_chemistry_minerals(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_alkalinity(std::ostream & chemistry_dat);
|
||||||
|
void ORCH_write_chemistry_minerals(std::ostream & chemistry_dat);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class cxxISolutionComp; // for this->pe access
|
friend class cxxISolutionComp; // for this->pe access
|
||||||
double density;
|
double density;
|
||||||
std::string units;
|
std::string units;
|
||||||
std::map<char *, cxxISolutionComp, CHARSTAR_LESS> comps;
|
std::map < char *, cxxISolutionComp, CHARSTAR_LESS > comps;
|
||||||
struct pe_data *pes;
|
struct pe_data *pes;
|
||||||
int default_pe;
|
int default_pe;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxISolution>& map;
|
//static std::map<int, cxxISolution>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
115
ISolutionComp.h
115
ISolutionComp.h
@ -19,59 +19,118 @@ class cxxISolution; // reqd for read and dump_xml
|
|||||||
|
|
||||||
class cxxISolutionComp
|
class cxxISolutionComp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cxxISolutionComp(void);
|
cxxISolutionComp(void);
|
||||||
cxxISolutionComp(struct conc *conc_ptr);
|
cxxISolutionComp(struct conc *conc_ptr);
|
||||||
~cxxISolutionComp(void);
|
~cxxISolutionComp(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//STATUS_TYPE read(CParser& parser, CSolution& sol);
|
//STATUS_TYPE read(CParser& parser, CSolution& sol);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
char * get_description()const {return this->description;}
|
char *get_description() const
|
||||||
void set_description(char * description) {this->description = description;}
|
{
|
||||||
|
return this->description;
|
||||||
|
}
|
||||||
|
void set_description(char *description)
|
||||||
|
{
|
||||||
|
this->description = description;
|
||||||
|
}
|
||||||
|
|
||||||
double get_moles()const {return this->moles;}
|
double get_moles() const
|
||||||
void set_moles(double moles) {this->moles = moles;}
|
{
|
||||||
|
return this->moles;
|
||||||
|
}
|
||||||
|
void set_moles(double moles)
|
||||||
|
{
|
||||||
|
this->moles = moles;
|
||||||
|
}
|
||||||
|
|
||||||
double get_input_conc()const {return this->input_conc;}
|
double get_input_conc() const
|
||||||
void set_input_conc(double input_conc) {this->input_conc = input_conc;}
|
{
|
||||||
|
return this->input_conc;
|
||||||
|
}
|
||||||
|
void set_input_conc(double input_conc)
|
||||||
|
{
|
||||||
|
this->input_conc = input_conc;
|
||||||
|
}
|
||||||
|
|
||||||
std::string get_units()const {return this->units;}
|
std::string get_units()const
|
||||||
void set_units(char * units) {this->units = units;}
|
{
|
||||||
|
return this->units;
|
||||||
|
}
|
||||||
|
void set_units(char *units)
|
||||||
|
{
|
||||||
|
this->units = units;
|
||||||
|
}
|
||||||
|
|
||||||
char * get_equation_name()const {return this->equation_name;}
|
char *get_equation_name() const
|
||||||
void set_equation_name(char * equation_name) {this->equation_name = equation_name;}
|
{
|
||||||
|
return this->equation_name;
|
||||||
|
}
|
||||||
|
void set_equation_name(char *equation_name)
|
||||||
|
{
|
||||||
|
this->equation_name = equation_name;
|
||||||
|
}
|
||||||
|
|
||||||
double get_phase_si()const {return this->phase_si;}
|
double get_phase_si() const
|
||||||
void set_phase_si(int phase_si) {this->phase_si = phase_si;}
|
{
|
||||||
|
return this->phase_si;
|
||||||
|
}
|
||||||
|
void set_phase_si(int phase_si)
|
||||||
|
{
|
||||||
|
this->phase_si = phase_si;
|
||||||
|
}
|
||||||
|
|
||||||
int get_n_pe()const {return this->n_pe;}
|
int get_n_pe() const
|
||||||
void set_n_pe(int n_pe) {this->n_pe = n_pe;}
|
{
|
||||||
|
return this->n_pe;
|
||||||
|
}
|
||||||
|
void set_n_pe(int n_pe)
|
||||||
|
{
|
||||||
|
this->n_pe = n_pe;
|
||||||
|
}
|
||||||
|
|
||||||
char *get_as()const {return this->as;}
|
char *get_as() const
|
||||||
void set_as(char *as) {this->as = as;}
|
{
|
||||||
|
return this->as;
|
||||||
|
}
|
||||||
|
void set_as(char *as)
|
||||||
|
{
|
||||||
|
this->as = as;
|
||||||
|
}
|
||||||
|
|
||||||
//double get_gfw()const {return this->gfw;}
|
//double get_gfw()const {return this->gfw;}
|
||||||
double get_gfw()const {return this->gfw;};
|
double get_gfw() const
|
||||||
void set_gfw(double gfw) {this->gfw = gfw;}
|
{
|
||||||
|
return this->gfw;
|
||||||
|
};
|
||||||
|
void set_gfw(double gfw)
|
||||||
|
{
|
||||||
|
this->gfw = gfw;
|
||||||
|
}
|
||||||
void set_gfw();
|
void set_gfw();
|
||||||
|
|
||||||
bool operator<(const cxxISolutionComp& conc)const { return ::strcmp(this->description, conc.description) < 0; }
|
bool operator<(const cxxISolutionComp & conc) const
|
||||||
|
{
|
||||||
|
return::strcmp(this->description, conc.description) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct conc * cxxISolutionComp2conc(const std::map <char *, cxxISolutionComp, CHARSTAR_LESS> &t );
|
static struct conc *cxxISolutionComp2conc(const std::map < char *,
|
||||||
|
cxxISolutionComp,
|
||||||
|
CHARSTAR_LESS > &t);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char * description;
|
char *description;
|
||||||
double moles;
|
double moles;
|
||||||
double input_conc;
|
double input_conc;
|
||||||
char * units;
|
char *units;
|
||||||
char * equation_name;
|
char *equation_name;
|
||||||
double phase_si;
|
double phase_si;
|
||||||
int n_pe;
|
int n_pe;
|
||||||
char * as;
|
char *as;
|
||||||
double gfw;
|
double gfw;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -15,38 +15,43 @@
|
|||||||
class cxxKineticsComp
|
class cxxKineticsComp
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxKineticsComp();
|
cxxKineticsComp();
|
||||||
cxxKineticsComp(struct kinetics_comp *);
|
cxxKineticsComp(struct kinetics_comp *);
|
||||||
~cxxKineticsComp();
|
~cxxKineticsComp();
|
||||||
|
|
||||||
static struct kinetics_comp *cxxKineticsComp2kinetics_comp(std::list<cxxKineticsComp>& el);
|
static struct kinetics_comp *cxxKineticsComp2kinetics_comp(std::list <
|
||||||
|
cxxKineticsComp
|
||||||
|
> &el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
char *get_rate_name()const {return this->rate_name;}
|
char *get_rate_name() const
|
||||||
|
{
|
||||||
|
return this->rate_name;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
#endif
|
#endif
|
||||||
void add(const cxxKineticsComp &comp, double extensive);
|
void add(const cxxKineticsComp & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char * rate_name;
|
char *rate_name;
|
||||||
cxxNameDouble namecoef; //stoichiometry of reaction
|
cxxNameDouble namecoef; //stoichiometry of reaction
|
||||||
double tol;
|
double tol;
|
||||||
double m;
|
double m;
|
||||||
double m0;
|
double m0;
|
||||||
double moles;
|
double moles;
|
||||||
std::vector<double> d_params;
|
std::vector < double >d_params;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
70
NameDouble.h
70
NameDouble.h
@ -11,11 +11,14 @@
|
|||||||
//#include "global.h"
|
//#include "global.h"
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
class cxxNameDouble : public std::map <char *, double, CHARSTAR_LESS>
|
class cxxNameDouble:public
|
||||||
|
std::map < char *, double,
|
||||||
|
CHARSTAR_LESS >
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ND_TYPE {
|
enum ND_TYPE
|
||||||
|
{
|
||||||
ND_ELT_MOLES = 1,
|
ND_ELT_MOLES = 1,
|
||||||
ND_SPECIES_LA = 2,
|
ND_SPECIES_LA = 2,
|
||||||
ND_SPECIES_GAMMA = 3,
|
ND_SPECIES_GAMMA = 3,
|
||||||
@ -28,46 +31,65 @@ public:
|
|||||||
cxxNameDouble(struct conc *);
|
cxxNameDouble(struct conc *);
|
||||||
cxxNameDouble(struct master_activity *ma, int count, ND_TYPE);
|
cxxNameDouble(struct master_activity *ma, int count, ND_TYPE);
|
||||||
cxxNameDouble(struct name_coef *nc, int count);
|
cxxNameDouble(struct name_coef *nc, int count);
|
||||||
cxxNameDouble(const cxxNameDouble &old, double factor);
|
cxxNameDouble(const cxxNameDouble & old, double factor);
|
||||||
~cxxNameDouble();
|
~
|
||||||
|
cxxNameDouble();
|
||||||
|
|
||||||
struct elt_list *elt_list();
|
struct elt_list *
|
||||||
|
elt_list();
|
||||||
|
|
||||||
struct master_activity *master_activity()const;
|
struct master_activity *
|
||||||
|
master_activity() const;
|
||||||
|
|
||||||
struct conc *conc()const;
|
struct conc *
|
||||||
|
conc() const;
|
||||||
|
|
||||||
struct name_coef *name_coef()const;
|
struct name_coef *
|
||||||
|
name_coef() const;
|
||||||
|
|
||||||
void dump_xml(std::ostream& s_oss, unsigned int indent)const;
|
void
|
||||||
|
dump_xml(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void
|
||||||
|
dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
CParser::STATUS_TYPE read_raw(CParser& parser, std::istream::pos_type& pos);
|
CParser::STATUS_TYPE
|
||||||
|
read_raw(CParser & parser, std::istream::pos_type & pos);
|
||||||
|
|
||||||
void add_extensive(const cxxNameDouble &old, double factor);
|
void
|
||||||
void add_intensive(const cxxNameDouble &addee, double fthis, double f2);
|
add_extensive(const cxxNameDouble & old, double factor);
|
||||||
void add_log_activities(const cxxNameDouble &addee, double fthis, double f2);
|
void
|
||||||
void add(const char * key, double total);
|
add_intensive(const cxxNameDouble & addee, double fthis, double f2);
|
||||||
void multiply(double factor);
|
void
|
||||||
|
add_log_activities(const cxxNameDouble & addee, double fthis, double f2);
|
||||||
|
void
|
||||||
|
add(const char *key, double total);
|
||||||
|
void
|
||||||
|
multiply(double factor);
|
||||||
|
|
||||||
void insert(char *str, double d) {
|
void
|
||||||
|
insert(char *str, double d)
|
||||||
|
{
|
||||||
(*this)[str] = d;
|
(*this)[str] = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void
|
||||||
void mpi_pack(int *ints, int *ii, double *doubles, int *dd);
|
mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
|
void
|
||||||
|
mpi_pack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
|
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void
|
||||||
|
mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
|
|
||||||
enum ND_TYPE type;
|
enum ND_TYPE
|
||||||
|
type;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//std::map <char *, double, CHARSTAR_LESS> totals;
|
//std::map <char *, double, CHARSTAR_LESS> totals;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxNameDouble>& map;
|
//static std::map<int, cxxNameDouble>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
55
NumKeyword.h
55
NumKeyword.h
@ -11,33 +11,58 @@ extern char *string_duplicate(const char *);
|
|||||||
|
|
||||||
class cxxNumKeyword
|
class cxxNumKeyword
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cxxNumKeyword();
|
cxxNumKeyword();
|
||||||
virtual ~cxxNumKeyword();
|
virtual ~ cxxNumKeyword();
|
||||||
|
|
||||||
|
|
||||||
char * get_description()const { return string_duplicate(this->description.c_str()); }
|
char *get_description() const
|
||||||
void set_description(std::string str) { this->description = str; }
|
{
|
||||||
void set_description(char * str) { if (str != NULL) this->description = str; }
|
return string_duplicate(this->description.c_str());
|
||||||
|
}
|
||||||
|
void set_description(std::string str)
|
||||||
|
{
|
||||||
|
this->description = str;
|
||||||
|
}
|
||||||
|
void set_description(char *str)
|
||||||
|
{
|
||||||
|
if (str != NULL)
|
||||||
|
this->description = str;
|
||||||
|
}
|
||||||
|
|
||||||
int get_n_user()const { return this->n_user; }
|
int get_n_user() const
|
||||||
void set_n_user(int user) { this->n_user = user; }
|
{
|
||||||
|
return this->n_user;
|
||||||
|
}
|
||||||
|
void set_n_user(int user)
|
||||||
|
{
|
||||||
|
this->n_user = user;
|
||||||
|
}
|
||||||
|
|
||||||
int get_n_user_end()const { return this->n_user_end; }
|
int get_n_user_end() const
|
||||||
void set_n_user_end(int user_end) { this->n_user_end = user_end; }
|
{
|
||||||
|
return this->n_user_end;
|
||||||
|
}
|
||||||
|
void set_n_user_end(int user_end)
|
||||||
|
{
|
||||||
|
this->n_user_end = user_end;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator<(const cxxNumKeyword& key)const { return (this->n_user < key.n_user); }
|
bool operator<(const cxxNumKeyword & key) const
|
||||||
|
{
|
||||||
|
return (this->n_user < key.n_user);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
virtual void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void read_number_description(CParser& parser);
|
void read_number_description(CParser & parser);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int n_user;
|
int n_user;
|
||||||
int n_user_end;
|
int n_user_end;
|
||||||
std::string description;
|
std::string description;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void read_number_description(std::istream& is);
|
void read_number_description(std::istream & is);
|
||||||
};
|
};
|
||||||
#endif // !defined(NUMKEYWORD_H_INCLUDED)
|
#endif // !defined(NUMKEYWORD_H_INCLUDED)
|
||||||
|
|||||||
@ -14,52 +14,56 @@
|
|||||||
#include "PPassemblageComp.h"
|
#include "PPassemblageComp.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxPPassemblage : public cxxNumKeyword
|
class cxxPPassemblage:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxPPassemblage();
|
cxxPPassemblage();
|
||||||
cxxPPassemblage(struct pp_assemblage *);
|
cxxPPassemblage(struct pp_assemblage *);
|
||||||
cxxPPassemblage(const std::map<int, cxxPPassemblage> &entity_map, cxxMix &mx, int n_user);
|
cxxPPassemblage(const std::map < int, cxxPPassemblage > &entity_map,
|
||||||
|
cxxMix & mx, int n_user);
|
||||||
~cxxPPassemblage();
|
~cxxPPassemblage();
|
||||||
|
|
||||||
struct pp_assemblage *cxxPPassemblage2pp_assemblage();
|
struct pp_assemblage *cxxPPassemblage2pp_assemblage();
|
||||||
|
|
||||||
struct pure_phase *cxxPPassemblageComp2pure_phase();
|
struct pure_phase *cxxPPassemblageComp2pure_phase();
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
const cxxNameDouble& get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return this->totals;
|
return this->totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void totalize();
|
void totalize();
|
||||||
#ifdef ORCHESTRA
|
#ifdef ORCHESTRA
|
||||||
void ORCH_write_chemistry(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_output_vars(std::ostream &outstream);
|
void ORCH_write_output_vars(std::ostream & outstream);
|
||||||
void ORCH_read(std::vector <std::pair <std::string, double> > output_vector, std::vector < std::pair < std::string, double > >::iterator &it);
|
void ORCH_read(std::vector < std::pair < std::string,
|
||||||
void ORCH_store_global(std::map < std::string, double > output_map);
|
double >>output_vector,
|
||||||
|
std::vector < std::pair < std::string,
|
||||||
|
double >>::iterator & it);
|
||||||
|
void ORCH_store_global(std::map < std::string, double >output_map);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void add(const cxxPPassemblage &addee, double extensive);
|
void add(const cxxPPassemblage & addee, double extensive);
|
||||||
// not written
|
// not written
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<cxxPPassemblageComp> ppAssemblageComps;
|
std::list < cxxPPassemblageComp > ppAssemblageComps;
|
||||||
cxxNameDouble eltList;
|
cxxNameDouble eltList;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxPPassemblage>& map;
|
//static std::map<int, cxxPPassemblage>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,38 +15,43 @@
|
|||||||
class cxxPPassemblageComp
|
class cxxPPassemblageComp
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxPPassemblageComp();
|
cxxPPassemblageComp();
|
||||||
cxxPPassemblageComp(struct pure_phase *);
|
cxxPPassemblageComp(struct pure_phase *);
|
||||||
~cxxPPassemblageComp();
|
~cxxPPassemblageComp();
|
||||||
|
|
||||||
|
|
||||||
static struct pure_phase *cxxPPassemblageComp2pure_phase(std::list<cxxPPassemblageComp>& el);
|
static struct pure_phase *cxxPPassemblageComp2pure_phase(std::list <
|
||||||
|
cxxPPassemblageComp
|
||||||
|
> &el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
char *get_name()const {return this->name;}
|
char *get_name() const
|
||||||
|
{
|
||||||
|
return this->name;
|
||||||
|
}
|
||||||
|
|
||||||
struct phase *get_phase();
|
struct phase *get_phase();
|
||||||
|
|
||||||
void totalize();
|
void totalize();
|
||||||
const cxxNameDouble &get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return (this->totals);
|
return (this->totals);
|
||||||
};
|
};
|
||||||
|
|
||||||
void add(const cxxPPassemblageComp &comp, double extensive);
|
void add(const cxxPPassemblageComp & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
protected:
|
protected:
|
||||||
char *name;
|
char *name;
|
||||||
char *add_formula;
|
char *add_formula;
|
||||||
double si;
|
double si;
|
||||||
@ -57,7 +62,7 @@ protected:
|
|||||||
bool dissolve_only;
|
bool dissolve_only;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
148
Parser.h
148
Parser.h
@ -12,14 +12,16 @@ extern int input_error;
|
|||||||
|
|
||||||
class CParser
|
class CParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CParser(std::istream& input);
|
CParser(std::istream & input);
|
||||||
CParser(std::istream& input, std::ostream& output);
|
CParser(std::istream & input, std::ostream & output);
|
||||||
CParser(std::istream& input, std::ostream& output, std::ostream& error);
|
CParser(std::istream & input, std::ostream & output,
|
||||||
|
std::ostream & error);
|
||||||
|
|
||||||
virtual ~CParser();
|
virtual ~ CParser();
|
||||||
|
|
||||||
enum LINE_TYPE {
|
enum LINE_TYPE
|
||||||
|
{
|
||||||
LT_EOF = -1,
|
LT_EOF = -1,
|
||||||
LT_OK = 1,
|
LT_OK = 1,
|
||||||
LT_EMPTY = 2,
|
LT_EMPTY = 2,
|
||||||
@ -27,7 +29,8 @@ public:
|
|||||||
LT_OPTION = 8
|
LT_OPTION = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TOKEN_TYPE {
|
enum TOKEN_TYPE
|
||||||
|
{
|
||||||
TT_EMPTY = 2,
|
TT_EMPTY = 2,
|
||||||
TT_UPPER = 4,
|
TT_UPPER = 4,
|
||||||
TT_LOWER = 5,
|
TT_LOWER = 5,
|
||||||
@ -35,12 +38,14 @@ public:
|
|||||||
TT_UNKNOWN = 7
|
TT_UNKNOWN = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FIND_TYPE {
|
enum FIND_TYPE
|
||||||
|
{
|
||||||
FT_OK = 0,
|
FT_OK = 0,
|
||||||
FT_ERROR = 1
|
FT_ERROR = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum KEY_TYPE {
|
enum KEY_TYPE
|
||||||
|
{
|
||||||
KT_NONE = -1,
|
KT_NONE = -1,
|
||||||
KT_END = 0,
|
KT_END = 0,
|
||||||
KT_EOF = 1,
|
KT_EOF = 1,
|
||||||
@ -51,29 +56,32 @@ public:
|
|||||||
KT_PPASSEMBLAGE_RAW = 9,
|
KT_PPASSEMBLAGE_RAW = 9,
|
||||||
KT_SSASSEMBLAGE_RAW = 10,
|
KT_SSASSEMBLAGE_RAW = 10,
|
||||||
KT_SURFACE_RAW = 11
|
KT_SURFACE_RAW = 11
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OPT_TYPE {
|
enum OPT_TYPE
|
||||||
|
{
|
||||||
OPT_DEFAULT = -4,
|
OPT_DEFAULT = -4,
|
||||||
OPT_ERROR = -3,
|
OPT_ERROR = -3,
|
||||||
OPT_KEYWORD = -2,
|
OPT_KEYWORD = -2,
|
||||||
OPT_EOF = -1
|
OPT_EOF = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ONERROR_TYPE {
|
enum ONERROR_TYPE
|
||||||
|
{
|
||||||
OT_CONTINUE = 0,
|
OT_CONTINUE = 0,
|
||||||
OT_STOP = 1
|
OT_STOP = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ECHO_OPTION {
|
enum ECHO_OPTION
|
||||||
|
{
|
||||||
EO_NONE = 0,
|
EO_NONE = 0,
|
||||||
EO_ALL = 1,
|
EO_ALL = 1,
|
||||||
EO_KEYWORDS = 2,
|
EO_KEYWORDS = 2,
|
||||||
EO_NOKEYWORDS = 3
|
EO_NOKEYWORDS = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum STATUS_TYPE {
|
enum STATUS_TYPE
|
||||||
|
{
|
||||||
PARSER_ERROR = 0,
|
PARSER_ERROR = 0,
|
||||||
PARSER_OK = 1
|
PARSER_OK = 1
|
||||||
};
|
};
|
||||||
@ -98,7 +106,8 @@ public:
|
|||||||
|
|
||||||
Terminates if EOF and allow_eof == false.
|
Terminates if EOF and allow_eof == false.
|
||||||
*/
|
*/
|
||||||
LINE_TYPE check_line(const std::string& str, bool allow_empty, bool allow_eof, bool allow_keyword, bool print);
|
LINE_TYPE check_line(const std::string & str, bool allow_empty,
|
||||||
|
bool allow_eof, bool allow_keyword, bool print);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read a line from input file put in "line".
|
Read a line from input file put in "line".
|
||||||
@ -119,22 +128,46 @@ public:
|
|||||||
// bool check_key(const std::string::iterator ptr);
|
// bool check_key(const std::string::iterator ptr);
|
||||||
bool check_key(std::string::iterator begin, std::string::iterator end);
|
bool check_key(std::string::iterator begin, std::string::iterator end);
|
||||||
|
|
||||||
STATUS_TYPE check_units(std::string& tot_units, bool alkalinity, bool check_compatibility,
|
STATUS_TYPE check_units(std::string & tot_units, bool alkalinity,
|
||||||
const std::string& default_units, bool print);
|
bool check_compatibility,
|
||||||
|
const std::string & default_units, bool print);
|
||||||
|
|
||||||
|
|
||||||
KEY_TYPE next_keyword()const { return m_next_keyword; }
|
KEY_TYPE next_keyword() const
|
||||||
int get_option(const std::vector<std::string>& opt_list, std::string::iterator& next_char);
|
{
|
||||||
int get_option(const std::vector<std::string>& opt_list, std::istream::pos_type& next_pos);
|
return m_next_keyword;
|
||||||
int getOptionFromLastLine(const std::vector<std::string>& opt_list, std::string::iterator& next_char);
|
}
|
||||||
int getOptionFromLastLine(const std::vector<std::string>& opt_list, std::istream::pos_type& next_pos);
|
int get_option(const std::vector < std::string > &opt_list,
|
||||||
|
std::string::iterator & next_char);
|
||||||
|
int get_option(const std::vector < std::string > &opt_list,
|
||||||
|
std::istream::pos_type & next_pos);
|
||||||
|
int getOptionFromLastLine(const std::vector < std::string > &opt_list,
|
||||||
|
std::string::iterator & next_char);
|
||||||
|
int getOptionFromLastLine(const std::vector < std::string > &opt_list,
|
||||||
|
std::istream::pos_type & next_pos);
|
||||||
|
|
||||||
|
|
||||||
std::string& line() {return m_line;}
|
std::string & line()
|
||||||
std::istringstream& get_iss() {return m_line_iss;}
|
{
|
||||||
int incr_input_error() {++::input_error; return ++m_input_error;}
|
return m_line;
|
||||||
std::ostream& get_output() {return m_output_stream;}
|
}
|
||||||
int get_input_error() {return m_input_error;}
|
std::istringstream & get_iss()
|
||||||
|
{
|
||||||
|
return m_line_iss;
|
||||||
|
}
|
||||||
|
int incr_input_error()
|
||||||
|
{
|
||||||
|
++::input_error;
|
||||||
|
return ++m_input_error;
|
||||||
|
}
|
||||||
|
std::ostream & get_output()
|
||||||
|
{
|
||||||
|
return m_output_stream;
|
||||||
|
}
|
||||||
|
int get_input_error()
|
||||||
|
{
|
||||||
|
return m_input_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -152,10 +185,12 @@ public:
|
|||||||
TT_DIGIT
|
TT_DIGIT
|
||||||
TT_UNKNOWN
|
TT_UNKNOWN
|
||||||
*/
|
*/
|
||||||
static TOKEN_TYPE copy_token(std::string& token, std::string::iterator& begin, std::string::iterator& end);
|
static TOKEN_TYPE copy_token(std::string & token,
|
||||||
static TOKEN_TYPE token_type(const std::string& token);
|
std::string::iterator & begin,
|
||||||
static TOKEN_TYPE copy_token(std::string& token, std::istream& is);
|
std::string::iterator & end);
|
||||||
TOKEN_TYPE copy_token(std::string& token, std::istream::pos_type& pos);
|
static TOKEN_TYPE token_type(const std::string & token);
|
||||||
|
static TOKEN_TYPE copy_token(std::string & token, std::istream & is);
|
||||||
|
TOKEN_TYPE copy_token(std::string & token, std::istream::pos_type & pos);
|
||||||
CParser::TOKEN_TYPE peek_token();
|
CParser::TOKEN_TYPE peek_token();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,7 +205,9 @@ public:
|
|||||||
end input, points to last position in the equation
|
end input, points to last position in the equation
|
||||||
element input pointer to place to return element character string
|
element input pointer to place to return element character string
|
||||||
*/
|
*/
|
||||||
STATUS_TYPE get_elt(std::string::iterator& begin, const std::string::iterator end, std::string& element);
|
STATUS_TYPE get_elt(std::string::iterator & begin,
|
||||||
|
const std::string::iterator end,
|
||||||
|
std::string & element);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -189,31 +226,50 @@ public:
|
|||||||
n -1 item not matched
|
n -1 item not matched
|
||||||
i position of match in list
|
i position of match in list
|
||||||
*/
|
*/
|
||||||
static FIND_TYPE find_option(const std::string& item, int *n, const std::vector<std::string>& list, bool exact);
|
static FIND_TYPE find_option(const std::string & item, int *n,
|
||||||
|
const std::vector < std::string > &list,
|
||||||
|
bool exact);
|
||||||
|
|
||||||
|
|
||||||
int error_msg(const std::ostringstream& err_str, ONERROR_TYPE stop) {return error_msg(err_str.str().c_str(), stop);}
|
int error_msg(const std::ostringstream & err_str, ONERROR_TYPE stop)
|
||||||
|
{
|
||||||
|
return error_msg(err_str.str().c_str(), stop);
|
||||||
|
}
|
||||||
int error_msg(const char *err_str, ONERROR_TYPE stop);
|
int error_msg(const char *err_str, ONERROR_TYPE stop);
|
||||||
int warning_msg(const char *err_str);
|
int warning_msg(const char *err_str);
|
||||||
|
|
||||||
void set_echo_file(ECHO_OPTION opt) {echo_file = opt;}
|
void set_echo_file(ECHO_OPTION opt)
|
||||||
ECHO_OPTION get_echo_file() {return this->echo_file;};
|
{
|
||||||
|
echo_file = opt;
|
||||||
|
}
|
||||||
|
ECHO_OPTION get_echo_file()
|
||||||
|
{
|
||||||
|
return this->echo_file;
|
||||||
|
};
|
||||||
|
|
||||||
void set_echo_stream(ECHO_OPTION opt) {echo_stream = opt;}
|
void set_echo_stream(ECHO_OPTION opt)
|
||||||
ECHO_OPTION get_echo_stream() {return this->echo_stream;};
|
{
|
||||||
|
echo_stream = opt;
|
||||||
|
}
|
||||||
|
ECHO_OPTION get_echo_stream()
|
||||||
|
{
|
||||||
|
return this->echo_stream;
|
||||||
|
};
|
||||||
|
|
||||||
STATUS_TYPE parse_couple(std::string& token);
|
STATUS_TYPE parse_couple(std::string & token);
|
||||||
|
|
||||||
STATUS_TYPE addPair(std::map<char *, double, CHARSTAR_LESS> &totals, std::istream::pos_type& pos);
|
STATUS_TYPE addPair(std::map < char *, double, CHARSTAR_LESS > &totals,
|
||||||
STATUS_TYPE addPair(std::map<char *, double> &totals, std::istream::pos_type& pos);
|
std::istream::pos_type & pos);
|
||||||
|
STATUS_TYPE addPair(std::map < char *, double >&totals,
|
||||||
|
std::istream::pos_type & pos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LINE_TYPE get_logical_line();
|
LINE_TYPE get_logical_line();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::istream& m_input_stream;
|
std::istream & m_input_stream;
|
||||||
std::ostream& m_output_stream;
|
std::ostream & m_output_stream;
|
||||||
std::ostream& m_error_stream;
|
std::ostream & m_error_stream;
|
||||||
int m_input_error;
|
int m_input_error;
|
||||||
KEY_TYPE m_next_keyword;
|
KEY_TYPE m_next_keyword;
|
||||||
std::string m_line;
|
std::string m_line;
|
||||||
|
|||||||
14
Reaction.h
14
Reaction.h
@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
|
|
||||||
class cxxReaction : public cxxNumKeyword
|
class cxxReaction:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxReaction();
|
cxxReaction();
|
||||||
cxxReaction(struct irrev *);
|
cxxReaction(struct irrev *);
|
||||||
~cxxReaction();
|
~cxxReaction();
|
||||||
@ -25,19 +25,19 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cxxNameDouble reactantList;
|
cxxNameDouble reactantList;
|
||||||
cxxNameDouble elementList;
|
cxxNameDouble elementList;
|
||||||
std::vector<double> steps;
|
std::vector < double >steps;
|
||||||
int countSteps;
|
int countSteps;
|
||||||
bool equalIncrements;
|
bool equalIncrements;
|
||||||
char *units;
|
char *units;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxReaction>& map;
|
//static std::map<int, cxxReaction>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
15
SAXPhreeqc.h
15
SAXPhreeqc.h
@ -2,15 +2,16 @@
|
|||||||
#define _INC_SAXPHREEQC_H
|
#define _INC_SAXPHREEQC_H
|
||||||
|
|
||||||
#if defined(__cplusplus) | defined(_CPP)
|
#if defined(__cplusplus) | defined(_CPP)
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SAX_StartSystem ();
|
void SAX_StartSystem();
|
||||||
int SAX_AddSolution (struct solution* solution_ptr);
|
int SAX_AddSolution(struct solution *solution_ptr);
|
||||||
void SAX_EndSystem ();
|
void SAX_EndSystem();
|
||||||
int SAX_GetXMLLength ();
|
int SAX_GetXMLLength();
|
||||||
const char* SAX_GetXMLStr ();
|
const char *SAX_GetXMLStr();
|
||||||
int SAX_UnpackSolutions(void* pvBuffer, int buf_size);
|
int SAX_UnpackSolutions(void *pvBuffer, int buf_size);
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus) | defined(_CPP)
|
#if defined(__cplusplus) | defined(_CPP)
|
||||||
|
|||||||
@ -14,13 +14,14 @@
|
|||||||
#include "SSassemblageSS.h"
|
#include "SSassemblageSS.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxSSassemblage : public cxxNumKeyword
|
class cxxSSassemblage:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxSSassemblage();
|
cxxSSassemblage();
|
||||||
cxxSSassemblage(struct s_s_assemblage *);
|
cxxSSassemblage(struct s_s_assemblage *);
|
||||||
cxxSSassemblage(const std::map<int, cxxSSassemblage> &entity_map, cxxMix &mx, int n_user);
|
cxxSSassemblage(const std::map < int, cxxSSassemblage > &entity_map,
|
||||||
|
cxxMix & mx, int n_user);
|
||||||
~cxxSSassemblage();
|
~cxxSSassemblage();
|
||||||
|
|
||||||
struct s_s_assemblage *cxxSSassemblage2s_s_assemblage();
|
struct s_s_assemblage *cxxSSassemblage2s_s_assemblage();
|
||||||
@ -29,30 +30,30 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
void totalize();
|
void totalize();
|
||||||
|
|
||||||
const cxxNameDouble& get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return this->totals;
|
return this->totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void add(const cxxSSassemblage &addee, double extensive);
|
void add(const cxxSSassemblage & addee, double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<cxxSSassemblageSS> ssAssemblageSSs;
|
std::list < cxxSSassemblageSS > ssAssemblageSSs;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxSSassemblage>& map;
|
//static std::map<int, cxxSSassemblage>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,12 +15,13 @@
|
|||||||
class cxxSSassemblageSS
|
class cxxSSassemblageSS
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxSSassemblageSS();
|
cxxSSassemblageSS();
|
||||||
cxxSSassemblageSS(struct s_s *);
|
cxxSSassemblageSS(struct s_s *);
|
||||||
~cxxSSassemblageSS();
|
~cxxSSassemblageSS();
|
||||||
|
|
||||||
enum SS_PARAMETER_TYPE {
|
enum SS_PARAMETER_TYPE
|
||||||
|
{
|
||||||
SS_PARM_NONE = -1,
|
SS_PARM_NONE = -1,
|
||||||
SS_PARM_A0_A1 = 0,
|
SS_PARM_A0_A1 = 0,
|
||||||
SS_PARM_GAMMAS = 1,
|
SS_PARM_GAMMAS = 1,
|
||||||
@ -34,31 +35,35 @@ public:
|
|||||||
SS_PARM_MARGULES = 9
|
SS_PARM_MARGULES = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct s_s *cxxSSassemblageSS2s_s(std::list<cxxSSassemblageSS>& el);
|
static struct s_s *cxxSSassemblageSS2s_s(std::list < cxxSSassemblageSS >
|
||||||
|
&el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
char *get_name()const {return this->name;}
|
char *get_name() const
|
||||||
|
{
|
||||||
|
return this->name;
|
||||||
|
}
|
||||||
|
|
||||||
void totalize();
|
void totalize();
|
||||||
const cxxNameDouble &get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return (this->totals);
|
return (this->totals);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void add(const cxxSSassemblageSS &comp, double extensive);
|
void add(const cxxSSassemblageSS & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char *name;
|
char *name;
|
||||||
cxxNameDouble comps;
|
cxxNameDouble comps;
|
||||||
double a0, a1;
|
double a0, a1;
|
||||||
@ -67,7 +72,7 @@ protected:
|
|||||||
double xb1, xb2;
|
double xb1, xb2;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -25,10 +25,17 @@
|
|||||||
#define LDBLE double
|
#define LDBLE double
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct XMLCH_LESS : std::binary_function<const XMLCh*, const XMLCh*, bool> {
|
struct XMLCH_LESS:
|
||||||
bool operator()(const XMLCh* _X, const XMLCh* _Y) const
|
std::binary_function < const XMLCh *, const XMLCh *,
|
||||||
|
bool >
|
||||||
{
|
{
|
||||||
return xns::XMLString::compareString( _X, _Y) < 0;}
|
bool
|
||||||
|
operator() (const XMLCh * _X, const XMLCh * _Y) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
xns::XMLString::compareString(_X, _Y) <
|
||||||
|
0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@ -41,36 +48,60 @@ bool operator()(const XMLCh* _X, const XMLCh* _Y) const
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
class Cconc : public conc
|
class
|
||||||
|
Cconc:
|
||||||
|
public
|
||||||
|
conc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Cconc() { conc_init(this); }
|
Cconc()
|
||||||
~Cconc() { ; }
|
{
|
||||||
|
conc_init(this);
|
||||||
|
}
|
||||||
|
~
|
||||||
|
Cconc()
|
||||||
|
{;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SaxPhreeqcHandlers : public xns::DefaultHandler
|
class
|
||||||
|
SaxPhreeqcHandlers:
|
||||||
|
public
|
||||||
|
xns::DefaultHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
SaxPhreeqcHandlers();
|
||||||
|
virtual ~
|
||||||
SaxPhreeqcHandlers();
|
SaxPhreeqcHandlers();
|
||||||
virtual ~SaxPhreeqcHandlers();
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// Implementations of the SAX DocumentHandler interface
|
// Implementations of the SAX DocumentHandler interface
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
void endDocument();
|
void
|
||||||
|
endDocument();
|
||||||
|
|
||||||
void endElement(const XMLCh* const uri, const XMLCh* const name, const XMLCh* const qname);
|
void
|
||||||
|
endElement(const XMLCh * const uri, const XMLCh * const name,
|
||||||
|
const XMLCh * const qname);
|
||||||
|
|
||||||
void characters(const XMLCh* const chars, const unsigned int length);
|
void
|
||||||
|
characters(const XMLCh * const chars, const unsigned int length);
|
||||||
|
|
||||||
void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
|
void
|
||||||
|
ignorableWhitespace(const XMLCh * const chars, const unsigned int length);
|
||||||
|
|
||||||
void processingInstruction(const XMLCh* const target, const XMLCh* const data);
|
void
|
||||||
|
processingInstruction(const XMLCh * const target,
|
||||||
|
const XMLCh * const data);
|
||||||
|
|
||||||
void startDocument();
|
void
|
||||||
|
startDocument();
|
||||||
|
|
||||||
void startElement(const XMLCh* const uri, const XMLCh* const name, const XMLCh* const qname, const xns::Attributes& attributes);
|
void
|
||||||
|
startElement(const XMLCh * const uri, const XMLCh * const name,
|
||||||
|
const XMLCh * const qname,
|
||||||
|
const xns::Attributes & attributes);
|
||||||
|
|
||||||
// element types
|
// element types
|
||||||
enum elementType
|
enum elementType
|
||||||
@ -133,22 +164,43 @@ public:
|
|||||||
attCONC_gfw,
|
attCONC_gfw,
|
||||||
} attType;
|
} attType;
|
||||||
|
|
||||||
int processSolutionAttributes(const xns::Attributes& attributes);
|
int
|
||||||
int processSolutionTotalAttributes(const xns::Attributes& attributes, struct conc *c);
|
processSolutionAttributes(const xns::Attributes & attributes);
|
||||||
int processMasterActivityAttributes(const xns::Attributes& attributes, struct master_activity *ma);
|
int
|
||||||
|
processSolutionTotalAttributes(const xns::Attributes & attributes,
|
||||||
|
struct conc *c);
|
||||||
|
int
|
||||||
|
processMasterActivityAttributes(const xns::Attributes & attributes,
|
||||||
|
struct master_activity *ma);
|
||||||
//int processMasterActivityAttributes(const xns::Attributes& attributes, std::vector<struct master_activity> *v);
|
//int processMasterActivityAttributes(const xns::Attributes& attributes, std::vector<struct master_activity> *v);
|
||||||
int processIsotopeAttributes(const xns::Attributes& attributes, struct isotope *iso);
|
int
|
||||||
|
processIsotopeAttributes(const xns::Attributes & attributes,
|
||||||
|
struct isotope *iso);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<conc> totals;
|
std::vector <
|
||||||
std::vector<master_activity> acts, s_gammas;
|
conc >
|
||||||
std::vector<isotope> isotopes;
|
totals;
|
||||||
std::map< const XMLCh*, elementType, XMLCH_LESS > mapXMLCh2Type;
|
std::vector <
|
||||||
std::map< const XMLCh*, attributeType, XMLCH_LESS > mapXMLCh2AttType;
|
master_activity >
|
||||||
|
acts,
|
||||||
|
s_gammas;
|
||||||
|
std::vector <
|
||||||
|
isotope >
|
||||||
|
isotopes;
|
||||||
|
std::map < const XMLCh *,
|
||||||
|
elementType,
|
||||||
|
XMLCH_LESS >
|
||||||
|
mapXMLCh2Type;
|
||||||
|
std::map < const XMLCh *,
|
||||||
|
attributeType,
|
||||||
|
XMLCH_LESS >
|
||||||
|
mapXMLCh2AttType;
|
||||||
/**
|
/**
|
||||||
std::hash_map<const XMLCh*, ElementType, hash<const XMLCh*>, XMLCH_EQUALS> m_hashmapXMLCh2Type;
|
std::hash_map<const XMLCh*, ElementType, hash<const XMLCh*>, XMLCH_EQUALS> m_hashmapXMLCh2Type;
|
||||||
**/
|
**/
|
||||||
struct solution* solution_ptr;
|
struct solution *
|
||||||
|
solution_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !defined(AFX_SAXPHREEQCHANDLERS_H__4A69D5F5_2E57_4001_911D_4ABF6F2C0A0B__INCLUDED_)
|
#endif // !defined(AFX_SAXPHREEQCHANDLERS_H__4A69D5F5_2E57_4001_911D_4ABF6F2C0A0B__INCLUDED_)
|
||||||
|
|||||||
157
Solution.h
157
Solution.h
@ -16,58 +16,132 @@
|
|||||||
|
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
|
|
||||||
class cxxSolution : public cxxNumKeyword
|
class cxxSolution:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxSolution();
|
cxxSolution();
|
||||||
cxxSolution(struct solution *);
|
cxxSolution(struct solution *);
|
||||||
cxxSolution(int n_user);
|
cxxSolution(int n_user);
|
||||||
cxxSolution(const std::map<int, cxxSolution> &solution_map, cxxMix &mx, int n_user);
|
cxxSolution(const std::map < int, cxxSolution > &solution_map,
|
||||||
|
cxxMix & mx, int n_user);
|
||||||
~cxxSolution();
|
~cxxSolution();
|
||||||
|
|
||||||
//static cxxSolution& read(CParser& parser);
|
//static cxxSolution& read(CParser& parser);
|
||||||
|
|
||||||
double get_tc()const {return this->tc;}
|
double get_tc() const
|
||||||
void set_tc(double tc) {this->tc = tc;}
|
{
|
||||||
|
return this->tc;
|
||||||
|
}
|
||||||
|
void set_tc(double tc)
|
||||||
|
{
|
||||||
|
this->tc = tc;
|
||||||
|
}
|
||||||
|
|
||||||
double get_ph()const {return this->ph;}
|
double get_ph() const
|
||||||
void set_ph(double pH) {this->ph = pH;}
|
{
|
||||||
|
return this->ph;
|
||||||
|
}
|
||||||
|
void set_ph(double pH)
|
||||||
|
{
|
||||||
|
this->ph = pH;
|
||||||
|
}
|
||||||
|
|
||||||
double get_pe()const {return this->pe;}
|
double get_pe() const
|
||||||
void set_pe(double pe) {this->pe =pe;}
|
{
|
||||||
|
return this->pe;
|
||||||
|
}
|
||||||
|
void set_pe(double pe)
|
||||||
|
{
|
||||||
|
this->pe = pe;
|
||||||
|
}
|
||||||
|
|
||||||
double get_mu()const {return this->mu;}
|
double get_mu() const
|
||||||
void set_mu(double mu) {this->mu = mu;}
|
{
|
||||||
|
return this->mu;
|
||||||
|
}
|
||||||
|
void set_mu(double mu)
|
||||||
|
{
|
||||||
|
this->mu = mu;
|
||||||
|
}
|
||||||
|
|
||||||
double get_ah2o()const {return this->ah2o;}
|
double get_ah2o() const
|
||||||
void set_ah2o(double ah2o) {this->ah2o = ah2o;}
|
{
|
||||||
|
return this->ah2o;
|
||||||
|
}
|
||||||
|
void set_ah2o(double ah2o)
|
||||||
|
{
|
||||||
|
this->ah2o = ah2o;
|
||||||
|
}
|
||||||
|
|
||||||
double get_total_h()const {return this->total_h;}
|
double get_total_h() const
|
||||||
void set_total_h(double total_h) {this->total_h = total_h;}
|
{
|
||||||
|
return this->total_h;
|
||||||
|
}
|
||||||
|
void set_total_h(double total_h)
|
||||||
|
{
|
||||||
|
this->total_h = total_h;
|
||||||
|
}
|
||||||
|
|
||||||
double get_total_o()const {return this->total_o;}
|
double get_total_o() const
|
||||||
void set_total_o(double total_o) {this->total_o = total_o;}
|
{
|
||||||
|
return this->total_o;
|
||||||
|
}
|
||||||
|
void set_total_o(double total_o)
|
||||||
|
{
|
||||||
|
this->total_o = total_o;
|
||||||
|
}
|
||||||
|
|
||||||
double get_cb()const {return this->cb;}
|
double get_cb() const
|
||||||
void set_cb(double cb) {this->cb = cb;}
|
{
|
||||||
|
return this->cb;
|
||||||
|
}
|
||||||
|
void set_cb(double cb)
|
||||||
|
{
|
||||||
|
this->cb = cb;
|
||||||
|
}
|
||||||
|
|
||||||
double get_mass_water()const {return this->mass_water;}
|
double get_mass_water() const
|
||||||
void set_mass_water(long double mass_water) {this->mass_water = mass_water;}
|
{
|
||||||
|
return this->mass_water;
|
||||||
|
}
|
||||||
|
void set_mass_water(long double mass_water)
|
||||||
|
{
|
||||||
|
this->mass_water = mass_water;
|
||||||
|
}
|
||||||
|
|
||||||
double get_total_alkalinity()const {return this->total_alkalinity;}
|
double get_total_alkalinity() const
|
||||||
void set_total_alkalinity(double total_alkalinity) {this->total_alkalinity = total_alkalinity;}
|
{
|
||||||
|
return this->total_alkalinity;
|
||||||
|
}
|
||||||
|
void set_total_alkalinity(double total_alkalinity)
|
||||||
|
{
|
||||||
|
this->total_alkalinity = total_alkalinity;
|
||||||
|
}
|
||||||
|
|
||||||
double get_total(char *string)const;
|
double get_total(char *string) const;
|
||||||
double get_total_element(char *string)const;
|
double get_total_element(char *string) const;
|
||||||
void set_total(char *string, double value);
|
void set_total(char *string, double value);
|
||||||
|
|
||||||
const cxxNameDouble& get_totals(void)const {return this->totals;}
|
const cxxNameDouble & get_totals(void) const
|
||||||
void set_totals(cxxNameDouble &nd) {this->totals = nd; this->totals.type = cxxNameDouble::ND_ELT_MOLES;}
|
{
|
||||||
void clear_totals() {this->totals.clear();}
|
return this->totals;
|
||||||
|
}
|
||||||
|
void set_totals(cxxNameDouble & nd)
|
||||||
|
{
|
||||||
|
this->totals = nd;
|
||||||
|
this->totals.type = cxxNameDouble::ND_ELT_MOLES;
|
||||||
|
}
|
||||||
|
void clear_totals()
|
||||||
|
{
|
||||||
|
this->totals.clear();
|
||||||
|
}
|
||||||
|
|
||||||
const cxxNameDouble& get_master_activity(void)const {return this->master_activity;}
|
const cxxNameDouble & get_master_activity(void) const
|
||||||
double get_master_activity(char *string)const;
|
{
|
||||||
|
return this->master_activity;
|
||||||
|
}
|
||||||
|
double get_master_activity(char *string) const;
|
||||||
void set_master_activity(char *string, double value);
|
void set_master_activity(char *string, double value);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -80,30 +154,33 @@ public:
|
|||||||
|
|
||||||
struct solution *cxxSolution2solution();
|
struct solution *cxxSolution2solution();
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
#ifdef ORCHESTRA
|
#ifdef ORCHESTRA
|
||||||
void ORCH_write(std::ostream& headings, std::ostream& input_data)const;
|
void ORCH_write(std::ostream & headings, std::ostream & input_data) const;
|
||||||
void ORCH_read(std::vector <std::pair <std::string, double> > output_vector, std::vector < std::pair < std::string, double > >::iterator &it);
|
void ORCH_read(std::vector < std::pair < std::string,
|
||||||
void ORCH_store_global(std::map < std::string, double > output_map);
|
double >>output_vector,
|
||||||
|
std::vector < std::pair < std::string,
|
||||||
|
double >>::iterator & it);
|
||||||
|
void ORCH_store_global(std::map < std::string, double >output_map);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
void mpi_send(int task_number);
|
void mpi_send(int task_number);
|
||||||
void mpi_recv(int task_number);
|
void mpi_recv(int task_number);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void zero();
|
void zero();
|
||||||
void add(const cxxSolution &addee, double extensive);
|
void add(const cxxSolution & addee, double extensive);
|
||||||
// not checked
|
// not checked
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double tc;
|
double tc;
|
||||||
double ph;
|
double ph;
|
||||||
double pe;
|
double pe;
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
class cxxSolutionIsotope
|
class cxxSolutionIsotope
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cxxSolutionIsotope(void);
|
cxxSolutionIsotope(void);
|
||||||
cxxSolutionIsotope(struct isotope *isotope_ptr);
|
cxxSolutionIsotope(struct isotope *isotope_ptr);
|
||||||
~cxxSolutionIsotope(void);
|
~cxxSolutionIsotope(void);
|
||||||
@ -20,41 +20,75 @@ public:
|
|||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
//cxxSolutionIsotope::STATUS read(CParser& parser);
|
//cxxSolutionIsotope::STATUS read(CParser& parser);
|
||||||
static struct isotope * list2isotope(std::list<cxxSolutionIsotope> &t);
|
static struct isotope *list2isotope(std::list < cxxSolutionIsotope > &t);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent)const;
|
void dump_xml(std::ostream & os, unsigned int indent) const;
|
||||||
void dump_raw(std::ostream& os, unsigned int indent)const;
|
void dump_raw(std::ostream & os, unsigned int indent) const;
|
||||||
|
|
||||||
CParser::STATUS_TYPE read_raw(CParser& parser);
|
CParser::STATUS_TYPE read_raw(CParser & parser);
|
||||||
|
|
||||||
double get_isotope_number()const { return this->isotope_number;}
|
double get_isotope_number() const
|
||||||
void set_isotope_number(double d) { this->isotope_number = d;}
|
{
|
||||||
char * get_elt_name()const { return this->elt_name;}
|
return this->isotope_number;
|
||||||
void set_elt_name(char * cstring) { this->elt_name = cstring;}
|
}
|
||||||
char * get_isotope_name()const { return this->isotope_name;}
|
void set_isotope_number(double d)
|
||||||
void set_isotope_name(char * cstring) { this->isotope_name = cstring;}
|
{
|
||||||
double get_total()const { return this->total;}
|
this->isotope_number = d;
|
||||||
void set_total(double d) { this->total = d;}
|
}
|
||||||
|
char *get_elt_name() const
|
||||||
|
{
|
||||||
|
return this->elt_name;
|
||||||
|
}
|
||||||
|
void set_elt_name(char *cstring)
|
||||||
|
{
|
||||||
|
this->elt_name = cstring;
|
||||||
|
}
|
||||||
|
char *get_isotope_name() const
|
||||||
|
{
|
||||||
|
return this->isotope_name;
|
||||||
|
}
|
||||||
|
void set_isotope_name(char *cstring)
|
||||||
|
{
|
||||||
|
this->isotope_name = cstring;
|
||||||
|
}
|
||||||
|
double get_total() const
|
||||||
|
{
|
||||||
|
return this->total;
|
||||||
|
}
|
||||||
|
void set_total(double d)
|
||||||
|
{
|
||||||
|
this->total = d;
|
||||||
|
}
|
||||||
|
|
||||||
double get_ratio()const { return this->ratio; }
|
double get_ratio() const
|
||||||
|
{
|
||||||
|
return this->ratio;
|
||||||
|
}
|
||||||
|
|
||||||
double get_ratio_uncertainty()const { return this->ratio_uncertainty; }
|
double get_ratio_uncertainty() const
|
||||||
|
{
|
||||||
|
return this->ratio_uncertainty;
|
||||||
|
}
|
||||||
|
|
||||||
bool get_ratio_uncertainty_defined()const { return this->ratio_uncertainty_defined; }
|
bool get_ratio_uncertainty_defined() const
|
||||||
|
{
|
||||||
|
return this->ratio_uncertainty_defined;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator<(const cxxSolutionIsotope& conc)const;
|
bool operator<(const cxxSolutionIsotope & conc) const;
|
||||||
|
|
||||||
struct master *master(void);
|
struct master *master(void);
|
||||||
struct master *primary(void);
|
struct master *primary(void);
|
||||||
|
|
||||||
void add(const cxxSolutionIsotope &isotope_ptr, double intensive, double extensive);
|
void add(const cxxSolutionIsotope & isotope_ptr, double intensive,
|
||||||
|
double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class cxxSolutionIsotopeList;
|
friend class cxxSolutionIsotopeList;
|
||||||
double isotope_number;
|
double isotope_number;
|
||||||
char * elt_name;
|
char *elt_name;
|
||||||
char * isotope_name;
|
char *isotope_name;
|
||||||
double total;
|
double total;
|
||||||
double ratio;
|
double ratio;
|
||||||
double ratio_uncertainty;
|
double ratio_uncertainty;
|
||||||
|
|||||||
@ -11,25 +11,31 @@
|
|||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
|
|
||||||
class cxxSolutionIsotopeList : public std::list <cxxSolutionIsotope>
|
class cxxSolutionIsotopeList:public
|
||||||
|
std::list <
|
||||||
|
cxxSolutionIsotope >
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxSolutionIsotopeList();
|
cxxSolutionIsotopeList();
|
||||||
|
|
||||||
cxxSolutionIsotopeList(struct solution *solution_ptr);
|
cxxSolutionIsotopeList(struct solution *solution_ptr);
|
||||||
|
|
||||||
~cxxSolutionIsotopeList();
|
~
|
||||||
|
cxxSolutionIsotopeList();
|
||||||
|
|
||||||
struct isotope *cxxSolutionIsotopeList2isotope();
|
struct isotope *
|
||||||
|
cxxSolutionIsotopeList2isotope();
|
||||||
|
|
||||||
void add(cxxSolutionIsotopeList oldlist, double intensive, double extensive);
|
void
|
||||||
void multiply(double extensive);
|
add(cxxSolutionIsotopeList oldlist, double intensive, double extensive);
|
||||||
|
void
|
||||||
|
multiply(double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
238
StorageBin.h
238
StorageBin.h
@ -24,7 +24,7 @@
|
|||||||
class cxxStorageBin
|
class cxxStorageBin
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxStorageBin();
|
cxxStorageBin();
|
||||||
cxxStorageBin(struct Use *use_ptr);
|
cxxStorageBin(struct Use *use_ptr);
|
||||||
~cxxStorageBin();
|
~cxxStorageBin();
|
||||||
@ -37,87 +37,117 @@ public:
|
|||||||
|
|
||||||
void remove(int n);
|
void remove(int n);
|
||||||
|
|
||||||
cxxSolution *getSolution(int n_user) {
|
cxxSolution *getSolution(int n_user)
|
||||||
if (this->Solutions.find(n_user) != this->Solutions.end()) {
|
{
|
||||||
return(&(this->Solutions.find(n_user)->second));
|
if (this->Solutions.find(n_user) != this->Solutions.end())
|
||||||
|
{
|
||||||
|
return (&(this->Solutions.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setSolution(int n_user, cxxSolution *entity) {
|
void setSolution(int n_user, cxxSolution * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Solutions[n_user] = *entity;
|
Solutions[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeSolution(int n_user) {
|
void removeSolution(int n_user)
|
||||||
|
{
|
||||||
Solutions.erase(n_user);
|
Solutions.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxExchange *getExchange(int n_user) {
|
cxxExchange *getExchange(int n_user)
|
||||||
if (this->Exchangers.find(n_user) != this->Exchangers.end()) {
|
{
|
||||||
return(&(this->Exchangers.find(n_user)->second));
|
if (this->Exchangers.find(n_user) != this->Exchangers.end())
|
||||||
|
{
|
||||||
|
return (&(this->Exchangers.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setExchange(int n_user, cxxExchange *entity) {
|
void setExchange(int n_user, cxxExchange * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Exchangers[n_user] = *entity;
|
Exchangers[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeExchange(int n_user) {
|
void removeExchange(int n_user)
|
||||||
|
{
|
||||||
Exchangers.erase(n_user);
|
Exchangers.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxPPassemblage *getPPassemblage(int n_user) {
|
cxxPPassemblage *getPPassemblage(int n_user)
|
||||||
if (this->PPassemblages.find(n_user) != this->PPassemblages.end()) {
|
{
|
||||||
return(&(this->PPassemblages.find(n_user)->second));
|
if (this->PPassemblages.find(n_user) != this->PPassemblages.end())
|
||||||
|
{
|
||||||
|
return (&(this->PPassemblages.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setPPassemblage(int n_user, cxxPPassemblage *entity) {
|
void setPPassemblage(int n_user, cxxPPassemblage * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
PPassemblages[n_user] = *entity;
|
PPassemblages[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removePPassemblage(int n_user) {
|
void removePPassemblage(int n_user)
|
||||||
|
{
|
||||||
PPassemblages.erase(n_user);
|
PPassemblages.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxGasPhase *getGasPhase(int n_user) {
|
cxxGasPhase *getGasPhase(int n_user)
|
||||||
if (this->GasPhases.find(n_user) != this->GasPhases.end()) {
|
{
|
||||||
return(&(this->GasPhases.find(n_user)->second));
|
if (this->GasPhases.find(n_user) != this->GasPhases.end())
|
||||||
|
{
|
||||||
|
return (&(this->GasPhases.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setGasPhase(int n_user, cxxGasPhase *entity) {
|
void setGasPhase(int n_user, cxxGasPhase * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
GasPhases[n_user] = *entity;
|
GasPhases[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeGasPhase(int n_user) {
|
void removeGasPhase(int n_user)
|
||||||
|
{
|
||||||
GasPhases.erase(n_user);
|
GasPhases.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxSSassemblage *getSSassemblage(int n_user) {
|
cxxSSassemblage *getSSassemblage(int n_user)
|
||||||
if (this->SSassemblages.find(n_user) != this->SSassemblages.end()) {
|
{
|
||||||
return(&(this->SSassemblages.find(n_user)->second));
|
if (this->SSassemblages.find(n_user) != this->SSassemblages.end())
|
||||||
|
{
|
||||||
|
return (&(this->SSassemblages.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setSSassemblage(int n_user, cxxSSassemblage *entity) {
|
void setSSassemblage(int n_user, cxxSSassemblage * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
SSassemblages[n_user] = *entity;
|
SSassemblages[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeSSassemblage(int n_user) {
|
void removeSSassemblage(int n_user)
|
||||||
|
{
|
||||||
SSassemblages.erase(n_user);
|
SSassemblages.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxKinetics *getKinetics(int n_user) {
|
cxxKinetics *getKinetics(int n_user)
|
||||||
if (this->Kinetics.find(n_user) != this->Kinetics.end()) {
|
{
|
||||||
return(&(this->Kinetics.find(n_user)->second));
|
if (this->Kinetics.find(n_user) != this->Kinetics.end())
|
||||||
|
{
|
||||||
|
return (&(this->Kinetics.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setKinetics(int n_user, cxxKinetics *entity) {
|
void setKinetics(int n_user, cxxKinetics * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Kinetics[n_user] = *entity;
|
Kinetics[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeKinetics(int n_user) {
|
void removeKinetics(int n_user)
|
||||||
|
{
|
||||||
Kinetics.erase(n_user);
|
Kinetics.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,111 +155,151 @@ public:
|
|||||||
{
|
{
|
||||||
if (this->Surfaces.find(n_user) != this->Surfaces.end())
|
if (this->Surfaces.find(n_user) != this->Surfaces.end())
|
||||||
{
|
{
|
||||||
return(&(this->Surfaces.find(n_user)->second));
|
return (&(this->Surfaces.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setSurface(int n_user, cxxSurface *entity) {
|
void setSurface(int n_user, cxxSurface * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Surfaces[n_user] = *entity;
|
Surfaces[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeSurface(int n_user) {
|
void removeSurface(int n_user)
|
||||||
|
{
|
||||||
Surfaces.erase(n_user);
|
Surfaces.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxMix *getMix(int n_user) {
|
cxxMix *getMix(int n_user)
|
||||||
if (this->Mixes.find(n_user) != this->Mixes.end()) {
|
{
|
||||||
return(&(this->Mixes.find(n_user)->second));
|
if (this->Mixes.find(n_user) != this->Mixes.end())
|
||||||
|
{
|
||||||
|
return (&(this->Mixes.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setMix(int n_user, cxxMix *entity) {
|
void setMix(int n_user, cxxMix * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Mixes[n_user] = *entity;
|
Mixes[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeMix(int n_user) {
|
void removeMix(int n_user)
|
||||||
|
{
|
||||||
Mixes.erase(n_user);
|
Mixes.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxReaction *getReaction(int n_user) {
|
cxxReaction *getReaction(int n_user)
|
||||||
if (this->Reactions.find(n_user) != this->Reactions.end()) {
|
{
|
||||||
return(&(this->Reactions.find(n_user)->second));
|
if (this->Reactions.find(n_user) != this->Reactions.end())
|
||||||
|
{
|
||||||
|
return (&(this->Reactions.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setReaction(int n_user, cxxReaction *entity) {
|
void setReaction(int n_user, cxxReaction * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Reactions[n_user] = *entity;
|
Reactions[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeReaction(int n_user) {
|
void removeReaction(int n_user)
|
||||||
|
{
|
||||||
Reactions.erase(n_user);
|
Reactions.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
cxxTemperature *getTemperature(int n_user) {
|
cxxTemperature *getTemperature(int n_user)
|
||||||
if (this->Temperatures.find(n_user) != this->Temperatures.end()) {
|
{
|
||||||
return(&(this->Temperatures.find(n_user)->second));
|
if (this->Temperatures.find(n_user) != this->Temperatures.end())
|
||||||
|
{
|
||||||
|
return (&(this->Temperatures.find(n_user)->second));
|
||||||
}
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
void setTemperature(int n_user, cxxTemperature *entity) {
|
void setTemperature(int n_user, cxxTemperature * entity)
|
||||||
if (entity == NULL) return;
|
{
|
||||||
|
if (entity == NULL)
|
||||||
|
return;
|
||||||
Temperatures[n_user] = *entity;
|
Temperatures[n_user] = *entity;
|
||||||
}
|
}
|
||||||
void removeTemperature(int n_user) {
|
void removeTemperature(int n_user)
|
||||||
|
{
|
||||||
Temperatures.erase(n_user);
|
Temperatures.erase(n_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSystem(struct Use *use_ptr);
|
void setSystem(struct Use *use_ptr);
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, int i, unsigned int indent);
|
void dump_raw(std::ostream & s_oss, int i, unsigned int indent);
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
int read_raw_keyword(CParser& parser);
|
int read_raw_keyword(CParser & parser);
|
||||||
|
|
||||||
void add(struct system *sys_ptr);
|
void add(struct system *sys_ptr);
|
||||||
|
|
||||||
struct system *cxxStorageBin2system(int i);
|
struct system *cxxStorageBin2system(int i);
|
||||||
|
|
||||||
//cxxSolution *mix_cxxSolutions(cxxMix &mixmap);
|
//cxxSolution *mix_cxxSolutions(cxxMix &mixmap);
|
||||||
cxxExchange *mix_cxxExchange(cxxMix &mixmap);
|
cxxExchange *mix_cxxExchange(cxxMix & mixmap);
|
||||||
|
|
||||||
const std::map<int, cxxSolution>& getSolutions()const {return this->Solutions;};
|
const std::map < int, cxxSolution > &getSolutions() const
|
||||||
const std::map<int, cxxExchange>& getExchangers()const {return this->Exchangers;};
|
{
|
||||||
const std::map<int, cxxGasPhase>& getGasPhases()const {return this->GasPhases;};
|
return this->Solutions;
|
||||||
const std::map<int, cxxKinetics>& getKinetics()const {return this->Kinetics;};
|
};
|
||||||
const std::map<int, cxxPPassemblage>& getPPassemblages()const {return this->PPassemblages;};
|
const std::map < int, cxxExchange > &getExchangers() const
|
||||||
const std::map<int, cxxSSassemblage>& getSSassemblages()const {return this->SSassemblages;};
|
{
|
||||||
const std::map<int, cxxSurface>& getSurfaces()const {return this->Surfaces;};
|
return this->Exchangers;
|
||||||
|
};
|
||||||
|
const std::map < int, cxxGasPhase > &getGasPhases() const
|
||||||
|
{
|
||||||
|
return this->GasPhases;
|
||||||
|
};
|
||||||
|
const std::map < int, cxxKinetics > &getKinetics() const
|
||||||
|
{
|
||||||
|
return this->Kinetics;
|
||||||
|
};
|
||||||
|
const std::map < int, cxxPPassemblage > &getPPassemblages() const
|
||||||
|
{
|
||||||
|
return this->PPassemblages;
|
||||||
|
};
|
||||||
|
const std::map < int, cxxSSassemblage > &getSSassemblages() const
|
||||||
|
{
|
||||||
|
return this->SSassemblages;
|
||||||
|
};
|
||||||
|
const std::map < int, cxxSurface > &getSurfaces() const
|
||||||
|
{
|
||||||
|
return this->Surfaces;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_send(int n, int task_number);
|
void mpi_send(int n, int task_number);
|
||||||
void mpi_recv(int task_number);
|
void mpi_recv(int task_number);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ORCHESTRA
|
#ifdef ORCHESTRA
|
||||||
void ORCH_write(std::ostream &chemistry_dat, std::ostream &input_dat, std::ostream &output_dat);
|
void ORCH_write(std::ostream & chemistry_dat, std::ostream & input_dat,
|
||||||
|
std::ostream & output_dat);
|
||||||
#endif
|
#endif
|
||||||
protected:
|
protected:
|
||||||
// Tidied classes
|
// Tidied classes
|
||||||
std::map<int, cxxSolution> Solutions;
|
std::map < int, cxxSolution > Solutions;
|
||||||
std::map<int, cxxExchange> Exchangers;
|
std::map < int, cxxExchange > Exchangers;
|
||||||
std::map<int, cxxGasPhase> GasPhases;
|
std::map < int, cxxGasPhase > GasPhases;
|
||||||
std::map<int, cxxKinetics> Kinetics;
|
std::map < int, cxxKinetics > Kinetics;
|
||||||
std::map<int, cxxPPassemblage> PPassemblages;
|
std::map < int, cxxPPassemblage > PPassemblages;
|
||||||
std::map<int, cxxSSassemblage> SSassemblages;
|
std::map < int, cxxSSassemblage > SSassemblages;
|
||||||
std::map<int, cxxSurface> Surfaces;
|
std::map < int, cxxSurface > Surfaces;
|
||||||
|
|
||||||
//bool b = exists (Solutions, 5);
|
//bool b = exists (Solutions, 5);
|
||||||
// Initial classes
|
// Initial classes
|
||||||
//std::map<int, cxxISolution> ISolutions;
|
//std::map<int, cxxISolution> ISolutions;
|
||||||
|
|
||||||
// Reaction classes
|
// Reaction classes
|
||||||
std::map<int, cxxMix> Mixes;
|
std::map < int, cxxMix > Mixes;
|
||||||
std::map<int, cxxReaction> Reactions;
|
std::map < int, cxxReaction > Reactions;
|
||||||
std::map<int, cxxTemperature> Temperatures;
|
std::map < int, cxxTemperature > Temperatures;
|
||||||
cxxSystem system;
|
cxxSystem system;
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxStorageBin>& map;
|
//static std::map<int, cxxStorageBin>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
29
Surface.h
29
Surface.h
@ -15,13 +15,14 @@
|
|||||||
#include "SurfaceCharge.h"
|
#include "SurfaceCharge.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxSurface : public cxxNumKeyword
|
class cxxSurface:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxSurface();
|
cxxSurface();
|
||||||
cxxSurface(struct surface *);
|
cxxSurface(struct surface *);
|
||||||
cxxSurface(const std::map<int, cxxSurface> &entity_map, cxxMix &mx, int n_user);
|
cxxSurface(const std::map < int, cxxSurface > &entity_map, cxxMix & mx,
|
||||||
|
int n_user);
|
||||||
~cxxSurface();
|
~cxxSurface();
|
||||||
|
|
||||||
//enum SURFACE_STYPE { UNKNOWN_DL, NO_EDL, DDL, CD_MUSIC };
|
//enum SURFACE_STYPE { UNKNOWN_DL, NO_EDL, DDL, CD_MUSIC };
|
||||||
@ -32,11 +33,11 @@ public:
|
|||||||
|
|
||||||
struct surf_comp *cxxSurfaceComp2surf_comp();
|
struct surf_comp *cxxSurfaceComp2surf_comp();
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
bool get_related_phases(void);
|
bool get_related_phases(void);
|
||||||
|
|
||||||
@ -44,21 +45,21 @@ public:
|
|||||||
|
|
||||||
void totalize();
|
void totalize();
|
||||||
|
|
||||||
const cxxNameDouble& get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return this->totals;
|
return this->totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
void add(const cxxSurface &addee, double extensive);
|
void add(const cxxSurface & addee, double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<cxxSurfaceComp> surfaceComps;
|
std::list < cxxSurfaceComp > surfaceComps;
|
||||||
std::list<cxxSurfaceCharge> surfaceCharges;
|
std::list < cxxSurfaceCharge > surfaceCharges;
|
||||||
enum SURFACE_TYPE type;
|
enum SURFACE_TYPE type;
|
||||||
enum DIFFUSE_LAYER_TYPE dl_type;
|
enum DIFFUSE_LAYER_TYPE dl_type;
|
||||||
enum SITES_UNITS sites_units;
|
enum SITES_UNITS sites_units;
|
||||||
@ -70,7 +71,7 @@ protected:
|
|||||||
bool transport;
|
bool transport;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxSurface>& map;
|
//static std::map<int, cxxSurface>& map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
class cxxSurfaceCharge
|
class cxxSurfaceCharge
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
cxxSurfaceCharge();
|
cxxSurfaceCharge();
|
||||||
cxxSurfaceCharge(struct surface_charge *);
|
cxxSurfaceCharge(struct surface_charge *);
|
||||||
@ -24,26 +24,31 @@ public:
|
|||||||
|
|
||||||
struct master *get_psi_master();
|
struct master *get_psi_master();
|
||||||
|
|
||||||
static struct surface_charge *cxxSurfaceCharge2surface_charge(std::list<cxxSurfaceCharge>& el);
|
static struct surface_charge *cxxSurfaceCharge2surface_charge(std::list <
|
||||||
|
cxxSurfaceCharge
|
||||||
|
> &el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
char *get_name()const {return this->name;}
|
char *get_name() const
|
||||||
|
{
|
||||||
|
return this->name;
|
||||||
|
}
|
||||||
|
|
||||||
void add(const cxxSurfaceCharge &comp, double extensive);
|
void add(const cxxSurfaceCharge & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char * name;
|
char *name;
|
||||||
double specific_area;
|
double specific_area;
|
||||||
double grams;
|
double grams;
|
||||||
double charge_balance;
|
double charge_balance;
|
||||||
@ -54,7 +59,7 @@ protected:
|
|||||||
//char * psi_master_name;
|
//char * psi_master_name;
|
||||||
cxxNameDouble diffuse_layer_totals;
|
cxxNameDouble diffuse_layer_totals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
class cxxSurfaceComp
|
class cxxSurfaceComp
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
cxxSurfaceComp();
|
cxxSurfaceComp();
|
||||||
cxxSurfaceComp(struct surface_comp *);
|
cxxSurfaceComp(struct surface_comp *);
|
||||||
@ -24,50 +24,71 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
struct master *get_master();
|
struct master *get_master();
|
||||||
char *get_phase_name()const {return this->phase_name;}
|
char *get_phase_name() const
|
||||||
char *get_rate_name()const {return this->rate_name;}
|
{
|
||||||
char *get_formula()const {return this->formula;}
|
return this->phase_name;
|
||||||
double get_charge_balance()const { return this->charge_balance;}
|
}
|
||||||
void set_charge_balance(double d) { this->charge_balance = d;}
|
char *get_rate_name() const
|
||||||
|
{
|
||||||
|
return this->rate_name;
|
||||||
|
}
|
||||||
|
char *get_formula() const
|
||||||
|
{
|
||||||
|
return this->formula;
|
||||||
|
}
|
||||||
|
double get_charge_balance() const
|
||||||
|
{
|
||||||
|
return this->charge_balance;
|
||||||
|
}
|
||||||
|
void set_charge_balance(double d)
|
||||||
|
{
|
||||||
|
this->charge_balance = d;
|
||||||
|
}
|
||||||
|
|
||||||
static struct surface_comp *cxxSurfaceComp2surface_comp(std::list<cxxSurfaceComp>& el);
|
static struct surface_comp *cxxSurfaceComp2surface_comp(std::list <
|
||||||
|
cxxSurfaceComp >
|
||||||
|
&el);
|
||||||
|
|
||||||
void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
const cxxNameDouble &get_totals()const
|
const cxxNameDouble & get_totals() const
|
||||||
{
|
{
|
||||||
return (this->totals);
|
return (this->totals);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void add(const cxxSurfaceComp &comp, double extensive);
|
void add(const cxxSurfaceComp & comp, double extensive);
|
||||||
void multiply(double extensive);
|
void multiply(double extensive);
|
||||||
|
|
||||||
char *charge_name() {return(get_charge_name(this->formula));};
|
char *charge_name()
|
||||||
|
{
|
||||||
|
return (get_charge_name(this->formula));
|
||||||
|
};
|
||||||
|
|
||||||
static char *get_charge_name(char * token) {
|
static char *get_charge_name(char *token)
|
||||||
|
{
|
||||||
char name[100];
|
char name[100];
|
||||||
int l;
|
int l;
|
||||||
char *ptr1 = token;
|
char *ptr1 = token;
|
||||||
get_elt (&ptr1, name, &l);
|
get_elt(&ptr1, name, &l);
|
||||||
ptr1 = strchr (name, '_');
|
ptr1 = strchr(name, '_');
|
||||||
if (ptr1 != NULL)
|
if (ptr1 != NULL)
|
||||||
{
|
{
|
||||||
ptr1[0] = '\0';
|
ptr1[0] = '\0';
|
||||||
}
|
}
|
||||||
return(string_hsave(name));
|
return (string_hsave(name));
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char * formula;
|
char *formula;
|
||||||
cxxNameDouble formula_totals;
|
cxxNameDouble formula_totals;
|
||||||
double formula_z;
|
double formula_z;
|
||||||
double moles;
|
double moles;
|
||||||
@ -79,7 +100,7 @@ protected:
|
|||||||
double phase_proportion;
|
double phase_proportion;
|
||||||
char *rate_name;
|
char *rate_name;
|
||||||
double Dw;
|
double Dw;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
87
System.h
87
System.h
@ -12,64 +12,65 @@
|
|||||||
#include "Temperature.h"
|
#include "Temperature.h"
|
||||||
class cxxSystem
|
class cxxSystem
|
||||||
{
|
{
|
||||||
public:
|
public:cxxSystem(void);
|
||||||
cxxSystem(void);
|
public: ~cxxSystem(void);
|
||||||
public:
|
|
||||||
~cxxSystem(void);
|
|
||||||
void Initialize(void);
|
void Initialize(void);
|
||||||
void setSolution(cxxSolution *entity) {
|
void setSolution(cxxSolution * entity)
|
||||||
|
{
|
||||||
this->solution = entity;
|
this->solution = entity;
|
||||||
}
|
} void setExchange(cxxExchange * entity)
|
||||||
void setExchange(cxxExchange *entity) {
|
{
|
||||||
this->exchange = entity;
|
this->exchange = entity;
|
||||||
}
|
} void setPPassemblage(cxxPPassemblage * entity)
|
||||||
void setPPassemblage(cxxPPassemblage *entity) {
|
{
|
||||||
this->ppassemblage = entity;
|
this->ppassemblage = entity;
|
||||||
}
|
} void setGasPhase(cxxGasPhase * entity)
|
||||||
void setGasPhase(cxxGasPhase *entity) {
|
{
|
||||||
this->gasphase = entity;
|
this->gasphase = entity;
|
||||||
}
|
} void setSSassemblage(cxxSSassemblage * entity)
|
||||||
void setSSassemblage(cxxSSassemblage *entity) {
|
{
|
||||||
this->ssassemblage = entity;
|
this->ssassemblage = entity;
|
||||||
}
|
} void setKinetics(cxxKinetics * entity)
|
||||||
void setKinetics(cxxKinetics *entity) {
|
{
|
||||||
this->kinetics = entity;
|
this->kinetics = entity;
|
||||||
}
|
} void setSurface(cxxSurface * entity)
|
||||||
void setSurface(cxxSurface *entity) {
|
{
|
||||||
this->surface = entity;
|
this->surface = entity;
|
||||||
}
|
} void setMix(cxxMix * entity)
|
||||||
void setMix(cxxMix *entity) {
|
{
|
||||||
this->mix = entity;
|
this->mix = entity;
|
||||||
}
|
} void setReaction(cxxReaction * entity)
|
||||||
void setReaction(cxxReaction *entity) {
|
{
|
||||||
this->reaction = entity;
|
this->reaction = entity;
|
||||||
}
|
} void setTemperature(cxxTemperature * entity)
|
||||||
void setTemperature(cxxTemperature *entity) {
|
{
|
||||||
this->temperature = entity;
|
this->temperature = entity;
|
||||||
}
|
} void totalize();
|
||||||
void totalize();
|
|
||||||
#ifdef ORCHESTRA
|
#ifdef ORCHESTRA
|
||||||
void ORCH_components();
|
void ORCH_components();
|
||||||
void ORCH_write(std::ostream &chemistry_dat, std::ostream &input_dat, std::ostream &output_dat);
|
void ORCH_write(std::ostream & chemistry_dat, std::ostream & input_dat,
|
||||||
void ORCH_write_chemistry_water(std::ostream &chemistry_dat);
|
std::ostream & output_dat);
|
||||||
void ORCH_write_chemistry_primary(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_water(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_chemistry_total_O_H(std::ostream &chemistry_dat);
|
void ORCH_write_chemistry_primary(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_output_vars(std::ostream &outstream);
|
void ORCH_write_chemistry_total_O_H(std::ostream & chemistry_dat);
|
||||||
void ORCH_write_input(std::ostream &input_dat);
|
void ORCH_write_output_vars(std::ostream & outstream);
|
||||||
#endif
|
void ORCH_write_input(std::ostream & input_dat);
|
||||||
|
|
||||||
private:
|
#endif /* */
|
||||||
cxxSolution *solution;
|
private:cxxSolution * solution;
|
||||||
cxxExchange *exchange;
|
cxxExchange * exchange;
|
||||||
cxxPPassemblage *ppassemblage;
|
cxxPPassemblage * ppassemblage;
|
||||||
cxxGasPhase *gasphase;
|
cxxGasPhase * gasphase;
|
||||||
cxxSSassemblage *ssassemblage;
|
cxxSSassemblage * ssassemblage;
|
||||||
cxxKinetics *kinetics;
|
cxxKinetics * kinetics;
|
||||||
cxxSurface *surface;
|
cxxSurface * surface;
|
||||||
cxxMix *mix;
|
cxxMix * mix;
|
||||||
cxxReaction *reaction;
|
cxxReaction * reaction;
|
||||||
cxxTemperature *temperature;
|
cxxTemperature * temperature;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
cxxNameDouble orch_totals;
|
cxxNameDouble orch_totals;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // !defined(SYSTEM_H_INCLUDED)
|
#endif // !defined(SYSTEM_H_INCLUDED)
|
||||||
|
|||||||
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
|
|
||||||
class cxxTemperature : public cxxNumKeyword
|
class cxxTemperature:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxTemperature();
|
cxxTemperature();
|
||||||
cxxTemperature(struct temperature *);
|
cxxTemperature(struct temperature *);
|
||||||
~cxxTemperature();
|
~cxxTemperature();
|
||||||
@ -24,16 +24,16 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<double> temps;
|
std::vector < double >temps;
|
||||||
int countTemps;
|
int countTemps;
|
||||||
bool equalIncrements;
|
bool equalIncrements;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxTemperature>& map;
|
//static std::map<int, cxxTemperature>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
41
Utils.h
41
Utils.h
@ -8,49 +8,56 @@
|
|||||||
#include <map> // std::map
|
#include <map> // std::map
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
|
|
||||||
namespace Utilities {
|
namespace Utilities
|
||||||
|
{
|
||||||
|
|
||||||
const char INDENT[] = " ";
|
const char INDENT[] = " ";
|
||||||
|
|
||||||
enum STATUS_TYPE {
|
enum STATUS_TYPE
|
||||||
|
{
|
||||||
OK = 0,
|
OK = 0,
|
||||||
ERROR = 1
|
ERROR = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
STATUS_TYPE parse_couple(std::string& token);
|
STATUS_TYPE parse_couple(std::string & token);
|
||||||
|
|
||||||
int strcmp_nocase(const char *str1, const char *str2);
|
int strcmp_nocase(const char *str1, const char *str2);
|
||||||
|
|
||||||
int strcmp_nocase_arg1(const char *str1, const char *str2);
|
int strcmp_nocase_arg1(const char *str1, const char *str2);
|
||||||
|
|
||||||
void str_tolower(std::string& str);
|
void str_tolower(std::string & str);
|
||||||
|
|
||||||
bool replace(const char* str1, const char* str2, std::string& str);
|
bool replace(const char *str1, const char *str2, std::string & str);
|
||||||
|
|
||||||
void squeeze_white(std::string& s_l);
|
void squeeze_white(std::string & s_l);
|
||||||
|
|
||||||
//void error_msg(const std::string&, const int stopflag);
|
//void error_msg(const std::string&, const int stopflag);
|
||||||
|
|
||||||
// operations on maps of entities (Solution, Exchange, ...)
|
// operations on maps of entities (Solution, Exchange, ...)
|
||||||
template<typename T>
|
template < typename T >
|
||||||
void dump_raw (const T &b, std::ostream& s_oss, unsigned int indent)
|
void dump_raw(const T & b, std::ostream & s_oss, unsigned int indent)
|
||||||
{
|
{
|
||||||
//std :: map < int, T > :: const_iterator it;
|
//std :: map < int, T > :: const_iterator it;
|
||||||
typename T::const_iterator it;
|
typename T::const_iterator it;
|
||||||
for (it = b.begin(); it != b.end(); ++it) {
|
for (it = b.begin(); it != b.end(); ++it)
|
||||||
|
{
|
||||||
it->second.dump_raw(s_oss, indent);
|
it->second.dump_raw(s_oss, indent);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
template<typename T>
|
template < typename T > bool exists(const T & b, int i)
|
||||||
bool exists (const T &b, int i){
|
{
|
||||||
return (b.find(i) != b.end());}
|
return (b.find(i) != b.end());
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template < typename T > T * get_entity(std::map < int, T > b, int i)
|
||||||
T *get_entity(std::map<int, T> b, int i) {
|
{
|
||||||
if (b.find(i) != b.end()) {
|
if (b.find(i) != b.end())
|
||||||
return(&(b.find(i)->second));
|
{
|
||||||
} else {
|
return (&(b.find(i)->second));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
char_star.h
13
char_star.h
@ -1,11 +1,16 @@
|
|||||||
#if !defined(CHARSTAR_H_INCLUDED)
|
#if !defined(CHARSTAR_H_INCLUDED)
|
||||||
#define CHARSTAR_H_INCLUDED
|
#define CHARSTAR_H_INCLUDED
|
||||||
|
|
||||||
struct CHARSTAR_LESS : std::binary_function<const char*, const char*, bool> {
|
struct CHARSTAR_LESS:
|
||||||
bool operator()(const char* _X, const char* _Y) const
|
std::binary_function < const char *, const char *,
|
||||||
|
bool >
|
||||||
{
|
{
|
||||||
return ::strcmp( _X, _Y) < 0;}
|
bool
|
||||||
|
operator() (const char *_X, const char *_Y) const
|
||||||
|
{
|
||||||
|
return::strcmp(_X, _Y) <
|
||||||
|
0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -14,13 +14,14 @@
|
|||||||
#include "KineticsComp.h"
|
#include "KineticsComp.h"
|
||||||
#include "cxxMix.h"
|
#include "cxxMix.h"
|
||||||
|
|
||||||
class cxxKinetics : public cxxNumKeyword
|
class cxxKinetics:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxKinetics();
|
cxxKinetics();
|
||||||
cxxKinetics(struct kinetics *);
|
cxxKinetics(struct kinetics *);
|
||||||
cxxKinetics(const std::map<int, cxxKinetics> &entity_map, cxxMix &mx, int n_user);
|
cxxKinetics(const std::map < int, cxxKinetics > &entity_map, cxxMix & mx,
|
||||||
|
int n_user);
|
||||||
~cxxKinetics();
|
~cxxKinetics();
|
||||||
|
|
||||||
struct kinetics *cxxKinetics2kinetics();
|
struct kinetics *cxxKinetics2kinetics();
|
||||||
@ -29,9 +30,9 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
bool get_related_phases(void);
|
bool get_related_phases(void);
|
||||||
|
|
||||||
@ -39,14 +40,14 @@ public:
|
|||||||
|
|
||||||
#ifdef USE_MPI
|
#ifdef USE_MPI
|
||||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||||
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
void add(const cxxKinetics &addee, double extensive);
|
void add(const cxxKinetics & addee, double extensive);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::list<cxxKineticsComp> kineticsComps;
|
std::list < cxxKineticsComp > kineticsComps;
|
||||||
std::vector<double> steps;
|
std::vector < double >steps;
|
||||||
cxxNameDouble totals;
|
cxxNameDouble totals;
|
||||||
double step_divide;
|
double step_divide;
|
||||||
int rk;
|
int rk;
|
||||||
@ -54,7 +55,7 @@ protected:
|
|||||||
bool use_cvode;
|
bool use_cvode;
|
||||||
int cvode_steps;
|
int cvode_steps;
|
||||||
int cvode_order;
|
int cvode_order;
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxKinetics>& map;
|
//static std::map<int, cxxKinetics>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
25
cxxMix.h
25
cxxMix.h
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
#include "char_star.h"
|
#include "char_star.h"
|
||||||
|
|
||||||
class cxxMix : public cxxNumKeyword
|
class cxxMix:public cxxNumKeyword
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cxxMix();
|
cxxMix();
|
||||||
cxxMix(struct mix *);
|
cxxMix(struct mix *);
|
||||||
~cxxMix();
|
~cxxMix();
|
||||||
@ -24,27 +24,32 @@ public:
|
|||||||
|
|
||||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||||
|
|
||||||
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
|
||||||
|
|
||||||
void read_raw(CParser& parser);
|
void read_raw(CParser & parser);
|
||||||
|
|
||||||
void add(int n, double f) {
|
void add(int n, double f)
|
||||||
|
{
|
||||||
if (this->mixComps.find(n) != this->mixComps.end())
|
if (this->mixComps.find(n) != this->mixComps.end())
|
||||||
{
|
{
|
||||||
mixComps[n] += f;
|
mixComps[n] += f;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
mixComps[n] = f;
|
mixComps[n] = f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<int, double> *comps() {return &mixComps;}
|
std::map < int, double >*comps()
|
||||||
|
{
|
||||||
|
return &mixComps;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class cxxStorageBin;
|
friend class cxxStorageBin;
|
||||||
std::map<int, double> mixComps;
|
std::map < int, double >mixComps;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//static std::map<int, cxxMix>& map;
|
//static std::map<int, cxxMix>& map;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user