iphreeqc/cxxMix.h
David L Parkhurst 193e8ef865 Bug with adding mixing solution when already in list. Replaced old fraction with new
fraction. Now adds the two fractions. 

This created a bug with rivers when mixing with the same solution. The mass fraction
was calculated incorrectly because only the second part of the solution was used (solution, frac 2).


git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2888 1feff8c3-07ed-0310-ac33-dd36852eb9cd
2008-04-24 23:59:55 +00:00

53 lines
1.0 KiB
C++

#if !defined(CXXMIX_H_INCLUDED)
#define CXXMIX_H_INCLUDED
#include "NumKeyword.h"
//#define EXTERNAL extern
//#include "global.h"
#include <cassert> // assert
#include <map> // std::map
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "char_star.h"
class cxxMix : public cxxNumKeyword
{
public:
cxxMix();
cxxMix(struct mix *);
~cxxMix();
struct mix *cxxMix2mix();
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
void read_raw(CParser& parser);
void add(int n, double f) {
if (this->mixComps.find(n) != this->mixComps.end())
{
mixComps[n] += f;
} else
{
mixComps[n] = f;
}
};
std::map<int, double> *comps() {return &mixComps;}
protected:
friend class cxxStorageBin;
std::map<int, double> mixComps;
public:
//static std::map<int, cxxMix>& map;
};
#endif // !defined(CXXMIX_H_INCLUDED)