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)
export(DistributeKinMatrix)
export(DistributeMatrix)
export(ElementalBalanceMin)
export(ExtractPphases)
export(ExtractSamples)
export(ExtractSpecies)
export(ExtractTotals)
......
## Functions for dealing with simulations with kinetics
### 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)
##' through \code{phreeqc}, which has been already loaded as
......@@ -119,22 +119,26 @@ DistributeKin <- function(input, prop=NULL, values, ident="-m0")
return(newinp)
}
##' TODO
##'
##' TODO
##' @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 splitted
##' @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
##' splitted
##' @param procs How many processors?
##' @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 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 dt time step
##' @param ann optional annotation to be postponed to the values
##' @param nmax minimum number of simulations in one "split"
##' @param verbose logical, defaulting to FALSE. If TRUE, some message are displayed
##' @return a list of length "procs" with the inputs, ready to be run in parallel
##' @param verbose logical, defaulting to FALSE. If TRUE, some message
##' are displayed
##' @return a list of length "procs" with the inputs, ready to be run
##' in parallel
##' @author MDL
##' @export
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)
}
##' 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
##' @param input The input buffer to manipulate
##' @param prop The names of properties to distribute
......@@ -357,7 +359,8 @@ DistributeKinMatrix <- function(input, prop, values, minerals, kin, dt, ann)
##' @param prop vector containing the names of the properties
##' @param minerals indeces of EQUILIBRIUM minerals
##' @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
##' @author MDL
##' @export
......
......@@ -7,7 +7,8 @@
AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U)
}
\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}
......@@ -21,7 +22,12 @@ AdvectionPQC(conc, inflow = rep(0, ncol(conc)), dx, dt, U)
a matrix containing the state after the advection
}
\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{
MDL
......
......@@ -27,9 +27,6 @@ input buffer with the values in correct places
\description{
This function \link{DistributeKin} a matrix of properties values into a buffer
}
\details{
TODO
}
\author{
MDL
}
......@@ -11,9 +11,6 @@ ExtractPphases(flatlist, pphases)
\item{pphases}{character vector containing the names of the Pure
Phases whose values are to be extracted}
\item{species}{vector containing the names of the species to
search for}
}
\value{
a matrix containing as many columns as specified pphases
......
......@@ -73,7 +73,7 @@ a list containing lots of stuff. Each element of the list
after the chemistry
}
\description{
TODO
Cfr \code{demo}
}
\author{
MDL
......
......@@ -15,7 +15,7 @@ RecomposeState(state, reduced)
a state with the original (full-grid) number of elements
}
\description{
TODO
Recompose a chemical state after reduction
}
\author{
MDL
......
......@@ -10,14 +10,13 @@ ReduceState(data)
\item{data}{the matrix}
}
\value{
a matrix plus an attribute containing the indeces of the
compressed matrix
a matrix with attached attribute containing the indeces of
the compressed matrix for later restoring and the "immobile"
indices
}
\description{
This functions requires the package \code{mgcv}
}
\details{
TODO
Applies \code{mgcv::uniquecombs} to the matrix representing the
current chemical state.
}
\author{
MDL
......
......@@ -30,7 +30,8 @@ splitMultiFix(
\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{
a list with n=procs inputs
......
......@@ -2,7 +2,8 @@
% Please edit documentation in R/Rphree_Kinetics.R
\name{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{
splitMultiKin(
data,
......@@ -19,17 +20,20 @@ splitMultiKin(
)
}
\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{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{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}
......@@ -39,16 +43,16 @@ splitMultiKin(
\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{
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{
TODO
}
\details{
TODO
Splits a named matrix of data (a column is a variable) in n
simulations to run in parallel
}
\author{
MDL
......
Markdown is supported
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