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

[bugfix] .gmls are exported correctly again

parent ef5a3640
No related branches found
No related tags found
1 merge request!6Merge branch 7 fixed functionality into master
...@@ -31,6 +31,16 @@ export_gml <- function(gml, path) { ...@@ -31,6 +31,16 @@ export_gml <- function(gml, path) {
}) })
} }
# The points need an extra 'id' attribute
for(i in seq_len(length(points_list))){
points_list[[i]] <- c(points_list[[i]], id = (i - 1))
# Remove empty names
if(points_list[[i]][["name"]] == ""){
points_list[[i]][["name"]] <- NULL
}
}
xml2::xml_add_child(gml_xml, xml2::xml_add_child(gml_xml,
xml2::as_xml_document( xml2::as_xml_document(
to_node(points_list, to_node(points_list,
......
...@@ -13,7 +13,7 @@ export_prj <- function(ogs6_obj) { ...@@ -13,7 +13,7 @@ export_prj <- function(ogs6_obj) {
basenames <- lapply(ogs6_obj$meshes, function(x){basename(x)}) basenames <- lapply(ogs6_obj$meshes, function(x){basename(x)})
meshes_node <- to_node(basenames, "meshes") meshes_node <- to_node(basenames, "meshes")
}else{ }else{
meshes_node <- to_node(basename(ogs6_obj$meshes[[1]])) meshes_node <- to_node(basename(ogs6_obj$meshes[[1]]), "mesh")
} }
# First instantiate our big wrapper list # First instantiate our big wrapper list
......
...@@ -38,7 +38,7 @@ run_simulation <- function(ogs6_obj, write_logfile = TRUE) { ...@@ -38,7 +38,7 @@ run_simulation <- function(ogs6_obj, write_logfile = TRUE) {
# Copy all referenced .vtu files to ogs6_obj$sim_path # Copy all referenced .vtu files to ogs6_obj$sim_path
for(i in seq_len(length(ogs6_obj$meshes))){ for(i in seq_len(length(ogs6_obj$meshes))){
file.copy(ogs6_obj$meshes[[i]]$mesh_path, ogs6_obj$sim_path) file.copy(ogs6_obj$meshes[[i]], ogs6_obj$sim_path)
} }
# Construct the call # Construct the call
......
...@@ -260,6 +260,7 @@ get_obj_status <- function(flag, obj){ ...@@ -260,6 +260,7 @@ get_obj_status <- function(flag, obj){
is_optional_sim_component <- function(ogs6_parameter_name){ is_optional_sim_component <- function(ogs6_parameter_name){
optional_sim_components <- c("gml", optional_sim_components <- c("gml",
"vtus",
"local_coordinate_system", "local_coordinate_system",
"curves", "curves",
"search_length_algorithm", "search_length_algorithm",
......
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