]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
By-pass a load of errors until we figure out how to deal with them - grep @whattodo.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 13:21:55 +0000 (13:21 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Oct 2013 13:21:55 +0000 (13:21 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31083 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/algorithms/operator.templates.h
deal.II/include/deal.II/lac/block_vector_base.h
deal.II/include/deal.II/lac/constraint_matrix.templates.h
deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/include/deal.II/numerics/vector_tools.templates.h
deal.II/source/fe/fe_tools_interpolate.cc
deal.II/source/fe/fe_values.cc
deal.II/source/grid/grid_refinement.cc
deal.II/source/numerics/matrix_tools.cc

index 173d10b9b733de1a6ad25d2a818338018988d5c8..d3bb3a047aa39f3b3470e51d053a005c37deea26 100644 (file)
@@ -72,11 +72,15 @@ namespace Algorithms
       }
     else
       {
-        (*os) << ' ' << step;
-        for (unsigned int i=0; i<vectors.size(); ++i)
-          for (unsigned int j=0; j<vectors(i)->size(); ++j)
-            (*os) << ' ' << (*vectors(i))(j);
-        (*os) << std::endl;
+        /* (*os) << ' ' << step; */
+        /* for (unsigned int i=0; i<vectors.size(); ++i) */
+        /*   for (unsigned int j=0; j<vectors(i)->size(); ++j) */
+        /*     (*os) << ' ' << (*vectors(i))(j); */
+        /* (*os) << std::endl; */
+
+       Assert ((false),
+               ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                           "but this function is not defined for complex types."));
       }
     return *this;
   }
index 899112340815188fc595d0007dc8c4210b792de8..c1285ef8f4d7a3e3cece857962662609715dfcdd 100644 (file)
@@ -2046,10 +2046,17 @@ typename BlockVectorBase<VectorType>::value_type
 BlockVectorBase<VectorType>::mean_value () const
 {
   value_type sum = 0.;
-  for (size_type i=0; i<n_blocks(); ++i)
-    sum += components[i].mean_value() * components[i].size();
 
-  return sum/size();
+/* @whattodo */
+  /* for (size_type i=0; i<n_blocks(); ++i) */
+  /* sum += components[i].mean_value() * components[i].size(); */
+  /* 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."));
+  
+  return sum;
 }
 
 
@@ -2568,10 +2575,17 @@ void BlockVectorBase<VectorType>::extract_subvector_to (ForwardIterator
                                                         const ForwardIterator    indices_end,
                                                         OutputIterator           values_begin) const
 {
-  while (indices_begin != indices_end) {
-    *values_begin = operator()(*indices_begin);
-    indices_begin++; values_begin++;
-  }
+  while (indices_begin != indices_end) 
+    {
+/* @whattodo */
+      /* *values_begin = operator()(*indices_begin); */
+      
+      Assert ((false),
+             ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                         "but this function is not defined for complex types."));
+      
+      indices_begin++; values_begin++;
+    }
 }
 
 #endif // DOXYGEN
index 4a1ce1888cdd58a7a0662e36c3b73026373b4371..ffcea009a9ceedb58d569640719d1b8d94318361 100644 (file)
@@ -861,7 +861,13 @@ distribute_local_to_global (const Vector<double>            &local_vector,
 
   const size_type n_local_dofs = local_vector.size();
   if (lines.empty())
-    global_vector.add(local_dof_indices, local_vector);
+    {
+/* @whattodo */
+    //    global_vector.add(local_dof_indices, local_vector);
+    Assert ((false),
+            ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                        "but this function is not defined for complex types."));
+    }
   else
     for (size_type i=0; i<n_local_dofs; ++i)
       {
@@ -2243,7 +2249,14 @@ add_this_index:
             // inhomogeneity, we set those to:
             //    inhomogeneity(i)*global_matrix (i,i).
             if (use_inhomogeneities_for_rhs == true)
-              global_vector(global_row) += constraints.get_inhomogeneity(global_row) * new_diagonal;
+             {
+/* @whattodo */
+               /* global_vector(global_row) += constraints.get_inhomogeneity(global_row) * new_diagonal; */
+
+               Assert ((false),
+                       ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                                   "but this function is not defined for complex types."));
+             }
           }
       }
   }
