]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix divide error by cast-from-int (as it already is in the parallel case).
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 14:46:04 +0000 (14:46 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 14:46:04 +0000 (14:46 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31089 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/petsc_vector_base.cc

index f3365e78a41d623f39e59163592e78f7fdc2ade1..d464bc05dd2615aff23e51f737e7c8cbc6cb15a8 100644 (file)
@@ -425,12 +425,8 @@ namespace PETScWrappers
         PetscScalar sum;
         ierr = VecSum(vector, &sum);
         AssertThrow (ierr == 0, ExcPETScError(ierr));
-// @whattodo
-        // return sum/size();
-
-       Assert ((false),
-               ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
-                           "but this function is not defined for complex types."));
+// @whattodo-done-check!
+       return sum/static_cast<PetscScalar>(size());
       }
 
     // get a representation of the vector and
@@ -471,11 +467,6 @@ namespace PETScWrappers
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     return mean;
-
-
-    Assert ((false),
-            ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
-                        "but this function is not defined for complex types."));
   }
 
 

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.