Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ogs6_h5.R
\name{OGS6_h5}
\alias{OGS6_h5}
\title{wrapper for rhdf5::h5read()}
\description{
Small class to wrap \code{h5} data into the \code{r2ogs6} workflow.
}
\details{
OGS6_h5
NOTE: This is a beta-version and is only guaranteed to work
with the current three existing [benchmarks](https://doxygen.opengeosys.org/d9/d28/ogs_file_param__prj__time_loop__output__hdf.html)
that contain *.h5 files. More complicated files can always be handled
with the method \code{$get_h5} and may refer to the package \code{rhdf5}.
}
\examples{
## ------------------------------------------------
## Method `OGS6_h5$new`
## ------------------------------------------------
h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
## ------------------------------------------------
## Method `OGS6_h5$print`
## ------------------------------------------------
h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
ogs6_h5
\dontrun{ogs6_obj$h5s}
## ------------------------------------------------
## Method `OGS6_h5$get_h5`
## ------------------------------------------------
\dontrun{h5_list <- ogs6_obj$h5s[[1]]$get_h5("/times")}
## ------------------------------------------------
## Method `OGS6_h5$get_df`
## ------------------------------------------------
h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
df <- ogs6_h5$get_df("/t_0", "pressure")
\dontrun{df <- ogs6_obj$h5s[[1]]$get_df("/t_0", "pressure")}
}
\section{Active bindings}{
\if{html}{\out{<div class="r6-active-bindings">}}
\describe{
\item{\code{h5_path}}{Getter/setter for private parameter `.h5_path`}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{OGS6_h5$new()}}
\item \href{#method-print}{\code{OGS6_h5$print()}}
\item \href{#method-get_h5}{\code{OGS6_h5$get_h5()}}
\item \href{#method-get_df}{\code{OGS6_h5$get_df()}}
\item \href{#method-clone}{\code{OGS6_h5$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
This function will be called automatically after a
simulation is run to give an overview of the \code{h5} output data.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_h5$new(h5_path)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{h5_path}}{path to \code{*.h5} file.}
}
\if{html}{\out{</div>}}
}
\subsection{Examples}{
\if{html}{\out{<div class="r example copy">}}
\preformatted{h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-print"></a>}}
\if{latex}{\out{\hypertarget{method-print}{}}}
\subsection{Method \code{print()}}{
Overrides the default print method
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_h5$print()}\if{html}{\out{</div>}}
}
\subsection{Examples}{
\if{html}{\out{<div class="r example copy">}}
\preformatted{h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
ogs6_h5
\dontrun{ogs6_obj$h5s}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_h5"></a>}}
\if{latex}{\out{\hypertarget{method-get_h5}{}}}
\subsection{Method \code{get_h5()}}{
return a h5 object for further processing with the
\code{rhdf5} package.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_h5$get_h5(name = "/", ...)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{name}}{Optional: *character* that indicates the element of the h5
file to access. Default *"/"* will return the entire file as a list.}
\item{\code{...}}{Optional: Further arguments to be passed to the function
\code{h5read}.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A list of data elements or the element accessed with
\code{name}
}
\subsection{Examples}{
\if{html}{\out{<div class="r example copy">}}
\preformatted{\dontrun{h5_list <- ogs6_obj$h5s[[1]]$get_h5("/times")}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_df"></a>}}
\if{latex}{\out{\hypertarget{method-get_df}{}}}
\subsection{Method \code{get_df()}}{
Method to retrieve \code{HDF5} output as a \code{tibble}
assuming a standardized structure of \code{OGS6 HDF5} output.
times and geometry are added by default.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{OGS6_h5$get_df(group, names = "geometry")}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{group}}{*character*}
\item{\code{names}}{*character* names for a hdf5 element such as displayed
when printing the OGS5_h5 object, without the leading "/".}
}
\if{html}{\out{</div>}}
}
\subsection{Examples}{
\if{html}{\out{<div class="r example copy">}}
\preformatted{h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
df <- ogs6_h5$get_df("/t_0", "pressure")
\dontrun{df <- ogs6_obj$h5s[[1]]$get_df("/t_0", "pressure")}
}
\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_h5$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>}}
}
}
}