PhreeqcRM
BMIPhreeqcRM Class Reference
Inheritance diagram for BMIPhreeqcRM:
Collaboration diagram for BMIPhreeqcRM:

Public Member Functions

 BMIPhreeqcRM ()
 
 BMIPhreeqcRM (int ngrid, int nthreads)
 
 ~BMIPhreeqcRM () override
 
void Initialize (std::string config_file="") override
 
void Update () override
 
void UpdateUntil (double end_time) override
 
void Finalize () override
 
std::string GetComponentName () override
 
int GetInputItemCount () override
 
int GetOutputItemCount () override
 
int GetPointableItemCount ()
 
std::vector< std::string > GetInputVarNames () override
 
std::vector< std::string > GetOutputVarNames () override
 
std::vector< std::string > GetPointableVarNames ()
 
std::vector< std::string > GetReadOnlyVarNames ()
 
int GetVarGrid (const std::string name) override
 
std::string GetVarType (const std::string name) override
 
std::string GetVarUnits (const std::string name) override
 
int GetVarItemsize (const std::string name) override
 
int GetVarNbytes (const std::string name) override
 
std::string GetVarLocation (const std::string name) override
 
double GetCurrentTime () override
 
double GetStartTime () override
 
double GetEndTime () override
 
std::string GetTimeUnits () override
 
double GetTimeStep () override
 
void GetValue (const std::string name, void *dest) override
 
void GetValue (const std::string name, bool &OUTPUT)
 
void GetValue (const std::string name, bool *OUTPUT)
 
void GetValue (const std::string name, double &OUTPUT)
 
void GetValue (const std::string name, double *OUTPUT)
 
void GetValue (const std::string name, int &OUTPUT)
 
void GetValue (const std::string name, int *OUTPUT)
 
void GetValue (const std::string name, std::string &OUTPUT)
 
void GetValue (const std::string name, std::vector< double > &OUTPUT)
 
void GetValue (const std::string name, std::vector< int > &OUTPUT)
 
void GetValue (const std::string name, std::vector< std::string > &OUTPUT)
 
void * GetValuePtr (std::string name) override
 
void GetValueAtIndices (std::string name, void *dest, int *inds, int count) override
 
void SetValue (const std::string name, void *src) override
 
void SetValue (const std::string name, bool src)
 
void SetValue (const std::string name, const char *src)
 
void SetValue (const std::string name, double src)
 
void SetValue (const std::string name, int src)
 
void SetValue (const std::string name, const std::string src)
 
void SetValue (const std::string name, std::vector< double > src)
 
void SetValue (const std::string name, std::vector< int > src)
 
void SetValue (const std::string name, std::vector< std::string > src)
 
void SetValueAtIndices (std::string name, int *inds, int count, void *src) override
 
int GetGridRank (const int grid) override
 
int GetGridSize (const int grid) override
 
std::string GetGridType (const int grid) override
 
void GetGridShape (const int grid, int *shape) override
 
void GetGridSpacing (const int grid, double *spacing) override
 
void GetGridOrigin (const int grid, double *origin) override
 
void GetGridX (const int grid, double *x) override
 
void GetGridY (const int grid, double *y) override
 
void GetGridZ (const int grid, double *z) override
 
int GetGridNodeCount (const int grid) override
 
int GetGridEdgeCount (const int grid) override
 
int GetGridFaceCount (const int grid) override
 
void GetGridEdgeNodes (const int grid, int *edge_nodes) override
 
void GetGridFaceEdges (const int grid, int *face_edges) override
 
void GetGridFaceNodes (const int grid, int *face_nodes) override
 
void GetGridNodesPerFace (const int grid, int *nodes_per_face) override
 
void AddOutputVars (std::string option, std::string def) override
 
IRM_RESULT SetLanguage (const char *string)
 
- Public Member Functions inherited from PhreeqcRM
 PhreeqcRM (int nxyz, int thread_count_or_communicator, PHRQ_io *io=NULL, bool delay_construct=false)
 
virtual ~PhreeqcRM (void)
 
IRM_RESULT CloseFiles (void)
 
IPhreeqc * Concentrations2Utility (const std::vector< double > &c, const std::vector< double > &tc, const std::vector< double > &p_atm)
 
IRM_RESULT CreateMapping (const std::vector< int > &grid2chem)
 
void DecodeError (int result)
 
IRM_RESULT DumpModule (bool dump_on, bool append=false)
 
void ErrorHandler (int result, const std::string &e_string)
 
void ErrorMessage (const std::string &error_string, bool prepend=true)
 
int FindComponents ()
 
const std::vector< std::vector< int > > & GetBackwardMapping (void)
 
int GetChemistryCellCount (void) const
 
int GetComponentCount (void) const
 
const std::vector< std::string > & GetComponents (void) const
 
IRM_RESULT GetConcentrations (std::vector< double > &c_output)
 
int GetCurrentSelectedOutputUserNumber (void)
 
std::string GetDatabaseFileName (void)
 
IRM_RESULT GetDensityCalculated (std::vector< double > &d_output)
 
IRM_RESULT GetDensity (std::vector< double > &d_output)
 
const std::vector< int > & GetEndCell (void)
 
const std::vector< std::string > & GetEquilibriumPhases (void) const
 
int GetEquilibriumPhasesCount (void) const
 
int GetErrorHandlerMode (void)
 
std::string GetErrorString (void)
 
const std::vector< std::string > & GetExchangeNames (void) const
 
const std::vector< std::string > & GetExchangeSpecies (void) const
 
int GetExchangeSpeciesCount (void) const
 
std::string GetFilePrefix (void)
 
const std::vector< int > & GetForwardMapping (void)
 
const std::vector< std::string > & GetGasComponents (void) const
 
int GetGasComponentsCount (void) const
 
IRM_RESULT GetGasCompMoles (std::vector< double > &gas_moles_output)
 
IRM_RESULT GetGasCompPhi (std::vector< double > &gas_phi)
 
IRM_RESULT GetGasCompPressures (std::vector< double > &gas_pressure)
 
