From: Wolfgang Bangerth Date: Mon, 30 Dec 2019 18:24:06 +0000 (-0700) Subject: Simplify the code a bit. X-Git-Tag: v9.2.0-rc1~758^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1983b6b8ea60a41c83c5cff79ac83928b7e8c69;p=dealii.git Simplify the code a bit. In earlier versions of deal.II, the SparseDirectUMFPACK could deal with block matrices but not block vectors, and so we needed to do some copying around. This is no longer necessary. --- diff --git a/tests/umfpack/umfpack_09.cc b/tests/umfpack/umfpack_09.cc index a161190fe2..5ed20f4040 100644 --- a/tests/umfpack/umfpack_09.cc +++ b/tests/umfpack/umfpack_09.cc @@ -129,21 +129,26 @@ test() solution.block(2).reinit(dof_handler.n_dofs() - 2 * (dof_handler.n_dofs() / 3)); solution.collect_sizes(); + + // Pick a solution vector + for (unsigned int j = 0; j < dof_handler.n_dofs(); ++j) + solution(j) = j + j * (i + 1) * (i + 1); + + // Then choose as rhs for the linear system the vector + // b = B*solution + // so that later the solution of the linear system Bx=b + // is again + // x = solution BlockVector x; x.reinit(solution); BlockVector b; b.reinit(solution); - for (unsigned int j = 0; j < dof_handler.n_dofs(); ++j) - solution(j) = j + j * (i + 1) * (i + 1); - B.vmult(b, solution); x = b; - Vector tmp(solution.size()); - tmp = x; - SparseDirectUMFPACK().solve(B, tmp); - x = tmp; + SparseDirectUMFPACK().solve(B, x); + // Check that we really got what we expected x -= solution; deallog << "relative norm distance = " << x.l2_norm() / solution.l2_norm() << std::endl;