From 61706c32c92029f239c1a6eef411f7ed01825c64 Mon Sep 17 00:00:00 2001 From: Stefano Zampini Date: Tue, 24 Jan 2023 10:30:34 +0300 Subject: [PATCH] Use a single API call to perform y = alpha * x --- source/lac/petsc_vector_base.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 9282eafc70..061c0ee72a 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -942,13 +942,8 @@ namespace PETScWrappers Assert(size() == v.size(), ExcDimensionMismatch(size(), v.size())); - // there is no simple operation for this - // in PETSc. there are multiple ways to - // emulate it, we choose this one: - const PetscErrorCode ierr = VecCopy(v.vector, vector); + const PetscErrorCode ierr = VecAXPBY(vector, a, 0.0, v.vector); AssertThrow(ierr == 0, ExcPETScError(ierr)); - - *this *= a; } -- 2.39.5