]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add some more compress() calls
authorfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 22:24:32 +0000 (22:24 +0000)
committerfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 22:24:32 +0000 (22:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@28348 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-42/step-42.cc

index 71af1b8ced379ab3c06e1d4abc14d64776f8b955..e3a5a347357f503466ef7566176be8306f887f51 100644 (file)
@@ -774,7 +774,7 @@ namespace Step42
         diag_mass_matrix_vector (j) = mass_matrix.diag_element (j);
       number_iterations = 0;
 
-      diag_mass_matrix_vector.compress (VectorOperation::add);
+      diag_mass_matrix_vector.compress (VectorOperation::insert);
     }
   }
 
@@ -814,7 +814,6 @@ namespace Step42
 
     const FEValuesExtractors::Vector displacement (0);
 
-    TrilinosWrappers::MPI::Vector   test_rhs(solution);
     const double kappa = 1.0;
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
@@ -1132,7 +1131,7 @@ namespace Step42
                       active_set_locally_owned.add_index (index_z);
                   }
               }
-    distributed_solution.compress (VectorOperation::add);
+    distributed_solution.compress (VectorOperation::insert);
 
     unsigned int sum_contact_constraints = Utilities::MPI::sum(active_set_locally_owned.n_elements (),
                                                                mpi_communicator);
@@ -1225,6 +1224,8 @@ namespace Step42
 
     constraints_hanging_nodes.set_zero (distributed_solution);
     constraints_hanging_nodes.set_zero (system_rhs_newton);
+    distributed_solution.compress ();
+    system_rhs_newton.compress ();
 
     MPI_Barrier (mpi_communicator);
     t.restart();
@@ -1318,6 +1319,7 @@ namespace Step42
         t.restart();
         system_matrix_newton = 0;
         system_rhs_newton = 0;
+        system_matrix_newton.compress();
        system_rhs_newton.compress();
         assemble_nl_system (solution);  //compute Newton-Matrix
         MPI_Barrier (mpi_communicator);
@@ -1347,13 +1349,13 @@ namespace Step42
             a=std::pow(0.5, static_cast<double>(i));
             old_solution = tmp_vector;
             old_solution.sadd(1-a,a, distributed_solution);
+            old_solution.compress (VectorOperation::add);
 
             MPI_Barrier (mpi_communicator);
             t.restart();
             system_rhs_newton = 0;
            system_rhs_newton.compress();
 
-
             solution = old_solution;
             residual_nl_system (solution);
             res = system_rhs_newton;
@@ -1389,6 +1391,7 @@ namespace Step42
         resid_old=resid;
 
         resid_vector = system_rhs_newton;
+        resid_vector.compress (VectorOperation::insert);
 
         if (active_set == active_set_old && resid < 1e-10)
           break;

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.