<h3>Specific improvements</h3>
<ol>
+ <li> Fixed: In 3d, when you set the <code>colorize</code> flag of
+ GridGenerator::hyper_shell(), the faces of the domain were colored but
+ the edges were not. This was an oversight because to refine correctly,
+ the edges also have to have the appropriate boundary indicator set.
+ <br>
+ (Wolfgang Bangerth, 2015/01/16)
+ </li>
+
<li> New: dealii::multithread_info.n_cpus returns the correct number of CPU
on FreeBSD.
<br>
* of cells of the resulting triangulation, i.e., how many cells form the
* ring (in 2d) or the shell (in 3d).
*
- * If the flag @p colorize is @p true, then the outer boundary will have the
- * indicator 1, while the inner boundary has id zero. If the flag is @p
- * false, both have indicator zero.
+ * If the flag @p colorize is @p true, then the outer boundary will
+ * have the indicator 1, while the inner boundary has id zero. In
+ * 3d, this applies to both the faces and the edges of these
+ * boundaries. If the flag is @p false, both have indicator zero.
*
* In 2d, the number <tt>n_cells</tt> of elements for this initial
* triangulation can be chosen arbitrarily. If the number of initial cells
cell != tria.end (); ++cell)
{
Assert(cell->face(2)->at_boundary(), ExcInternalError());
- cell->face (2)->set_boundary_indicator (1);
+ cell->face (2)->set_all_boundary_indicators (1);
}
}
{
Triangulation<3>::cell_iterator cell = tria.begin();
- cell->face(4)->set_boundary_indicator(1);
Assert (cell->face(4)->at_boundary(), ExcInternalError());
+ cell->face(4)->set_all_boundary_indicators(1);
- (++cell)->face(2)->set_boundary_indicator(1);
+ ++cell;
Assert (cell->face(2)->at_boundary(), ExcInternalError());
+ cell->face(2)->set_all_boundary_indicators(1);
- (++cell)->face(2)->set_boundary_indicator(1);
+ ++cell;
Assert (cell->face(2)->at_boundary(), ExcInternalError());
+ cell->face(2)->set_all_boundary_indicators(1);
- (++cell)->face(0)->set_boundary_indicator(1);
+ ++cell;
Assert (cell->face(0)->at_boundary(), ExcInternalError());
+ cell->face(0)->set_all_boundary_indicators(1);
- (++cell)->face(2)->set_boundary_indicator(1);
+ ++cell;
Assert (cell->face(2)->at_boundary(), ExcInternalError());
+ cell->face(2)->set_all_boundary_indicators(1);
- (++cell)->face(0)->set_boundary_indicator(1);
+ ++cell;
Assert (cell->face(0)->at_boundary(), ExcInternalError());
+ cell->face(0)->set_all_boundary_indicators(1);
}
else if (tria.n_cells() == 12)
{
cell != tria.end(); ++cell)
{
Assert (cell->face(5)->at_boundary(), ExcInternalError());
- cell->face(5)->set_boundary_indicator(1);
+ cell->face(5)->set_all_boundary_indicators(1);
}
}
else if (tria.n_cells() == 96)
cell != tria.end(); ++cell)
if (cell->face(5)->at_boundary())
{
- cell->face(5)->set_boundary_indicator(1);
+ cell->face(5)->set_all_boundary_indicators(1);
++count;
}
Assert (count == 48, ExcInternalError());
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2007 - 2015 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// GridGenerator::hyper_shell colorized the faces but forgot the
+// edges. This is not useful because the colorization is usually done
+// so that one can attach a boundary or manifold object to these parts
+// of the boundary
+
+#include "../tests.h"
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/base/logstream.h>
+#include <cmath>
+#include <cstdlib>
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+
+std::ofstream logfile("output");
+
+
+template<int dim>
+void check (double r1, double r2, unsigned int n)
+{
+ Point<dim> center;
+ Triangulation<dim> tria (Triangulation<dim>::none);
+ GridGenerator::hyper_shell (tria, center, r1, r2, n, true);
+ static const HyperShellBoundary<dim> boundary(center);
+ tria.set_boundary(0, boundary);
+
+ for (typename Triangulation<dim>::cell_iterator cell=tria.begin();
+ cell != tria.end(); ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->face(f)->at_boundary())
+ for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_face; ++l)
+ Assert (cell->face(f)->line(l)->boundary_indicator()
+ ==
+ cell->face(f)->boundary_indicator(),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ deallog << std::setprecision(3);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check<3> (.5, 1, 6);
+ check<3> (.5, 1, 12);
+ check<3> (.5, 1, 96);
+}
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK