From a8bd8b5cdc8b889f1437a30e58ec6ee46c189c0d Mon Sep 17 00:00:00 2001
From: aheinri5 <Anna@netzkritzler.de>
Date: Tue, 24 Nov 2020 09:22:21 +0100
Subject: [PATCH] [docs] Added documentation for new functions

---
 man/OGS6.Rd                         | 19 ++++++++++++++++++-
 man/find_read_in_func_call.Rd       | 17 +++++++++++++++++
 man/get_grandchild_length_vector.Rd | 18 ++++++++++++++++++
 man/guess_structure.Rd              |  2 +-
 man/is_het_wrapper.Rd               | 17 +++++++++++++++++
 man/list_from_nodeset.Rd            | 14 ++++++++++++++
 man/make_call_from_parameters.Rd    | 17 +++++++++++++++++
 man/node_to_r2ogs6_obj.Rd           |  2 +-
 man/r2ogs6_parameter.Rd             |  6 ++++--
 man/read_in.Rd                      |  2 +-
 man/read_in_timesteps_node.Rd       | 14 ++++++++++++++
 man/run_simulation.Rd               |  4 +++-
 12 files changed, 125 insertions(+), 7 deletions(-)
 create mode 100644 man/find_read_in_func_call.Rd
 create mode 100644 man/get_grandchild_length_vector.Rd
 create mode 100644 man/is_het_wrapper.Rd
 create mode 100644 man/list_from_nodeset.Rd
 create mode 100644 man/make_call_from_parameters.Rd
 create mode 100644 man/read_in_timesteps_node.Rd

