From b20b3ddfd98bf13dfa4e5c5150c527b13c2c8cf0 Mon Sep 17 00:00:00 2001 From: young Date: Thu, 3 Oct 2013 17:53:07 +0000 Subject: [PATCH] Use PetscReal where a real_type is needed. git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31097 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/petsc_vector_base.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc index d464bc05dd..c7515a665e 100644 --- a/deal.II/source/lac/petsc_vector_base.cc +++ b/deal.II/source/lac/petsc_vector_base.cc @@ -411,8 +411,7 @@ namespace PETScWrappers return d*d; } - // @todo does not build with PETSc complex scalar types. - // :425:25: error: no match for ‘operator/’ in ‘sum / dealii::PETScWrappers::VectorBase::size()’ + PetscScalar VectorBase::mean_value () const { @@ -426,7 +425,7 @@ namespace PETScWrappers ierr = VecSum(vector, &sum); AssertThrow (ierr == 0, ExcPETScError(ierr)); // @whattodo-done-check! - return sum/static_cast(size()); + return sum/static_cast(size()); } // get a representation of the vector and @@ -458,7 +457,7 @@ namespace PETScWrappers while (ptr != start_ptr+size()) sum0 += *ptr++; - mean = (sum0+sum1+sum2+sum3)/static_cast(size()); + mean = (sum0+sum1+sum2+sum3)/static_cast(size()); } // restore the representation of the -- 2.39.5