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

[docs] Updated documentation for added validation functions

parent c271544d
No related branches found
No related tags found
4 merge requests!57 vtkdiff,!47 parameter,!37 process borehole heat exchanger,!2Basic import and export functionality
Showing
with 322 additions and 24 deletions
......@@ -13,8 +13,10 @@ Constructor for the OGS6 base class
\item \href{#method-add_sim_output}{\code{OGS6$add_sim_output()}}
\item \href{#method-add_mesh}{\code{OGS6$add_mesh()}}
\item \href{#method-add_gml}{\code{OGS6$add_gml()}}
\item \href{#method-add_python_script}{\code{OGS6$add_python_script()}}
\item \href{#method-add_process}{\code{OGS6$add_process()}}
\item \href{#method-add_time_loop}{\code{OGS6$add_time_loop()}}
\item \href{#method-add_local_coordinate_system}{\code{OGS6$add_local_coordinate_system()}}
\item \href{#method-add_medium}{\code{OGS6$add_medium()}}
\item \href{#method-add_parameter}{\code{OGS6$add_parameter()}}
\item \href{#method-add_curve}{\code{OGS6$add_curve()}}
......@@ -22,6 +24,7 @@ Constructor for the OGS6 base class
\item \href{#method-add_nonlinear_solver}{\code{OGS6$add_nonlinear_solver()}}
\item \href{#method-add_linear_solver}{\code{OGS6$add_linear_solver()}}
\item \href{#method-add_vtkdiff}{\code{OGS6$add_vtkdiff()}}
\item \href{#method-add_insitu}{\code{OGS6$add_insitu()}}
\item \href{#method-get_status}{\code{OGS6$get_status()}}
\item \href{#method-clear}{\code{OGS6$clear()}}
\item \href{#method-clone}{\code{OGS6$clone()}}
......@@ -42,12 +45,13 @@ Constructor for the OGS6 base class
\item{\code{sim_id}}{The ID of the simulation}
\item{\code{sim_path}}{The path where all relevant files for the simulation will be saved}
\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 :)}
\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>}}
}
......@@ -78,6 +82,15 @@ a developer, please leave this variable as it is :)}
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_gml(gml)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-add_python_script"></a>}}
\if{latex}{\out{\hypertarget{method-add_python_script}{}}}
\subsection{Method \code{add_python_script()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_python_script(python_script)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-add_process"></a>}}
......@@ -96,6 +109,15 @@ a developer, please leave this variable as it is :)}
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_time_loop(time_loop)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-add_local_coordinate_system"></a>}}
\if{latex}{\out{\hypertarget{method-add_local_coordinate_system}{}}}
\subsection{Method \code{add_local_coordinate_system()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_local_coordinate_system(local_coordinate_system)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-add_medium"></a>}}
......@@ -159,6 +181,15 @@ a developer, please leave this variable as it is :)}
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_vtkdiff(vtkdiff)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-add_insitu"></a>}}
\if{latex}{\out{\hypertarget{method-add_insitu}{}}}
\subsection{Method \code{add_insitu()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6$add_insitu(insitu)}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_status"></a>}}
......@@ -174,11 +205,7 @@ a developer, please leave this variable as it is :)}
\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{<div class="r">}}\preformatted{OGS6$clear(which = names(get_implemented_classes()))}\if{html}{\out{</div>}}
}
}
......
......@@ -4,18 +4,30 @@
\alias{analyse_xml}
\title{analyse_xml}
\usage{
analyse_xml(path, pattern, element_name)
analyse_xml(
path,
pattern,
element_name,
xpath_prefix = "//",
print_findings = TRUE
)
}
\arguments{
\item{path}{A path}
\item{path}{string: A path}
\item{pattern}{A regex pattern}
\item{pattern}{string: A regex pattern}
\item{element_name}{The name of the XML element to look for}
\item{element_name}{string: The name of the XML element to look for}
\item{xpath_prefix}{string: Optional: The XPath prefix to use
(defaults to "//")}
\item{print_findings}{Optional: Should the results be printed to the console?}
}
\description{
This is a helper function which can be used to combat missing documentation. It looks
for files in a path which match the given pattern and then attempts to parse them as XML.
For each occurence of the specified element, it documents its attributes and direct children and prints a little
summary of its findings at the end.
This is a helper function which can be used to combat missing
documentation. It looks for files in a path which match the given pattern
and then attempts to parse them as XML. For each occurence of the specified
element, it documents its attributes and direct children and prints a little
summary of its findings at the end.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{coerce_string_to_numeric}
\alias{coerce_string_to_numeric}
\title{coerce_string_to_numeric}
\usage{
coerce_string_to_numeric(obj, split = FALSE)
}
\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.
}
% 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}{The URL of a .prj file}
\item{path}{The 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)
}
......@@ -10,8 +10,10 @@ find_read_in_func_call(node_name)
\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
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
Checks if a custom read_in function was defined for nodes
with the given name
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{flags_to_assign_str}
\alias{flags_to_assign_str}
\title{flags_to_assign_str}
\usage{
flags_to_assign_str(flags, print_result = FALSE)
}
\arguments{
\item{flags}{vector: Flags}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a string out of a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{flags_to_con_call_str}
\alias{flags_to_con_call_str}
\title{flags_to_con_call_str}
\usage{
flags_to_con_call_str(flags, print_result = FALSE)
}
\arguments{
\item{flags}{vector: Flags}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a string out of a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{flags_to_con_str}
\alias{flags_to_con_str}
\title{flags_to_con_str}
\usage{
flags_to_con_str(flags, print_result = FALSE)
}
\arguments{
\item{flags}{vector: Flags}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a string out of a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{flags_to_doc_str}
\alias{flags_to_doc_str}
\title{flags_to_doc_str}
\usage{
flags_to_doc_str(flags, print_result = FALSE)
}
\arguments{
\item{flags}{vector: Flags}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a string out of a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{flags_to_name_str}
\alias{flags_to_name_str}
\title{flags_to_name_str}
\usage{
flags_to_name_str(flags, print_result = FALSE)
}
\arguments{
\item{flags}{vector: Flags}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a name string out of a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{generate_active_field}
\alias{generate_active_field}
\title{generate_active_field}
\usage{
generate_active_field(parameter_name)
}
\arguments{
\item{parameter_name}{The name of the OGS6 class parameter}
}
\description{
Helper function to generate an R6 active field for a OGS6 class
parameter
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{generate_add_method}
\alias{generate_add_method}
\title{generate_add_method}
\usage{
generate_add_method(tag_name, parent_tag_name)
}
\arguments{
\item{tag_name}{The tag name of the XML element represented by the class
object}
\item{parent_tag_name}{The tag name of the parent of the XML element
represented by the class object}
}
\description{
Helper function to generate an R6 add_* method for a
r2ogs6 class object
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_benchmark_script.R
\name{generate_all_benchmarks}
\alias{generate_all_benchmarks}
\title{generate_all_benchmarks}
\usage{
generate_all_benchmarks(
path = "extdata/benchmarks/",
dest_dir = "extdata/benchmark_scripts/"
)
}
\arguments{
\item{path}{Optional: A path to a benchmark directory to generate scripts from
(defaults to 'extdata/benchmarks' package folder)}
\item{dest_dir}{Optional: The directory to write the scripts to
(defaults to 'extdata/benchmark_scripts' package folder)}
}
\description{
Collector function to generate benchmarks from all .prj files in a directory
}
......@@ -4,7 +4,7 @@
\alias{generate_benchmark_script}
\title{generate_benchmark_script}
\usage{
generate_benchmark_script(prj_path, dest_dir = "")
generate_benchmark_script(prj_path, dest_dir = "extdata/benchmark_scripts/")
}
\arguments{
\item{prj_path}{The path to the project file the script will be based on}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{generate_constructor}
\alias{generate_constructor}
\title{generate_constructor}
\usage{
generate_constructor(tag_name, param_flags, prefix = "", print_result = FALSE)
}
\arguments{
\item{tag_name}{The name of the XML element the class will be based on}
\item{param_flags}{The parameters for the class and if they are required or
not (i.e. 'c(a = TRUE, b = FALSE)')}
\item{prefix}{Optional: For subclasses whose represented elements have
the same tag name as an element for which a class was already specified,
a prefix must be appended to the class name}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a constructor out of a tag name
and a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_class.R
\name{generate_helper}
\alias{generate_helper}
\title{generate_helper}
\usage{
generate_helper(tag_name, param_flags, prefix = "", print_result = FALSE)
}
\arguments{
\item{tag_name}{The name of the XML element the helper will be based on}
\item{param_flags}{The parameters for the class and if they are required or
not (i.e. 'c(a = TRUE, b = FALSE)')}
\item{prefix}{Optional: For subclasses whose represented elements have
the same tag name as an element for which a class was already specified,
a prefix must be appended to the class name}
\item{print_result}{flag: Should the result be printed to the console?}
}
\description{
Helper function to generate a helper out of a tag name
and a flag vector
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{get_class_tag_name}
\alias{get_class_tag_name}
\title{get_class_tag_name}
\usage{
get_class_tag_name(class_name)
}
\arguments{
\item{class_name}{string: The name of a r2ogs6 class}
}
\value{
string: The tag name corresponding to class_name
}
\description{
Utility function, returns the tag name of a r2ogs6 class
}
......@@ -10,9 +10,10 @@ get_grandchild_length_vector(xml_node)
\item{xml_node}{An XML node}
}
\value{
A numeric vector containing the number of children of each child of xml_node
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)
Helper function to check the number of children of children of
an XML node (i.e. grandchildren)
}
% 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>
}
......@@ -13,8 +13,9 @@ get_list_status(flag, obj_list, element_type = "list element", is_opt = FALSE)
\item{element_type}{Optional: What kind of elements are in the list?}
\item{is_opt}{Does the list need at least one element?}
\item{is_opt}{flag: Does the list need at least one element?}
}
\description{
Helper function for get_status() to check if a list has at least one element.
Helper function for get_status() to check if a list has at least
one element.
}
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