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

[bugfix] added function for mesh tag export

parent 284d9202
No related branches found
No related tags found
1 merge request!20Resolve "Prepare package for installation"
......@@ -174,3 +174,38 @@ to_node <- function(object, object_name = "",
return(invisible(object_node))
}
}
#===== meshes_to_xml =====
#' meshes_to_xml
#' @description
#' Helper function for a mesh element of a .prj file.
#' @param meshes list: List of meshes
#' @noRd
meshes_to_xml <- function(meshes){
meshes_doc <- xml2::read_xml("<meshes/>")
xml_children <- lapply(meshes, function(x){
if(x[["axially_symmetric"]]){
xml2::as_xml_document(
list(mesh = structure(list(basename(x[["path"]])),
axially_symmetric = "true")))
}else{
xml2::as_xml_document(
list(mesh = list(basename(x[["path"]]))))
}
})
if(length(meshes) == 1){
return(xml_children[[1]])
}else{
for(i in seq_len(length(xml_children))){
xml2::xml_add_child(meshes_doc, xml_children[[i]])
}
return(meshes_doc)
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_ogs6.R
\name{ogs6_download_ogs6}
\alias{ogs6_download_ogs6}
\title{Download OpenGeoSys 6}
\usage{
ogs6_download_ogs6(path, os, set_as_default_bin_path = TRUE)
}
\arguments{
\item{path}{String: Download path. Defaults to ...}
\item{os}{String: Operating System.}
\item{set_as_default_bin_path}{flag: Defaults to `TRUE`}
}
\description{
Downloads latest prebuilt OpenGeoSys 6 version
}
......@@ -44,9 +44,21 @@ test_that("OGS6_Ensemble initialization works", {
)
expect_equal(length(ogs6_ens_seq_noper$ensemble), 4)
expect_equal(ogs6_ens_seq_noper$ensemble[[1]]$parameters[[1]]$value, 2)
expect_equal(ogs6_ens_seq_noper$ensemble[[1]]$parameters[[2]]$value, 4)
expect_equal(ogs6_ens_seq_noper$ensemble[[2]]$parameters[[1]]$value, 3)
expect_equal(ogs6_ens_seq_noper$ensemble[[2]]$parameters[[2]]$value, 4)
expect_equal(ogs6_ens_seq_noper$ensemble[[3]]$parameters[[1]]$value, 1)
expect_equal(ogs6_ens_seq_noper$ensemble[[3]]$parameters[[2]]$value, 5)
expect_equal(ogs6_ens_seq_noper$ensemble[[4]]$parameters[[1]]$value, 1)
expect_equal(ogs6_ens_seq_noper$ensemble[[4]]$parameters[[2]]$value, 6)
# Test with sequential_mode off and percentages_mode on
ogs6_ens_noseq_per <- OGS6_Ensemble$new(
ogs6_obj = ogs6_obj,
......
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