From b5e902cf78ddec4f47c31ac71b68564490e91141 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 22 Mar 2015 05:38:03 -0500 Subject: [PATCH] Improve an error message about a case that can happen but is not implemented. --- source/grid/tria.cc | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/source/grid/tria.cc b/source/grid/tria.cc index a6f115f7a0..0bbb1cc664 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1540,10 +1540,32 @@ namespace internal case 2: break; default: - // a node must have one - // or two adjacent - // lines - AssertThrow (false, ExcInternalError()); + // in 1d, a node must have one or two adjacent lines + if (spacedim==1) + AssertThrow (false, ExcInternalError()) + else + AssertThrow (false, + ExcMessage ("You have a vertex in your triangulation " + "at which more than two cells come together. " + "(For one dimensional triangulation, cells are " + "line segments.)" + "\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 vertex), 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 vertex, " + "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 vertices have the same " + "value, using the ConstraintMatrix class.")); } // assert there are no more -- 2.39.5