From f76af0ab81c4c976246b2f3049d502acaaa95cf1 Mon Sep 17 00:00:00 2001 From: aheinri5 <Anna@netzkritzler.de> Date: Sat, 16 Jan 2021 22:02:14 +0100 Subject: [PATCH] [docs] updated documentation --- man/OGS6.Rd | 19 ++++--- man/OGS6_vtu.Rd | 21 +++++++ man/addable_prj_components.Rd | 19 +++++++ man/coerce_string_to_numeric.Rd | 10 +--- man/decode_appended_data.Rd | 20 +++++++ man/generate_all_benchmark_scripts.Rd | 16 +++--- man/generate_benchmark_script.Rd | 8 +-- man/get_class_args.Rd | 17 ++++++ man/get_valid_vtu_categories.Rd | 14 +++++ man/get_vtu_data_arrays_from_file.Rd | 25 +++++++++ man/node_to_object.Rd | 29 ++++++++++ man/node_to_r2ogs6_class_object.Rd | 23 ++++++++ man/order_parameters.Rd | 3 + man/r2ogs6_phase.Rd | 2 +- man/r2ogs6_pr_property.Rd | 80 ++++++++++++++++++--------- man/read_in_output.Rd | 2 +- man/read_in_prj.Rd | 9 ++- man/read_in_pvd.Rd | 17 ++++++ man/read_in_vtu.Rd | 3 +- 19 files changed, 278 insertions(+), 59 deletions(-) create mode 100644 man/addable_prj_components.Rd create mode 100644 man/decode_appended_data.Rd create mode 100644 man/get_class_args.Rd create mode 100644 man/get_valid_vtu_categories.Rd create mode 100644 man/get_vtu_data_arrays_from_file.Rd create mode 100644 man/node_to_object.Rd create mode 100644 man/node_to_r2ogs6_class_object.Rd create mode 100644 man/read_in_pvd.Rd diff --git a/man/OGS6.Rd b/man/OGS6.Rd index ce0bb93..1e4eb53 100644 --- a/man/OGS6.Rd +++ b/man/OGS6.Rd @@ -59,7 +59,7 @@ Constructor for the OGS6 base class \subsection{Public methods}{ \itemize{ \item \href{#method-new}{\code{OGS6$new()}} -\item \href{#method-add_component}{\code{OGS6$add_component()}} +\item \href{#method-add}{\code{OGS6$add()}} \item \href{#method-add_gml}{\code{OGS6$add_gml()}} \item \href{#method-add_vtu}{\code{OGS6$add_vtu()}} \item \href{#method-add_python_script}{\code{OGS6$add_python_script()}} @@ -109,18 +109,21 @@ validated. Unless you're a dev, please don't touch.} } } \if{html}{\out{<hr>}} -\if{html}{\out{<a id="method-add_component"></a>}} -\if{latex}{\out{\hypertarget{method-add_component}{}}} -\subsection{Method \code{add_component()}}{ +\if{html}{\out{<a id="method-add"></a>}} +\if{latex}{\out{\hypertarget{method-add}{}}} +\subsection{Method \code{add()}}{ Adds a simulation component (WIP) \subsection{Usage}{ -\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_component(x)}\if{html}{\out{</div>}} +\if{html}{\out{<div class="r">}}\preformatted{OGS6$add(x, component_name = "")}\if{html}{\out{</div>}} } \subsection{Arguments}{ \if{html}{\out{<div class="arguments">}} \describe{ -\item{\code{x}}{OGS6_*: An object of a class listed in get_implemented_classes()} +\item{\code{x}}{An object of any class listed in addable_components(). If `x` is +not of a proprietary `r2ogs6` class, `component_name` must be +supplied. E.g. If you're adding a `python_script` which is a string, you +would call `your_ogs6_obj$add("some_script.py", "python_script")`} } \if{html}{\out{</div>}} } @@ -419,7 +422,7 @@ Prints logfile to console (if it exists) \subsection{Method \code{clear()}}{ Clears components from the OGS6 object \subsection{Usage}{ -\if{html}{\out{<div class="r">}}\preformatted{OGS6$clear(which = names(get_implemented_classes()))}\if{html}{\out{</div>}} +\if{html}{\out{<div class="r">}}\preformatted{OGS6$clear(which = names(addable_prj_components()))}\if{html}{\out{</div>}} } \subsection{Arguments}{ @@ -427,7 +430,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(get_implemented_classes()) for the available options.} +names(addable_prj_components()) for the available options.} } \if{html}{\out{</div>}} } diff --git a/man/OGS6_vtu.Rd b/man/OGS6_vtu.Rd index ee7efcf..bbf865e 100644 --- a/man/OGS6_vtu.Rd +++ b/man/OGS6_vtu.Rd @@ -35,6 +35,7 @@ Constructor for the OGS6_vtu base class \subsection{Public methods}{ \itemize{ \item \href{#method-new}{\code{OGS6_vtu$new()}} +\item \href{#method-get_data_arrays}{\code{OGS6_vtu$get_data_arrays()}} \item \href{#method-clone}{\code{OGS6_vtu$clone()}} } } @@ -76,6 +77,26 @@ Creates new OGS6_vtu object } } \if{html}{\out{<hr>}} +\if{html}{\out{<a id="method-get_data_arrays"></a>}} +\if{latex}{\out{\hypertarget{method-get_data_arrays}{}}} +\subsection{Method \code{get_data_arrays()}}{ +Gets specified DataArrays +\subsection{Usage}{ +\if{html}{\out{<div class="r">}}\preformatted{OGS6_vtu$get_data_arrays(Names = character(), categories = character())}\if{html}{\out{</div>}} +} + +\subsection{Arguments}{ +\if{html}{\out{<div class="arguments">}} +\describe{ +\item{\code{Names}}{character: Optional: Select `DataArray` by `Name`} + +\item{\code{categories}}{character: Optional: One or more of +`get_valid_vtu_categories()`} +} +\if{html}{\out{</div>}} +} +} +\if{html}{\out{<hr>}} \if{html}{\out{<a id="method-clone"></a>}} \if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ diff --git a/man/addable_prj_components.Rd b/man/addable_prj_components.Rd new file mode 100644 index 0000000..7845a80 --- /dev/null +++ b/man/addable_prj_components.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{addable_prj_components} +\alias{addable_prj_components} +\title{addable_prj_components} +\usage{ +addable_prj_components() +} +\value{ +character: Named vector of `OGS6` top level .prj components (names) +along with their respective class names (values) +} +\description{ +Returns all possible `OGS6` top level .prj components (names) +along with their respective class names (values). +Change this if you implement new `OGS6` .prj components or delete old ones! +If you implement a new components, you add the following to the `class_names` +vector: `name_of_prj_component = "name_of_your_class"` +} diff --git a/man/coerce_string_to_numeric.Rd b/man/coerce_string_to_numeric.Rd index 93de4e7..33eee9b 100644 --- a/man/coerce_string_to_numeric.Rd +++ b/man/coerce_string_to_numeric.Rd @@ -4,21 +4,15 @@ \alias{coerce_string_to_numeric} \title{coerce_string_to_numeric} \usage{ -coerce_string_to_numeric(obj, split = FALSE) +coerce_string_to_numeric(obj) } \arguments{ \item{obj}{An object to check} - -\item{split}{flag: Should object be split at ' ' (whitespace) if it is a -string?} } \value{ The object as a numeric type (if 'obj' was a string, else the unchanged 'obj') } \description{ -If an object is of type string, coerces it to a numeric type: -A double if 'split' is FALSE as per default, a numeric vector otherwise. -If 'split' is set to true the string will be split at ' ' (whitespace) -characters. +If an object is of type string, coerces it to a numeric type } diff --git a/man/decode_appended_data.Rd b/man/decode_appended_data.Rd new file mode 100644 index 0000000..5b47001 --- /dev/null +++ b/man/decode_appended_data.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_vtu.R +\name{decode_appended_data} +\alias{decode_appended_data} +\title{decode_appended_data} +\usage{ +decode_appended_data(appended_data, compressor = "") +} +\arguments{ +\item{appended_data}{character: AppendedData} + +\item{compressor}{string: Optional: How the data was compressed, this is the +`compressor` attribute of *VTKFile*} +} +\value{ +list: DataArrays with `data` element which is the decoded data +} +\description{ +Decodes AppendedData +} diff --git a/man/generate_all_benchmark_scripts.Rd b/man/generate_all_benchmark_scripts.Rd index 0f1bf40..eebd7e2 100644 --- a/man/generate_all_benchmark_scripts.Rd +++ b/man/generate_all_benchmark_scripts.Rd @@ -8,10 +8,10 @@ generate_all_benchmark_scripts( path, sim_path, scripts_path, - starting_from_prj_path = "", - skip_prj_paths = character(), + read_in_gmls, read_in_vtus = FALSE, - read_in_gmls = TRUE + starting_from_prj_path = "", + skip_prj_paths = character() ) } \arguments{ @@ -21,15 +21,15 @@ generate_all_benchmark_scripts( \item{scripts_path}{string: Path where benchmark scripts will be saved} -\item{starting_from_prj_path}{string: Optional:} - -\item{skip_prj_paths}{character: Optional: .prj paths to skip} +\item{read_in_gmls}{flag: Optional: Should .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_gmls}{flag: Optional: Should .gml 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} } \description{ Wrapper function to generate benchmark scripts from all .prj diff --git a/man/generate_benchmark_script.Rd b/man/generate_benchmark_script.Rd index 03126b3..cdd5d1d 100644 --- a/man/generate_benchmark_script.Rd +++ b/man/generate_benchmark_script.Rd @@ -9,8 +9,8 @@ generate_benchmark_script( sim_path, ogs_bin_path, script_path, - read_in_vtu = FALSE, - read_in_gml = TRUE + read_in_gml, + read_in_vtu = FALSE ) } \arguments{ @@ -22,10 +22,10 @@ generate_benchmark_script( \item{script_path}{string: Path where benchmark script will be saved} -\item{read_in_vtu}{flag: Optional: Should .vtu file(s) just be copied or read +\item{read_in_gml}{flag: Optional: Should .gml file just be copied or read in too?} -\item{read_in_gml}{flag: Optional: Should .gml file just be copied or read +\item{read_in_vtu}{flag: Optional: Should .vtu file(s) just be copied or read in too?} } \description{ diff --git a/man/get_class_args.Rd b/man/get_class_args.Rd new file mode 100644 index 0000000..82debcb --- /dev/null +++ b/man/get_class_args.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_utils.R +\name{get_class_args} +\alias{get_class_args} +\title{get_class_args} +\usage{ +get_class_args(class_name) +} +\arguments{ +\item{class_name}{string: The name of a class} +} +\value{ +character: Named vector of class arguments +} +\description{ +Gets class arguments +} diff --git a/man/get_valid_vtu_categories.Rd b/man/get_valid_vtu_categories.Rd new file mode 100644 index 0000000..9cda300 --- /dev/null +++ b/man/get_valid_vtu_categories.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{get_valid_vtu_categories} +\alias{get_valid_vtu_categories} +\title{get_valid_vtu_categories} +\usage{ +get_valid_vtu_categories() +} +\value{ +character: `OGS6_vtu` categories +} +\description{ +Returns all valid `OGS6_vtu` categories. +} diff --git a/man/get_vtu_data_arrays_from_file.Rd b/man/get_vtu_data_arrays_from_file.Rd new file mode 100644 index 0000000..f812aaa --- /dev/null +++ b/man/get_vtu_data_arrays_from_file.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_vtu.R +\name{get_vtu_data_arrays_from_file} +\alias{get_vtu_data_arrays_from_file} +\title{get_vtu_data_arrays_from_file} +\usage{ +get_vtu_data_arrays_from_file( + vtu_path, + Names = character(), + categories = character() +) +} +\arguments{ +\item{vtu_path}{string: .vtu file path} + +\item{Names}{character: Optional: Select `DataArray` elements by `Name` +attribute} + +\item{categories}{character: Optional: One or more of `FieldData`, `PointData`, +`CellData`, `Points` or `Cells`. If left empty, will get `DataArray` +elements from whole XML document.} +} +\description{ +Reads DataArray elements from a .vtu file +} diff --git a/man/node_to_object.Rd b/man/node_to_object.Rd new file mode 100644 index 0000000..4538056 --- /dev/null +++ b/man/node_to_object.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_utils.R +\name{node_to_object} +\alias{node_to_object} +\title{node_to_object} +\usage{ +node_to_object(xml_node, xpath_expr = "", subclasses_names = character()) +} +\arguments{ +\item{xml_node}{xml2::xml_node: XML node} + +\item{xpath_expr}{string: Optional: XPath expression (for subclass +differentiation)} + +\item{subclasses_names}{character: Optional: Names of `r2ogs6` subclasses +(`r2ogs6` classes without a OGS6$add method)} +} +\description{ +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 +} diff --git a/man/node_to_r2ogs6_class_object.Rd b/man/node_to_r2ogs6_class_object.Rd new file mode 100644 index 0000000..51a782e --- /dev/null +++ b/man/node_to_r2ogs6_class_object.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_utils.R +\name{node_to_r2ogs6_class_object} +\alias{node_to_r2ogs6_class_object} +\title{node_to_r2ogs6_class_object} +\usage{ +node_to_r2ogs6_class_object( + xml_node, + xpath_expr, + subclasses_names = character() +) +} +\arguments{ +\item{xml_node}{xml2::xml_node: XML node} + +\item{xpath_expr}{string: XPath expression (for subclass differentiation)} + +\item{subclasses_names}{character: Optional: Names of r2ogs6 subclasses +(r2ogs6 classes without a method for input_add)} +} +\description{ +Takes an XML node and turns it into a class object +} diff --git a/man/order_parameters.Rd b/man/order_parameters.Rd index e6fb230..8d18945 100644 --- a/man/order_parameters.Rd +++ b/man/order_parameters.Rd @@ -11,6 +11,9 @@ order_parameters(parameters, class_name) \item{class_name}{string: The name of a class} } +\value{ +list: Parameters ordered by argument order of class +} \description{ Orders a list of parameters corresponding to the argument order of a class diff --git a/man/r2ogs6_phase.Rd b/man/r2ogs6_phase.Rd index a88c61c..af754f8 100644 --- a/man/r2ogs6_phase.Rd +++ b/man/r2ogs6_phase.Rd @@ -4,7 +4,7 @@ \alias{r2ogs6_phase} \title{r2ogs6_phase} \usage{ -r2ogs6_phase(type, properties, components = NULL) +r2ogs6_phase(type, properties = NULL, components = NULL) } \arguments{ \item{type}{string: Phase type diff --git a/man/r2ogs6_pr_property.Rd b/man/r2ogs6_pr_property.Rd index 285a52d..5028f3f 100644 --- a/man/r2ogs6_pr_property.Rd +++ b/man/r2ogs6_pr_property.Rd @@ -16,67 +16,97 @@ r2ogs6_pr_property( independent_variable = NULL, curve = NULL, minimum_relative_permeability_liquid = NULL, + initial_permeability = NULL, + maximum_permeability = NULL, lambda = NULL, cutoff_value = NULL, - initial_permeability = NULL, + intrinsic_permeability = NULL, + initial_aperture = NULL, + mean_frac_distance = NULL, + threshold_strain = NULL, + fracture_normal = NULL, reference_permeability = NULL, fitting_factor = NULL, cohesion = NULL, friction_angle = NULL, - maximum_permeability = NULL, tensile_strength_parameter = NULL, + b1 = NULL, + b2 = NULL, + b3 = NULL, + minimum_permeability = NULL, + initial_porosity = NULL, entry_pressure = NULL, min_relative_permeability_liquid = NULL, min_relative_permeability_gas = NULL ) } \arguments{ -\item{name}{string: Property name} +\item{name}{string:} -\item{type}{string: Property type} +\item{type}{string:} -\item{value}{Optional: string | double: ...} +\item{value}{Optional:} -\item{parameter_name}{Optional: string:} +\item{parameter_name}{Optional:} -\item{exponent}{Optional: string | double:} +\item{exponent}{Optional:} -\item{residual_liquid_saturation}{Optional: string | double:} +\item{residual_liquid_saturation}{Optional:} -\item{residual_gas_saturation}{Optional: string | double:} +\item{residual_gas_saturation}{Optional:} -\item{p_b}{Optional: string | double: string | double:} +\item{p_b}{Optional:} -\item{independent_variable}{Optional: string} +\item{independent_variable}{Optional:} -\item{curve}{Optional: string:} +\item{curve}{Optional:} \item{minimum_relative_permeability_liquid}{Optional:} -\item{lambda}{Optional: string | double:} +\item{initial_permeability}{Optional:} + +\item{maximum_permeability}{Optional:} + +\item{lambda}{Optional:} + +\item{cutoff_value}{Optional:} + +\item{intrinsic_permeability}{Optional:} + +\item{initial_aperture}{Optional:} + +\item{mean_frac_distance}{Optional:} + +\item{threshold_strain}{Optional:} + +\item{fracture_normal}{Optional:} + +\item{reference_permeability}{Optional:} + +\item{fitting_factor}{Optional:} -\item{cutoff_value}{Optional: string | double:} +\item{cohesion}{Optional:} -\item{initial_permeability}{Optional: string:} +\item{friction_angle}{Optional:} -\item{reference_permeability}{Optional: string | double:} +\item{tensile_strength_parameter}{Optional:} -\item{fitting_factor}{Optional: string | double:} +\item{b1}{Optional:} -\item{cohesion}{Optional: string | double:} +\item{b2}{Optional:} -\item{friction_angle}{Optional: string | double:} +\item{b3}{Optional:} -\item{maximum_permeability}{Optional: string | double:} +\item{minimum_permeability}{Optional:} -\item{tensile_strength_parameter}{Optional: string | double:} +\item{initial_porosity}{Optional:} -\item{entry_pressure}{Optional: string | double:} +\item{entry_pressure}{Optional:} -\item{min_relative_permeability_liquid}{Optional: string | double:} +\item{min_relative_permeability_liquid}{Optional:} -\item{min_relative_permeability_gas}{Optional: string | double:} +\item{min_relative_permeability_gas}{Optional:} } \description{ -tag: property, a constitutive property +tag: property } diff --git a/man/read_in_output.Rd b/man/read_in_output.Rd index e4f6637..17d3f0e 100644 --- a/man/read_in_output.Rd +++ b/man/read_in_output.Rd @@ -7,7 +7,7 @@ read_in_output(ogs6_obj) } \arguments{ -\item{ogs6_obj}{A OGS6 class object} +\item{ogs6_obj}{OGS6: Simulation object} } \description{ After a OGS6 simulation was run, reads in the generated .vtu diff --git a/man/read_in_prj.Rd b/man/read_in_prj.Rd index f4fb4f8..9633b09 100644 --- a/man/read_in_prj.Rd +++ b/man/read_in_prj.Rd @@ -4,16 +4,19 @@ \alias{read_in_prj} \title{read_in_prj} \usage{ -read_in_prj(ogs6_obj, prj_path, read_in_vtu = FALSE, read_in_gml = TRUE) +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{read_in_vtu}{flag: Should .vtu file just be copied or read in too?} +\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 <= the +number of lines in `options("r2ogs6.max_lines_gml")`, the .gml will be read +in. Else, only the geometry reference will be saved.} -\item{read_in_gml}{flag: Should .gml file just be copied or read in too?} +\item{read_in_vtu}{flag: Should .vtu file just be copied or read in too?} } \description{ Wrapper function to read in a whole .prj file diff --git a/man/read_in_pvd.Rd b/man/read_in_pvd.Rd new file mode 100644 index 0000000..4f17da0 --- /dev/null +++ b/man/read_in_pvd.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/read_in_vtu.R +\name{read_in_pvd} +\alias{read_in_pvd} +\title{read_in_pvd} +\usage{ +read_in_pvd(pvd_path) +} +\arguments{ +\item{pvd_path}{string: Path to .pvd file that should be read in} +} +\value{ +character: Vector containing .vtu paths +} +\description{ +Function to read in a .pvd file +} diff --git a/man/read_in_vtu.Rd b/man/read_in_vtu.Rd index 929b7bd..1f2df67 100644 --- a/man/read_in_vtu.Rd +++ b/man/read_in_vtu.Rd @@ -13,5 +13,6 @@ read_in_vtu(vtu_path) OGS6_vtu: Mesh object } \description{ -Wrapper function to read in a whole .vtu file +Wrapper function to read in a whole .vtu file as a OGS6_vtu +class object } -- GitLab