wrapper for rhdf5::h5read()
OGS6_h5.Rd
Small class to wrap h5
data into the 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 $get_h5
and may refer to the package rhdf5
.
Methods
Method new()
This function will be called automatically after a
simulation is run to give an overview of the h5
output data.
Usage
OGS6_h5$new(h5_path)
Examples
h5_path <- system.file("/extdata/benchmarks/EllipticPETSc",
"cube_1e3_np3.h5",
package = "r2ogs6")
ogs6_h5 <- OGS6_h5$new(h5_path)
Method print()
Overrides the default print method
Method get_h5()
return a h5 object for further processing with the
rhdf5
package.
Method get_df()
Method to retrieve HDF5
output as a tibble
assuming a standardized structure of OGS6 HDF5
output.
times and geometry are added by default.
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
#> OGS6_h5
#> h5 path:
#> /tmp/RtmpNztizb/temp_libpath54db57f01be4/r2ogs6//extdata/benchmarks/EllipticPETSc/cube_1e3_np3.h5
#>
#> # h5 file structure ------------------------------------------------------------
#> group name otype dclass dim
#> 0 / t_0 H5I_GROUP
#> 1 /t_0 D1_left_front_N1_right H5I_DATASET FLOAT 1895
#> 2 /t_0 Linear_1_to_minus1 H5I_DATASET FLOAT 1895
#> 3 /t_0 MaterialIDs H5I_DATASET INTEGER 1233
#> 4 /t_0 geometry H5I_DATASET FLOAT 3 x 1895
#> 5 /t_0 pressure H5I_DATASET FLOAT 1895
#> 6 /t_0 topology H5I_DATASET INTEGER 11097
#> 7 /t_0 v H5I_DATASET FLOAT 3 x 1895
#> 8 / t_1 H5I_GROUP
#> 9 /t_1 pressure H5I_DATASET FLOAT 1895
#> 10 /t_1 v H5I_DATASET FLOAT 3 x 1895
if (FALSE) ogs6_obj$h5s
## ------------------------------------------------
## Method `OGS6_h5$get_h5`
## ------------------------------------------------
if (FALSE) 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")
if (FALSE) df <- ogs6_obj$h5s[[1]]$get_df("/t_0", "pressure")