PhreeqcRM
PhreeqcRM.h
Go to the documentation of this file.
1 
4 #if !defined(PHREEQCRM_H_INCLUDED)
5 #define PHREEQCRM_H_INCLUDED
6 #ifdef USE_MPI
7 #include "mpi.h"
8 #define MP_TYPE MPI_Comm
9 #else
10 #define MP_TYPE int
11 #endif
12 class IPhreeqcPhast;
13 
14 class cxxStorageBin;
15 //class cxxNameDouble;
16 #include "NameDouble.h"
17 class cxxSolution;
18 class PHRQ_io;
19 #include <vector>
20 #include <list>
21 #include <set>
22 #include <map>
23 #include <string>
24 
25 #if defined(_WINDLL)
26 #define IRM_DLL_EXPORT __declspec(dllexport)
27 #else
28 #define IRM_DLL_EXPORT
29 #endif
30 
31 class PHRQ_io;
32 class IPhreeqc;
39 class IRM_DLL_EXPORT PhreeqcRMStop : public std::exception
40 {
41 public:
42  const char *what() const throw () {return "Failure in PhreeqcRM\n";}
43 };
44 
47 #include "IrmResult.h"
48 enum {
49  METHOD_CREATEMAPPING,
50  METHOD_DUMPMODULE,
51  METHOD_FINDCOMPONENTS,
52  METHOD_GETCONCENTRATIONS,
53  METHOD_GETDENSITY,
54  METHOD_GETERRORSTRING,
55  METHOD_GETGASCOMPMOLES,
56  METHOD_GETGASCOMPPRESSURES,
57  METHOD_GETGASCOMPPHI,
58  METHOD_GETGASPHASEVOLUME,
59  METHOD_GETPRESSURE,
60  METHOD_GETSATURATION,
61  METHOD_GETSELECTEDOUTPUT,
62  METHOD_GETSOLUTIONVOLUME,
63  METHOD_GETSPECIESCONCENTRATIONS,
64  METHOD_GETSPECIESLOG10GAMMAS,
65  METHOD_GETSPECIESLOG10MOLALITIES,
66  METHOD_GETTEMPERATURE,
67  METHOD_INITIALPHREEQC2MODULE,
68  METHOD_INITIALPHREEQCCELL2MODULE,
69  METHOD_LOADDATABASE,
70  METHOD_MPIWORKERBREAK,
71  METHOD_RUNCELLS,
72  METHOD_RUNFILE,
73  METHOD_RUNSTRING,
74  METHOD_SETCOMPONENTH2O,
75  METHOD_SETCONCENTRATIONS,
76  METHOD_SETDENSITY,
77  METHOD_SETERRORHANDLERMODE,
78  METHOD_SETFILEPREFIX,
79  METHOD_SETGASCOMPMOLES,
80  METHOD_SETGASPHASEVOLUME,
81  METHOD_SETPARTITIONUZSOLIDS,
82  METHOD_SETPOROSITY,
83  METHOD_SETPRESSURE,
84  METHOD_SETPRINTCHEMISTRYON,
85  METHOD_SETPRINTCHEMISTRYMASK,
86  METHOD_SETREBALANCEBYCELL,
87  METHOD_SETREBALANCEFRACTION,
88  METHOD_SETREPRESENTATIVEVOLUME,
89  METHOD_SETSATURATION,
90  METHOD_SETSELECTEDOUTPUTON,
91  METHOD_SETSPECIESSAVEON,
92  METHOD_SETTEMPERATURE,
93  METHOD_SETTIME,
94  METHOD_SETTIMECONVERSION,
95  METHOD_SETTIMESTEP,
96  METHOD_SETUNITSEXCHANGE,
97  METHOD_SETUNITSGASPHASE,
98  METHOD_SETUNITSKINETICS,
99  METHOD_SETUNITSPPASSEMBLAGE,
100  METHOD_SETUNITSSOLUTION,
101  METHOD_SETUNITSSSASSEMBLAGE,
102  METHOD_SETUNITSSURFACE,
103  METHOD_SPECIESCONCENTRATIONS2MODULE,
104  METHOD_STATESAVE,
105  METHOD_STATEAPPLY,
106  METHOD_STATEDELETE,
107  METHOD_USESOLUTIONDENSITYVOLUME
108 } /* MPI_METHOD */;
109 
130 class IRM_DLL_EXPORT PhreeqcRM
131 {
132 public:
133  static void CleanupReactionModuleInstances(void);
134  static int CreateReactionModule(int nxyz, MP_TYPE nthreads);
135  static IRM_RESULT DestroyReactionModule(int n);
136  static PhreeqcRM * GetInstance(int n);
137 
178  PhreeqcRM(int nxyz, MP_TYPE thread_count_or_communicator, PHRQ_io * io=NULL);
179  ~PhreeqcRM(void);
195  IRM_RESULT CloseFiles(void);
242  IPhreeqc * Concentrations2Utility(std::vector<double> &c,
243  std::vector<double> tc, std::vector<double> p_atm);
279  IRM_RESULT CreateMapping(std::vector<int> &grid2chem);
313  void DecodeError(int result);
335  IRM_RESULT DumpModule(bool dump_on, bool append = false);
358  void ErrorHandler(int result, const std::string &e_string);
375  void ErrorMessage(const std::string &error_string, bool prepend = true);
455  int FindComponents();
481  const std::vector < std::vector <int> > & GetBackwardMapping(void) {return this->backward_mapping;}
504  int GetChemistryCellCount(void) const {return this->count_chemistry;}
524  int GetComponentCount(void) const {return (int) this->components.size();}
549 const std::vector<std::string> & GetComponents(void) const {return this->components;}
550 
589  IRM_RESULT GetConcentrations(std::vector<double> &c);
607  std::string GetDatabaseFileName(void) {return this->database_file_name;}
632  IRM_RESULT GetDensity(std::vector<double> & density);
668  const std::vector < int> & GetEndCell(void) const {return this->end_cell;}
698 const std::vector<std::string> & GetEquilibriumPhases(void) const { return this->EquilibriumPhasesList; }
726 int GetEquilibriumPhasesCount(void) const { return (int) this->EquilibriumPhasesList.size(); }
727 
728 
749  int GetErrorHandlerMode(void) {return this->error_handler_mode;}
768  std::string GetErrorString(void);
769 
805 const std::vector<std::string> & GetExchangeNames(void) const { return this->ExchangeNamesList; }
840 const std::vector<std::string> & GetExchangeSpecies(void) const { return this->ExchangeSpeciesNamesList; }
872 int GetExchangeSpeciesCount(void) const { return (int) this->ExchangeSpeciesNamesList.size(); }
873 
874 
892  std::string GetFilePrefix(void) {return this->file_prefix;}
913 const std::vector < int > & GetForwardMapping(void) {return this->forward_mapping_root;}
914 
944 const std::vector<std::string> & GetGasComponents(void) const { return this->GasComponentsList; }
972 int GetGasComponentsCount(void) const { return (int) this->GasComponentsList.size(); }
973 
1006 IRM_RESULT GetGasCompMoles(std::vector<double>& gas_moles);
1007 
1040 IRM_RESULT GetGasCompPressures(std::vector<double>& gas_pressure);
1041 
1075 IRM_RESULT GetGasCompPhi(std::vector<double>& gas_phi);
1076 
1108 IRM_RESULT GetGasPhaseVolume(std::vector<double>& gas_volume);
1109 
1136  const std::vector < double > & GetGfw(void) {return this->gfw;}
1158  int GetGridCellCount(void) {return this->nxyz;}
1185 IPhreeqc * GetIPhreeqcPointer(int i);
1186 
1216 const std::vector<std::string> & GetKineticReactions(void) const { return this->KineticReactionsList; }
1244 int GetKineticReactionsCount(void) const { return (int) this->KineticReactionsList.size(); }
1245 
1270  int GetMpiMyself(void) const {return this->mpi_myself;}
1296  int GetMpiTasks(void) const {return this->mpi_tasks;}
1334  int GetNthSelectedOutputUserNumber(int n);
1367  bool GetPartitionUZSolids(void) const {return this->partition_uz_solids;}
1368 #ifdef USE_RV
1369 
1389  std::vector<double> & GetPoreVolume(void) {return this->pore_volume;}
1390 #endif
1391 
1412  const std::vector<double> & GetPressure(void);
1433  const std::vector<int> & GetPrintChemistryMask (void) {return this->print_chem_mask_root;}
1462  const std::vector <bool> & GetPrintChemistryOn(void) const {return this->print_chemistry_on;}
1486  bool GetRebalanceByCell(void) const {return this->rebalance_by_cell;}
1511  double GetRebalanceFraction(void) const {return this->rebalance_fraction;}
1542 IRM_RESULT GetSaturation(std::vector<double> & sat);
1574  IRM_RESULT GetSelectedOutput(std::vector<double> &so);
1613  int GetSelectedOutputColumnCount(void);
1640  int GetSelectedOutputCount(void);
1677  IRM_RESULT GetSelectedOutputHeading(int icol, std::string &heading);
1696  bool GetSelectedOutputOn(void) {return this->selected_output_on;}
1736 int GetSelectedOutputRowCount(void);
1737 
1764 int GetSICount(void) const { return (int) this->SINamesList.size(); }
1798 const std::vector<std::string> & GetSINames(void) const { return this->SINamesList; }
1799 
1835 const std::vector<std::string> & GetSolidSolutionComponents(void) const { return this->SolidSolutionComponentsList; }
1868 int GetSolidSolutionComponentsCount(void) const { return (int) this->SolidSolutionComponentsList.size(); }
1869 
1906 const std::vector<std::string> & GetSolidSolutionNames(void) const { return this->SolidSolutionNamesList; }
1907 
1928  const std::vector<double> & GetSolutionVolume(void);
1974  IRM_RESULT GetSpeciesConcentrations(std::vector<double> & species_conc);
2006  int GetSpeciesCount(void) {return (int) this->species_names.size();}
2041  const std::vector<double> & GetSpeciesD25(void) {return this->species_d_25;}
2083  IRM_RESULT GetSpeciesLog10Gammas(std::vector<double> & species_log10gammas);
2084 
2125 IRM_RESULT GetSpeciesLog10Molalities(std::vector<double>& species_log10molalities);
2126 
2160  const std::vector<std::string> & GetSpeciesNames(void) {return this->species_names;}
2198  bool GetSpeciesSaveOn(void) {return this->species_save_on;}
2199 
2249  const std::vector<cxxNameDouble> & GetSpeciesStoichiometry(void) {return this->species_stoichiometry;}
2281  const std::vector<double> & GetSpeciesZ(void) {return this->species_z;}
2316 const std::vector < int> & GetStartCell(void) const {return this->start_cell;}
2317 
2354 const std::vector<std::string> & GetSurfaceNames(void) const { return this->SurfaceNamesList; }
2355 
2391 const std::vector<std::string> & GetSurfaceSpecies(void) const { return this->SurfaceSpeciesNamesList; }
2392 
2425 int GetSurfaceSpeciesCount(void) const { return (int) this->SurfaceSpeciesNamesList.size(); }
2426 
2427 
2465 const std::vector<std::string> & GetSurfaceTypes(void) const { return this->SurfaceTypesList; }
2466 
2487  //const std::vector<double> & GetTemperature(void) {return this->tempc;}
2488  const std::vector<double> & GetTemperature(void);
2509  int GetThreadCount() {return this->nthreads;}
2532  double GetTime(void) const {return this->time;}
2557  double GetTimeConversion(void) {return this->time_conversion;}
2581  double GetTimeStep(void) {return this->time_step;}
2606  int GetUnitsExchange(void) {return this->units_Exchange;}
2631  int GetUnitsGasPhase(void) {return this->units_GasPhase;}
2656  int GetUnitsKinetics(void) {return this->units_Kinetics;}
2681  int GetUnitsPPassemblage(void) {return this->units_PPassemblage;}
2735  int GetUnitsSolution(void) {return this->units_Solution;}
2760  int GetUnitsSSassemblage(void) {return this->units_SSassemblage;}
2785  int GetUnitsSurface(void) {return this->units_Surface;}
2808  const std::vector<IPhreeqcPhast *> & GetWorkers() {return this->workers;}
2836  IRM_RESULT InitialPhreeqc2Concentrations(
2837  std::vector < double > & destination_c,
2838  std::vector < int > & boundary_solution1);
2877  IRM_RESULT InitialPhreeqc2Concentrations(
2878  std::vector < double > & destination_c,
2879  std::vector < int > & boundary_solution1,
2880  std::vector < int > & boundary_solution2,
2881  std::vector < double > & fraction1);
2922  IRM_RESULT InitialPhreeqc2Module(std::vector < int > & initial_conditions1);
2985  IRM_RESULT InitialPhreeqc2Module(
2986  std::vector < int > & initial_conditions1,
2987  std::vector < int > & initial_conditions2,
2988  std::vector < double > & fraction1);
3018  IRM_RESULT InitialPhreeqc2SpeciesConcentrations(
3019  std::vector < double > & destination_c,
3020  std::vector < int > & boundary_solution1);
3060  IRM_RESULT InitialPhreeqc2SpeciesConcentrations(
3061  std::vector < double > & destination_c,
3062  std::vector < int > & boundary_solution1,
3063  std::vector < int > & boundary_solution2,
3064  std::vector < double > & fraction1);
3091  IRM_RESULT InitialPhreeqcCell2Module(int n, const std::vector<int> &cell_numbers);
3108  IRM_RESULT LoadDatabase(const std::string &database);
3127  void LogMessage(const std::string &str);
3142  int MpiAbort();
3188  IRM_RESULT MpiWorker();
3210  IRM_RESULT MpiWorkerBreak();
3229  IRM_RESULT OpenFiles(void);
3255  void OutputMessage(const std::string &str);
3288  IRM_RESULT RunCells(void);
3309  IRM_RESULT ReturnHandler(IRM_RESULT result, const std::string &e_string);
3334  IRM_RESULT RunFile(bool workers, bool initial_phreeqc, bool utility, const std::string & chemistry_name);
3361  IRM_RESULT RunString(bool workers, bool initial_phreeqc, bool utility, const std::string & input_string);
3384  void ScreenMessage(const std::string &str);
3413  IRM_RESULT SetComponentH2O(bool tf);
3451  IRM_RESULT SetConcentrations(const std::vector<double> &c);
3483  IRM_RESULT SetCurrentSelectedOutputUserNumber(int n_user);
3508  IRM_RESULT SetDensity(const std::vector<double> &density);
3528  IRM_RESULT SetDumpFileName(const std::string & dump_name);
3549  IRM_RESULT SetErrorHandlerMode(int mode);
3569  IRM_RESULT SetErrorOn(bool tf);
3588  IRM_RESULT SetFilePrefix(const std::string & prefix);
3589 
3625 IRM_RESULT SetGasCompMoles(const std::vector<double>& gas_moles);
3664 IRM_RESULT SetGasPhaseVolume(const std::vector<double>& gas_volume);
3665 
3761  IRM_RESULT SetMpiWorkerCallbackC(int (*fcn)(int *method, void * cookie));
3832  IRM_RESULT SetMpiWorkerCallbackCookie(void * cookie);
3837  IRM_RESULT SetMpiWorkerCallbackFortran(int (*fcn)(int *method));
3873  IRM_RESULT SetPartitionUZSolids(bool tf);
3896  IRM_RESULT SetPorosity(const std::vector<double> &por);
3897 
3918  IRM_RESULT SetPressure(const std::vector<double> &p);
3945  IRM_RESULT SetPrintChemistryMask(std::vector<int> & cell_mask);
3980  IRM_RESULT SetPrintChemistryOn(bool workers, bool initial_phreeqc, bool utility);
4005  IRM_RESULT SetRebalanceByCell(bool tf);
4034  IRM_RESULT SetRebalanceFraction(double f);
4066  IRM_RESULT SetRepresentativeVolume(const std::vector<double> &rv);
4095  IRM_RESULT SetSaturation(const std::vector<double> &sat);
4115  IRM_RESULT SetScreenOn(bool tf);
4137  IRM_RESULT SetSelectedOutputOn(bool tf);
4173  IRM_RESULT SetSpeciesSaveOn(bool save_on);
4199  IRM_RESULT SetTemperature(const std::vector<double> &t);
4217  IRM_RESULT SetTime(double time);
4236  IRM_RESULT SetTimeConversion(double conv_factor);
4256  IRM_RESULT SetTimeStep(double time_step);
4289  IRM_RESULT SetUnitsExchange(int option);
4323  IRM_RESULT SetUnitsGasPhase(int option);
4371  IRM_RESULT SetUnitsKinetics(int option);
4404  IRM_RESULT SetUnitsPPassemblage(int option);
4456  IRM_RESULT SetUnitsSolution(int option);
4489  IRM_RESULT SetUnitsSSassemblage(int option);
4522  IRM_RESULT SetUnitsSurface(int option);
4570 IRM_RESULT SpeciesConcentrations2Module(std::vector<double> & species_conc);
4571 
4601 IRM_RESULT StateSave(int istate);
4631 IRM_RESULT StateApply(int istate);
4653 IRM_RESULT StateDelete(int istate);
4689 void UseSolutionDensityVolume(bool tf);
4706  void WarningMessage(const std::string &warnstr);
4707 
4708  // Utilities
4709  static std::string Char2TrimString(const char * str, size_t l = 0);
4710  static bool FileExists(const std::string &name);
4711  static void FileRename(const std::string &temp_name, const std::string &name,
4712  const std::string &backup_name);
4713  static IRM_RESULT Int2IrmResult(int r, bool positive_ok);
4714 protected:
4715  IRM_RESULT CellInitialize(
4716  int i,
4717  int n_user_new,
4718  int *initial_conditions1,
4719  int *initial_conditions2,
4720  double *fraction1,
4721  std::set<std::string> &error_set);
4722  IRM_RESULT CheckCells();
4723  int CheckSelectedOutput();
4724  //void Collapse2Nchem(double *d_in, double *d_out);
4725  //void Collapse2Nchem(int *i_in, int *i_out);
4726  IPhreeqc * Concentrations2UtilityH2O(std::vector<double> &c_in,
4727  std::vector<double> &t_in, std::vector<double> &p_in);
4728  IPhreeqc * Concentrations2UtilityNoH2O(std::vector<double> &c_in,
4729  std::vector<double> &t_in, std::vector<double> &p_in);
4730  void Concentrations2Solutions(int n, std::vector<double> &c);
4731  void Concentrations2SolutionsH2O(int n, std::vector<double> &c);
4732  void Concentrations2SolutionsNoH2O(int n, std::vector<double> &c);
4733  void cxxSolution2concentration(cxxSolution * cxxsoln_ptr, std::vector<double> & d, double v, double dens);
4734  void cxxSolution2concentrationH2O(cxxSolution * cxxsoln_ptr, std::vector<double> & d, double v, double dens);
4735  void cxxSolution2concentrationNoH2O(cxxSolution * cxxsoln_ptr, std::vector<double> & d, double v, double dens);
4736  void GatherNchem(std::vector<double> &source, std::vector<double> &destination);
4737  cxxStorageBin & Get_phreeqc_bin(void) {return *this->phreeqc_bin;}
4738  IRM_RESULT HandleErrorsInternal(std::vector< int > & r);
4739  void PartitionUZ(int n, int iphrq, int ihst, double new_frac);
4740  void RebalanceLoad(void);
4741  void RebalanceLoadPerCell(void);
4742  IRM_RESULT RunCellsThread(int i);
4743  IRM_RESULT RunFileThread(int n);
4744  IRM_RESULT RunStringThread(int n, std::string & input);
4745  IRM_RESULT RunCellsThreadNoPrint(int n);
4746  void Scale_solids(int n, int iphrq, double frac);
4747  void ScatterNchem(double *d_array);
4748  void ScatterNchem(int *i_array);
4749  void ScatterNchem(std::vector<double> &source, std::vector<double> &destination);
4750  void ScatterNchem(std::vector<int> &source, std::vector<int> &destination);
4751  IRM_RESULT SetChemistryFileName(const char * prefix = NULL);
4752  IRM_RESULT SetDatabaseFileName(const char * db = NULL);
4753  void SetEndCells(void);
4754  void SetEndCellsHeterogeneous(void);
4755  double TimeStandardTask(void);
4756  IRM_RESULT TransferCells(cxxStorageBin &t_bin, int old, int nnew);
4757  IRM_RESULT TransferCellsUZ(std::ostringstream &raw_stream, int old, int nnew);
4758 
4759 private:
4760  //IRM_RESULT SetGeneric(std::vector<double> &destination, int newSize, const std::vector<double> &origin, int mpiMethod, const std::string &name, const double newValue = 0.0);
4761  IRM_RESULT SetGeneric(const std::vector<double> &source, std::vector<double> &destination_root, std::vector<double> &destination_worker, int mpiMethod, const std::string &name);
4762 protected:
4763 
4764 #if defined(_MSC_VER)
4765 /* disable warning C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' */
4766 #pragma warning(disable:4251)
4767 #endif
4768 
4769  bool component_h2o; // true: use H2O, excess H, excess O, and charge;
4770  // false total H, total O, and charge
4771  std::string database_file_name;
4772  std::string chemistry_file_name;
4773  std::string dump_file_name;
4774  std::string file_prefix;
4775  cxxStorageBin * phreeqc_bin;
4776  int mpi_myself;
4777  int mpi_tasks;
4778  std::vector <std::string> components; // list of components to be transported
4779  std::vector <double> gfw; // gram formula weights converting mass to moles (1 for each component)
4780  double gfw_water; // gfw of water
4781  bool partition_uz_solids;
4782  int nxyz; // number of nodes
4783  int count_chemistry; // number of cells for chemistry
4784  double time; // time from transport, sec
4785  double time_step; // time step from transport, sec
4786  double time_conversion; // time conversion factor, multiply to convert to preferred time unit for output
4787  std::vector <double> old_saturation_root; // saturation fraction from previous step
4788  std::vector <double> old_saturation_worker;
4789  std::vector<double> saturation_root; // nxyz saturation fraction
4790  std::vector<double> saturation_worker; // nchem on workers saturation fraction
4791  std::vector<double> pressure_root; // nxyz on root current pressure
4792  std::vector<double> pressure_worker; // nchem on workers current pressure
4793  std::vector<double> rv_root; // nxyz on root representative volume
4794  std::vector<double> rv_worker; // nchem on workers representative volume
4795  std::vector<double> porosity_root; // nxyz porosity
4796  std::vector<double> porosity_worker; // nchem on workers porosity
4797  std::vector<double> tempc_root; // nxyz on root temperature Celsius
4798  std::vector<double> tempc_worker; // nchem on workers temperature Celsius
4799  std::vector<double> density_root; // nxyz density
4800  std::vector<double> density_worker; // nchem on workers density
4801  std::vector<double> solution_volume_root; // nxyz on root solution volume
4802  std::vector<double> solution_volume_worker; // nchem on workers solution_volume
4803  std::vector<int> print_chem_mask_root; // nxyz print flags for output file
4804  std::vector<int> print_chem_mask_worker; // nchem print flags for output file
4805  bool rebalance_by_cell; // rebalance method 0 std, 1 by_cell
4806  double rebalance_fraction; // parameter for rebalancing process load for parallel
4807  int units_Solution; // 1 mg/L, 2 mol/L, 3 kg/kgs
4808  int units_PPassemblage; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4809  int units_Exchange; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4810  int units_Surface; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4811  int units_GasPhase; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4812  int units_SSassemblage; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4813  int units_Kinetics; // 0, mol/L cell; 1, mol/L water; 2 mol/L rock
4814  std::vector <int> forward_mapping_root; // mapping from nxyz cells to count_chem chemistry cells
4815  std::vector <std::vector <int> > backward_mapping; // mapping from count_chem chemistry cells to nxyz cells
4816  bool use_solution_density_volume;
4817 
4818  // print flags
4819  std::vector<bool> print_chemistry_on; // print flag for chemistry output file
4820  bool selected_output_on; // create selected output
4821 
4822  int error_count;
4823  int error_handler_mode; // 0, return code; 1, throw; 2 exit;
4824  bool need_error_check;
4825  std::string phreeqcrm_error_string;
4826 
4827  // threading
4828  int nthreads;
4829  std::vector<IPhreeqcPhast *> workers;
4830  std::vector<int> start_cell;
4831  std::vector<int> end_cell;
4832  PHRQ_io *phreeqcrm_io;
4833  bool delete_phreeqcrm_io;
4834 
4835  // mpi
4836 #ifdef USE_MPI
4837  MPI_Comm phreeqcrm_comm; // MPI communicator
4838 #endif
4839  int (*mpi_worker_callback_fortran) (int *method);
4840  int (*mpi_worker_callback_c) (int *method, void *cookie);
4841  void *mpi_worker_callback_cookie;
4842 
4843  // mcd
4844  bool species_save_on;
4845  std::vector <std::string> species_names;
4846  std::vector <double> species_z;
4847  std::vector <double> species_d_25;
4848  std::vector <cxxNameDouble> species_stoichiometry;
4849  std::map<int, int> s_num2rm_species_num;
4850  std::vector<double> standard_task_vector; // root only
4851 
4852  // reactant lists
4853  std::vector <std::string> ExchangeSpeciesNamesList;
4854  std::vector <std::string> ExchangeNamesList;
4855  std::vector <std::string> SurfaceSpeciesNamesList;
4856  std::vector <std::string> SurfaceTypesList;
4857  std::vector <std::string> SurfaceNamesList;
4858 
4859  std::vector <std::string> EquilibriumPhasesList;
4860  std::vector <std::string> GasComponentsList;
4861  std::vector <std::string> KineticReactionsList;
4862  std::vector <std::string> SolidSolutionComponentsList;
4863  std::vector <std::string> SolidSolutionNamesList;
4864  std::vector <std::string> SINamesList;
4865 
4866 private:
4867  //friend class RM_interface;
4868  static std::map<size_t, PhreeqcRM*> Instances;
4869  static size_t InstancesIndex;
4870 
4871 #if defined(_MSC_VER)
4872 /* reset warning C4251 */
4873 #pragma warning(default:4251)
4874 #endif
4875 
4876 };
4877 #endif // !defined(PHREEQCRM_H_INCLUDED)
int GetUnitsExchange(void)
Definition: PhreeqcRM.h:2606
const std::vector< std::vector< int > > & GetBackwardMapping(void)
Definition: PhreeqcRM.h:481
int GetUnitsGasPhase(void)
Definition: PhreeqcRM.h:2631
int GetUnitsSurface(void)
Definition: PhreeqcRM.h:2785
int GetSICount(void) const
Definition: PhreeqcRM.h:1764
int GetGridCellCount(void)
Definition: PhreeqcRM.h:1158
std::string GetFilePrefix(void)
Definition: PhreeqcRM.h:892
int GetChemistryCellCount(void) const
Definition: PhreeqcRM.h:504
int GetUnitsSolution(void)
Definition: PhreeqcRM.h:2735
int GetSurfaceSpeciesCount(void) const
Definition: PhreeqcRM.h:2425
const std::vector< double > & GetSpeciesZ(void)
Definition: PhreeqcRM.h:2281
const std::vector< std::string > & GetSurfaceSpecies(void) const
Definition: PhreeqcRM.h:2391
bool GetSelectedOutputOn(void)
Definition: PhreeqcRM.h:1696
const std::vector< std::string > & GetSpeciesNames(void)
Definition: PhreeqcRM.h:2160
const std::vector< std::string > & GetSurfaceNames(void) const
Definition: PhreeqcRM.h:2354
Geochemical reaction module.
Definition: PhreeqcRM.h:130
std::string GetDatabaseFileName(void)
Definition: PhreeqcRM.h:607
const std::vector< std::string > & GetSolidSolutionComponents(void) const
Definition: PhreeqcRM.h:1835
int GetUnitsSSassemblage(void)
Definition: PhreeqcRM.h:2760
double GetTimeStep(void)
Definition: PhreeqcRM.h:2581
int GetErrorHandlerMode(void)
Definition: PhreeqcRM.h:749
int GetSpeciesCount(void)
Definition: PhreeqcRM.h:2006
const std::vector< int > & GetForwardMapping(void)
Definition: PhreeqcRM.h:913
const std::vector< std::string > & GetSolidSolutionNames(void) const
Definition: PhreeqcRM.h:1906
const std::vector< int > & GetStartCell(void) const
Definition: PhreeqcRM.h:2316
const std::vector< std::string > & GetKineticReactions(void) const
Definition: PhreeqcRM.h:1216
const std::vector< std::string > & GetEquilibriumPhases(void) const
Definition: PhreeqcRM.h:698
double GetRebalanceFraction(void) const
Definition: PhreeqcRM.h:1511
This class is derived from std::exception and is thrown when an unrecoverable error has occurred...
Definition: PhreeqcRM.h:39
int GetKineticReactionsCount(void) const
Definition: PhreeqcRM.h:1244
const std::vector< double > & GetSpeciesD25(void)
Definition: PhreeqcRM.h:2041
int GetGasComponentsCount(void) const
Definition: PhreeqcRM.h:972
const std::vector< int > & GetPrintChemistryMask(void)
Definition: PhreeqcRM.h:1433
const std::vector< std::string > & GetExchangeSpecies(void) const
Definition: PhreeqcRM.h:840
int GetSolidSolutionComponentsCount(void) const
Definition: PhreeqcRM.h:1868
int GetMpiMyself(void) const
Definition: PhreeqcRM.h:1270
int GetEquilibriumPhasesCount(void) const
Definition: PhreeqcRM.h:726
bool GetSpeciesSaveOn(void)
Definition: PhreeqcRM.h:2198
const std::vector< double > & GetGfw(void)
Definition: PhreeqcRM.h:1136
double GetTime(void) const
Definition: PhreeqcRM.h:2532
IRM_RESULT
Enumeration for PhreeqcRM function return codes.
Definition: IrmResult.h:8
const std::vector< int > & GetEndCell(void) const
Definition: PhreeqcRM.h:668
const std::vector< std::string > & GetSurfaceTypes(void) const
Definition: PhreeqcRM.h:2465
const std::vector< std::string > & GetGasComponents(void) const
Definition: PhreeqcRM.h:944
const std::vector< std::string > & GetComponents(void) const
Definition: PhreeqcRM.h:549
int GetExchangeSpeciesCount(void) const
Definition: PhreeqcRM.h:872
int GetComponentCount(void) const
Definition: PhreeqcRM.h:524
int GetUnitsPPassemblage(void)
Definition: PhreeqcRM.h:2681
const std::vector< std::string > & GetSINames(void) const
Definition: PhreeqcRM.h:1798
double GetTimeConversion(void)
Definition: PhreeqcRM.h:2557
Enumeration used to return error codes.
bool GetRebalanceByCell(void) const
Definition: PhreeqcRM.h:1486
const std::vector< bool > & GetPrintChemistryOn(void) const
Definition: PhreeqcRM.h:1462
const std::vector< IPhreeqcPhast * > & GetWorkers()
Definition: PhreeqcRM.h:2808
int GetThreadCount()
Definition: PhreeqcRM.h:2509
const std::vector< cxxNameDouble > & GetSpeciesStoichiometry(void)
Definition: PhreeqcRM.h:2249
int GetMpiTasks(void) const
Definition: PhreeqcRM.h:1296
const std::vector< std::string > & GetExchangeNames(void) const
Definition: PhreeqcRM.h:805
int GetUnitsKinetics(void)
Definition: PhreeqcRM.h:2656
bool GetPartitionUZSolids(void) const
Definition: PhreeqcRM.h:1367