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 
45 IRM_DLL_EXPORT IRM_RESULT RM_Abort(int id, int result, const char * err_str);
62 IRM_DLL_EXPORT IRM_RESULT RM_CloseFiles(int id);
102 IRM_DLL_EXPORT int RM_Concentrations2Utility(int id, double *c, int n, double *tc, double *p_atm);
142 #ifdef USE_MPI
143 IRM_DLL_EXPORT int RM_Create(int nxyz, MPI_Comm comm);
144 #else
145 IRM_DLL_EXPORT int RM_Create(int nxyz, int nthreads);
146 #endif
147 
178 IRM_DLL_EXPORT IRM_RESULT RM_CreateMapping (int id, int *grid2chem);
213 IRM_DLL_EXPORT IRM_RESULT RM_DecodeError (int id, int e);
230 IRM_DLL_EXPORT IRM_RESULT RM_Destroy(int id);
252 IRM_DLL_EXPORT IRM_RESULT RM_DumpModule(int id, int dump_on, int append);
271 IRM_DLL_EXPORT IRM_RESULT RM_ErrorMessage(int id, const char *errstr);
310 IRM_DLL_EXPORT int RM_FindComponents(int id);
341 IRM_DLL_EXPORT IRM_RESULT RM_GetBackwardMapping(int id, int n, int *list, int *size);
361 IRM_DLL_EXPORT int RM_GetChemistryCellCount(int id);
388 IRM_DLL_EXPORT IRM_RESULT RM_GetComponent(int id, int num, char *chem_name, int l);
407 IRM_DLL_EXPORT int RM_GetComponentCount(int id);
449 IRM_DLL_EXPORT IRM_RESULT RM_GetConcentrations(int id, double *c);
474 IRM_DLL_EXPORT IRM_RESULT RM_GetDensity(int id, double *density);
475 
476 
497 IRM_DLL_EXPORT IRM_RESULT RM_GetEndCell(int id, int *ec);
498 
528 IRM_DLL_EXPORT IRM_RESULT RM_GetErrorString(int id, char *errstr, int l);
553 IRM_DLL_EXPORT int RM_GetErrorStringLength(int id);
577 IRM_DLL_EXPORT IRM_RESULT RM_GetFilePrefix(int id, char *prefix, int l);
606 IRM_DLL_EXPORT IRM_RESULT RM_GetGfw(int id, double * gfw);
628 IRM_DLL_EXPORT int RM_GetGridCellCount(int id);
660 IRM_DLL_EXPORT int RM_GetIPhreeqcId(int id, int i);
684 IRM_DLL_EXPORT int RM_GetMpiMyself(int id);
711 IRM_DLL_EXPORT int RM_GetMpiTasks(int id);
751 IRM_DLL_EXPORT int RM_GetNthSelectedOutputUserNumber(int id, int n);
752 
784 IRM_DLL_EXPORT IRM_RESULT RM_GetSaturation(int id, double *sat_calc);
785 
817 IRM_DLL_EXPORT IRM_RESULT RM_GetSelectedOutput(int id, double *so);
818 
847 IRM_DLL_EXPORT int RM_GetSelectedOutputColumnCount(int id);
876 IRM_DLL_EXPORT int RM_GetSelectedOutputCount(int id);
911 IRM_DLL_EXPORT IRM_RESULT RM_GetSelectedOutputHeading(int id, int icol, char * heading, int length);
951 IRM_DLL_EXPORT int RM_GetSelectedOutputRowCount(int id);
978 IRM_DLL_EXPORT IRM_RESULT RM_GetSolutionVolume(int id, double *vol);
1019 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesConcentrations(int id, double *species_conc);
1052 IRM_DLL_EXPORT int RM_GetSpeciesCount(int id);
1084 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesD25(int id, double *diffc);
1122 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesName(int id, int i, char * name, int length);
1155 IRM_DLL_EXPORT int RM_GetSpeciesSaveOn(int id);
1185 IRM_DLL_EXPORT IRM_RESULT RM_GetSpeciesZ(int id, double *z);
1186 
1207 IRM_DLL_EXPORT IRM_RESULT RM_GetStartCell(int id, int *sc);
1208 
1228 IRM_DLL_EXPORT int RM_GetThreadCount(int id);
1249 IRM_DLL_EXPORT double RM_GetTime(int id);
1272 IRM_DLL_EXPORT double RM_GetTimeConversion(int id);
1295 IRM_DLL_EXPORT double RM_GetTimeStep(int id);
1345  int id,
1346  double *c,
1347  int n_boundary,
1348  int *boundary_solution1,
1349  int *boundary_solution2,
1350  double *fraction1);
1429 IRM_DLL_EXPORT IRM_RESULT RM_InitialPhreeqc2Module(int id,
1430  int *initial_conditions1, // 7 x nxyz end-member 1
1431  int *initial_conditions2, // 7 x nxyz end-member 2
1432  double *fraction1); // 7 x nxyz fraction of end-member 1
1433 
1486  int id,
1487  double *species_c,
1488  int n_boundary,
1489  int *boundary_solution1,
1490  int *boundary_solution2,
1491  double *fraction1);
1523 IRM_DLL_EXPORT IRM_RESULT RM_InitialPhreeqcCell2Module(int id,
1524  int n, // InitialPhreeqc cell number
1525  int *module_numbers, // Module cell numbers
1526  int dim_module_numbers); // Number of module cell numbers
1527 
1547 IRM_DLL_EXPORT IRM_RESULT RM_LoadDatabase(int id, const char *db_name);
1568 IRM_DLL_EXPORT IRM_RESULT RM_LogMessage(int id, const char *str);
1602 IRM_DLL_EXPORT IRM_RESULT RM_MpiWorker(int id);
1625 IRM_DLL_EXPORT IRM_RESULT RM_MpiWorkerBreak(int id);
1645 IRM_DLL_EXPORT IRM_RESULT RM_OpenFiles(int id);
1677 IRM_DLL_EXPORT IRM_RESULT RM_OutputMessage(int id, const char *str);
1709 IRM_DLL_EXPORT IRM_RESULT RM_RunCells(int id);
1735 IRM_DLL_EXPORT IRM_RESULT RM_RunFile(int id, int workers, int initial_phreeqc, int utility, const char *chem_name);
1763 IRM_DLL_EXPORT IRM_RESULT RM_RunString(int id, int workers, int initial_phreeqc, int utility, const char * input_string);
1783 IRM_DLL_EXPORT IRM_RESULT RM_ScreenMessage(int id, const char *str);
1813 IRM_DLL_EXPORT IRM_RESULT RM_SetComponentH2O(int id, int tf);
1855 IRM_DLL_EXPORT IRM_RESULT RM_SetConcentrations(int id, double *c);
1887 IRM_DLL_EXPORT IRM_RESULT RM_SetCurrentSelectedOutputUserNumber(int id, int n_user);
1918 IRM_DLL_EXPORT IRM_RESULT RM_SetDensity(int id, double *density);
1939 IRM_DLL_EXPORT IRM_RESULT RM_SetDumpFileName(int id, const char *dump_name);
1960 IRM_DLL_EXPORT IRM_RESULT RM_SetErrorHandlerMode(int id, int mode);
1980 IRM_DLL_EXPORT IRM_RESULT RM_SetFilePrefix(int id, const char *prefix);
2076 IRM_DLL_EXPORT IRM_RESULT RM_SetMpiWorkerCallback(int id, int (*fcn)(int *x1, void *cookie));
2145 IRM_DLL_EXPORT IRM_RESULT RM_SetMpiWorkerCallbackCookie(int id, void *cookie);
2183 IRM_DLL_EXPORT IRM_RESULT RM_SetPartitionUZSolids(int id, int tf);
2206 IRM_DLL_EXPORT IRM_RESULT RM_SetPorosity(int id, double *por);
2228 IRM_DLL_EXPORT IRM_RESULT RM_SetPressure(int id, double *p);
2258 IRM_DLL_EXPORT IRM_RESULT RM_SetPrintChemistryMask(int id, int *cell_mask);
2291 IRM_DLL_EXPORT IRM_RESULT RM_SetPrintChemistryOn(int id, int workers, int initial_phreeqc, int utility);
2292 
2320 IRM_DLL_EXPORT IRM_RESULT RM_SetRebalanceByCell(int id, int method);
2350 IRM_DLL_EXPORT IRM_RESULT RM_SetRebalanceFraction(int id, double f);
2386 IRM_DLL_EXPORT IRM_RESULT RM_SetRepresentativeVolume(int id, double *rv);
2417 IRM_DLL_EXPORT IRM_RESULT RM_SetSaturation(int id, double *sat);
2438 IRM_DLL_EXPORT IRM_RESULT RM_SetScreenOn(int id, int tf);
2462 IRM_DLL_EXPORT IRM_RESULT RM_SetSelectedOutputOn(int id, int selected_output);
2491 IRM_DLL_EXPORT IRM_RESULT RM_SetSpeciesSaveOn(int id, int save_on);
2520 IRM_DLL_EXPORT IRM_RESULT RM_SetTemperature(int id, double *t);
2538 IRM_DLL_EXPORT IRM_RESULT RM_SetTime(int id, double time);
2556 IRM_DLL_EXPORT IRM_RESULT RM_SetTimeConversion(int id, double conv_factor);
2576 IRM_DLL_EXPORT IRM_RESULT RM_SetTimeStep(int id, double time_step);
2611 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsExchange(int id, int option);
2646 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsGasPhase(int id, int option);
2695 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsKinetics(int id, int option);
2730 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsPPassemblage(int id, int option);
2783 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSolution(int id, int option);
2818 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSSassemblage(int id, int option);
2853 IRM_DLL_EXPORT IRM_RESULT RM_SetUnitsSurface(int id, int option);
2893 IRM_DLL_EXPORT IRM_RESULT RM_SpeciesConcentrations2Module(int id, double * species_conc);
2930 IRM_DLL_EXPORT IRM_RESULT RM_UseSolutionDensityVolume(int id, int tf);
2948 IRM_DLL_EXPORT IRM_RESULT RM_WarningMessage(int id, const char *warn_str);
2949 
2950 #if defined(__cplusplus)
2951 }
2952 #endif
2953 
2954 #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_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)
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)
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_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)
double RM_GetTimeConversion(int id)
int RM_GetSpeciesCount(int id)
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_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_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_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_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)
int RM_GetSpeciesSaveOn(int id)
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)
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_GetSelectedOutputHeading(int id, int icol, char *heading, int length)
int RM_GetSelectedOutputCount(int id)
IRM_RESULT RM_SetFilePrefix(int id, const char *prefix)
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)
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_GetErrorString(int id, char *errstr, int l)
IRM_RESULT RM_GetGfw(int id, double *gfw)
int RM_GetChemistryCellCount(int id)
IRM_RESULT RM_GetConcentrations(int id, double *c)
IRM_RESULT RM_SetUnitsKinetics(int id, int option)
IRM_RESULT RM_SetUnitsGasPhase(int id, int option)
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)
int RM_GetErrorStringLength(int id)
int RM_GetIPhreeqcId(int id, int i)
IRM_RESULT RM_SetTimeStep(int id, double time_step)
int RM_GetSelectedOutputRowCount(int id)