CMakeLists.txt 10.4 KB
Newer Older
1
2
add_executable(test_ff_flow_over_square_2d EXCLUDE_FROM_ALL main_ff.cc)
add_executable(test_pm_flow_over_square_2d EXCLUDE_FROM_ALL main_pm.cc)
3

4
5
target_compile_definitions(test_ff_flow_over_square_2d PUBLIC "ENABLEMONOLITHIC=0")
target_compile_definitions(test_pm_flow_over_square_2d PUBLIC "ENABLEMONOLITHIC=0")
6

7
8
target_link_libraries(test_ff_flow_over_square_2d PRIVATE dumux-precice)
target_link_libraries(test_pm_flow_over_square_2d PRIVATE dumux-precice)
9
10
11
12

add_input_file_links()
add_precice_file_links()

13
14
15
16
17
18
19
20
21
# Dummy test is needed to build porous media solver. The default
# `dumux_add_test` (and the underlying `dune_add_test`) only accept
# one target executable.
dumux_add_test(NAME dummy_test_ff_pm_part_flow_over_square_2d
              TARGET test_pm_flow_over_square_2d
              LABELS freeflow stokes precice darcy partitioned
              TIMEOUT 30
              COMMAND ${CMAKE_SOURCE_DIR}/test/return-test-passed.sh
)
22

23
24
25
26
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_si_st_first
              TARGET test_ff_flow_over_square_2d
              TARGET test_pm_flow_over_square_2d
              LABELS freeflow stokes precice darcy partitioned
27
              TIMEOUT 30
28
29
              CMAKE_GUARD HAVE_UMFPACK
              COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
30
              CMD_ARGS
31
              --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_first_si_stokes.vtu
Alexander Jaust's avatar
Alexander Jaust committed
32
                      ${CMAKE_CURRENT_BINARY_DIR}/stokes-iterative-00005.vtu
33
                      ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_first_si_darcy.vtu
Alexander Jaust's avatar
Alexander Jaust committed
34
                      ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00005.vtu
35
36
              --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-stokesdarcy.input
              --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-si-free-flow-first.xml
37
              --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_first_si_coupliter_stokes.log ${CMAKE_CURRENT_BINARY_DIR}/precice-FreeFlow-iterations.log
Alexander Jaust's avatar
Alexander Jaust committed
38
              --case-name "flow-over-box-2d-si-stokes-first"
39
              --relative 5e-6
