From: Wolfgang Bangerth Date: Wed, 26 Apr 2006 04:19:34 +0000 (+0000) Subject: Triangulation::clear_user_flags_XXX X-Git-Tag: v8.0.0~11867 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faca6cf7fcfa1e65c85d3baaee15353bb7fcfc90;p=dealii.git Triangulation::clear_user_flags_XXX git-svn-id: https://svn.dealii.org/trunk@12905 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 798d4c2983..594f47cc75 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1753,7 +1753,12 @@ class Triangulation : public Subscriptor */ void load_user_flags (const std::vector &v); - /** + /** + * Clear all user flags on lines. + */ + void clear_user_flags_line (); + + /** * Save the user flags on lines. */ void save_user_flags_line (std::ostream &out) const; @@ -1776,6 +1781,11 @@ class Triangulation : public Subscriptor */ void load_user_flags_line (const std::vector &v); + /** + * Clear all user flags on quads. + */ + void clear_user_flags_quad (); + /** * Save the user flags on quads. */ @@ -1799,7 +1809,13 @@ class Triangulation : public Subscriptor */ void load_user_flags_quad (const std::vector &v); - /** + + /** + * Clear all user flags on quads. + */ + void clear_user_flags_hex (); + + /** * Save the user flags on hexs. */ void save_user_flags_hex (std::ostream &out) const; @@ -3155,14 +3171,17 @@ template <> void Triangulation<2>::clear_user_pointers (); template <> void Triangulation<2>::clear_user_flags (); template <> void Triangulation<3>::clear_user_pointers (); template <> void Triangulation<3>::clear_user_flags (); +template <> void Triangulation<1>::clear_user_flags_quad (); template <> void Triangulation<1>::save_user_flags_quad (std::ostream &) const; template <> void Triangulation<1>::save_user_flags_quad (std::vector &) const; template <> void Triangulation<1>::load_user_flags_quad (std::istream &); template <> void Triangulation<1>::load_user_flags_quad (const std::vector &); +template <> void Triangulation<1>::clear_user_flags_hex (); template <> void Triangulation<1>::save_user_flags_hex (std::ostream &) const; template <> void Triangulation<1>::save_user_flags_hex (std::vector &) const; template <> void Triangulation<1>::load_user_flags_hex (std::istream &); template <> void Triangulation<1>::load_user_flags_hex (const std::vector &); +template <> void Triangulation<2>::clear_user_flags_hex (); template <> void Triangulation<2>::save_user_flags_hex (std::ostream &) const; template <> void Triangulation<2>::save_user_flags_hex (std::vector &) const; template <> void Triangulation<2>::load_user_flags_hex (std::istream &); diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 39e8a86b0d..7f390da2bc 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -1980,12 +1980,21 @@ void Triangulation<1>::clear_user_pointers () template <> void Triangulation<1>::clear_user_flags () { - cell_iterator cell = begin(), - endc = end(); - for (; cell!=endc; ++cell) - cell->clear_user_flag (); + clear_user_flags_line(); } + + +template <> +void Triangulation<1>::clear_user_flags_quad () +{} + + +template <> +void Triangulation<1>::clear_user_flags_hex () +{} + + #endif @@ -2010,18 +2019,17 @@ void Triangulation<2>::clear_user_pointers () template <> void Triangulation<2>::clear_user_flags () { - line_iterator line = begin_line(), - endl = end_line(); - for (; line!=endl; ++line) - line->clear_user_flag (); - - cell_iterator cell = begin(), - endc = end(); - for (; cell!=endc; ++cell) - cell->clear_user_flag (); + clear_user_flags_line (); + clear_user_flags_quad (); } + +template <> +void Triangulation<2>::clear_user_flags_hex () +{} + + #endif @@ -2050,25 +2058,48 @@ void Triangulation<3>::clear_user_pointers () template <> void Triangulation<3>::clear_user_flags () +{ + clear_user_flags_line (); + clear_user_flags_quad (); + clear_user_flags_hex (); +} + + + +#endif + + +template +void Triangulation::clear_user_flags_line () { line_iterator line = begin_line(), endl = end_line(); for (; line!=endl; ++line) line->clear_user_flag (); +} + + +template +void Triangulation::clear_user_flags_quad () +{ quad_iterator quad = begin_quad(), endq = end_quad(); for (; quad!=endq; ++quad) quad->clear_user_flag (); - - cell_iterator cell = begin(), - endc = end(); - for (; cell!=endc; ++cell) - cell->clear_user_flag (); } -#endif + +template +void Triangulation::clear_user_flags_hex () +{ + hex_iterator hex = begin_hex(), + endh = end_hex(); + for (; hex!=endh; ++hex) + hex->clear_user_flag (); +} + template diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index f4d0497657..2c9cb90c7c 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -612,6 +612,15 @@ inconvenience this causes.

deal.II

    +
  1. + New: The functions Triangulation::clear_user_flags_line, + Triangulation::clear_user_flags_quad, and + Triangulation::clear_user_flags_hex can be used to + selectively clear only some of the user flags as needed. +
    + (WB 2006/04/25) +

    +
  2. New: The function VectorTools::project functions can now also be used for vector arguments of type other than