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

[base] Added a class for meshes (WIP)

parent e3a64316
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
# Functions for adding .vtu data to a OGS6 simulation object
#'r2ogs6_mesh
#'@description Wrapper class, so far only has a reference to a .vtu file
#'@param mesh_ref A reference to a .vtu file
#'@export
r2ogs6_mesh <- function(mesh_ref){
new_r2ogs6_mesh(mesh_ref)
}
new_r2ogs6_mesh <- function(mesh_ref){
assertthat::assert_that(assertthat::is.string(mesh_ref))
structure(
list(
mesh_ref = mesh_ref
),
class = "r2ogs6_mesh"
)
}
#'as_node.r2ogs6_curve
#'@description Implementation of generic function as_node for S3 class r2ogs6_mesh
#'@param x A r2ogs6_mesh class object
as_node.r2ogs6_mesh <- function(x){
node <- list(mesh = structure(list(x$mesh_ref)))
return(node)
}
#'generate_structured_mesh
#'@description Wrapper function to call generateStructuredMesh.exe (VTK mesh generator).
#'For full documentation see https://www.opengeosys.org/docs/tools/meshing/structured-mesh-generation/
......@@ -29,7 +59,7 @@ generate_structured_mesh = function(ogs6_obj, call_str) {
system(command = paste0(ogs6_obj$ogs_bin_path, "generateStructuredMesh.exe",
" -o ", mesh_output_file, " ", call_str))
ogs6_obj$add_mesh(mesh_output_file_name)
ogs6_obj$add_mesh(r2ogs6_mesh(mesh_output_file_name))
return(invisible(mesh_output_file_name))
}
\ No newline at end of file
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