mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
Updates
git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@837 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
e2b5a47014
commit
957551d0a7
27
Solution.cxx
27
Solution.cxx
@ -14,6 +14,7 @@
|
||||
#include <cassert> // assert
|
||||
#include <algorithm> // std::sort
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -1118,11 +1119,29 @@ void test_classes(void)
|
||||
}
|
||||
#endif
|
||||
{
|
||||
// get all c storage
|
||||
cxxStorageBin cstorage(cxxStorageBin::SB_GLOBAL);
|
||||
//std::ostringstream oss;
|
||||
//cstorage.dump_raw(oss, 0);
|
||||
//write it out
|
||||
std::fstream myfile;
|
||||
myfile.open("tfile", std::ios_base::out);
|
||||
cstorage.dump_raw(myfile, 0);
|
||||
myfile.close();
|
||||
}
|
||||
{
|
||||
// empty storage bin
|
||||
cxxStorageBin cstorage;
|
||||
// fstream
|
||||
std::fstream myfile;
|
||||
myfile.open("tfile", std::ios_base::in);
|
||||
// ostream
|
||||
std::ostringstream oss;
|
||||
cstorage.dump_raw(oss, 0);
|
||||
std::cerr << oss.str();
|
||||
//char string[200];
|
||||
//strcpy_s(string, "abc");
|
||||
// parser
|
||||
CParser cparser(myfile, oss, std::cerr);
|
||||
cstorage.read_raw(cparser);
|
||||
//std::cerr << oss.str();
|
||||
|
||||
// read it back
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,11 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cxxStorageBin::cxxStorageBin()
|
||||
{
|
||||
}
|
||||
|
||||
cxxStorageBin::cxxStorageBin(cxxStorageBin::SB_CONSTRUCTOR flag)
|
||||
//
|
||||
// default constructor for cxxStorageBin
|
||||
// pull data out of c storage
|
||||
@ -120,63 +123,30 @@ void cxxStorageBin::dump_raw(std::ostream& s_oss, unsigned int indent)const
|
||||
|
||||
// Solutions
|
||||
Utilities::dump_raw(Solutions, s_oss, indent);
|
||||
//for (std::map<int, cxxSolution>::const_iterator it = this->Solutions.begin(); it != this->Solutions.end(); ++it) {
|
||||
//it->second.dump_raw(s_oss, indent);
|
||||
//}
|
||||
|
||||
// Exchange
|
||||
Utilities::dump_raw(Exchangers, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxExchange>::const_iterator it = this->Exchangers.begin(); it != this->Exchangers.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
// Gas Phases
|
||||
Utilities::dump_raw(GasPhases, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxGasPhase>::const_iterator it = this->GasPhases.begin(); it != this->GasPhases.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
}
|
||||
*/
|
||||
|
||||
// Kinetics
|
||||
Utilities::dump_raw(Kinetics, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxKinetics>::const_iterator it = this->Kinetics.begin(); it != this->Kinetics.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
}
|
||||
*/
|
||||
|
||||
// PPassemblage
|
||||
Utilities::dump_raw(PPassemblages, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxPPassemblage>::const_iterator it = this->PPassemblages.begin(); it != this->PPassemblages.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
}
|
||||
*/
|
||||
|
||||
// SSassemblage
|
||||
Utilities::dump_raw(SSassemblages, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxSSassemblage>::const_iterator it = this->SSassemblages.begin(); it != this->SSassemblages.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
}
|
||||
*/
|
||||
|
||||
// Surface
|
||||
Utilities::dump_raw(Surfaces, s_oss, indent);
|
||||
/*
|
||||
for (std::map<int, cxxSurface>::const_iterator it = this->Surfaces.begin(); it != this->Surfaces.end(); ++it) {
|
||||
it->second.dump_raw(s_oss, indent);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void cxxStorageBin::read_raw(CParser& parser)
|
||||
{
|
||||
CParser::LINE_TYPE i;
|
||||
while ((i = parser.check_line("Subroutine Read", false, true, true, true)) != CParser::LT_KEYWORD)
|
||||
while ((i = parser.check_line("StorageBin read_raw", false, true, true, true)) != CParser::LT_KEYWORD)
|
||||
{
|
||||
if (i == CParser::LT_EOF) return; // CParser::LT_EOF;
|
||||
}
|
||||
|
||||
@ -20,15 +20,16 @@
|
||||
#include <list> // std::list
|
||||
#include <vector> // std::vector
|
||||
|
||||
template<class T>
|
||||
bool exists (std::map<int, T> b, int i){
|
||||
return (b.find(i) != b.end());}
|
||||
|
||||
class cxxStorageBin
|
||||
{
|
||||
|
||||
public:
|
||||
enum SB_CONSTRUCTOR {
|
||||
SB_GLOBAL = 1
|
||||
};
|
||||
|
||||
cxxStorageBin();
|
||||
cxxStorageBin(SB_CONSTRUCTOR flag);
|
||||
~cxxStorageBin();
|
||||
|
||||
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user