40
41
              --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
)
42
set_tests_properties(test_ff_pm_part_flow_over_square_2d_si_st_first PROPERTIES
43
    ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
44

45
46
47
48
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_si_st_second
    TARGET test_pm_flow_over_square_2d
    TARGET test_ff_flow_over_square_2d
    LABELS freeflow darcy precice darcy partitioned
49
    TIMEOUT 30
50
    CMAKE_GUARD HAVE_UMFPACK
Alexander Jaust's avatar
Alexander Jaust committed
51
    COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
52
    CMD_ARGS
53
            --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_second_si_stokes.vtu
54
              ${CMAKE_CURRENT_BINARY_DIR}/stokes-iterative-00006.vtu
55
              ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_second_si_darcy.vtu
56
              ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00006.vtu
57
58
            --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-stokesdarcy.input
            --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-si-free-flow-second.xml
59
            --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_second_si_coupliter_darcy.log ${CMAKE_CURRENT_BINARY_DIR}/precice-Darcy-iterations.log
60
    --case-name "flow-over-box-2d-si-stokes-second"
61
    --relative 5e-6
Alexander Jaust's avatar
Alexander Jaust committed
62
    --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
63
)
64
set_tests_properties(test_ff_pm_part_flow_over_square_2d_si_st_second PROPERTIES
65
  ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
66

67
68
69
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_pi_st
              TARGET test_ff_flow_over_square_2d test_pm_flow_over_square_2d
              LABELS freeflow stokes precice darcy partitioned
70
              TIMEOUT 30
71
72
              CMAKE_GUARD HAVE_UMFPACK
              COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
73
              CMD_ARGS
74
              --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_pi_stokes.vtu
Alexander Jaust's avatar
Alexander Jaust committed
75
                      ${CMAKE_CURRENT_BINARY_DIR}/stokes-iterative-00007.vtu
76
                      ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_pi_darcy.vtu
Alexander Jaust's avatar
Alexander Jaust committed
77
                      ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00007.vtu
78
79
              --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-stokesdarcy.input
              --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-pi.xml
80
              --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_stokes_pi_coupliter_stokes.log
Alexander Jaust's avatar
Alexander Jaust committed
81
82
              ${CMAKE_CURRENT_BINARY_DIR}/precice-FreeFlow-iterations.log
              --case-name "flow-over-box-2d-pi"
83
              --relative 5e-6
84
85
86
              --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
)
# Adding DuMuX directory to Python search path such that we can use DuMuX'x fuzzy (inexact) testing of vtu files
87
set_tests_properties(test_ff_pm_part_flow_over_square_2d_pi_st PROPERTIES
88
    ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
89

90
### Setting test dependencies
91
92
set_property(TEST test_ff_pm_part_flow_over_square_2d_si_st_second APPEND PROPERTY DEPENDS test_ff_pm_part_flow_over_square_2d_si_st_first)
set_property(TEST test_ff_pm_part_flow_over_square_2d_pi_st APPEND PROPERTY DEPENDS test_ff_pm_part_flow_over_square_2d_si_st_second)
93
94
95
96
97

######################
# Navier-Stokes tests
######################

98
99
100
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_si_ns_first
              TARGET test_ff_flow_over_square_2d test_pm_flow_over_square_2d
              LABELS freeflow navierstokes precice darcy partitioned
101
102
103
              TIMEOUT 60
              CMAKE_GUARD HAVE_UMFPACK
              COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
104
              CMD_ARGS
105
              --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_first_si_navierstokes.vtu
106
                      ${CMAKE_CURRENT_BINARY_DIR}/navierstokes-iterative-00006.vtu
107
                      ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_first_si_darcy.vtu
108
                      ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00006.vtu
109
110
              --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-navierstokesdarcy.input
              --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-si-free-flow-first.xml
111
              --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_first_si_coupliter_navierstokes.log ${CMAKE_CURRENT_BINARY_DIR}/precice-FreeFlow-iterations.log
112
              --case-name "flow-over-box-2d-si-navierstokes-first"
113
              --relative 5e-6
114
115
              --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
)
116
set_tests_properties(test_ff_pm_part_flow_over_square_2d_si_ns_first PROPERTIES
117
    ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
118

119
120
121
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_si_ns_second
    TARGET test_ff_flow_over_square_2d test_pm_flow_over_square_2d
    LABELS freeflow darcy precice darcy partitioned
122
123
124
    TIMEOUT 60
    CMAKE_GUARD HAVE_UMFPACK
    COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
125
    CMD_ARGS
126
    --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_second_si_navierstokes.vtu
127
              ${CMAKE_CURRENT_BINARY_DIR}/navierstokes-iterative-00007.vtu
128
              ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_second_si_darcy.vtu
129
              ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00007.vtu
130
131
            --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-navierstokesdarcy.input
            --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-si-free-flow-second.xml
132
            --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_second_si_coupliter_darcy.log ${CMAKE_CURRENT_BINARY_DIR}/precice-Darcy-iterations.log
133
    --case-name "flow-over-box-2d-si-navierstokes-second"
134
    --relative 5e-6
135
136
    --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
)
137
set_tests_properties(test_ff_pm_part_flow_over_square_2d_si_ns_second PROPERTIES
138
 ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
139

140
141
142
dumux_add_test(NAME test_ff_pm_part_flow_over_square_2d_pi_ns
              TARGET test_ff_flow_over_square_2d test_pm_flow_over_square_2d
              LABELS freeflow navierstokes precice darcy partitioned
143
144
145
              TIMEOUT 60
              CMAKE_GUARD HAVE_UMFPACK
              COMMAND ${CMAKE_SOURCE_DIR}/test/run-iterative-test.py
146
              CMD_ARGS
147
              --files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_pi_navierstokes.vtu
148
                      ${CMAKE_CURRENT_BINARY_DIR}/navierstokes-iterative-00011.vtu
149
                      ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_pi_darcy.vtu
150
                      ${CMAKE_CURRENT_BINARY_DIR}/darcy-iterative-00011.vtu
151
152
              --dumux-param-file ${CMAKE_CURRENT_BINARY_DIR}/params-navierstokesdarcy.input
              --precice-config-file ${CMAKE_CURRENT_BINARY_DIR}/precice-config-pi.xml
153
              --precice-iteration-files ${CMAKE_SOURCE_DIR}/test/reference-solutions/flow-over-square-2d/test_navierstokes_pi_coupliter_navierstokes.log
154
155
              ${CMAKE_CURRENT_BINARY_DIR}/precice-FreeFlow-iterations.log
              --case-name "flow-over-box-2d-pi"
156
              --relative 5e-6
157
158
159
              --zeroThreshold {"velocity_liq \(m/s\)":1e-14,"p":1e-12}
)
# Adding DuMuX directory to Python search path such that we can use DuMuX'x fuzzy (inexact) testing of vtu files
160
set_tests_properties(test_ff_pm_part_flow_over_square_2d_pi_ns PROPERTIES
161
    ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/test:$ENV{PYTHONPATH})
162
163

# Adding DuMuX directory to Python search path such that we can use DuMuX'x fuzzy (inexact) testing of vtu files
164
165
set_property(TEST test_ff_pm_part_flow_over_square_2d_si_ns_first APPEND PROPERTY DEPENDS test_ff_pm_part_flow_over_square_2d_pi_st)
set_property(TEST test_ff_pm_part_flow_over_square_2d_si_ns_second APPEND PROPERTY DEPENDS test_ff_pm_part_flow_over_square_2d_si_ns_first)
166
set_property(TEST test_ff_pm_part_flow_over_square_2d_pi_ns APPEND PROPERTY DEPENDS test_ff_pm_part_flow_over_square_2d_si_ns_second)