<h3>Specific improvements</h3>
<ol>
-<li> Improved: FEFieldFunction allows now for the computation of laplacians.
+<li> Fixed: parallel::distributed::Triangulation::clear() forgot
+to update the number cache of this class, leading to wrong results
+when calling functions like
+parallel::distributed::Triangulation::n_global_active_cells();
+<br>
+(Wolfgang Bangerth, 2012/02/20)
+
+<ol>
+<li> Improved: FEFieldFunction allows now for the computation of Laplacians.
<br>
(Christian Goll, 2012/02/16)
p4est_tree_to_coarse_cell_permutation.resize (0);
dealii::Triangulation<dim,spacedim>::clear ();
+
+ update_number_cache ();
}
number_cache.n_locally_owned_active_cells.end(),
0);
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
- cell = this->begin_active();
- cell != this->end(); ++cell)
- if (cell->subdomain_id() == my_subdomain)
- ++number_cache.n_locally_owned_active_cells[my_subdomain];
+ if (this->n_levels() > 0)
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ cell = this->begin_active();
+ cell != this->end(); ++cell)
+ if (cell->subdomain_id() == my_subdomain)
+ ++number_cache.n_locally_owned_active_cells[my_subdomain];
unsigned int send_value
= number_cache.n_locally_owned_active_cells[my_subdomain];
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id: 2d_coarsening_01.cc 23710 2011-05-17 04:50:10Z bangerth $
+// Version: $Name$
+//
+// Copyright (C) 2008, 2009, 2012 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+// parallel::distributed::Triangulation<dim>::clear forgot to
+// update the number cache. check that this is fixed now.
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+
+
+
+template<int dim>
+void test()
+{
+ parallel::distributed::Triangulation<dim> tr (MPI_COMM_WORLD);
+
+ GridGenerator::hyper_cube(tr);
+ tr.refine_global(1);
+ deallog << tr.n_global_active_cells() << std::endl;
+
+ tr.clear ();
+ deallog << tr.n_global_active_cells() << std::endl;
+}
+
+
+int main(int argc, char *argv[])
+{
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Init (&argc,&argv);
+#else
+ (void)argc;
+ (void)argv;
+#endif
+
+ std::ofstream logfile("update_number_cache_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ deallog.push("2d");
+ test<2>();
+ deallog.pop();
+
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Finalize();
+#endif
+}