mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
removed all PHREEQC_CLASS ifdefs Need to remove old_io ifdefs git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5712 1feff8c3-07ed-0310-ac33-dd36852eb9cd
94 lines
2.1 KiB
C++
94 lines
2.1 KiB
C++
#include <algorithm> // std::replace
|
|
|
|
#include "Phreeqc.h"
|
|
#include "System.h"
|
|
#include "SSassemblage.h"
|
|
#include "Solution.h"
|
|
#include "Exchange.h"
|
|
#include "GasPhase.h"
|
|
#include "cxxKinetics.h"
|
|
#include "PPassemblage.h"
|
|
#include "SSassemblageSS.h"
|
|
#include "SSassemblage.h"
|
|
#include "Surface.h"
|
|
#include "cxxMix.h"
|
|
#include "Reaction.h"
|
|
#include "Temperature.h"
|
|
|
|
cxxSystem::cxxSystem(PHRQ_io *io)
|
|
:
|
|
PHRQ_base(io)
|
|
{
|
|
this->solution = NULL;
|
|
this->exchange = NULL;
|
|
this->ppassemblage = NULL;
|
|
this->gasphase = NULL;
|
|
this->ssassemblage = NULL;
|
|
this->kinetics = NULL;
|
|
this->surface = NULL;
|
|
this->mix = NULL;
|
|
this->reaction = NULL;
|
|
this->temperature = NULL;
|
|
}
|
|
cxxSystem::~cxxSystem(void)
|
|
{
|
|
}
|
|
void
|
|
cxxSystem::Initialize(void)
|
|
{
|
|
this->solution = NULL;
|
|
this->exchange = NULL;
|
|
this->ppassemblage = NULL;
|
|
this->gasphase = NULL;
|
|
this->ssassemblage = NULL;
|
|
this->kinetics = NULL;
|
|
this->surface = NULL;
|
|
this->mix = NULL;
|
|
this->reaction = NULL;
|
|
this->temperature = NULL;
|
|
}
|
|
void
|
|
cxxSystem::totalize(PHREEQC_PTR_ARG)
|
|
{
|
|
//initialize
|
|
this->totals.clear();
|
|
//add solution
|
|
if (this->solution != NULL)
|
|
{
|
|
char token[MAX_LENGTH];
|
|
strcpy(token, "O");
|
|
this->totals[token] = this->solution->Get_total_o();
|
|
strcpy(token, "H");
|
|
this->totals[token] = this->solution->Get_total_h();
|
|
strcpy(token, "Charge");
|
|
this->totals[token] = this->solution->Get_cb();
|
|
this->totals.add_extensive(this->solution->Get_totals(), 1.0);
|
|
}
|
|
if (this->exchange != NULL)
|
|
{
|
|
this->exchange->totalize();
|
|
this->totals.add_extensive(this->exchange->Get_totals(), 1.0);
|
|
}
|
|
if (this->ppassemblage != NULL)
|
|
{
|
|
this->ppassemblage->totalize(P_INSTANCE);
|
|
this->totals.add_extensive(this->ppassemblage->Get_totals(), 1.0);
|
|
}
|
|
if (this->gasphase != NULL)
|
|
{
|
|
this->gasphase->totalize(P_INSTANCE);
|
|
this->totals.add_extensive(this->gasphase->Get_totals(), 1.0);
|
|
}
|
|
if (this->ssassemblage != NULL)
|
|
{
|
|
this->ssassemblage->totalize(P_INSTANCE);
|
|
this->totals.add_extensive(this->ssassemblage->Get_totals(), 1.0);
|
|
}
|
|
if (this->surface != NULL)
|
|
{
|
|
this->ssassemblage->totalize(P_INSTANCE);
|
|
this->totals.add_extensive(this->surface->Get_totals(), 1.0);
|
|
}
|
|
return;
|
|
}
|