]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
tenporary fix for matrix.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Sep 2013 14:02:35 +0000 (14:02 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Sep 2013 14:02:35 +0000 (14:02 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31035 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/numerics/matrix_tools.cc

index ad3c1936a24f8b6d3655a1836389da0ca6454f87..136fd5baeef2dbdc63cb67a91e1a09eb88ec9af8 100644 (file)
@@ -2422,16 +2422,21 @@ namespace MatrixTools
         // find such an entry, take one
 #ifndef PETSC_USE_COMPLEX
         PetscScalar average_nonzero_diagonal_entry = 1;
+        for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
+          if (matrix.diag_element(i) != 0)
+            {
+              average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
+              break;
+            }
 #else
         PetscScalar average_nonzero_diagonal_entry = (PetscScalar) std::complex<double> (1,1);
-#endif
-
         for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
-          if (matrix.diag_element(i) != std::complex<double> (0,0))
+          if (matrix.diag_element(i) != std::complex<double> (0,0)) // PETSC_NULL?
             {
               average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
               break;
             }
+#endif
 
         // figure out which rows of the matrix we
         // have to eliminate on this processor

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.