From: Wolfgang Bangerth Date: Sun, 22 Mar 2015 10:42:04 +0000 (-0500) Subject: Also adjust the error message for the dim=2, spacedim>2 case. X-Git-Tag: v8.3.0-rc1~364^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b49371ddcb258a29fe158ed0f50a46440637c86;p=dealii.git Also adjust the error message for the dim=2, spacedim>2 case. --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 0bbb1cc664..fd09c2ac06 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1840,11 +1840,37 @@ namespace internal line!=triangulation.end_line(); ++line) { const unsigned int n_adj_cells = adjacent_cells[line->index()].size(); - // assert that every line has - // one or two adjacent cells - AssertThrow ((n_adj_cells >= 1) && - (n_adj_cells <= 2), - ExcInternalError()); + + // assert that every line has one or two adjacent cells. + // this has to be the case for 2d triangulations in 2d. + // in higher dimensions, this may happen but is not + // implemented + if (spacedim==2) + AssertThrow ((n_adj_cells >= 1) && + (n_adj_cells <= 2), + ExcInternalError()) + else + AssertThrow ((n_adj_cells >= 1) && + (n_adj_cells <= 2), + ExcMessage ("You have a line in your triangulation " + "at which more than two cells come together. " + "\n\n" + "This is not currently supported because the " + "Triangulation class makes the assumption that " + "every cell has zero or one neighbors behind " + "each face (here, behind each line), but in your " + "situation there would be more than one." + "\n\n" + "Support for this is not currently implemented. " + "If you need to work with triangulations where " + "more than two cells come together at a line, " + "duplicate the vertices once per cell (i.e., put " + "multiple vertices at the same physical location, " + "but using different vertex indices for each) " + "and then ensure continuity of the solution by " + "explicitly creating constraints that the degrees " + "of freedom at these lines have the same " + "value, using the ConstraintMatrix class.")); // if only one cell: line is at // boundary -> give it the