From 1ce265d95be2b532a48f1328a8ff9e230b9dd2c7 Mon Sep 17 00:00:00 2001 From: Doug Shi-Dong Date: Fri, 19 Jun 2020 12:34:35 -0400 Subject: [PATCH] Update Trilinos Matrix::clear_rows 2nd arg test. --- tests/trilinos/69.cc | 14 +++++++++----- tests/trilinos/69.output | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/trilinos/69.cc b/tests/trilinos/69.cc index d715a11134..3ca148d159 100644 --- a/tests/trilinos/69.cc +++ b/tests/trilinos/69.cc @@ -72,8 +72,8 @@ test(TrilinosWrappers::SparseMatrix &m) Assert(m.n_nonzero_elements() - nnz == 0, ExcInternalError()); // now remove the entries of rows N/2 and - // N/3. set diagonal entries to rnd - const double rnd = Testing::rand(); + // N/3. set diagonal entries to diag + const double diag = Testing::rand(); for (unsigned int i = 0; i < N; ++i) { const double s = m.el(N / 2, i); @@ -84,10 +84,14 @@ test(TrilinosWrappers::SparseMatrix &m) const double s = m.el(N / 3, i); norm_sqr -= s * s; } - norm_sqr += 2 * rnd * rnd; + norm_sqr += 2 * diag * diag; - const types::global_dof_index rows[2] = {N / 3, N / 2}; - m.clear_rows(std::vector(&rows[0], &rows[2]), rnd); + const std::vector rows = {N / 3, N / 2}; + m.clear_rows(rows, diag); + for (const auto row : rows) + { + Assert(m.el(row, row) == diag, ExcInternalError()); + } deallog << m.frobenius_norm() << ' ' << std::sqrt(norm_sqr) << std::endl; deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl; diff --git a/tests/trilinos/69.output b/tests/trilinos/69.output index d14aebb0a1..615e171a2c 100644 --- a/tests/trilinos/69.output +++ b/tests/trilinos/69.output @@ -1,6 +1,6 @@ DEAL::7.15267e+09 7.15267e+09 DEAL::32 32 -DEAL::6.82410e+09 6.96580e+09 +DEAL::6.96580e+09 6.96580e+09 DEAL::32 32 DEAL::OK -- 2.39.5