IRM_RESULT GetGasPhaseVolume (std::vector< double > &gas_volume_output)
 
const std::vector< double > & GetGfw (void)
 
int GetGridCellCount (void)
 
IPhreeqc * GetIPhreeqcPointer (int i)
 
IRM_RESULT GetIthConcentration (int i, std::vector< double > &c_output)
 
IRM_RESULT GetIthSpeciesConcentration (int i, std::vector< double > &c_output)
 
const std::vector< std::string > & GetKineticReactions (void) const
 
int GetKineticReactionsCount (void) const
 
int GetMpiMyself (void) const
 
int GetMpiTasks (void) const
 
int GetNthSelectedOutputUserNumber (int n)
 
bool GetPartitionUZSolids (void) const
 
const std::vector< double > & GetPorosity (void)
 
const std::vector< double > & GetPressure (void)
 
const std::vector< int > & GetPrintChemistryMask (void)
 
const std::vector< bool > & GetPrintChemistryOn (void)
 
bool GetRebalanceByCell (void) const
 
double GetRebalanceFraction (void) const
 
IRM_RESULT GetSaturationCalculated (std::vector< double > &sat_output)
 
IRM_RESULT GetSaturation (std::vector< double > &sat_output)
 
IRM_RESULT GetSelectedOutput (std::vector< double > &s_output)
 
int GetSelectedOutputColumnCount (void)
 
int GetSelectedOutputCount (void)
 
IRM_RESULT GetSelectedOutputHeading (int icol, std::string &heading)
 
IRM_RESULT GetSelectedOutputHeadings (std::vector< std::string > &headings)
 
bool GetSelectedOutputOn (void)
 
int GetSelectedOutputRowCount (void)
 
int GetSICount (void) const
 
const std::vector< std::string > & GetSINames (void) const
 
const std::vector< std::string > & GetSolidSolutionComponents (void) const
 
int GetSolidSolutionComponentsCount (void) const
 
const std::vector< std::string > & GetSolidSolutionNames (void) const
 
const std::vector< double > & GetSolutionVolume (void)
 
IRM_RESULT GetSpeciesConcentrations (std::vector< double > &species_conc_output)
 
int GetSpeciesCount (void)
 
const std::vector< double > & GetSpeciesD25 (void)
 
IRM_RESULT GetSpeciesLog10Gammas (std::vector< double > &species_log10gammas)
 
IRM_RESULT GetSpeciesLog10Molalities (std::vector< double > &species_log10molalities)
 
const std::vector< std::string > & GetSpeciesNames (void)
 
bool GetSpeciesSaveOn (void)
 
const std::vector< cxxNameDouble > & GetSpeciesStoichiometry (void)
 
const std::vector< double > & GetSpeciesZ (void)
 
const std::vector< int > & GetStartCell (void)
 
const std::vector< std::string > & GetSurfaceNames (void) const
 
const std::vector< std::string > & GetSurfaceSpecies (void) const
 
int GetSurfaceSpeciesCount (void) const
 
const std::vector< std::string > & GetSurfaceTypes (void) const
 
const std::vector< double > & GetTemperature (void)
 
int GetThreadCount ()
 
double GetTime (void) const
 
double GetTimeConversion (void)
 
double GetTimeStep (void)
 
int GetUnitsExchange (void)
 
int GetUnitsGasPhase (void)
 
int GetUnitsKinetics (void)
 
int GetUnitsPPassemblage (void)
 
int GetUnitsSolution (void)
 
int GetUnitsSSassemblage (void)
 
int GetUnitsSurface (void)
 
const std::vector< double > & GetViscosity ()
 
const std::vector< IPhreeqcPhast * > & GetWorkers ()
 
IRM_RESULT InitializeYAML (std::string yamlfile)
 
IRM_RESULT InitialPhreeqc2Concentrations (std::vector< double > &destination_c, const std::vector< int > &boundary_solution1)
 
IRM_RESULT InitialPhreeqc2Concentrations (std::vector< double > &destination_c, const std::vector< int > &boundary_solution1, const std::vector< int > &boundary_solution2, const std::vector< double > &fraction1)
 
IRM_RESULT InitialEquilibriumPhases2Module (const std::vector< int > &equilibrium_phases)
 
IRM_RESULT InitialExchanges2Module (const std::vector< int > &exchanges)
 
IRM_RESULT InitialGasPhases2Module (const std::vector< int > &gas_phases)
 
IRM_RESULT InitialKinetics2Module (const std::vector< int > &kinetics)
 
IRM_RESULT InitialPhreeqc2Module (const std::vector< int > &initial_conditions1)
 
IRM_RESULT InitialPhreeqc2Module (const std::vector< int > &initial_conditions1, const std::vector< int > &initial_conditions2, const std::vector< double > &fraction1)
 
IRM_RESULT InitialPhreeqc2SpeciesConcentrations (std::vector< double > &destination_c, const std::vector< int > &boundary_solution1)
 
IRM_RESULT InitialPhreeqc2SpeciesConcentrations (std::vector< double > &destination_c, const std::vector< int > &boundary_solution1, const std::vector< int > &boundary_solution2, const std::vector< double > &fraction1)
 
IRM_RESULT InitialPhreeqcCell2Module (int n, const std::vector< int > &cell_numbers)
 
IRM_RESULT InitialSolidSolutions2Module (const std::vector< int > &solid_solutions)
 
IRM_RESULT InitialSolutions2Module (const std::vector< int > &solutions)
 
IRM_RESULT InitialSurfaces2Module (const std::vector< int > &surfaces)
 
IRM_RESULT LoadDatabase (const std::string &database)
 
void LogMessage (const std::string &str)
 
int MpiAbort ()
 
IRM_RESULT MpiWorker ()
 
IRM_RESULT MpiWorkerBreak ()
 
IRM_RESULT OpenFiles (void)
 
void OutputMessage (const std::string &str)
 
IRM_RESULT ReturnHandler (IRM_RESULT result, const std::string &e_string)
 
