From: young Date: Tue, 31 Mar 2009 13:13:45 +0000 (+0000) Subject: Upgraded: PETSc vector base to migrate to PETSc 3.0.0 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcc75d500a7dd5ae64cfbbd582955441e4fd71f7;p=dealii-svn.git Upgraded: PETSc vector base to migrate to PETSc 3.0.0 git-svn-id: https://svn.dealii.org/trunk@18534 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/petsc_vector_base.h b/deal.II/lac/include/lac/petsc_vector_base.h index 1889d575e1..1249ac988e 100644 --- a/deal.II/lac/include/lac/petsc_vector_base.h +++ b/deal.II/lac/include/lac/petsc_vector_base.h @@ -455,6 +455,14 @@ namespace PETScWrappers */ VectorBase & conjugate (); + /** + * A collective piecewise + * multiply operation. TODO: + * The model for this function + * should be similer to add (). + */ + VectorBase & mult (); + /** * Return whether the vector contains * only elements with value zero. This diff --git a/deal.II/lac/source/petsc_vector_base.cc b/deal.II/lac/source/petsc_vector_base.cc index 2acb47d533..95436b78e8 100644 --- a/deal.II/lac/source/petsc_vector_base.cc +++ b/deal.II/lac/source/petsc_vector_base.cc @@ -448,6 +448,17 @@ namespace PETScWrappers + VectorBase & + VectorBase::mult () + { + const int ierr = VecPointwiseMult (vector,vector,vector); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + return *this; + } + + + bool VectorBase::all_zero () const {