]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug when there were as many degrees of freedom as there are cells (DG0 case...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 3 Mar 2003 15:22:30 +0000 (15:22 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 3 Mar 2003 15:22:30 +0000 (15:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@7260 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/data_out_stack.cc
deal.II/doc/news/2002/c-3-4.html

index 4f8cfcab6c9a529fc7a82303bc76d5d7b1c70c53..e6a1bbf6283b2eb254fdc59f2fec3297fdf74984 100644 (file)
@@ -166,12 +166,21 @@ void DataOutStack<dim>::add_data_vector (const Vector<number> &vec,
            data_vector->data.reinit (vec.size());
            std::copy (vec.begin(), vec.end(),
                       data_vector->data.begin());
-           break;
+           return;
          };
-      Assert (data_vector != dof_data.end(),
-             ExcVectorNotDeclared (names[0]));
+
+                                       // ok. not found. there is a
+                                       // slight chance that
+                                       // n_dofs==n_cells, so only
+                                       // bomb out if the next if
+                                       // statement will not be run
+      if (dof_handler->n_dofs() != dof_handler->get_tria().n_active_cells())
+        Assert (false, ExcVectorNotDeclared (names[0]));
     }
-  else
+
+                                   // search cell data
+  if ((vec.size() != dof_handler->n_dofs()) ||
+      (dof_handler->n_dofs() == dof_handler->get_tria().n_active_cells()))
     {
       typename std::vector<DataVector>::iterator data_vector=cell_data.begin();
       for (; data_vector!=cell_data.end(); ++data_vector)
@@ -180,11 +189,15 @@ void DataOutStack<dim>::add_data_vector (const Vector<number> &vec,
            data_vector->data.reinit (vec.size());
            std::copy (vec.begin(), vec.end(),
                       data_vector->data.begin());
-           break;
+           return;
          };
-      Assert (data_vector != cell_data.end(),
-             ExcVectorNotDeclared (names[0]));
+      Assert (false, ExcVectorNotDeclared (names[0]));
     };
+
+                                   // we have either return or Assert
+                                   // statements above, so shouldn't
+                                   // get here!
+  Assert (false, ExcInternalError());
 }
 
 
index 5ae27eb27f8f5e9c67a547e9a184e6b769b86200..18ebb7eec68e502e98f22ec55347760816f1e512 100644 (file)
@@ -66,7 +66,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        </p>
 
   <li> <p> 
-       Changed: Class and structures that are declared inside namespaces named
+       Changed: Classes and structures that are declared inside namespaces named
        <code class="class">internal</code> are now no longer shown in the class
        index view of the documentation of each of the sublibraries. Since they
        are supposed to be used internally only, this is no drawback for the
@@ -80,12 +80,12 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        Fixed: Some of the formulas in the step-14 tutorial were obviously 
        scrambled a little. This is now fixed.
        <br>
-       (WB 2003/01/30)
+       (Roy Stogner, WB 2003/01/30)
        </p>
 
   <li> <p> 
        Changed: The main Makefile has been changed to sequentialize building 
-       the base, lac, and deal.II subibraries. We changed this, since on some
+       the base, lac, and deal.II sublibraries. We changed this, since on some
        systems (notably AIX), the latter libraries need to be linked against
        the former ones, when creating shared libraries.
        <br>
@@ -739,6 +739,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>
+       Fixed: The <code class="class">DataOutStack</code> class had a problem
+       when there were as many degrees of freedom as there were cells (i.e. if
+       we were using DG0 elements). This should now be fixed.
+       <br>
+       (WB 2003/03/02)
+       </p>
+
   <li> <p>
        Fixed: The <code class="class">DataOutFaces</code> class was
        broken for cell data. It should now be correct, although the
@@ -856,8 +864,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        member function <code class="member">half_hyper_ball</code>,
        derived from member <code class="member">hyper_ball</code>.     
        The intial mesh contains four elements. This mesh will work with
-       the boundary class <code class="class">template <int dim> 
-       HalfHyperBallBoundary</code>.
+       the boundary class <code class="class">HalfHyperBallBoundary</code>.
        <br>
        (Brian Carnes 2002/12/16)
        </p>
@@ -1096,7 +1103,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        </p>
 
   <li> <p> Improved: Several functions like the <code
-       class="member">DoFHandler::distribute</code> and <code
+       class="member">DoFHandler::distribute_dofs</code> and <code
        class="member">DoFTools::make_flux_sparsity_pattern</code>
        functions altered the <code
        class="member">user_flags</code>. This was stated in the

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.