@@ -2590,9 +2603,13 @@ ConstraintMatrix::distribute_local_to_global (
         }
     }
 
-  internals::set_matrix_diagonals (global_rows, local_dof_indices,
-                                   local_matrix, *this,
-                                   global_matrix, global_vector, use_inhomogeneities_for_rhs);
+/* @whattodo */
+  /* internals::set_matrix_diagonals (global_rows, local_dof_indices, */
+  /*                                  local_matrix, *this, */
+  /*                                  global_matrix, global_vector, use_inhomogeneities_for_rhs); */
+  Assert ((false),
+         ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                     "but this function is not defined for complex types."));
 }
 
 
@@ -2644,7 +2661,14 @@ ConstraintMatrix::distribute_local_to_global (
       Assert (n_values == (size_type)(val_ptr - &vals[0]),
               ExcInternalError());
       if (n_values > 0)
-        global_matrix.add(row, n_values, &cols[0], &vals[0], false, true);
+/* @whattodo */
+        /* global_matrix.add(row, n_values, &cols[0], &vals[0], false, true); */
+       {
+         Assert ((false),
+                 ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                             "but this function is not defined for complex types."));
+       }
+       
     }
 }
 
index 709e1e61859ab34fd4ccce6ded37945cbc72cf53..930aef000b4666a6202cf39624abad33bd7da29b 100644 (file)
@@ -1263,29 +1263,19 @@ namespace PETScWrappers
 
     // if we are dealing
     // with a parallel vector
-    if (ghosted )
+    if (ghosted)
     {
 
       int ierr;
 
-      // there is the possibility
-      // that the vector has
-      // ghost elements. in that
-      // case, we first need to
-      // figure out which
-      // elements we own locally,
-      // then get a pointer to
-      // the elements that are
-      // stored here (both the
-      // ones we own as well as
-      // the ghost elements). in
-      // this array, the locally
-      // owned elements come
-      // first followed by the
-      // ghost elements whose
-      // position we can get from
-      // an index set
-      PetscInt begin, end, i;
+      // there is the possibility that the vector has ghost
+      // elements. in that case, we first need to figure out which
+      // elements we own locally, then get a pointer to the elements
+      // that are stored here (both the ones we own as well as the
+      // ghost elements). in this array, the locally owned elements
+      // come first followed by the ghost elements whose position we
+      // can get from an index set
+      PetscInt begin, end;
       ierr = VecGetOwnershipRange (vector, &begin, &end);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -1301,22 +1291,29 @@ namespace PETScWrappers
       ierr = VecGetArray(locally_stored_elements, &ptr);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-      for (i = 0; i < n_idx; i++) {
+      for (PetscInt i=0; i<n_idx; i++) {
         const unsigned int index = *(indices_begin+i);
         if ( index>=static_cast<unsigned int>(begin)
             && index<static_cast<unsigned int>(end) )
         {
           //local entry
-          *(values_begin+i) = *(ptr+index-begin);
+/* @whattodo */
+//       *(values_begin+i) = *(ptr+index-begin);  
+
+/* @testcheck */
+         /* std::double<double> cheese = *(values_begin+i);  */
+         /* PetscScalar fish = *(ptr+index-begin); ok */ 
+/* @endtestcheck */
         }
         else
         {
           //ghost entry
-          const unsigned int ghostidx
-          = ghost_indices.index_within_set(index);
+         const unsigned int ghostidx  
+           = ghost_indices.index_within_set(index); 
 
-          Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError());
-          *(values_begin+i) = *(ptr+ghostidx+end-begin);
+         Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError()); 
+/* @whattodo */
+//          *(values_begin+i) = *(ptr+ghostidx+end-begin);
         }
       }
 
@@ -1348,7 +1345,8 @@ namespace PETScWrappers
         Assert(index>=static_cast<unsigned int>(begin)
             && index<static_cast<unsigned int>(end), ExcInternalError());
 
-        *(values_begin+i) = *(ptr+index-begin);
+/* @whattodo */
+        /* *(values_begin+i) = *(ptr+index-begin); */
       }
 
       ierr = VecRestoreArray(vector, &ptr);
