mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
Working on saving state.
I think there is a compiler bug with map iterators in template definitions. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@796 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
c42d985558
commit
2fe8f7d44e
7
Makefile
7
Makefile
@ -158,6 +158,7 @@ COMMON_CXXOBJS = \
|
|||||||
ISolutionComp.o \
|
ISolutionComp.o \
|
||||||
SSassemblage.o \
|
SSassemblage.o \
|
||||||
SSassemblageSS.o \
|
SSassemblageSS.o \
|
||||||
|
StorageBin.o \
|
||||||
Surface.o \
|
Surface.o \
|
||||||
SurfCharge.o \
|
SurfCharge.o \
|
||||||
SurfComp.o \
|
SurfComp.o \
|
||||||
@ -178,6 +179,9 @@ ${PROGRAM} : ${OBJECT_FILES}
|
|||||||
#
|
#
|
||||||
# CXX files
|
# CXX files
|
||||||
#
|
#
|
||||||
|
EntityMap.o: ../EntityMap.cxx ../Utils.h ../EntityMap.h \
|
||||||
|
../phreeqc/global.h ../phreeqc/phrqtype.h ../char_star.h ../Parser.h \
|
||||||
|
../char_star.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
|
||||||
Exchange.o: ../Exchange.cxx ../Utils.h ../Exchange.h ../NumKeyword.h \
|
Exchange.o: ../Exchange.cxx ../Utils.h ../Exchange.h ../NumKeyword.h \
|
||||||
../Parser.h ../char_star.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
../Parser.h ../char_star.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
||||||
../char_star.h ../ExchComp.h ../NameDouble.h ../char_star.h ../Parser.h \
|
../char_star.h ../ExchComp.h ../NameDouble.h ../char_star.h ../Parser.h \
|
||||||
@ -281,6 +285,9 @@ SSassemblageSS.o: ../SSassemblageSS.cxx ../Utils.h ../SSassemblageSS.h \
|
|||||||
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
../NameDouble.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
||||||
../char_star.h ../Parser.h ../char_star.h ../char_star.h \
|
../char_star.h ../Parser.h ../char_star.h ../char_star.h \
|
||||||
../NameDouble.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
|
../NameDouble.h ../phreeqc/phqalloc.h ../phreeqc/phrqproto.h
|
||||||
|
StorageBin.o: ../StorageBin.cxx ../Utils.h ../StorageBin.h \
|
||||||
|
../phreeqc/global.h ../phreeqc/phrqtype.h ../phreeqc/phqalloc.h \
|
||||||
|
../phreeqc/phrqproto.h
|
||||||
Surface.o: ../Surface.cxx ../Utils.h ../Surface.h ../NumKeyword.h \
|
Surface.o: ../Surface.cxx ../Utils.h ../Surface.h ../NumKeyword.h \
|
||||||
../Parser.h ../char_star.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
../Parser.h ../char_star.h ../phreeqc/global.h ../phreeqc/phrqtype.h \
|
||||||
../char_star.h ../SurfComp.h ../NameDouble.h ../char_star.h ../Parser.h \
|
../char_star.h ../SurfComp.h ../NameDouble.h ../char_star.h ../Parser.h \
|
||||||
|
|||||||
10
Parser.cxx
10
Parser.cxx
@ -233,9 +233,13 @@ bool CParser::check_key(std::string::iterator begin, std::string::iterator end)
|
|||||||
static std::map<std::string, KEY_TYPE> s_keyword_map;
|
static std::map<std::string, KEY_TYPE> s_keyword_map;
|
||||||
if (s_keyword_map.size() == 0)
|
if (s_keyword_map.size() == 0)
|
||||||
{
|
{
|
||||||
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("solution", KT_SOLUTION));
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("solution_raw", KT_SOLUTION_RAW));
|
||||||
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("solution_raw", KT_SOLUTION_RAW));
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("exchange_raw", KT_EXCHANGE_RAW));
|
||||||
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("end", KT_END));
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("gas_phase_raw", KT_GASPHASE_RAW));
|
||||||
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("kinetics_raw", KT_KINETICS_RAW));
|
||||||
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("equilibrium_phases_raw", KT_PPASSEMBLAGE_RAW));
|
||||||
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("solid_solutions_raw", KT_SSASSEMBLAGE_RAW));
|
||||||
|
s_keyword_map.insert(std::map<std::string, KEY_TYPE>::value_type("surface_raw", KT_SURFACE_RAW));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string lowercase;
|
std::string lowercase;
|
||||||
|
|||||||
16
Parser.h
16
Parser.h
@ -40,11 +40,17 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum KEY_TYPE {
|
enum KEY_TYPE {
|
||||||
KT_NONE = -1,
|
KT_NONE = -1,
|
||||||
KT_END = 0,
|
KT_END = 0,
|
||||||
KT_EOF = 1,
|
KT_EOF = 1,
|
||||||
KT_SOLUTION = 4,
|
KT_SOLUTION_RAW = 5,
|
||||||
KT_SOLUTION_RAW = 5
|
KT_EXCHANGE_RAW = 6,
|
||||||
|
KT_GASPHASE_RAW = 7,
|
||||||
|
KT_KINETICS_RAW = 8,
|
||||||
|
KT_PPASSEMBLAGE_RAW = 9,
|
||||||
|
KT_SSASSEMBLAGE_RAW = 10,
|
||||||
|
KT_SURFACE_RAW = 11
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OPT_TYPE {
|
enum OPT_TYPE {
|
||||||
|
|||||||
20
Solution.cxx
20
Solution.cxx
@ -809,6 +809,8 @@ cxxSolution& cxxSolution::read(CParser& parser)
|
|||||||
#include "Reaction.h"
|
#include "Reaction.h"
|
||||||
#include "Mix.h"
|
#include "Mix.h"
|
||||||
#include "Temperature.h"
|
#include "Temperature.h"
|
||||||
|
#include "StorageBin.h"
|
||||||
|
#include "NumKeyword.h"
|
||||||
#include <iostream> // std::cout std::cerr
|
#include <iostream> // std::cout std::cerr
|
||||||
//#include <strstream>
|
//#include <strstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -816,8 +818,22 @@ cxxSolution& cxxSolution::read(CParser& parser)
|
|||||||
void test_classes(void)
|
void test_classes(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
bool b(true);
|
|
||||||
i = (int) b;
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
std::map<int, cxxSolution> Solutions;
|
||||||
|
cxxSolution soln(solution[0]);
|
||||||
|
Solutions[solution[0]->n_user] = soln;
|
||||||
|
bool b = Utilities::exists(Solutions, 1);
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
cxxEntityMap x;
|
||||||
|
cxxSolution soln(solution[0]);
|
||||||
|
cxxNumKeyword nk;
|
||||||
|
x[solution[0]->n_user] = soln;
|
||||||
|
*/
|
||||||
|
|
||||||
for (i=0; i < count_solution; i++) {
|
for (i=0; i < count_solution; i++) {
|
||||||
if (solution[i]->new_def == TRUE) {
|
if (solution[i]->new_def == TRUE) {
|
||||||
cxxISolution sol(solution[i]);
|
cxxISolution sol(solution[i]);
|
||||||
|
|||||||
21
Utils.h
21
Utils.h
@ -2,6 +2,11 @@
|
|||||||
#define UTILITIES_H_INCLUDED
|
#define UTILITIES_H_INCLUDED
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <sstream> // std::istringstream std::ostringstream
|
||||||
|
#include <ostream> // std::ostream
|
||||||
|
#include <istream> // std::istream
|
||||||
|
#include <map> // std::map
|
||||||
|
#include "char_star.h"
|
||||||
|
|
||||||
namespace Utilities {
|
namespace Utilities {
|
||||||
|
|
||||||
@ -26,6 +31,22 @@ namespace Utilities {
|
|||||||
|
|
||||||
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, ...)
|
||||||
|
template<class T>
|
||||||
|
bool exists (std::map<int, T> b, int i){
|
||||||
|
return (b.find(i) != b.end());}
|
||||||
|
|
||||||
|
/*
|
||||||
|
template<class T>
|
||||||
|
void dump_raw ( std::map<int, T> b, std::ostream& s_oss, unsigned int indent )
|
||||||
|
{
|
||||||
|
std :: map < int, T > :: iterator it;
|
||||||
|
for (it = b.begin(); it != b.end(); ++it) {
|
||||||
|
it->second.dump_raw(s_oss, indent);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILITIES_H_INCLUDED
|
#endif // UTILITIES_H_INCLUDED
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user