// 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();
+
AssertThrow (false, ExcInternalError());
};
// 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();
+
AssertThrow (false, ExcInternalError());
};
if ( ! ((0<=cells[cell].vertices[vertex]) &&
(cells[cell].vertices[vertex]<static_cast<signed int>(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();
+
Assert (false,
ExcInvalidVertexIndex (cell, cells[cell].vertices[vertex], vertices.size()));
};
// this by rotating by one or three
// vertices, but deciding this is
// difficult and not implemented.
- for (unsigned int line=0; line<4; ++line)
- if (needed_lines.find(make_pair(line_vertices[line].second,
- line_vertices[line].first))
- !=
- needed_lines.end())
- {
- // rotate vertex numbers
- swap (cells[cell].vertices[0], cells[cell].vertices[2]);
- swap (cells[cell].vertices[1], cells[cell].vertices[3]);
- // remake lines
- line_vertices[0]
- = make_pair (cells[cell].vertices[0], cells[cell].vertices[1]);
- line_vertices[1]
- = make_pair (cells[cell].vertices[1], cells[cell].vertices[2]);
- line_vertices[2]
- = make_pair (cells[cell].vertices[0], cells[cell].vertices[3]);
- line_vertices[3]
- = make_pair (cells[cell].vertices[3], cells[cell].vertices[2]);
- // allow for only one such
- // rotation
- break;
- };
+// for (unsigned int line=0; line<4; ++line)
+// if (needed_lines.find(make_pair(line_vertices[line].second,
+// line_vertices[line].first))
+// !=
+// needed_lines.end())
+// {
+// // rotate vertex numbers
+// swap (cells[cell].vertices[0], cells[cell].vertices[2]);
+// swap (cells[cell].vertices[1], cells[cell].vertices[3]);
+// // remake lines
+// line_vertices[0]
+// = make_pair (cells[cell].vertices[0], cells[cell].vertices[1]);
+// line_vertices[1]
+// = make_pair (cells[cell].vertices[1], cells[cell].vertices[2]);
+// line_vertices[2]
+// = make_pair (cells[cell].vertices[0], cells[cell].vertices[3]);
+// line_vertices[3]
+// = make_pair (cells[cell].vertices[3], cells[cell].vertices[2]);
+// // allow for only one such
+// // rotation
+// break;
+// };
for (unsigned int line=0; line<4; ++line)
==
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();
+
AssertThrow (false,
ExcGridHasInvalidCell(cell));
};
if ( ! (* (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();
+
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();
+
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();
+
AssertThrow (false, ExcLineInexistant(line_vertices.first,
line_vertices.second));
};
// are given a boundary indicator
if (! (line->boundary_indicator() == 0))
{
+ // 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();
+
AssertThrow (false, ExcInteriorLineCantBeBoundary());
};
if (! ((0<=cells[cell].vertices[vertex]) &&
(cells[cell].vertices[vertex]<static_cast<signed int>(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();
+
AssertThrow (false,
ExcInvalidVertexIndex (cell, cells[cell].vertices[vertex],
vertices.size()));
==
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();
+
AssertThrow (false, ExcGridHasInvalidCell(cell));
};
if (! (* (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();
+
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();
+
AssertThrow (false, ExcInternalError());
};