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
8553f59b
Commit
8553f59b
authored
2 years ago
by
Johannes Boog
Browse files
Options
Downloads
Patches
Plain Diff
[test] read and export msh files
parent
bc47cefc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!50
Add support for mesh files in MSH format
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/testthat/test-export_prj.R
+26
-0
26 additions, 0 deletions
tests/testthat/test-export_prj.R
tests/testthat/test-read_in_prj.R
+18
-1
18 additions, 1 deletion
tests/testthat/test-read_in_prj.R
with
44 additions
and
1 deletion
tests/testthat/test-export_prj.R
+
26
−
0
View file @
8553f59b
...
...
@@ -97,6 +97,32 @@ test_that("export_prj works for referenced *.dat files", {
unlink
(
test_path
,
recursive
=
TRUE
)
})
test_that
(
"export_prj works for referenced *.msh files"
,
{
# Get extdata directory and create folder for the test
extdata_path
<-
system.file
(
"extdata/"
,
package
=
"r2ogs6"
)
test_path
<-
paste0
(
extdata_path
,
"/export_prj_test"
)
dir.create
(
test_path
)
# Define prj_path and OGS6 object, then read in .prj file
ogs6_obj
<-
OGS6
$
new
(
sim_name
=
"t1_1Dsource"
,
sim_path
=
test_path
)
prj_path
<-
system.file
(
"extdata/benchmarks/t1_1Dsource"
,
"t1_1Dsource.prj"
,
package
=
"r2ogs6"
)
suppressWarnings
(
read_in_prj
(
ogs6_obj
,
prj_path
,
read_in_gml
=
F
))
# test with copying referenced files
export_prj
(
ogs6_obj
,
copy_ext_files
=
T
)
expect_equal
(
sort
(
list.files
(
ogs6_obj
$
sim_path
)),
sort
(
c
(
"t1_1Dsource.gml"
,
"t1_1Dsource.msh"
,
"t1_1Dsource.prj"
)))
# Tidy up by deleting the folder we created
unlink
(
test_path
,
recursive
=
TRUE
)
})
test_that
(
"export_prj works for process$include"
,
{
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-read_in_prj.R
+
18
−
1
View file @
8553f59b
...
...
@@ -275,7 +275,7 @@ test_that("read_in works for python_script objects", {
})
test_that
(
"read_in works for geometry and
vtu
meshes"
,
{
test_that
(
"read_in works for geometry and meshes"
,
{
# read gml, vtu
prj_base_path
<-
system.file
(
...
...
@@ -317,6 +317,23 @@ test_that("read_in works for geometry and vtu meshes", {
expect_equal
(
ogs6_obj
$
meshes
[[
2
]]
$
path
,
vtu_path2
)
expect_equal
(
ogs6_obj
$
meshes
[[
3
]]
$
path
,
vtu_path3
)
expect_equal
(
ogs6_obj
$
meshes
[[
4
]]
$
path
,
vtu_path4
)
# read msh
prj_base_path
<-
system.file
(
"extdata/benchmarks/t1_1Dsource"
,
package
=
"r2ogs6"
)
prj_path
<-
paste0
(
prj_base_path
,
"/t1_1Dsource.prj"
)
gml_path
<-
paste0
(
prj_base_path
,
"/t1_1Dsource.gml"
)
msh_path
<-
paste0
(
prj_base_path
,
"/t1_1Dsource.msh"
)
ogs6_obj
<-
OGS6
$
new
(
sim_name
=
"sim"
,
sim_path
=
"sim_path"
)
suppressWarnings
(
read_in_prj
(
ogs6_obj
,
prj_path
,
read_in_gml
=
F
))
expect_equal
(
ogs6_obj
$
geometry
,
gml_path
)
expect_equal
(
ogs6_obj
$
meshes
$
mesh
$
path
,
msh_path
)
rm
(
ogs6_obj
)
})
test_that
(
"read_in works for chemical_system objects"
,
{
...
...
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