diff --git a/Solver/linearSystemPETSc.cpp b/Solver/linearSystemPETSc.cpp index d0d34079eef311c4941251ca5d64e691c39c95ed..1ed3ec0af3cc33cf9f8400cd08feeda3090a8386 100644 --- a/Solver/linearSystemPETSc.cpp +++ b/Solver/linearSystemPETSc.cpp @@ -240,6 +240,8 @@ linearSystemPETScBlockDouble::linearSystemPETScBlockDouble() double linearSystemPETScBlockDouble::normInfRightHandSide() const { PetscReal nor; + VecAssemblyBegin(_b); + VecAssemblyEnd(_b); VecNorm(_b, NORM_INFINITY, &nor); return nor; } diff --git a/Solver/linearSystemPETSc.hpp b/Solver/linearSystemPETSc.hpp index 2694650dd6c7597bec9607ac1e0ce5f48ee9ae07..67c35945efbd6b69341078cdc5e33b52868c2067 100644 --- a/Solver/linearSystemPETSc.hpp +++ b/Solver/linearSystemPETSc.hpp @@ -173,7 +173,7 @@ void linearSystemPETSc<scalar>::getFromRightHandSide(int row, scalar &val) const // FIXME specialize this routine val = s.real(); #else - VecGetValues(_b, 1, &row, &val); + _try(VecGetValues(_b, 1, &row, &val)); #endif } @@ -181,6 +181,8 @@ template <class scalar> double linearSystemPETSc<scalar>::normInfRightHandSide() const { PetscReal nor; + VecAssemblyBegin(_b); + VecAssemblyEnd(_b); _try(VecNorm(_b, NORM_INFINITY, &nor)); return nor; } @@ -205,7 +207,7 @@ void linearSystemPETSc<scalar>::getFromSolution(int row, scalar &val) const _try(VecRestoreArray(_x, &tmp)); val = s.real(); #else - VecGetValues(_x, 1, &row, &val); + _try(VecGetValues(_x, 1, &row, &val)); #endif }