Skip to content
Snippets Groups Projects
Commit 39bd9611 authored by Ruben Heinrich's avatar Ruben Heinrich
Browse files

[base] docs and NAMESPACE cleanup

parent c3e744a8
No related branches found
No related tags found
1 merge request!6Merge branch 7 fixed functionality into master
Showing
with 79 additions and 468 deletions
...@@ -38,7 +38,8 @@ Imports: ...@@ -38,7 +38,8 @@ Imports:
dplyr, dplyr,
rlang, rlang,
doParallel, doParallel,
stats stats,
reticulate
RoxygenNote: 7.1.1 RoxygenNote: 7.1.1
VignetteBuilder: knitr VignetteBuilder: knitr
Depends: Depends:
......
# Generated by roxygen2: do not edit by hand
export(OGS6)
export(OGS6_Chain)
export(OGS6_Ensemble)
export(OGS6_gml)
export(OGS6_pvd)
export(OGS6_vtu)
export(generate_benchmark_script)
export(generate_structured_mesh)
export(r2ogs6_borehole_heat_exchanger)
export(r2ogs6_boundary_condition)
export(r2ogs6_capillary_pressure)
export(r2ogs6_chemical_system)
export(r2ogs6_com_property)
export(r2ogs6_component)
export(r2ogs6_convergence_criterion)
export(r2ogs6_curve)
export(r2ogs6_deactivated_subdomain)
export(r2ogs6_eigen)
export(r2ogs6_flow_and_temperature_control)
export(r2ogs6_fluid)
export(r2ogs6_fracture_model)
export(r2ogs6_fracture_properties)
export(r2ogs6_global_process_coupling)
export(r2ogs6_insitu)
export(r2ogs6_jacobian_assembler)
export(r2ogs6_kinetic_reactant)
export(r2ogs6_linear_solver)
export(r2ogs6_local_coordinate_system)
export(r2ogs6_material_property)
export(r2ogs6_medium)
export(r2ogs6_nonlinear_solver)
export(r2ogs6_output)
export(r2ogs6_parameter)
export(r2ogs6_ph_property)
export(r2ogs6_phase)
export(r2ogs6_phase_component)
export(r2ogs6_phasefield_parameters)
export(r2ogs6_pipes)
export(r2ogs6_porous_medium)
export(r2ogs6_process)
export(r2ogs6_process_variable)
export(r2ogs6_rate)
export(r2ogs6_search_length_algorithm)
export(r2ogs6_solution)
export(r2ogs6_source_term)
export(r2ogs6_time_loop)
export(r2ogs6_time_stepping)
export(r2ogs6_tl_process)
export(r2ogs6_vtkdiff)
export(read_in_prj)
export(run_simulation)
importFrom(foreach,"%dopar%")
...@@ -205,18 +205,17 @@ get_nonstandard_tag_names <- function(){ ...@@ -205,18 +205,17 @@ get_nonstandard_tag_names <- function(){
} }
#'get_implemented_classes #'addable_prj_components
#'@description Returns class names (and variable names) of `OGS6` variables. #'@description Returns all possible `OGS6` top level .prj components (names)
#' Change this if you implement new `OGS6` variables or delete old ones! #' along with their respective class names (values).
#' If you implement a new variable, you add the following the `class_names` #' Change this if you implement new `OGS6` .prj components or delete old ones!
#' vector: `name_of_OGS6_variable = "name_of_your_class"` #' If you implement a new components, you add the following to the `class_names`
#'@return character: Named vector containing class names of `OGS6` variables #' vector: `name_of_prj_component = "name_of_your_class"`
#' and their corresponding variable name #'@return character: Named vector of `OGS6` top level .prj components (names)
get_implemented_classes <- function(){ #' along with their respective class names (values)
addable_prj_components <- function(){
class_names <- c(vtus = "OGS6_vtu",
gml = "r2ogs6_gml", class_names <- c(search_length_algorithm = "r2ogs6_search_length_algorithm",
search_length_algorithm = "r2ogs6_search_length_algorithm",
processes = "r2ogs6_process", processes = "r2ogs6_process",
media = "r2ogs6_medium", media = "r2ogs6_medium",
time_loop = "r2ogs6_time_loop", time_loop = "r2ogs6_time_loop",
...@@ -297,15 +296,15 @@ get_obj_status <- function(flag, obj){ ...@@ -297,15 +296,15 @@ get_obj_status <- function(flag, obj){
#'@param ogs6_parameter_name string: Name of a OGS6 parameter #'@param ogs6_parameter_name string: Name of a OGS6 parameter
is_optional_sim_component <- function(ogs6_parameter_name){ is_optional_sim_component <- function(ogs6_parameter_name){
optional_sim_components <- c("gml", mandatory_components <- c("meshes",
"vtus", "processes",
"local_coordinate_system", "time_loop",
"curves", "nonlinear_solvers",
"search_length_algorithm", "linear_solvers",
"test_definition", "parameters",
"insitu") "process_variables")
return(invisible(ogs6_parameter_name %in% optional_sim_components)) return(invisible(!ogs6_parameter_name %in% mandatory_components))
} }
...@@ -313,23 +312,15 @@ is_optional_sim_component <- function(ogs6_parameter_name){ ...@@ -313,23 +312,15 @@ is_optional_sim_component <- function(ogs6_parameter_name){
#'coerce_string_to_numeric #'coerce_string_to_numeric
#'@description If an object is of type string, coerces it to a numeric type: #'@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.
#'@param obj An object to check #'@param obj An object to check
#'@param split flag: Should object be split at ' ' (whitespace) if it is a
#' string?
#'@return The object as a numeric type (if 'obj' was a string, else the #'@return The object as a numeric type (if 'obj' was a string, else the
#' unchanged 'obj') #' unchanged 'obj')
coerce_string_to_numeric <- function(obj, split = FALSE){ coerce_string_to_numeric <- function(obj){
if(assertthat::is.string(obj)){ if(assertthat::is.string(obj)){
if(split){ obj <- trimws(gsub("\r?\n|\r|\\s+", " ", obj))
obj <- as.double(unlist(strsplit(obj, " "))) obj <- as.double(unlist(strsplit(obj, " ")))
}else{
obj <- as.double(obj)
}
} }
return(invisible(obj)) return(invisible(obj))
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vtu.R
\name{OGS6_Piece}
\alias{OGS6_Piece}
\title{OGS6_Piece}
\description{
Constructor for the OGS6_Piece base class
}
\section{Active bindings}{
\if{html}{\out{<div class="r6-active-bindings">}}
\describe{
\item{\code{NumberOfPoints}}{Access to private parameter '.NumberOfPoints'}
\item{\code{NumberOfCells}}{Access to private parameter '.NumberOfCells'}
\item{\code{PointData}}{Access to private parameter '.PointData'}
\item{\code{Points}}{Access to private parameter '.Points'}
\item{\code{Cells}}{Access to private parameter '.Cells'}
\item{\code{CellData}}{Access to private parameter '.CellData'}
\item{\code{is_subclass}}{Access to private parameter '.is_subclass'}
\item{\code{subclasses_names}}{Access to private parameter '.subclasses_names'}
\item{\code{attr_names}}{Access to private parameter '.attr_names'}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{OGS6_Piece$new()}}
\item \href{#method-clone}{\code{OGS6_Piece$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Creates new OGS6_Piece object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_Piece$new(
NumberOfPoints,
NumberOfCells,
PointData,
Points,
Cells,
CellData = NULL
)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{NumberOfPoints}}{string | number:}
\item{\code{NumberOfCells}}{string | number:}
\item{\code{PointData}}{list, :}
\item{\code{Points}}{list, :}
\item{\code{Cells}}{list, :}
\item{\code{CellData}}{list, : Optional:}
}
\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()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_Piece$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vtu.R
\name{OGS6_UnstructuredGrid}
\alias{OGS6_UnstructuredGrid}
\title{OGS6_UnstructuredGrid}
\description{
Constructor for the OGS6_UnstructuredGrid base class
}
\section{Active bindings}{
\if{html}{\out{<div class="r6-active-bindings">}}
\describe{
\item{\code{Piece}}{Access to private parameter '.Piece'}
\item{\code{FieldData}}{Access to private parameter '.FieldData'}
\item{\code{is_subclass}}{Access to private parameter '.is_subclass'}
\item{\code{attr_names}}{Access to private parameter '.attr_names'}
\item{\code{flatten_on_exp}}{Access to private parameter '.flatten_on_exp'}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{OGS6_UnstructuredGrid$new()}}
\item \href{#method-clone}{\code{OGS6_UnstructuredGrid$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Creates new OGS6_UnstructuredGrid object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_UnstructuredGrid$new(Piece, FieldData = NULL)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{Piece}}{OGS6_Piece:}
\item{\code{FieldData}}{character, length == 2: Optional:}
}
\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()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_UnstructuredGrid$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_in_utils.R
\name{check_file_extension}
\alias{check_file_extension}
\title{check_file_extension}
\usage{
check_file_extension(file, expected_extension)
}
\arguments{
\item{file}{A file}
\item{expected_extension}{The expected file extension}
}
\description{
Helper function to check the extension of a file
}
% 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
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{get_implemented_classes}
\alias{get_implemented_classes}
\title{get_implemented_classes}
\usage{
get_implemented_classes()
}
\description{
Utility function, returns the names of all classes implemented
so far. Change this if you implement new classes or delete old ones!
If you implement a new class, you add the following to the character vector:
<name_of_corresponding_OGS6_parameter> = <name_of_your_class>
}
% 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.
}
% 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
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_in_utils.R
\name{guess_structure}
\alias{guess_structure}
\title{guess_structure}
\usage{
guess_structure(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}{Optional: character: Names of r2ogs6 subclasses
(r2ogs6 classes without a OGS6$add method)}
}
\description{
Guesses the R representation of an XML node and adds it to
parameter list. This is a recursive function.
ASSUMPTIONS:
1) Leaf nodes will have EITHER a value OR attributes (and will not be missing
both, e.g. '<a/>').
2) Leaf nodes will never be r2ogs6_* objects
3) 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
4) Wrapper nodes are represented as lists
5) Parent nodes whose children have no children are represented as lists
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gml.R
\name{new_r2ogs6_gml}
\alias{new_r2ogs6_gml}
\title{new_r2ogs6_gml}
\usage{
new_r2ogs6_gml(name, points, polylines = NULL, surfaces = NULL)
}
\arguments{
\item{name}{The name of the geometry}
\item{points}{A tibble of points}
\item{polylines}{Optional: A list of polylines}
\item{surfaces}{Optional: A list of surfaces}
}
\description{
Constructor for S3 class new_r2ogs6_gml
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_in_utils.R
\name{node_to_r2ogs6_obj}
\alias{node_to_r2ogs6_obj}
\title{node_to_r2ogs6_obj}
\usage{
node_to_r2ogs6_obj(xml_node, xpath_expr, subclasses_names = character())
}
\arguments{
\item{xml_node}{An XML node (of class xml2::xml_node)}
\item{xpath_expr}{An XPath expression (for subclass differentiation)}
\item{subclasses_names}{Optional: A character vector containing the names of
r2ogs6 subclasses (r2ogs6 classes without a method for input_add)}
}
\description{
Takes an XML node and turns it into a class object
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gml.R
\name{r2ogs6_gml}
\alias{r2ogs6_gml}
\title{r2ogs6_gml}
\usage{
r2ogs6_gml(name, points, polylines = NULL, surfaces = NULL)
}
\arguments{
\item{name}{The name of the geometry}
\item{points}{A tibble of points}
\item{polylines}{Optional: A list of polylines}
\item{surfaces}{Optional: A list of surfaces}
}
\description{
S3 class describing the .gml file
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_in_gml.R
\name{read_in_gml}
\alias{read_in_gml}
\title{read_in_gml}
\usage{
read_in_gml(gml_path)
}
\arguments{
\item{gml_path}{The path to the geometry file that should be read in}
}
\description{
Wrapper function to read in a whole .gml file
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sim_utils.R
\name{read_in_output}
\alias{read_in_output}
\title{read_in_output}
\usage{
read_in_output(ogs6_obj)
}
\arguments{
\item{ogs6_obj}{OGS6: Simulation object}
}
\description{
After a OGS6 simulation was run, reads in the generated .vtu
files as new input for
the .prj file
}
% 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
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_in_vtu.R
\name{read_in_vtu}
\alias{read_in_vtu}
\title{read_in_vtu}
\usage{
read_in_vtu(vtu_path)
}
\arguments{
\item{vtu_path}{string: Path to .vtu file that should be read in}
}
\value{
OGS6_vtu: Mesh object
}
\description{
Wrapper function to read in a whole .vtu file as a OGS6_vtu
class object
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gml.R
\name{validate_r2ogs6_gml}
\alias{validate_r2ogs6_gml}
\title{validate_r2ogs6_gml}
\usage{
validate_r2ogs6_gml(r2ogs6_gml)
}
\arguments{
\item{r2ogs6_gml}{r2ogs6_gml:}
}
\description{
Validator for class r2ogs6_gml. Checks if the defined polylines
and surfaces reference existing points.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gml.R
\name{validate_surface_elements}
\alias{validate_surface_elements}
\title{validate_surface_elements}
\usage{
validate_surface_elements(surface_element_1, surface_element_2)
}
\arguments{
\item{surface_element_1}{numeric, length = 3}
\item{surface_element_2}{numeric, length = 3}
}
\description{
Helper function, checks if two numerical vectors of length 3
(two surface elements) each consist of 3 different elements and also have
exactly 2 matching elements between them which means they describe a valid
surface. You can think of the two vectors as two triangles, and the two
triangles together form a square which is our surface.
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment