Skip to content

Commit

Permalink
Merge pull request #665 from MFraters/add_gwb-grid_filter_vtu_mesh_test
Browse files Browse the repository at this point in the history
Add gwb grid filter vtu mesh test
  • Loading branch information
MFraters authored Feb 23, 2024
2 parents ab932a5 + 8a95661 commit 9239916
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,31 @@ IF(WB_RUN_APP_TESTS)
-P ${CMAKE_SOURCE_DIR}/tests/gwb-dat/run_gwb-dat_tests.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-dat/)


# Add tests which filters the output.
set(TEST_ARGUMENTS "${CMAKE_SOURCE_DIR}/tests/data/subducting_plate_composition_smooth_filtered.wb\;${CMAKE_SOURCE_DIR}/tests/gwb-grid/subducting_plate_composition_smooth.grid\;--filtered")
add_test(grid_filtered
${CMAKE_COMMAND}
-D TEST_NAME=${test_name}
-D TEST_PROGRAM=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gwb-grid${CMAKE_EXECUTABLE_SUFFIX}
-D TEST_ARGS=${TEST_ARGUMENTS}
-D TEST_OUTPUT=${CMAKE_BINARY_DIR}/tests/gwb-grid/subducting_plate_composition_smooth_filtered.filtered.vtu
-D TEST_REFERENCE=${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/subducting_plate_composition_smooth_filtered.filtered.vtu
-P ${CMAKE_SOURCE_DIR}/tests/gwb-grid/run_gwb-grid_tests.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/)


# Add tests which filters the by tag.
set(TEST_ARGUMENTS "${CMAKE_SOURCE_DIR}/tests/data/subducting_plate_composition_smooth_by_tag.wb\;${CMAKE_SOURCE_DIR}/tests/gwb-grid/subducting_plate_composition_smooth.grid\;--by-tag")
add_test(grid_by_tag
${CMAKE_COMMAND}
-D TEST_NAME=${test_name}
-D TEST_PROGRAM=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gwb-grid${CMAKE_EXECUTABLE_SUFFIX}
-D TEST_ARGS=${TEST_ARGUMENTS}
-D TEST_OUTPUT=${CMAKE_BINARY_DIR}/tests/gwb-grid/subducting_plate_composition_smooth_by_tag.1.vtu
-D TEST_REFERENCE=${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/subducting_plate_composition_smooth_by_tag.1.vtu
-P ${CMAKE_SOURCE_DIR}/tests/gwb-grid/run_gwb-grid_tests.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gwb-grid/)

#find all the integration test files
file(GLOB_RECURSE APP_TEST_SOURCES "gwb-dat/*.wb")
Expand Down
33 changes: 33 additions & 0 deletions tests/data/subducting_plate_composition_smooth_by_tag.wb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "0.6",
"gravity model":{"model":"uniform", "magnitude":10},
"cross section":[[0,50e3],[50e3,0]],
"features":
[
{
"model":"continental plate", "name":"overriding plate", "max depth":200e3,
"coordinates":[[-550e3,-550e3],[-550e3,550e3],[550e3,550e3],[550e3,-550e3]],
"composition models":
[
{"model":"uniform", "compositions":[3], "max depth":30e3},
{"model":"uniform", "compositions":[4], "min depth":30e3},
{"model":"uniform", "compositions":[6], "min depth":30e3, "operation":"add"},
{"model":"uniform", "compositions":[6], "fractions":[0.5], "min depth":75e3, "operation":"subtract"},
{"model":"uniform", "compositions":[6], "fractions":[1.5], "min depth":150e3, "operation":"replace defined only"}
]
},
{
"model":"subducting plate", "name":"Antilles slab", "dip point":[1e7,-1e7],
"coordinates":[[0,0],[50e3,50e3]],
"segments":
[
{"length":600e3, "thickness":[200e3], "angle":[0,45], "top truncation":[-100.000e03]}
],
"temperature models":[{"model":"uniform", "temperature":600}],
"composition models":[
{"model":"smooth", "compositions":[0], "top fractions":[0], "bottom fractions":[1], "min distance slab top":-100e3, "max distance slab top":0e3},
{"model":"uniform", "compositions":[0], "fractions":[1.25], "min distance slab top":0e3, "max distance slab top":50e3},
{"model":"smooth", "compositions":[0], "min distance slab top":50e3, "max distance slab top":200e3}]
}
]
}
33 changes: 33 additions & 0 deletions tests/data/subducting_plate_composition_smooth_filtered.wb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "0.6",
"gravity model":{"model":"uniform", "magnitude":10},
"cross section":[[0,50e3],[50e3,0]],
"features":
[
{
"model":"continental plate", "name":"overriding plate", "max depth":200e3,
"coordinates":[[-550e3,-550e3],[-550e3,550e3],[550e3,550e3],[550e3,-550e3]],
"composition models":
[
{"model":"uniform", "compositions":[3], "max depth":30e3},
{"model":"uniform", "compositions":[4], "min depth":30e3},
{"model":"uniform", "compositions":[6], "min depth":30e3, "operation":"add"},
{"model":"uniform", "compositions":[6], "fractions":[0.5], "min depth":75e3, "operation":"subtract"},
{"model":"uniform", "compositions":[6], "fractions":[1.5], "min depth":150e3, "operation":"replace defined only"}
]
},
{
"model":"subducting plate", "name":"Antilles slab", "dip point":[1e7,-1e7],
"coordinates":[[0,0],[50e3,50e3]],
"segments":
[
{"length":600e3, "thickness":[200e3], "angle":[0,45], "top truncation":[-100.000e03]}
],
"temperature models":[{"model":"uniform", "temperature":600}],
"composition models":[
{"model":"smooth", "compositions":[0], "top fractions":[0], "bottom fractions":[1], "min distance slab top":-100e3, "max distance slab top":0e3},
{"model":"uniform", "compositions":[0], "fractions":[1.25], "min distance slab top":0e3, "max distance slab top":50e3},
{"model":"smooth", "compositions":[0], "min distance slab top":50e3, "max distance slab top":200e3}]
}
]
}
Loading

0 comments on commit 9239916

Please sign in to comment.