]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deal with PETSC_USE_COMPLEX in PETScWrappers.
authorToby D. Young <tyoung@ippt.pan.pl>
Mon, 3 Jun 2013 10:01:02 +0000 (10:01 +0000)
committerToby D. Young <tyoung@ippt.pan.pl>
Mon, 3 Jun 2013 10:01:02 +0000 (10:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@29736 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/source/lac/petsc_matrix_base.cc
deal.II/source/lac/petsc_vector_base.cc

index c5eafdb4d7dc2fb2c559e9be51a48986433f23e2..9ba11127fe1746d84955a5672612cfd3bea736be 100644 (file)
@@ -916,7 +916,7 @@ namespace PETScWrappers
      * diagonal entries in the
      * matrix.
      */
-    PetscReal trace () const;
+    PetscScalar trace () const;
 #endif
 
     /**
index 4222be10e12efe1abbe92b6a50bf4fec5aac7286..8d6b6c127c83d3c03505797775ff0576b43a3dc2 100644 (file)
@@ -504,11 +504,12 @@ namespace PETScWrappers
      */
     real_type norm_sqr () const;
 
+#ifndef PETSC_USE_COMPLEX
     /**
-     * Mean value of the elements of
-     * this vector.
+     * Return the mean value of the elements of this vector.
      */
     PetscScalar mean_value () const;
+#endif
 
     /**
      * $l_1$-norm of the vector.
index 036addb3394f3fd99bebd16715d9635b585130e6..d114eac5f2f79ad8781096a77820b4668b708680 100644 (file)
@@ -428,10 +428,10 @@ namespace PETScWrappers
 
 
 #if DEAL_II_PETSC_VERSION_GTE(3,1,0)
-  PetscReal
+  PetscScalar
   MatrixBase::trace () const
   {
-    PetscReal result;
+    PetscScalar result;
 
     const int ierr
       = MatGetTrace (matrix, &result);
index 0f8deef8afced3690cd46e7d63e4545815aec742..268ca13316be78caf33431f638aae0cbaeb0a819 100644 (file)
@@ -409,18 +409,20 @@ 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()’
+#ifndef PETSC_USE_COMPLEX
   PetscScalar
   VectorBase::mean_value () const
   {
     int ierr;
+
     // We can only use our more efficient
     // routine in the serial case.
     if (dynamic_cast<const PETScWrappers::MPI::Vector *>(this) != 0)
       {
         PetscScalar sum;
-        ierr = VecSum( vector, &sum);
+        ierr = VecSum(vector, &sum);
         AssertThrow (ierr == 0, ExcPETScError(ierr));
         return sum/size();
       }
@@ -464,7 +466,7 @@ namespace PETScWrappers
 
     return mean;
   }
-
+#endif
 
 
   VectorBase::real_type

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.