IRM_RESULT RunCells (void)
 
IRM_RESULT RunFile (bool workers, bool initial_phreeqc, bool utility, const std::string &chemistry_name)
 
IRM_RESULT RunString (bool workers, bool initial_phreeqc, bool utility, const std::string &input_string)
 
void ScreenMessage (const std::string &str)
 
IRM_RESULT SetComponentH2O (bool tf)
 
IRM_RESULT SetConcentrations (const std::vector< double > &c)
 
IRM_RESULT SetCurrentSelectedOutputUserNumber (int n_user)
 
IRM_RESULT SetDensityUser (const std::vector< double > &density)
 
IRM_RESULT SetDensity (const std::vector< double > &density)
 
IRM_RESULT SetDumpFileName (const std::string &dump_name)
 
IRM_RESULT SetErrorHandlerMode (int mode)
 
IRM_RESULT SetErrorOn (bool tf)
 
IRM_RESULT SetFilePrefix (const std::string &prefix)
 
IRM_RESULT SetGasCompMoles (const std::vector< double > &gas_moles)
 
IRM_RESULT SetGasPhaseVolume (const std::vector< double > &gas_volume)
 
IRM_RESULT SetIthConcentration (int i, std::vector< double > &c)
 
IRM_RESULT SetIthSpeciesConcentration (int i, std::vector< double > &c)
 
IRM_RESULT SetMpiWorkerCallbackC (int(*fcn)(int *method, void *cookie))
 
IRM_RESULT SetMpiWorkerCallbackCookie (void *cookie)
 
IRM_RESULT SetMpiWorkerCallbackFortran (int(*fcn)(int *method))
 
IRM_RESULT SetNthSelectedOutput (int n)
 
IRM_RESULT SetPartitionUZSolids (bool tf)
 
IRM_RESULT SetPorosity (const std::vector< double > &por)
 
IRM_RESULT SetPressure (const std::vector< double > &p)
 
IRM_RESULT SetPrintChemistryMask (const std::vector< int > &cell_mask)
 
IRM_RESULT SetPrintChemistryOn (bool workers, bool initial_phreeqc, bool utility)
 
IRM_RESULT SetRebalanceByCell (bool tf)
 
IRM_RESULT SetRebalanceFraction (double f)
 
IRM_RESULT SetRepresentativeVolume (const std::vector< double > &rv)
 
IRM_RESULT SetSaturationUser (const std::vector< double > &sat)
 
IRM_RESULT SetSaturation (const std::vector< double > &sat)
 
IRM_RESULT SetScreenOn (bool tf)
 
IRM_RESULT SetSelectedOutputOn (bool tf)
 
IRM_RESULT SetSpeciesSaveOn (bool save_on)
 
IRM_RESULT SetTemperature (const std::vector< double > &t)
 
IRM_RESULT SetTime (double time)
 
IRM_RESULT SetTimeConversion (double conv_factor)
 
IRM_RESULT SetTimeStep (double time_step)
 
IRM_RESULT SetUnitsExchange (int option)
 
IRM_RESULT SetUnitsGasPhase (int option)
 
IRM_RESULT SetUnitsKinetics (int option)
 
IRM_RESULT SetUnitsPPassemblage (int option)
 
IRM_RESULT SetUnitsSolution (int option)
 
IRM_RESULT SetUnitsSSassemblage (int option)
 
IRM_RESULT SetUnitsSurface (int option)
 
IRM_RESULT SpeciesConcentrations2Module (const std::vector< double > &species_conc)
 
IRM_RESULT StateSave (int istate)
 
IRM_RESULT StateApply (int istate)
 
IRM_RESULT StateDelete (int istate)
 
void UseSolutionDensityVolume (bool tf)
 
void WarningMessage (const std::string &warnstr)
 
- Public Member Functions inherited from StaticIndexer< PhreeqcRM >
 StaticIndexer (PhreeqcRM *self)
 
 ~StaticIndexer ()
 
int GetIndex ()
 

Static Public Member Functions

static void CleanupBMIModuleInstances (void)
 
static int CreateBMIModule ()
 
static int CreateBMIModule (int nxyz, int nthreads)
 
static IRM_RESULT DestroyBMIModule (int n)
 
static BMIPhreeqcRMGetInstance (int n)
 
- Static Public Member Functions inherited from PhreeqcRM
static void CleanupReactionModuleInstances (void)
 
static int CreateReactionModule (int nxyz, int nthreads)
 
static IRM_RESULT DestroyReactionModule (int n)
 
static int GetGridCellCountYAML (const char *YAML_file)
 
static std::string Char2TrimString (const char *str, size_t l=0)
 
static bool FileExists (const std::string &name)
 
static void FileRename (const std::string &temp_name, const std::string &name, const std::string &backup_name)
 
static IRM_RESULT Int2IrmResult (int r, bool positive_ok)
 
- Static Public Member Functions inherited from StaticIndexer< PhreeqcRM >
static PhreeqcRMGetInstance (int id)
 
static Derived * GetInstance (int id)
 
static IRM_RESULT Destroy (int id)
 
static void DestroyAll ()
 

Public Attributes

std::string language
 

Protected Member Functions

void Construct (Initializer initializer) override
 

Additional Inherited Members

- Protected Attributes inherited from StaticIndexer< PhreeqcRM >
size_t _Index
 
- Static Protected Attributes inherited from StaticIndexer< PhreeqcRM >
static std::mutex _InstancesLock
 
static std::map< size_t, PhreeqcRM * > _Instances
 
static size_t _InstancesIndex
 

Detailed Description

Basic Model Interface implementation of the geochemical reaction module PhreeqcRM.

Constructor & Destructor Documentation

◆ BMIPhreeqcRM() [1/2]

BMIPhreeqcRM::BMIPhreeqcRM ( )

Default constructor for the BMIPhreeqcRM subclass of PhreeqcRM. Definition of the number of cells and threads (or MPI communicator) is deferred. Initialize must be called to initialize the BMIPhreeqcRM instance.

