PhreeqcRM
RM_interface_C.h
Go to the documentation of this file.
1 
4 #ifdef USE_MPI
5 #include "mpi.h"
6 #endif
7 #include "IrmResult.h"
8 #ifndef RM_INTERFACE_C_H
9 #define RM_INTERFACE_C_H
10 
11 #if defined(_WINDLL)
12 #define IRM_DLL_EXPORT __declspec(dllexport)
13 #else
14 #define IRM_DLL_EXPORT
15 #endif
16 
17 #if defined(__cplusplus)
18 extern "C" {
19 #endif
20 
47 IRM_DLL_EXPORT IRM_RESULT RM_Abort(int id, int result, const char * err_str);
66 IRM_DLL_EXPORT IRM_RESULT RM_CloseFiles(int id);
106 IRM_DLL_EXPORT int RM_Concentrations2Utility(int id, double *c, int n, double *tc, double *p_atm);
147 #ifdef USE_MPI
148 IRM_DLL_EXPORT int RM_Create(int nxyz, MPI_Comm comm);
149 #else
150 IRM_DLL_EXPORT int RM_Create(int nxyz, int nthreads);
151 #endif
152 
183 IRM_DLL_EXPORT IRM_RESULT RM_CreateMapping (int id, int *grid2chem);
218 IRM_DLL_EXPORT IRM_RESULT RM_DecodeError (int id, int e);
236 IRM_DLL_EXPORT IRM_RESULT RM_Destroy(int id);
259 IRM_DLL_EXPORT IRM_RESULT RM_DumpModule(int id, int dump_on, int append);
283 IRM_DLL_EXPORT IRM_RESULT RM_ErrorMessage(int id, const char *errstr);
356 IRM_DLL_EXPORT int RM_FindComponents(int id);
390 IRM_DLL_EXPORT IRM_RESULT RM_GetBackwardMapping(int id, int n, int *list, int *size);
412 IRM_DLL_EXPORT int RM_GetChemistryCellCount(int id);
441 IRM_DLL_EXPORT IRM_RESULT RM_GetComponent(int id, int num, char *chem_name, int l);
462 IRM_DLL_EXPORT int RM_GetComponentCount(int id);
463 
512 IRM_DLL_EXPORT IRM_RESULT RM_GetConcentrations(int id, double *c);
537 IRM_DLL_EXPORT IRM_RESULT RM_GetDensity(int id, double *density);
538 
539 
564 IRM_DLL_EXPORT IRM_RESULT RM_GetEndCell(int id, int *ec);
592 IRM_DLL_EXPORT int RM_GetEquilibriumPhasesCount(int id);
624 IRM_DLL_EXPORT IRM_RESULT RM_GetEquilibriumPhasesName(int id, int num, char *name, int l1);
654 IRM_DLL_EXPORT IRM_RESULT RM_GetErrorString(int id, char *errstr, int l);
679 IRM_DLL_EXPORT int RM_GetErrorStringLength(int id);
712 IRM_DLL_EXPORT IRM_RESULT RM_GetExchangeName(int id, int num, char *name, int l1);
740 IRM_DLL_EXPORT int RM_GetExchangeSpeciesCount(int id);
774 IRM_DLL_EXPORT IRM_RESULT RM_GetExchangeSpeciesName(int id, int num, char *name, int l1);
799 IRM_DLL_EXPORT IRM_RESULT RM_GetFilePrefix(int id, char *prefix, int l);
827 IRM_DLL_EXPORT int RM_GetGasComponentsCount(int id);
859 IRM_DLL_EXPORT IRM_RESULT RM_GetGasComponentsName(int id, int num, char *name, int l1);
896 IRM_DLL_EXPORT IRM_RESULT RM_GetGasCompMoles(int id, double* gas_moles);
933 IRM_DLL_EXPORT IRM_RESULT RM_GetGasCompPressures(int id, double* gas_pressure);
971 IRM_DLL_EXPORT IRM_RESULT RM_GetGasCompPhi(int id, double* gas_phi);
1006 IRM_DLL_EXPORT IRM_RESULT RM_GetGasPhaseVolume(int id, double* gas_volume);
1038 IRM_DLL_EXPORT IRM_RESULT RM_GetGfw(int id, double * gfw);
1062 IRM_DLL_EXPORT int RM_GetGridCellCount(int id);
1096 IRM_DLL_EXPORT int RM_GetIPhreeqcId(int id, int i);
1124 IRM_DLL_EXPORT int RM_GetKineticReactionsCount(int id);
1156 IRM_DLL_EXPORT IRM_RESULT RM_GetKineticReactionsName(int id, int num, char *name, int l1);
1181 IRM_DLL_EXPORT int RM_GetMpiMyself(int id);
1210 IRM_DLL_EXPORT int RM_GetMpiTasks(int id);
1254 IRM_DLL_EXPORT int RM_GetNthSelectedOutputUserNumber(int id, int n);
1255 
1291 IRM_DLL_EXPORT IRM_RESULT RM_GetSaturation(int id, double *sat_calc);
1292 
1329 IRM_DLL_EXPORT IRM_RESULT RM_GetSelectedOutput(int id, double *so);
1330 
1364 IRM_DLL_EXPORT int RM_GetSelectedOutputColumnCount(int id);
1398 IRM_DLL_EXPORT int RM_GetSelectedOutputCount(int id);
1438 IRM_DLL_EXPORT IRM_RESULT RM_GetSelectedOutputHeading(int id, int icol, char * heading, int length);
1483 IRM_DLL_EXPORT int RM_GetSelectedOutputRowCount(int id);
1512 IRM_DLL_EXPORT int RM_GetSICount(int id);
1546 IRM_DLL_EXPORT IRM_RESULT RM_GetSIName(int id, int num, char *name, int l1);
1547 
1575 IRM_DLL_EXPORT int RM_GetSolidSolutionComponentsCount(int id);
1608 IRM_DLL_EXPORT IRM_RESULT RM_GetSolidSolutionComponentsName(int id, int num, char *name, int l1);
1643 IRM_DLL_EXPORT IRM_RESULT RM_GetSolidSolutionName(int id, int num, char *name, int l1);
1644 
1672 IRM_DLL_EXPORT IRM_RESULT RM_GetSolutionVolume(int id, double *vol);
1722 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesConcentrations(int id, double *species_conc);
1762 IRM_DLL_EXPORT int RM_GetSpeciesCount(int id);
1803 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesD25(int id, double *diffc);
1848 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesLog10Gammas(int id, double *species_log10gammas);
1892 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesLog10Molalities(int id, double* species_log10molalities);
1938 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesName(int id, int i, char * name, int length);
1979 IRM_DLL_EXPORT int RM_GetSpeciesSaveOn(int id);
2017 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesZ(int id, double *z);
2018 
2043 IRM_DLL_EXPORT IRM_RESULT RM_GetStartCell(int id, int *sc);
2076 IRM_DLL_EXPORT IRM_RESULT RM_GetSurfaceName(int id, int num, char *name, int l1);
2104 IRM_DLL_EXPORT int RM_GetSurfaceSpeciesCount(int id);
2138 IRM_DLL_EXPORT IRM_RESULT RM_GetSurfaceSpeciesName(int id, int num, char *name, int l1);
2171 IRM_DLL_EXPORT IRM_RESULT RM_GetSurfaceType(int id, int num, char *name, int l1);
2192 IRM_DLL_EXPORT int RM_GetThreadCount(int id);
2217 IRM_DLL_EXPORT double RM_GetTime(int id);
2245 IRM_DLL_EXPORT double RM_GetTimeConversion(int id);
2272 IRM_DLL_EXPORT double RM_GetTimeStep(int id);
2324  int id,
2325  double *c,
2326  int n_boundary,
2327  int *boundary_solution1,
2328  int *boundary_solution2,
2329  double *fraction1);
2409 IRM_DLL_EXPORT IRM_RESULT RM_InitialPhreeqc2Module(int id,
2410  int *initial_conditions1, // 7 x nxyz end-member 1
2411  int *initial_conditions2, // 7 x nxyz end-member 2
2412  double *fraction1); // 7 x nxyz fraction of end-member 1
2413 
2469  int id,
2470  double *species_c,
2471  int n_boundary,
2472  int *boundary_solution1,
2473  int *boundary_solution2,
2474  double *fraction1);
2506 IRM_DLL_EXPORT IRM_RESULT RM_InitialPhreeqcCell2Module(int id,
2507  int n, // InitialPhreeqc cell number
2508  int *module_numbers, // Module cell numbers
2509  int dim_module_numbers); // Number of module cell numbers
2510 
2531 IRM_DLL_EXPORT IRM_RESULT RM_LoadDatabase(int id, const char *db_name);
2557 IRM_DLL_EXPORT IRM_RESULT RM_LogMessage(int id, const char *str);
2594 IRM_DLL_EXPORT IRM_RESULT RM_MpiWorker(int id);
2620 IRM_DLL_EXPORT IRM_RESULT RM_MpiWorkerBreak(int id);
2646 IRM_DLL_EXPORT IRM_RESULT RM_OpenFiles(int id);
2682 IRM_DLL_EXPORT IRM_RESULT RM_OutputMessage(int id, const char *str);
2719 IRM_DLL_EXPORT IRM_RESULT RM_RunCells(int id);
2746 IRM_DLL_EXPORT IRM_RESULT RM_RunFile(int id, int workers, int initial_phreeqc, int utility, const char *chem_name);
2775 IRM_DLL_EXPORT IRM_RESULT RM_RunString(int id, int workers, int initial_phreeqc, int utility, const char * input_string);
2799 IRM_DLL_EXPORT IRM_RESULT RM_ScreenMessage(int id, const char *str);
2830 IRM_DLL_EXPORT IRM_RESULT RM_SetComponentH2O(int id, int tf);
2876 IRM_DLL_EXPORT IRM_RESULT RM_SetConcentrations(int id, double *c);
2913 IRM_DLL_EXPORT IRM_RESULT RM_SetCurrentSelectedOutputUserNumber(int id, int n_user);
2947 IRM_DLL_EXPORT IRM_RESULT RM_SetDensity(int id, double *density);
2969 IRM_DLL_EXPORT IRM_RESULT RM_SetDumpFileName(int id, const char *dump_name);
2990 IRM_DLL_EXPORT IRM_RESULT RM_SetErrorHandlerMode(int id, int mode);
3013 IRM_DLL_EXPORT IRM_RESULT RM_SetErrorOn(int id, int tf);
3035 IRM_DLL_EXPORT IRM_RESULT RM_SetFilePrefix(int id, const char *prefix);
3036 
3073 IRM_DLL_EXPORT IRM_RESULT RM_SetGasCompMoles(int id, double* gas_moles);
3074 
3113 IRM_DLL_EXPORT IRM_RESULT RM_SetGasPhaseVolume(int id, double* gas_volume);
3114 
3115 
3213 IRM_DLL_EXPORT IRM_RESULT RM_SetMpiWorkerCallback(int id, int (*fcn)(int *x1, void *cookie));
3284 IRM_DLL_EXPORT IRM_RESULT RM_SetMpiWorkerCallbackCookie(int id, void *cookie);
3322 IRM_DLL_EXPORT IRM_RESULT RM_SetPartitionUZSolids(int id, int tf);
3348 IRM_DLL_EXPORT IRM_RESULT RM_SetPorosity(int id, double *por);
3371 IRM_DLL_EXPORT IRM_RESULT RM_SetPressure(int id, double *p);
3402 IRM_DLL_EXPORT IRM_RESULT RM_SetPrintChemistryMask(int id, int *cell_mask);
3436 IRM_DLL_EXPORT IRM_RESULT RM_SetPrintChemistryOn(int id, int workers, int initial_phreeqc, int utility);
3437 
3466 IRM_DLL_EXPORT IRM_RESULT RM_SetRebalanceByCell(int id, int method);
3497 IRM_DLL_EXPORT IRM_RESULT RM_SetRebalanceFraction(int id, double f);
3535 IRM_DLL_EXPORT IRM_RESULT RM_SetRepresentativeVolume(int id, double *rv);
3570 IRM_DLL_EXPORT IRM_RESULT RM_SetSaturation(int id, double *sat);
3593 IRM_DLL_EXPORT IRM_RESULT RM_SetScreenOn(int id, int tf);
3619 IRM_DLL_EXPORT IRM_RESULT RM_SetSelectedOutputOn(int id, int selected_output);
3656 IRM_DLL_EXPORT IRM_RESULT RM_SetSpeciesSaveOn(int id, int save_on);
3687 IRM_DLL_EXPORT IRM_RESULT RM_SetTemperature(int id, double *t);
3707 IRM_DLL_EXPORT IRM_RESULT RM_SetTime(int id, double time);
3727 IRM_DLL_EXPORT IRM_RESULT RM_SetTimeConversion(int id, double conv_factor);
3749 IRM_DLL_EXPORT IRM_RESULT RM_SetTimeStep(int id, double time_step);
3787 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsExchange(int id, int option);
3825 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsGasPhase(int id, int option);
3878 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsKinetics(int id, int option);
3916 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsPPassemblage(int id, int option);
3973 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSolution(int id, int option);
4011 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSSassemblage(int id, int option);
4049 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSurface(int id, int option);
4097 IRM_DLL_EXPORT IRM_RESULT RM_SpeciesConcentrations2Module(int id, double * species_conc);
4128 IRM_DLL_EXPORT IRM_RESULT RM_StateSave(int id, int istate);
4159 IRM_DLL_EXPORT IRM_RESULT RM_StateApply(int id, int istate);
4182 IRM_DLL_EXPORT IRM_RESULT RM_StateDelete(int id, int istate);
4223 IRM_DLL_EXPORT IRM_RESULT RM_UseSolutionDensityVolume(int id, int tf);
4246 IRM_DLL_EXPORT IRM_RESULT RM_WarningMessage(int id, const char *warn_str);
4247 
4248 #if defined(__cplusplus)
4249 }
4250 #endif
4251 
4252 #endif // RM_INTERFACE_C_H
IRM_RESULT RM_SetTemperature(int id, double *t)
IRM_RESULT RM_SpeciesConcentrations2Module(int id, double *species_conc)
IRM_RESULT RM_GetGasCompPressures(int id, double *gas_pressure)
IRM_RESULT RM_SetSelectedOutputOn(int id, int selected_output)
IRM_RESULT RM_SetDumpFileName(int id, const char *dump_name)
IRM_RESULT RM_GetStartCell(int id, int *sc)
IRM_RESULT RM_ScreenMessage(int id, const char *str)
IRM_RESULT RM_Abort(int id, int result, const char *err_str)
IRM_RESULT RM_GetEndCell(int id, int *ec)
IRM_RESULT RM_SetRepresentativeVolume(int id, double *rv)
int RM_GetSICount(int id)
IRM_RESULT RM_MpiWorker(int id)
IRM_RESULT RM_SetErrorHandlerMode(int id, int mode)
int RM_GetGridCellCount(int id)
IRM_RESULT RM_SetPrintChemistryOn(int id, int workers, int initial_phreeqc, int utility)
IRM_RESULT RM_GetSpeciesD25(int id, double *diffc)
IRM_RESULT RM_GetDensity(int id, double *density)
int RM_GetKineticReactionsCount(int id)
IRM_RESULT RM_SetRebalanceByCell(int id, int method)
IRM_RESULT RM_GetSolutionVolume(int id, double *vol)
IRM_RESULT RM_GetSpeciesConcentrations(int id, double *species_conc)
IRM_RESULT RM_SetUnitsSSassemblage(int id, int option)
IRM_RESULT RM_StateApply(int id, int istate)
IRM_RESULT RM_SetUnitsSolution(int id, int option)
double RM_GetTime(int id)
IRM_RESULT RM_InitialPhreeqc2Module(int id, int *initial_conditions1, int *initial_conditions2, double *fraction1)
int RM_GetComponentCount(int id)
IRM_RESULT RM_SetUnitsPPassemblage(int id, int option)
int RM_GetSelectedOutputColumnCount(int id)
IRM_RESULT RM_SetPorosity(int id, double *por)
IRM_RESULT RM_SetSpeciesSaveOn(int id, int save_on)
IRM_RESULT RM_InitialPhreeqc2Concentrations(int id, double *c, int n_boundary, int *boundary_solution1, int *boundary_solution2, double *fraction1)
IRM_RESULT RM_GetSpeciesLog10Molalities(int id, double *species_log10molalities)
double RM_GetTimeConversion(int id)
int RM_GetSpeciesCount(int id)
IRM_RESULT RM_GetExchangeSpeciesName(int id, int num, char *name, int l1)
IRM_RESULT RM_InitialPhreeqcCell2Module(int id, int n, int *module_numbers, int dim_module_numbers)
int RM_GetMpiMyself(int id)
IRM_RESULT RM_CreateMapping(int id, int *grid2chem)
IRM_RESULT RM_SetMpiWorkerCallbackCookie(int id, void *cookie)
IRM_RESULT RM_InitialPhreeqc2SpeciesConcentrations(int id, double *species_c, int n_boundary, int *boundary_solution1, int *boundary_solution2, double *fraction1)
IRM_RESULT RM_SetPrintChemistryMask(int id, int *cell_mask)
IRM_RESULT RM_GetSurfaceName(int id, int num, char *name, int l1)
IRM_RESULT RM_DumpModule(int id, int dump_on, int append)
IRM_RESULT RM_RunCells(int id)
IRM_RESULT RM_SetMpiWorkerCallback(int id, int(*fcn)(int *x1, void *cookie))
IRM_RESULT RM_GetFilePrefix(int id, char *prefix, int l)
IRM_RESULT RM_DecodeError(int id, int e)
IRM_RESULT RM_StateSave(int id, int istate)
IRM_RESULT RM_SetTimeConversion(int id, double conv_factor)
int RM_Create(int nxyz, int nthreads)
IRM_RESULT RM_SetConcentrations(int id, double *c)
IRM_RESULT RM_LoadDatabase(int id, const char *db_name)
IRM_RESULT RM_LogMessage(int id, const char *str)
IRM_RESULT RM_GetSpeciesLog10Gammas(int id, double *species_log10gammas)
IRM_RESULT RM_SetPartitionUZSolids(int id, int tf)
IRM_RESULT RM_SetUnitsExchange(int id, int option)
IRM_RESULT RM_OutputMessage(int id, const char *str)
IRM_RESULT RM_GetGasComponentsName(int id, int num, char *name, int l1)
IRM_RESULT RM_MpiWorkerBreak(int id)
IRM_RESULT RM_GetSaturation(int id, double *sat_calc)
IRM_RESULT RM_SetUnitsSurface(int id, int option)
IRM_RESULT RM_SetTime(int id, double time)
int RM_GetNthSelectedOutputUserNumber(int id, int n)
IRM_RESULT RM_CloseFiles(int id)
IRM_RESULT RM_SetGasCompMoles(int id, double *gas_moles)
int RM_GetSpeciesSaveOn(int id)
IRM_RESULT RM_GetSolidSolutionComponentsName(int id, int num, char *name, int l1)
IRM_RESULT RM_GetEquilibriumPhasesName(int id, int num, char *name, int l1)
IRM_RESULT RM_GetGasCompPhi(int id, double *gas_phi)
IRM_RESULT RM_GetSelectedOutput(int id, double *so)
IRM_RESULT RM_SetPressure(int id, double *p)
IRM_RESULT RM_SetDensity(int id, double *density)
int RM_GetThreadCount(int id)
IRM_RESULT
Enumeration for PhreeqcRM function return codes.
Definition: IrmResult.h:8
IRM_RESULT RM_GetBackwardMapping(int id, int n, int *list, int *size)
int RM_GetSolidSolutionComponentsCount(int id)
IRM_RESULT RM_GetGasCompMoles(int id, double *gas_moles)
IRM_RESULT RM_ErrorMessage(int id, const char *errstr)
IRM_RESULT RM_GetSpeciesName(int id, int i, char *name, int length)
IRM_RESULT RM_SetRebalanceFraction(int id, double f)
IRM_RESULT RM_SetSaturation(int id, double *sat)
IRM_RESULT RM_StateDelete(int id, int istate)
IRM_RESULT RM_GetSelectedOutputHeading(int id, int icol, char *heading, int length)
int RM_GetEquilibriumPhasesCount(int id)
int RM_GetSelectedOutputCount(int id)
IRM_RESULT RM_SetErrorOn(int id, int tf)
IRM_RESULT RM_GetSurfaceSpeciesName(int id, int num, char *name, int l1)
IRM_RESULT RM_SetFilePrefix(int id, const char *prefix)
IRM_RESULT RM_SetGasPhaseVolume(int id, double *gas_volume)
int RM_GetGasComponentsCount(int id)
int RM_FindComponents(int id)
IRM_RESULT RM_WarningMessage(int id, const char *warn_str)
IRM_RESULT RM_GetComponent(int id, int num, char *chem_name, int l)
IRM_RESULT RM_GetExchangeName(int id, int num, char *name, int l1)
double RM_GetTimeStep(int id)
IRM_RESULT RM_OpenFiles(int id)
IRM_RESULT RM_RunFile(int id, int workers, int initial_phreeqc, int utility, const char *chem_name)
Enumeration used to return error codes.
IRM_RESULT RM_GetSpeciesZ(int id, double *z)
IRM_RESULT RM_Destroy(int id)
IRM_RESULT RM_SetCurrentSelectedOutputUserNumber(int id, int n_user)
IRM_RESULT RM_SetScreenOn(int id, int tf)
IRM_RESULT RM_GetSurfaceType(int id, int num, char *name, int l1)
IRM_RESULT RM_GetKineticReactionsName(int id, int num, char *name, int l1)
IRM_RESULT RM_GetErrorString(int id, char *errstr, int l)
IRM_RESULT RM_GetGfw(int id, double *gfw)
int RM_GetChemistryCellCount(int id)
IRM_RESULT RM_GetGasPhaseVolume(int id, double *gas_volume)
IRM_RESULT RM_GetConcentrations(int id, double *c)
IRM_RESULT RM_SetUnitsKinetics(int id, int option)
IRM_RESULT RM_SetUnitsGasPhase(int id, int option)
int RM_GetExchangeSpeciesCount(int id)
IRM_RESULT RM_RunString(int id, int workers, int initial_phreeqc, int utility, const char *input_string)
int RM_GetMpiTasks(int id)
IRM_RESULT RM_SetComponentH2O(int id, int tf)
int RM_Concentrations2Utility(int id, double *c, int n, double *tc, double *p_atm)
IRM_RESULT RM_UseSolutionDensityVolume(int id, int tf)
IRM_RESULT RM_GetSolidSolutionName(int id, int num, char *name, int l1)
int RM_GetSurfaceSpeciesCount(int id)
int RM_GetErrorStringLength(int id)
int RM_GetIPhreeqcId(int id, int i)
IRM_RESULT RM_GetSIName(int id, int num, char *name, int l1)
IRM_RESULT RM_SetTimeStep(int id, double time_step)
int RM_GetSelectedOutputRowCount(int id)