index 92670d6ac538eff66dd03c26faa2f95f1318122f..46c67c939eba154e958ca451ba968c3d82f00e1e 100644 (file)
@@ -5594,7 +5594,12 @@ namespace VectorTools
         for (unsigned int i=0; i<n; ++i)
           if (p_select[i])
             {
-              s += v(i);
+/* @whattodo */
+              /* s += v(i); */
+
+             Assert ((false),
+                     ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                                 "but this function is not defined for complex types."));
               ++counter;
             }
         // Error out if we have not constrained anything. Note that in this
index 8eef0c9e124eb6e95c4b62898729238aaec9dd1f..8781932709530ea0daec84c1bc7ec02e416d974c 100644 (file)
@@ -222,7 +222,8 @@ namespace FETools
     for (types::global_dof_index i=0; i<dof2.n_dofs(); ++i)
       if (locally_owned_dofs.is_element(i))
         {
-          Assert(touch_count(i)!=0, ExcInternalError());
+// @whattodo
+          // Assert(touch_count(i)!=0, ExcInternalError());
           u2(i) /= touch_count(i);
         }
 
index a94336f66913db8c52b65fe0787968874e2d57db..c7ada43c1c9c6a647d02d223a62b040869e711a2 100644 (file)
@@ -44,7 +44,8 @@ namespace
   get_vector_element (const VectorType &vector,
                       const types::global_dof_index cell_number)
   {
-    return vector[cell_number];
+// @whattodo
+    // return vector[cell_number];
   }
 
 
index 1de5c7b1acba704de80b05b2a5f9220773311a61..4836cc71ee5011ab759f410c94fc366140d4900e 100644 (file)
@@ -69,8 +69,12 @@ namespace
       // to get the array of values from PETSc
       // in every iteration), but works
       PetscScalar m = 0;
-      for (unsigned int i=0; i<criteria.size(); ++i)
-        m = std::max (m, criteria(i));
+// @whattodo
+      // for (unsigned int i=0; i<criteria.size(); ++i)
+      //   m = std::max (m, criteria(i));
+      Assert ((false),
+             ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                         "but this function is not defined for complex types."));
       return m;
     }
 
@@ -82,8 +86,12 @@ namespace
       // to get the array of values from PETSc
       // in every iteration), but works
       PetscScalar m = criteria(0);
-      for (unsigned int i=1; i<criteria.size(); ++i)
-        m = std::min (m, criteria(i));
+// @whattodo
+      // for (unsigned int i=1; i<criteria.size(); ++i)
+      //   m = std::min (m, criteria(i));
+      Assert ((false),
+             ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex "
+                         "but this function is not defined for complex types."));
       return m;
     }
 #endif
index 84004b00796a02299224d2e4b8b6db31ce8c9de0..92f1f1f8295b6392a12412706275dc9f9f2e82d5 100644 (file)
@@ -2420,23 +2420,24 @@ namespace MatrixTools
         // entry from within the part of the
         // matrix that we can see. if we can't
         // 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);
-        for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
-          if (matrix.diag_element(i) != std::complex<double> (0,0)) // PETSC_NULL?
-            {
-              average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
-              break;
-            }
-#endif
+
+// @whattodo Note: this is a real mess, though no harder to fix than
+// the other messes (cast?). Please compare with trunk before making
+// any serious changes here!
+       PetscScalar average_nonzero_diagonal_entry;
+        // 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;
+        //     }
+
+// @testcheck
+        // PetscScalar average_nonzero_diagonal_entry = (PetscScalar) std::complex<double> (1,1);
+        // for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
+        //   if (matrix.diag_element(i) != std::complex<double> (0,0)) // PETSC_NULL?
+// @endtestcheck
 
         // figure out which rows of the matrix we
         // have to eliminate on this processor
@@ -2460,7 +2461,7 @@ namespace MatrixTools
         // preserving it. this is different from
         // the case of deal.II sparse matrices
         // treated in the other functions.
-        matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
+       matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
 
         std::vector<types::global_dof_index> indices;
         std::vector<PetscScalar>  solution_values;

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.