◆ BMIPhreeqcRM() [2/2]

BMIPhreeqcRM::BMIPhreeqcRM ( int  ngrid,
int  nthreads 
)

Constructor for the BMIPhreeqcRM subclass of PhreeqcRM. A BMIPhreeqcRM instance has the BMI methods plus all of the PhreeqcRM methods. The constructor requires two arguments: the number of cells in the user's model, and either (a) the number of threads for OpenMP parallelization, or (b) an MPI communicator.

Parameters
ngridNumber of cells in the user's model.
nthreadsNumber of threads for parallelization with OpenMP or an MPI communicator if PhreeqcRM is compiled with MPI. With OpenMP, a value of zero causes the program to set nthreads to the number of logical processors of the computer.
C++ Example:
int nthreads = 0;
std::string yaml_file = "myfile.yaml";
int nxyz = GetGridCellCountYAML(yaml_file);
BMIPhreeqcRM brm(nxyz, nthreads);
brm.Initialize(yaml_file);

◆ ~BMIPhreeqcRM()

BMIPhreeqcRM::~BMIPhreeqcRM ( )
override

Member Function Documentation

◆ AddOutputVars()

void BMIPhreeqcRM::AddOutputVars ( std::string  option,
std::string  def 
)
overridevirtual

AddOutputVars allows selection of sets of variables that can be retieved by the GetValue method. Sets of variables can be included or excluded with multiple calls to this method. All calls must precede the final call to FindComponents. FindComponents generates SELECTED_OUTPUT 333 and USER_PUNCH 333 data blocks that make the variables accessible. Variables will only be accessible if the system includes the given reactant; for example, no gas variables will be created if there are no GAS_PHASEs in the model.

Parameters
optionA string value, among those listed below, that includes or excludes variables from GetOutputVarNames, GetValue, and other BMI methods.
defA string value that can be "false", "true", or a list of items to be included as accessible variables. A value of "false", excludes all variables of the given type; a value of "true" includes all variables of the given type for the current system; a list specifies a subset of items of the given type.

Values for the the parameter option:

AddOutputVars: False excludes all variables; True causes the settings for each variable group to determine the variables that will be defined. Default True;

SolutionProperties: False excludes all solution property variables; True includes variables pH, pe, alkalinity, ionic strength, water mass, charge balance, percent error, and specific conductance. Default True.

SolutionTotalMolalities: False excludes all total element and element redox state variables; True includes all elements and element redox state variables for the system defined for the calculation; list restricts variables to the specified elements and redox states. Default True.

ExchangeMolalities: False excludes all variables related to exchange; True includes all variables related to exchange; list includes variables for the specified exchange species. Default True.

SurfaceMolalities: False excludes all variables related to surfaces; True includes all variables related to surfaces; list includes variables for the specified surface species. Default True.

EquilibriumPhases: False excludes all variables related to equilibrium phases; True includes all variables related to equilibrium phases; list includes variables for the specified equilibiurm phases. Default True.

Gases: False excludes all variables related to gases; True includes all variables related to gases; list includes variables for the specified gas components. Default True.

KineticReactants: False excludes all variables related to kinetic reactants; True includes all variables related to kinetic reactants; list includes variables for the specified kinetic reactants. Default True.

SolidSolutions: False excludes all variables related to solid solutions; True includes all variables related to solid solutions; list includes variables for the specified solid solutions components. Default True.

CalculateValues: False excludes all calculate values; True includes all calculate values; list includes the specified calculate values. CALCLUATE_VALUES can be used to calculate geochemical quantities not available in the other sets of variables. Default True.

SolutionActivities: False excludes all aqueous species; True includes all aqueous species; list includes only the specified aqueous species. Default False.

SolutionMolalities: False excludes all aqueous species; True includes all aqueous species; list includes only the specified aqueous species. Default False.

SaturationIndices: False excludes all saturation indices; True includes all saturation indices; list includes only the specified saturation indices. Default False.

Reimplemented from PhreeqcRM.

◆ CleanupBMIModuleInstances()

static void BMIPhreeqcRM::CleanupBMIModuleInstances ( void  )
static

◆ Construct()

void BMIPhreeqcRM::Construct ( Initializer  initializer)
overrideprotected

◆ CreateBMIModule() [1/2]

static int BMIPhreeqcRM::CreateBMIModule ( )
static

◆ CreateBMIModule() [2/2]

static int BMIPhreeqcRM::CreateBMIModule ( int  nxyz,
int  nthreads 
)
static

◆ DestroyBMIModule()

static IRM_RESULT BMIPhreeqcRM::DestroyBMIModule ( int  n)
static

◆ Finalize()

void BMIPhreeqcRM::Finalize ( )
override

Finalize closes any files open in the BMIPhreeqcRM instance.

C++ Example:
brm.Finalize();
 
MPI:
Called by root, workers must be in the loop of MpiWorker.

◆ GetComponentName()

std::string BMIPhreeqcRM::GetComponentName ( )
inlineoverride

GetComponentName returns the component name–"BMI PhreeqcRM". BMI PhreeqcRM is a partial interface to PhreeqcRM, and provides the methods to implement chemical reactions in a multicomponent transport model. All of the native PhreeqcRM methods (non BMI methods) are also available, which provides a complete interface to PhreeqcRM.

Return values
Thestring "BMI PhreeqcRM".
C++ Example:
std::string comp_name = brm.GetComponentName();
MPI:
Called by root.

◆ GetCurrentTime()

double BMIPhreeqcRM::GetCurrentTime ( )
override

GetCurrentTime returns the current simulation time, in seconds. (Same as GetTime.)

Return values
Thecurrent simulation time, in seconds.
See also
GetEndTime, GetTimeStep, SetValue, GetTime, GetTimeStep, SetTime, SetTimeStep.
C++ Example:
std::cout << "Current time: " << GetCurrentTime() << " seconds\n";
MPI:
Called by root.

◆ GetEndTime()

double BMIPhreeqcRM::GetEndTime ( )
override

