Works with szBin on serial and parallel.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@876 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2006-04-21 20:00:26 +00:00
parent a372f9a8a2
commit cb5ccd55d1
3 changed files with 110 additions and 0 deletions

View File

@ -51,6 +51,7 @@ cxxNumKeyword()
// gas_phase components
for (i = 0; i < gas_phase_ptr->count_comps; i++) {
if (gas_phase_ptr->comps[i].name == NULL) continue;
gasPhaseComps[gas_phase_ptr->comps[i].name] = gas_phase_ptr->comps[i].moles;
}
}

View File

@ -435,6 +435,30 @@ void cxxStorageBin::phreeqc2cxxStorageBin(int n)
}
}
void cxxStorageBin::remove(int n)
{
// Solution
this->Solutions.erase(n);
// Exchanger
this->Exchangers.erase(n);
// GasPhase
this->GasPhases.erase(n);
// Kinetics
this->Kinetics.erase(n);
// PPassemblage
this->PPassemblages.erase(n);
// SSassemblage
this->SSassemblages.erase(n);
// Surface
this->Surfaces.erase(n);
}
cxxSolution *cxxStorageBin::mix_cxxSolutions(cxxMix &mixmap)
{
@ -475,3 +499,62 @@ cxxSolution *cxxStorageBin::mix_cxxSolutions(cxxMix &mixmap)
}
return(cxxsoln_ptr);
}
struct system *cxxStorageBin::cxxStorageBin2system(int n)
//
// make a system from storagebin
//
{
struct system *system_ptr = new (struct system);
// Solutions
if (this->getSolution(n) != NULL) {
system_ptr->solution = (this->getSolution(n))->cxxSolution2solution();
} else {
system_ptr->solution = NULL;
}
// Exchangers
if (this->getExchange(n) != NULL) {
system_ptr->exchange = (this->getExchange(n))->cxxExchange2exchange();
} else {
system_ptr->exchange = NULL;
}
// GasPhases
if (this->getGasPhase(n) != NULL) {
system_ptr->gas_phase = (this->getGasPhase(n))->cxxGasPhase2gas_phase();
} else {
system_ptr->gas_phase = NULL;
}
// Kinetics
if (this->getKinetics(n) != NULL) {
system_ptr->kinetics = (this->getKinetics(n))->cxxKinetics2kinetics();
} else {
system_ptr->kinetics = NULL;
}
// PPassemblages
if (this->getPPassemblage(n) != NULL) {
system_ptr->pp_assemblage = (this->getPPassemblage(n))->cxxPPassemblage2pp_assemblage();
} else {
system_ptr->pp_assemblage = NULL;
}
// SSassemblages
if (this->getSSassemblage(n) != NULL) {
system_ptr->s_s_assemblage = (this->getSSassemblage(n))->cxxSSassemblage2s_s_assemblage();
} else {
system_ptr->s_s_assemblage = NULL;
}
// Surfaces
if (this->getSurface(n) != NULL) {
system_ptr->surface = (this->getSurface(n))->cxxSurface2surface();
} else {
system_ptr->surface = NULL;
}
return system_ptr;
}

View File

@ -34,6 +34,8 @@ public:
void phreeqc2cxxStorageBin(int n);
void remove(int n);
struct cxxSolution *getSolution(int n_user) {
if (this->Solutions.find(n_user) != this->Solutions.end()) {
return(&(this->Solutions.find(n_user)->second));
@ -43,6 +45,9 @@ public:
void setSolution(int n_user, cxxSolution *entity) {
Solutions[n_user] = *entity;
}
void removeSolution(int n_user) {
Solutions.erase(n_user);
}
struct cxxExchange *getExchange(int n_user) {
if (this->Exchangers.find(n_user) != this->Exchangers.end()) {
@ -53,6 +58,9 @@ public:
void setExchange(int n_user, cxxExchange *entity) {
Exchangers[n_user] = *entity;
}
void removeExchange(int n_user) {
Exchangers.erase(n_user);
}
struct cxxPPassemblage *getPPassemblage(int n_user) {
if (this->PPassemblages.find(n_user) != this->PPassemblages.end()) {
@ -63,6 +71,10 @@ public:
void setPPassemblage(int n_user, cxxPPassemblage *entity) {
PPassemblages[n_user] = *entity;
}
void removePPassemblage(int n_user) {
PPassemblages.erase(n_user);
}
struct cxxGasPhase *getGasPhase(int n_user) {
if (this->GasPhases.find(n_user) != this->GasPhases.end()) {
return(&(this->GasPhases.find(n_user)->second));
@ -72,6 +84,9 @@ public:
void setGasPhase(int n_user, cxxGasPhase *entity) {
GasPhases[n_user] = *entity;
}
void removeGasPhase(int n_user) {
GasPhases.erase(n_user);
}
struct cxxSSassemblage *getSSassemblage(int n_user) {
if (this->SSassemblages.find(n_user) != this->SSassemblages.end()) {
@ -82,6 +97,9 @@ public:
void setSSassemblage(int n_user, cxxSSassemblage *entity) {
SSassemblages[n_user] = *entity;
}
void removeSSassemblage(int n_user) {
SSassemblages.erase(n_user);
}
struct cxxKinetics *getKinetics(int n_user) {
if (this->Kinetics.find(n_user) != this->Kinetics.end()) {
@ -92,6 +110,9 @@ public:
void setKinetics(int n_user, cxxKinetics *entity) {
Kinetics[n_user] = *entity;
}
void removeKinetics(int n_user) {
Kinetics.erase(n_user);
}
struct cxxSurface *getSurface(int n_user) {
if (this->Surfaces.find(n_user) != this->Surfaces.end()) {
@ -102,6 +123,9 @@ public:
void setSurface(int n_user, cxxSurface *entity) {
Surfaces[n_user] = *entity;
}
void removeSurface(int n_user) {
Surfaces.erase(n_user);
}
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
@ -109,6 +133,8 @@ public:
void add(struct system *sys_ptr);
struct system *cxxStorageBin2system(int i);
cxxSolution *mix_cxxSolutions(cxxMix &mixmap);
protected: