]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update Trilinos Matrix::clear_rows 2nd arg test. 10463/head
authorDoug Shi-Dong <doug.shidong@gmail.com>
Fri, 19 Jun 2020 16:34:35 +0000 (12:34 -0400)
committerDoug Shi-Dong <doug.shidong@gmail.com>
Tue, 23 Jun 2020 00:54:24 +0000 (20:54 -0400)
tests/trilinos/69.cc
tests/trilinos/69.output

index d715a11134e0859267822dc742d22fa5675cd53e..3ca148d159221c2f9dc2f75d1c5e5ecd88494cf2 100644 (file)
@@ -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<types::global_dof_index>(&rows[0], &rows[2]), rnd);
+  const std::vector<types::global_dof_index> 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;
index d14aebb0a1928aeffab44c28903099cd314aa853..615e171a2c11fe71ebe15abe4993bb247263653d 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.