diff --git a/R/ogs6.R b/R/ogs6.R index 6d8a5c74e9178446b345f70c175564504710c431..c05732b0c3def4dab910aa1ca85a33ea874bb4cd 100644 --- a/R/ogs6.R +++ b/R/ogs6.R @@ -2,17 +2,19 @@ #===== OGS6 ===== -#'OGS6 -#'@description Constructor for the OGS6 base class -#'@export +#' OGS6 +#' @description Constructor for the \code{OGS6} base class +#' @export OGS6 <- R6::R6Class("OGS6", public = list( - #'@description - #'Creates new OGS6 object - #'@param sim_name string: Simulation name - #'@param sim_path string: Path where all files for the simulation will be - #' saved + #' @description + #' Creates new OGS6 object + #' @param sim_name string: Simulation name + #' @param sim_path string: Path where all files for the simulation will be + #' saved + #' @examples + #' ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") initialize = function(sim_name, sim_path) { @@ -30,9 +32,12 @@ OGS6 <- R6::R6Class("OGS6", #===== Adding components ===== - #'@description - #'Adds a .prj simulation component - #'@param x An object of any .prj `r2ogs6` class + #' @description + #' Adds a .prj simulation component + #' @param x An object of any .prj `r2ogs6` class + #' @examples + #' ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") + #' ogs6_obj$add(r2ogs6_parameter$new(name = "foo", type = "bar")) add = function(x){ # Assert that class name is in implemented .prj classes for OGS6 @@ -66,11 +71,15 @@ OGS6 <- R6::R6Class("OGS6", invisible(self) }, - #'@description - #'Adds a reference to a .gml file and optionally, a OGS6_gml object - #'@param gml string | r2ogs6_gml: Either a path to a file with extension - #' .gml or a r2ogs6_gml object. - #@examples + #' @description + #' Adds a reference to a file with ending .gml and optionally, a + #' \code{OGS6_gml} object + #' @param gml string | OGS6_gml: Either a path to a file with extension + #' .gml or a OGS6_gml object. + #' @examples + #' ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") + #' ogs6_obj$add_gml("this_works.gml") + #' \dontrun{ogs6_obj$add_gml("this_doesnt.oops")} add_gml = function(gml){ if(assertthat::is.string(gml)){ @@ -85,11 +94,16 @@ OGS6 <- R6::R6Class("OGS6", invisible(self) }, - #'@description - #'Adds a reference to a .vtu file and optionally, a OGS6_vtu object - #'@param path string: - #'@param read_in_vtu flag: Optional: Should .vtu file just be copied or - #' read in too? + #' @description + #' Adds a reference to a \code{.vtu} file and optionally, a \code{OGS6_vtu} + #' object + #' @param path string: A path + #' @param read_in_vtu flag: Optional: Should \code{.vtu} file just be + #' copied or read in too? + #' @examples + #' ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") + #' ogs6_obj$add_vtu("this_works.vtu") + #' \dontrun{ogs6_obj$add_vtu("this_doesnt.oops")} add_vtu = function(path, read_in_vtu = FALSE){ assertthat::assert_that(assertthat::is.string(path)) @@ -109,10 +123,13 @@ OGS6 <- R6::R6Class("OGS6", #===== Utility ===== - #'@description - #'Checks if the OGS6 object has all necessary parameters for + #' @description + #' Checks if the \code{OGS6} object has all necessary parameters for #' starting a simulation - #'@param print_status flag: Should the status be printed to the console? + #' @param print_status flag: Should the status be printed to the console? + #' @examples + #' ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") + #' ogs6_obj$get_status() get_status = function(print_status = TRUE){ assertthat::assert_that(assertthat::is.flag(print_status)) @@ -166,8 +183,8 @@ OGS6 <- R6::R6Class("OGS6", return(invisible(flag)) }, - #'@description - #'Overrides default printing behaviour + #' @description + #' Overrides default printing behaviour print = function(){ cat("OGS6\n") cat("simulation name: ", self$sim_name, "\n", sep = "") @@ -197,8 +214,8 @@ OGS6 <- R6::R6Class("OGS6", invisible(self) }, - #'print_log - #'@description Prints logfile to console (if it exists) + #' print_log + #' @description Prints logfile to console (if it exists) print_log = function(){ if(!is.null(self$logfile)){ writeLines(readLines(self$logfile)) @@ -209,11 +226,11 @@ OGS6 <- R6::R6Class("OGS6", invisible(self) }, - #'@description - #'Clears components from the OGS6 object - #'@param which character: The names of the components (all by default). + #' @description + #' Clears components from the \code{OGS6} object + #' @param which character: The names of the components (all by default). #' If you want to delete only some components, run - #' names(prj_top_level_classes()) for the available options. + #' \code{names(prj_top_level_classes())} for the available options. clear = function(which){ if(missing(which)){ @@ -254,8 +271,8 @@ OGS6 <- R6::R6Class("OGS6", active = list( - #'@field sim_name - #'Simulation name. `value` must be string + #' @field sim_name + #' Simulation name. \code{value} must be string sim_name = function(value) { if(missing(value)) { private$.sim_name @@ -265,8 +282,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field sim_path - #'Simulation path. `value` must be string + #' @field sim_path + #' Simulation path. \code{value} must be string sim_path = function(value) { if(missing(value)) { private$.sim_path @@ -275,8 +292,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field logfile - #'Logfile path. `value` must be string + #' @field logfile + #' Logfile path. \code{value} must be string logfile = function(value) { if(missing(value)) { private$.logfile @@ -286,14 +303,14 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field gml - #'.gml. read-only + #' @field gml + #' \code{.gml}. read-only gml = function() { private$.gml }, - #'@field geometry - #'.prj `geometry` tag. `value` must be string + #' @field geometry + #' \code{.prj} \code{geometry} tag. \code{value} must be string geometry = function(value) { if(missing(value)) { private$.geometry @@ -303,8 +320,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field meshes - #'.prj `meshes` tag. `value` must be list of strings + #' @field meshes + #' \code{.prj} \code{meshes} tag. \code{value} must be list of strings meshes = function(value) { if(missing(value)) { private$.meshes @@ -317,8 +334,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field vtus - #'.vtus. `value` must be list of `OGS_vtu` objects + #' @field vtus + #' \code{.vtu}s. \code{value} must be list of \code{OGS6_vtu} objects vtus = function(value) { if(missing(value)) { private$.vtus @@ -329,8 +346,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field python_script - #'.prj `python_script` tag. `value` must be string + #' @field python_script + #' \code{.prj} \code{python_script} tag. \code{value} must be string python_script = function(value) { if(missing(value)) { private$.python_script @@ -340,9 +357,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field search_length_algorithm - #'.prj `search_length_algorithm` tag. `value` must be - #' `r2ogs6_search_length_algorithm` object + #' @field search_length_algorithm + #' \code{.prj} \code{search_length_algorithm} tag. \code{value} must be + #' \code{r2ogs6_search_length_algorithm} object search_length_algorithm = function(value) { if(missing(value)) { private$.search_length_algorithm @@ -354,8 +371,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field processes - #'.prj `processes` tag. `value` must be list of `r2ogs6_process` objects + #' @field processes + #' \code{.prj} \code{processes} tag. \code{value} must be list of + #' \code{r2ogs6_process} objects processes = function(value) { if(missing(value)) { private$.processes @@ -384,8 +402,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field time_loop - #'.prj `time_loop` tag. `value` must be `r2ogs6_time_loop` object + #' @field time_loop + #' \code{.prj} \code{time_loop} tag. \code{value} must be + #' \code{r2ogs6_time_loop} object time_loop = function(value) { if(missing(value)) { private$.time_loop @@ -397,9 +416,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field local_coordinate_system - #'.prj `local_coordinate_system` tag. `value` must be - #' `r2ogs6_local_coordinate_system` object + #' @field local_coordinate_system + #' \code{.prj} \code{local_coordinate_system} tag. \code{value} must be + #' \code{r2ogs6_local_coordinate_system} object local_coordinate_system = function(value) { if(missing(value)) { private$.local_coordinate_system @@ -411,8 +430,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field media - #'.prj `media` tag. `value` must be list of `r2ogs6_medium` objects + #' @field media + #' \code{.prj} \code{media} tag. \code{value} must be list of + #' \code{r2ogs6_medium} objects media = function(value) { if(missing(value)) { private$.media @@ -423,9 +443,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field parameters - #'.prj `parameters` tag. `value` must be list of `r2ogs6_parameter` - #' objects + #' @field parameters + #' \code{.prj} \code{parameters} tag. \code{value} must be list of + #' \code{r2ogs6_parameter} objects parameters = function(value) { if(missing(value)) { private$.parameters @@ -436,9 +456,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field chemical_system - #'.prj `chemical_system` tag. `value` must be `r2ogs6_chemical_system` - #' object + #' @field chemical_system + #' \code{.prj} \code{chemical_system} tag. \code{value} must be + #' \code{r2ogs6_chemical_system} object chemical_system = function(value) { if(missing(value)) { private$.chemical_system @@ -450,8 +470,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field curves - #'.prj `curves` tag. `value` must be list of `r2ogs6_curve` objects + #' @field curves + #' \code{.prj} \code{curves} tag. \code{value} must be list of + #' \code{r2ogs6_curve} objects curves = function(value) { if(missing(value)) { private$.curves @@ -462,9 +483,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field process_variables - #'.prj `process_variables` tag. `value` must be list of - #' `r2ogs6_process_variable` objects + #' @field process_variables + #' \code{.prj} \code{process_variables} tag. \code{value} must be list of + #' \code{r2ogs6_process_variable} objects process_variables = function(value) { if(missing(value)) { private$.process_variables @@ -476,9 +497,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field nonlinear_solvers - #'.prj `nonlinear_solvers` tag. `value` must be list of - #' `r2ogs6_nonlinear_solver` objects + #' @field nonlinear_solvers + #' \code{.prj} \code{nonlinear_solvers} tag. \code{value} must be list of + #' \code{r2ogs6_nonlinear_solver} objects nonlinear_solvers = function(value) { if(missing(value)) { private$.nonlinear_solvers @@ -490,9 +511,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field linear_solvers - #'.prj `linear_solvers` tag. `value` must be list of - #' `r2ogs6_linear_solver` objects + #' @field linear_solvers + #' \code{.prj} \code{linear_solvers} tag. \code{value} must be list of + #' \code{r2ogs6_linear_solver} objects linear_solvers = function(value) { if(missing(value)) { private$.linear_solvers @@ -503,9 +524,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field test_definition - #'.prj `test_definition` tag. `value` must be list of `r2ogs6_vtkdiff` - #' objects + #' @field test_definition + #' \code{.prj} \code{test_definition} tag. \code{value} must be list of + #' \code{r2ogs6_vtkdiff} objects test_definition = function(value) { if(missing(value)) { private$.test_definition @@ -516,8 +537,9 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field insitu - #'.prj `insitu` tag. `value` must be `r2ogs6_insitu` object + #' @field insitu + #' \code{.prj} \code{insitu} tag. \code{value} must be + #' \code{r2ogs6_insitu} object insitu = function(value) { if(missing(value)) { private$.insitu @@ -529,8 +551,8 @@ OGS6 <- R6::R6Class("OGS6", } }, - #'@field pvds - #'.pvds. `value` must be list of `OGS6_pvd` objects + #' @field pvds + #' \code{.pvd}s. \code{value} must be list of \code{OGS6_pvd} objects pvds = function(value) { if(missing(value)) { private$.pvds diff --git a/R/ogs6_gml.R b/R/ogs6_gml.R index 6d6ce74011e8e6d27c0a94a25d78b82e56a3e797..1dd40a99dd11150e24945914286266f713c4cd5f 100644 --- a/R/ogs6_gml.R +++ b/R/ogs6_gml.R @@ -2,21 +2,40 @@ #===== OGS6_gml ===== -#'OGS6_gml -#'@description Constructor for the OGS6_gml base class -#'@export +#' OGS6_gml +#' @description Constructor for the OGS6_gml base class +#' @examples +#' OGS6_gml$new( +#' name = "cube_1x1x1_geometry", +#' points = tibble::tibble( +#' x = c(0, 0, 0, 0), +#' y = c(0, 0, 1, 1), +#' z = c(0, 1, 1, 0), +#' name = c("origin", "", "", "") +#' ), +#' polylines = list(polyline = list("front_left", +#' c( +#' pnt = 0, pnt = 1 +#' ))), +#' surfaces = list(surface = list( +#' name = "left", +#' element = c(p1 = 0, p2 = 1, p3 = 2), +#' element = c(p1 = 0, p2 = 3, p3 = 2) +#' )) +#' ) +#' @export OGS6_gml <- R6::R6Class( "OGS6_gml", public = list( - #'@description - #'Creates new OGS6_gml object - #'@param gml_path string: Optional: Path to .gml file - #'@param name string: Geometry name - #'@param points tibble: Must have 3 vectors named 'x', 'y' and 'z', may - #' have optional 'name' vector - #'@param polylines list(list("foo", c(1, 2))): - #'@param surfaces list(list("foo", c(1, 2, 3), c(2, 3, 4))): + #' @description + #' Creates new OGS6_gml object + #' @param gml_path string: Optional: Path to .gml file + #' @param name string: Geometry name + #' @param points tibble: Must have 3 vectors named 'x', 'y' and 'z', may + #' have optional 'name' vector + #' @param polylines list(list("foo", c(1, 2))): + #' @param surfaces list(list("foo", c(1, 2, 3), c(2, 3, 4))) initialize = function(gml_path = NULL, name = NULL, points = NULL, diff --git a/R/prj_borehole_heat_exchanger.R b/R/prj_borehole_heat_exchanger.R index 0fb58882726198e55e52d29d93fd9da23a17987a..f833e0f697982c04db12cab45ed52272f2be882e 100644 --- a/R/prj_borehole_heat_exchanger.R +++ b/R/prj_borehole_heat_exchanger.R @@ -2,16 +2,17 @@ #===== r2ogs6_borehole_heat_exchanger ===== -#'r2ogs6_borehole_heat_exchanger -#'@description tag: borehole_heat_exchanger -#'@param type string: -#'@param flow_and_temperature_control r2ogs6_flow_and_temperature_control: -#'@param borehole list: -#'@param grout list: -#'@param pipes r2ogs6_pipes: -#'@param refrigerant list: -#'@param use_bhe_pipe_network Optional: string ("true" | "false"): -#'@export +#' r2ogs6_borehole_heat_exchanger +#' @description tag: borehole_heat_exchanger +#' @param type string: +#' @param flow_and_temperature_control r2ogs6_flow_and_temperature_control: +#' @param borehole list: +#' @param grout list: +#' @param pipes r2ogs6_pipes: +#' @param refrigerant list: +#' @param use_bhe_pipe_network Optional: string ("true" | "false"): +#' @example man/examples/ex_prj_borehole_heat_exchanger.R +#' @export r2ogs6_borehole_heat_exchanger <- function(type, flow_and_temperature_control, borehole, @@ -81,15 +82,16 @@ new_r2ogs6_borehole_heat_exchanger <- function(type, #===== r2ogs6_flow_and_temperature_control ===== -#'r2ogs6_flow_and_temperature_control -#'@description tag: flow_and_temperature_control -#'@param type string: -#'@param flow_rate Optional: string | double: -#'@param temperature_curve Optional: string: -#'@param power Optional: string | double: -#'@param power_curve Optional: string: -#'@param flow_rate_curve Optional: string: -#'@export +#' r2ogs6_flow_and_temperature_control +#' @description tag: flow_and_temperature_control +#' @param type string: +#' @param flow_rate Optional: string | double: +#' @param temperature_curve Optional: string: +#' @param power Optional: string | double: +#' @param power_curve Optional: string: +#' @param flow_rate_curve Optional: string: +#' @example man/examples/ex_prj_flow_and_temperature_control.R +#' @export r2ogs6_flow_and_temperature_control <- function(type, flow_rate = NULL, temperature_curve = NULL, @@ -146,15 +148,16 @@ new_r2ogs6_flow_and_temperature_control <- function(type, #===== r2ogs6_pipes ===== -#'r2ogs6_pipes -#'@description tag: pipes -#'@param longitudinal_dispersion_length string | double: -#'@param inlet Optional: list: -#'@param outlet Optional: list: -#'@param distance_between_pipes Optional: string | double: -#'@param outer Optional: list: -#'@param inner Optional: list: -#'@export +#' r2ogs6_pipes +#' @description tag: pipes +#' @param longitudinal_dispersion_length string | double: +#' @param inlet Optional: list: +#' @param outlet Optional: list: +#' @param distance_between_pipes Optional: string | double: +#' @param outer Optional: list: +#' @param inner Optional: list: +#' @example man/examples/ex_prj_pipes.R +#' @export r2ogs6_pipes <- function(longitudinal_dispersion_length, inlet = NULL, outlet = NULL, @@ -213,4 +216,4 @@ new_r2ogs6_pipes <- function(longitudinal_dispersion_length, ), class = "r2ogs6_pipes" ) -} \ No newline at end of file +} diff --git a/R/prj_chemical_system.R b/R/prj_chemical_system.R index eb16116b1f38724ecb1fc06d7f9d25fac3e32278..66b455d45d519c1e725291e9c9d348830c6a8a3d 100644 --- a/R/prj_chemical_system.R +++ b/R/prj_chemical_system.R @@ -2,19 +2,20 @@ #===== r2ogs6_chemical_system ===== -#'r2ogs6_chemical_system -#'@description tag: chemical_system -#'@param chemical_solver string: -#'@param database string: -#'@param solution r2ogs6_solution: -#'@param mesh Optional: string: -#'@param knobs Optional: list: -#'@param kinetic_reactants Optional: list, r2ogs6_kinetic_reactant: -#'@param rates Optional: list, r2ogs6_rate: -#'@param equilibrium_reactants Optional: list, r2ogs6_phase_component: -#'@param surface Optional: -#'@param user_punch Optional: -#'@export +#' r2ogs6_chemical_system +#' @description tag: chemical_system +#' @param chemical_solver string: +#' @param database string: +#' @param solution r2ogs6_solution: +#' @param mesh Optional: string: +#' @param knobs Optional: list: +#' @param kinetic_reactants Optional: list, r2ogs6_kinetic_reactant: +#' @param rates Optional: list, r2ogs6_rate: +#' @param equilibrium_reactants Optional: list, r2ogs6_phase_component: +#' @param surface Optional: +#' @param user_punch Optional: +#' @example man/examples/ex_prj_chemical_system.R +#' @export r2ogs6_chemical_system <- function(chemical_solver, database, solution, @@ -106,14 +107,15 @@ new_r2ogs6_chemical_system <- function(chemical_solver, #===== r2ogs6_solution ===== -#'r2ogs6_solution -#'@description tag: solution -#'@param temperature string | double: Temperature -#'@param pressure string | double: Pressure -#'@param pe string | double: pe -#'@param components list: Components -#'@param charge_balance Optional: string: Charge balance -#'@export +#' r2ogs6_solution +#' @description tag: solution +#' @param temperature string | double: Temperature +#' @param pressure string | double: Pressure +#' @param pe string | double: pe +#' @param components list: Components +#' @param charge_balance Optional: string: Charge balance +#' @example man/examples/ex_prj_solution.R +#' @export r2ogs6_solution <- function(temperature, pressure, pe, @@ -168,12 +170,13 @@ new_r2ogs6_solution <- function(temperature, #===== r2ogs6_phase_component ===== -#'r2ogs6_phase_component -#'@description S3 class describing .prj phase_component -#'@param name The component name -#'@param saturation_index The saturation index of the component -#'@param initial_amount optional: The initial amount of the component -#'@export +#' r2ogs6_phase_component +#' @description S3 class describing .prj phase_component +#' @param name The component name +#' @param saturation_index The saturation index of the component +#' @param initial_amount optional: The initial amount of the component +#' @example man/examples/ex_prj_phase_component.R +#' @export r2ogs6_phase_component <- function(name, saturation_index, initial_amount = NULL) { @@ -214,17 +217,18 @@ new_r2ogs6_phase_component <- function(name, #===== r2ogs6_kinetic_reactant ===== -#'r2ogs6_kinetic_reactant -#'@description S3 class describing .prj kinetic_reactant -#'@param name The component name -#'@param initial_amount The initial amount of the component -#'@param chemical_formula The chemical formula of the component -#'@param fix_amount Should the amount be fixed or not? -#'@export +#' r2ogs6_kinetic_reactant +#' @description S3 class describing .prj kinetic_reactant +#' @param name The component name +#' @param initial_amount The initial amount of the component +#' @param chemical_formula The chemical formula of the component +#' @param fix_amount Should the amount be fixed or not? +#' @example man/examples/ex_prj_kinetic_reactant.R +#' @export r2ogs6_kinetic_reactant <- function(name, - initial_amount = NULL, - chemical_formula = NULL, - fix_amount = NULL) { + initial_amount = NULL, + chemical_formula = NULL, + fix_amount = NULL) { #Coerce input initial_amount <- coerce_string_to_numeric(initial_amount) @@ -264,11 +268,12 @@ new_r2ogs6_kinetic_reactant <- function(name, #===== r2ogs6_rate ===== -#'r2ogs6_rate -#'@description S3 class describing .prj rate -#'@param kinetic_reactant string: References a kinetic_reactant object -#'@param expression character: Statements -#'@export +#' r2ogs6_rate +#' @description S3 class describing .prj rate +#' @param kinetic_reactant string: References a kinetic_reactant object +#' @param expression character: Statements +#' @example man/examples/ex_prj_rate.R +#' @export r2ogs6_rate <- function(kinetic_reactant, expression) { diff --git a/R/prj_curve.R b/R/prj_curve.R index 274c63bfe0d2a0d59b62f2587df1f9f4e148305b..a6d06a73d477f860651d533f9ce20967d88a2f3b 100644 --- a/R/prj_curve.R +++ b/R/prj_curve.R @@ -2,13 +2,14 @@ #===== r2ogs6_curve ===== -#'r2ogs6_curve -#'@description tag: curve, a curve -#'@param name string: Name of the curve -#'@param coords string | numeric: Coordinates at which the curve's values -#' are given -#'@param values string | numeric: Values of the curve at the given coordinates -#'@export +#' r2ogs6_curve +#' @description tag: curve, a curve +#' @param name string: Name of the curve +#' @param coords string | numeric: Coordinates at which the curve's values +#' are given +#' @param values string | numeric: Values of the curve at the given coordinates +#' @example man/examples/ex_prj_curve.R +#' @export r2ogs6_curve <- function(name, coords, values){ #Coerce input diff --git a/R/prj_insitu.R b/R/prj_insitu.R index 8309023e3a6ef96b8e3d62ac26468111bde73085..c97f53544769314d88079bf290cdea0ede56002c 100644 --- a/R/prj_insitu.R +++ b/R/prj_insitu.R @@ -2,10 +2,11 @@ #===== r2ogs6_insitu ===== -#'r2ogs6_insitu -#'@description tag: insitu -#'@param scripts character: Script names -#'@export +#' r2ogs6_insitu +#' @description tag: insitu +#' @param scripts character: Script names +#' @example man/examples/ex_prj_insitu.R +#' @export r2ogs6_insitu <- function(scripts) { #Make this more user friendly diff --git a/R/prj_linear_solver.R b/R/prj_linear_solver.R index fdde0e88752c15a77a4127f48640251daf0d5a90..801b4ef4670de884269ca625a347c31193913d90 100644 --- a/R/prj_linear_solver.R +++ b/R/prj_linear_solver.R @@ -2,13 +2,14 @@ #===== r2ogs6_linear_solver ===== -#'r2ogs6_linear_solver -#'@description tag: linear_solver -#'@param name string: The name of the linear solver -#'@param eigen Optional: list: ... -#'@param lis Optional: string: ... -#'@param petsc Optional: character: ... -#'@export +#' r2ogs6_linear_solver +#' @description tag: linear_solver +#' @param name string: The name of the linear solver +#' @param eigen Optional: list: ... +#' @param lis Optional: string: ... +#' @param petsc Optional: character: ... +#' @example man/examples/ex_prj_linear_solver.R +#' @export r2ogs6_linear_solver <- function(name, eigen = NULL, lis = NULL, @@ -60,15 +61,16 @@ new_r2ogs6_linear_solver <- function(name, #===== r2ogs6_eigen ===== -#'r2ogs6_eigen -#'@description tag: eigen -#'@param solver_type string: -#'@param precon_type Optional: string: -#'@param max_iteration_step Optional: string | double: ... -#'@param error_tolerance Optional: string | double: ... -#'@param scaling Optional: string | double: ... -#'@param restart Optional: string | double: ... -#'@export +#' r2ogs6_eigen +#' @description tag: eigen +#' @param solver_type string: +#' @param precon_type Optional: string: +#' @param max_iteration_step Optional: string | double: ... +#' @param error_tolerance Optional: string | double: ... +#' @param scaling Optional: string | double: ... +#' @param restart Optional: string | double: ... +#' @example man/examples/ex_prj_eigen.R +#' @export r2ogs6_eigen <- function(solver_type, precon_type = NULL, max_iteration_step = NULL, diff --git a/R/prj_local_coordinate_system.R b/R/prj_local_coordinate_system.R index 2e558fc47992f8f8281056242efce83ff1bbfd60..fd2d5952f7d01b068268b26976200d7c7cbddebb 100644 --- a/R/prj_local_coordinate_system.R +++ b/R/prj_local_coordinate_system.R @@ -1,10 +1,11 @@ -#'r2ogs6_local_coordinate_system -#'@description tag: local_coordinate_system -#'@param basis_vector_0 string | double: A basis vector -#'@param basis_vector_1 string | double: A basis vector -#'@param basis_vector_2 Optional: string | double: A basis vector -#'@export +#' r2ogs6_local_coordinate_system +#' @description tag: local_coordinate_system +#' @param basis_vector_0 string | double: A basis vector +#' @param basis_vector_1 string | double: A basis vector +#' @param basis_vector_2 Optional: string | double: A basis vector +#' @example man/examples/ex_prj_local_coordinate_system.R +#' @export r2ogs6_local_coordinate_system <- function(basis_vector_0, basis_vector_1, basis_vector_2 = NULL) { @@ -35,4 +36,4 @@ new_r2ogs6_local_coordinate_system <- function(basis_vector_0, ), class = "r2ogs6_local_coordinate_system" ) -} \ No newline at end of file +} diff --git a/R/prj_material_property.R b/R/prj_material_property.R index 57873a995c3cb8afb31ac3df9df56e49a53c8acb..b3336252450f2fad14d6bb99e0ba949cbbb0d25f 100644 --- a/R/prj_material_property.R +++ b/R/prj_material_property.R @@ -2,11 +2,12 @@ #===== r2ogs6_material_property ===== -#'r2ogs6_material_property -#'@description tag: material_property -#'@param fluid r2ogs6_fluid: -#'@param porous_medium r2ogs6_porous_medium: -#'@export +#' r2ogs6_material_property +#' @description tag: material_property +#' @param fluid r2ogs6_fluid: +#' @param porous_medium r2ogs6_porous_medium: +#' @example man/examples/ex_prj_material_property.R +#' @export r2ogs6_material_property <- function(fluid, porous_medium) { @@ -38,19 +39,20 @@ new_r2ogs6_material_property <- function(fluid, #===== r2ogs6_fluid ===== -#'r2ogs6_fluid -#'@description tag: fluid -#'@param liquid_density list: -#'@param gas_density list: -#'@param liquid_viscosity list: -#'@param gas_viscosity list: -#'@param specific_heat_capacity_solid Optional: -#'@param specific_heat_capacity_water Optional: -#'@param specific_heat_capacity_air Optional: -#'@param specific_heat_capacity_water_vapor Optional: -#'@param thermal_conductivity_dry_solid Optional: -#'@param thermal_conductivity_wet_solid Optional: -#'@export +#' r2ogs6_fluid +#' @description tag: fluid +#' @param liquid_density list: +#' @param gas_density list: +#' @param liquid_viscosity list: +#' @param gas_viscosity list: +#' @param specific_heat_capacity_solid Optional: +#' @param specific_heat_capacity_water Optional: +#' @param specific_heat_capacity_air Optional: +#' @param specific_heat_capacity_water_vapor Optional: +#' @param thermal_conductivity_dry_solid Optional: +#' @param thermal_conductivity_wet_solid Optional: +#' @example man/examples/ex_prj_fluid.R +#' @export r2ogs6_fluid <- function(liquid_density, gas_density, liquid_viscosity, diff --git a/R/prj_medium.R b/R/prj_medium.R index 4530511a1ba1a79d403efd877be53f8b3e52f2da..524fe18f6dcc36a82e8a84076f1327d83b9ef06c 100644 --- a/R/prj_medium.R +++ b/R/prj_medium.R @@ -2,13 +2,14 @@ #===== r2ogs6_medium ===== -#'r2ogs6_medium -#'@description tag: medium, a specific medium with optional id corresponding -#' to the MaterialIDs -#'@param phases list, r2ogs6_phase: Optional: Medium phases -#'@param properties list, r2ogs6_pr_property: Optional: Medium properties -#'@param id string | double: Optional: ID corresponding to the MaterialIDs -#'@export +#' r2ogs6_medium +#' @description tag: medium, a specific medium with optional id corresponding +#' to the MaterialIDs +#' @param phases list, r2ogs6_phase: Optional: Medium phases +#' @param properties list, r2ogs6_pr_property: Optional: Medium properties +#' @param id string | double: Optional: ID corresponding to the MaterialIDs +#' @example man/examples/ex_prj_medium.R +#' @export r2ogs6_medium <- function(phases = NULL, properties = NULL, id = NULL) { @@ -54,42 +55,43 @@ new_r2ogs6_medium <- function(phases = NULL, #===== r2ogs6_pr_property ===== -#'r2ogs6_pr_property -#'@description tag: property -#'@param name string: -#'@param type string: -#'@param value Optional: -#'@param parameter_name Optional: -#'@param exponent Optional: -#'@param residual_liquid_saturation Optional: -#'@param residual_gas_saturation Optional: -#'@param p_b Optional: -#'@param independent_variable Optional: -#'@param curve Optional: -#'@param minimum_relative_permeability_liquid Optional: -#'@param initial_permeability Optional: -#'@param maximum_permeability Optional: -#'@param lambda Optional: -#'@param cutoff_value Optional: -#'@param intrinsic_permeability Optional: -#'@param initial_aperture Optional: -#'@param mean_frac_distance Optional: -#'@param threshold_strain Optional: -#'@param fracture_normal Optional: -#'@param reference_permeability Optional: -#'@param fitting_factor Optional: -#'@param cohesion Optional: -#'@param friction_angle Optional: -#'@param tensile_strength_parameter Optional: -#'@param b1 Optional: -#'@param b2 Optional: -#'@param b3 Optional: -#'@param minimum_permeability Optional: -#'@param initial_porosity Optional: -#'@param entry_pressure Optional: -#'@param min_relative_permeability_liquid Optional: -#'@param min_relative_permeability_gas Optional: -#'@export +#' r2ogs6_pr_property +#' @description tag: property +#' @param name string: +#' @param type string: +#' @param value Optional: +#' @param parameter_name Optional: +#' @param exponent Optional: +#' @param residual_liquid_saturation Optional: +#' @param residual_gas_saturation Optional: +#' @param p_b Optional: +#' @param independent_variable Optional: +#' @param curve Optional: +#' @param minimum_relative_permeability_liquid Optional: +#' @param initial_permeability Optional: +#' @param maximum_permeability Optional: +#' @param lambda Optional: +#' @param cutoff_value Optional: +#' @param intrinsic_permeability Optional: +#' @param initial_aperture Optional: +#' @param mean_frac_distance Optional: +#' @param threshold_strain Optional: +#' @param fracture_normal Optional: +#' @param reference_permeability Optional: +#' @param fitting_factor Optional: +#' @param cohesion Optional: +#' @param friction_angle Optional: +#' @param tensile_strength_parameter Optional: +#' @param b1 Optional: +#' @param b2 Optional: +#' @param b3 Optional: +#' @param minimum_permeability Optional: +#' @param initial_porosity Optional: +#' @param entry_pressure Optional: +#' @param min_relative_permeability_liquid Optional: +#' @param min_relative_permeability_gas Optional: +#' @example man/examples/ex_prj_pr_property.R +#' @export r2ogs6_pr_property <- function(name, type, value = NULL, @@ -292,12 +294,12 @@ new_r2ogs6_pr_property <- function(name, } -#'ogs_get_medium_property -#'@description Returns a medium property based on the property name -#'@param medium r2ogs6_medium -#'@param name string: The property name -#'@return r2ogs6_pr_property -#'@export +#' ogs_get_medium_property +#' @description Returns a medium property based on the property name +#' @param medium r2ogs6_medium +#' @param name string: The property name +#' @return r2ogs6_pr_property +#' @export ogs_get_medium_property <- function(medium, name){ assertthat::assert_that(class(medium) == "r2ogs6_medium") @@ -313,13 +315,14 @@ ogs_get_medium_property <- function(medium, name){ #===== r2ogs6_phase ===== -#'r2ogs6_phase -#'@description tag: phase, a coherent material with homogeneous properties -#'@param type string: Phase type -#' (get valid types with get_valid_phase_types()) -#'@param properties list, r2ogs6_pr_property: Properties -#'@param components list, components -#'@export +#' r2ogs6_phase +#' @description tag: phase, a coherent material with homogeneous properties +#' @param type string: Phase type +#' (get valid types with get_valid_phase_types()) +#' @param properties list, r2ogs6_pr_property: Properties +#' @param components list, components +#' @example man/examples/ex_prj_phase.R +#' @export r2ogs6_phase <- function(type, properties = NULL, components = NULL){ @@ -375,25 +378,26 @@ get_valid_phase_types <- function(){ #===== r2ogs6_ph_property ===== -#'r2ogs6_ph_property -#'@description tag: property -#'@param name string: Property name -#'@param type string: Property type -#'@param value Optional: string | double: ... -#'@param reference_value Optional: string | double: -#'@param initial_porosity Optional: string: -#'@param minimal_porosity Optional: string | double: -#'@param maximal_porosity Optional: string | double: -#'@param parameter_name Optional: string: -#'@param exponents Optional: string | numeric: -#'@param offset Optional: string | double: -#'@param exponent Optional: list: -#'@param swelling_pressures Optional: string | numeric: -#'@param lower_saturation_limit Optional: string | double: -#'@param upper_saturation_limit Optional: string | double: -#'@param intrinsic_permeabilities Optional: string | numeric: -#'@param ... independent_variable -#'@export +#' r2ogs6_ph_property +#' @description tag: property +#' @param name string: Property name +#' @param type string: Property type +#' @param value Optional: string | double: ... +#' @param reference_value Optional: string | double: +#' @param initial_porosity Optional: string: +#' @param minimal_porosity Optional: string | double: +#' @param maximal_porosity Optional: string | double: +#' @param parameter_name Optional: string: +#' @param exponents Optional: string | numeric: +#' @param offset Optional: string | double: +#' @param exponent Optional: list: +#' @param swelling_pressures Optional: string | numeric: +#' @param lower_saturation_limit Optional: string | double: +#' @param upper_saturation_limit Optional: string | double: +#' @param intrinsic_permeabilities Optional: string | numeric: +#' @param ... independent_variable +#' @example man/examples/ex_prj_ph_property.R +#' @export r2ogs6_ph_property <- function(name, type, value = NULL, @@ -537,11 +541,12 @@ new_r2ogs6_ph_property <- function(name, #===== r2ogs6_component ===== -#'r2ogs6_component -#'@description tag: component -#'@param name string: -#'@param properties list, r2ogs6_com_property: -#'@export +#' r2ogs6_component +#' @description tag: component +#' @param name string: +#' @param properties list, r2ogs6_com_property: +#' @example man/examples/ex_prj_component.R +#' @export r2ogs6_component <- function(name, properties){ @@ -577,13 +582,14 @@ new_r2ogs6_component <- function(name, #===== r2ogs6_com_property ===== -#'r2ogs6_com_property -#'@description tag: property -#'@param name string: Property name -#'@param type string: Property type -#'@param value Optional: string | double: ... -#'@param parameter_name Optional: -#'@export +#' r2ogs6_com_property +#' @description tag: property +#' @param name string: Property name +#' @param type string: Property type +#' @param value Optional: string | double: ... +#' @param parameter_name Optional: +#' @example man/examples/ex_prj_com_property.R +#' @export r2ogs6_com_property <- function(name, type, value = NULL, diff --git a/R/prj_nonlinear_solver.R b/R/prj_nonlinear_solver.R index 7f137b8a8d503354965fbd54e076d253a8621ded..a5107372f7ebea26df70f6018790dad4cd594150 100644 --- a/R/prj_nonlinear_solver.R +++ b/R/prj_nonlinear_solver.R @@ -2,14 +2,15 @@ #===== r2ogs6_nonlinear_solver ===== -#'r2ogs6_nonlinear_solver -#'@description tag: nonlinear_solver -#'@param name string: Name -#'@param type string: Type -#'@param max_iter string | double: Maximal number of iterations -#'@param linear_solver string: Name of corresponding linear_solver -#'@param damping Optional: string | double: Damping -#'@export +#' r2ogs6_nonlinear_solver +#' @description tag: nonlinear_solver +#' @param name string: Name +#' @param type string: Type +#' @param max_iter string | double: Maximal number of iterations +#' @param linear_solver string: Name of corresponding linear_solver +#' @param damping Optional: string | double: Damping +#' @example man/examples/ex_prj_nonlinear_solver.R +#' @export r2ogs6_nonlinear_solver <- function(name, type, max_iter, diff --git a/R/prj_parameter.R b/R/prj_parameter.R index 19f2729902fcb81ddade088a6f89e0ae46a5e24f..af27cbecf9edc354656db581f127ec22d2fcd415 100644 --- a/R/prj_parameter.R +++ b/R/prj_parameter.R @@ -2,22 +2,23 @@ #===== r2ogs6_parameter ===== -#'r2ogs6_parameter -#'@description tag: parameter -#'@param name string: -#'@param type string: -#'@param value Optional: string | double: Parameter value -#'@param values Optional: string | double: Parameter values -#'@param curve Optional: string: -#'@param parameter Optional: string: -#'@param group_id_property Optional: string: -#'@param field_name Optional: string: -#'@param mesh Optional: string: -#'@param time_series Optional: list: -#'@param use_local_coordinate_system Optional: string, "true" | "false": -#'@param ... Optional: for index_values and expression tags (since there can be +#' r2ogs6_parameter +#' @description tag: parameter +#' @param name string: +#' @param type string: +#' @param value Optional: string | double: Parameter value +#' @param values Optional: string | double: Parameter values +#' @param curve Optional: string: +#' @param parameter Optional: string: +#' @param group_id_property Optional: string: +#' @param field_name Optional: string: +#' @param mesh Optional: string: +#' @param time_series Optional: list: +#' @param use_local_coordinate_system Optional: string, "true" | "false": +#' @param ... Optional: for index_values and expression tags (since there can be #' multiple) -#'@export +#' @example man/examples/ex_prj_parameter.R +#' @export r2ogs6_parameter <- function(name, type, value = NULL, diff --git a/R/prj_porous_medium.R b/R/prj_porous_medium.R index ad05b5ce4ff00dd8f9906200263ffb74b7c05bf7..9f66b13ba839b9395d11720c47c4e7a5418b9529 100644 --- a/R/prj_porous_medium.R +++ b/R/prj_porous_medium.R @@ -2,15 +2,16 @@ #===== r2ogs6_porous_medium ===== -#'r2ogs6_porous_medium -#'@description tag: porous_medium -#'@param id string | double: -#'@param permeability list: -#'@param porosity list: -#'@param storage list: -#'@param capillary_pressure r2ogs6_capillary_pressure: -#'@param relative_permeability list: -#'@export +#' r2ogs6_porous_medium +#' @description tag: porous_medium +#' @param id string | double: +#' @param permeability list: +#' @param porosity list: +#' @param storage list: +#' @param capillary_pressure r2ogs6_capillary_pressure: +#' @param relative_permeability list: +#' @example man/examples/ex_prj_porous_medium.R +#' @export r2ogs6_porous_medium <- function(id, permeability, porosity, @@ -80,17 +81,18 @@ new_r2ogs6_porous_medium <- function(id, #===== r2ogs6_capillary_pressure ===== -#'r2ogs6_capillary_pressure -#'@description tag: capillary_pressure -#'@param type string: -#'@param pd Optional: string | double: -#'@param sr Optional: string | double: -#'@param smax Optional: string | double: -#'@param m Optional: string | double: -#'@param pc_max Optional: string | double: -#'@param has_regularized Optional: string, "true" | "false": -#'@param curve Optional: list: -#'@export +#' r2ogs6_capillary_pressure +#' @description tag: capillary_pressure +#' @param type string: +#' @param pd Optional: string | double: +#' @param sr Optional: string | double: +#' @param smax Optional: string | double: +#' @param m Optional: string | double: +#' @param pc_max Optional: string | double: +#' @param has_regularized Optional: string, "true" | "false": +#' @param curve Optional: list: +#' @example man/examples/ex_prj_capillary_pressure.R +#' @export r2ogs6_capillary_pressure <- function(type, pd = NULL, sr = NULL, @@ -177,14 +179,16 @@ new_r2ogs6_capillary_pressure <- function(type, #===== r2ogs6_relative_permeability ===== -#'r2ogs6_relative_permeability -#'@description tag: relative_permeability -#'@param type string: -#'@param sr string | number: -#'@param smax string | number: -#'@param m string | number: -#'@param krel_min string | number: -#'@param id string: Optional: +#' r2ogs6_relative_permeability +#' @description tag: relative_permeability +#' @param type string: +#' @param sr string | number: +#' @param smax string | number: +#' @param m string | number: +#' @param krel_min string | number: +#' @param id string: Optional: +#' @example man/examples/ex_prj_relative_permeability.R +#' @export r2ogs6_relative_permeability <- function(type, sr, smax, diff --git a/R/prj_process.R b/R/prj_process.R index 3a624ab7eff3dc9ee44ec9dc10b40e7f4b03cfd0..fb6573ef183e6cb14c7026bba2028ce637ddd489 100644 --- a/R/prj_process.R +++ b/R/prj_process.R @@ -2,78 +2,79 @@ #===== r2ogs6_process ===== -#'r2ogs6_process -#'@description tag: process (parent tag: processes) -#'@param name string: -#'@param type string: -#'@param integration_order string | double: -#'@param process_variables list, character: -#'@param secondary_variables Optional: -#'@param specific_body_force Optional: -#'@param solid_density Optional: -#'@param dimension Optional: -#'@param coupling_scheme Optional: -#'@param reference_solid_density Optional: -#'@param linear_thermal_expansion_coefficient Optional: -#'@param specific_heat_capacity Optional: -#'@param thermal_conductivity Optional: -#'@param darcy_gravity Optional: -#'@param reference_temperature Optional: -#'@param fracture_model Optional: -#'@param jacobian_assembler Optional: -#'@param internal_length Optional: -#'@param mass_lumping Optional: -#'@param porosity Optional: -#'@param calculatesurfaceflux Optional: -#'@param intrinsic_permeability Optional: -#'@param specific_storage Optional: -#'@param fluid_viscosity Optional: -#'@param biot_coefficient Optional: -#'@param fluid_density Optional: -#'@param initial_effective_stress Optional: -#'@param initial_fracture_effective_stress Optional: -#'@param phasefield_parameters Optional: -#'@param deactivate_matrix_in_flow Optional: -#'@param borehole_heat_exchangers Optional: -#'@param temperature Optional: -#'@param reactive_system Optional: -#'@param fluid_specific_heat_source Optional: -#'@param fluid_specific_isobaric_heat_capacity Optional: -#'@param solid_hydraulic_permeability Optional: -#'@param solid_specific_heat_source Optional: -#'@param solid_heat_conductivity Optional: -#'@param solid_specific_isobaric_heat_capacity Optional: -#'@param tortuosity Optional: -#'@param diffusion_coefficient Optional: -#'@param solid_density_dry Optional: -#'@param solid_density_initial Optional: -#'@param characteristic_pressure Optional: -#'@param characteristic_temperature Optional: -#'@param characteristic_vapour_mass_fraction Optional: -#'@param output_element_matrices Optional: -#'@param material_property Optional: -#'@param diffusion_coeff_component_b Optional: -#'@param diffusion_coeff_component_a Optional: -#'@param hydro_crack_scheme Optional: -#'@param at_num Optional: -#'@param initial_stress Optional: -#'@param split_method Optional: -#'@param reg_param Optional: -#'@param thermal_parameters Optional: -#'@param non_advective_form Optional: -#'@param fluid Optional: -#'@param porous_medium Optional: -#'@param decay_rate Optional: -#'@param fluid_reference_density Optional: -#'@param retardation_factor Optional: -#'@param solute_dispersivity_longitudinal Optional: -#'@param solute_dispersivity_transverse Optional: -#'@param molecular_diffusion_coefficient Optional: -#'@param density_solid Optional: -#'@param latent_heat_evaporation Optional: -#'@param pf_irrv Optional: -#'@param ... Optional: fracture_properties, constitutive_relation -#'@export +#' r2ogs6_process +#' @description tag: process (parent tag: processes) +#' @param name string: +#' @param type string: +#' @param integration_order string | double: +#' @param process_variables list, character: +#' @param secondary_variables Optional: +#' @param specific_body_force Optional: +#' @param solid_density Optional: +#' @param dimension Optional: +#' @param coupling_scheme Optional: +#' @param reference_solid_density Optional: +#' @param linear_thermal_expansion_coefficient Optional: +#' @param specific_heat_capacity Optional: +#' @param thermal_conductivity Optional: +#' @param darcy_gravity Optional: +#' @param reference_temperature Optional: +#' @param fracture_model Optional: +#' @param jacobian_assembler Optional: +#' @param internal_length Optional: +#' @param mass_lumping Optional: +#' @param porosity Optional: +#' @param calculatesurfaceflux Optional: +#' @param intrinsic_permeability Optional: +#' @param specific_storage Optional: +#' @param fluid_viscosity Optional: +#' @param biot_coefficient Optional: +#' @param fluid_density Optional: +#' @param initial_effective_stress Optional: +#' @param initial_fracture_effective_stress Optional: +#' @param phasefield_parameters Optional: +#' @param deactivate_matrix_in_flow Optional: +#' @param borehole_heat_exchangers Optional: +#' @param temperature Optional: +#' @param reactive_system Optional: +#' @param fluid_specific_heat_source Optional: +#' @param fluid_specific_isobaric_heat_capacity Optional: +#' @param solid_hydraulic_permeability Optional: +#' @param solid_specific_heat_source Optional: +#' @param solid_heat_conductivity Optional: +#' @param solid_specific_isobaric_heat_capacity Optional: +#' @param tortuosity Optional: +#' @param diffusion_coefficient Optional: +#' @param solid_density_dry Optional: +#' @param solid_density_initial Optional: +#' @param characteristic_pressure Optional: +#' @param characteristic_temperature Optional: +#' @param characteristic_vapour_mass_fraction Optional: +#' @param output_element_matrices Optional: +#' @param material_property Optional: +#' @param diffusion_coeff_component_b Optional: +#' @param diffusion_coeff_component_a Optional: +#' @param hydro_crack_scheme Optional: +#' @param at_num Optional: +#' @param initial_stress Optional: +#' @param split_method Optional: +#' @param reg_param Optional: +#' @param thermal_parameters Optional: +#' @param non_advective_form Optional: +#' @param fluid Optional: +#' @param porous_medium Optional: +#' @param decay_rate Optional: +#' @param fluid_reference_density Optional: +#' @param retardation_factor Optional: +#' @param solute_dispersivity_longitudinal Optional: +#' @param solute_dispersivity_transverse Optional: +#' @param molecular_diffusion_coefficient Optional: +#' @param density_solid Optional: +#' @param latent_heat_evaporation Optional: +#' @param pf_irrv Optional: +#' @param ... Optional: fracture_properties, constitutive_relation +#' @example man/examples/ex_prj_process.R +#' @export r2ogs6_process <- function(name, type, integration_order, @@ -545,48 +546,50 @@ new_r2ogs6_process <- function(name, #===== r2ogs6_constitutive_relation ===== -#'r2ogs6_constitutive_relation -#'@description tag: constitutive_relation -#'@param type string: -#'@param id Optional: -#'@param youngs_modulus Optional: -#'@param poissons_ratio Optional: -#'@param nonlinear_solver Optional: -#'@param behaviour Optional: -#'@param material_properties Optional: -#'@param shear_modulus Optional: -#'@param bulk_modulus Optional: -#'@param kappa Optional: -#'@param beta Optional: -#'@param gamma Optional: -#'@param hardening_modulus Optional: -#'@param alpha Optional: -#'@param delta Optional: -#'@param eps Optional: -#'@param m Optional: -#'@param alphap Optional: -#'@param deltap Optional: -#'@param epsp Optional: -#'@param mp Optional: -#'@param betap Optional: -#'@param gammap Optional: -#'@param tangent_type Optional: -#'@param damage_properties Optional: -#'@param youngs_moduli Optional: -#'@param shear_moduli Optional: -#'@param poissons_ratios Optional: -#'@param a Optional: -#'@param n Optional: -#'@param sigma0 Optional: -#'@param q Optional: -#'@param kelvin_shear_modulus Optional: -#'@param kelvin_viscosity Optional: -#'@param maxwell_shear_modulus Optional: -#'@param maxwell_bulk_modulus Optional: -#'@param maxwell_viscosity Optional: -#'@param dependency_parameter_mk Optional: -#'@param dependency_parameter_mvk Optional: -#'@param dependency_parameter_mvm Optional: +#' r2ogs6_constitutive_relation +#' @description tag: constitutive_relation +#' @param type string: +#' @param id Optional: +#' @param youngs_modulus Optional: +#' @param poissons_ratio Optional: +#' @param nonlinear_solver Optional: +#' @param behaviour Optional: +#' @param material_properties Optional: +#' @param shear_modulus Optional: +#' @param bulk_modulus Optional: +#' @param kappa Optional: +#' @param beta Optional: +#' @param gamma Optional: +#' @param hardening_modulus Optional: +#' @param alpha Optional: +#' @param delta Optional: +#' @param eps Optional: +#' @param m Optional: +#' @param alphap Optional: +#' @param deltap Optional: +#' @param epsp Optional: +#' @param mp Optional: +#' @param betap Optional: +#' @param gammap Optional: +#' @param tangent_type Optional: +#' @param damage_properties Optional: +#' @param youngs_moduli Optional: +#' @param shear_moduli Optional: +#' @param poissons_ratios Optional: +#' @param a Optional: +#' @param n Optional: +#' @param sigma0 Optional: +#' @param q Optional: +#' @param kelvin_shear_modulus Optional: +#' @param kelvin_viscosity Optional: +#' @param maxwell_shear_modulus Optional: +#' @param maxwell_bulk_modulus Optional: +#' @param maxwell_viscosity Optional: +#' @param dependency_parameter_mk Optional: +#' @param dependency_parameter_mvk Optional: +#' @param dependency_parameter_mvm Optional: +#' @example man/examples/ex_prj_constitutive_relation.R +#' @export r2ogs6_constitutive_relation <- function(type, id = NULL, youngs_modulus = NULL, @@ -765,20 +768,21 @@ new_r2ogs6_constitutive_relation <- function(type, #===== r2ogs6_fracture_model ===== -#'r2ogs6_fracture_model -#'@description tag: fracture_model -#'@param type string: -#'@param normal_stiffness string: -#'@param shear_stiffness string: -#'@param penalty_aperture_cutoff string | double: -#'@param tension_cutoff string | double: -#'@param fracture_toughness Optional: string: -#'@param peak_normal_traction Optional: string: -#'@param friction_angle Optional: string: -#'@param dilatancy_angle Optional: string: -#'@param cohesion Optional: string: -#'@param nonlinear_solver Optional: list: -#'@export +#' r2ogs6_fracture_model +#' @description tag: fracture_model +#' @param type string: +#' @param normal_stiffness string: +#' @param shear_stiffness string: +#' @param penalty_aperture_cutoff string | double: +#' @param tension_cutoff string | double: +#' @param fracture_toughness Optional: string: +#' @param peak_normal_traction Optional: string: +#' @param friction_angle Optional: string: +#' @param dilatancy_angle Optional: string: +#' @param cohesion Optional: string: +#' @param nonlinear_solver Optional: list: +#' @example man/examples/ex_prj_fracture_model.R +#' @export r2ogs6_fracture_model <- function(type, normal_stiffness, shear_stiffness, @@ -863,14 +867,15 @@ new_r2ogs6_fracture_model <- function(type, #===== r2ogs6_fracture_properties ===== -#'r2ogs6_fracture_properties -#'@description tag: fracture_properties -#'@param material_id string | double: -#'@param initial_aperture string: -#'@param specific_storage Optional: string: -#'@param biot_coefficient Optional: string: -#'@param permeability_model Optional: list: -#'@export +#' r2ogs6_fracture_properties +#' @description tag: fracture_properties +#' @param material_id string | double: +#' @param initial_aperture string: +#' @param specific_storage Optional: string: +#' @param biot_coefficient Optional: string: +#' @param permeability_model Optional: list: +#' @example man/examples/ex_prj_fracture_properties.R +#' @export r2ogs6_fracture_properties <- function(material_id, initial_aperture, specific_storage = NULL, @@ -937,12 +942,13 @@ new_r2ogs6_fracture_properties <- function(material_id, #===== r2ogs6_jacobian_assembler ===== -#'r2ogs6_jacobian_assembler -#'@description tag: jacobian_assembler -#'@param type string: -#'@param component_magnitudes Optional: string | double: -#'@param relative_epsilons Optional: string | double: -#'@export +#' r2ogs6_jacobian_assembler +#' @description tag: jacobian_assembler +#' @param type string: +#' @param component_magnitudes Optional: string | double: +#' @param relative_epsilons Optional: string | double: +#' @example man/examples/ex_prj_jacobian_assembler.R +#' @export r2ogs6_jacobian_assembler <- function(type, component_magnitudes = NULL, relative_epsilons = NULL) { @@ -981,14 +987,15 @@ new_r2ogs6_jacobian_assembler <- function(type, #===== r2ogs6_phasefield_parameters ===== -#'r2ogs6_phasefield_parameters -#'@description tag: phasefield_parameters -#'@param residual_stiffness string: -#'@param crack_resistance string: -#'@param crack_length_scale string: -#'@param kinetic_coefficient string: -#'@param history_field Optional: string: -#'@export +#' r2ogs6_phasefield_parameters +#' @description tag: phasefield_parameters +#' @param residual_stiffness string: +#' @param crack_resistance string: +#' @param crack_length_scale string: +#' @param kinetic_coefficient string: +#' @param history_field Optional: string: +#' @example man/examples/ex_prj_phasefield_parameters.R +#' @export r2ogs6_phasefield_parameters <- function(residual_stiffness, crack_resistance, crack_length_scale, diff --git a/R/prj_process_variable.R b/R/prj_process_variable.R index e4b95c118e6707f742ef2db32d6a4e74d5d476c4..30213a4513e42b5a57a2e21d6162d5ae19a8bf96 100644 --- a/R/prj_process_variable.R +++ b/R/prj_process_variable.R @@ -2,17 +2,18 @@ #===== r2ogs6_process_variable ===== -#'r2ogs6_process_variable -#'@description tag: process_variable -#'@param name string: The name of the process variable -#'@param components string | double: -#'@param order string | double: -#'@param initial_condition string: -#'@param boundary_conditions list, r2ogs6_boundary_condition: -#'@param source_terms Optional: list, r2ogs6_source_term: -#'@param mesh Optional: string: list: -#'@param deactivated_subdomains Optional: list, r2ogs6_deactivated_subdomain: -#'@export +#' r2ogs6_process_variable +#' @description tag: process_variable +#' @param name string: The name of the process variable +#' @param components string | double: +#' @param order string | double: +#' @param initial_condition string: +#' @param boundary_conditions list, r2ogs6_boundary_condition: +#' @param source_terms Optional: list, r2ogs6_source_term: +#' @param mesh Optional: string: list: +#' @param deactivated_subdomains Optional: list, r2ogs6_deactivated_subdomain: +#' @example man/examples/ex_prj_process_variable.R +#' @export r2ogs6_process_variable <- function(name, components, order, @@ -92,33 +93,34 @@ new_r2ogs6_process_variable <- function(name, #===== r2ogs6_boundary_condition ===== -#'r2ogs6_boundary_condition -#'@description tag: boundary_condition -#'@param type string: -#'@param parameter string: -#'@param geometrical_set Optional: string: -#'@param geometry Optional: string: -#'@param component Optional: string | double: -#'@param mesh Optional: string: -#'@param alpha Optional: string: -#'@param u_0 Optional: string: -#'@param constraint_type Optional: string: -#'@param constraining_process_variable Optional: string: -#'@param constraint_threshold Optional: string | double: -#'@param constraint_direction Optional: string: -#'@param area_parameter Optional: string: -#'@param bc_object Optional: string: -#'@param flush_stdout Optional: string: -#'@param property_name Optional: string: -#'@param initial_value_parameter Optional: string: -#'@param constant_name Optional: string: -#'@param coefficient_current_variable_name Optional: string: -#'@param coefficient_other_variable_name Optional: string: -#'@param coefficient_mixed_variables_name Optional: string: -#'@param threshold_parameter Optional: string: -#'@param comparison_operator Optional: string: -#'@param time_interval Optional: list of 2, character: -#'@export +#' r2ogs6_boundary_condition +#' @description tag: boundary_condition +#' @param type string: +#' @param parameter string: +#' @param geometrical_set Optional: string: +#' @param geometry Optional: string: +#' @param component Optional: string | double: +#' @param mesh Optional: string: +#' @param alpha Optional: string: +#' @param u_0 Optional: string: +#' @param constraint_type Optional: string: +#' @param constraining_process_variable Optional: string: +#' @param constraint_threshold Optional: string | double: +#' @param constraint_direction Optional: string: +#' @param area_parameter Optional: string: +#' @param bc_object Optional: string: +#' @param flush_stdout Optional: string: +#' @param property_name Optional: string: +#' @param initial_value_parameter Optional: string: +#' @param constant_name Optional: string: +#' @param coefficient_current_variable_name Optional: string: +#' @param coefficient_other_variable_name Optional: string: +#' @param coefficient_mixed_variables_name Optional: string: +#' @param threshold_parameter Optional: string: +#' @param comparison_operator Optional: string: +#' @param time_interval Optional: list of 2, character: +#' @example man/examples/ex_prj_boundary_condition.R +#' @export r2ogs6_boundary_condition <- function(type, parameter = NULL, geometrical_set = NULL, @@ -275,15 +277,16 @@ new_r2ogs6_boundary_condition <- function(type, #===== r2ogs6_source_term ===== -#'r2ogs6_source_term -#'@description tag: source_term -#'@param type string: -#'@param parameter Optional: string: -#'@param geometrical_set Optional: string: -#'@param geometry Optional: string: -#'@param mesh Optional: string: -#'@param source_term_object Optional: string: -#'@export +#' r2ogs6_source_term +#' @description tag: source_term +#' @param type string: +#' @param parameter Optional: string: +#' @param geometrical_set Optional: string: +#' @param geometry Optional: string: +#' @param mesh Optional: string: +#' @param source_term_object Optional: string: +#' @example man/examples/ex_prj_source_term.R +#' @export r2ogs6_source_term <- function(type, parameter = NULL, geometrical_set = NULL, @@ -312,10 +315,10 @@ new_r2ogs6_source_term <- function(type, assertthat::assert_that(assertthat::is.string(type)) are_null_or_strings(parameter, - geometrical_set, - geometry, - mesh, - source_term_object) + geometrical_set, + geometry, + mesh, + source_term_object) structure(list(type = type, parameter = parameter, @@ -336,11 +339,12 @@ new_r2ogs6_source_term <- function(type, #===== r2ogs6_deactivated_subdomain ===== -#'r2ogs6_deactivated_subdomain -#'@description tag: deactivated_subdomain -#'@param time_interval list, numeric: -#'@param material_ids string | double: -#'@export +#' r2ogs6_deactivated_subdomain +#' @description tag: deactivated_subdomain +#' @param time_interval list, numeric: +#' @param material_ids string | double: +#' @example man/examples/ex_prj_deactivated_subdomain.R +#' @export r2ogs6_deactivated_subdomain <- function(time_interval, material_ids){ diff --git a/R/prj_search_length_algorithm.R b/R/prj_search_length_algorithm.R index 7e98dc421b8fb031826156240bb5d7c46975b87b..967952d5334f8b82488adc13c399b288c1121bab 100644 --- a/R/prj_search_length_algorithm.R +++ b/R/prj_search_length_algorithm.R @@ -2,11 +2,12 @@ #===== r2ogs6_search_length_algorithm ===== -#'r2ogs6_search_length_algorithm -#'@description tag: search_length_algorithm -#'@param type string: The type -#'@param value string | double: The value -#'@export +#' r2ogs6_search_length_algorithm +#' @description tag: search_length_algorithm +#' @param type string: The type +#' @param value string | double: The value +#' @example man/examples/ex_prj_search_length_algorithm.R +#' @export r2ogs6_search_length_algorithm <- function(type, value = NULL) { diff --git a/R/prj_time_loop.R b/R/prj_time_loop.R index 3d8d08ddd557da280fa624c3d0f0d374cdecfd0f..e056cf16375e47e9c033ed821558c01bae5dffaa 100644 --- a/R/prj_time_loop.R +++ b/R/prj_time_loop.R @@ -2,12 +2,13 @@ #===== r2ogs6_time_loop ===== -#'r2ogs6_time_loop -#'@description tag: time_loop -#'@param processes list, r2ogs6_tl_process: -#'@param output r2ogs6_output: -#'@param global_process_coupling Optional: r2ogs6_global_process_coupling: -#'@export +#' r2ogs6_time_loop +#' @description tag: time_loop +#' @param processes list, r2ogs6_tl_process: +#' @param output r2ogs6_output: +#' @param global_process_coupling Optional: r2ogs6_global_process_coupling: +#' @example man/examples/ex_prj_time_loop.R +#' @export r2ogs6_time_loop <- function(processes, output, global_process_coupling = NULL) { @@ -48,16 +49,17 @@ new_r2ogs6_time_loop <- function(processes, #===== r2ogs6_tl_process ===== -#'r2ogs6_tl_process -#'@description tag: process (parent: time_loop, NOT processes!) -#'@param ref string: References a r2ogs6_process object by name -#'@param nonlinear_solver string: -#'@param convergence_criterion r2ogs6_convergence_criterion: -#'@param time_discretization vector: -#'@param time_stepping r2ogs6_time_stepping: -#'@param compensate_non_equilibrium_initial_residuum string: Optional: Either -#'"true" or "false" -#'@export +#' r2ogs6_tl_process +#' @description tag: process (parent: time_loop, NOT processes!) +#' @param ref string: References a r2ogs6_process object by name +#' @param nonlinear_solver string: +#' @param convergence_criterion r2ogs6_convergence_criterion: +#' @param time_discretization vector: +#' @param time_stepping r2ogs6_time_stepping: +#' @param compensate_non_equilibrium_initial_residuum string: Optional: Either +#' "true" or "false" +#' @example man/examples/ex_prj_tl_process.R +#' @export r2ogs6_tl_process <- function(ref, nonlinear_solver, convergence_criterion, @@ -126,30 +128,31 @@ new_r2ogs6_tl_process <- function(ref, #===== r2ogs6_output ===== -#'r2ogs6_output -#'@description tag: output -#'@param type string: -#'@param prefix string: -#'@param variables vector: -#'@param suffix Optional: string: -#'@param timesteps Optional: -#'@param compress_output Optional: string: Should the output be compressed? -#' Either "true" or "false" -#'@param data_mode Optional: string: -#'@param output_iteration_results Optional: string: Either "true" or "false" -#'@param meshes Optional: character: A vector of mesh names -#'@param fixed_output_times Optional: string | numeric: -#'@export +#' r2ogs6_output +#' @description tag: output +#' @param type string: +#' @param prefix string: +#' @param variables vector: +#' @param suffix Optional: string: +#' @param timesteps Optional: +#' @param compress_output Optional: string: Should the output be compressed? +#' Either "true" or "false" +#' @param data_mode Optional: string: +#' @param output_iteration_results Optional: string: Either "true" or "false" +#' @param meshes Optional: character: A vector of mesh names +#' @param fixed_output_times Optional: string | numeric: +#' @example man/examples/ex_prj_output.R +#' @export r2ogs6_output <- function(type, - prefix, - variables, - suffix = NULL, - timesteps = NULL, - compress_output = NULL, - data_mode = NULL, - output_iteration_results = NULL, - meshes = NULL, - fixed_output_times = NULL) { + prefix, + variables, + suffix = NULL, + timesteps = NULL, + compress_output = NULL, + data_mode = NULL, + output_iteration_results = NULL, + meshes = NULL, + fixed_output_times = NULL) { #Coerce input fixed_output_times <- coerce_string_to_numeric(fixed_output_times) @@ -227,12 +230,13 @@ new_r2ogs6_output <- function(type, #===== r2ogs6_global_process_coupling ===== -#'r2ogs6_global_process_coupling -#'@description tag: global_process_coupling -#'@param max_iter string | double: Maximal number of iterations -#'@param convergence_criteria list, r2ogs6_convergence_criterion: -#' Convergence criteria -#'@export +#' r2ogs6_global_process_coupling +#' @description tag: global_process_coupling +#' @param max_iter string | double: Maximal number of iterations +#' @param convergence_criteria list, r2ogs6_convergence_criterion: +#' Convergence criteria +#' @example man/examples/ex_prj_global_process_coupling.R +#' @export r2ogs6_global_process_coupling <- function(max_iter, convergence_criteria) { @@ -268,15 +272,16 @@ new_r2ogs6_global_process_coupling <- function(max_iter, #===== r2ogs6_convergence_criterion ===== -#'r2ogs6_convergence_criterion -#'@description tag: convergence_criterion -#'@param type string: Type -#'@param norm_type string: ... -#'@param abstol string | double: Absolute tolerance -#'@param reltol string | double: Relative tolerance -#'@param abstols string | numeric: Absolute tolerances -#'@param reltols string | numeric: Relative tolerances -#'@export +#' r2ogs6_convergence_criterion +#' @description tag: convergence_criterion +#' @param type string: Type +#' @param norm_type string: ... +#' @param abstol string | double: Absolute tolerance +#' @param reltol string | double: Relative tolerance +#' @param abstols string | numeric: Absolute tolerances +#' @param reltols string | numeric: Relative tolerances +#' @example man/examples/ex_prj_convergence_criterion.R +#' @export r2ogs6_convergence_criterion <- function(type, norm_type, abstol = NULL, @@ -336,24 +341,25 @@ new_r2ogs6_convergence_criterion <- function(type, #===== r2ogs6_time_stepping ===== -#'r2ogs6_time_stepping -#'@description tag: time_stepping -#'@param type string: -#'@param t_initial Optional: string | double: -#'@param t_end Optional: string | double: -#'@param timesteps Optional: list: -#'@param initial_dt Optional: string | double: -#'@param minimum_dt Optional: string | double: -#'@param maximum_dt Optional: string | double: -#'@param number_iterations Optional: string | numeric: -#'@param multiplier Optional: string | numeric: -#'@param dt_guess Optional: string | double: -#'@param dt_min Optional: string | double: -#'@param dt_max Optional: string | double: -#'@param rel_dt_min Optional: string | double: -#'@param rel_dt_max Optional: string | double: -#'@param tol Optional: string | double: -#'@export +#' r2ogs6_time_stepping +#' @description tag: time_stepping +#' @param type string: +#' @param t_initial Optional: string | double: +#' @param t_end Optional: string | double: +#' @param timesteps Optional: list: +#' @param initial_dt Optional: string | double: +#' @param minimum_dt Optional: string | double: +#' @param maximum_dt Optional: string | double: +#' @param number_iterations Optional: string | numeric: +#' @param multiplier Optional: string | numeric: +#' @param dt_guess Optional: string | double: +#' @param dt_min Optional: string | double: +#' @param dt_max Optional: string | double: +#' @param rel_dt_min Optional: string | double: +#' @param rel_dt_max Optional: string | double: +#' @param tol Optional: string | double: +#' @example man/examples/ex_prj_time_stepping.R +#' @export r2ogs6_time_stepping <- function(type, t_initial = NULL, t_end = NULL, @@ -423,16 +429,16 @@ new_r2ogs6_time_stepping <- function(type, are_strings(type) are_null_or_numbers(t_initial, - t_end, - initial_dt, - minimum_dt, - maximum_dt, - dt_guess, - dt_min, - dt_max, - rel_dt_min, - rel_dt_max, - tol) + t_end, + initial_dt, + minimum_dt, + maximum_dt, + dt_guess, + dt_min, + dt_max, + rel_dt_min, + rel_dt_max, + tol) are_null_or_numeric(number_iterations, multiplier) diff --git a/R/prj_vtkdiff.R b/R/prj_vtkdiff.R index 8ab67b727189ed4d59e4f7842c154700821bb103..da33947ae80546f2a450f822031db5255eb13bbf 100644 --- a/R/prj_vtkdiff.R +++ b/R/prj_vtkdiff.R @@ -2,15 +2,16 @@ #===== r2ogs6_vtkdiff ===== -#'r2ogs6_vtkdiff -#'@description tag: vtkdiff +#' r2ogs6_vtkdiff +#' @description tag: vtkdiff #' -#'@param field string: ... -#'@param absolute_tolerance string | double: Absolute tolerance -#'@param relative_tolerance string | double: Relative tolerance -#'@param file string: Optional: File -#'@param regex string: Optional: A regular expression -#'@export +#' @param field string: ... +#' @param absolute_tolerance string | double: Absolute tolerance +#' @param relative_tolerance string | double: Relative tolerance +#' @param file string: Optional: File +#' @param regex string: Optional: A regular expression +#' @example man/examples/ex_prj_vtkdiff.R +#' @export r2ogs6_vtkdiff <- function(field, absolute_tolerance, relative_tolerance, @@ -38,10 +39,10 @@ new_r2ogs6_vtkdiff <- function(field, assertthat::assert_that(assertthat::is.string(field)) are_numbers(absolute_tolerance, - relative_tolerance) + relative_tolerance) are_null_or_strings(file, - regex) + regex) structure( list(field = field, diff --git a/R/scrape_benchmarks.R b/R/scrape_benchmarks.R deleted file mode 100644 index b8c55d890f05d3542c440eb1128c2abead3835ba..0000000000000000000000000000000000000000 --- a/R/scrape_benchmarks.R +++ /dev/null @@ -1,56 +0,0 @@ - -#===== download_benchmark ===== - - -#'download_benchmark -#'@description Downloads a single benchmark (consisting of one .prj file and -#' either one .gml and one .vtu file or multiple .vtu files) -#'@param prj_url string: URL of a .prj file -#'@param path string: Path the benchmark files should be saved to -download_benchmark <- function(prj_url, path) { - - assertthat::assert_that(assertthat::is.string(prj_url)) - - path <- as_dir_path(path) - - prj_dest_file <- paste0(path, basename(prj_url)) - file.create(prj_dest_file) - - prj_dir <- paste0(dirname(prj_url), "/") - - #Download the .prj file - tmp <- tempfile() - curl::curl_download(prj_url, tmp) - prj_doc <- validate_read_in_xml(tmp) - xml2::write_xml(prj_doc, prj_dest_file) - - gml_ref_node <- xml2::xml_find_first(prj_doc, "//geometry") - - #Get name of geometry file (if any) - if (class(gml_ref_node) != "xml_missing") { - geo_url <- paste0(prj_dir, xml2::xml_text(gml_ref_node)) - - gml_dest_file <- paste0(path, basename(geo_url)) - file.create(gml_dest_file) - curl::curl_download(geo_url, gml_dest_file) - - vtu_ref_node <- xml2::xml_find_first(prj_doc, "//mesh") - vtu_url <- paste0(prj_dir, xml2::xml_text(vtu_ref_node)) - - vtu_dest_file <- paste0(path, basename(vtu_url)) - file.create(vtu_dest_file) - curl::curl_download(vtu_url, vtu_dest_file) - }else{ - vtu_ref_nodes <- xml2::xml_find_all(prj_doc, "//meshes/*") - - for (i in seq_len(length(vtu_ref_nodes))) { - vtu_url <- paste0(prj_dir, xml2::xml_text(vtu_ref_nodes[[i]])) - - vtu_dest_file <- paste0(path, basename(vtu_url)) - file.create(vtu_dest_file) - curl::curl_download(vtu_url, vtu_dest_file) - } - } - - return(invisible(prj_dest_file)) -} diff --git a/R/utils.R b/R/utils.R index c4d4d4e634736839604cca12e132897cc28d992a..43f2a6a3f90fa3c07f363a8f2bd47ca57d4c3f7c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -2,10 +2,12 @@ #===== Implementation utility ===== -#'get_class_from_xpath -#'@description Gets r2ogs6 class name from an xpath-like expression -#'@param xpath string: An xpath expression. Works for path-like xpaths only -#'@return string: The class name. +#' get_class_from_xpath +#' @description Gets r2ogs6 class name from an xpath-like expression +#' @param xpath string: An xpath expression. Works for path-like xpaths only +#' @return string: The class name. +#' @examples +#' get_class_from_xpath("processes/process") get_class_from_xpath <- function(xpath){ assertthat::assert_that(assertthat::is.string(xpath)) @@ -21,14 +23,16 @@ get_class_from_xpath <- function(xpath){ } } - return(invisible(NULL)) + return(NULL) } -#'get_tag_from_class -#'@description Utility function, returns the tag name of a r2ogs6 class -#'@param class_name string: The name of a r2ogs6 class -#'@return string: The tag name corresponding to `class_name` +#' get_tag_from_class +#' @description Utility function, returns the tag name of a r2ogs6 class +#' @param class_name string: The name of a r2ogs6 class +#' @return string: The tag name corresponding to \code{class_name} +#' @examples +#' get_tag_from_class("r2ogs6_process") get_tag_from_class <- function(class_name) { assertthat::assert_that(assertthat::is.string(class_name)) @@ -39,14 +43,16 @@ get_tag_from_class <- function(class_name) { split_xpath <- unlist(strsplit(xpath[[1]], "/", fixed = TRUE)) tag_name <- split_xpath[[length(split_xpath)]] - return(invisible(tag_name)) + return(tag_name) } -#'get_tag_from_xpath -#'@description Gets the XML tag name from an xpath expression -#'@param xpath string: An xpath expression. Works for path-like xpaths only -#'@return string: The XML tag name. +#' get_tag_from_xpath +#' @description Gets the XML tag name from an xpath expression +#' @param xpath string: An xpath expression. Works for path-like xpaths only +#' @return string: The XML tag name +#' @examples +#' get_tag_from_xpath("processes/process") get_tag_from_xpath <- function(xpath){ xpath_split <- unlist(strsplit(xpath, "/", fixed = TRUE)) @@ -56,9 +62,9 @@ get_tag_from_xpath <- function(xpath){ } -#'prj_top_level_tags -#'@description Gets top level .prj tags along with info if they are required. -#'@return list: List of lists. +#' prj_top_level_tags +#' @description Gets top level .prj tags along with info if they are required. +#' @return list: List of lists. prj_top_level_tags <- function(){ prj_reduxml <- system.file("extdata/xml_redux/", "prj_redu.xml", @@ -75,10 +81,11 @@ prj_top_level_tags <- function(){ } -#'prj_top_level_classes -#'@description Returns named character vector of `OGS6` top level .prj tags -#' (names) represented by r2ogs6 classes along with their class names (values). -#'@return character +#' prj_top_level_classes +#' @description Returns named character vector of \code{OGS6} top level +#' \code{.prj} tags (names) represented by \code{r2ogs6} classes along with their +#' class names (values). +#' @return character prj_top_level_classes <- function(){ xpaths_for_classes <- xpaths_for_classes @@ -117,10 +124,12 @@ prj_top_level_classes <- function(){ #===== Coercion utility ===== -#'coerce_string_to_numeric -#'@description If an object is of type string, coerces it to a numeric type -#'@param obj object: Any object -#'@return numeric if 'obj' was a string, else unchanged 'obj' +#' coerce_string_to_numeric +#' @description If an object is of type string, coerces it to a numeric type +#' @param obj object: Any object +#' @return numeric if \code{obj} was a string, else unchanged \code{obj} +#' @examples +#' coerce_string_to_numeric("12 54 2 \n 2") coerce_string_to_numeric <- function(obj){ if(assertthat::is.string(obj)){ @@ -132,13 +141,12 @@ coerce_string_to_numeric <- function(obj){ } - -#'coerce_names -#'@description Validator function for a parameter vector -#'@param vector vector: Vector of parameters -#'@param names character: How the vector elements will be named as +#' coerce_names +#' @description Validator function for a parameter vector +#' @param vector vector: Vector of parameters +#' @param names character: How the vector elements will be named as #' per default -#'@return vector: Named vector where the names correspond to `names` +#' @return vector: Named vector where the names correspond to \code{names} coerce_names <- function(vector, names) { assertthat::assert_that(is.vector(vector)) @@ -166,10 +174,10 @@ coerce_names <- function(vector, names) { } -#'is_null_or_coerce_names -#'@description Validator function for a parameter list or vector or NULL -#'@param obj A list (or vector) of parameters -#'@param names How the list elements will be named as per default +#' is_null_or_coerce_names +#' @description Validator function for a parameter list or vector or \code{NULL} +#' @param obj A list (or vector) of parameters +#' @param names How the list elements will be named as per default is_null_or_coerce_names <- function(obj, names){ if(!is.null(obj)){ @@ -180,10 +188,10 @@ is_null_or_coerce_names <- function(obj, names){ } -#'clean_imported_list -#'@description Cleans an imported list because sometimes strings containing +#' clean_imported_list +#' @description Cleans an imported list because sometimes strings containing #' only newline characters and spaces get imported in -#'@param list list: A list +#' @param list list: A list clean_imported_list <- function(list){ assertthat::assert_that(is.list(list)) @@ -203,9 +211,9 @@ clean_imported_list <- function(list){ } -#'as_dir_path -#'@description Checks if a given path ends on '/' -#'@param path string: A path +#' as_dir_path +#' @description Checks if a given path ends on \code{/} +#' @param path string: A path as_dir_path <- function(path){ assertthat::assert_that(assertthat::is.string(path)) @@ -222,12 +230,13 @@ as_dir_path <- function(path){ } -#'filter_invalid_xml -#'@description Filters invalid XML paths out of a vector -#'@param paths character: Vector of (maybe-)XML paths -#'@param encoding string: Optional: XML encoding. Defaults to ISO-8859-1 -#'@param print_messages flag: Optional: Print error messages? Defaults to TRUE -#'@return character: Vector of invalid XML paths +#' filter_invalid_xml +#' @description Filters invalid XML paths out of a vector +#' @param paths character: Vector of (maybe-)XML paths +#' @param encoding string: Optional: XML encoding. Defaults to ISO-8859-1 +#' @param print_messages flag: Optional: Print error messages? Defaults to +#' \code{TRUE} +#' @return character: Vector of invalid XML paths filter_invalid_xml <- function(paths, encoding = "ISO-8859-1", print_messages = TRUE){ @@ -258,9 +267,9 @@ filter_invalid_xml <- function(paths, #===== Validation utility ===== -#'are_numbers -#'@description Checks if objects are numbers -#'@param ... Ellipsis +#' are_numbers +#' @description Checks if objects are numbers +#' @param ... Ellipsis are_numbers <- function(...){ lapply(list(...), function(x){ @@ -271,9 +280,9 @@ are_numbers <- function(...){ } -#'are_null_or_numbers -#'@description Checks if objects are either NULL or numbers -#'@param ... Ellipsis +#' are_null_or_numbers +#' @description Checks if objects are either \code{NULL} or numbers +#' @param ... Ellipsis are_null_or_numbers <- function(...){ lapply(list(...), function(x){ @@ -286,9 +295,9 @@ are_null_or_numbers <- function(...){ } -#'are_numeric -#'@description Checks if objects are numeric -#'@param ... Ellipsis +#' are_numeric +#' @description Checks if objects are numeric +#' @param ... Ellipsis are_numeric <- function(...){ lapply(list(...), function(x){ @@ -299,9 +308,9 @@ are_numeric <- function(...){ } -#'are_null_or_numeric -#'@description Checks if objects are either NULL or numeric -#'@param ... Ellipsis +#' are_null_or_numeric +#' @description Checks if objects are either \code{NULL} or numeric +#' @param ... Ellipsis are_null_or_numeric <- function(...){ lapply(list(...), function(x){ @@ -314,9 +323,9 @@ are_null_or_numeric <- function(...){ } -#'are_strings -#'@description Checks if objects are strings -#'@param ... Ellipsis +#' are_strings +#' @description Checks if objects are strings +#' @param ... Ellipsis are_strings <- function(...){ lapply(list(...), function(x){ @@ -327,9 +336,9 @@ are_strings <- function(...){ } -#'are_null_or_strings -#'@description Checks if objects are either NULL or strings -#'@param ... Ellipsis +#' are_null_or_strings +#' @description Checks if objects are either \code{NULL} or strings +#' @param ... Ellipsis are_null_or_strings <- function(...){ lapply(list(...), function(x){ @@ -342,9 +351,9 @@ are_null_or_strings <- function(...){ } -#'are_string_flags -#'@description Checks if objects are strings reading either "true" or "false" -#'@param ... Ellipsis +#' are_string_flags +#' @description Checks if objects are strings reading either "true" or "false" +#' @param ... Ellipsis are_string_flags <- function(...){ lapply(list(...), function(x){ @@ -356,10 +365,10 @@ are_string_flags <- function(...){ } -#'are_null_or_string_flags -#'@description Checks if objects are either NULL or strings reading either -#' "true" or "false" -#'@param ... Ellipsis +#' are_null_or_string_flags +#' @description Checks if objects are either \code{NULL} or strings reading +#' either "true" or "false" +#' @param ... Ellipsis are_null_or_string_flags <- function(...){ lapply(list(...), function(x){ @@ -372,11 +381,11 @@ are_null_or_string_flags <- function(...){ } -#'is_wrapper_list -#'@description Checks if a list consists only of elements of class -#' `element_class` -#'@param list list: List to check -#'@param element_class string: Class each element of `list` should have +#' is_wrapper_list +#' @description Checks if a list consists only of elements of class +#' \code{element_class} +#' @param list list: List to check +#' @param element_class string: Class each element of \code{list} should have is_wrapper_list <- function(list, element_class) { assertthat::assert_that(is.list(list)) @@ -389,11 +398,11 @@ is_wrapper_list <- function(list, element_class) { } -#'is_null_or_wrapper_list -#'@description Checks if an object is either NULL or a list of elements -#' of class `element_class` -#'@param obj list | NULL: Object to check -#'@param element_class string: Class each element of `obj` should have +#' is_null_or_wrapper_list +#' @description Checks if an object is either \code{NULL} or a list of elements +#' of class \code{element_class} +#' @param obj list | NULL: Object to check +#' @param element_class string: Class each element of \code{obj} should have is_null_or_wrapper_list <- function(obj, element_class) { if(!is.null(obj)){ @@ -408,11 +417,11 @@ is_null_or_wrapper_list <- function(obj, element_class) { } -#'is_null_or_has_class -#'@description Checks if an object is either null or a class object of class -#' 'class_name' -#'@param obj The object to check -#'@param class_name The name of the expected class +#' is_null_or_has_class +#' @description Checks if an object is either \code{NULL} or a class object of +#' class \code{class_name} +#' @param obj The object to check +#' @param class_name The name of the expected class is_null_or_has_class <- function(obj, class_name){ if(!is.null(obj)){ diff --git a/man/OGS6.Rd b/man/OGS6.Rd index 3e941a8979bbf59ee88ecfab338dd36a4dde30f9..14948b8edccd1d32959a84fecca7130cd1a07700 100644 --- a/man/OGS6.Rd +++ b/man/OGS6.Rd @@ -4,62 +4,105 @@ \alias{OGS6} \title{OGS6} \description{ -Constructor for the OGS6 base class +Constructor for the \code{OGS6} base class +} +\examples{ + +## ------------------------------------------------ +## Method `OGS6$new` +## ------------------------------------------------ + +ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") + +## ------------------------------------------------ +## Method `OGS6$add` +## ------------------------------------------------ + +ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add(r2ogs6_parameter$new(name = "foo", type = "bar")) + +## ------------------------------------------------ +## Method `OGS6$add_gml` +## ------------------------------------------------ + +ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add_gml("this_works.gml") +\dontrun{ogs6_obj$add_gml("this_doesnt.oops")} + +## ------------------------------------------------ +## Method `OGS6$add_vtu` +## ------------------------------------------------ + +ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add_vtu("this_works.vtu") +\dontrun{ogs6_obj$add_vtu("this_doesnt.oops")} + +## ------------------------------------------------ +## Method `OGS6$get_status` +## ------------------------------------------------ + +ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$get_status() } \section{Active bindings}{ \if{html}{\out{<div class="r6-active-bindings">}} \describe{ -\item{\code{sim_name}}{Simulation name. `value` must be string} +\item{\code{sim_name}}{Simulation name. \code{value} must be string} -\item{\code{sim_path}}{Simulation path. `value` must be string} +\item{\code{sim_path}}{Simulation path. \code{value} must be string} -\item{\code{logfile}}{Logfile path. `value` must be string} +\item{\code{logfile}}{Logfile path. \code{value} must be string} -\item{\code{gml}}{.gml. read-only} +\item{\code{gml}}{\code{.gml}. read-only} -\item{\code{geometry}}{.prj `geometry` tag. `value` must be string} +\item{\code{geometry}}{\code{.prj} \code{geometry} tag. \code{value} must be string} -\item{\code{meshes}}{.prj `meshes` tag. `value` must be list of strings} +\item{\code{meshes}}{\code{.prj} \code{meshes} tag. \code{value} must be list of strings} -\item{\code{vtus}}{.vtus. `value` must be list of `OGS_vtu` objects} +\item{\code{vtus}}{\code{.vtu}s. \code{value} must be list of \code{OGS6_vtu} objects} -\item{\code{python_script}}{.prj `python_script` tag. `value` must be string} +\item{\code{python_script}}{\code{.prj} \code{python_script} tag. \code{value} must be string} -\item{\code{search_length_algorithm}}{.prj `search_length_algorithm` tag. `value` must be -`r2ogs6_search_length_algorithm` object} +\item{\code{search_length_algorithm}}{\code{.prj} \code{search_length_algorithm} tag. \code{value} must be +\code{r2ogs6_search_length_algorithm} object} -\item{\code{processes}}{.prj `processes` tag. `value` must be list of `r2ogs6_process` objects} +\item{\code{processes}}{\code{.prj} \code{processes} tag. \code{value} must be list of +\code{r2ogs6_process} objects} -\item{\code{time_loop}}{.prj `time_loop` tag. `value` must be `r2ogs6_time_loop` object} +\item{\code{time_loop}}{\code{.prj} \code{time_loop} tag. \code{value} must be +\code{r2ogs6_time_loop} object} -\item{\code{local_coordinate_system}}{.prj `local_coordinate_system` tag. `value` must be -`r2ogs6_local_coordinate_system` object} +\item{\code{local_coordinate_system}}{\code{.prj} \code{local_coordinate_system} tag. \code{value} must be +\code{r2ogs6_local_coordinate_system} object} -\item{\code{media}}{.prj `media` tag. `value` must be list of `r2ogs6_medium` objects} +\item{\code{media}}{\code{.prj} \code{media} tag. \code{value} must be list of +\code{r2ogs6_medium} objects} -\item{\code{parameters}}{.prj `parameters` tag. `value` must be list of `r2ogs6_parameter` -objects} +\item{\code{parameters}}{\code{.prj} \code{parameters} tag. \code{value} must be list of +\code{r2ogs6_parameter} objects} -\item{\code{chemical_system}}{.prj `chemical_system` tag. `value` must be `r2ogs6_chemical_system` -object} +\item{\code{chemical_system}}{\code{.prj} \code{chemical_system} tag. \code{value} must be +\code{r2ogs6_chemical_system} object} -\item{\code{curves}}{.prj `curves` tag. `value` must be list of `r2ogs6_curve` objects} +\item{\code{curves}}{\code{.prj} \code{curves} tag. \code{value} must be list of +\code{r2ogs6_curve} objects} -\item{\code{process_variables}}{.prj `process_variables` tag. `value` must be list of -`r2ogs6_process_variable` objects} +\item{\code{process_variables}}{\code{.prj} \code{process_variables} tag. \code{value} must be list of +\code{r2ogs6_process_variable} objects} -\item{\code{nonlinear_solvers}}{.prj `nonlinear_solvers` tag. `value` must be list of -`r2ogs6_nonlinear_solver` objects} +\item{\code{nonlinear_solvers}}{\code{.prj} \code{nonlinear_solvers} tag. \code{value} must be list of +\code{r2ogs6_nonlinear_solver} objects} -\item{\code{linear_solvers}}{.prj `linear_solvers` tag. `value` must be list of -`r2ogs6_linear_solver` objects} +\item{\code{linear_solvers}}{\code{.prj} \code{linear_solvers} tag. \code{value} must be list of +\code{r2ogs6_linear_solver} objects} -\item{\code{test_definition}}{.prj `test_definition` tag. `value` must be list of `r2ogs6_vtkdiff` -objects} +\item{\code{test_definition}}{\code{.prj} \code{test_definition} tag. \code{value} must be list of +\code{r2ogs6_vtkdiff} objects} -\item{\code{insitu}}{.prj `insitu` tag. `value` must be `r2ogs6_insitu` object} +\item{\code{insitu}}{\code{.prj} \code{insitu} tag. \code{value} must be +\code{r2ogs6_insitu} object} -\item{\code{pvds}}{.pvds. `value` must be list of `OGS6_pvd` objects} +\item{\code{pvds}}{\code{.pvd}s. \code{value} must be list of \code{OGS6_pvd} objects} } \if{html}{\out{</div>}} } @@ -96,6 +139,14 @@ saved} } \if{html}{\out{</div>}} } +\subsection{Examples}{ +\if{html}{\out{<div class="r example copy">}} +\preformatted{ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +} +\if{html}{\out{</div>}} + +} + } \if{html}{\out{<hr>}} \if{html}{\out{<a id="method-add"></a>}} @@ -113,12 +164,22 @@ Adds a .prj simulation component } \if{html}{\out{</div>}} } +\subsection{Examples}{ +\if{html}{\out{<div class="r example copy">}} +\preformatted{ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add(r2ogs6_parameter$new(name = "foo", type = "bar")) +} +\if{html}{\out{</div>}} + +} + } \if{html}{\out{<hr>}} \if{html}{\out{<a id="method-add_gml"></a>}} \if{latex}{\out{\hypertarget{method-add_gml}{}}} \subsection{Method \code{add_gml()}}{ -Adds a reference to a .gml file and optionally, a OGS6_gml object +Adds a reference to a file with ending .gml and optionally, a +\code{OGS6_gml} object \subsection{Usage}{ \if{html}{\out{<div class="r">}}\preformatted{OGS6$add_gml(gml)}\if{html}{\out{</div>}} } @@ -126,17 +187,28 @@ Adds a reference to a .gml file and optionally, a OGS6_gml object \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{gml}}{string | r2ogs6_gml: Either a path to a file with extension -.gml or a r2ogs6_gml object.} +\item{\code{gml}}{string | OGS6_gml: Either a path to a file with extension +.gml or a OGS6_gml object.} } \if{html}{\out{</div>}} } +\subsection{Examples}{ +\if{html}{\out{<div class="r example copy">}} +\preformatted{ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add_gml("this_works.gml") +\dontrun{ogs6_obj$add_gml("this_doesnt.oops")} +} +\if{html}{\out{</div>}} + +} + } \if{html}{\out{<hr>}} \if{html}{\out{<a id="method-add_vtu"></a>}} \if{latex}{\out{\hypertarget{method-add_vtu}{}}} \subsection{Method \code{add_vtu()}}{ -Adds a reference to a .vtu file and optionally, a OGS6_vtu object +Adds a reference to a \code{.vtu} file and optionally, a \code{OGS6_vtu} +object \subsection{Usage}{ \if{html}{\out{<div class="r">}}\preformatted{OGS6$add_vtu(path, read_in_vtu = FALSE)}\if{html}{\out{</div>}} } @@ -144,19 +216,29 @@ Adds a reference to a .vtu file and optionally, a OGS6_vtu object \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{path}}{string:} +\item{\code{path}}{string: A path} -\item{\code{read_in_vtu}}{flag: Optional: Should .vtu file just be copied or -read in too?} +\item{\code{read_in_vtu}}{flag: Optional: Should \code{.vtu} file just be +copied or read in too?} +} +\if{html}{\out{</div>}} +} +\subsection{Examples}{ +\if{html}{\out{<div class="r example copy">}} +\preformatted{ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$add_vtu("this_works.vtu") +\dontrun{ogs6_obj$add_vtu("this_doesnt.oops")} } \if{html}{\out{</div>}} + } + } \if{html}{\out{<hr>}} \if{html}{\out{<a id="method-get_status"></a>}} \if{latex}{\out{\hypertarget{method-get_status}{}}} \subsection{Method \code{get_status()}}{ -Checks if the OGS6 object has all necessary parameters for +Checks if the \code{OGS6} object has all necessary parameters for starting a simulation \subsection{Usage}{ \if{html}{\out{<div class="r">}}\preformatted{OGS6$get_status(print_status = TRUE)}\if{html}{\out{</div>}} @@ -169,6 +251,15 @@ starting a simulation } \if{html}{\out{</div>}} } +\subsection{Examples}{ +\if{html}{\out{<div class="r example copy">}} +\preformatted{ogs6_obj <- OGS6$new(sim_name = "my_sim", sim_path = "my/path") +ogs6_obj$get_status() +} +\if{html}{\out{</div>}} + +} + } \if{html}{\out{<hr>}} \if{html}{\out{<a id="method-print"></a>}} @@ -195,7 +286,7 @@ Prints logfile to console (if it exists) \if{html}{\out{<a id="method-clear"></a>}} \if{latex}{\out{\hypertarget{method-clear}{}}} \subsection{Method \code{clear()}}{ -Clears components from the OGS6 object +Clears components from the \code{OGS6} object \subsection{Usage}{ \if{html}{\out{<div class="r">}}\preformatted{OGS6$clear(which)}\if{html}{\out{</div>}} } @@ -205,7 +296,7 @@ Clears components from the OGS6 object \describe{ \item{\code{which}}{character: The names of the components (all by default). If you want to delete only some components, run -names(prj_top_level_classes()) for the available options.} +\code{names(prj_top_level_classes())} for the available options.} } \if{html}{\out{</div>}} } diff --git a/man/OGS6_Ensemble.Rd b/man/OGS6_Ensemble.Rd index 2d42dac93d22a4bef90de32320a082fd9c6f3594..15b77c315aac1960b0f9aee64c19a7c7dc09be63 100644 --- a/man/OGS6_Ensemble.Rd +++ b/man/OGS6_Ensemble.Rd @@ -27,7 +27,7 @@ Constructor for the OGS6_Ensemble base class \item \href{#method-new}{\code{OGS6_Ensemble$new()}} \item \href{#method-print}{\code{OGS6_Ensemble$print()}} \item \href{#method-run_simulation}{\code{OGS6_Ensemble$run_simulation()}} -\item \href{#method-relevant_parameter_at}{\code{OGS6_Ensemble$relevant_parameter_at()}} +\item \href{#method-get_point_data}{\code{OGS6_Ensemble$get_point_data()}} \item \href{#method-clone}{\code{OGS6_Ensemble$clone()}} } } @@ -94,22 +94,38 @@ This is implementented via the 'parallel' package.} } } \if{html}{\out{<hr>}} -\if{html}{\out{<a id="method-relevant_parameter_at"></a>}} -\if{latex}{\out{\hypertarget{method-relevant_parameter_at}{}}} -\subsection{Method \code{relevant_parameter_at()}}{ -If the ensemble was created in sequential_mode, this will get the -name of the value vector that was being iterated over at the given -`index` during ensemble creation. I. e. if the ensemble was created -with the value vectors `a = c(1, 2, 3)` and `b = c("foo", "bar")`, -an `index` of 4 would return `"b"` +\if{html}{\out{<a id="method-get_point_data"></a>}} +\if{latex}{\out{\hypertarget{method-get_point_data}{}}} +\subsection{Method \code{get_point_data()}}{ +Wrapper for `OGS6_pvd$get_point_data()` Returns combined dataframe +with extra `name` and / or `perc` column depending on if +`sequential_mode` and / or `percentages_mode` were used. \subsection{Usage}{ -\if{html}{\out{<div class="r">}}\preformatted{OGS6_Ensemble$relevant_parameter_at(index)}\if{html}{\out{</div>}} +\if{html}{\out{<div class="r">}}\preformatted{OGS6_Ensemble$get_point_data( + pvd_id = 1, + point_ids, + keys, + start_at_timestep, + end_at_timestep +)}\if{html}{\out{</div>}} } \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{index}}{number: Index} +\item{\code{pvd_id}}{number: Optional: Which .pvd to consider in OGS6$pvds. +Defaults to 1.} + +\item{\code{point_ids}}{numeric: Optional: Point IDs. Defaults to all.} + +\item{\code{keys}}{character: Optional: `Name` attributes of `DataArray` +elements. Defaults to all.} + +\item{\code{start_at_timestep}}{number: Optional: Timestep to start at. +Defaults to first timestep.} + +\item{\code{end_at_timestep}}{number: Optional: Timestep to end at. Defaults +to last timestep.} } \if{html}{\out{</div>}} } diff --git a/man/OGS6_gml.Rd b/man/OGS6_gml.Rd index c7f4e63d323ad621c93f9fc69b7a2efdc2c89293..48aad92508f8439a3ce953d3e51b7147e639198d 100644 --- a/man/OGS6_gml.Rd +++ b/man/OGS6_gml.Rd @@ -6,6 +6,26 @@ \description{ Constructor for the OGS6_gml base class } +\examples{ +OGS6_gml$new( + name = "cube_1x1x1_geometry", + points = tibble::tibble( + x = c(0, 0, 0, 0), + y = c(0, 0, 1, 1), + z = c(0, 1, 1, 0), + name = c("origin", "", "", "") + ), + polylines = list(polyline = list("front_left", + c( + pnt = 0, pnt = 1 + ))), + surfaces = list(surface = list( + name = "left", + element = c(p1 = 0, p2 = 1, p3 = 2), + element = c(p1 = 0, p2 = 3, p3 = 2) + )) +) +} \section{Active bindings}{ \if{html}{\out{<div class="r6-active-bindings">}} \describe{ @@ -62,7 +82,7 @@ have optional 'name' vector} \item{\code{polylines}}{list(list("foo", c(1, 2))):} -\item{\code{surfaces}}{list(list("foo", c(1, 2, 3), c(2, 3, 4))):} +\item{\code{surfaces}}{list(list("foo", c(1, 2, 3), c(2, 3, 4)))} } \if{html}{\out{</div>}} } diff --git a/man/are_null_or_numbers.Rd b/man/are_null_or_numbers.Rd index bfa1f97512acce88d821d94f50b2cc2f88fd7573..a646d8c38c459e29f8024965596693c5749d96d1 100644 --- a/man/are_null_or_numbers.Rd +++ b/man/are_null_or_numbers.Rd @@ -10,5 +10,5 @@ are_null_or_numbers(...) \item{...}{Ellipsis} } \description{ -Checks if objects are either NULL or numbers +Checks if objects are either \code{NULL} or numbers } diff --git a/man/are_null_or_numeric.Rd b/man/are_null_or_numeric.Rd index 088882791d709636769dd4f1d33bcb61729e516a..d6f3c7b7e0a3f9fc36d79d17343f747b4020b60f 100644 --- a/man/are_null_or_numeric.Rd +++ b/man/are_null_or_numeric.Rd @@ -10,5 +10,5 @@ are_null_or_numeric(...) \item{...}{Ellipsis} } \description{ -Checks if objects are either NULL or numeric +Checks if objects are either \code{NULL} or numeric } diff --git a/man/are_null_or_string_flags.Rd b/man/are_null_or_string_flags.Rd index a719b10fedb113c2e1e378b213647f79befe4afd..31b05fdeef2f14a2fdec1b9f5c0908a02931ccb2 100644 --- a/man/are_null_or_string_flags.Rd +++ b/man/are_null_or_string_flags.Rd @@ -10,6 +10,6 @@ are_null_or_string_flags(...) \item{...}{Ellipsis} } \description{ -Checks if objects are either NULL or strings reading either -"true" or "false" +Checks if objects are either \code{NULL} or strings reading +either "true" or "false" } diff --git a/man/are_null_or_strings.Rd b/man/are_null_or_strings.Rd index 533510897c125c7c8333c9ed38054034f76912cc..c9c67f0df76c7a298fa01d1eb72530094be6df54 100644 --- a/man/are_null_or_strings.Rd +++ b/man/are_null_or_strings.Rd @@ -10,5 +10,5 @@ are_null_or_strings(...) \item{...}{Ellipsis} } \description{ -Checks if objects are either NULL or strings +Checks if objects are either \code{NULL} or strings } diff --git a/man/as_dir_path.Rd b/man/as_dir_path.Rd index d6adefeea91300910a65bb9307bc1bc03b4a8b6e..47b0dc6ed94582cc19e38593865b065fca955df1 100644 --- a/man/as_dir_path.Rd +++ b/man/as_dir_path.Rd @@ -10,5 +10,5 @@ as_dir_path(path) \item{path}{string: A path} } \description{ -Checks if a given path ends on '/' +Checks if a given path ends on \code{/} } diff --git a/man/build_redux_doc.Rd b/man/build_redux_doc.Rd index 24e0d59f10137c7bb705f5387bb05fae128fdfd7..85e005c088c3eec2f9ad7a86291511eed47db4f4 100644 --- a/man/build_redux_doc.Rd +++ b/man/build_redux_doc.Rd @@ -7,15 +7,16 @@ build_redux_doc(path, pattern, xpath, export_path) } \arguments{ -\item{path}{string: See ?analyse_xml} +\item{path}{string: See \code{?analyse_xml}} -\item{pattern}{string: See ?analyse_xml} +\item{pattern}{string: See \code{?analyse_xml}} -\item{xpath}{string: See ?analyse_xml} +\item{xpath}{string: See \code{?analyse_xml}} \item{export_path}{string: Path to export the XML document to} } \description{ -Builds an XML document based on the findings of analyse_xml. -Calls recursive function `build_redux_tree` internally. +Builds an XML document based on the findings of +\code{analyse_xml()}. Calls recursive function \code{build_redux_tree()} +internally. } diff --git a/man/build_redux_tree.Rd b/man/build_redux_tree.Rd index 9de941080512ca774b5c37712fabcb3cf9b283e3..11f2cc7ecc0d692234617cb7530f8903431596f9 100644 --- a/man/build_redux_tree.Rd +++ b/man/build_redux_tree.Rd @@ -7,15 +7,15 @@ build_redux_tree(path, pattern, xpath, required) } \arguments{ -\item{path}{string: See ?analyse_xml} +\item{path}{string: See \code{?analyse_xml}} -\item{pattern}{string: See ?analyse_xml} +\item{pattern}{string: See \code{?analyse_xml}} -\item{xpath}{string: See ?analyse_xml} +\item{xpath}{string: See \code{?analyse_xml}} \item{required}{flag: Recursion utility} } \description{ -Builds an XML tree based on the findings of analyse_xml. -This is a recursive function. Handle with care. +Builds an XML tree based on the findings of +\code{analyse_xml()}. This is a recursive function. } diff --git a/man/coerce_names.Rd b/man/coerce_names.Rd index ea12331dc11a8c1c6a6cd0cab5713a788201e6f1..be60541341a4930832171abc851ac402db62b686 100644 --- a/man/coerce_names.Rd +++ b/man/coerce_names.Rd @@ -13,7 +13,7 @@ coerce_names(vector, names) per default} } \value{ -vector: Named vector where the names correspond to `names` +vector: Named vector where the names correspond to \code{names} } \description{ Validator function for a parameter vector diff --git a/man/coerce_string_to_numeric.Rd b/man/coerce_string_to_numeric.Rd index b3f45c507054291514e27471301ab9579608a90d..4061da8a4305c77485bf9295d927195a3545f2c4 100644 --- a/man/coerce_string_to_numeric.Rd +++ b/man/coerce_string_to_numeric.Rd @@ -10,8 +10,11 @@ coerce_string_to_numeric(obj) \item{obj}{object: Any object} } \value{ -numeric if 'obj' was a string, else unchanged 'obj' +numeric if \code{obj} was a string, else unchanged \code{obj} } \description{ If an object is of type string, coerces it to a numeric type } +\examples{ + coerce_string_to_numeric("12 54 2 \n 2") +} diff --git a/man/construct_add_call.Rd b/man/construct_add_call.Rd index fb98e19e309c5b7cb4f88e0492a2e7bab7a63690..3753914b929358ba876859776d1eac2790b9320b 100644 --- a/man/construct_add_call.Rd +++ b/man/construct_add_call.Rd @@ -7,17 +7,17 @@ construct_add_call(object, nested_call = FALSE) } \arguments{ -\item{object}{An object (numeric, character, list, NULL, OGS6 or r2ogs6 class -object)} +\item{object}{An object (numeric, character, list, NULL, \code{OGS6} or +\code{r2ogs6} class object)} \item{nested_call}{Optional: For recursion purposes, you should leave this as it is.} } \value{ -A string representing the code with which the component would be added -to an OGS6 object +A string representing the code with which the component would be +added to an \code{OGS6} object } \description{ -Constructs a call based on an OGS6 component. This is a +Constructs a call based on an \code{OGS6} component. This is a recursive function, handle with care. } diff --git a/man/download_benchmark.Rd b/man/download_benchmark.Rd deleted file mode 100644 index f7b6eb03e2c5bdb1d581b8833dc5b8420cc578d9..0000000000000000000000000000000000000000 --- a/man/download_benchmark.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scrape_benchmarks.R -\name{download_benchmark} -\alias{download_benchmark} -\title{download_benchmark} -\usage{ -download_benchmark(prj_url, path) -} -\arguments{ -\item{prj_url}{string: URL of a .prj file} - -\item{path}{string: Path the benchmark files should be saved to} -} -\description{ -Downloads a single benchmark (consisting of one .prj file and -either one .gml and one .vtu file or multiple .vtu files) -} diff --git a/man/examples/ex_prj_borehole_heat_exchanger.R b/man/examples/ex_prj_borehole_heat_exchanger.R new file mode 100644 index 0000000000000000000000000000000000000000..45959518076908b46ff8f1a9d9637d044dc9e15e --- /dev/null +++ b/man/examples/ex_prj_borehole_heat_exchanger.R @@ -0,0 +1,37 @@ +r2ogs6_borehole_heat_exchanger( + type = "1U", + flow_and_temperature_control = r2ogs6_flow_and_temperature_control( + type = "TemperatureCurveConstantFlow", + flow_rate = 2e-04, + temperature_curve = "inflow_temperature" + ), + borehole = list(length = "18.0", + diameter = "0.13"), + grout = list( + density = "2190.0", + porosity = "0.0", + heat_capacity = "1735.160", + thermal_conductivity = "0.806" + ), + pipes = r2ogs6_pipes( + longitudinal_dispersion_length = 0.001, + inlet = list( + diameter = " 0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + outlet = list( + diameter = "0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + distance_between_pipes = 0.053 + ), + refrigerant = list( + density = "992.92", + viscosity = "0.00067418", + specific_heat_capacity = "4068", + thermal_conductivity = "0.62863", + reference_temperature = "298.15" + ) +) diff --git a/man/examples/ex_prj_boundary_condition.R b/man/examples/ex_prj_boundary_condition.R new file mode 100644 index 0000000000000000000000000000000000000000..f64d1c2911125d43f473b3f7bf0662a27dc9a1a1 --- /dev/null +++ b/man/examples/ex_prj_boundary_condition.R @@ -0,0 +1,7 @@ +r2ogs6_boundary_condition( + type = "Neumann", + parameter = "flux_in", + geometrical_set = "cube_1x1x1_geometry", + geometry = "left", + component = 0 +) diff --git a/man/examples/ex_prj_capillary_pressure.R b/man/examples/ex_prj_capillary_pressure.R new file mode 100644 index 0000000000000000000000000000000000000000..0e4a0a013f6317a92c3a5d7c595b4bd3710d8bff --- /dev/null +++ b/man/examples/ex_prj_capillary_pressure.R @@ -0,0 +1,9 @@ +r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" +) diff --git a/man/examples/ex_prj_chemical_system.R b/man/examples/ex_prj_chemical_system.R new file mode 100644 index 0000000000000000000000000000000000000000..72427ae876ae5d25ac15a33cd97adf346a35b4d7 --- /dev/null +++ b/man/examples/ex_prj_chemical_system.R @@ -0,0 +1,29 @@ +r2ogs6_chemical_system( + chemical_solver = "Phreeqc", + database = "PSINA_12_07_110615_DAV_s.dat", + solution = r2ogs6_solution( + temperature = 25, + pressure = 1, + pe = 4, + components = list( + component = "C(4)", + component = "Ca" + ), + charge_balance = "pH" + ), + mesh = "calcite_ReactiveDomain", + knobs = list( + max_iter = "100", + relative_convergence_tolerance = "1e-12", + tolerance = "1e-15", + step_size = "100", + scaling = "0" + ), + equilibrium_reactants = list( + phase_component = r2ogs6_phase_component( + name = "Calcite", + saturation_index = 0, + initial_amount = 0.000207 + ) + ) +) diff --git a/man/examples/ex_prj_com_property.R b/man/examples/ex_prj_com_property.R new file mode 100644 index 0000000000000000000000000000000000000000..31b57e34249fdbc64b38de94f983647db03c0a10 --- /dev/null +++ b/man/examples/ex_prj_com_property.R @@ -0,0 +1,3 @@ +r2ogs6_com_property(name = "molecular_diffusion", + type = "Constant", + value = 2e-09) diff --git a/man/examples/ex_prj_component.R b/man/examples/ex_prj_component.R new file mode 100644 index 0000000000000000000000000000000000000000..ee35ed0d491717f970cb333e50515288df2c7d15 --- /dev/null +++ b/man/examples/ex_prj_component.R @@ -0,0 +1,8 @@ +r2ogs6_component( + name = "concentration", + properties = list( + property = r2ogs6_com_property(name = "molecular_diffusion", + type = "Constant", + value = 2e-09) + ) +) diff --git a/man/examples/ex_prj_constitutive_relation.R b/man/examples/ex_prj_constitutive_relation.R new file mode 100644 index 0000000000000000000000000000000000000000..206d6fa19b40f0241c0f39fa6233057bdcb357dd --- /dev/null +++ b/man/examples/ex_prj_constitutive_relation.R @@ -0,0 +1,5 @@ +r2ogs6_constitutive_relation( + type = "LinearElasticIsotropic", + youngs_modulus = "E", + poissons_ratio = "nu" +) diff --git a/man/examples/ex_prj_convergence_criterion.R b/man/examples/ex_prj_convergence_criterion.R new file mode 100644 index 0000000000000000000000000000000000000000..f34fbdd975c14ab910946782d7320250dc935f55 --- /dev/null +++ b/man/examples/ex_prj_convergence_criterion.R @@ -0,0 +1,6 @@ +r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "INFINITY_N", + abstol = 1e-08, + reltol = 1e-10 +) diff --git a/man/examples/ex_prj_curve.R b/man/examples/ex_prj_curve.R new file mode 100644 index 0000000000000000000000000000000000000000..26f166a2b96458dca2d015d58669a67bb663ce0d --- /dev/null +++ b/man/examples/ex_prj_curve.R @@ -0,0 +1,3 @@ +r2ogs6_curve(name = "Dirichlet_temporal", + coords = "0 3", + values = "200 200") \ No newline at end of file diff --git a/man/examples/ex_prj_deactivated_subdomain.R b/man/examples/ex_prj_deactivated_subdomain.R new file mode 100644 index 0000000000000000000000000000000000000000..e67be0a5eb0bc5d7ecad069bd281d8a9eef63ea2 --- /dev/null +++ b/man/examples/ex_prj_deactivated_subdomain.R @@ -0,0 +1,3 @@ +r2ogs6_deactivated_subdomain(time_interval = list(start = "0", + end = "1"), + material_ids = 1) diff --git a/man/examples/ex_prj_eigen.R b/man/examples/ex_prj_eigen.R new file mode 100644 index 0000000000000000000000000000000000000000..29aa95b4c5f9d1fa44f2676670c7274a2b567757 --- /dev/null +++ b/man/examples/ex_prj_eigen.R @@ -0,0 +1,6 @@ +r2ogs6_eigen( + solver_type = "BiCGSTAB", + precon_type = "ILUT", + max_iteration_step = 10000, + error_tolerance = 1e-16 +) \ No newline at end of file diff --git a/man/examples/ex_prj_flow_and_temperature_control.R b/man/examples/ex_prj_flow_and_temperature_control.R new file mode 100644 index 0000000000000000000000000000000000000000..ee98437ff302fcc8421438aa3d275f0a33910757 --- /dev/null +++ b/man/examples/ex_prj_flow_and_temperature_control.R @@ -0,0 +1,5 @@ +r2ogs6_flow_and_temperature_control( + type = "TemperatureCurveConstantFlow", + flow_rate = 2e-04, + temperature_curve = "inflow_temperature" +) diff --git a/man/examples/ex_prj_fluid.R b/man/examples/ex_prj_fluid.R new file mode 100644 index 0000000000000000000000000000000000000000..4805e549e7a52b4e7c9482fcc71b19c37e792499 --- /dev/null +++ b/man/examples/ex_prj_fluid.R @@ -0,0 +1,10 @@ +r2ogs6_fluid( + liquid_density = list(type = "Constant", + value = " 1.e3 "), + gas_density = list(type = "IdealGasLaw", + molar_mass = " 0.002 "), + liquid_viscosity = list(type = "Constant", + value = " 3.171e-11 "), + gas_viscosity = list(type = "Constant", + value = " 2.8539e-13 ") +) diff --git a/man/examples/ex_prj_fracture_model.R b/man/examples/ex_prj_fracture_model.R new file mode 100644 index 0000000000000000000000000000000000000000..2e6c88c4d5bdc29212d15824d8a32791f962bf76 --- /dev/null +++ b/man/examples/ex_prj_fracture_model.R @@ -0,0 +1,5 @@ +r2ogs6_fracture_model(type = "LinearElasticIsotropic", + normal_stiffness = "Kn", + shear_stiffness = "Ks", + penalty_aperture_cutoff = 1e-05, + tension_cutoff = 1) diff --git a/man/examples/ex_prj_fracture_properties.R b/man/examples/ex_prj_fracture_properties.R new file mode 100644 index 0000000000000000000000000000000000000000..9c8c9a997cb521e48efc7e898d9c10efba3fc41a --- /dev/null +++ b/man/examples/ex_prj_fracture_properties.R @@ -0,0 +1,7 @@ +r2ogs6_fracture_properties( + material_id = 0, + initial_aperture = "aperture0", + specific_storage = "S_f", + biot_coefficient = "biot_f", + permeability_model = list(type = "CubicLaw") +) diff --git a/man/examples/ex_prj_global_process_coupling.R b/man/examples/ex_prj_global_process_coupling.R new file mode 100644 index 0000000000000000000000000000000000000000..9ae65ef077912bae289dab2701e861b178113521 --- /dev/null +++ b/man/examples/ex_prj_global_process_coupling.R @@ -0,0 +1,11 @@ +r2ogs6_global_process_coupling( + max_iter = 100, + convergence_criteria = list( + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "INFINITY_N", + abstol = 1e-08, + reltol = 1e-10 + ) + ) +) diff --git a/man/examples/ex_prj_insitu.R b/man/examples/ex_prj_insitu.R new file mode 100644 index 0000000000000000000000000000000000000000..83ac5fdb0c212572ecf9ca9be5a04d8207eebd5e --- /dev/null +++ b/man/examples/ex_prj_insitu.R @@ -0,0 +1 @@ +r2ogs6_insitu(scripts = c(script = "square_1e1_neumann-insitu.py")) diff --git a/man/examples/ex_prj_jacobian_assembler.R b/man/examples/ex_prj_jacobian_assembler.R new file mode 100644 index 0000000000000000000000000000000000000000..a1b80a22a26d39b08db3031a609e0edc567ce2e4 --- /dev/null +++ b/man/examples/ex_prj_jacobian_assembler.R @@ -0,0 +1,5 @@ +r2ogs6_jacobian_assembler( + type = "CentralDifferences", + component_magnitudes = 1, + relative_epsilons = 1e-08 +) diff --git a/man/examples/ex_prj_kinetic_reactant.R b/man/examples/ex_prj_kinetic_reactant.R new file mode 100644 index 0000000000000000000000000000000000000000..0a8e9cd30103b46e29a4f16350eaa3074069d9bc --- /dev/null +++ b/man/examples/ex_prj_kinetic_reactant.R @@ -0,0 +1,2 @@ +r2ogs6_kinetic_reactant(name = "Productc", + initial_amount = 1e-06) diff --git a/man/examples/ex_prj_linear_solver.R b/man/examples/ex_prj_linear_solver.R new file mode 100644 index 0000000000000000000000000000000000000000..e02ee09c7dbd415b4af72bc6b694248eaf0b54a7 --- /dev/null +++ b/man/examples/ex_prj_linear_solver.R @@ -0,0 +1,10 @@ +r2ogs6_linear_solver( + name = "general_linear_solver", + eigen = r2ogs6_eigen( + solver_type = "BiCGSTAB", + precon_type = "ILUT", + max_iteration_step = 10000, + error_tolerance = 1e-16 + ), + lis = "-i bicgstab -p ilu -tol 1e-16 -maxiter 10000" +) \ No newline at end of file diff --git a/man/examples/ex_prj_local_coordinate_system.R b/man/examples/ex_prj_local_coordinate_system.R new file mode 100644 index 0000000000000000000000000000000000000000..b2bb3f68c87275258d54834c40bafae1bca56116 --- /dev/null +++ b/man/examples/ex_prj_local_coordinate_system.R @@ -0,0 +1,3 @@ +r2ogs6_local_coordinate_system(basis_vector_0 = "e0", + basis_vector_1 = "e1", + basis_vector_2 = "e2") diff --git a/man/examples/ex_prj_material_property.R b/man/examples/ex_prj_material_property.R new file mode 100644 index 0000000000000000000000000000000000000000..744ea511f8df219232bc8c76b6b3b173277a714a --- /dev/null +++ b/man/examples/ex_prj_material_property.R @@ -0,0 +1,42 @@ +r2ogs6_material_property( + fluid = r2ogs6_fluid( + liquid_density = list(type = "Constant", + value = " 1.e3 "), + gas_density = list(type = "IdealGasLaw", + molar_mass = " 0.002 "), + liquid_viscosity = list(type = "Constant", + value = " 3.171e-11 "), + gas_viscosity = list(type = "Constant", + value = " 2.8539e-13 ") + ), + porous_medium = list( + porous_medium = r2ogs6_porous_medium( + id = 0, + permeability = list(permeability_tensor_entries = "kappa1", + type = "Constant"), + porosity = list(type = "Constant", + porosity_parameter = "constant_porosity_parameter"), + storage = list(type = "Constant", + value = " 0.0 "), + capillary_pressure = r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" + ), + relative_permeability = list( + relative_permeability = r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" + ) + ) + ) + ) +) diff --git a/man/examples/ex_prj_medium.R b/man/examples/ex_prj_medium.R new file mode 100644 index 0000000000000000000000000000000000000000..46f3444a3f04b6fe373c823d8d817f53503c7e75 --- /dev/null +++ b/man/examples/ex_prj_medium.R @@ -0,0 +1,25 @@ +r2ogs6_medium( + phases = list( + phase = r2ogs6_phase( + type = "Gas", + properties = list( + property = r2ogs6_ph_property(name = "viscosity", + type = "Constant", + value = 1e-05) + ) + ), + phase = r2ogs6_phase( + type = "Solid", + properties = list( + property = r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) + ) + ) + ), + properties = list( + property = r2ogs6_pr_property(name = "reference_temperature", + type = "Constant", + value = 293.15) + ) +) diff --git a/man/examples/ex_prj_nonlinear_solver.R b/man/examples/ex_prj_nonlinear_solver.R new file mode 100644 index 0000000000000000000000000000000000000000..2e1e62a917b821eeca3675961df20638beaa5058 --- /dev/null +++ b/man/examples/ex_prj_nonlinear_solver.R @@ -0,0 +1,6 @@ +r2ogs6_nonlinear_solver( + name = "basic_newton", + type = "Newton", + max_iter = 50, + linear_solver = "general_linear_solver" +) \ No newline at end of file diff --git a/man/examples/ex_prj_output.R b/man/examples/ex_prj_output.R new file mode 100644 index 0000000000000000000000000000000000000000..ff4d8ec45e33a694708c65de7427e33fff8a9046 --- /dev/null +++ b/man/examples/ex_prj_output.R @@ -0,0 +1,11 @@ +r2ogs6_output( + type = "VTK", + prefix = "flow_free_expansion", + variables = list( + variable = "displacement", + variable = "pressure" + ), + suffix = "_ts_{:timestep}_t_{:time}", + timesteps = list(pair = list(1, + each_steps = 1000)) +) diff --git a/man/examples/ex_prj_parameter.R b/man/examples/ex_prj_parameter.R new file mode 100644 index 0000000000000000000000000000000000000000..52659945e893eec6834869d62647c4f6c1017f8d --- /dev/null +++ b/man/examples/ex_prj_parameter.R @@ -0,0 +1,7 @@ +r2ogs6_parameter(name = "zero", + type = "Constant", + value = 0) + +r2ogs6_parameter(name = "flux_in", + type = "Constant", + value = 1e-04) \ No newline at end of file diff --git a/man/examples/ex_prj_ph_property.R b/man/examples/ex_prj_ph_property.R new file mode 100644 index 0000000000000000000000000000000000000000..a400332ba57e51e55f724470397b3db74f9a1913 --- /dev/null +++ b/man/examples/ex_prj_ph_property.R @@ -0,0 +1,3 @@ +r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) diff --git a/man/examples/ex_prj_phase.R b/man/examples/ex_prj_phase.R new file mode 100644 index 0000000000000000000000000000000000000000..9e5bebbc7a0f66420cc785e5a9f2de486de7fd8c --- /dev/null +++ b/man/examples/ex_prj_phase.R @@ -0,0 +1,8 @@ +r2ogs6_phase( + type = "Solid", + properties = list( + property = r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) + ) +) diff --git a/man/examples/ex_prj_phase_component.R b/man/examples/ex_prj_phase_component.R new file mode 100644 index 0000000000000000000000000000000000000000..6177a8be4a35f0a3e51b7e6cca28fec2b54abafd --- /dev/null +++ b/man/examples/ex_prj_phase_component.R @@ -0,0 +1,5 @@ +r2ogs6_phase_component( + name = "Calcite", + saturation_index = 0, + initial_amount = 0.000207 +) diff --git a/man/examples/ex_prj_phasefield_parameters.R b/man/examples/ex_prj_phasefield_parameters.R new file mode 100644 index 0000000000000000000000000000000000000000..d70227d357aafba77471441397f86ddbfba57a4c --- /dev/null +++ b/man/examples/ex_prj_phasefield_parameters.R @@ -0,0 +1,7 @@ +r2ogs6_phasefield_parameters( + residual_stiffness = "k", + crack_resistance = "gc", + crack_length_scale = "ls", + kinetic_coefficient = "M", + history_field = "H" +) diff --git a/man/examples/ex_prj_pipes.R b/man/examples/ex_prj_pipes.R new file mode 100644 index 0000000000000000000000000000000000000000..ae6fd21d6d98b27dd374edbca09c70de865b604f --- /dev/null +++ b/man/examples/ex_prj_pipes.R @@ -0,0 +1,14 @@ +r2ogs6_pipes( + longitudinal_dispersion_length = 0.001, + inlet = list( + diameter = " 0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + outlet = list( + diameter = "0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + distance_between_pipes = 0.053 +) diff --git a/man/examples/ex_prj_porous_medium.R b/man/examples/ex_prj_porous_medium.R new file mode 100644 index 0000000000000000000000000000000000000000..0adf4d7efb9ab1684085c8fa9bf56cbec5a384a6 --- /dev/null +++ b/man/examples/ex_prj_porous_medium.R @@ -0,0 +1,28 @@ +r2ogs6_porous_medium( + id = 0, + permeability = list(permeability_tensor_entries = "kappa1", + type = "Constant"), + porosity = list(type = "Constant", + porosity_parameter = "constant_porosity_parameter"), + storage = list(type = "Constant", + value = " 0.0 "), + capillary_pressure = r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" + ), + relative_permeability = list( + relative_permeability = r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" + ) + ) +) diff --git a/man/examples/ex_prj_pr_property.R b/man/examples/ex_prj_pr_property.R new file mode 100644 index 0000000000000000000000000000000000000000..341bc10b7b27dff7642dcd930691fd1701525dd3 --- /dev/null +++ b/man/examples/ex_prj_pr_property.R @@ -0,0 +1,3 @@ +r2ogs6_pr_property(name = "reference_temperature", + type = "Constant", + value = 293.15) diff --git a/man/examples/ex_prj_process.R b/man/examples/ex_prj_process.R new file mode 100644 index 0000000000000000000000000000000000000000..c615361d4799583b27a73c34a4934fe901731336 --- /dev/null +++ b/man/examples/ex_prj_process.R @@ -0,0 +1,18 @@ +r2ogs6_process( + name = "HM", + type = "HYDRO_MECHANICS", + integration_order = 3, + process_variables = list(displacement = "displacement", + pressure = "pressure"), + secondary_variables = list( + secondary_variable = c(internal_name = "sigma_xx", output_name = "sigma_xx"), + secondary_variable = c(internal_name = "sigma_yy", output_name = "sigma_yy") + ), + specific_body_force = c(0, 0, 0), + dimension = 3, + constitutive_relation = r2ogs6_constitutive_relation( + type = "LinearElasticIsotropic", + youngs_modulus = "E", + poissons_ratio = "nu" + ) +) diff --git a/man/examples/ex_prj_process_variable.R b/man/examples/ex_prj_process_variable.R new file mode 100644 index 0000000000000000000000000000000000000000..8aecaeab0000ca22092ebee7b3e6f08afb0f7fa0 --- /dev/null +++ b/man/examples/ex_prj_process_variable.R @@ -0,0 +1,15 @@ +r2ogs6_process_variable( + name = "pressure", + components = 1, + order = 1, + initial_condition = "pressure0", + boundary_conditions = list( + boundary_condition = r2ogs6_boundary_condition( + type = "Neumann", + parameter = "flux_in", + geometrical_set = "cube_1x1x1_geometry", + geometry = "left", + component = 0 + ) + ) +) diff --git a/man/examples/ex_prj_rate.R b/man/examples/ex_prj_rate.R new file mode 100644 index 0000000000000000000000000000000000000000..d9d9fcfc79e176891c34fe2e7a635037e2a83087 --- /dev/null +++ b/man/examples/ex_prj_rate.R @@ -0,0 +1,11 @@ +r2ogs6_rate( + kinetic_reactant = "Productc", + expression = list( + statement = "Km = 10", + statement = "U = 1e-3", + statement = + "rate = U * TOT(\"Synthetica\") / (Km + TOT(\"Syntheticb\"))", + statement = "moles = - rate * TIME", + statement = "save moles" + ) +) diff --git a/man/examples/ex_prj_relative_permeability.R b/man/examples/ex_prj_relative_permeability.R new file mode 100644 index 0000000000000000000000000000000000000000..535363602e599523636a53cdc238091ce58b0542 --- /dev/null +++ b/man/examples/ex_prj_relative_permeability.R @@ -0,0 +1,8 @@ +r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" +) diff --git a/man/examples/ex_prj_search_length_algorithm.R b/man/examples/ex_prj_search_length_algorithm.R new file mode 100644 index 0000000000000000000000000000000000000000..971cec498e8d8854028b1bac54d5927c41d921a6 --- /dev/null +++ b/man/examples/ex_prj_search_length_algorithm.R @@ -0,0 +1,2 @@ +r2ogs6_search_length_algorithm(type = "fixed", + value = 1e-06) diff --git a/man/examples/ex_prj_solution.R b/man/examples/ex_prj_solution.R new file mode 100644 index 0000000000000000000000000000000000000000..58076b732f4c74a440eb0e90d991e20b750cc31c --- /dev/null +++ b/man/examples/ex_prj_solution.R @@ -0,0 +1,10 @@ +r2ogs6_solution( + temperature = 25, + pressure = 1, + pe = 4, + components = list( + component = "C(4)", + component = "Ca" + ), + charge_balance = "pH" +) diff --git a/man/examples/ex_prj_source_term.R b/man/examples/ex_prj_source_term.R new file mode 100644 index 0000000000000000000000000000000000000000..3113b8432f818c9499969f23ea4752424be26502 --- /dev/null +++ b/man/examples/ex_prj_source_term.R @@ -0,0 +1,6 @@ +r2ogs6_source_term( + type = "Nodal", + parameter = "sourceterm_heat_transfer_coefficient", + geometrical_set = "geometry", + geometry = "po0" +) diff --git a/man/examples/ex_prj_time_loop.R b/man/examples/ex_prj_time_loop.R new file mode 100644 index 0000000000000000000000000000000000000000..8befb8e732c69fcb18bb37d1c6c1ce005041a563 --- /dev/null +++ b/man/examples/ex_prj_time_loop.R @@ -0,0 +1,32 @@ +r2ogs6_time_loop( + processes = list( + process = r2ogs6_tl_process( + ref = "HM", + nonlinear_solver = "basic_newton", + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "NORM2", + reltol = 1e-08 + ), + time_discretization = list(type = "BackwardEuler"), + time_stepping = r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) + ) + ) + ), + output = r2ogs6_output( + type = "VTK", + prefix = "flow_free_expansion", + variables = list( + variable = "displacement", + variable = "pressure" + ), + suffix = "_ts_{:timestep}_t_{:time}", + timesteps = list(pair = list(1, + each_steps = 1000)) + ) +) diff --git a/man/examples/ex_prj_time_stepping.R b/man/examples/ex_prj_time_stepping.R new file mode 100644 index 0000000000000000000000000000000000000000..5c9a10f5f4275c46a4c95e1538b6e02b769fdae6 --- /dev/null +++ b/man/examples/ex_prj_time_stepping.R @@ -0,0 +1,7 @@ +r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) +) diff --git a/man/examples/ex_prj_tl_process.R b/man/examples/ex_prj_tl_process.R new file mode 100644 index 0000000000000000000000000000000000000000..5a9cf5e7ed8db6c213dc48835178767e384c64e3 --- /dev/null +++ b/man/examples/ex_prj_tl_process.R @@ -0,0 +1,17 @@ +r2ogs6_tl_process( + ref = "HM", + nonlinear_solver = "basic_newton", + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "NORM2", + reltol = 1e-08 + ), + time_discretization = list(type = "BackwardEuler"), + time_stepping = r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) + ) +) diff --git a/man/examples/ex_prj_vtkdiff.R b/man/examples/ex_prj_vtkdiff.R new file mode 100644 index 0000000000000000000000000000000000000000..8029098348a17a6916cacc1cc5c74992a633043c --- /dev/null +++ b/man/examples/ex_prj_vtkdiff.R @@ -0,0 +1,4 @@ +r2ogs6_vtkdiff(field = "displacement", + absolute_tolerance = 1e-15, + relative_tolerance = 0, + regex = "gravity_pcs_0_ts_.*_t_.*.vtu") \ No newline at end of file diff --git a/man/export_prj.Rd b/man/export_prj.Rd index e2f5e24dfbbabe5633547506f522523efe45831b..6aabeb8da266cb9dc9b090a39dbecf7cea647a48 100644 --- a/man/export_prj.Rd +++ b/man/export_prj.Rd @@ -10,6 +10,6 @@ export_prj(ogs6_obj) \item{ogs6_obj}{OGS6: Simulation object} } \description{ -Wrapper function to create a .prj XML document based on the user -input data +Wrapper function to create a \code{.prj} XML document based on +the user input data } diff --git a/man/filter_invalid_xml.Rd b/man/filter_invalid_xml.Rd index ab07c1bba15cf3335cc9519b81b9f0dcf8fcf99a..512b64458afecef2f05bac5407aced522c20ca1c 100644 --- a/man/filter_invalid_xml.Rd +++ b/man/filter_invalid_xml.Rd @@ -11,7 +11,8 @@ filter_invalid_xml(paths, encoding = "ISO-8859-1", print_messages = TRUE) \item{encoding}{string: Optional: XML encoding. Defaults to ISO-8859-1} -\item{print_messages}{flag: Optional: Print error messages? Defaults to TRUE} +\item{print_messages}{flag: Optional: Print error messages? Defaults to +\code{TRUE}} } \value{ character: Vector of invalid XML paths diff --git a/man/generate_R6.Rd b/man/generate_R6.Rd index 7bbb5ab1fc4dcf4493a8929e0fbf7c8fb58859ad..664e8232b49d006d0eaa744d1cabc95340fc9a86 100644 --- a/man/generate_R6.Rd +++ b/man/generate_R6.Rd @@ -7,7 +7,7 @@ generate_R6(params, prefix = "", print_result = TRUE) } \arguments{ -\item{params}{list: (Return value of analyse_xml())} +\item{params}{list: (Return value of \code{analyse_xml()})} \item{prefix}{Optional: For subclasses whose represented elements have the same tag name as an element for which a class was already specified, diff --git a/man/generate_add_method.Rd b/man/generate_add_method.Rd index ab1868717f88951b7393a7ec926fbf7ce64438f6..9957c8e1f195b87069276ba371ed5c60eb5eb903 100644 --- a/man/generate_add_method.Rd +++ b/man/generate_add_method.Rd @@ -14,6 +14,6 @@ object} represented by the class object} } \description{ -Helper function to generate an R6 add_* method for a +Helper function to generate an R6 \code{add_*} method for a r2ogs6 class object } diff --git a/man/generate_all_benchmark_scripts.Rd b/man/generate_all_benchmark_scripts.Rd index eebd7e23f3f0e1a626de9f0f3d94580c42222c2f..3832caf0aadc4f3b15b19e5db9e067e3709fe7e0 100644 --- a/man/generate_all_benchmark_scripts.Rd +++ b/man/generate_all_benchmark_scripts.Rd @@ -21,17 +21,17 @@ generate_all_benchmark_scripts( \item{scripts_path}{string: Path where benchmark scripts will be saved} -\item{read_in_gmls}{flag: Optional: Should .gml files just be copied or read -in too?} +\item{read_in_gmls}{flag: Optional: Should \code{.gml} files just be copied +or read in too?} -\item{read_in_vtus}{flag: Optional: Should .vtu files just be copied or read -in too?} +\item{read_in_vtus}{flag: Optional: Should \code{.vtu} files just be copied +or read in too?} \item{starting_from_prj_path}{string: Optional:} -\item{skip_prj_paths}{character: Optional: .prj paths to skip} +\item{skip_prj_paths}{character: Optional: \code{.prj} paths to skip} } \description{ -Wrapper function to generate benchmark scripts from all .prj -files in a directory +Wrapper function to generate benchmark scripts from all +\code{.prj} files in a directory } diff --git a/man/generate_benchmark_script.Rd b/man/generate_benchmark_script.Rd index cdd5d1da7a9dae69389a23e3471d8d8c903ca81b..0df3411c426c51addcc24b22e71635b85754cd78 100644 --- a/man/generate_benchmark_script.Rd +++ b/man/generate_benchmark_script.Rd @@ -14,7 +14,7 @@ generate_benchmark_script( ) } \arguments{ -\item{prj_path}{string: .prj file the script will be based on} +\item{prj_path}{string: \code{.prj} file the script will be based on} \item{sim_path}{string: Path where all simulation files will be saved} @@ -22,12 +22,12 @@ generate_benchmark_script( \item{script_path}{string: Path where benchmark script will be saved} -\item{read_in_gml}{flag: Optional: Should .gml file just be copied or read -in too?} +\item{read_in_gml}{flag: Optional: Should \code{.gml} file just be copied or +read in too?} -\item{read_in_vtu}{flag: Optional: Should .vtu file(s) just be copied or read -in too?} +\item{read_in_vtu}{flag: Optional: Should \code{.vtu} file(s) just be copied +or read in too?} } \description{ -Generates a benchmark script from an existing .prj file. +Generates a benchmark script from an existing \code{.prj} file. } diff --git a/man/generate_constructor.Rd b/man/generate_constructor.Rd index 91b0b083442e2fa6b1740a84b4b52a144f23d108..e4709eba899f055184af40317b1ec6da1cb6a239 100644 --- a/man/generate_constructor.Rd +++ b/man/generate_constructor.Rd @@ -7,7 +7,7 @@ generate_constructor(params, prefix = "", print_result = FALSE) } \arguments{ -\item{params}{list: (Return value of analyse_xml())} +\item{params}{list: (Return value of \code{analyse_xml()})} \item{prefix}{Optional: For subclasses whose represented elements have the same tag name as an element for which a class was already specified, diff --git a/man/generate_helper.Rd b/man/generate_helper.Rd index 8775ffe9b1a978a9ec2204f07a298bb686973654..92a6b422c229e57ef453cb2d24e5a2af0bc9c021 100644 --- a/man/generate_helper.Rd +++ b/man/generate_helper.Rd @@ -7,7 +7,7 @@ generate_helper(params, prefix = "", print_result = FALSE) } \arguments{ -\item{params}{list: (Return value of analyse_xml())} +\item{params}{list: (Return value of \code{analyse_xml()})} \item{prefix}{Optional: For subclasses whose represented elements have the same tag name as an element for which a class was already specified, diff --git a/man/get_class_from_xpath.Rd b/man/get_class_from_xpath.Rd index 94377ed30b0ef91edd087c8a6050271cabf898ea..c064a55df381e43d94dfa61ae370864a402ee5d8 100644 --- a/man/get_class_from_xpath.Rd +++ b/man/get_class_from_xpath.Rd @@ -15,3 +15,6 @@ string: The class name. \description{ Gets r2ogs6 class name from an xpath-like expression } +\examples{ + get_class_from_xpath("processes/process") +} diff --git a/man/get_tag_from_class.Rd b/man/get_tag_from_class.Rd index 04e0ba72925eeed1eed06682d7bf0aeb1667c7ee..6e4c93d72a23a62161434ef1dabf58b533d94ac9 100644 --- a/man/get_tag_from_class.Rd +++ b/man/get_tag_from_class.Rd @@ -10,8 +10,11 @@ get_tag_from_class(class_name) \item{class_name}{string: The name of a r2ogs6 class} } \value{ -string: The tag name corresponding to `class_name` +string: The tag name corresponding to \code{class_name} } \description{ Utility function, returns the tag name of a r2ogs6 class } +\examples{ + get_tag_from_class("r2ogs6_process") +} diff --git a/man/get_tag_from_xpath.Rd b/man/get_tag_from_xpath.Rd index bac95f3a7e7ae2a8e5195894115753a6d43172da..116a8885697ac7bc9b364533db0bcb78dd084689 100644 --- a/man/get_tag_from_xpath.Rd +++ b/man/get_tag_from_xpath.Rd @@ -10,8 +10,11 @@ get_tag_from_xpath(xpath) \item{xpath}{string: An xpath expression. Works for path-like xpaths only} } \value{ -string: The XML tag name. +string: The XML tag name } \description{ Gets the XML tag name from an xpath expression } +\examples{ + get_tag_from_xpath("processes/process") +} diff --git a/man/is_null_or_coerce_names.Rd b/man/is_null_or_coerce_names.Rd index 641c6e5f7119b9630ae3c4ecd6cd279c2da150b3..8b49faf8895e77f2e6031c5d7cf53258855635da 100644 --- a/man/is_null_or_coerce_names.Rd +++ b/man/is_null_or_coerce_names.Rd @@ -12,5 +12,5 @@ is_null_or_coerce_names(obj, names) \item{names}{How the list elements will be named as per default} } \description{ -Validator function for a parameter list or vector or NULL +Validator function for a parameter list or vector or \code{NULL} } diff --git a/man/is_null_or_has_class.Rd b/man/is_null_or_has_class.Rd index d0de551bdb4c1ecd3ab85f4780b8da52f49913e0..42fc9c114e745f265697bc2fb8c7b1a3e840ca14 100644 --- a/man/is_null_or_has_class.Rd +++ b/man/is_null_or_has_class.Rd @@ -12,6 +12,6 @@ is_null_or_has_class(obj, class_name) \item{class_name}{The name of the expected class} } \description{ -Checks if an object is either null or a class object of class -'class_name' +Checks if an object is either \code{NULL} or a class object of +class \code{class_name} } diff --git a/man/is_null_or_wrapper_list.Rd b/man/is_null_or_wrapper_list.Rd index a8e3f9bdf12304f1da20a632ec22a20f1e33d479..9c76eddf56a80ed99c153bea7b16c6cbfc9fef22 100644 --- a/man/is_null_or_wrapper_list.Rd +++ b/man/is_null_or_wrapper_list.Rd @@ -9,9 +9,9 @@ is_null_or_wrapper_list(obj, element_class) \arguments{ \item{obj}{list | NULL: Object to check} -\item{element_class}{string: Class each element of `obj` should have} +\item{element_class}{string: Class each element of \code{obj} should have} } \description{ -Checks if an object is either NULL or a list of elements -of class `element_class` +Checks if an object is either \code{NULL} or a list of elements +of class \code{element_class} } diff --git a/man/is_wrapper_list.Rd b/man/is_wrapper_list.Rd index 5dbacdfed1884fadbe10560f77dd76c8591e0e6a..379ef3e83f77996962b0295484e523e1b3222391 100644 --- a/man/is_wrapper_list.Rd +++ b/man/is_wrapper_list.Rd @@ -9,9 +9,9 @@ is_wrapper_list(list, element_class) \arguments{ \item{list}{list: List to check} -\item{element_class}{string: Class each element of `list` should have} +\item{element_class}{string: Class each element of \code{list} should have} } \description{ Checks if a list consists only of elements of class -`element_class` +\code{element_class} } diff --git a/man/node_to_object.Rd b/man/node_to_object.Rd index fc6da47d8bdb5b47c5ec4135e23661d7dd5e77dd..141f78e8077e4fff783d600999cf0f7f8e03c63f 100644 --- a/man/node_to_object.Rd +++ b/man/node_to_object.Rd @@ -16,10 +16,6 @@ Returns representation of an XML node. This is a recursive function. ASSUMPTIONS: 1) Leaf nodes will never be r2ogs6_* objects -2) If there are multiple occurrences of r2ogs6_* class (and subclass) -elements on the same level, they have a wrapper node as their parent -(e.g. <processes>, <properties>) which will contain ONLY elements of this -type -3) Wrapper nodes are represented as lists -4) Parent nodes whose children have no children are represented as lists +2) Wrapper nodes are represented as lists +3) Parent nodes whose children have no children are represented as lists } diff --git a/man/ogs_call_ogs6.Rd b/man/ogs_call_ogs6.Rd index 931bceca1a1d4c46a9fb63ad62cd122e641ef939..ceff868bc2f2779fa2b833bbd9d6032efb489f4a 100644 --- a/man/ogs_call_ogs6.Rd +++ b/man/ogs_call_ogs6.Rd @@ -9,12 +9,12 @@ ogs_call_ogs6(ogs6_obj, write_logfile = TRUE, ogs_bin_path, verbose = F) \arguments{ \item{ogs6_obj}{OGS6: Simulation object} -\item{write_logfile}{flag: Should output be written to a logfile? If `FALSE`, -output will be written to console. If `TRUE`, logfile directory will be -created in `ogs6$sim_path` directory} +\item{write_logfile}{flag: Should output be written to a logfile? If +\code{FALSE}, output will be written to console. If \code{TRUE}, logfile +directory will be created in \code{ogs6$sim_path} directory} \item{ogs_bin_path}{string: Optional: OpenGeoSys 6 bin folder path. Defaults -to `options("r2ogs6.default_ogs_bin_path")`} +to \code{options("r2ogs6.default_ogs_bin_path")}} \item{verbose}{flag} } diff --git a/man/ogs_export_sim_files.Rd b/man/ogs_export_sim_files.Rd index bdc0eb89a5ea5bec4b87726da11993d7e76ff6c7..6ec05b68c17fa0e45bc5faa68e1afad438dac6bf 100644 --- a/man/ogs_export_sim_files.Rd +++ b/man/ogs_export_sim_files.Rd @@ -9,10 +9,10 @@ ogs_export_sim_files(ogs6_obj, test_mode = FALSE) \arguments{ \item{ogs6_obj}{OGS6: Simulation object} -\item{test_mode}{flag: If `TRUE`, Will not check status of `ogs6_obj` before -exporting files. Defaults to `FALSE`} +\item{test_mode}{flag: If \code{TRUE}, Will not check status of +\code{ogs6_obj} before exporting files. Defaults to \code{FALSE}} } \description{ -Creates `ogs6_obj$sim_path` directory if it does not exist yet +Creates \code{ogs6$sim_path} directory if it does not exist yet and exports and / or copies all simulation files to it. } diff --git a/man/ogs_read_output_files.Rd b/man/ogs_read_output_files.Rd index 151d4ab30f072fb54ff04fbf8f43d0bc61457069..75216493fa3bc9614fd5a7c9a4f2827afab1d5bb 100644 --- a/man/ogs_read_output_files.Rd +++ b/man/ogs_read_output_files.Rd @@ -10,5 +10,5 @@ ogs_read_output_files(ogs6_obj) \item{ogs6_obj}{OGS6: Simulation object} } \description{ -Read in generated .pvd files and add it to ogs6_obj +Read in generated \code{.pvd} files and add it to ogs6_obj } diff --git a/man/ogs_run_simulation.Rd b/man/ogs_run_simulation.Rd index 1070ff5e363a5a6753311c3cde10a527e93ab94f..0cb1b045cbf57d59d49330b98b988617a2ccab13 100644 --- a/man/ogs_run_simulation.Rd +++ b/man/ogs_run_simulation.Rd @@ -9,16 +9,16 @@ ogs_run_simulation(ogs6_obj, write_logfile = TRUE, ogs_bin_path, verbose = F) \arguments{ \item{ogs6_obj}{OGS6: Simulation object} -\item{write_logfile}{flag: Should output be written to a logfile? If `FALSE`, -output will be written to console. If `TRUE`, logfile directory will be -created in `ogs6$sim_path` directory} +\item{write_logfile}{flag: Should output be written to a logfile? If +\code{FALSE}, output will be written to console. If \code{TRUE}, logfile +directory will be created in \code{ogs6$sim_path} directory} \item{ogs_bin_path}{string: Optional: OpenGeoSys 6 bin folder path. Defaults -to `options("r2ogs6.default_ogs_bin_path")`} +to \code{options("r2ogs6.default_ogs_bin_path")}} \item{verbose}{flag} } \description{ -Wrapper function that calls `ogs_export_sim_files`, -`ogs_call_ogs6` and `ogs_read_output_files`. +Wrapper function that calls \code{ogs_export_sim_files()}, +\code{ogs_call_ogs6()} and \code{ogs_read_output_files()}. } diff --git a/man/prj_top_level_classes.Rd b/man/prj_top_level_classes.Rd index 8906060f6e5a3687b8649b21f6400c6d404094e2..e9e47962ceb633962bf1c1dd41f6b4f501965b2e 100644 --- a/man/prj_top_level_classes.Rd +++ b/man/prj_top_level_classes.Rd @@ -10,6 +10,7 @@ prj_top_level_classes() character } \description{ -Returns named character vector of `OGS6` top level .prj tags -(names) represented by r2ogs6 classes along with their class names (values). +Returns named character vector of \code{OGS6} top level +\code{.prj} tags (names) represented by \code{r2ogs6} classes along with their +class names (values). } diff --git a/man/r2ogs6_borehole_heat_exchanger.Rd b/man/r2ogs6_borehole_heat_exchanger.Rd index e99ad45f73d0072dddcf3569cbd565a0293efa04..a24919a58edde00b2df99af11cb1942a0f8360c4 100644 --- a/man/r2ogs6_borehole_heat_exchanger.Rd +++ b/man/r2ogs6_borehole_heat_exchanger.Rd @@ -32,3 +32,42 @@ r2ogs6_borehole_heat_exchanger( \description{ tag: borehole_heat_exchanger } +\examples{ +r2ogs6_borehole_heat_exchanger( + type = "1U", + flow_and_temperature_control = r2ogs6_flow_and_temperature_control( + type = "TemperatureCurveConstantFlow", + flow_rate = 2e-04, + temperature_curve = "inflow_temperature" + ), + borehole = list(length = "18.0", + diameter = "0.13"), + grout = list( + density = "2190.0", + porosity = "0.0", + heat_capacity = "1735.160", + thermal_conductivity = "0.806" + ), + pipes = r2ogs6_pipes( + longitudinal_dispersion_length = 0.001, + inlet = list( + diameter = " 0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + outlet = list( + diameter = "0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + distance_between_pipes = 0.053 + ), + refrigerant = list( + density = "992.92", + viscosity = "0.00067418", + specific_heat_capacity = "4068", + thermal_conductivity = "0.62863", + reference_temperature = "298.15" + ) +) +} diff --git a/man/r2ogs6_boundary_condition.Rd b/man/r2ogs6_boundary_condition.Rd index bf52d28d98476af984e61ac6b8e44616e3261685..16b90a1a91736cabdeec78e77ba4692fba7adc70 100644 --- a/man/r2ogs6_boundary_condition.Rd +++ b/man/r2ogs6_boundary_condition.Rd @@ -83,3 +83,12 @@ r2ogs6_boundary_condition( \description{ tag: boundary_condition } +\examples{ +r2ogs6_boundary_condition( + type = "Neumann", + parameter = "flux_in", + geometrical_set = "cube_1x1x1_geometry", + geometry = "left", + component = 0 +) +} diff --git a/man/r2ogs6_capillary_pressure.Rd b/man/r2ogs6_capillary_pressure.Rd index b3db5d7ac5451aff36dd047113c26370825f4ab6..e8d53cbb4334322ee5bf17182147f6abf3492bfd 100644 --- a/man/r2ogs6_capillary_pressure.Rd +++ b/man/r2ogs6_capillary_pressure.Rd @@ -35,3 +35,14 @@ r2ogs6_capillary_pressure( \description{ tag: capillary_pressure } +\examples{ +r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" +) +} diff --git a/man/r2ogs6_chemical_system.Rd b/man/r2ogs6_chemical_system.Rd index c1b1f207e4a70b0d072065489d58411791655e72..65a0a5836379445fa3120e7fd8ca383c351438d7 100644 --- a/man/r2ogs6_chemical_system.Rd +++ b/man/r2ogs6_chemical_system.Rd @@ -41,3 +41,34 @@ r2ogs6_chemical_system( \description{ tag: chemical_system } +\examples{ +r2ogs6_chemical_system( + chemical_solver = "Phreeqc", + database = "PSINA_12_07_110615_DAV_s.dat", + solution = r2ogs6_solution( + temperature = 25, + pressure = 1, + pe = 4, + components = list( + component = "C(4)", + component = "Ca" + ), + charge_balance = "pH" + ), + mesh = "calcite_ReactiveDomain", + knobs = list( + max_iter = "100", + relative_convergence_tolerance = "1e-12", + tolerance = "1e-15", + step_size = "100", + scaling = "0" + ), + equilibrium_reactants = list( + phase_component = r2ogs6_phase_component( + name = "Calcite", + saturation_index = 0, + initial_amount = 0.000207 + ) + ) +) +} diff --git a/man/r2ogs6_com_property.Rd b/man/r2ogs6_com_property.Rd index 541e266d50456232437008766e8251cfab8f4224..b5b8bb2acb80ecd9e58b0ef56b02fe7507f105d0 100644 --- a/man/r2ogs6_com_property.Rd +++ b/man/r2ogs6_com_property.Rd @@ -18,3 +18,8 @@ r2ogs6_com_property(name, type, value = NULL, parameter_name = NULL) \description{ tag: property } +\examples{ +r2ogs6_com_property(name = "molecular_diffusion", + type = "Constant", + value = 2e-09) +} diff --git a/man/r2ogs6_component.Rd b/man/r2ogs6_component.Rd index 41ab4aa3886c5ee4814e16c6c23f60c18edde325..208d019f18ae0b30221c79648fbb559d8a24de68 100644 --- a/man/r2ogs6_component.Rd +++ b/man/r2ogs6_component.Rd @@ -14,3 +14,13 @@ r2ogs6_component(name, properties) \description{ tag: component } +\examples{ +r2ogs6_component( + name = "concentration", + properties = list( + property = r2ogs6_com_property(name = "molecular_diffusion", + type = "Constant", + value = 2e-09) + ) +) +} diff --git a/man/r2ogs6_constitutive_relation.Rd b/man/r2ogs6_constitutive_relation.Rd index 3c04d628ee562352cfd82f2ad9f27cd2fc95c6df..3b52baf17a339bbf9159cfeee5fa268cefb8777d 100644 --- a/man/r2ogs6_constitutive_relation.Rd +++ b/man/r2ogs6_constitutive_relation.Rd @@ -131,3 +131,10 @@ r2ogs6_constitutive_relation( \description{ tag: constitutive_relation } +\examples{ +r2ogs6_constitutive_relation( + type = "LinearElasticIsotropic", + youngs_modulus = "E", + poissons_ratio = "nu" +) +} diff --git a/man/r2ogs6_convergence_criterion.Rd b/man/r2ogs6_convergence_criterion.Rd index cf8c9c4442bc8d9af5fae7ebdbdfd2603455e294..73c28e416d5d4a2ebaf39650e08d1132f595b000 100644 --- a/man/r2ogs6_convergence_criterion.Rd +++ b/man/r2ogs6_convergence_criterion.Rd @@ -29,3 +29,11 @@ r2ogs6_convergence_criterion( \description{ tag: convergence_criterion } +\examples{ +r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "INFINITY_N", + abstol = 1e-08, + reltol = 1e-10 +) +} diff --git a/man/r2ogs6_curve.Rd b/man/r2ogs6_curve.Rd index 88aeb1629f7e9290e8351ccb745819dbd98426a6..043c1fc9a9886172cf09363ee33230c68d188309 100644 --- a/man/r2ogs6_curve.Rd +++ b/man/r2ogs6_curve.Rd @@ -17,3 +17,8 @@ are given} \description{ tag: curve, a curve } +\examples{ +r2ogs6_curve(name = "Dirichlet_temporal", + coords = "0 3", + values = "200 200") +} diff --git a/man/r2ogs6_deactivated_subdomain.Rd b/man/r2ogs6_deactivated_subdomain.Rd index b6c0efb483edd588abe52e7c62f121cc59e8d215..a48e1c191d3235f4935ab7c8419992c5e160cba3 100644 --- a/man/r2ogs6_deactivated_subdomain.Rd +++ b/man/r2ogs6_deactivated_subdomain.Rd @@ -14,3 +14,8 @@ r2ogs6_deactivated_subdomain(time_interval, material_ids) \description{ tag: deactivated_subdomain } +\examples{ +r2ogs6_deactivated_subdomain(time_interval = list(start = "0", + end = "1"), + material_ids = 1) +} diff --git a/man/r2ogs6_eigen.Rd b/man/r2ogs6_eigen.Rd index 90380224d58be177508435459fca030603fd2df0..6d58152d09b91158c4f5542fbb37bf4a97824756 100644 --- a/man/r2ogs6_eigen.Rd +++ b/man/r2ogs6_eigen.Rd @@ -29,3 +29,11 @@ r2ogs6_eigen( \description{ tag: eigen } +\examples{ +r2ogs6_eigen( + solver_type = "BiCGSTAB", + precon_type = "ILUT", + max_iteration_step = 10000, + error_tolerance = 1e-16 +) +} diff --git a/man/r2ogs6_flow_and_temperature_control.Rd b/man/r2ogs6_flow_and_temperature_control.Rd index 0bf6abb1e8d1ebab7fb7ebded815b581b2b38209..bca6a61454533051b1cf48eafd0573324e31ef7e 100644 --- a/man/r2ogs6_flow_and_temperature_control.Rd +++ b/man/r2ogs6_flow_and_temperature_control.Rd @@ -29,3 +29,10 @@ r2ogs6_flow_and_temperature_control( \description{ tag: flow_and_temperature_control } +\examples{ +r2ogs6_flow_and_temperature_control( + type = "TemperatureCurveConstantFlow", + flow_rate = 2e-04, + temperature_curve = "inflow_temperature" +) +} diff --git a/man/r2ogs6_fluid.Rd b/man/r2ogs6_fluid.Rd index beb2f7c53da00d6cb0bad1e427fa9da69f3e0337..154918d538a90f5aca4cb6c336f17be8501b0fbe 100644 --- a/man/r2ogs6_fluid.Rd +++ b/man/r2ogs6_fluid.Rd @@ -41,3 +41,15 @@ r2ogs6_fluid( \description{ tag: fluid } +\examples{ +r2ogs6_fluid( + liquid_density = list(type = "Constant", + value = " 1.e3 "), + gas_density = list(type = "IdealGasLaw", + molar_mass = " 0.002 "), + liquid_viscosity = list(type = "Constant", + value = " 3.171e-11 "), + gas_viscosity = list(type = "Constant", + value = " 2.8539e-13 ") +) +} diff --git a/man/r2ogs6_fracture_model.Rd b/man/r2ogs6_fracture_model.Rd index 8c8e4cc166447a0ddcf7999a7eb8444b61fd20e5..020b30842a44bdccb341cb4ce982f82884be8ef5 100644 --- a/man/r2ogs6_fracture_model.Rd +++ b/man/r2ogs6_fracture_model.Rd @@ -44,3 +44,10 @@ r2ogs6_fracture_model( \description{ tag: fracture_model } +\examples{ +r2ogs6_fracture_model(type = "LinearElasticIsotropic", + normal_stiffness = "Kn", + shear_stiffness = "Ks", + penalty_aperture_cutoff = 1e-05, + tension_cutoff = 1) +} diff --git a/man/r2ogs6_fracture_properties.Rd b/man/r2ogs6_fracture_properties.Rd index 8f737b9cd0b7bb0442bc52cffc1a400878c72ead..913b822eed8895ebf39154de2b3cfe65a5dda4ee 100644 --- a/man/r2ogs6_fracture_properties.Rd +++ b/man/r2ogs6_fracture_properties.Rd @@ -26,3 +26,12 @@ r2ogs6_fracture_properties( \description{ tag: fracture_properties } +\examples{ +r2ogs6_fracture_properties( + material_id = 0, + initial_aperture = "aperture0", + specific_storage = "S_f", + biot_coefficient = "biot_f", + permeability_model = list(type = "CubicLaw") +) +} diff --git a/man/r2ogs6_global_process_coupling.Rd b/man/r2ogs6_global_process_coupling.Rd index 44e2d961bbc28c4b90b4d6797006c754a9455e4e..aa4343cc924bb0923cb89fed6a64c3c3f38810ca 100644 --- a/man/r2ogs6_global_process_coupling.Rd +++ b/man/r2ogs6_global_process_coupling.Rd @@ -15,3 +15,16 @@ Convergence criteria} \description{ tag: global_process_coupling } +\examples{ +r2ogs6_global_process_coupling( + max_iter = 100, + convergence_criteria = list( + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "INFINITY_N", + abstol = 1e-08, + reltol = 1e-10 + ) + ) +) +} diff --git a/man/r2ogs6_insitu.Rd b/man/r2ogs6_insitu.Rd index f8a5a50618544ed6231fd2fdaf53084d5548066e..37e60376713f4d902c0ad1e3f2925de58f974eae 100644 --- a/man/r2ogs6_insitu.Rd +++ b/man/r2ogs6_insitu.Rd @@ -12,3 +12,6 @@ r2ogs6_insitu(scripts) \description{ tag: insitu } +\examples{ +r2ogs6_insitu(scripts = c(script = "square_1e1_neumann-insitu.py")) +} diff --git a/man/r2ogs6_jacobian_assembler.Rd b/man/r2ogs6_jacobian_assembler.Rd index 9d8b15bdec521edee1095fde9d4fec52106de0c4..5c582422215e5dffe844b77a0d576e62a5bf212e 100644 --- a/man/r2ogs6_jacobian_assembler.Rd +++ b/man/r2ogs6_jacobian_assembler.Rd @@ -20,3 +20,10 @@ r2ogs6_jacobian_assembler( \description{ tag: jacobian_assembler } +\examples{ +r2ogs6_jacobian_assembler( + type = "CentralDifferences", + component_magnitudes = 1, + relative_epsilons = 1e-08 +) +} diff --git a/man/r2ogs6_kinetic_reactant.Rd b/man/r2ogs6_kinetic_reactant.Rd index e41d39b5dcdecd0198783592e67f43726da5aa53..522694029905a4add88955c19de785ec5cf89d20 100644 --- a/man/r2ogs6_kinetic_reactant.Rd +++ b/man/r2ogs6_kinetic_reactant.Rd @@ -23,3 +23,7 @@ r2ogs6_kinetic_reactant( \description{ S3 class describing .prj kinetic_reactant } +\examples{ +r2ogs6_kinetic_reactant(name = "Productc", + initial_amount = 1e-06) +} diff --git a/man/r2ogs6_linear_solver.Rd b/man/r2ogs6_linear_solver.Rd index 0b0182f40c682c8e2699c7d9addb8d1a5f21d15f..f1695c2a452f111014bfc852a270b53ebbc2cdd1 100644 --- a/man/r2ogs6_linear_solver.Rd +++ b/man/r2ogs6_linear_solver.Rd @@ -18,3 +18,15 @@ r2ogs6_linear_solver(name, eigen = NULL, lis = NULL, petsc = NULL) \description{ tag: linear_solver } +\examples{ +r2ogs6_linear_solver( + name = "general_linear_solver", + eigen = r2ogs6_eigen( + solver_type = "BiCGSTAB", + precon_type = "ILUT", + max_iteration_step = 10000, + error_tolerance = 1e-16 + ), + lis = "-i bicgstab -p ilu -tol 1e-16 -maxiter 10000" +) +} diff --git a/man/r2ogs6_local_coordinate_system.Rd b/man/r2ogs6_local_coordinate_system.Rd index 2e5ca5b3170ba8cd251a12a53fc2c143bf0d742d..11609bb6e2512fcac0cc3d5ed0f8cac1a4d320ac 100644 --- a/man/r2ogs6_local_coordinate_system.Rd +++ b/man/r2ogs6_local_coordinate_system.Rd @@ -20,3 +20,8 @@ r2ogs6_local_coordinate_system( \description{ tag: local_coordinate_system } +\examples{ +r2ogs6_local_coordinate_system(basis_vector_0 = "e0", + basis_vector_1 = "e1", + basis_vector_2 = "e2") +} diff --git a/man/r2ogs6_material_property.Rd b/man/r2ogs6_material_property.Rd index 448f556fd5065165c3c899f2844447d95fec7984..880c17d2dfc26402c8cf2d640ed145ab3b42a604 100644 --- a/man/r2ogs6_material_property.Rd +++ b/man/r2ogs6_material_property.Rd @@ -14,3 +14,47 @@ r2ogs6_material_property(fluid, porous_medium) \description{ tag: material_property } +\examples{ +r2ogs6_material_property( + fluid = r2ogs6_fluid( + liquid_density = list(type = "Constant", + value = " 1.e3 "), + gas_density = list(type = "IdealGasLaw", + molar_mass = " 0.002 "), + liquid_viscosity = list(type = "Constant", + value = " 3.171e-11 "), + gas_viscosity = list(type = "Constant", + value = " 2.8539e-13 ") + ), + porous_medium = list( + porous_medium = r2ogs6_porous_medium( + id = 0, + permeability = list(permeability_tensor_entries = "kappa1", + type = "Constant"), + porosity = list(type = "Constant", + porosity_parameter = "constant_porosity_parameter"), + storage = list(type = "Constant", + value = " 0.0 "), + capillary_pressure = r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" + ), + relative_permeability = list( + relative_permeability = r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" + ) + ) + ) + ) +) +} diff --git a/man/r2ogs6_medium.Rd b/man/r2ogs6_medium.Rd index a4431cf95440c5a39082a97e37f769b874dd4c22..84917d079f811457a85ea1ac1f53b5700b95ee81 100644 --- a/man/r2ogs6_medium.Rd +++ b/man/r2ogs6_medium.Rd @@ -15,5 +15,32 @@ r2ogs6_medium(phases = NULL, properties = NULL, id = NULL) } \description{ tag: medium, a specific medium with optional id corresponding -to the MaterialIDs + to the MaterialIDs +} +\examples{ +r2ogs6_medium( + phases = list( + phase = r2ogs6_phase( + type = "Gas", + properties = list( + property = r2ogs6_ph_property(name = "viscosity", + type = "Constant", + value = 1e-05) + ) + ), + phase = r2ogs6_phase( + type = "Solid", + properties = list( + property = r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) + ) + ) + ), + properties = list( + property = r2ogs6_pr_property(name = "reference_temperature", + type = "Constant", + value = 293.15) + ) +) } diff --git a/man/r2ogs6_nonlinear_solver.Rd b/man/r2ogs6_nonlinear_solver.Rd index 862972c15c2e1d878384a622a7c1cb22ee06e08b..e127818f2398ee76d06eb0cd27849c21947f53ff 100644 --- a/man/r2ogs6_nonlinear_solver.Rd +++ b/man/r2ogs6_nonlinear_solver.Rd @@ -20,3 +20,11 @@ r2ogs6_nonlinear_solver(name, type, max_iter, linear_solver, damping = NULL) \description{ tag: nonlinear_solver } +\examples{ +r2ogs6_nonlinear_solver( + name = "basic_newton", + type = "Newton", + max_iter = 50, + linear_solver = "general_linear_solver" +) +} diff --git a/man/r2ogs6_output.Rd b/man/r2ogs6_output.Rd index 78e5f50ac0d998cd516d2770b1c2175371e24871..e9e5cced99053680d90c950412bb1f08a25255ec 100644 --- a/man/r2ogs6_output.Rd +++ b/man/r2ogs6_output.Rd @@ -42,3 +42,16 @@ Either "true" or "false"} \description{ tag: output } +\examples{ +r2ogs6_output( + type = "VTK", + prefix = "flow_free_expansion", + variables = list( + variable = "displacement", + variable = "pressure" + ), + suffix = "_ts_{:timestep}_t_{:time}", + timesteps = list(pair = list(1, + each_steps = 1000)) +) +} diff --git a/man/r2ogs6_parameter.Rd b/man/r2ogs6_parameter.Rd index 2b33b1bafe1f5ec0b14eca3f3ba56bbbc5b4b2e7..a7d96c6a078fe8542da2d6de2f3ecf602939ea96 100644 --- a/man/r2ogs6_parameter.Rd +++ b/man/r2ogs6_parameter.Rd @@ -48,3 +48,12 @@ multiple)} \description{ tag: parameter } +\examples{ +r2ogs6_parameter(name = "zero", + type = "Constant", + value = 0) + +r2ogs6_parameter(name = "flux_in", + type = "Constant", + value = 1e-04) +} diff --git a/man/r2ogs6_ph_property.Rd b/man/r2ogs6_ph_property.Rd index afe8dc0924a6bfac7da23c75553a93cbc13fe7e6..f334fff1c0280166f6370b00ec77a129ee0c17ce 100644 --- a/man/r2ogs6_ph_property.Rd +++ b/man/r2ogs6_ph_property.Rd @@ -59,3 +59,8 @@ r2ogs6_ph_property( \description{ tag: property } +\examples{ +r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) +} diff --git a/man/r2ogs6_phase.Rd b/man/r2ogs6_phase.Rd index af754f8466ad5a54c5dd582b4dca491af49e4672..304d45c5bf0b2d0fd75786b304d260c4f9c3ace5 100644 --- a/man/r2ogs6_phase.Rd +++ b/man/r2ogs6_phase.Rd @@ -17,3 +17,13 @@ r2ogs6_phase(type, properties = NULL, components = NULL) \description{ tag: phase, a coherent material with homogeneous properties } +\examples{ +r2ogs6_phase( + type = "Solid", + properties = list( + property = r2ogs6_ph_property(name = "porosity", + type = "Constant", + value = 0.3) + ) +) +} diff --git a/man/r2ogs6_phase_component.Rd b/man/r2ogs6_phase_component.Rd index bbb3570617365f2ba0e19d6374c8421db3283c52..2ae1eb33fabf01ac5bf4e42496ef550896833d47 100644 --- a/man/r2ogs6_phase_component.Rd +++ b/man/r2ogs6_phase_component.Rd @@ -16,3 +16,10 @@ r2ogs6_phase_component(name, saturation_index, initial_amount = NULL) \description{ S3 class describing .prj phase_component } +\examples{ +r2ogs6_phase_component( + name = "Calcite", + saturation_index = 0, + initial_amount = 0.000207 +) +} diff --git a/man/r2ogs6_phasefield_parameters.Rd b/man/r2ogs6_phasefield_parameters.Rd index eca7f7903cbf00c512532c1dd18dcacbcf01cc58..2b8fae79d6c74880e3e353c5aaa530bffbe10ec4 100644 --- a/man/r2ogs6_phasefield_parameters.Rd +++ b/man/r2ogs6_phasefield_parameters.Rd @@ -26,3 +26,12 @@ r2ogs6_phasefield_parameters( \description{ tag: phasefield_parameters } +\examples{ +r2ogs6_phasefield_parameters( + residual_stiffness = "k", + crack_resistance = "gc", + crack_length_scale = "ls", + kinetic_coefficient = "M", + history_field = "H" +) +} diff --git a/man/r2ogs6_pipes.Rd b/man/r2ogs6_pipes.Rd index 0964723926959a7742192bd7cc7462fa8e537317..d03d055bf895a0f88c1bd0fce1b029eb5336f1a3 100644 --- a/man/r2ogs6_pipes.Rd +++ b/man/r2ogs6_pipes.Rd @@ -29,3 +29,19 @@ r2ogs6_pipes( \description{ tag: pipes } +\examples{ +r2ogs6_pipes( + longitudinal_dispersion_length = 0.001, + inlet = list( + diameter = " 0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + outlet = list( + diameter = "0.013665", + wall_thickness = "0.003035", + wall_thermal_conductivity = "0.39" + ), + distance_between_pipes = 0.053 +) +} diff --git a/man/r2ogs6_porous_medium.Rd b/man/r2ogs6_porous_medium.Rd index 742d823cd8b30631b0c4e0ab3e7b90675061a5fa..fba9e7ff8fefc57806a2e47e018835f283cb5711 100644 --- a/man/r2ogs6_porous_medium.Rd +++ b/man/r2ogs6_porous_medium.Rd @@ -29,3 +29,33 @@ r2ogs6_porous_medium( \description{ tag: porous_medium } +\examples{ +r2ogs6_porous_medium( + id = 0, + permeability = list(permeability_tensor_entries = "kappa1", + type = "Constant"), + porosity = list(type = "Constant", + porosity_parameter = "constant_porosity_parameter"), + storage = list(type = "Constant", + value = " 0.0 "), + capillary_pressure = r2ogs6_capillary_pressure( + type = "vanGenuchten", + pd = 2e+06, + sr = 0.4, + smax = 1, + m = 0.3288590604, + pc_max = 2e+07, + has_regularized = "true" + ), + relative_permeability = list( + relative_permeability = r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" + ) + ) +) +} diff --git a/man/r2ogs6_pr_property.Rd b/man/r2ogs6_pr_property.Rd index 5028f3fbf977565b610e7b2b3ba8c9c6ae21e916..c77c01496f7e7391bee1679f94f5a4a49e4cfc2d 100644 --- a/man/r2ogs6_pr_property.Rd +++ b/man/r2ogs6_pr_property.Rd @@ -110,3 +110,8 @@ r2ogs6_pr_property( \description{ tag: property } +\examples{ +r2ogs6_pr_property(name = "reference_temperature", + type = "Constant", + value = 293.15) +} diff --git a/man/r2ogs6_process.Rd b/man/r2ogs6_process.Rd index f1e926b5b1155c7855afd025ef5b66e95f00496d..f338095a882d4306c8af2dad5006ddedc115e265 100644 --- a/man/r2ogs6_process.Rd +++ b/man/r2ogs6_process.Rd @@ -218,3 +218,23 @@ r2ogs6_process( \description{ tag: process (parent tag: processes) } +\examples{ +r2ogs6_process( + name = "HM", + type = "HYDRO_MECHANICS", + integration_order = 3, + process_variables = list(displacement = "displacement", + pressure = "pressure"), + secondary_variables = list( + secondary_variable = c(internal_name = "sigma_xx", output_name = "sigma_xx"), + secondary_variable = c(internal_name = "sigma_yy", output_name = "sigma_yy") + ), + specific_body_force = c(0, 0, 0), + dimension = 3, + constitutive_relation = r2ogs6_constitutive_relation( + type = "LinearElasticIsotropic", + youngs_modulus = "E", + poissons_ratio = "nu" + ) +) +} diff --git a/man/r2ogs6_process_variable.Rd b/man/r2ogs6_process_variable.Rd index b4b12e99acf781b8774c648d75b5046fee0a8389..112984c3159cc4a39568bdb4bb39a94c0c84c3ee 100644 --- a/man/r2ogs6_process_variable.Rd +++ b/man/r2ogs6_process_variable.Rd @@ -35,3 +35,20 @@ r2ogs6_process_variable( \description{ tag: process_variable } +\examples{ +r2ogs6_process_variable( + name = "pressure", + components = 1, + order = 1, + initial_condition = "pressure0", + boundary_conditions = list( + boundary_condition = r2ogs6_boundary_condition( + type = "Neumann", + parameter = "flux_in", + geometrical_set = "cube_1x1x1_geometry", + geometry = "left", + component = 0 + ) + ) +) +} diff --git a/man/r2ogs6_rate.Rd b/man/r2ogs6_rate.Rd index 7c7b9eab0722b5f03c3ff98134580b98d5ae3fe3..c534c779bec86f15e8d2bef25aa35b10b3fbf24e 100644 --- a/man/r2ogs6_rate.Rd +++ b/man/r2ogs6_rate.Rd @@ -14,3 +14,16 @@ r2ogs6_rate(kinetic_reactant, expression) \description{ S3 class describing .prj rate } +\examples{ +r2ogs6_rate( + kinetic_reactant = "Productc", + expression = list( + statement = "Km = 10", + statement = "U = 1e-3", + statement = + "rate = U * TOT(\"Synthetica\") / (Km + TOT(\"Syntheticb\"))", + statement = "moles = - rate * TIME", + statement = "save moles" + ) +) +} diff --git a/man/r2ogs6_relative_permeability.Rd b/man/r2ogs6_relative_permeability.Rd index cd82b1c0ae93424d9c8f93bead5b3541fc7fc20a..1db4fb619207925d2a16127e28386b2326dffb66 100644 --- a/man/r2ogs6_relative_permeability.Rd +++ b/man/r2ogs6_relative_permeability.Rd @@ -22,3 +22,13 @@ r2ogs6_relative_permeability(type, sr, smax, m, krel_min, id = NULL) \description{ tag: relative_permeability } +\examples{ +r2ogs6_relative_permeability( + type = "NonWettingPhaseVanGenuchten", + sr = 0, + smax = 0.6, + m = 0.3288590604, + krel_min = 0, + id = "0" +) +} diff --git a/man/r2ogs6_search_length_algorithm.Rd b/man/r2ogs6_search_length_algorithm.Rd index 07745676ac0b200a8c6b7cd1ac9b468ffa68ca0b..42fd636c5e68b34ef91b51691f99db5f10f55cf3 100644 --- a/man/r2ogs6_search_length_algorithm.Rd +++ b/man/r2ogs6_search_length_algorithm.Rd @@ -14,3 +14,7 @@ r2ogs6_search_length_algorithm(type, value = NULL) \description{ tag: search_length_algorithm } +\examples{ +r2ogs6_search_length_algorithm(type = "fixed", + value = 1e-06) +} diff --git a/man/r2ogs6_solution.Rd b/man/r2ogs6_solution.Rd index 0d9fe49c5ddb22a61ed0e0963fe50b20caf82899..42e87bd688abff9ea5ebba8bd3a38bcff8471844 100644 --- a/man/r2ogs6_solution.Rd +++ b/man/r2ogs6_solution.Rd @@ -20,3 +20,15 @@ r2ogs6_solution(temperature, pressure, pe, components, charge_balance = NULL) \description{ tag: solution } +\examples{ +r2ogs6_solution( + temperature = 25, + pressure = 1, + pe = 4, + components = list( + component = "C(4)", + component = "Ca" + ), + charge_balance = "pH" +) +} diff --git a/man/r2ogs6_source_term.Rd b/man/r2ogs6_source_term.Rd index 57f5b7d126d86ed585a99f06dd4b2c21ed850258..cc7be19f0b09863c2806b03e66e16136faf2d824 100644 --- a/man/r2ogs6_source_term.Rd +++ b/man/r2ogs6_source_term.Rd @@ -29,3 +29,11 @@ r2ogs6_source_term( \description{ tag: source_term } +\examples{ +r2ogs6_source_term( + type = "Nodal", + parameter = "sourceterm_heat_transfer_coefficient", + geometrical_set = "geometry", + geometry = "po0" +) +} diff --git a/man/r2ogs6_time_loop.Rd b/man/r2ogs6_time_loop.Rd index a61f6d1fd973a4ea125fd53b8f5ad048b2874302..7c2c3dd37b1ad0e7f8a1a9375589a949a978dfc4 100644 --- a/man/r2ogs6_time_loop.Rd +++ b/man/r2ogs6_time_loop.Rd @@ -16,3 +16,37 @@ r2ogs6_time_loop(processes, output, global_process_coupling = NULL) \description{ tag: time_loop } +\examples{ +r2ogs6_time_loop( + processes = list( + process = r2ogs6_tl_process( + ref = "HM", + nonlinear_solver = "basic_newton", + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "NORM2", + reltol = 1e-08 + ), + time_discretization = list(type = "BackwardEuler"), + time_stepping = r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) + ) + ) + ), + output = r2ogs6_output( + type = "VTK", + prefix = "flow_free_expansion", + variables = list( + variable = "displacement", + variable = "pressure" + ), + suffix = "_ts_{:timestep}_t_{:time}", + timesteps = list(pair = list(1, + each_steps = 1000)) + ) +) +} diff --git a/man/r2ogs6_time_stepping.Rd b/man/r2ogs6_time_stepping.Rd index 4d1a4f07fcf13f8cbcf7e69b29d1dc1817d076a6..28f8b259bb0717a0459abea91e7f1e5dbcffc8ab 100644 --- a/man/r2ogs6_time_stepping.Rd +++ b/man/r2ogs6_time_stepping.Rd @@ -56,3 +56,12 @@ r2ogs6_time_stepping( \description{ tag: time_stepping } +\examples{ +r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) +) +} diff --git a/man/r2ogs6_tl_process.Rd b/man/r2ogs6_tl_process.Rd index e4e8fb500bf0a8a860ecb9a987310e2d4e996400..c43bb4cfa88ae1fa6a0832a4fcf923ccb27dc743 100644 --- a/man/r2ogs6_tl_process.Rd +++ b/man/r2ogs6_tl_process.Rd @@ -30,3 +30,22 @@ r2ogs6_tl_process( \description{ tag: process (parent: time_loop, NOT processes!) } +\examples{ +r2ogs6_tl_process( + ref = "HM", + nonlinear_solver = "basic_newton", + convergence_criterion = r2ogs6_convergence_criterion( + type = "DeltaX", + norm_type = "NORM2", + reltol = 1e-08 + ), + time_discretization = list(type = "BackwardEuler"), + time_stepping = r2ogs6_time_stepping( + type = "FixedTimeStepping", + t_initial = 0, + t_end = 10000, + timesteps = list(pair = list(1000, + delta_t = 10)) + ) +) +} diff --git a/man/r2ogs6_vtkdiff.Rd b/man/r2ogs6_vtkdiff.Rd index 0ab8165d3aaadbf3506e681d9a20d19c3c041557..534a35b4ec4965b75ecf342f428fab214b4f6228 100644 --- a/man/r2ogs6_vtkdiff.Rd +++ b/man/r2ogs6_vtkdiff.Rd @@ -26,3 +26,9 @@ r2ogs6_vtkdiff( \description{ tag: vtkdiff } +\examples{ +r2ogs6_vtkdiff(field = "displacement", + absolute_tolerance = 1e-15, + relative_tolerance = 0, + regex = "gravity_pcs_0_ts_.*_t_.*.vtu") +} diff --git a/man/read_in_points.Rd b/man/read_in_points.Rd index e0956b9ccb297636f9404e61780cb1b704cf399e..2b486cf2cf37efbdf536f7142640b60ba31ebc1b 100644 --- a/man/read_in_points.Rd +++ b/man/read_in_points.Rd @@ -7,8 +7,8 @@ read_in_points(xml_doc) } \arguments{ -\item{xml_doc}{A parsed XML document (of class 'xml2::xml_document')} +\item{xml_doc}{A parsed XML document (of class \code{xml2::xml_document})} } \description{ -Reads points from a .gml file +Reads points from a \code{.gml} file } diff --git a/man/read_in_polylines.Rd b/man/read_in_polylines.Rd index 242ac2a1d728666c394b8247f55a3b895d7d89c1..69b60ffc3521c4ab8310c698dc0ce63578e77489 100644 --- a/man/read_in_polylines.Rd +++ b/man/read_in_polylines.Rd @@ -7,8 +7,8 @@ read_in_polylines(xml_doc) } \arguments{ -\item{xml_doc}{A parsed XML document (of class 'xml2::xml_document')} +\item{xml_doc}{A parsed XML document (of class \code{xml2::xml_document})} } \description{ -Reads polylines from a .gml file +Reads polylines from a \code{.gml} file } diff --git a/man/read_in_prj.Rd b/man/read_in_prj.Rd index 3d5b8bc49334b1a7d87c4bedb9cd544e3d8087ec..314aada86924e6393e009a32e60871d3528d0caa 100644 --- a/man/read_in_prj.Rd +++ b/man/read_in_prj.Rd @@ -9,15 +9,16 @@ read_in_prj(ogs6_obj, prj_path, read_in_gml, read_in_vtu = FALSE) \arguments{ \item{ogs6_obj}{OGS6: Simulation object} -\item{prj_path}{string: Path to the project file that should be read in} +\item{prj_path}{string: Path to the \code{.prj} file that should be read in} -\item{read_in_gml}{flag: Optional: Should .gml file just be copied or read in -too? If this parameter is missing and the .gml file contains <= -`options("r2ogs6.max_lines_gml")`, the .gml will be read in. Else, only the -geometry reference will be saved.} +\item{read_in_gml}{flag: Optional: Should \code{.gml} file just be copied or +read in too? If this parameter is missing and the \code{.gml} file contains +<= \code{options("r2ogs6.max_lines_gml")}, the \code{.gml} will be read in. +Else, only the geometry reference will be saved.} -\item{read_in_vtu}{flag: Should .vtu file just be copied or read in too?} +\item{read_in_vtu}{flag: Should \code{.vtu} file just be copied or read in +too?} } \description{ -Wrapper function to read in a whole .prj file +Wrapper function to read in a whole \code{.prj} file } diff --git a/man/read_in_surfaces.Rd b/man/read_in_surfaces.Rd index f197240d1f0d7cdbf3142a1b1aae83b5144725d3..ded5155738587b478b3c9f14a54a20fcc870fdcc 100644 --- a/man/read_in_surfaces.Rd +++ b/man/read_in_surfaces.Rd @@ -7,8 +7,8 @@ read_in_surfaces(xml_doc) } \arguments{ -\item{xml_doc}{A parsed XML document (of class 'xml2::xml_document')} +\item{xml_doc}{A parsed XML document (of class \code{xml2::xml_document})} } \description{ -Reads surfaces from a .gml file +Reads surfaces from a \code{.gml} file } diff --git a/man/run_all_benchmarks.Rd b/man/run_all_benchmarks.Rd index e69498cecab2e1f1c68ba416604d5e6f0ed24b8c..caac9a41641ce18d3bb57882a5cd8dfcd28f460a 100644 --- a/man/run_all_benchmarks.Rd +++ b/man/run_all_benchmarks.Rd @@ -23,7 +23,7 @@ which contains relevant Tests.cmake files} \item{sim_path}{string: Path where simulation files will be saved} -\item{starting_from_prj_path}{string: .prj path to start from} +\item{starting_from_prj_path}{string: \code{.prj} path to start from} \item{print_results}{flag: Print results in the end?} } diff --git a/man/validate_read_in_xml.Rd b/man/validate_read_in_xml.Rd index 6177cf85e9b9b6fae0eb47bc43d446b4944638f8..c97deee00c15d2e2fc3886b7d052f38eff18c3ac 100644 --- a/man/validate_read_in_xml.Rd +++ b/man/validate_read_in_xml.Rd @@ -10,7 +10,8 @@ validate_read_in_xml(path) \item{path}{string: A file to be parsed as XML} } \value{ -The parsed XML file (as class object of type xml2::xml_document) +The parsed XML file (as class object of type +\code{xml2::xml_document}) } \description{ Utility function, tries parsing the provided file as an XML