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
7f8d5feb
Commit
7f8d5feb
authored
3 years ago
by
Johannes Boog
Browse files
Options
Downloads
Patches
Plain Diff
[tests] create absolute reference when read_in includes, gml, vtu meshes
parent
789c08c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!41
standardize files references during prj import/export (new MR)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testthat/test-read_in_prj.R
+49
-3
49 additions, 3 deletions
tests/testthat/test-read_in_prj.R
with
49 additions
and
3 deletions
tests/testthat/test-read_in_prj.R
+
49
−
3
View file @
7f8d5feb
...
...
@@ -185,17 +185,18 @@ test_that("read_in_prj works for processes/include tags", {
prj_path
<-
(
system.file
(
"extdata/benchmarks/Elliptic/circle_radius_1"
,
"circle_1e1_axi.prj"
,
package
=
"r2ogs6"
))
incl_path
<-
(
system.file
(
"extdata/benchmarks/Elliptic/other_dir"
,
"SteadyStateDiffusion.xml"
,
package
=
"r2ogs6"
))
ogs6_obj
<-
OGS6
$
new
(
sim_name
=
"sim"
,
sim_path
=
"sim_path"
)
read_in_prj
(
ogs6_obj
,
prj_path
,
read_in_gml
=
T
)
prj_path
)
expect_equal
(
length
(
ogs6_obj
$
processes
),
1
)
expect_equal
(
names
(
ogs6_obj
$
processes
)[[
1
]],
"include"
)
expect_equal
(
ogs6_obj
$
processes
$
include
[[
"file"
]],
incl_path
)
})
...
...
@@ -231,4 +232,49 @@ test_that("read_in works for python_script objects", {
expect_equal
(
length
(
ogs6_obj
$
python_script
),
1
)
expect_equal
(
ogs6_obj
$
python_script
,
py_path
)
})
test_that
(
"read_in works for geometry and vtu meshes"
,
{
# read gml, vtu
prj_base_path
<-
system.file
(
"extdata/benchmarks/Elliptic/square_1x1_SteadyStateDiffusion_Python"
,
package
=
"r2ogs6"
)
prj_path
<-
paste0
(
prj_base_path
,
"/square_1e3_laplace_eq.prj"
)
gml_path
<-
paste0
(
prj_base_path
,
"/square_1x1.gml"
)
vtu_path
<-
paste0
(
prj_base_path
,
"/square_1x1_quad_1e3.vtu"
)
ogs6_obj
<-
OGS6
$
new
(
sim_name
=
"sim"
,
sim_path
=
"sim_path"
)
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
,
vtu_path
)
rm
(
ogs6_obj
)
# read vtus
prj_base_path
<-
system.file
(
"extdata/benchmarks/CationExchange/"
,
package
=
"r2ogs6"
)
prj_path
<-
paste0
(
prj_base_path
,
"/exchange.prj"
)
vtu_path1
<-
paste0
(
prj_base_path
,
"/exchange.vtu"
)
vtu_path2
<-
paste0
(
prj_base_path
,
"/exchange_upstream.vtu"
)
vtu_path3
<-
paste0
(
prj_base_path
,
"/exchange_downstream.vtu"
)
vtu_path4
<-
paste0
(
prj_base_path
,
"/ReactiveDomain_exchange.vtu"
)
ogs6_obj
<-
OGS6
$
new
(
sim_name
=
"sim"
,
sim_path
=
"sim_path"
)
read_in_prj
(
ogs6_obj
,
prj_path
,
read_in_gml
=
F
)
expect_equal
(
ogs6_obj
$
meshes
[[
1
]]
$
path
,
vtu_path1
)
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
)
})
})
\ No newline at end of file
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