/*
5: An error occurred in line <4586> of file </scratch/deal-trunk/deal.II/include/deal.II/numerics/vector_tools.templates.h> in function
5: void dealii::VectorTools::compute_no_normal_flux_constraints(const DH<dim, spacedim>&, unsigned int, const std::set<unsigned char>&, dealii::ConstraintMatrix&, const dealii::Mapping<dim, spacedim>&) [with int dim = 3; DH = dealii::DoFHandler; int spacedim = 3]
-5: The violated condition was:
+5: The violated condition was:
5: contribution->second.size() == dim-1
5: The name and call sequence of the exception was:
5: ExcNotImplemented()
-
+
*/
+// The problem comes down to this: The domain (a box with a cylinder
+// through it) is discretized with eight cells that go around the
+// perimeter of the cylinder and are extruded to full height in
+// z-direction. In particular, for the top and bottom surfaces, there
+// is a cell edge from the circle to the corners of the top and bottom
+// outer squares (as well as an edge from the circle to the midpoints
+// of the sides of the squares).
+//
+// now, we try to compute the boundary conditions for no normal flux
+// with a set of boundary indicators that includes the top part of the
+// domain plus one of the four outer sides of the box. consider what
+// happens at one of the vertices of the box that are part of both the
+// top and the selected side: there, one of the eight cells of the
+// mesh contributes two normal vectors (one from its top face and from
+// its "side" face) but since at each of the eight vertices of the box
+// two cells come together, there is also a cell that contributes only
+// one normal vector (because it has one face at the top surface, but
+// its other outer face does not have a selected boundary
+// indicator). we used to be unable to deal with this situation where
+// one cell contributed twice and another only once. this has been
+// fixed now by simply ignoring the one that contributes only once.
+
#include "../tests.h"
#include <grid/tria.h>
// indicator 6 = cylinder
GridGenerator::hyper_cube_with_cylindrical_hole (tria, 0.25, 0.5, 0.5, 1, true);
-
+
/* std::string filename = "Mesh.eps";
std::ofstream output (filename.c_str());
GridOut grid_out;
grid_out.write_eps (tria, output);
*/
-
+
FESystem<dim> fe(FE_Q<dim>(1), dim);
DoFHandler<dim> dof_handler (tria);
dof_handler.distribute_dofs (fe);
std::set<unsigned char> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert (0); // x=0
no_normal_flux_boundaries.insert (5); // z=1
-
+
VectorTools::compute_no_normal_flux_constraints
(dof_handler, 0,
no_normal_flux_boundaries,