Skip to content
Snippets Groups Projects
Commit 21e53f50 authored by Johannes Boog's avatar Johannes Boog
Browse files

[base] additional xpath for prj_curve

parent da10371c
No related branches found
No related tags found
1 merge request!54[bugfix] make all OGS6 benchmarks work.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#' @export #' @export
prj_curve <- function(name, coords, values){ prj_curve <- function(name, coords, values){
#Coerce input if(missing(name)){ name <- NULL }
coords <- coerce_string_to_numeric(coords) coords <- coerce_string_to_numeric(coords)
values <- coerce_string_to_numeric(values) values <- coerce_string_to_numeric(values)
...@@ -22,14 +22,21 @@ prj_curve <- function(name, coords, values){ ...@@ -22,14 +22,21 @@ prj_curve <- function(name, coords, values){
new_prj_curve <- function(name, coords, values){ new_prj_curve <- function(name, coords, values){
assertthat::assert_that(assertthat::is.string(name)) if(!is.null(name)){
assertthat::assert_that(assertthat::is.string(name))
}
assertthat::assert_that(is.numeric(coords)) assertthat::assert_that(is.numeric(coords))
assertthat::assert_that(is.numeric(values)) assertthat::assert_that(is.numeric(values))
structure(list(name = name, structure(list(name = name,
coords = coords, coords = coords,
values = values, values = values,
xpath = "curves/curve", xpath = c("curves/curve",
paste0("processes/process/porous_medium/",
"porous_medium/capillary_pressure/curve"),
paste0("processes/process/material_property/",
"porous_medium/porous_medium/",
"capillary_pressure/curve")),
attr_names = character(), attr_names = character(),
flatten_on_exp = c("coords", "values") flatten_on_exp = c("coords", "values")
), ),
......
...@@ -144,16 +144,6 @@ new_prj_capillary_pressure <- function(type, ...@@ -144,16 +144,6 @@ new_prj_capillary_pressure <- function(type,
are_null_or_string_flags(has_regularized) are_null_or_string_flags(has_regularized)
is_null_or_coerce_names(curve, c("coords", "values"))
if(!is.null(curve)){
curve[[1]] <- coerce_string_to_numeric(curve[[1]])
curve[[2]] <- coerce_string_to_numeric(curve[[2]])
assertthat::assert_that(is.numeric(curve[[1]]))
assertthat::assert_that(is.numeric(curve[[2]]))
}
structure(list(type = type, structure(list(type = type,
pd = pd, pd = pd,
sr = sr, sr = sr,
......
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