From 4e9f09efc3cbf90022fc6a4b39a4cbc2181587e2 Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Wed, 20 Dec 2023 11:08:54 +0100 Subject: [PATCH] remove tests used for debugging --- .../test_cuSparse_matrix_operations.cpp | 109 ------------------ 1 file changed, 109 deletions(-) diff --git a/tests/cuistl/test_cuSparse_matrix_operations.cpp b/tests/cuistl/test_cuSparse_matrix_operations.cpp index cd2b8218914..eb7fd39178f 100644 --- a/tests/cuistl/test_cuSparse_matrix_operations.cpp +++ b/tests/cuistl/test_cuSparse_matrix_operations.cpp @@ -180,112 +180,3 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(FlattenAndInvertDiagonalWith2By2Blocks, T, Numeric BOOST_CHECK_CLOSE(expectedInvDiag[i], computedInvDiag[i], 1e-7); } } - -BOOST_AUTO_TEST_CASE_TEMPLATE(testMvHelperFunction, T, NumericTypes) -{ - size_t N = 3; - std::vector A(N*N), b(N), c(N); - for (int i = 0; i < N; i++){ - for (int j = 0; j < N; j++){ - A[i*N + j] = i*N + j; - } - b[i] = i; - c[i] = N - i; - } - - bool setEqual = true; - - for (size_t i = 0; i < N; ++i) { - if (setEqual){ - c[i] = 0; - } - - for (size_t j = 0; j < N; ++j) { - if (setEqual){ - c[i] += A[i * N + j] * b[j]; - } - else if (!setEqual){ - c[i] -= A[i * N + j] * b[j]; - } - } - } - - std::vector expected_ans = {5.0, 14.0, 23.0}; - for (int i = 0; i < N; i++){ - - BOOST_CHECK_CLOSE(c[i], expected_ans[i], 1e-7); - } - - setEqual = false; - expected_ans = {0.0, 0.0, 0.0}; - - for (size_t i = 0; i < N; ++i) { - if (setEqual){ - c[i] = 0; - } - - for (size_t j = 0; j < N; ++j) { - if (setEqual){ - c[i] += A[i * N + j] * b[j]; - } - else if (!setEqual){ - c[i] -= A[i * N + j] * b[j]; - } - } - } - - for (int i = 0; i < N; i++){ - - BOOST_CHECK_CLOSE(c[i], expected_ans[i], 1e-7); - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(moveToReorderedMatrix, T, NumericTypes) -{ - const size_t blocksize = 2; - const size_t N = 2; - const int nonZeroes = 3; - using M = Dune::FieldMatrix; - using SpMatrix = Dune::BCRSMatrix; - - SpMatrix A(N, N, nonZeroes, SpMatrix::row_wise); - for (auto row = A.createbegin(); row != A.createend(); ++row) { - row.insert(row.index()); - if (row.index() == 0) { - row.insert(row.index() + 1); - } - } - SpMatrix B(N, N, nonZeroes, SpMatrix::row_wise); - for (auto row = B.createbegin(); row != B.createend(); ++row) { - row.insert(row.index()); - if (row.index() == 1) { - row.insert(row.index() - 1); - } - } - A[0][0][0][0] = 1.0; - A[0][1][0][1] = 2.0; - A[1][1][1][0] = 3.0; - B[0][0][0][0] = -1.0; - B[1][0][0][0] = -1.0; - B[1][1][0][0] = -1.0; - - Opm::cuistl::CuSparseMatrix mA = Opm::cuistl::CuSparseMatrix::fromMatrix(A); - Opm::cuistl::CuSparseMatrix mB = Opm::cuistl::CuSparseMatrix::fromMatrix(B); - - Opm::cuistl::CuVector naturalToReorder({1, 0}); - - Opm::cuistl::detail::moveMatDataToReordered2(mA.getNonZeroValues().data(), mA.getRowIndices().data(), mA.getColumnIndices().data(), mB.getNonZeroValues().data(), mB.getRowIndices().data(), mB.getColumnIndices().data(), naturalToReorder.data(), N, nonZeroes); - - std::vector orig(mA.getNonZeroValues().asStdVector()); - std::vector res(mB.getNonZeroValues().asStdVector()); - - printf("=======\n"); - for (auto e : orig){ - printf("%lf ", e); - } - printf("\n"); - for (auto e : res){ - printf("%lf ", e); - } - printf("=======\n"); -} \ No newline at end of file