// a node must have one
// or two adjacent
// lines
-
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here,
- // as the subscriptions
- // were for the
- // initially empty
- // grid, and we want to
- // clear it again now,
- // so temporarily
- // disable
- // subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions ();
AssertThrow (false, ExcInternalError());
};
// two boundary nodes
if (boundary_nodes != 2)
{
- // clear will only work if
- // there are no
- // subscriptions. however, this
- // is bogus here, as the
- // subscriptions were for the
- // initially empty grid, and we
- // want to clear it again now,
- // so temporarily disable
- // subscriptions, clear, and
- // then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcInternalError());
};
// error message
const unsigned int n_vertices = vertices.size();
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially
- // empty grid, and we
- // want to clear it again
- // now, so temporarily
- // disable subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
Assert (false,
ExcInvalidVertexIndex (cell, cells[cell].vertices[vertex],
==
needed_lines.end()))
{
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here,
- // as the subscriptions
- // were for the
- // initially empty
- // grid, and we want to
- // clear it again now,
- // so temporarily
- // disable
- // subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false,
ExcGridHasInvalidCell(cell));
if ( ! (* (std::min_element(vertex_touch_count.begin(),
vertex_touch_count.end())) >= 2))
{
- // clear will only work if
- // there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially empty
- // grid, and we want to
- // clear it again now, so
- // temporarily disable
- // subscriptions, clear,
- // and then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcGridHasInvalidVertices());
};
if (! ((n_adj_cells >= 1) &&
(n_adj_cells <= 2)))
{
- // clear will only work if
- // there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially empty
- // grid, and we want to
- // clear it again now, so
- // temporarily disable
- // subscriptions, clear,
- // and then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcInternalError());
};
else
{
// line does not exist
-
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here,
- // as the subscriptions
- // were for the
- // initially empty
- // grid, and we want to
- // clear it again now,
- // so temporarily
- // disable
- // subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcLineInexistant(line_vertices.first,
line_vertices.second));
if (line->boundary_indicator() != 0 &&
line->boundary_indicator() != 255)
{
- // clear will only work if
- // there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially empty
- // grid, and we want to
- // clear it again now, so
- // temporarily disable
- // subscriptions, clear,
- // and then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcMultiplySetLineInfoOfLine(
line_vertices.first, line_vertices.second));
// are given a boundary indicator
if (line->boundary_indicator() == 255)
{
- // same as above
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcInteriorLineCantBeBoundary());
};
// include it in the
// error message
const unsigned int n_vertices = vertices.size();
-
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially
- // empty grid, and we
- // want to clear it again
- // now, so temporarily
- // disable subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+
+ clear_despite_subscriptions();
AssertThrow (false,
ExcInvalidVertexIndex (cell, cells[cell].vertices[vertex],
==
needed_lines.end()))
{
- // clear will only work
- // if there are no
- // subscriptions. however,
- // this is bogus here,
- // as the subscriptions
- // were for the
- // initially empty
- // grid, and we want to
- // clear it again now,
- // so temporarily
- // disable
- // subscriptions,
- // clear, and then set
- // them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcGridHasInvalidCell(cell));
};
if (! (* (std::min_element(vertex_touch_count.begin(),
vertex_touch_count.end())) >= 3))
{
- // clear will only work if
- // there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially empty
- // grid, and we want to
- // clear it again now, so
- // temporarily disable
- // subscriptions, clear,
- // and then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcGridHasInvalidVertices());
};
if (! ((n_adj_cells >= 1) &&
(n_adj_cells <= 2)))
{
- // clear will only work if
- // there are no
- // subscriptions. however,
- // this is bogus here, as
- // the subscriptions were
- // for the initially empty
- // grid, and we want to
- // clear it again now, so
- // temporarily disable
- // subscriptions, clear,
- // and then set them again
- const unsigned int n=n_subscriptions();
- for (unsigned int i=0; i<n; ++i)
- unsubscribe();
- clear ();
- for (unsigned int i=0; i<n; ++i)
- subscribe();
+ clear_despite_subscriptions();
AssertThrow (false, ExcInternalError());
};
}
+template<int dim>
+void
+Triangulation<dim>::clear_despite_subscriptions()
+{
+ // disable subscriptions, clear,
+ // and then set them again
+ const unsigned int n=n_subscriptions();
+ for (unsigned int i=0; i<n; ++i)
+ unsubscribe();
+ clear ();
+ for (unsigned int i=0; i<n; ++i)
+ subscribe();
+}
+
+
#if deal_II_dimension == 1
template <>