From 955f0e382457a9b152ca7498ac6287d2ab4be0cd Mon Sep 17 00:00:00 2001 From: cneyens Date: Thu, 1 Aug 2024 20:45:25 +0200 Subject: [PATCH] updated docs for cran submission --- DESCRIPTION | 10 ++++++---- R/plot.R | 2 +- cran-comments.md | 13 ++++++++++--- man/contours.Rd | 3 +++ vignettes/vign-01-overview.Rmd | 13 +++++++------ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4e6b3a1..1517104 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,12 +3,14 @@ Title: Analytic Element Modeling of Steady Single-Layer Groundwater Flow Version: 0.1.0 Authors@R: person("Cas", "Neyens", , "cas.neyens@gmail.com", role = c("aut", "cre", "cph")) -Description: Analytic element modeling of steady-state, single-layer - groundwater flow under the 'Dupuit-Forchheimer' assumption. Elements - such as wells, area-sinks and line-sinks can be placed at arbitrary +Description: A model of single-layer groundwater flow in steady-state + under the Dupuit-Forchheimer assumption can be created by placing + elements such as wells, area-sinks and line-sinks at arbitrary locations in the flow field. Output variables include hydraulic head and the discharge vector. Particle traces can be computed numerically - in three dimensions. + in three dimensions. The underlying theory is described in Haitjema + (1995) and references + therein. License: MIT + file LICENSE URL: https://github.com/cneyens/raem, https://cneyens.github.io/raem/ BugReports: https://github.com/cneyens/raem/issues diff --git a/R/plot.R b/R/plot.R index 303a286..711507f 100644 --- a/R/plot.R +++ b/R/plot.R @@ -71,7 +71,7 @@ image_to_matrix <- function(m) { #' @details [contours()] is a wrapper around [contour()]. It obtains the values of `variable` at #' the grid points defined by marginal vectors `x` and `y` and constructs the matrix supplied to [contour()] by reversing the rows and #' transposing the matrix (see also the documentation of [image()]). -#' +#' @return A contour plot of the selected variable. #' @export #' @importFrom graphics contour #' @seealso [aem()] [contour()] [image()] [heads()] diff --git a/cran-comments.md b/cran-comments.md index a214393..1339999 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,10 +1,17 @@ ## Resubmission This is a resubmission. In this version I have: - * Reduced the elapsed time of some examples. + * Removed single quotes around words in the description. + + * Updated the description to not start with the title. + + * Added a general reference to analytic element modeling theory in the description field. + + * Added a \value field to contours.Rd. + + * Removed the setting of graphical parameters using par() in the vignettes. + - * Handled words flagged as possibly misspelled in DESCRIPTION. - ## R CMD check results 0 errors | 0 warnings | 1 note diff --git a/man/contours.Rd b/man/contours.Rd index 3420154..8631b11 100644 --- a/man/contours.Rd +++ b/man/contours.Rd @@ -27,6 +27,9 @@ contours( \item{...}{additional arguments passed to \code{\link[=contour]{contour()}}.} } +\value{ +A contour plot of the selected variable. +} \description{ \code{\link[=contours]{contours()}} creates a contour plot of a state-variable computed by the analytic element model \code{aem}, or adds the contour lines to an existing plot. diff --git a/vignettes/vign-01-overview.Rmd b/vignettes/vign-01-overview.Rmd index 3f926a5..7db9e14 100644 --- a/vignettes/vign-01-overview.Rmd +++ b/vignettes/vign-01-overview.Rmd @@ -275,9 +275,7 @@ As an example, an analytic element model is created for a phreatic system with t The `add_element()` function is used to add elements to an initially empty model. After all the elements are added, the model needs to be solved with an explicit call to `solve.aem()`. This is useful for adding elements to a model in a loop or pipeline. -A major benefit of the AEM approach is that no numerical grid of the domain is needed. This allows to zoom in on an area of interest without altering or rerunning the model, as illustrated by the plot of the inset area around well A (green rectangular in the first plot). - -```{r example-model, fig.show="hold", out.width="75%"} +```{r example-model, fig.show="hold"} # aquifer parameters ---- k = 15 # hydraulic conductivity, m/d top = 20 # aquifer top elevation, m @@ -328,8 +326,6 @@ for(i in seq(nls - 1)) { m = solve(m) # view head contours ---- -par(mar = c(4, 4, .3, .3)) - xg = seq(-800, 300, length = 100) yg = seq(-600, 300, length = 100) @@ -339,6 +335,12 @@ plot(m, add = TRUE) polygon(x = c(-500, 50, 50, -500), y = c(-200, -200, 150, 150), border = 'forestgreen') grid() # add gridlines to plot +``` + +A major benefit of the AEM approach is that no numerical grid of the domain is needed. This allows to zoom in on an area of interest without altering or rerunning the model, as illustrated by the plot of the inset area around well A (green rectangular in the first plot). + +```{r fig-inset-well} + # view inset near well A xg = seq(-500, 50, length = 100) yg = seq(-200, 150, length = 100) @@ -376,7 +378,6 @@ To plot a cross-section of the water-table, simply compute the head values at th xprofile = seq(-800, 400, length = 1000) hprofile = heads(m, x = xprofile, y = -100) -par(mar=c(4, 4, 0.3, 0.3)) plot(xprofile, hprofile, type = 'l', xlab = 'x (m)', ylab = 'head (m)') ```