From 0a2faf889d2ac27915bbed6271d81e7659a94870 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 3 Mar 2003 15:22:30 +0000 Subject: [PATCH] Fix a bug when there were as many degrees of freedom as there are cells (DG0 case). Fix several small things in the news file. git-svn-id: https://svn.dealii.org/trunk@7260 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/source/numerics/data_out_stack.cc | 27 ++++++++++++++----- deal.II/doc/news/2002/c-3-4.html | 19 ++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/deal.II/deal.II/source/numerics/data_out_stack.cc b/deal.II/deal.II/source/numerics/data_out_stack.cc index 4f8cfcab6c..e6a1bbf628 100644 --- a/deal.II/deal.II/source/numerics/data_out_stack.cc +++ b/deal.II/deal.II/source/numerics/data_out_stack.cc @@ -166,12 +166,21 @@ void DataOutStack::add_data_vector (const Vector &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::iterator data_vector=cell_data.begin(); for (; data_vector!=cell_data.end(); ++data_vector) @@ -180,11 +189,15 @@ void DataOutStack::add_data_vector (const Vector &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()); } diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html index 5ae27eb27f..18ebb7eec6 100644 --- a/deal.II/doc/news/2002/c-3-4.html +++ b/deal.II/doc/news/2002/c-3-4.html @@ -66,7 +66,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

  • - Changed: Class and structures that are declared inside namespaces named + Changed: Classes and structures that are declared inside namespaces named internal 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.
    - (WB 2003/01/30) + (Roy Stogner, WB 2003/01/30)

  • 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.
    @@ -739,6 +739,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

    deal.II

      +
    1. + Fixed: The DataOutStack 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. +
      + (WB 2003/03/02) +

      +
    2. Fixed: The DataOutFaces 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 half_hyper_ball, derived from member hyper_ball. The intial mesh contains four elements. This mesh will work with - the boundary class template - HalfHyperBallBoundary. + the boundary class HalfHyperBallBoundary.
      (Brian Carnes 2002/12/16)

      @@ -1096,7 +1103,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

    3. Improved: Several functions like the DoFHandler::distribute and DoFHandler::distribute_dofs and DoFTools::make_flux_sparsity_pattern functions altered the user_flags. This was stated in the -- 2.39.5