From 8fd312d4e64020b2b8684b2535bbcda444480f01 Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 26 Feb 2013 04:57:49 +0000 Subject: [PATCH] Deprecate Triangulation::distort_random. Revive it as GridTools::distort_random. git-svn-id: https://svn.dealii.org/trunk@28564 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/grid/grid_tools.h | 23 +++++++++++++++++++++++ deal.II/include/deal.II/grid/tria.h | 4 +++- deal.II/source/grid/grid_tools.cc | 11 +++++++++++ deal.II/source/grid/grid_tools.inst.in | 5 +++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index f9face699a..6b270a8bd2 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -249,6 +249,29 @@ namespace GridTools void scale (const double scaling_factor, Triangulation &triangulation); + /** + * Distort the given triangulation by randomly + * moving around all the vertices + * of the grid. The direction of + * movement of each vertex is random, while the + * length of the shift vector has + * a value of @p factor times + * the minimal length of the + * active edges adjacent to this + * vertex. Note that @p factor + * should obviously be well below + * 0.5. + * + * If @p keep_boundary is set to + * @p true (which is the + * default), then boundary + * vertices are not moved. + */ + template + void distort_random (const double factor, + Triangulation &triangulation, + const bool keep_boundary=true); + /** * Find and return the number of * the used vertex in a given diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h index 1560b4af27..835c091414 100644 --- a/deal.II/include/deal.II/grid/tria.h +++ b/deal.II/include/deal.II/grid/tria.h @@ -2023,9 +2023,11 @@ public: * @p true (which is the * default), then boundary * vertices are not moved. + * + * @deprecated Use GridTools::distort_random instead. */ void distort_random (const double factor, - const bool keep_boundary=true); + const bool keep_boundary=true) DEAL_II_DEPRECATED; /** diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index 77c916ae7d..a32ac8b8da 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -602,6 +602,17 @@ namespace GridTools } + template + void + distort_random (const double factor, + Triangulation &triangulation, + const bool keep_boundary) + { + //TODO: Move implementation of this function into the current + // namespace + triangulation.distort_random (factor, keep_boundary); + } + template class Container, int spacedim> unsigned int diff --git a/deal.II/source/grid/grid_tools.inst.in b/deal.II/source/grid/grid_tools.inst.in index 132dc8ec48..1d2470bf6c 100644 --- a/deal.II/source/grid/grid_tools.inst.in +++ b/deal.II/source/grid/grid_tools.inst.in @@ -101,6 +101,11 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS void scale (const double, Triangulation &); + template + void distort_random (const double, + Triangulation &, + const bool); + template void get_face_connectivity_of_cells (const Triangulation &triangulation, -- 2.39.5