]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Patch by Arvind Ajoy: make things compatible with a PETSc that is compiled with compl...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 Sep 2009 23:59:06 +0000 (23:59 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 Sep 2009 23:59:06 +0000 (23:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@19471 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6541f8dd6134f76d3ab6ab30c143b6fb034cadd1..592b81777cef58bb32ec8ede53865c3106aac062 100644 (file)
@@ -1497,11 +1497,11 @@ namespace PETScWrappers
        n_columns = 0;
        for (unsigned int j=0; j<n_cols; ++j)
          {
-           const double value = values[j];
+           const PetscScalar value = values[j];
            Assert (numbers::is_finite(value),
                    ExcMessage("The given value is not finite but either "
                               "infinite or Not A Number (NaN)"));
-           if (value != 0)
+           if (value != PetscScalar())
              {
                column_indices[n_columns] = col_indices[j];
                column_values[n_columns] = value;
@@ -1533,7 +1533,7 @@ namespace PETScWrappers
            ExcMessage("The given value is not finite but either "
                       "infinite or Not A Number (NaN)"));
 
-    if (value == 0)
+    if (value == PetscScalar())
       {
                                  // we have to do checkings on Insert/Add
                                  // in any case
@@ -1644,11 +1644,11 @@ namespace PETScWrappers
        n_columns = 0;
        for (unsigned int j=0; j<n_cols; ++j)
          {
-           const double value = values[j];
+           const PetscScalar value = values[j];
            Assert (numbers::is_finite(value),
                    ExcMessage("The given value is not finite but either "
                               "infinite or Not A Number (NaN)"));
-           if (value != 0)
+           if (value != PetscScalar())
              {
                column_indices[n_columns] = col_indices[j];
                column_values[n_columns] = value;
index 1249ac988eda235a3111c82b06e579ba8b89ea33..5cf061e7cd822154c7d0b521305bcca30a911e32 100644 (file)
@@ -835,7 +835,7 @@ namespace PETScWrappers
                                        // PETScWrappers::MPI::Vector), but we
                                        // can save some work if the addend is
                                        // zero
-      if (value == 0)
+      if (value == PetscScalar())
         return *this;
       
                                        // use the PETSc function to add something
@@ -873,7 +873,7 @@ namespace PETScWrappers
                                        // PETScWrappers::MPI::Vector), but we
                                        // can save some work if the addend is
                                        // zero
-      if (value == 0)
+      if (value == PetscScalar())
         return *this;
 
                                        // use the PETSc function to add something

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.