From: Martin Kronbichler Date: Wed, 30 Sep 2020 11:42:38 +0000 (+0200) Subject: Reset ghost values in vector after output X-Git-Tag: v9.3.0-rc1~1054^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d3a2fbd6cb0d437df351f5c5ab118eaa2844c5d;p=dealii.git Reset ghost values in vector after output --- diff --git a/examples/step-48/step-48.cc b/examples/step-48/step-48.cc index 8b4d5112fc..5006e9433a 100644 --- a/examples/step-48/step-48.cc +++ b/examples/step-48/step-48.cc @@ -460,11 +460,11 @@ namespace Step48 // data that is needed in the VectorTools::integrate_difference() function // as well as in DataOut. The only action to take at this point is to make // sure that the vector updates its ghost values before we read from - // them. This is a feature present only in the - // LinearAlgebra::distributed::Vector class. Distributed vectors with PETSc - // and Trilinos, on the other hand, need to be copied to special vectors - // including ghost values (see the relevant section in step-40). If we also - // wanted to access all degrees of freedom on ghost cells (e.g. when + // them, and to reset ghost values once done. This is a feature present only + // in the LinearAlgebra::distributed::Vector class. Distributed vectors with + // PETSc and Trilinos, on the other hand, need to be copied to special + // vectors including ghost values (see the relevant section in step-40). If + // we also wanted to access all degrees of freedom on ghost cells (e.g. when // computing error estimators that use the jump of solution over cell // boundaries), we would need more information and create a vector // initialized with locally relevant dofs just as in step-40. Observe also @@ -502,6 +502,8 @@ namespace Step48 data_out.write_vtu_with_pvtu_record( "./", "solution", timestep_number, MPI_COMM_WORLD, 3); + + solution.zero_out_ghosts(); }