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

[base] Moved validation in OGS6 class

parent f782f261
No related branches found
No related tags found
1 merge request!2Basic import and export functionality
...@@ -30,7 +30,25 @@ OGS6 <- R6::R6Class("OGS6", ...@@ -30,7 +30,25 @@ OGS6 <- R6::R6Class("OGS6",
assertthat::assert_that(assertthat::is.string(ogs_bin_path)) assertthat::assert_that(assertthat::is.string(ogs_bin_path))
if(!test_mode){ if(!test_mode){
validate_paths(sim_path, ogs_bin_path) sim_path <- validate_is_dir_path(sim_path)
ogs_bin_path <- validate_is_dir_path(ogs_bin_path)
if(!dir.exists(sim_path)){
dir.create(sim_path)
}else{
if(length(dir(sim_path, all.files = TRUE)) != 0){
warning(paste0("The defined sim_path directory '",
sim_path,
"' is not empty. Files may be overwritten."),
call. = FALSE)
}
}
if(!file.exists(paste0(ogs_bin_path, "generateStructuredMesh.exe"))) {
stop(paste("Could not find executable file",
"generateStructuredMesh.exe at location",
ogs_bin_path), call. = FALSE)
}
} }
private$.sim_output <- list() private$.sim_output <- list()
......
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