]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix one bug in the computation of the value of the solution in the neighbor cell...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Dec 2003 15:36:51 +0000 (15:36 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Dec 2003 15:36:51 +0000 (15:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@8254 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/c-4-0.html
deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif
deal.II/examples/step-9/step-9.cc

index 012c4cb7cc2c580f6c2298620d43d427fa60b429..e0d5dde0f12131f45f463c0573aa2c2e6e6f8e0b 100644 (file)
@@ -79,6 +79,16 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>General</h3>
 
 <ol>
+  <li> <p>
+       Fixed: <code>step-9</code> had the computation of the value of the
+       solution in the mid-point of the neighbor cell wrong. This is now
+       fixed. Consequently, the resulting mesh also looks much nicer now (much
+       smoother). 
+       <br> 
+       (<a href="mailto:werner.scholz@tuwien.ac.at">Werner Scholz</a>
+        2003/12/11)
+       </p>
+
   <li> <p>
        New: The <code>config.h</code> file now declares a variable <code
        class="member">deal_II_numbers::invalid_unsigned_int</code>.
index 91c55c068e3e6a689fd053a53e1fd951120b808f..d46812483688bd633b244aecc5f89fb8f124ec51 100644 (file)
Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif differ
index bedbda9b031d40ce773834cd0ad52a17bcc597cc..32da47f75fe05338243c5fc7f6e436eef5f2ecec 100644 (file)
@@ -1924,9 +1924,19 @@ GradientEstimation::estimate_interval (const DoFHandler<dim> &dof_handler,
       fe_midpoint_value.get_function_values (solution, this_midpoint_value);
                
 
-                                      // Now loop over all active
-                                      // neighbors and collect the
-                                      // data we need.
+                                      // Now loop over all active neighbors
+                                      // and collect the data we
+                                      // need. Allocate a vector just like
+                                      // ``this_midpoint_value'' which we
+                                      // will use to store the value of the
+                                      // solution in the midpoint of the
+                                      // neighbor cell. We allocate it here
+                                      // already, since that way we don't
+                                      // have to allocate memory repeatedly
+                                      // in each iteration of this inner loop
+                                      // (memory allocation is a rather
+                                      // expensive operation):
+      std::vector<double> neighbor_midpoint_value(1);
       typename std::vector<typename DoFHandler<dim>::active_cell_iterator>::const_iterator
        neighbor_ptr = active_neighbors.begin();
       for (; neighbor_ptr!=active_neighbors.end(); ++neighbor_ptr)
@@ -1943,15 +1953,15 @@ GradientEstimation::estimate_interval (const DoFHandler<dim> &dof_handler,
                                           // the value of the finite
                                           // element function
                                           // thereon. Note that for
-                                          // these information we
+                                          // this information we
                                           // have to reinitialize the
                                           // ``FEValues'' object for
                                           // the neighbor cell.
          fe_midpoint_value.reinit (neighbor);
          const Point<dim> neighbor_center = fe_midpoint_value.quadrature_point(0);
 
-         std::vector<double> neighbor_midpoint_value(1);
-         fe_midpoint_value.get_function_values (solution, this_midpoint_value);
+         fe_midpoint_value.get_function_values (solution,
+                                                 neighbor_midpoint_value);
 
                                           // Compute the vector ``y''
                                           // connecting the centers

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.