Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
r2ogs6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ogs
OpenGeoSys Tools
r2ogs6
Commits
5b17d1b3
Commit
5b17d1b3
authored
4 years ago
by
Ruben Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
[base] .pvd now gets read in after a simulation
parent
d5bb9093
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Merge branch 7 fixed functionality into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/sim_utils.R
+25
-19
25 additions, 19 deletions
R/sim_utils.R
with
25 additions
and
19 deletions
R/sim_utils.R
+
25
−
19
View file @
5b17d1b3
...
@@ -72,6 +72,12 @@ run_simulation <- function(ogs6_obj, write_logfile = TRUE) {
...
@@ -72,6 +72,12 @@ run_simulation <- function(ogs6_obj, write_logfile = TRUE) {
closeAllConnections
()
closeAllConnections
()
# Read in generated .pvd file and add it to ogs6_obj
pvd_path
<-
paste0
(
ogs6_obj
$
sim_path
,
ogs6_obj
$
time_loop
$
output
$
prefix
,
".pvd"
)
ogs6_obj
$
pvd
<-
OGS6_pvd
$
new
(
pvd_path
=
pvd_path
)
return
(
invisible
(
exit_code
))
return
(
invisible
(
exit_code
))
}
}
...
@@ -94,6 +100,23 @@ export_all_sim_files <- function(ogs6_obj){
...
@@ -94,6 +100,23 @@ export_all_sim_files <- function(ogs6_obj){
file.copy
(
ogs6_obj
$
geometry
,
ogs6_obj
$
sim_path
)
file.copy
(
ogs6_obj
$
geometry
,
ogs6_obj
$
sim_path
)
}
}
# If processes tag only contains reference, copy referenced file
if
(
names
(
ogs6_obj
$
processes
)[[
1
]]
==
"include"
){
include_dir
<-
paste0
(
ogs6_obj
$
sim_path
,
"include/"
)
if
(
!
dir.exists
(
include_dir
)){
dir.create
(
include_dir
)
}
file.copy
(
ogs6_obj
$
processes
[[
1
]][[
"file"
]],
include_dir
)
new_ref_path
<-
paste0
(
include_dir
,
basename
(
ogs6_obj
$
processes
[[
1
]][[
"file"
]]))
ogs6_obj
$
processes
<-
new_ref_path
}
# Copy all referenced .vtu files to ogs6_obj$sim_path
# Copy all referenced .vtu files to ogs6_obj$sim_path
lapply
(
ogs6_obj
$
meshes
,
function
(
x
){
lapply
(
ogs6_obj
$
meshes
,
function
(
x
){
file.copy
(
x
,
ogs6_obj
$
sim_path
)
file.copy
(
x
,
ogs6_obj
$
sim_path
)
...
@@ -248,13 +271,14 @@ run_all_benchmarks <- function(path,
...
@@ -248,13 +271,14 @@ run_all_benchmarks <- function(path,
)
)
}
}
# Read in valid .prj files and run simulations
# Read in valid .prj files and run simulations
exit_codes
<-
numeric
()
exit_codes
<-
numeric
()
failed_prj_paths
<-
character
()
failed_prj_paths
<-
character
()
for
(
i
in
seq_len
(
length
(
prj_paths
))){
for
(
i
in
seq_len
(
length
(
prj_paths
))){
cat
(
"\nAttempting to run Benchmark"
,
prj_paths
[[
i
]])
exit_code
<-
run_benchmark
(
prj_path
=
prj_paths
[[
i
]],
exit_code
<-
run_benchmark
(
prj_path
=
prj_paths
[[
i
]],
ogs_bin_path
=
ogs_bin_path
,
ogs_bin_path
=
ogs_bin_path
,
sim_path
=
sim_path
)
sim_path
=
sim_path
)
...
@@ -276,21 +300,3 @@ run_all_benchmarks <- function(path,
...
@@ -276,21 +300,3 @@ run_all_benchmarks <- function(path,
exit_codes
=
exit_codes
,
exit_codes
=
exit_codes
,
failed_prj_paths
=
failed_prj_paths
)))
failed_prj_paths
=
failed_prj_paths
)))
}
}
#===== Chaining utility (WIP) =====
#'read_in_output
#'@description After a OGS6 simulation was run, reads in the generated .vtu
#' files as new input for
#' the .prj file
#'@param ogs6_obj A OGS6 class object
read_in_output
<-
function
(
ogs6_obj
)
{
#....WIP
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment