Commit 0945ecdf authored by Marco De Lucia's avatar Marco De Lucia
Browse files

MDL: fixes for CRAN submission

parent be82c72c
...@@ -11,6 +11,7 @@ export(DistributeKin) ...@@ -11,6 +11,7 @@ export(DistributeKin)
export(DistributeKinMatrix) export(DistributeKinMatrix)
export(DistributeMatrix) export(DistributeMatrix)
export(ElementalBalanceMin) export(ElementalBalanceMin)
export(ExtractPphases)
export(ExtractSamples) export(ExtractSamples)
export(ExtractSpecies) export(ExtractSpecies)
export(ExtractTotals) export(ExtractTotals)
......
## Functions for dealing with simulations with kinetics ## Functions for dealing with simulations with kinetics
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-28 15:19:27 delucia" ### Time-stamp: "Last modified 2021-04-28 16:06:07 delucia"
##' This function runs the generated input buffer (or a list thereof) ##' This function runs the generated input buffer (or a list thereof)
##' through \code{phreeqc}, which has been already loaded as ##' through \code{phreeqc}, which has been already loaded as
...@@ -119,22 +119,26 @@ DistributeKin <- function(input, prop=NULL, values, ident="-m0") ...@@ -119,22 +119,26 @@ DistributeKin <- function(input, prop=NULL, values, ident="-m0")
return(newinp) return(newinp)
} }
##' TODO
##' ##' @title Splits a named matrix of data (a column is a variable) in n
##' TODO ##' simulations to run in parallel
##' @title Splits a named matrix of data (a column is a variable) in n simulations to run in parallel ##' @param data The matrix or data.frame containing the values to be
##' @param data The matrix or data.frame containing the values to be splitted ##' splitted
##' @param procs How many processors? ##' @param procs How many processors?
##' @param base The base script SOLUTION block ##' @param base The base script SOLUTION block
##' @param first The first block to be prepended to each generated input ##' @param first The first block to be prepended to each generated
##' input
##' @param prop The names of the properties ##' @param prop The names of the properties
##' @param minerals vector containing the indeces of the EQUILIBRIUM minerals ##' @param minerals vector containing the indeces of the EQUILIBRIUM
##' minerals
##' @param kin vector containing indeces of KINETICS minerals ##' @param kin vector containing indeces of KINETICS minerals
##' @param dt time step ##' @param dt time step
##' @param ann optional annotation to be postponed to the values ##' @param ann optional annotation to be postponed to the values
##' @param nmax minimum number of simulations in one "split" ##' @param nmax minimum number of simulations in one "split"
##' @param verbose logical, defaulting to FALSE. If TRUE, some message are displayed ##' @param verbose logical, defaulting to FALSE. If TRUE, some message
##' @return a list of length "procs" with the inputs, ready to be run in parallel ##' are displayed
##' @return a list of length "procs" with the inputs, ready to be run
##' in parallel
##' @author MDL ##' @author MDL
##' @export ##' @export
splitMultiKin <- function(data, procs, base, first, prop, minerals, kin, dt, ann, nmax=200, verbose=FALSE) splitMultiKin <- function(data, procs, base, first, prop, minerals, kin, dt, ann, nmax=200, verbose=FALSE)
...@@ -274,8 +278,6 @@ DistributeMatrix <- function(input, prop, values, minerals, SI=FALSE) ...@@ -274,8 +278,6 @@ DistributeMatrix <- function(input, prop, values, minerals, SI=FALSE)
} }
##' This function \link{DistributeKin} a matrix of properties values into a buffer ##' This function \link{DistributeKin} a matrix of properties values into a buffer
##'
##' TODO
##' @title Distribute all values from a matrix into a buffer, KINETICS case ##' @title Distribute all values from a matrix into a buffer, KINETICS case
##' @param input The input buffer to manipulate ##' @param input The input buffer to manipulate
##' @param prop The names of properties to distribute ##' @param prop The names of properties to distribute
...@@ -357,7 +359,8 @@ DistributeKinMatrix <- function(input, prop, values, minerals, kin, dt, ann) ...@@ -357,7 +359,8 @@ DistributeKinMatrix <- function(input, prop, values, minerals, kin, dt, ann)
##' @param prop vector containing the names of the properties ##' @param prop vector containing the names of the properties
##' @param minerals indeces of EQUILIBRIUM minerals ##' @param minerals indeces of EQUILIBRIUM minerals
##' @param nmax max number of simulations in each input ##' @param nmax max number of simulations in each input
##' @param verbose logical, defaulting to FALSE. If TRUE, some message are displayed ##' @param verbose logical, defaulting to FALSE. If TRUE, some message
##' are displayed
##' @return a list with n=procs inputs ##' @return a list with n=procs inputs
##' @author MDL ##' @author MDL
##' @export ##' @export
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U) AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U)
} }
\arguments{ \arguments{
\item{conc}{matrix containing the chemical state} \item{conc}{either a vector or a matrix containing the chemical
state to be updated}
\item{inflow}{vector of concentrations entering the inlet} \item{inflow}{vector of concentrations entering the inlet}
...@@ -21,7 +22,12 @@ AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U) ...@@ -21,7 +22,12 @@ AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U)
a matrix containing the state after the advection a matrix containing the state after the advection
} }
\description{ \description{
Todo This function takes the current state of a chemical system in form
of a matrix, a vector of concentrations representing boundary
conditions (injection), the required time step (dt/s), grid spcing
(dx/m) and U (Darcy velocity/m^3/s). Note that it is
responsibility of user to check that the required dt does not
trespass the CFL condition.
} }
\author{ \author{
MDL MDL
......
...@@ -27,9 +27,6 @@ input buffer with the values in correct places ...@@ -27,9 +27,6 @@ input buffer with the values in correct places
\description{ \description{
This function \link{DistributeKin} a matrix of properties values into a buffer This function \link{DistributeKin} a matrix of properties values into a buffer
} }
\details{
TODO
}
\author{ \author{
MDL MDL
} }
...@@ -11,9 +11,6 @@ ExtractPphases(flatlist, pphases) ...@@ -11,9 +11,6 @@ ExtractPphases(flatlist, pphases)
\item{pphases}{character vector containing the names of the Pure \item{pphases}{character vector containing the names of the Pure
Phases whose values are to be extracted} Phases whose values are to be extracted}
\item{species}{vector containing the names of the species to
search for}
} }
\value{ \value{
a matrix containing as many columns as specified pphases a matrix containing as many columns as specified pphases
......
...@@ -73,7 +73,7 @@ a list containing lots of stuff. Each element of the list ...@@ -73,7 +73,7 @@ a list containing lots of stuff. Each element of the list
after the chemistry after the chemistry
} }
\description{ \description{
TODO Cfr \code{demo}
} }
\author{ \author{
MDL MDL
......
...@@ -15,7 +15,7 @@ RecomposeState(state, reduced) ...@@ -15,7 +15,7 @@ RecomposeState(state, reduced)
a state with the original (full-grid) number of elements a state with the original (full-grid) number of elements
} }
\description{ \description{
TODO Recompose a chemical state after reduction
} }
\author{ \author{
MDL MDL
......
...@@ -10,14 +10,13 @@ ReduceState(data) ...@@ -10,14 +10,13 @@ ReduceState(data)
\item{data}{the matrix} \item{data}{the matrix}
} }
\value{ \value{
a matrix plus an attribute containing the indeces of the a matrix with attached attribute containing the indeces of
compressed matrix the compressed matrix for later restoring and the "immobile"
indices
} }
\description{ \description{
This functions requires the package \code{mgcv} Applies \code{mgcv::uniquecombs} to the matrix representing the
} current chemical state.
\details{
TODO
} }
\author{ \author{
MDL MDL
......
...@@ -30,7 +30,8 @@ splitMultiFix( ...@@ -30,7 +30,8 @@ splitMultiFix(
\item{nmax}{max number of simulations in each input} \item{nmax}{max number of simulations in each input}
\item{verbose}{logical, defaulting to FALSE. If TRUE, some message are displayed} \item{verbose}{logical, defaulting to FALSE. If TRUE, some message
are displayed}
} }
\value{ \value{
a list with n=procs inputs a list with n=procs inputs
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
% Please edit documentation in R/Rphree_Kinetics.R % Please edit documentation in R/Rphree_Kinetics.R
\name{splitMultiKin} \name{splitMultiKin}
\alias{splitMultiKin} \alias{splitMultiKin}
\title{Splits a named matrix of data (a column is a variable) in n simulations to run in parallel} \title{Splits a named matrix of data (a column is a variable) in n
simulations to run in parallel}
\usage{ \usage{
splitMultiKin( splitMultiKin(
data, data,
...@@ -19,17 +20,20 @@ splitMultiKin( ...@@ -19,17 +20,20 @@ splitMultiKin(
) )
} }
\arguments{ \arguments{
\item{data}{The matrix or data.frame containing the values to be splitted} \item{data}{The matrix or data.frame containing the values to be
splitted}
\item{procs}{How many processors?} \item{procs}{How many processors?}
\item{base}{The base script SOLUTION block} \item{base}{The base script SOLUTION block}
\item{first}{The first block to be prepended to each generated input} \item{first}{The first block to be prepended to each generated
input}
\item{prop}{The names of the properties} \item{prop}{The names of the properties}
\item{minerals}{vector containing the indeces of the EQUILIBRIUM minerals} \item{minerals}{vector containing the indeces of the EQUILIBRIUM
minerals}
\item{kin}{vector containing indeces of KINETICS minerals} \item{kin}{vector containing indeces of KINETICS minerals}
...@@ -39,16 +43,16 @@ splitMultiKin( ...@@ -39,16 +43,16 @@ splitMultiKin(
\item{nmax}{minimum number of simulations in one "split"} \item{nmax}{minimum number of simulations in one "split"}
\item{verbose}{logical, defaulting to FALSE. If TRUE, some message are displayed} \item{verbose}{logical, defaulting to FALSE. If TRUE, some message
are displayed}
} }
\value{ \value{
a list of length "procs" with the inputs, ready to be run in parallel a list of length "procs" with the inputs, ready to be run
in parallel
} }
\description{ \description{
TODO Splits a named matrix of data (a column is a variable) in n
} simulations to run in parallel
\details{
TODO
} }
\author{ \author{
MDL MDL
......
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