| 1 |
# SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 2 |
# SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception |
| 3 |
|
| 4 |
# Link all test targets in this directory against Dune::ISTL |
| 5 |
link_libraries(Dune::ISTL) |
| 6 |
|
| 7 |
# install the test tools as we want to support testing 3rd-party vectors and matrices with an installed dune-istl |
| 8 |
install(FILES |
| 9 |
matrixtest.hh |
| 10 |
vectortest.hh |
| 11 |
laplacian.hh |
| 12 |
multirhstest.hh |
| 13 |
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/istl/test) |
| 14 |
|
| 15 |
dune_add_test(SOURCES bcrsassigntest.cc) |
| 16 |
|
| 17 |
dune_add_test(SOURCES bcrsmatrixtest.cc) |
| 18 |
|
| 19 |
dune_add_test(SOURCES bcrsnormtest.cc) |
| 20 |
|
| 21 |
dune_add_test(SOURCES cgconditiontest.cc) |
| 22 |
|
| 23 |
dune_add_test(SOURCES dilutest.cc) |
| 24 |
|
| 25 |
dune_add_test(SOURCES dotproducttest.cc) |
| 26 |
|
| 27 |
dune_add_test(SOURCES complexmatrixtest.cc) |
| 28 |
|
| 29 |
dune_add_test(SOURCES fieldvectortest.cc) |
| 30 |
|
| 31 |
dune_add_test(SOURCES foreachtest.cc) |
| 32 |
|
| 33 |
dune_add_test(SOURCES matrixnormtest.cc) |
| 34 |
|
| 35 |
dune_add_test(SOURCES matrixutilstest.cc) |
| 36 |
|
| 37 |
dune_add_test(SOURCES matrixtest.cc) |
| 38 |
|
| 39 |
dune_add_test(SOURCES multirhstest.cc) |
| 40 |
add_dune_vc_flags(multirhstest) # Vc is not a hard requirement |
| 41 |
|
| 42 |
dune_add_test(SOURCES bvectortest.cc) |
| 43 |
|
| 44 |
dune_add_test(SOURCES vbvectortest.cc) |
| 45 |
|
| 46 |
dune_add_test(SOURCES bcrsbuild.cc) |
| 47 |
|
| 48 |
dune_add_test(SOURCES bcrsimplicitbuild.cc |
| 49 |
COMPILE_DEFINITIONS DUNE_ISTL_WITH_CHECKING=1) |
| 50 |
|
| 51 |
dune_add_test(SOURCES matrixiteratortest.cc) |
| 52 |
|
| 53 |
dune_add_test(SOURCES mmtest.cc) |
| 54 |
|
| 55 |
dune_add_test(SOURCES multitypeblockmatrixtest.cc) |
| 56 |
|
| 57 |
dune_add_test(SOURCES multitypeblockvectortest.cc) |
| 58 |
|
| 59 |
dune_add_test(SOURCES mv.cc) |
| 60 |
|
| 61 |
dune_add_test(SOURCES iotest.cc) |
| 62 |
|
| 63 |
dune_add_test(SOURCES inverseoperator2prectest.cc) |
| 64 |
|
| 65 |
dune_add_test(SOURCES preconditionerstest.cc) |
| 66 |
|
| 67 |
dune_add_test(SOURCES scalarproductstest.cc) |
| 68 |
|
| 69 |
dune_add_test(SOURCES scaledidmatrixtest.cc) |
| 70 |
|
| 71 |
dune_add_test(SOURCES solvertest.cc) |
| 72 |
|
| 73 |
dune_add_test(SOURCES solveraborttest.cc) |
| 74 |
|
| 75 |
set(DUNE_TEST_FACTORY_FIELD_TYPES |
| 76 |
"double" |
| 77 |
"float" |
| 78 |
"std::complex<double>" |
| 79 |
"std::complex<float>" |
| 80 |
"Dune::LoopSIMD<double, 4>") |
| 81 |
|
| 82 |
set(DUNE_TEST_FACTORY_BLOCK_SIZES |
| 83 |
1 |
| 84 |
2 |
| 85 |
3) |
| 86 |
|
| 87 |
function(add_factory_test BLOCK) |
| 88 |
STRING(REGEX REPLACE "[^a-zA-Z0-9]" "" BLOCK_CLEAN ${BLOCK}) |
| 89 |
set(DEFINE_DEACTIVATE_AMG_DIRECTSOLVER "#define DISABLE_AMG_DIRECTSOLVER 1") |
| 90 |
configure_file(solverfactorytest.cc.in solverfactorytest_${BLOCK_CLEAN}.cc) |
| 91 |
dune_add_test(NAME solverfactorytest_${BLOCK_CLEAN} |
| 92 |
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc |
| 93 |
CMAKE_GUARD |
| 94 |
HAVE_MPI |
| 95 |
SuiteSparse_CHOLMOD_FOUND |
| 96 |
SuiteSparse_LDL_FOUND |
| 97 |
SuiteSparse_SPQR_FOUND |
| 98 |
SuiteSparse_UMFPACK_FOUND |
| 99 |
SuperLU_FOUND) |
| 100 |
add_dune_mpi_flags(solverfactorytest_${BLOCK_CLEAN}) |
| 101 |
add_dune_parmetis_flags(solverfactorytest_${BLOCK_CLEAN}) |
| 102 |
add_dune_suitesparse_flags(solverfactorytest_${BLOCK_CLEAN}) |
| 103 |
add_dune_superlu_flags(solverfactorytest_${BLOCK_CLEAN}) |
| 104 |
|
| 105 |
string(REGEX MATCH "LoopSIMD" _matched "${BLOCK}") |
| 106 |
if(NOT _matched) |
| 107 |
set(DEFINE_DEACTIVATE_AMG_DIRECTSOLVER "") |
| 108 |
configure_file(solverfactorytest.cc.in solverfactorytest_${BLOCK_CLEAN}_direct.cc) |
| 109 |
dune_add_test(NAME solverfactorytest_${BLOCK_CLEAN}_direct |
| 110 |
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}_direct.cc |
| 111 |
MPI_RANKS 1 2 4 |
| 112 |
TIMEOUT 600 |
| 113 |
CMAKE_GUARD |
| 114 |
HAVE_MPI |
| 115 |
SuiteSparse_CHOLMOD_FOUND |
| 116 |
SuiteSparse_LDL_FOUND |
| 117 |
SuiteSparse_SPQR_FOUND |
| 118 |
SuiteSparse_UMFPACK_FOUND |
| 119 |
SuperLU_FOUND) |
| 120 |
add_dune_mpi_flags(solverfactorytest_${BLOCK_CLEAN}_direct) |
| 121 |
add_dune_parmetis_flags(solverfactorytest_${BLOCK_CLEAN}_direct) |
| 122 |
add_dune_suitesparse_flags(solverfactorytest_${BLOCK_CLEAN}_direct) |
| 123 |
add_dune_superlu_flags(solverfactorytest_${BLOCK_CLEAN}_direct) |
| 124 |
endif() |
| 125 |
endfunction(add_factory_test) |
| 126 |
|
| 127 |
foreach(FIELD_TYPE ${DUNE_TEST_FACTORY_FIELD_TYPES}) |
| 128 |
add_factory_test(${FIELD_TYPE}) |
| 129 |
foreach(BLOCK_SIZE ${DUNE_TEST_FACTORY_BLOCK_SIZES}) |
| 130 |
add_factory_test("Dune::FieldVector<${FIELD_TYPE}, ${BLOCK_SIZE}>") |
| 131 |
endforeach() |
| 132 |
endforeach() |
| 133 |
dune_symlink_to_source_files(FILES solverfactorytest.ini) |
| 134 |
|
| 135 |
# SuperLU tests |
| 136 |
if(HAVE_SUPERLU) |
| 137 |
dune_add_test(NAME superlustest |
| 138 |
SOURCES superlutest.cc |
| 139 |
COMPILE_DEFINITIONS SUPERLU_NTYPE=0) |
| 140 |
add_dune_superlu_flags(superlustest) |
| 141 |
|
| 142 |
dune_add_test(SOURCES superlutest.cc) |
| 143 |
add_dune_superlu_flags(superlutest) |
| 144 |
|
| 145 |
dune_add_test(NAME superluctest |
| 146 |
SOURCES superlutest.cc |
| 147 |
COMPILE_DEFINITIONS SUPERLU_NTYPE=2) |
| 148 |
add_dune_superlu_flags(superluctest) |
| 149 |
|
| 150 |
dune_add_test(NAME superluztest |
| 151 |
SOURCES superlutest.cc |
| 152 |
COMPILE_DEFINITIONS SUPERLU_NTYPE=3) |
| 153 |
add_dune_superlu_flags(superluztest) |
| 154 |
|
| 155 |
dune_add_test(SOURCES complexrhstest.cc |
| 156 |
COMPILE_DEFINITIONS SUPERLU_NTYPE=3) |
| 157 |
add_dune_superlu_flags(complexrhstest) |
| 158 |
endif() |
| 159 |
|
| 160 |
# SuiteSparse tests |
| 161 |
if(HAVE_SUITESPARSE) |
| 162 |
dune_add_test(SOURCES umfpacktest.cc |
| 163 |
CMAKE_GUARD SuiteSparse_UMFPACK_FOUND) |
| 164 |
add_dune_suitesparse_flags(umfpacktest) |
| 165 |
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "umfpack_decomp") |
| 166 |
|
| 167 |
dune_add_test(SOURCES ldltest.cc |
| 168 |
CMAKE_GUARD SuiteSparse_LDL_FOUND) |
| 169 |
add_dune_suitesparse_flags(ldltest) |
| 170 |
|
| 171 |
dune_add_test(SOURCES spqrtest.cc |
| 172 |
CMAKE_GUARD SuiteSparse_SPQR_FOUND) |
| 173 |
add_dune_suitesparse_flags(spqrtest) |
| 174 |
|
| 175 |
dune_add_test(SOURCES cholmodtest.cc |
| 176 |
CMAKE_GUARD SuiteSparse_CHOLMOD_FOUND) |
| 177 |
add_dune_suitesparse_flags(cholmodtest) |
| 178 |
endif() |
| 179 |
|
| 180 |
dune_add_test(SOURCES overlappingschwarztest.cc |
| 181 |
CMAKE_GUARD "SuperLU_FOUND OR SuiteSparse_UMFPACK_FOUND") |
| 182 |
add_dune_suitesparse_flags(overlappingschwarztest) |
| 183 |
add_dune_superlu_flags(overlappingschwarztest) |
| 184 |
|
| 185 |
dune_add_test(SOURCES registrytest.cc) |
| 186 |
|
| 187 |
# MPI tests |
| 188 |
dune_add_test(SOURCES matrixredisttest.cc |
| 189 |
MPI_RANKS 1 2 4 |
| 190 |
TIMEOUT 600 |
| 191 |
CMAKE_GUARD MPI_FOUND) |
| 192 |
add_dune_mpi_flags(matrixredisttest) |
| 193 |
add_dune_parmetis_flags(matrixredisttest) # ParMETIS is not a hard requirement |
| 194 |
|
| 195 |
dune_add_test(SOURCES vectorcommtest.cc |
| 196 |
MPI_RANKS 1 2 4 |
| 197 |
TIMEOUT 600 |
| 198 |
CMAKE_GUARD MPI_FOUND) |
| 199 |
add_dune_mpi_flags(vectorcommtest) |
| 200 |
|
| 201 |
dune_add_test(SOURCES matrixmarkettest.cc) |
| 202 |
add_dune_gmp_flags(matrixmarkettest) |
| 203 |
add_dune_mpi_flags(matrixmarkettest) |
| 204 |
add_dune_quadmath_flags(matrixmarkettest) |
| 205 |
|
| 206 |
dune_add_test(SOURCES iluildltest.cc) |
| 207 |
|
| 208 |
dune_add_test(SOURCES matrixfreesolverfactorytest.cc) |
| 209 |
|
| 210 |
dune_add_test(SOURCES blocklevel.cc COMPILE_ONLY) |
| 211 |
|
| 212 |
dune_add_test(SOURCES registermacrosbackwardcompatibilitytest.cc |
| 213 |
CMAKE_GUARD "SuiteSparse_UMFPACK_FOUND") |
| 214 |
add_dune_suitesparse_flags(registermacrosbackwardcompatibilitytest) |
| 215 |
|
| 216 |
exclude_from_headercheck(complexdata.hh) |