]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Mask max/min operations until it is clear what this means for complex numbers.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 10 Mar 2014 10:15:30 +0000 (10:15 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 10 Mar 2014 10:15:30 +0000 (10:15 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32631 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/grid_refinement.cc

index ced9477136bd5b0f02487bd319fac851da1ddd5a..9fe43f0c4d2324c7bc56f8bf9f79976a4ffd5067 100644 (file)
@@ -62,35 +62,33 @@ namespace
 
 
 #ifdef DEAL_II_WITH_PETSC
+#ifndef PETSC_USE_COMPLEX
     PetscScalar
     max_element (const PETScWrappers::Vector &criteria)
     {
-      // this is horribly slow (since we have
-      // to get the array of values from PETSc
-      // in every iteration), but works
+      // this is horribly slow (since we have to get the array of
+      // values from PETSc in every iteration), but works
       PetscScalar m = 0;
-      // @whattodo How do we get the maximum element of a complex vector? This only makes sense in real.
-      // for (unsigned int i=0; i<criteria.size(); ++i)
-      //   m = std::max (m, criteria(i));
+      for (unsigned int i=0; i<criteria.size(); ++i)
+       m = std::max (m, criteria(i));
       Assert ((false), ExcMessage ("This function is corrupt: @whattodo"));
       return m;
     }
-
-
+    
+    
     PetscScalar
     min_element (const PETScWrappers::Vector &criteria)
     {
-      // this is horribly slow (since we have
-      // to get the array of values from PETSc
-      // in every iteration), but works
+      // this is horribly slow (since we have to get the array of
+      // values from PETSc in every iteration), but works
       PetscScalar m = criteria(0);
-      // @whattodo How do we get the minimum element of a complex vector? This only makes sense in real.
-      // for (unsigned int i=1; i<criteria.size(); ++i)
-      //   m = std::min (m, criteria(i));
+      for (unsigned int i=1; i<criteria.size(); ++i)
+       m = std::min (m, criteria(i));
       Assert ((false), ExcMessage ("This function is corrupt: @whattodo"));
       return m;
     }
 #endif
+#endif
 
 
 #ifdef DEAL_II_WITH_TRILINOS

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.