GetEndTime returns GetCurrentTime plus GetTimeStep, in seconds.

Return values
Theend of the time step, in seconds.
See also
GetCurrentTime, GetTimeStep, SetValue, GetTime, GetTimeStep, SetTime, SetTimeStep.
C++ Example:
std::cout << "End of time step " << GetEndTime() << " seconds\n";
MPI:
Called by root.

◆ GetGridEdgeCount()

int BMIPhreeqcRM::GetGridEdgeCount ( const int  grid)
inlineoverride

GetGridEdgeCount is not implemented.

◆ GetGridEdgeNodes()

void BMIPhreeqcRM::GetGridEdgeNodes ( const int  grid,
int *  edge_nodes 
)
inlineoverride

GetGridEdgeNodes is not implemented.

◆ GetGridFaceCount()

int BMIPhreeqcRM::GetGridFaceCount ( const int  grid)
inlineoverride

GetGridFaceCount is not implemented.

◆ GetGridFaceEdges()

void BMIPhreeqcRM::GetGridFaceEdges ( const int  grid,
int *  face_edges 
)
inlineoverride

GetGridFaceEdges is not implemented.

◆ GetGridFaceNodes()

void BMIPhreeqcRM::GetGridFaceNodes ( const int  grid,
int *  face_nodes 
)
inlineoverride

GetGridFaceNodes is not implemented.

◆ GetGridNodeCount()

int BMIPhreeqcRM::GetGridNodeCount ( const int  grid)
inlineoverride

GetGridNodeCount is not implemented.

◆ GetGridNodesPerFace()

void BMIPhreeqcRM::GetGridNodesPerFace ( const int  grid,
int *  nodes_per_face 
)
inlineoverride

GetGridNodesPerFace is not implemented.

◆ GetGridOrigin()

void BMIPhreeqcRM::GetGridOrigin ( const int  grid,
double *  origin 
)
inlineoverride

GetGridOrigin is not implemented.

◆ GetGridRank()

int BMIPhreeqcRM::GetGridRank ( const int  grid)
override

GetGridRank returns a rank of 1 for grid 0. BMIPhreeqcRM only has a 1D series of cells; any grid or spatial information must be found in the user's model.

Parameters
gridGrid number, only grid 0 is considered.
Return values
Rankof 1 is returned for grid 0; 0 for all other values of grid.

◆ GetGridShape()

void BMIPhreeqcRM::GetGridShape ( const int  grid,
int *  shape 
)
inlineoverride

GetGridShape is not implemented.

◆ GetGridSize()

int BMIPhreeqcRM::GetGridSize ( const int  grid)
override

GetGridSize returns the number of cells specified at creation of the BMIPhreeqcRM instance.

Parameters
gridGrid number, only grid 0 is considered.
Return values
Numberof cells in the user's modle (same value as GetGridCellCount) is returned for grid 0; 0 for all other values of grid.

◆ GetGridSpacing()

void BMIPhreeqcRM::GetGridSpacing ( const int  grid,
double *  spacing 
)
inlineoverride

GetGridSpacing is not implemented.

◆ GetGridType()

std::string BMIPhreeqcRM::GetGridType ( const int  grid)
override

GetGridType is considered to be points. No grid information is available in BMIPhreeqcRM; all grid information must be found in the user's model.

Parameters
gridGrid number, only grid 0 is considered.
Return values
Pointsis returned for grid 0; "Undefined grid identifier" is returned for all other values of grid.

◆ GetGridX()

void BMIPhreeqcRM::GetGridX ( const int  grid,
double *  x 
)
inlineoverride

GetGridX is not implemented.

◆ GetGridY()

void BMIPhreeqcRM::GetGridY ( const int  grid,
double *  y 
)
inlineoverride

GetGridY is not implemented.

◆ GetGridZ()

void BMIPhreeqcRM::GetGridZ ( const int  grid,
double *  z 
)
inlineoverride

GetGridZ is not implemented.

◆ GetInputItemCount()

int BMIPhreeqcRM::GetInputItemCount ( )
override

GetInputVarNames returns the count of input variables that can be set with SetValue.

