]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
remove calls to compress() without arguments from all deal steps, add missing calls...
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 23:23:18 +0000 (23:23 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 23:23:18 +0000 (23:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@28351 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-17/step-17.cc
deal.II/examples/step-18/step-18.cc
deal.II/examples/step-40/step-40.cc

index 45756bebeababd6b543a453709b4005d1c34f596..f90d693cab8fadb55256e265d5ea4e0344d337d7 100644 (file)
@@ -497,21 +497,20 @@ namespace Step17
           // not be associated with the cell we are presently treating, and
           // are therefore not represented in the local matrix and vector),
           // but it can be done while distributing the local system to the
-          // global one. This is what the following two calls do, i.e. they
+          // global one. This is what the following call does, i.e. we
           // distribute to the global objects and at the same time make sure
           // that hanging node constraints are taken care of:
           cell->get_dof_indices (local_dof_indices);
           hanging_node_constraints
-          .distribute_local_to_global (cell_matrix,
+          .distribute_local_to_global(cell_matrix, cell_rhs,
                                        local_dof_indices,
-                                       system_matrix);
-
-          hanging_node_constraints
-          .distribute_local_to_global (cell_rhs,
-                                       local_dof_indices,
-                                       system_rhs);
+                                       system_matrix, system_rhs);
         }
 
+    // Now compress the vector and the system matrix:
+    system_matrix.compress();
+    system_rhs.compress(VectorOperation::add);
+
     // The global matrix and right hand side vectors have now been
     // formed. Note that since we took care of this already above, we do not
     // have to condense away hanging node constraints any more.
@@ -601,11 +600,6 @@ namespace Step17
     // a distributed vector that has all the constrained nodes fixed.
     solution = localized_solution;
 
-    // After this has happened, flush the PETSc buffers. This may or may not
-    // be strictly necessary here (the PETSc documentation is not very verbose
-    // on these things), but certainly doesn't hurt either.
-    solution.compress ();
-
     // Finally return the number of iterations it took to converge, to allow
     // for some output:
     return solver_control.last_step();
@@ -827,7 +821,7 @@ namespace Step17
     for (unsigned int i=0; i<local_error_per_cell.size(); ++i)
       if (local_error_per_cell(i) != 0)
         distributed_all_errors(i) = local_error_per_cell(i);
-    distributed_all_errors.compress ();
+    distributed_all_errors.compress (VectorOperation::insert);
 
 
     // So now we have this distributed vector out there that contains the
index 8f5940cb2a135f267fce9e8454a8b9131b69b227..838627b7290bd40c841a666f1ac6c0c897efa24c 100644 (file)
@@ -1135,16 +1135,16 @@ namespace Step18
           cell->get_dof_indices (local_dof_indices);
 
           hanging_node_constraints
-          .distribute_local_to_global (cell_matrix,
+           .distribute_local_to_global (cell_matrix, cell_rhs,
                                        local_dof_indices,
-                                       system_matrix);
-
-          hanging_node_constraints
-          .distribute_local_to_global (cell_rhs,
-                                       local_dof_indices,
-                                       system_rhs);
+                                        system_matrix, system_rhs);
         }
 
+    // Now compress the vector and the system matrix:
+    system_matrix.compress();
+    system_rhs.compress(VectorOperation::add);
+
+    
     // The last step is to again fix up boundary values, just as we already
     // did in previous programs. A slight complication is that the
     // <code>apply_boundary_values</code> function wants to have a solution
@@ -1634,7 +1634,7 @@ namespace Step18
     for (unsigned int i=0; i<error_per_cell.size(); ++i)
       if (error_per_cell(i) != 0)
         distributed_error_per_cell(i) = error_per_cell(i);
-    distributed_error_per_cell.compress ();
+    distributed_error_per_cell.compress (VectorOperation::insert);
 
     // Once we have that, copy it back into local copies on all processors and
     // refine the mesh accordingly:
index 9b613a950578a05e7221f77a166d71d14b621335..7c074382585417b56e134d32b2b39c01287d6f0f 100644 (file)
@@ -393,7 +393,7 @@ namespace Step40
         }
 
     system_matrix.compress ();
-    system_rhs.compress ();
+    system_rhs.compress (VectorOperation::add);
   }
 
 

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.