mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
as constructor methods for Solution and Exchange. Takes c storage and makes C++ objects after a calculation. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2062 1feff8c3-07ed-0310-ac33-dd36852eb9cd
76 lines
2.1 KiB
C++
76 lines
2.1 KiB
C++
#if !defined(NAMEDOUBLE_H_INCLUDED)
|
|
#define NAMEDOUBLE_H_INCLUDED
|
|
|
|
//#define EXTERNAL extern
|
|
#include <cassert> // assert
|
|
#include <map> // std::map
|
|
#include <string> // std::string
|
|
#include <list> // std::list
|
|
#include <vector> // std::vector
|
|
|
|
//#include "global.h"
|
|
#include "char_star.h"
|
|
#include "Parser.h"
|
|
class cxxNameDouble : public std::map <char *, double, CHARSTAR_LESS>
|
|
{
|
|
|
|
public:
|
|
enum ND_TYPE {
|
|
ND_ELT_MOLES = 1,
|
|
ND_SPECIES_LA = 2,
|
|
ND_SPECIES_GAMMA = 3,
|
|
ND_NAME_COEF = 4
|
|
};
|
|
|
|
cxxNameDouble();
|
|
cxxNameDouble(struct elt_list *);
|
|
cxxNameDouble(struct elt_list *, int count);
|
|
cxxNameDouble(struct conc *);
|
|
cxxNameDouble(struct master_activity *ma, int count, ND_TYPE);
|
|
cxxNameDouble(struct name_coef *nc, int count);
|
|
cxxNameDouble(const cxxNameDouble &old, double factor);
|
|
~cxxNameDouble();
|
|
|
|
struct elt_list *elt_list();
|
|
|
|
struct master_activity *master_activity()const;
|
|
|
|
struct conc *conc()const;
|
|
|
|
struct name_coef *name_coef()const;
|
|
|
|
void dump_xml(std::ostream& s_oss, unsigned int indent)const;
|
|
|
|
void dump_raw(std::ostream& s_oss, unsigned int indent)const;
|
|
|
|
CParser::STATUS_TYPE read_raw(CParser& parser, std::istream::pos_type& pos);
|
|
|
|
void add_extensive(const cxxNameDouble &old, double factor);
|
|
void add_intensive(const cxxNameDouble &addee, double fthis, double f2);
|
|
void add_log_activities(const cxxNameDouble &addee, double fthis, double f2);
|
|
void add(char * key, double total);
|
|
void multiply(double factor);
|
|
|
|
void insert(char *str, double d) {
|
|
(*this)[str] = d;
|
|
}
|
|
|
|
void mpi_pack(std::vector<int>& ints, std::vector<double>& doubles);
|
|
void mpi_pack(int *ints, int *ii, double *doubles, int *dd);
|
|
|
|
void mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
|
|
|
|
enum ND_TYPE type;
|
|
|
|
protected:
|
|
|
|
//std::map <char *, double, CHARSTAR_LESS> totals;
|
|
|
|
|
|
public:
|
|
//static std::map<int, cxxNameDouble>& map;
|
|
|
|
};
|
|
|
|
#endif // !defined(NAMEDOUBLE_H_INCLUDED)
|