Return values
Countof input variables that can be set with SetValue.
See also
GetInputVarNames, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits, SetValue.
C++ Example:
int count = brm.GetInputItemCount();
std::vector< std::string > InputVarNames = brm.GetInputVarNames();
oss << "SetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << InputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(InputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(InputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(InputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(InputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(InputVarNames[i]) /
           brm.GetVarItemsize(InputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetInputVarNames()

std::vector< std::string > BMIPhreeqcRM::GetInputVarNames ( )
override

GetInputVarNames returns a list of the variable names that can be set with SetValue.

Return values
Astd::vector of the names of variables that can be set with SetValue.
See also
GetInputItemCount, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits, SetValue.
C++ Example:
std::vector< std::string > InputVarNames = brm.GetInputVarNames();
int count = brm.GetInputItemCount();
oss << "SetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << InputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(InputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(InputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(InputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(InputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(InputVarNames[i]) /
           brm.GetVarItemsize(InputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetInstance()

static BMIPhreeqcRM * BMIPhreeqcRM::GetInstance ( int  n)
static

◆ GetOutputItemCount()

int BMIPhreeqcRM::GetOutputItemCount ( )
override

GetOutputItemCount returns the count of output variables that can be retrieved with GetValue.

Return values
Countof output variables that can be retrieved with GetValue.
See also
GetOutputVarNames, GetValue, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
int count = brm.GetOutputItemCount();
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
           brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetOutputVarNames()

std::vector< std::string > BMIPhreeqcRM::GetOutputVarNames ( )
override

GetOutputVarNames returns a list of the variable names that can be retrieved with GetValue.

Return values
Alist of the names of variable that can be retrieved with GetValue.
See also
GetOutputItemCount, GetValue, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
int count = brm.GetOutputItemCount();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
           brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetPointableItemCount()

int BMIPhreeqcRM::GetPointableItemCount ( )

GetPointableItemCount returns the count of variables for which pointers can be obtained with GetValuePtr. The pointers point to current copies of the variables. Setting a value with one of the pointers will have no effect on the simulation, but will corrupt the copy of the variable.

Return values
Countof pointers to variables that can be accessed with GetValuePtr.
See also
GetPointableVarNames, GetValue, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
int count = brm.GetPointableItemCount();
std::vector< std::string > PointableVarNames = brm.GetPointableVarNames();
oss << "GetValuePtr variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << PointableVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(PointableVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(PointableVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(PointableVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(PointableVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(PointableVarNames[i]) /
           brm.GetVarItemsize(PointableVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetPointableVarNames()

std::vector< std::string > BMIPhreeqcRM::GetPointableVarNames ( )

GetPointableVarNames returns a list of the names of variables for which pointers can be retrieved with GetValuePtr.

Return values
Alist of the names of variables for which pointers can be retieved with GetValuePtr.
See also
GetPointableItemCount, GetValue, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
std::vector< std::string > PointableVarNames = brm.GetPointableVarNames();
int count = brm.GetPointableItemCount();
oss << "GetValuePtr variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << PointableVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(PointableVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(PointableVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(PointableVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(PointableVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(PointableVarNames[i]) /
           brm.GetVarItemsize(PointableVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetReadOnlyVarNames()

std::vector< std::string > BMIPhreeqcRM::GetReadOnlyVarNames ( )

◆ GetStartTime()

double BMIPhreeqcRM::GetStartTime ( )
override

GetStartTime returns the current simulation time, in seconds. (Same as GetCurrentTime or GetTime.)

Return values
Thecurrent simulation time, in seconds.

◆ GetTimeStep()

double BMIPhreeqcRM::GetTimeStep ( void  )
inlineoverride

◆ GetTimeUnits()

std::string BMIPhreeqcRM::GetTimeUnits ( )
inlineoverride

GetTimeUnits returns the time units of PhreeqcRM. All time units are seconds.

Return values
Returnsthe string "seconds".
See also
GetCurrentTime, GetEndTime, GetTimeStep, SetValue, GetTime, GetTimeStep, SetTime, SetTimeStep.
C++ Example:
std::cout << "BMIPhreeqcRM time units are " << GetTimeUnits() << ".\n";
MPI:
Called by root.

◆ GetValue() [1/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
bool &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [2/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
bool *  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [3/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
double &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [4/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
double *  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [5/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
int &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [6/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
int *  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [7/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
std::string &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [8/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
std::vector< double > &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [9/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
std::vector< int > &  OUTPUT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetValue() [10/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
std::vector< std::string > &  OUTPUT 
)

◆ GetValue() [11/11]

void BMIPhreeqcRM::GetValue ( const std::string  name,
void *  dest 
)
override

GetValue retrieves model variables. Only variables in the list provided by GetOutputVarNames can be retrieved.

Parameters
nameName of the variable to retrieve.
destVariable in which to place results. The dest variable can be of different types depending on the variable retrieved.

The following list gives the name in the first argument and the corresponding data type of the dest argument:


"ComponentCount", dest: int;
"Components", dest: std::vector< std::string >;
"Concentrations", dest: std::vector< double >;
"CurrentSelectedOutputUserNumber", dest: int;
"DensityCalculated", dest: std::vector< double >;
"ErrorString", dest: std::string;
"FilePrefix", dest: std::string;
"Gfw", dest: std::vector< double >;
"GridCellCount", dest: int;
"Porosity", dest: std::vector< double >;
"Pressure", dest: std::vector< double >;
"SaturationCalculated", dest: std::vector< double >;
"SelectedOutput", dest: std::vector< double >;
"SelectedOutputColumnCount", dest: int;
"SelectedOutputCount", dest: int;
"SelectedOutputHeadings", dest: std::vector< std::string >;
"SelectedOutputOn", dest: bool;
"SelectedOutputRowCount", dest: int;
"SolutionVolume", dest: std::vector< double >;
"Temperature", dest: std::vector< double >;
"Time", dest: double;
"TimeStep", dest: double,
"Viscosity", dest: std::vector< double >.

See also
GetOutputVarNames, GetOutputItemCount, GetValuePtr; GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
    std::vector< double > density;
    phreeqc_rm.GetValue("DensityCalculated", density);
    std::vector< std::string > comps;
    phreeqc_rm.GetValue("Components", comps);
MPI:
Called by root, workers must be in the loop of MpiWorker.

◆ GetValueAtIndices()

void BMIPhreeqcRM::GetValueAtIndices ( std::string  name,
void *  dest,
int *  inds,
int  count 
)
inlineoverride

GetValueAtIndices is not implemented

◆ GetValuePtr()

void * BMIPhreeqcRM::GetValuePtr ( std::string  name)
override

GetValuePtr takes a variable name and returns a pointer to a current copy of the variable values. Unlike the buffer returned from GetValue, the reference always points to the current values of the variable, even if the model's state has changed.

Parameters
nameName of the variable to retrieve.
Return values
Voidpointer to data. The following list gives the name in the argument and the data type the void pointer should be cast to:
"ComponentCount": int*;
"Concentrations": double*;
"DensityCalculated": double*;
"Gfw": double*;
"GridCellCount": int*;
"Porosity": double*;
"Pressure": double*;
"SaturationCalculated": double*;
"SelectedOutputOn": bool*;
"SolutionVolume": double*;
"Temperature": double*;
"Time": double*;
"TimeStep": double*;
"Viscosity": double*;

◆ GetVarGrid()

int BMIPhreeqcRM::GetVarGrid ( const std::string  name)
inlineoverride

GetVarGrid returns a value of 1, indicating points. BMIPhreeqcRM does not have a grid of its own. The cells of BMIPhreeqcRM are associated with the user's model grid, and all spatial characterists are assigned by the user's model.

Parameters
nameVaraiable name. (Return value is the same regardless of name.)
Return values
1BMIPhreeqcRM cells derive meaning from the user's model.

◆ GetVarItemsize()

int BMIPhreeqcRM::GetVarItemsize ( const std::string  name)
override

GetVarItemsize retrieves size of an individual item that can be set or retrived. Sizes may be sizeof(int), sizeof(double), or a character length for string variables.

Parameters
nameName of the variable to retrieve size.
Return values
Sizeof one element of the variable.
See also
GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
int count = brm.GetOutputItemCount();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
           brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetVarLocation()

std::string BMIPhreeqcRM::GetVarLocation ( const std::string  name)
inlineoverride

GetVarLocation has no explicit meaning in BMIPhreeqcRM. All grid-related information derives from the user's model.

Parameters
nameName of the variable, but not used.
Return values
Thestring "Unknown" is returned.

◆ GetVarNbytes()

int BMIPhreeqcRM::GetVarNbytes ( const std::string  name)
override

GetVarNbytes retrieves the total number of bytes that are set for a variable with SetValue, retrieved for a variable with GetValue, or pointed to by GetValuePtr.

Parameters
nameName of the variable to retrieve total bytes.
Return values
Totalnumber of bytes set, retrieved, or pointed to for variable.
See also
GetVarItemsize, GetVarType, GetVarUnits.
C++ Example:
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
int count = brm.GetOutputItemCount();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
        brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI :
Called by root.

◆ GetVarType()

std::string BMIPhreeqcRM::GetVarType ( const std::string  name)
override

GetVarType retrieves the type of a variable that can be set with SetValue, retrieved with GetValue, or pointed to by GetValuePtr. Types are "int", "double", "std::string", or "std::vector<std::string>".

Parameters
nameName of the variable to retrieve type.
Return values
Characterstring of variable type.
See also
GetVarNbytes, GetVarItemsize, GetVarUnits.
C++ Example:
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
int count = brm.GetOutputItemCount();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
           brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ GetVarUnits()

std::string BMIPhreeqcRM::GetVarUnits ( const std::string  name)
override

GetVarUnits retrieves the units of a variable that can be set with SetValue, retrieved with GetValue, or pointed to by GetValuePtr.

Parameters
nameName of the variable to retrieve units.
Return values
Characterstring of units for variable.
See also
GetVarNbytes, GetVarItemsize, GetVarType.
C++ Example:
std::vector< std::string > OutputVarNames = brm.GetOutputVarNames();
int count = brm.GetOutputItemCount();
oss << "GetValue variables:\n";
for (size_t i = 0; i < count; i++)
{
    oss << "  " << i << "  " << OutputVarNames[i] << "\n";
    oss << "     Type:        " << brm.GetVarType(OutputVarNames[i]) << "\n";
    oss << "     Units:       " << brm.GetVarUnits(OutputVarNames[i]) << "\n";
    oss << "     Total bytes: " << brm.GetVarNbytes(OutputVarNames[i]) << "\n";
    oss << "     Item bytes:  " << brm.GetVarItemsize(OutputVarNames[i]) << "\n";
    oss << "     Dim:         " << brm.GetVarNbytes(OutputVarNames[i]) /
           brm.GetVarItemsize(OutputVarNames[i]) << "\n";
}
MPI:
Called by root.

◆ Initialize()

void BMIPhreeqcRM::Initialize ( std::string  config_file = "")
override

Initialize must be called to initialize a BMIPhreeqcRM instance. A YAML file is normally used for initialization; however, an empty string can be used for the file name when initializing without use of a YAML file.

The YAML file contains a YAML map of PhreeqcRM methods and data corresponding to each PhreeqcRM method. For example,

    - key: LoadDatabase
      database: phreeqc.dat
    - key: RunFile
      workers: true
      initial_phreeqc: true
      utility: true
      chemistry_name: advect.pqi

Initialize will read the YAML file and execute the specified methods with the specified arguments. Using YAML terminology, the argument(s) for a method may be a scalar, a sequence, or a map, depending if the argument is a single item, a single vector, or there are multiple arguments. In the case of a map, the name associated with each argument (for example "chemistry_name" above) is arbitrary. The names of the map keys for map arguments are not used in parsing the YAML file; only the order of the arguments is important.

The PhreeqcRM methods that can be specified in a YAML file include:

CloseFiles();
CreateMapping(std::vector< int >& grid2chem);
DumpModule();
FindComponents();
InitialEquilibriumPhases2Module(std::vector< int > equilibrium_phases);
InitialExchanges2Module(std::vector< int > exchanges);
InitialGasPhases2Module(std::vector< int > gas_phases);
InitialKineticss2Module(std::vector< int > kinetics);
InitialSolidSolutions2Module(std::vector< int > solid_solutions);
InitialSolutions2Module(std::vector< int > solutions);
InitialSurfaces2Module(std::vector< int > surfaces);
InitialPhreeqc2Module(std::vector< int > initial_conditions1);
InitialPhreeqc2Module(std::vector< int > initial_conditions1,
    std::vector< int > initial_conditions2, std::vector< double > fraction1);
InitialPhreeqcCell2Module(int n, std::vector< int > cell_numbers);
LoadDatabase(std::string database);
OpenFiles();
OutputMessage(std::string str);
RunCells();
RunFile(bool workers, bool initial_phreeqc,
     bool utility, std::string chemistry_name);
RunString(bool workers, bool initial_phreeqc, bool utility, std::string input_string);
ScreenMessage(std::string str);
SetComponentH2O(bool tf);
SetConcentrations(std::vector< double > c);
SetCurrentSelectedOutputUserNumber(int n_user);
SetDensityUser(std::vector< double > density);
SetDumpFileName(std::string dump_name);
SetErrorHandlerMode(int mode);
SetErrorOn(bool tf);
SetFilePrefix(std::string prefix);
SetGasCompMoles(std::vector< double > gas_moles);
SetGasPhaseVolume(std::vector< double > gas_volume);
SetPartitionUZSolids(bool tf);
SetPorosity(std::vector< double > por);
SetPressure(std::vector< double > p);
SetPrintChemistryMask(std::vector< int > cell_mask);
SetPrintChemistryOn(bool workers, bool initial_phreeqc, bool utility);
SetRebalanceByCell(bool tf);
SetRebalanceFraction(double f);
SetRepresentativeVolume(std::vector< double > rv);
SetSaturationUser(std::vector< double > sat);
SetScreenOn(bool tf);
SetSelectedOutputOn(bool tf);
SetSpeciesSaveOn(bool save_on);
SetTemperature(std::vector< double > t);
SetTime(double time);
SetTimeConversion(double conv_factor);
SetTimeStep(double time_step);
SetUnitsExchange(int option);
SetUnitsGasPhase(int option);
SetUnitsKinetics(int option);
SetUnitsPPassemblage(int option);
SetUnitsSolution(int option);
SetUnitsSSassemblage(int option);
SetUnitsSurface(int option);
SpeciesConcentrations2Module(std::vector< double > species_conc);
StateSave(int istate);
StateApply(int istate);
StateDelete(int istate);
UseSolutionDensityVolume(bool tf);
WarningMessage(std::string warnstr);

See also
Update.
C++ Example:
int nthreads = 0;
std::string yaml_file = "myfile.yaml";
int nxyz = GetGridCellCountYAML(yaml_file);
BMIPhreeqcRM brm(nxyz, nthreads);
brm.Initialize(yaml_file);
int ncomps;
brm.GetValue("ComponentCount", &ncomps);
int ngrid;
brm.GetValue("GridCellCount", &ngrid);
std::vector< double > c;
brm.GetValue("Concentrations", c);
brm.SetValue("TimeStep", 86400);
for(double time = 0; time < 864000; time+=86400)
{
    // Take a transport time step here and update the vector c.
    brm.SetValue("Time", time);
    brm.SetValue("Concentrations", c);
    brm.Update();
    brm.GetValue("Concentrations", c);
}
MPI:
Called by root, workers must be in the loop of MpiWorker.

◆ SetLanguage()

IRM_RESULT BMIPhreeqcRM::SetLanguage ( const char *  string)
inline

◆ SetValue() [1/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
bool  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [2/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
const char *  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [3/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
const std::string  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [4/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
double  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [5/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
int  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [6/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
std::vector< double >  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [7/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
std::vector< int >  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [8/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
std::vector< std::string >  src 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetValue() [9/9]

void BMIPhreeqcRM::SetValue ( const std::string  name,
void *  src 
)
override

SetValue sets model variables. Only variables in the list provided by GetInputVarNames can be set.

Parameters
nameName of the variable to retrieve.
srcData used to set the variable. The src data type can vary depending on the variable retrieved.

The following list gives the name in the first argument and the corresponding data type and size of the src argument:

"Concentrations", std::vector, [GridCellCount*ComponentCount];
"DensityUser", std::vector, [GridCellCount];
"FilePrefix", std::string;
"NthSelectedOutput", int;
"Porosity", std::vector, [GridCellCount];
"Pressure", std::vector, [GridCellCount];
"SaturationUser", std::vector, [GridCellCount];
"SelectedOutputOn", bool;
"Temperature", std::vector, [GridCellCount];
"Time", double;
"TimeStep", double;

See also
GetInputVarNames, GetInputItemCount, GetValue, GetVarItemsize, GetVarNbytes, GetVarType, GetVarUnits.
C++ Example:
std::vector< double > temperature(ngrid, 28.0);
phreeqc_rm.SetValue("Temperature", temperature);
MPI:
Called by root, workers must be in the loop of MpiWorker.

◆ SetValueAtIndices()

void BMIPhreeqcRM::SetValueAtIndices ( std::string  name,
int *  inds,
int  count,
void *  src 
)
inlineoverride

SetValueAtIndices is not implemented.

◆ Update()

void BMIPhreeqcRM::Update ( )
override

Update runs PhreeqcRM for one time step. PhreeqcRM will equilibrate the solutions with all equilibrium reactants (EQUILIBRIUM_PHASES, EXCHANGE, GAS_PHASE, SOLID_SOLUTIONS, and SURFACE) and integrate KINETICS reactions for the specified time step (TimeStep or SetTimeStep).

See also
Initialize, UpdateUntil.
C++ Example:
BMIPhreeqcRM brm(nxyz, nthreads);
brm.Initialize("myfile.yaml");
int ncomps;
brm.GetValue("ComponentCount", &ncomps);
int ngrid;
brm.GetValue("GridCellCount", &ngrid);
std::vector< double > c;
brm.GetValue("Concentrations", c);
brm.SetValue("TimeStep", 86400);
for(double time = 0; time < 864000; time+=86400)
{
    // Take a transport time step here and update the vector c.
    brm.SetValue("Time", time);
    brm.SetValue("Concentrations", c);
    brm.Update();
    brm.GetValue("Concentrations", c);
}
MPI:
Called by root, workers must be in the loop of MpiWorker.

◆ UpdateUntil()

void BMIPhreeqcRM::UpdateUntil ( double  end_time)
override

UpdateUntil is the same as Update, except the time step is calculated from the argument end_time. The time step is calculated to be end_time minus the current time (GetCurrentTime).

Parameters
end_timeTime at the end of the time step.
See also
Initialize, Update.
C++ Example:
BMIPhreeqcRM brm(nxyz, nthreads);
brm.Initialize("myfile.yaml");
int ncomps;
brm.GetValue("ComponentCount", &ncomps);
int ngrid;
brm.GetValue("GridCellCount", &ngrid);
std::vector< double > c;
brm.GetValue("Concentrations", c);
for(double time = 0; time < 864000; time+=86400)
{
    // Take a transport time step here and update the vector c.
    brm.SetValue("Time", time);
    brm.SetValue("Concentrations", c);
    brm.UpdateUntil(time + 86400.0);
    brm.GetValue("Concentrations", c);
}
MPI:
Called by root, workers must be in the loop of MpiWorker.

Member Data Documentation

◆ language

std::string BMIPhreeqcRM::language

The documentation for this class was generated from the following file: