From b8fad216e172b9275589a24ac36edadc8ce6314c Mon Sep 17 00:00:00 2001
From: aheinri5 <Anna@netzkritzler.de>
Date: Thu, 7 Jan 2021 18:11:29 +0100
Subject: [PATCH] [examples] Changed examples to fit new gml calls

---
 inst/examples/flow_free_expansion.R         |  4 ++--
 inst/examples/read_from_benchmark_example.R | 17 ++++++-----------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/inst/examples/flow_free_expansion.R b/inst/examples/flow_free_expansion.R
index 94279bd..95270b9 100644
--- a/inst/examples/flow_free_expansion.R
+++ b/inst/examples/flow_free_expansion.R
@@ -11,7 +11,7 @@ ogs6_obj <- OGS6$new(
 )
 
 
-pick_vtu_file(ogs6_obj)
+ogs6_obj$add_vtu(file.choose(), read_in_vtu = FALSE)
 
 
 ogs6_obj$add_gml(
@@ -93,7 +93,7 @@ ogs6_obj$add_process(
             secondary_variable = c(internal_name = "velocity", output_name = "velocity")
         ),
         specific_body_force = c(0, 0, 0),
-        constitutive_relation = list(
+        constitutive_relation = r2ogs6_constitutive_relation(
             type = "LinearElasticIsotropic",
             youngs_modulus = "E",
             poissons_ratio = "nu"
diff --git a/inst/examples/read_from_benchmark_example.R b/inst/examples/read_from_benchmark_example.R
index dcaa37f..cc5701f 100644
--- a/inst/examples/read_from_benchmark_example.R
+++ b/inst/examples/read_from_benchmark_example.R
@@ -8,7 +8,7 @@ library(r2ogs6)
 #===== SET UP SIMULATION OBJECT =====
 
 
-# If you run this, alter ogs_bin_path below to fit your installation location!
+# Set this option on your system:
 
 ogs_bin_path <- paste0("D:/Programme/OpenGeoSys/",
                        "ogs-6.3.2-Windows-10.0.14393-x64-python-3.7.2-de-utils",
@@ -24,16 +24,11 @@ ogs6_obj <- OGS6$new(sim_name = "my_sim",
 
 #===== READ IN .prj FILE =====
 
-
-# This will only work if the working directory is r2ogs6!
-
-prj_path <- paste0("inst/extdata/flow_free_expansion/flow_free_expansion.prj")
-
-# # Alternative path (also system dependent)
-# alt_path = paste0("D:\\Programme\\OpenGeoSys\\",
-#                   "ogs-master-Tests-Data-HydroMechanics\\",
-#                   "Tests\\Data\\HydroMechanics\\IdealGas\\",
-#                   "flow_no_strain\\flow_no_strain.prj")
+# (system dependent)
+prj_path = paste0("D:\\Programme\\OpenGeoSys\\",
+                  "ogs-master-Tests-Data\\",
+                  "Tests\\Data\\HydroMechanics\\IdealGas\\",
+                  "flow_no_strain\\flow_no_strain.prj")
 
 read_in_prj(ogs6_obj, prj_path)
 
-- 
GitLab