]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Final version of the test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Jul 2013 16:41:19 +0000 (16:41 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Jul 2013 16:41:19 +0000 (16:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@30012 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/work_stream_03.cc

index eec7d029922d000ef744cf866cd15e266d53bdd6..0acc74a6abc6d1ef65fbf9347792129f093dfbd3 100644 (file)
@@ -89,8 +89,17 @@ zero_subrange(const unsigned int begin, const unsigned int end,
     dst[i] = 0;
 }
 
+
+void
+zero_element(std::vector<double> &dst,
+            const unsigned int i)
+{
+  dst[i] = 0;
+}
+
+
 template<int dim>
-  void
+void
   mass_assembler(const typename Triangulation<dim>::active_cell_iterator &cell,
       Scratch<dim> &data, CopyData &copy_data)
   {
@@ -98,25 +107,26 @@ template<int dim>
 
     const Point<dim> q = data.x_fe_values.quadrature_point(0);
 
-    // this appears to be the key: the following line overwrites some of the memory
-    // in which we store the quadrature point location. if the line is moved down,
-    // the comparison in the if() always succeeds...
+    // this appears to be the key: the following two ways both overwrite some
+    // of the memory in which we store the quadrature point location.
     parallel::apply_to_subranges(0U, copy_data.cell_rhs.size(),
         std_cxx1x::bind(&zero_subrange, std_cxx1x::_1, std_cxx1x::_2,
             std_cxx1x::ref(copy_data.cell_rhs)), 1);
 
-    std::cout << (q != data.x_fe_values.quadrature_point(0) ? '.' : '*')
-        << std::flush;
+    Assert(q == data.x_fe_values.quadrature_point(0),
+        ExcInternalError());
 
     copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0));
   }
 
+
 void
 copy_local_to_global(const CopyData &data, double *sum)
 {
   *sum += data.cell_rhs[0];
 }
 
+
 void
 do_project()
 {
@@ -141,7 +151,8 @@ do_project()
           &mass_assembler<dim>,
           std_cxx1x::bind(&copy_local_to_global, std_cxx1x::_1, &sum),
           assembler_data, copy_data, 8, 1);
-      printf("\nCheck: %5.3f\n", sum);
+
+      Assert (std::fabs(sum-288.) < 1e-12, ExcInternalError());
       deallog << sum << std::endl;
     }
 }

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.