Commit 2a58aebd authored by Marco De Lucia's avatar Marco De Lucia
Browse files

Renamed RReadOut* to ReadOut

parent 05d337ff
...@@ -34,11 +34,11 @@ export(RPhreeExt) ...@@ -34,11 +34,11 @@ export(RPhreeExt)
export(RPhreeFile) export(RPhreeFile)
export(RPhreeWriteInp) export(RPhreeWriteInp)
export(RPinfo) export(RPinfo)
export(RReadOut)
export(RReadOutKin)
export(RReadOutVal)
export(ReactTranspBalanceEq) export(ReactTranspBalanceEq)
export(ReactTranspBalanceKin) export(ReactTranspBalanceKin)
export(ReadOut)
export(ReadOutKin)
export(ReadOutVal)
export(RecomposeState) export(RecomposeState)
export(ReduceState) export(ReduceState)
export(RepSol) export(RepSol)
......
### File-related utility functions for RedModRphree ### File-related utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-29 18:02:02 delucia" ### Time-stamp: "Last modified 2021-06-27 16:16:16 delucia"
##' Reads a normal PHREEQC input file and prepares it for ##' Reads a normal PHREEQC input file and prepares it for
...@@ -73,8 +73,8 @@ RPhreeWriteInp <- function(ofile,input) ...@@ -73,8 +73,8 @@ RPhreeWriteInp <- function(ofile,input)
##' calculation were made with Rphree. ##' calculation were made with Rphree.
##' ##'
##' Currently all blocks are read. For simulations with kinetics the ##' Currently all blocks are read. For simulations with kinetics the
##' function to use is \code{\link{RReadOutKin}}. ##' function to use is \code{\link{ReadOutKin}}.
##' @title RReadOut, parse a PHREEQC output file ##' @title ReadOut, parse a PHREEQC output file
##' @param out The PHREEQC output file. ##' @param out The PHREEQC output file.
##' @return An output list, as if the simulation would have being run ##' @return An output list, as if the simulation would have being run
##' through Rphree (the same blocks and the same names are returned) ##' through Rphree (the same blocks and the same names are returned)
...@@ -82,9 +82,9 @@ RPhreeWriteInp <- function(ofile,input) ...@@ -82,9 +82,9 @@ RPhreeWriteInp <- function(ofile,input)
##' @export ##' @export
##' @examples ##' @examples
##' \dontrun{ ##' \dontrun{
##' out <- RReadOut("ex.out") ##' out <- ReadOut("ex.out")
##' } ##' }
RReadOut <- function(out) ReadOut <- function(out)
{ {
if (length(out)==1) {## is it a buffer or a file? if (length(out)==1) {## is it a buffer or a file?
## note that empty lines are removed! ## note that empty lines are removed!
...@@ -247,7 +247,7 @@ RReadOut <- function(out) ...@@ -247,7 +247,7 @@ RReadOut <- function(out)
##' Kinetics simulation: reads a PHREEQC output file or buffer and ##' Kinetics simulation: reads a PHREEQC output file or buffer and
##' forms an output list. ##' forms an output list.
##' @title RReadOutKin, imports the output file of a kinetic ##' @title ReadOutKin, imports the output file of a kinetic
##' simulation into R ##' simulation into R
##' @param out The PHREEQC output file or buffer ##' @param out The PHREEQC output file or buffer
##' @param verbose logical. If TRUE more output is given to the ##' @param verbose logical. If TRUE more output is given to the
...@@ -256,7 +256,7 @@ RReadOut <- function(out) ...@@ -256,7 +256,7 @@ RReadOut <- function(out)
##' "logical block": desc, tot, pphases, species, kin ##' "logical block": desc, tot, pphases, species, kin
##' @author MDL ##' @author MDL
##' @export ##' @export
RReadOutKin <- function(out, verbose=FALSE) ReadOutKin <- function(out, verbose=FALSE)
{ {
if (length(out)==1) {## is it a buffer or a file? if (length(out)==1) {## is it a buffer or a file?
## note that empty lines are removed! ## note that empty lines are removed!
...@@ -414,7 +414,7 @@ RReadOutKin <- function(out, verbose=FALSE) ...@@ -414,7 +414,7 @@ RReadOutKin <- function(out, verbose=FALSE)
##' This version looks for a precise valence of an element. It is used ##' This version looks for a precise valence of an element. It is used
##' primarily by \code{Pourbaix} to track the species and the SIs ##' primarily by \code{Pourbaix} to track the species and the SIs
##' which must be retained for the diagram. ##' which must be retained for the diagram.
##' @title RReadOutVal, parse a PHREEQC output file/buffer in search ##' @title ReadOutVal, parse a PHREEQC output file/buffer in search
##' of specific valence state of an element ##' of specific valence state of an element
##' @param out The PHREEQC output file or buffer ##' @param out The PHREEQC output file or buffer
##' @param valence the specified element valence, e.g., Fe(2) ##' @param valence the specified element valence, e.g., Fe(2)
...@@ -422,7 +422,7 @@ RReadOutKin <- function(out, verbose=FALSE) ...@@ -422,7 +422,7 @@ RReadOutKin <- function(out, verbose=FALSE)
##' "logical block": desc, tot, pphases, species ##' "logical block": desc, tot, pphases, species
##' @author MDL ##' @author MDL
##' @export ##' @export
RReadOutVal <- function(out, valence) ReadOutVal <- function(out, valence)
{ {
if (length(out)==1) {## is it a buffer or a file? if (length(out)==1) {## is it a buffer or a file?
## note that empty lines are removed! ## note that empty lines are removed!
......
### Licence: LGPL version 2.1 ### Licence: LGPL version 2.1
## Time-stamp: "Last modified 2021-04-29 15:56:47 delucia" ## Time-stamp: "Last modified 2021-06-27 16:17:00 delucia"
##' @title Revert a string ##' @title Revert a string
##' @param x character vector. All element of the vector will be ##' @param x character vector. All element of the vector will be
...@@ -235,7 +235,7 @@ Pourbaix <- function(element, ...@@ -235,7 +235,7 @@ Pourbaix <- function(element,
has_valence <- FALSE has_valence <- FALSE
if (missing(element)) { if (missing(element)) {
utils::capture.output(res <- RReadOutVal(con)[[1]]) utils::capture.output(res <- ReadOutVal(con)[[1]])
selout <- FormSelectedOutput(res) selout <- FormSelectedOutput(res)
} else { } else {
## first we distinguish if we want total amount of element or a specific valence ## first we distinguish if we want total amount of element or a specific valence
...@@ -246,10 +246,10 @@ Pourbaix <- function(element, ...@@ -246,10 +246,10 @@ Pourbaix <- function(element,
## strip the parentheses from valence to get the element ## strip the parentheses from valence to get the element
element <- sub("\\(.*\\)", "", valence) element <- sub("\\(.*\\)", "", valence)
msg("Restricting the calculation to the oxidation state", valence) msg("Restricting the calculation to the oxidation state", valence)
utils::capture.output(res <- RReadOutVal(con, valence)[[1]]) utils::capture.output(res <- ReadOutVal(con, valence)[[1]])
selout <- FormSelectedOutput(res, element) selout <- FormSelectedOutput(res, element)
} else { } else {
utils::capture.output(res <- RReadOutVal(con)[[1]]) utils::capture.output(res <- ReadOutVal(con)[[1]])
selout <- FormSelectedOutput(res, element) selout <- FormSelectedOutput(res, element)
} }
} }
......
## Functions for dealing with surrogate simulations ## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-29 18:05:53 delucia" ### Time-stamp: "Last modified 2021-06-27 16:17:52 delucia"
##' Computes the average of absolute values of a vector ##' Computes the average of absolute values of a vector
##' @title Average of absolute values ##' @title Average of absolute values
...@@ -110,7 +110,7 @@ ExtractTotals <- function(flatlist, totals) { ...@@ -110,7 +110,7 @@ ExtractTotals <- function(flatlist, totals) {
##' @title Scan a list of Rphree simulations to form stoichiometric ##' @title Scan a list of Rphree simulations to form stoichiometric
##' matrix ##' matrix
##' @param flatlist a flatted list of Rphree simulations ##' @param flatlist a flatted list of Rphree simulations
##' @param db database (as read by RReadFile(..., is.db=TRUE)) ##' @param db database (as read by ReadFile(..., is.db=TRUE))
##' @param species vector containing all species to be included in the ##' @param species vector containing all species to be included in the
##' stoichiometric matrix. If omitted, the flat list is searched ##' stoichiometric matrix. If omitted, the flat list is searched
##' for all possible species ##' for all possible species
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R % Please edit documentation in R/Rphree_Files.R
\name{RReadOut} \name{ReadOut}
\alias{RReadOut} \alias{ReadOut}
\title{RReadOut, parse a PHREEQC output file} \title{ReadOut, parse a PHREEQC output file}
\usage{ \usage{
RReadOut(out) ReadOut(out)
} }
\arguments{ \arguments{
\item{out}{The PHREEQC output file.} \item{out}{The PHREEQC output file.}
...@@ -19,11 +19,11 @@ calculation were made with Rphree. ...@@ -19,11 +19,11 @@ calculation were made with Rphree.
} }
\details{ \details{
Currently all blocks are read. For simulations with kinetics the Currently all blocks are read. For simulations with kinetics the
function to use is \code{\link{RReadOutKin}}. function to use is \code{\link{ReadOutKin}}.
} }
\examples{ \examples{
\dontrun{ \dontrun{
out <- RReadOut("ex.out") out <- ReadOut("ex.out")
} }
} }
\author{ \author{
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R % Please edit documentation in R/Rphree_Files.R
\name{RReadOutKin} \name{ReadOutKin}
\alias{RReadOutKin} \alias{ReadOutKin}
\title{RReadOutKin, imports the output file of a kinetic \title{ReadOutKin, imports the output file of a kinetic
simulation into R} simulation into R}
\usage{ \usage{
RReadOutKin(out, verbose = FALSE) ReadOutKin(out, verbose = FALSE)
} }
\arguments{ \arguments{
\item{out}{The PHREEQC output file or buffer} \item{out}{The PHREEQC output file or buffer}
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R % Please edit documentation in R/Rphree_Files.R
\name{RReadOutVal} \name{ReadOutVal}
\alias{RReadOutVal} \alias{ReadOutVal}
\title{RReadOutVal, parse a PHREEQC output file/buffer in search \title{ReadOutVal, parse a PHREEQC output file/buffer in search
of specific valence state of an element} of specific valence state of an element}
\usage{ \usage{
RReadOutVal(out, valence) ReadOutVal(out, valence)
} }
\arguments{ \arguments{
\item{out}{The PHREEQC output file or buffer} \item{out}{The PHREEQC output file or buffer}
......
...@@ -10,7 +10,7 @@ StoichiometricMatrix(flatlist, db, species, pphases) ...@@ -10,7 +10,7 @@ StoichiometricMatrix(flatlist, db, species, pphases)
\arguments{ \arguments{
\item{flatlist}{a flatted list of Rphree simulations} \item{flatlist}{a flatted list of Rphree simulations}
\item{db}{database (as read by RReadFile(..., is.db=TRUE))} \item{db}{database (as read by ReadFile(..., is.db=TRUE))}
\item{species}{vector containing all species to be included in the \item{species}{vector containing all species to be included in the
stoichiometric matrix. If omitted, the flat list is searched stoichiometric matrix. If omitted, the flat list is searched
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment