mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Last of SKIPs
In parser, do not echo if using last line. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5982 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
7257281b55
commit
9758c574e4
21
ExchComp.cxx
21
ExchComp.cxx
@ -38,27 +38,6 @@ cxxExchComp::cxxExchComp(PHRQ_io *io)
|
||||
formula_z = 0.0;
|
||||
}
|
||||
#ifdef SKIP
|
||||
cxxExchComp::cxxExchComp(struct exch_comp * exch_comp_ptr, PHRQ_io *io)
|
||||
//
|
||||
// constructor for cxxExchComp from struct exch_comp
|
||||
//
|
||||
:
|
||||
PHRQ_base(io),
|
||||
formula_totals(exch_comp_ptr->formula_totals), totals(exch_comp_ptr->totals)
|
||||
{
|
||||
this->Set_formula(exch_comp_ptr->formula);
|
||||
moles = exch_comp_ptr->moles;
|
||||
// totals in constructor
|
||||
//formula_totals in constructor
|
||||
la = exch_comp_ptr->la;
|
||||
charge_balance = exch_comp_ptr->charge_balance;
|
||||
this->Set_phase_name(exch_comp_ptr->phase_name);
|
||||
phase_proportion = exch_comp_ptr->phase_proportion;
|
||||
this->Set_rate_name(exch_comp_ptr->rate_name);
|
||||
formula_z = exch_comp_ptr->formula_z;
|
||||
}
|
||||
#endif
|
||||
#ifdef SKIP
|
||||
cxxExchComp::cxxExchComp(std::vector < cxxExchComp > &ec_vector,
|
||||
std::vector < double >&f_vector)
|
||||
//
|
||||
|
||||
@ -14,7 +14,6 @@ class cxxExchComp: public PHRQ_base
|
||||
|
||||
public:
|
||||
cxxExchComp(PHRQ_io *io=NULL);
|
||||
//cxxExchComp(struct exch_comp *, PHRQ_io *io=NULL);
|
||||
~cxxExchComp();
|
||||
|
||||
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
|
||||
|
||||
26
Exchange.cxx
26
Exchange.cxx
@ -31,32 +31,6 @@ cxxExchange::cxxExchange(PHRQ_io *io)
|
||||
n_solution = -999;
|
||||
pitzer_exchange_gammas = true;
|
||||
}
|
||||
#ifdef SKIP
|
||||
cxxExchange::cxxExchange(struct exchange * exchange_ptr, PHRQ_io *io)
|
||||
//
|
||||
// constructor for cxxExchange from struct exchange
|
||||
//
|
||||
:
|
||||
cxxNumKeyword(io)
|
||||
{
|
||||
int i;
|
||||
|
||||
this->Set_description(exchange_ptr->description);
|
||||
n_user = exchange_ptr->n_user;
|
||||
n_user_end = exchange_ptr->n_user_end;
|
||||
pitzer_exchange_gammas = (exchange_ptr->pitzer_exchange_gammas == TRUE);
|
||||
for (i = 0; i < exchange_ptr->count_comps; i++)
|
||||
{
|
||||
cxxExchComp ec(&(exchange_ptr->comps[i]), this->Get_io());
|
||||
std::string str(ec.Get_formula());
|
||||
exchComps[str] = ec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
cxxExchange::cxxExchange(const std::map < int, cxxExchange > &entities,
|
||||
cxxMix & mix, int l_n_user, PHRQ_io *io):
|
||||
cxxNumKeyword(io)
|
||||
|
||||
@ -16,7 +16,6 @@ class cxxExchange:public cxxNumKeyword
|
||||
|
||||
public:
|
||||
cxxExchange(PHRQ_io *io=NULL);
|
||||
//cxxExchange(struct exchange *, PHRQ_io *io=NULL);
|
||||
cxxExchange(const std::map < int, cxxExchange > &exchange_map,
|
||||
cxxMix & mx, int n_user, PHRQ_io *io=NULL);
|
||||
~cxxExchange();
|
||||
|
||||
@ -1245,7 +1245,8 @@ CParser::getOptionFromLastLine(const std::vector < std::string > &opt_list,
|
||||
pos_ptr = 0;
|
||||
copy_token(option, pos_ptr);
|
||||
next_pos = pos_ptr;
|
||||
if (this->echo_file) // pr.echo_input == TRUE
|
||||
//if (this->echo_file) // pr.echo_input == TRUE
|
||||
if (false)
|
||||
{
|
||||
if (true) // database_file == NULL
|
||||
{
|
||||
|
||||
28
Phreeqc.cpp
28
Phreeqc.cpp
@ -195,16 +195,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
accumulator.add_extensive(r_ptr.Get_elementList(), 1.0);
|
||||
}
|
||||
}
|
||||
#ifdef SKIP
|
||||
{
|
||||
for (i = 0; i < count_irrev; i++)
|
||||
{
|
||||
reaction_calc(&irrev[i]);
|
||||
cxxReaction entity(&irrev[i]);
|
||||
accumulator.add_extensive(entity.Get_elementList(), 1.0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// pure phases
|
||||
for (i = 0; i < count_pp_assemblage; i++)
|
||||
{
|
||||
@ -214,14 +205,6 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
}
|
||||
|
||||
// exchangers
|
||||
#ifdef SKIP
|
||||
for (i = 0; i < count_exchange; i++)
|
||||
{
|
||||
cxxExchange entity(&exchange[i], phrq_io);
|
||||
entity.totalize();
|
||||
accumulator.add_extensive(entity.Get_totals(), 1.0);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
std::map<int, cxxExchange>::const_iterator cit = Rxn_exchange_map.begin();
|
||||
for (; cit != Rxn_exchange_map.end(); cit++)
|
||||
@ -250,14 +233,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
|
||||
accumulator.add_extensive(entity.Get_totals(), 1.0);
|
||||
}
|
||||
}
|
||||
#ifdef SKIP
|
||||
for (i = 0; i < count_gas_phase; i++)
|
||||
{
|
||||
cxxGasPhase entity(&gas_phase[i], phrq_io);
|
||||
entity.totalize(this);
|
||||
accumulator.add_extensive(entity.Get_totals(), 1.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// solid-solutions
|
||||
for (i = 0; i < count_s_s_assemblage; i++)
|
||||
{
|
||||
|
||||
37
Reaction.cxx
37
Reaction.cxx
@ -29,43 +29,6 @@ cxxReaction::cxxReaction(PHRQ_io *io)
|
||||
reactantList.type = cxxNameDouble::ND_NAME_COEF;
|
||||
elementList.type = cxxNameDouble::ND_ELT_MOLES;
|
||||
}
|
||||
#ifdef SKIP
|
||||
cxxReaction::cxxReaction(struct irrev *irrev_ptr, PHRQ_io *io)
|
||||
//
|
||||
// constructor for cxxReaction from struct irrev
|
||||
//
|
||||
:
|
||||
cxxNumKeyword(io),
|
||||
reactantList(irrev_ptr->list, irrev_ptr->count_list),
|
||||
elementList(irrev_ptr->elts)
|
||||
{
|
||||
int i;
|
||||
|
||||
this->Set_description(irrev_ptr->description);
|
||||
this->n_user = irrev_ptr->n_user;
|
||||
this->n_user_end = irrev_ptr->n_user_end;
|
||||
this->Set_units(irrev_ptr->units);
|
||||
// steps
|
||||
if (irrev_ptr->count_steps < 0)
|
||||
{
|
||||
for (i = 0; i < 1; i++)
|
||||
{
|
||||
this->steps.push_back(irrev_ptr->steps[i]);
|
||||
}
|
||||
this->countSteps = -irrev_ptr->count_steps;
|
||||
this->equalIncrements = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < irrev_ptr->count_steps; i++)
|
||||
{
|
||||
this->steps.push_back(irrev_ptr->steps[i]);
|
||||
}
|
||||
this->countSteps = irrev_ptr->count_steps;
|
||||
this->equalIncrements = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
cxxReaction::~cxxReaction()
|
||||
{
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ class cxxReaction:public cxxNumKeyword
|
||||
|
||||
public:
|
||||
cxxReaction(PHRQ_io *io = NULL);
|
||||
//cxxReaction(struct irrev *, PHRQ_io *io = NULL);
|
||||
~cxxReaction();
|
||||
|
||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||
|
||||
1139
ReadClass.cxx
1139
ReadClass.cxx
File diff suppressed because it is too large
Load Diff
23
cxxMix.cxx
23
cxxMix.cxx
@ -26,30 +26,7 @@ cxxMix::cxxMix(PHRQ_io *io)
|
||||
: cxxNumKeyword(io)
|
||||
{
|
||||
}
|
||||
#ifdef SKIP
|
||||
cxxMix::cxxMix(struct mix *mix_ptr, PHRQ_io *io)
|
||||
//
|
||||
// constructor for cxxMix from struct mix
|
||||
//
|
||||
:
|
||||
cxxNumKeyword(io)
|
||||
{
|
||||
int i;
|
||||
|
||||
this->Set_description(mix_ptr->description);
|
||||
this->n_user = mix_ptr->n_user;
|
||||
this->n_user_end = mix_ptr->n_user_end;
|
||||
// comps
|
||||
if (mix_ptr->count_comps > 0)
|
||||
{
|
||||
for (i = 0; i < mix_ptr->count_comps; i++)
|
||||
{
|
||||
this->mixComps[mix_ptr->comps[i].n_solution] =
|
||||
mix_ptr->comps[i].fraction;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
cxxMix::~cxxMix()
|
||||
{
|
||||
}
|
||||
|
||||
1
cxxMix.h
1
cxxMix.h
@ -15,7 +15,6 @@ class cxxMix:public cxxNumKeyword
|
||||
|
||||
public:
|
||||
cxxMix(PHRQ_io *io=NULL);
|
||||
//cxxMix(struct mix *, PHRQ_io *io=NULL);
|
||||
~cxxMix();
|
||||
|
||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||
|
||||
225
dumper.cpp
225
dumper.cpp
@ -255,231 +255,6 @@ bool dumper::Read(CParser & parser)
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
#ifdef SKIP
|
||||
bool dumper::Read(CParser & parser)
|
||||
{
|
||||
|
||||
bool return_value(true);
|
||||
static std::vector < std::string > vopts;
|
||||
if (vopts.empty())
|
||||
{
|
||||
vopts.reserve(20);
|
||||
vopts.push_back("solution");
|
||||
vopts.push_back("solutions");
|
||||
vopts.push_back("pp_assemblage");
|
||||
vopts.push_back("pp_assemblages");
|
||||
vopts.push_back("equilibrium_phase");
|
||||
vopts.push_back("equilibrium_phases");
|
||||
vopts.push_back("exchange");
|
||||
vopts.push_back("surface");
|
||||
vopts.push_back("s_s_assemblage");
|
||||
vopts.push_back("solid_solution");
|
||||
vopts.push_back("solid_solutions");
|
||||
vopts.push_back("gas_phase");
|
||||
vopts.push_back("gas_phases");
|
||||
vopts.push_back("kinetics");
|
||||
vopts.push_back("file");
|
||||
vopts.push_back("append");
|
||||
vopts.push_back("all");
|
||||
vopts.push_back("cell");
|
||||
vopts.push_back("cells"); // 18
|
||||
vopts.push_back("mix"); // 19
|
||||
vopts.push_back("reaction"); // 20
|
||||
vopts.push_back("reactions"); // 21
|
||||
vopts.push_back("temperature"); // 22
|
||||
vopts.push_back("reaction_temperature"); // 23
|
||||
vopts.push_back("reaction_temperatures"); // 24
|
||||
vopts.push_back("pressure"); // 25
|
||||
vopts.push_back("reaction_pressure"); // 26
|
||||
vopts.push_back("reaction_pressures"); // 27
|
||||
}
|
||||
|
||||
std::istream::pos_type ptr;
|
||||
std::istream::pos_type next_char;
|
||||
std::string token;
|
||||
int opt_save;
|
||||
bool useLastLine(false);
|
||||
|
||||
// Read mix number and description
|
||||
//this->read_number_description(parser);
|
||||
|
||||
opt_save = CParser::OPT_DEFAULT;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int opt;
|
||||
StorageBinListItem cells;
|
||||
opt = parser.get_option(vopts, next_char);
|
||||
if (opt == CParser::OPT_DEFAULT)
|
||||
{
|
||||
opt = opt_save;
|
||||
}
|
||||
else
|
||||
{
|
||||
opt_save = opt;
|
||||
}
|
||||
|
||||
// Select StorageBinListItem
|
||||
StorageBinListItem *item = NULL;
|
||||
switch (opt)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
item = &(this->binList.Get_solution());
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
item = &(this->binList.Get_pp_assemblage());
|
||||
break;
|
||||
case 6:
|
||||
item = &(this->binList.Get_exchange());
|
||||
break;
|
||||
case 7:
|
||||
item = &(this->binList.Get_surface());
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
item = &(this->binList.Get_s_s_assemblage());
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
item = &(this->binList.Get_gas_phase());
|
||||
break;
|
||||
case 13:
|
||||
item = &(this->binList.Get_kinetics());
|
||||
break;
|
||||
case 17: // cell
|
||||
case 18: // cells
|
||||
item = &cells;
|
||||
break;
|
||||
case 19: // mix
|
||||
item = &(this->binList.Get_mix());
|
||||
break;
|
||||
case 20: // reaction
|
||||
case 21: // reactions
|
||||
item = &(this->binList.Get_reaction());
|
||||
break;
|
||||
case 22: // temperature
|
||||
case 23: // reaction_temperature
|
||||
case 24: // reaction_temperatures
|
||||
item = &(this->binList.Get_temperature());
|
||||
break;
|
||||
case 25: // pressure
|
||||
case 26: // reaction_pressure
|
||||
case 27: // reaction_pressures
|
||||
item = &(this->binList.Get_pressure());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Read dump entity list of numbers or number ranges for line, store in item
|
||||
if ((opt >= 0 && opt <= 13) || (opt >= 17 && opt <= 28))
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
CParser::TOKEN_TYPE j = parser.copy_token(token, next_char);
|
||||
if (j == CParser::TT_DIGIT)
|
||||
{
|
||||
item->Augment(token);
|
||||
}
|
||||
else if (j == CParser::TT_EMPTY)
|
||||
{
|
||||
item->Augment(token);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
parser.error_msg("Expected single number or range of numbers.",
|
||||
PHRQ_io::OT_CONTINUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opt == 17 || opt == 18)
|
||||
{
|
||||
this->binList.TransferAll(cells);
|
||||
}
|
||||
// Process other identifiers
|
||||
std::set < int >::iterator it;
|
||||
switch (opt)
|
||||
{
|
||||
case CParser::OPT_EOF:
|
||||
break;
|
||||
case CParser::OPT_KEYWORD:
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case 20:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
case 26:
|
||||
case 27:
|
||||
break;
|
||||
case 14: //file
|
||||
std::getline(parser.get_iss(), this->file_name);
|
||||
this->file_name = trim(this->file_name, " \t");
|
||||
if (this->file_name.size() == 0)
|
||||
{
|
||||
this->file_name = "dump.out";
|
||||
}
|
||||
|
||||
break;
|
||||
case 15: //append
|
||||
{
|
||||
parser.copy_token(token, next_char);
|
||||
//if (!(parser.get_iss() >> this->append))
|
||||
this->append = true;
|
||||
if (token.c_str()[0] == 'f' || token.c_str()[0] == 'F')
|
||||
{
|
||||
this->append = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16: //all
|
||||
this->SetAll(true);
|
||||
break;
|
||||
default:
|
||||
case CParser::OPT_DEFAULT:
|
||||
case CParser::OPT_ERROR:
|
||||
opt = CParser::OPT_EOF;
|
||||
parser.error_msg("Unknown input reading DUMP definition.",
|
||||
PHRQ_io::OT_CONTINUE);
|
||||
parser.error_msg(parser.line().c_str(), PHRQ_io::OT_CONTINUE);
|
||||
useLastLine = false;
|
||||
return_value = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (opt == CParser::OPT_EOF || opt == CParser::OPT_KEYWORD)
|
||||
break;
|
||||
}
|
||||
return(return_value);
|
||||
}
|
||||
#endif
|
||||
bool dumper::Get_bool_any(void)
|
||||
{
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user