diff --git a/man/OGS6.Rd b/man/OGS6.Rd
index 6a231ae..23dd355 100644
--- a/man/OGS6.Rd
+++ b/man/OGS6.Rd
@@ -23,6 +23,7 @@ Constructor for the OGS6 base class
 \item \href{#method-add_linear_solver}{\code{OGS6$add_linear_solver()}}
 \item \href{#method-add_vtkdiff}{\code{OGS6$add_vtkdiff()}}
 \item \href{#method-get_status}{\code{OGS6$get_status()}}
+\item \href{#method-clear}{\code{OGS6$clear()}}
 \item \href{#method-clone}{\code{OGS6$clone()}}
 }
 }
@@ -31,7 +32,7 @@ Constructor for the OGS6 base class
 \if{latex}{\out{\hypertarget{method-new}{}}}
 \subsection{Method \code{new()}}{
 \subsection{Usage}{
-\if{html}{\out{<div class="r">}}\preformatted{OGS6$new(sim_name, sim_id, sim_path, ogs_bin_path)}\if{html}{\out{</div>}}
+\if{html}{\out{<div class="r">}}\preformatted{OGS6$new(sim_name, sim_id, sim_path, ogs_bin_path, test_mode = FALSE)}\if{html}{\out{</div>}}
 }
 
 \subsection{Arguments}{
@@ -44,6 +45,9 @@ Constructor for the OGS6 base class
 \item{\code{sim_path}}{The path where all relevant files for the simulation will be saved}
 
 \item{\code{ogs_bin_path}}{Path to OpenGeoSys6 /bin directory}
+
+\item{\code{test_mode}}{In test mode, sim_path and ogs_bin_path will not be validated. If you're not
+a developer, please leave this variable as it is :)}
 }
 \if{html}{\out{</div>}}
 }
@@ -164,6 +168,19 @@ Constructor for the OGS6 base class
 \if{html}{\out{<div class="r">}}\preformatted{OGS6$get_status()}\if{html}{\out{</div>}}
 }
 
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-clear"></a>}}
+\if{latex}{\out{\hypertarget{method-clear}{}}}
+\subsection{Method \code{clear()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{OGS6$clear(
+  which = c("meshes", "geometry", "processes", "time_loop", "media", "parameters",
+    "curves", "process_variables", "nonlinear_solvers", "linear_solvers",
+    "test_definition")
+)}\if{html}{\out{</div>}}
+}
+
 }
 \if{html}{\out{<hr>}}
 \if{html}{\out{<a id="method-clone"></a>}}
diff --git a/man/find_read_in_func_call.Rd b/man/find_read_in_func_call.Rd
new file mode 100644
index 0000000..d0799fd
--- /dev/null
+++ b/man/find_read_in_func_call.Rd
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_utils.R
+\name{find_read_in_func_call}
+\alias{find_read_in_func_call}
+\title{find_read_in_func_call}
+\usage{
+find_read_in_func_call(node_name)
+}
+\arguments{
+\item{node_name}{The name of an XML node}
+}
+\value{
+A ready-to-call string if a corresponding function was found, an empty string otherwise
+}
+\description{
+Checks if a custom read_in function was defined for nodes with the given name
+}
diff --git a/man/get_grandchild_length_vector.Rd b/man/get_grandchild_length_vector.Rd
new file mode 100644
index 0000000..b109f12
--- /dev/null
+++ b/man/get_grandchild_length_vector.Rd
@@ -0,0 +1,18 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_utils.R
+\name{get_grandchild_length_vector}
+\alias{get_grandchild_length_vector}
+\title{get_grandchild_length_vector}
+\usage{
+get_grandchild_length_vector(xml_node)
+}
+\arguments{
+\item{xml_node}{An XML node}
+}
+\value{
+A numeric vector containing the number of children of each child of xml_node
+}
+\description{
+Helper function to check the number of children of children of an XML node
+(i.e. grandchildren)
+}
diff --git a/man/guess_structure.Rd b/man/guess_structure.Rd
index 227acea..2da20e7 100644
--- a/man/guess_structure.Rd
+++ b/man/guess_structure.Rd
@@ -4,7 +4,7 @@
 \alias{guess_structure}
 \title{guess_structure}
 \usage{
-guess_structure(xml_node, subclasses_names = NULL)
+guess_structure(xml_node, subclasses_names = character())
 }
 \arguments{
 \item{xml_node}{An XML node (of class xml2::xml_node)}
diff --git a/man/is_het_wrapper.Rd b/man/is_het_wrapper.Rd
new file mode 100644
index 0000000..2310d29
--- /dev/null
+++ b/man/is_het_wrapper.Rd
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_utils.R
+\name{is_het_wrapper}
+\alias{is_het_wrapper}
+\title{is_het_wrapper}
+\usage{
+is_het_wrapper(xml_node, subclasses_names = character())
+}
+\arguments{
+\item{xml_node}{An XML node (of class xml2::xml_node)}
+
+\item{subclasses_names}{Optional: A character vector containing the names of r2ogs6_*
+subclasses (r2ogs6_* classes without a method for input_add)}
+}
+\description{
+Tests if a node is a heterogenous wrapper
+}
diff --git a/man/list_from_nodeset.Rd b/man/list_from_nodeset.Rd
new file mode 100644
index 0000000..77175d5
--- /dev/null
+++ b/man/list_from_nodeset.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_utils.R
+\name{list_from_nodeset}
+\alias{list_from_nodeset}
+\title{list_from_nodeset}
+\usage{
+list_from_nodeset(xml_nodeset)
+}
+\arguments{
+\item{xml_nodeset}{An XML nodeset (of class xml2::xml_nodeset)}
+}
+\description{
+Creates a named vector from a nodeset
+}
diff --git a/man/make_call_from_parameters.Rd b/man/make_call_from_parameters.Rd
new file mode 100644
index 0000000..f7bcc26
--- /dev/null
+++ b/man/make_call_from_parameters.Rd
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_utils.R
+\name{make_call_from_parameters}
+\alias{make_call_from_parameters}
+\title{make_call_from_parameters}
+\usage{
+make_call_from_parameters(class_name, parameters)
+}
+\arguments{
+\item{class_name}{Which class constructor should be called?}
+
+\item{parameters}{A named list of parameters}
+}
+\description{
+Helper function to construct a call from a class name and a
+list of class parameters
+}
diff --git a/man/node_to_r2ogs6_obj.Rd b/man/node_to_r2ogs6_obj.Rd
index 0c15db5..2a0debd 100644
--- a/man/node_to_r2ogs6_obj.Rd
+++ b/man/node_to_r2ogs6_obj.Rd
@@ -4,7 +4,7 @@
 \alias{node_to_r2ogs6_obj}
 \title{node_to_r2ogs6_obj}
 \usage{
-node_to_r2ogs6_obj(xml_node, subclasses_names = NULL)
+node_to_r2ogs6_obj(xml_node, subclasses_names = character())
 }
 \arguments{
 \item{xml_node}{An XML node (of class xml2::xml_node)}
diff --git a/man/r2ogs6_parameter.Rd b/man/r2ogs6_parameter.Rd
index cc98811..bc9c7d1 100644
--- a/man/r2ogs6_parameter.Rd
+++ b/man/r2ogs6_parameter.Rd
@@ -4,14 +4,16 @@
 \alias{r2ogs6_parameter}
 \title{r2ogs6_parameter}
 \usage{
-r2ogs6_parameter(name, type, values)
+r2ogs6_parameter(name, type, values = NULL, value = NULL)
 }
 \arguments{
 \item{name}{The parameter name}
 
 \item{type}{The parameter type}
 
-\item{values}{The parameter values}
+\item{values}{Optional: The parameter values}
+
+\item{value}{Optional: The parameter value}
 }
 \description{
 S3 class describing a .prj parameter
diff --git a/man/read_in.Rd b/man/read_in.Rd
index 6b40163..74e2606 100644
--- a/man/read_in.Rd
+++ b/man/read_in.Rd
@@ -10,7 +10,7 @@ read_in(
   element_name,
   child_name,
   selection_vector = NULL,
-  subclasses_names = NULL
+  subclasses_names = character()
 )
 }
 \arguments{
diff --git a/man/read_in_timesteps_node.Rd b/man/read_in_timesteps_node.Rd
new file mode 100644
index 0000000..6aee261
--- /dev/null
+++ b/man/read_in_timesteps_node.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/read_in_prj.R
+\name{read_in_timesteps_node}
+\alias{read_in_timesteps_node}
+\title{read_in_timesteps_node}
+\usage{
+read_in_timesteps_node(timesteps_node)
+}
+\arguments{
+\item{timesteps_node}{The timesteps node}
+}
+\description{
+Reads in a timesteps node
+}
diff --git a/man/run_simulation.Rd b/man/run_simulation.Rd
index 64ee180..9a3a1b1 100644
--- a/man/run_simulation.Rd
+++ b/man/run_simulation.Rd
@@ -4,12 +4,14 @@
 \alias{run_simulation}
 \title{run_simulation}
 \usage{
-run_simulation(ogs6_obj, iter_n = 1)
+run_simulation(ogs6_obj, iter_n = 1, output_to_log_file = TRUE)
 }
 \arguments{
 \item{ogs6_obj}{A OGS6 class object}
 
 \item{iter_n}{The number of iterations (for simulation chains)}
+
+\item{output_to_log_file}{Should the output be written to a log file?}
 }
 \description{
 Calls OGS6 object validator functions, exports all necessary files and starts OpenGeoSys6
-- 
GitLab