]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix the computation of cell_constitution for the parallel case
authorfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Feb 2013 22:28:57 +0000 (22:28 +0000)
committerfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Feb 2013 22:28:57 +0000 (22:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@28496 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f2506e2b5d985767d520e117cb9a2af4040c200c..a24556b2c2db3e0bfbe6d1ba235ce6385dc0ee4e 100644 (file)
@@ -896,7 +896,7 @@ namespace Step42
     unsigned int elast_points = 0;
     unsigned int plast_points = 0;
     double       yield = 0;
-    unsigned int cell_number = 0;
+    double       cell_number = 0;
     cell_constitution = 0;
 
     for (; cell!=endc; ++cell)
@@ -918,6 +918,7 @@ namespace Step42
 
               plast_lin_hard->plast_linear_hardening (stress_strain_tensor, strain_tensor[q_point],
                                                       elast_points, plast_points, yield);
+
               cell_constitution (cell_number) += yield;
               for (unsigned int i=0; i<dofs_per_cell; ++i)
                 {
@@ -961,9 +962,15 @@ namespace Step42
               system_rhs_newton);
 
           cell_number += 1;
+        }
+      else
+        {
+          cell_constitution (cell_number) = 0;
+          cell_number += 1;
         };
 
     cell_constitution /= n_q_points;
+    cell_constitution.compress (VectorOperation::add);
     system_rhs_newton.compress (VectorOperation::add);
 
     unsigned int sum_elast_points = Utilities::MPI::sum(elast_points, mpi_communicator);

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.