4#if !defined(BMIPHREEQCRM_H_INCLUDED)
5#define BMIPHREEQCRM_H_INCLUDED
8#if defined(WITH_PYBIND11)
9#include <pybind11/pybind11.h>
10#include <pybind11/numpy.h>
11#include <pybind11/stl.h>
12#include <pybind11/stl_bind.h>
14namespace py = pybind11;
16class NotIntialized :
public std::runtime_error {
18 NotIntialized() : std::runtime_error(
"must call initialize first") { };
23#include "BMIVariant.h"
25#include "VarManager.h"
330 std::string GetComponentName()
override {
332 sprintf(buffer,
"BMI PhreeqcRM [MSC v.%d 64 bit (AMD64)]", _MSC_VER);
336 std::string GetComponentName()
override {
338 sprintf(buffer,
"BMI PhreeqcRM [MSC v.%d 32 bit (Intel)]", _MSC_VER);
342 std::string GetComponentName()
override {
344 sprintf(buffer,
"BMI PhreeqcRM [MSC v.%d Unknown]", _MSC_VER);
594 int GetVarGrid(
const std::string name)
override {
return 0; }
747 std::string
GetVarLocation(
const std::string name)
override {
return "Unknown"; }
897 void GetValue(
const std::string name,
void* dest)
override;
901 void GetValue(
const std::string name,
bool& OUTPUT);
905 void GetValue(
const std::string name,
bool* OUTPUT);
909 void GetValue(
const std::string name,
double& OUTPUT);
913 void GetValue(
const std::string name,
double* OUTPUT);
917 void GetValue(
const std::string name,
int& OUTPUT);
921 void GetValue(
const std::string name,
int* OUTPUT);
925 void GetValue(
const std::string name, std::string& OUTPUT);
929 void GetValue(
const std::string name, std::vector<double>& OUTPUT);
933 void GetValue(
const std::string name, std::vector<int>& OUTPUT);
937 void GetValue(
const std::string name, std::vector<std::string>& OUTPUT);
1021 void SetValue(
const std::string name,
void* src)
override;
1029 void SetValue(
const std::string name,
const char* src);
1041 void SetValue(
const std::string name,
const std::string src);
1045 void SetValue(
const std::string name, std::vector<double> src);
1049 void SetValue(
const std::string name, std::vector<int> src);
1053 void SetValue(
const std::string name, std::vector<std::string> src);
1274#if defined(WITH_PYBIND11)
1276 py::array BMIPhreeqcRM::get_value(std::string name, py::array arr);
1280 py::array get_value_ptr(std::string name);
1282 void set_value(std::string name, py::array src);
1284 py::array get_value_at_indices(std::string name, py::array dest, py::array indices);
1286 void set_value_at_indices(std::string name, py::array indices, py::array src);
1288 py::sequence process_sequence(py::sequence seq);
1293#if defined(SWIG) || defined(swig_python_EXPORTS)
1294 void get_value_ptr_double(std::string var,
double** ARGOUTVIEW_ARRAY1,
int* DIM1);
1295 void get_value_ptr_int(std::string var,
int** ARGOUTVIEW_ARRAY1,
int* DIM1);
1296 std::vector<std::string>& get_value_ptr_vector_strings(std::string var);
1304 VarManager* var_man;
1307 void ClearBMISelectedOutput()
override;
1308 void GenerateAutoOutputVars()
override;
1309 void UpdateBMI(RMVARS v_enum)
override;
1310 void UpdateVariables();
1311 RMVARS GetEnum(
const std::string name);
IRM_RESULT
Enumeration for PhreeqcRM function return codes.
Definition IrmResult.h:8
@ IRM_OK
Definition IrmResult.h:9
C++ header file for PhreeqcRM. PhreeqcRM is deprecated and included for backward compatibility....
#define MP_TYPE
Definition PhreeqcRM.h:17
Basic Model Interface implementation of the geochemical reaction module PhreeqcRM.
Definition BMIPhreeqcRM.h:44
double GetCurrentTime() override
std::vector< std::string > GetInputVarNames() override
int GetGridEdgeCount(const int grid) override
Definition BMIPhreeqcRM.h:1142
std::string GetVarUnits(const std::string name) override
void SetValue(const std::string name, const char *src)
int GetVarNbytes(const std::string name) override
void GetGridFaceNodes(const int grid, int *face_nodes) override
Definition BMIPhreeqcRM.h:1170
std::string GetVarLocation(const std::string name) override
Definition BMIPhreeqcRM.h:747
void SetValue(const std::string name, double src)
IRM_RESULT SetLanguage(const char *string)
Definition BMIPhreeqcRM.h:1264
std::vector< std::string > GetPointableVarNames()
void SetValue(const std::string name, int src)
void GetValue(const std::string name, std::vector< int > &OUTPUT)
static void CleanupBMIModuleInstances(void)
int GetGridSize(const int grid) override
void GetValue(const std::string name, double *OUTPUT)
void GetGridShape(const int grid, int *shape) override
Definition BMIPhreeqcRM.h:1093
void GetValue(const std::string name, std::vector< std::string > &OUTPUT)
int GetVarGrid(const std::string name) override
Definition BMIPhreeqcRM.h:594
void SetValue(const std::string name, std::vector< std::string > src)
void GetValue(const std::string name, bool *OUTPUT)
std::string GetTimeUnits() override
Definition BMIPhreeqcRM.h:831
double GetTimeStep() override
Definition BMIPhreeqcRM.h:832
static int CreateBMIModule(int nxyz, int nthreads)
void SetValue(const std::string name, bool src)
void SetValueAtIndices(std::string name, int *inds, int count, void *src) override
Definition BMIPhreeqcRM.h:1057
void AddOutputVars(std::string option, std::string def) override
std::string language
Definition BMIPhreeqcRM.h:1266
void GetValue(const std::string name, std::vector< double > &OUTPUT)
double GetEndTime() override
void GetGridY(const int grid, double *y) override
Definition BMIPhreeqcRM.h:1121
void Construct(Initializer initializer) override
static IRM_RESULT DestroyBMIModule(int n)
std::string GetVarType(const std::string name) override
void GetValue(const std::string name, bool &OUTPUT)
void GetGridFaceEdges(const int grid, int *face_edges) override
Definition BMIPhreeqcRM.h:1163
double GetStartTime() override
static BMIPhreeqcRM * GetInstance(int n)
int GetPointableItemCount()
void * GetValuePtr(std::string name) override
void GetValue(const std::string name, void *dest) override
void GetGridSpacing(const int grid, double *spacing) override
Definition BMIPhreeqcRM.h:1100
void GetValue(const std::string name, int &OUTPUT)
static int CreateBMIModule()
std::vector< std::string > GetReadOnlyVarNames()
std::string GetGridType(const int grid) override
void GetValue(const std::string name, int *OUTPUT)
void GetGridX(const int grid, double *x) override
Definition BMIPhreeqcRM.h:1114
int GetOutputItemCount() override
void SetValue(const std::string name, std::vector< int > src)
int GetGridRank(const int grid) override
void Initialize(std::string config_file="") override
void GetValueAtIndices(std::string name, void *dest, int *inds, int count) override
Definition BMIPhreeqcRM.h:968
std::vector< std::string > GetOutputVarNames() override
int GetGridFaceCount(const int grid) override
Definition BMIPhreeqcRM.h:1149
void GetValue(const std::string name, std::string &OUTPUT)
BMIPhreeqcRM(int ngrid, int nthreads)
std::string GetComponentName() override
Definition BMIPhreeqcRM.h:349
void UpdateUntil(double end_time) override
int GetGridNodeCount(const int grid) override
Definition BMIPhreeqcRM.h:1135
void SetValue(const std::string name, const std::string src)
void SetValue(const std::string name, void *src) override
int GetVarItemsize(const std::string name) override
void SetValue(const std::string name, std::vector< double > src)
void GetGridZ(const int grid, double *z) override
Definition BMIPhreeqcRM.h:1128
void GetGridOrigin(const int grid, double *origin) override
Definition BMIPhreeqcRM.h:1107
void GetGridEdgeNodes(const int grid, int *edge_nodes) override
Definition BMIPhreeqcRM.h:1156
void GetGridNodesPerFace(const int grid, int *nodes_per_face) override
Definition BMIPhreeqcRM.h:1177
int GetInputItemCount() override
void GetValue(const std::string name, double &OUTPUT)
Throws an exception for Basic Model Interface methods that are not implemented in BMIPhreeqcRM.
Definition BMIPhreeqcRM.h:32
NotImplemented()
Definition BMIPhreeqcRM.h:34
Geochemical reaction module.
Definition PhreeqcRM.h:269
double GetTimeStep(void)
Definition PhreeqcRM.h:3024