]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use PetscReal where a real_type is needed.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 17:53:07 +0000 (17:53 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 17:53:07 +0000 (17:53 +0000)
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

index d464bc05dd2615aff23e51f737e7c8cbc6cb15a8..c7515a665ee5250de808d068652ca41602a813e1 100644 (file)
@@ -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<PetscScalar>(size());
+       return sum/static_cast<PetscReal>(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<PetscScalar>(size());
+      mean = (sum0+sum1+sum2+sum3)/static_cast<PetscReal>(size());
     }
 
     // restore the representation of the

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.