Skip to content
Snippets Groups Projects

Add support for mesh files in MSH format

Merged Johannes Boog requested to merge 67-feat_msh-file-support into master
1 file
+ 41
0
Compare changes
  • Side-by-side
  • Inline
R/ogs6_msh.R 0 → 100644
+ 41
0
#' OGS6_msh
#' @description Small class to support \code{MSH} mesh files. Note that
#' MSH files are a legacy format from OGS5. It is recommended to switch to VTU
#' files.
#' @export
OGS6_msh <- R6::R6Class("OGS6_msh",
public = list(
#' @description reates new OGS6_vtu object..
#' @param msh_path path to \code{*.msh} file.
initialize = function(msh_path) {
assertthat::is.string(msh_path)
assertthat::assert_that(file.exists(msh_path))
private$.msh_path <- msh_path
},
#' @description Overrides the default print method
print = function(){
cat("OGS6_msh\n")
cat("msh path:\n")
cat(private$.msh_path, "\n\n")
invisible(self)
}
),
# === active fields
active = list(
#' @field msh_path
#' Getter/setter for private parameter `.msh_path`
msh_path = function(value) {
if (missing(value)) {
private$.msh_path
} else {
assertthat::assert_that(assertthat::is.string(value))
private$.msh_path <- value
}
}
),
private = list(
.msh_path = NULL
)
)
\ No newline at end of file
Loading