mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Working on StorageBin. Moved 3 routines to structures to eliminate P_INSTANCEs.
Runs mytest OK. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5659 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
6acf05a1a0
commit
b18bda26b4
14
Exchange.cxx
14
Exchange.cxx
@ -167,7 +167,7 @@ cxxExchange::~cxxExchange()
|
||||
}
|
||||
|
||||
bool
|
||||
cxxExchange::get_related_phases()
|
||||
cxxExchange::Get_related_phases() const
|
||||
{
|
||||
for (std::map < std::string, cxxExchComp >::const_iterator it =
|
||||
this->exchComps.begin(); it != this->exchComps.end(); ++it)
|
||||
@ -180,7 +180,7 @@ cxxExchange::get_related_phases()
|
||||
}
|
||||
|
||||
bool
|
||||
cxxExchange::get_related_rate()
|
||||
cxxExchange::Get_related_rate() const
|
||||
{
|
||||
for (std::map < std::string, cxxExchComp >::const_iterator it =
|
||||
this->exchComps.begin(); it != this->exchComps.end(); ++it)
|
||||
@ -456,23 +456,23 @@ cxxExchange::totalize()
|
||||
return;
|
||||
}
|
||||
bool
|
||||
cxxExchange::get_pitzer_exchange_gammas()
|
||||
cxxExchange::Get_pitzer_exchange_gammas() const
|
||||
{
|
||||
return this->pitzer_exchange_gammas;
|
||||
}
|
||||
void
|
||||
cxxExchange::set_pitzer_exchange_gammas(bool b)
|
||||
cxxExchange::Set_pitzer_exchange_gammas(bool b)
|
||||
{
|
||||
this->pitzer_exchange_gammas = b;
|
||||
}
|
||||
|
||||
std::map < std::string, cxxExchComp > &
|
||||
cxxExchange::get_exchComps(void)
|
||||
const std::map < std::string, cxxExchComp > &
|
||||
cxxExchange::get_exchComps(void) const
|
||||
{
|
||||
return (this->exchComps);
|
||||
}
|
||||
const cxxNameDouble &
|
||||
cxxExchange::get_totals() const
|
||||
cxxExchange::Get_totals() const
|
||||
{
|
||||
return totals;
|
||||
}
|
||||
|
||||
12
Exchange.h
12
Exchange.h
@ -25,17 +25,17 @@ public:
|
||||
|
||||
void read_raw(CParser & parser, bool check = true);
|
||||
|
||||
bool get_related_phases(void);
|
||||
bool Get_related_phases(void) const;
|
||||
|
||||
bool get_related_rate(void);
|
||||
bool Get_related_rate(void) const;
|
||||
|
||||
bool get_pitzer_exchange_gammas();
|
||||
void set_pitzer_exchange_gammas(bool b);
|
||||
bool Get_pitzer_exchange_gammas() const;
|
||||
void Set_pitzer_exchange_gammas(bool b);
|
||||
|
||||
std::map < std::string, cxxExchComp > &get_exchComps(void);
|
||||
const std::map < std::string, cxxExchComp > &get_exchComps(void) const;
|
||||
void totalize();
|
||||
|
||||
const cxxNameDouble & get_totals() const;
|
||||
const cxxNameDouble & Get_totals() const;
|
||||
|
||||
#ifdef USE_MPI
|
||||
void mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
|
||||
|
||||
@ -35,12 +35,12 @@ public:
|
||||
this->rate_name.clear();
|
||||
}
|
||||
|
||||
cxxNameDouble &Get_namecoef(void) {return namecoef;};
|
||||
double Get_tol(void) {return tol;};
|
||||
double Get_m(void) {return m;};
|
||||
double Get_m0(void) {return m0;};
|
||||
double Get_moles(void) {return moles;};
|
||||
std::vector < double > &Get_d_params(void) {return d_params;};
|
||||
const cxxNameDouble &Get_namecoef(void) const {return namecoef;};
|
||||
double Get_tol(void) const {return tol;};
|
||||
double Get_m(void) const {return m;};
|
||||
double Get_m0(void) const {return m0;};
|
||||
double Get_moles(void) const {return moles;};
|
||||
const std::vector < double > &Get_d_params(void) const {return d_params;};
|
||||
|
||||
#ifdef USE_MPI
|
||||
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
||||
|
||||
@ -480,7 +480,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
{
|
||||
cxxExchange entity(&exchange[i], &phrq_io);
|
||||
entity.totalize();
|
||||
accumulator.add_extensive(entity.get_totals(), 1.0);
|
||||
accumulator.add_extensive(entity.Get_totals(), 1.0);
|
||||
}
|
||||
|
||||
// surfaces
|
||||
|
||||
16
Phreeqc.h
16
Phreeqc.h
@ -53,6 +53,7 @@ class cxxSSassemblageSS;
|
||||
class cxxSurface;
|
||||
class cxxSurfaceCharge;
|
||||
class cxxSurfaceComp;
|
||||
class cxxStorageBin;
|
||||
|
||||
class Phreeqc
|
||||
{
|
||||
@ -1144,9 +1145,9 @@ CLASS_STATIC int isotope_compare(const void *ptr1, const void *ptr2);
|
||||
public:
|
||||
struct solution *solution_alloc(void);
|
||||
struct solution *solution_bsearch(int k, int *n, int print);
|
||||
private:
|
||||
struct solution *solution_copy(struct solution *solution_old_ptr,
|
||||
int n_user_new);
|
||||
private:
|
||||
int solution_copy_to_last(int n, int n_user_new);
|
||||
int solution_duplicate(int n_user_old, int n_user_new);
|
||||
int solution_delete(int n_user_old);
|
||||
@ -1250,9 +1251,9 @@ extern void MergeFinalize(void);
|
||||
// convert class to struct
|
||||
|
||||
struct mix * cxxMix2mix(cxxMix *mx);
|
||||
struct kinetics *cxxKinetics2kinetics(cxxKinetics * kin);
|
||||
struct kinetics_comp * cxxKineticsComp2kinetics_comp(std::list < cxxKineticsComp > * el);
|
||||
struct exchange * cxxExchange2exchange(cxxExchange * ex);
|
||||
struct kinetics *cxxKinetics2kinetics(const cxxKinetics * kin);
|
||||
struct kinetics_comp * cxxKineticsComp2kinetics_comp(const std::list < cxxKineticsComp > * el);
|
||||
struct exchange * cxxExchange2exchange(const cxxExchange * ex);
|
||||
struct exch_comp * cxxExchComp2exch_comp(const std::map < std::string, cxxExchComp > * el);
|
||||
struct master * Get_exch_master(const cxxExchComp * ec);
|
||||
struct gas_phase * cxxGasPhase2gas_phase(const cxxGasPhase * gp);
|
||||
@ -1265,7 +1266,7 @@ struct solution * cxxSolution2solution(const cxxSolution * sol);
|
||||
struct isotope * cxxSolutionIsotopeList2isotope(const cxxSolutionIsotopeList * il);
|
||||
struct s_s_assemblage * cxxSSassemblage2s_s_assemblage(const cxxSSassemblage * ss);
|
||||
struct s_s * cxxSSassemblageSS2s_s(const std::map < std::string, cxxSSassemblageSS > * sscomp);
|
||||
struct surface * cxxSurface2surface(cxxSurface * surf);
|
||||
struct surface * cxxSurface2surface(const cxxSurface * surf);
|
||||
struct surface_comp * cxxSurfaceComp2surface_comp(const std::map < std::string, cxxSurfaceComp > * sc);
|
||||
struct surface_charge * cxxSurfaceCharge2surface_charge(const std::map < std::string, cxxSurfaceCharge > * s_ch);
|
||||
|
||||
@ -1274,6 +1275,11 @@ struct elt_list * cxxNameDouble2elt_list(const cxxNameDouble * nd);
|
||||
struct name_coef * cxxNameDouble2name_coef(const cxxNameDouble * nd);
|
||||
struct master_activity * cxxNameDouble2master_activity(const cxxNameDouble * nd);
|
||||
struct master * cxxNameDouble2surface_master(const cxxNameDouble * totals);
|
||||
|
||||
void Use2cxxStorageBin(cxxStorageBin & sb);
|
||||
void phreeqc2cxxStorageBin(cxxStorageBin & sb);
|
||||
void cxxStorageBin2phreeqc(cxxStorageBin & sb, int n);
|
||||
|
||||
/* tally.c */
|
||||
|
||||
void add_all_components_tally(void);
|
||||
|
||||
@ -49,6 +49,7 @@ PHRQ_base(io)
|
||||
this->system.Set_io(io);
|
||||
}
|
||||
|
||||
#ifdef MOVE_TO_STRUCTURES
|
||||
cxxStorageBin::cxxStorageBin(PHREEQC_PTR_ARG_COMMA struct Use *use_ptr, PHRQ_io * io)
|
||||
:
|
||||
PHRQ_base(io)
|
||||
@ -160,7 +161,7 @@ PHRQ_base(io)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
cxxStorageBin::~cxxStorageBin()
|
||||
{
|
||||
}
|
||||
@ -434,6 +435,8 @@ cxxStorageBin::getSurfaces() const
|
||||
{
|
||||
return this->Surfaces;
|
||||
}
|
||||
|
||||
#ifdef MOVE_TO_STRUCTURES
|
||||
void
|
||||
cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
|
||||
//
|
||||
@ -504,7 +507,7 @@ cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
|
||||
Temperatures[P_INSTANCE_POINTER temperature[i].n_user] = cxxTemperature(&P_INSTANCE_POINTER temperature[i], this->Get_io());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SKIP
|
||||
void
|
||||
@ -919,6 +922,7 @@ cxxStorageBin::add(struct system *system_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOVE_TO_STRUCTURES
|
||||
void
|
||||
cxxStorageBin::cxxStorageBin2phreeqc(PHREEQC_PTR_ARG_COMMA int n)
|
||||
//
|
||||
@ -1044,6 +1048,9 @@ cxxStorageBin::cxxStorageBin2phreeqc(PHREEQC_PTR_ARG_COMMA int n)
|
||||
//std::cerr << oss.str();
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOVE_TO_STRUCTURES
|
||||
void
|
||||
cxxStorageBin::phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n)
|
||||
//
|
||||
@ -1106,6 +1113,7 @@ cxxStorageBin::phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
cxxStorageBin::remove(int n)
|
||||
|
||||
@ -25,12 +25,12 @@ class cxxStorageBin: public PHRQ_base
|
||||
public:
|
||||
cxxStorageBin(PHRQ_io *io=NULL);
|
||||
//cxxStorageBin(struct Use *use_ptr);
|
||||
cxxStorageBin(PHREEQC_PTR_ARG_COMMA struct Use *use_ptr, PHRQ_io *io=NULL);
|
||||
//cxxStorageBin(PHREEQC_PTR_ARG_COMMA struct Use *use_ptr, PHRQ_io *io=NULL);
|
||||
~cxxStorageBin();
|
||||
|
||||
void import_phreeqc(PHREEQC_PTR_ARG);
|
||||
//void import_phreeqc(PHREEQC_PTR_ARG);
|
||||
|
||||
void cxxStorageBin2phreeqc(PHREEQC_PTR_ARG_COMMA int n);
|
||||
//void cxxStorageBin2phreeqc(PHREEQC_PTR_ARG_COMMA int n);
|
||||
|
||||
void phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n);
|
||||
|
||||
@ -105,6 +105,7 @@ class cxxStorageBin: public PHRQ_base
|
||||
const std::map < int, cxxSSassemblage > &getSSassemblages() const;
|
||||
const std::map < int, cxxSurface > &getSurfaces() const;
|
||||
|
||||
cxxSystem & Get_system(void) {return system;};
|
||||
#ifdef USE_MPI
|
||||
void mpi_send(int n, int task_number);
|
||||
void mpi_recv(int task_number);
|
||||
|
||||
@ -118,7 +118,7 @@ cxxSurface::~cxxSurface()
|
||||
}
|
||||
|
||||
bool
|
||||
cxxSurface::Get_related_phases()
|
||||
cxxSurface::Get_related_phases() const
|
||||
{
|
||||
for (std::map < std::string, cxxSurfaceComp >::const_iterator it =
|
||||
this->surfaceComps.begin(); it != this->surfaceComps.end(); ++it)
|
||||
@ -131,7 +131,7 @@ cxxSurface::Get_related_phases()
|
||||
}
|
||||
|
||||
bool
|
||||
cxxSurface::Get_related_rate()
|
||||
cxxSurface::Get_related_rate() const
|
||||
{
|
||||
for (std::map < std::string, cxxSurfaceComp >::const_iterator it =
|
||||
this->surfaceComps.begin(); it != this->surfaceComps.end(); ++it)
|
||||
|
||||
20
Surface.h
20
Surface.h
@ -28,9 +28,9 @@ class cxxSurface:public cxxNumKeyword
|
||||
|
||||
void read_raw(CParser & parser, bool check = true);
|
||||
|
||||
bool Get_related_phases(void);
|
||||
bool Get_related_phases(void) const;
|
||||
|
||||
bool Get_related_rate(void);
|
||||
bool Get_related_rate(void) const;
|
||||
|
||||
void totalize();
|
||||
|
||||
@ -47,15 +47,15 @@ class cxxSurface:public cxxNumKeyword
|
||||
void add(const cxxSurface & addee, double extensive);
|
||||
const std::map < std::string, cxxSurfaceComp > & Get_surfaceComps() const {return this->surfaceComps;};
|
||||
const std::map < std::string, cxxSurfaceCharge > & Get_surfaceCharges() const {return this->surfaceCharges;};
|
||||
SURFACE_TYPE Get_type(void) {return this->type;};
|
||||
DIFFUSE_LAYER_TYPE Get_dl_type(void) {return dl_type;};
|
||||
SITES_UNITS Get_sites_units(void) {return sites_units;};
|
||||
bool Get_only_counter_ions(void) {return only_counter_ions;};
|
||||
double Get_thickness(void) {return thickness;};
|
||||
double Get_debye_lengths(void) {return debye_lengths;};
|
||||
double Get_DDL_viscosity(void) {return DDL_viscosity;};
|
||||
SURFACE_TYPE Get_type(void) const {return this->type;};
|
||||
DIFFUSE_LAYER_TYPE Get_dl_type(void) const {return dl_type;};
|
||||
SITES_UNITS Get_sites_units(void) const {return sites_units;};
|
||||
bool Get_only_counter_ions(void) const {return only_counter_ions;};
|
||||
double Get_thickness(void) const {return thickness;};
|
||||
double Get_debye_lengths(void) const {return debye_lengths;};
|
||||
double Get_DDL_viscosity(void) const {return DDL_viscosity;};
|
||||
double Get_DDL_limit(void) const {return DDL_limit;};
|
||||
bool Get_transport(void) {return transport;};
|
||||
bool Get_transport(void) const {return transport;};
|
||||
|
||||
protected:
|
||||
std::map < std::string, cxxSurfaceComp > surfaceComps;
|
||||
|
||||
@ -72,7 +72,7 @@ cxxSystem::totalize(PHREEQC_PTR_ARG)
|
||||
if (this->exchange != NULL)
|
||||
{
|
||||
this->exchange->totalize();
|
||||
this->totals.add_extensive(this->exchange->get_totals(), 1.0);
|
||||
this->totals.add_extensive(this->exchange->Get_totals(), 1.0);
|
||||
}
|
||||
if (this->ppassemblage != NULL)
|
||||
{
|
||||
|
||||
@ -20,7 +20,7 @@ class cxxKinetics:public cxxNumKeyword
|
||||
cxxKinetics(struct kinetics *, PHRQ_io *io=NULL);
|
||||
cxxKinetics(const std::map < int, cxxKinetics > &entity_map, cxxMix & mx,
|
||||
int n_user, PHRQ_io *io=NULL);
|
||||
~cxxKinetics();
|
||||
~cxxKinetics();
|
||||
|
||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||
|
||||
@ -28,19 +28,19 @@ class cxxKinetics:public cxxNumKeyword
|
||||
|
||||
void read_raw(CParser & parser, bool check = true);
|
||||
|
||||
bool Get_related_phases(void);
|
||||
bool Get_related_rate(void);
|
||||
//bool Get_related_phases(void) const;
|
||||
//bool Get_related_rate(void) const;
|
||||
|
||||
std::vector < double > &Get_steps(void) {return steps;};
|
||||
double Get_step_divide(void) {return step_divide;};
|
||||
int Get_rk(void) {return rk;};
|
||||
int Get_bad_step_max(void) {return bad_step_max;};
|
||||
bool Get_use_cvode(void) {return use_cvode;};
|
||||
int Get_cvode_steps(void) {return cvode_steps;};
|
||||
int Get_cvode_order(void) {return cvode_order;};
|
||||
std::list < cxxKineticsComp > &Get_kineticsComps(void) {return kineticsComps;};
|
||||
cxxNameDouble & Get_totals(void) {return this->totals;};
|
||||
int Get_equal_steps(void) {return equal_steps;};
|
||||
const std::vector < double > &Get_steps(void) const {return steps;};
|
||||
double Get_step_divide(void) const {return step_divide;};
|
||||
int Get_rk(void) const {return rk;};
|
||||
int Get_bad_step_max(void) const {return bad_step_max;};
|
||||
bool Get_use_cvode(void) const {return use_cvode;};
|
||||
int Get_cvode_steps(void) const {return cvode_steps;};
|
||||
int Get_cvode_order(void) const {return cvode_order;};
|
||||
const std::list < cxxKineticsComp > &Get_kineticsComps(void) const {return kineticsComps;};
|
||||
const cxxNameDouble & Get_totals(void) const {return this->totals;};
|
||||
int Get_equal_steps(void) const {return equal_steps;};
|
||||
|
||||
|
||||
#ifdef USE_MPI
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user