From: guido Date: Fri, 2 Oct 1998 11:47:02 +0000 (+0000) Subject: distort_random takes minimum line length X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef6ab4dc24aea2e097445f086674e7bbc27af299;p=dealii-svn.git distort_random takes minimum line length git-svn-id: https://svn.dealii.org/trunk@611 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 2723c83b50..ed2f87b011 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -671,12 +671,9 @@ void Triangulation<2>::create_hyper_ball (const Point<2> &p, const double radius template void Triangulation::distort_random (const double factor, const bool keep_boundary) { - // note number of lines adjacent - // to a vertex - vector adjacent_lines (vertices.size(), 0); - // sum up the length of the lines + // find the smallest length of the lines // adjecent to the vertex - vector cumulated_length (vertices.size(), 0); + vector minimal_length (vertices.size(), 1e308); // also note if a vertex is at // the boundary vector at_boundary (vertices.size(), false); @@ -690,10 +687,10 @@ void Triangulation::distort_random (const double factor, at_boundary[line->vertex_index(1)] = true; }; - adjacent_lines[line->vertex_index(0)]++; - adjacent_lines[line->vertex_index(1)]++; - cumulated_length[line->vertex_index(0)] += line->diameter(); - cumulated_length[line->vertex_index(1)] += line->diameter(); + minimal_length[line->vertex_index(0)] + = min(line->diameter(), minimal_length[line->vertex_index(0)]); + minimal_length[line->vertex_index(1)] + = min(line->diameter(), minimal_length[line->vertex_index(1)]); }; @@ -712,16 +709,8 @@ void Triangulation::distort_random (const double factor, for (unsigned int d=0; d