From: ESeNonFossiIo Date: Fri, 25 Mar 2016 10:32:05 +0000 (+0100) Subject: doc X-Git-Tag: v8.5.0-rc1~1168^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0066984c132eddcd02e98d219e63398bef299721;p=dealii.git doc --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 7ee6e86440..0890de0e9c 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -1712,10 +1712,14 @@ namespace GridTools get_longest_direction(typename Triangulation::active_cell_iterator cell); /** - * Remove hanging nodes from a grid. @p isotropic (default) allows to reproduce - * the proportion of each cell in child cells. - * Since this procedure could require a large number of iterations, - * a max number of iteration is provided. + * Remove hanging nodes from a grid. If the @p isotropic parameter is set + * to @p false (default) this function detects cells with hanging nodes and + * refines the neighbours in the direction that removes hanging nodes. + * If the @p isotropic parameter is set + * to @p true, the neighbours refinement is made in each directions. + * In order to remove all hanging nodes this procedure has to be repeated: + * this could require a large number of iterations. + * To avoid this a max number (@p max_iterations) of iteration is provided. * * Consider the following grid: * @image html remove_hanging_nodes-hanging.png @@ -1731,11 +1735,14 @@ namespace GridTools * @param[in] isotropic if true refine cells in each directions, otherwise * (default value) refine the cell in the direction that removes hanging node. * - * @param[in] max_iterations at each step only closest cells to hanging - * nodes are refined. In order to remove completely hangind nodes one may have - * infinite loops. @p max_iterations is the maximum number of iteration allowed. - * If @p max_iterations == 0 this function continues refining until + * @param[in] max_iterations at each step only closest cells to hanging nodes + * are refined. The code may require a lot of iterations to to remove all + * hangind nodes. @p max_iterations is the maximum number of iteration + * allowed. If @p max_iterations == 0 this function continues refining until * there are no hanging nodes. + * + * @note In the case of parallel codes, this function should be combined + * with GridGenerator::flatten_triangulation. */ template void @@ -1761,6 +1768,9 @@ namespace GridTools * the dimensions of each cell. * * @param[in] max_iterations maximum number of iterations allowed. + * + * @note In the case of parallel codes, this function should be combined + * with GridGenerator::flatten_triangulation and remove_hanging_nodes. */ template void diff --git a/tests/grid/grid_remove_anisotropy.cc b/tests/grid/grid_remove_anisotropy.cc new file mode 100644 index 0000000000..8d5a4b6975 --- /dev/null +++ b/tests/grid/grid_remove_anisotropy.cc @@ -0,0 +1,61 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2013 - 2015 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +std::ofstream logfile ("output"); + +void check_remove_anisotropy () +{ + Point<3> (corners) [3]; + + corners[0] = Point<3> (1, 0, 0); + corners[1] = Point<3> (0, 4, 0); + corners[2] = Point<3> (0, 0, 2); + + const unsigned int n_subdivisions = 1; + + Triangulation<3> triangulation; + GridGenerator::subdivided_parallelepiped (triangulation, n_subdivisions, corners); + dealii::GridTools::remove_anisotropy<3>(triangulation, + /*max ratio =*/ 1.2); + + GridOut grid_out; + grid_out.write_vtk (triangulation, logfile); + + triangulation.clear (); +} + +int main () +{ + check_remove_anisotropy(); +} diff --git a/tests/grid/grid_remove_anisotropy.output b/tests/grid/grid_remove_anisotropy.output new file mode 100644 index 0000000000..923eec1c9a --- /dev/null +++ b/tests/grid/grid_remove_anisotropy.output @@ -0,0 +1,99 @@ +# vtk DataFile Version 3.0 +#This file was generated +ASCII +DATASET UNSTRUCTURED_GRID + +POINTS 64 double +0 0 0 +1 0 0 +0 1 0 +1 1 0 +0 0 1 +1 0 1 +0 1 1 +1 1 1 +0 0 1 +1 0 1 +0 1 1 +1 1 1 +0 0 2 +1 0 2 +0 1 2 +1 1 2 +0 1 0 +1 1 0 +0 2 0 +1 2 0 +0 1 1 +1 1 1 +0 2 1 +1 2 1 +0 1 1 +1 1 1 +0 2 1 +1 2 1 +0 1 2 +1 1 2 +0 2 2 +1 2 2 +0 2 0 +1 2 0 +0 3 0 +1 3 0 +0 2 1 +1 2 1 +0 3 1 +1 3 1 +0 2 1 +1 2 1 +0 3 1 +1 3 1 +0 2 2 +1 2 2 +0 3 2 +1 3 2 +0 3 0 +1 3 0 +0 4 0 +1 4 0 +0 3 1 +1 3 1 +0 4 1 +1 4 1 +0 3 1 +1 3 1 +0 4 1 +1 4 1 +0 3 2 +1 3 2 +0 4 2 +1 4 2 + +CELLS 8 72 +8 0 1 3 2 4 5 7 6 +8 8 9 11 10 12 13 15 14 +8 16 17 19 18 20 21 23 22 +8 24 25 27 26 28 29 31 30 +8 32 33 35 34 36 37 39 38 +8 40 41 43 42 44 45 47 46 +8 48 49 51 50 52 53 55 54 +8 56 57 59 58 60 61 63 62 + +CELL_TYPES 8 + 12 12 12 12 12 12 12 12 +POINT_DATA 64 +SCALARS level double 1 +LOOKUP_TABLE default +3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +SCALARS manifold double 1 +LOOKUP_TABLE default +-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +SCALARS material double 1 +LOOKUP_TABLE default +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +SCALARS subdomain double 1 +LOOKUP_TABLE default +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/tests/grid/grid_remove_hanging_nodes.cc b/tests/grid/grid_remove_hanging_nodes.cc new file mode 100644 index 0000000000..c1c849268a --- /dev/null +++ b/tests/grid/grid_remove_hanging_nodes.cc @@ -0,0 +1,65 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2013 - 2015 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +std::ofstream logfile ("output"); + +void check_remove_hanging_nodes () +{ + Point<2> corners[2]; + + corners[0] = Point<2> (1, 0); + corners[1] = Point<2> (0, 4); + const unsigned int n_subdivisions = 1; + + + Triangulation<2> tria; + GridGenerator::subdivided_parallelepiped (tria, n_subdivisions, corners); + + tria.refine_global(); + + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement(); + + tria.refine_global(); + + dealii::GridTools::remove_hanging_nodes(tria, /*isotropic=*/false); + + GridOut grid_out; + grid_out.write_vtk (tria, logfile); + + tria.clear (); +} + +int main () +{ + check_remove_hanging_nodes(); +} diff --git a/tests/grid/grid_remove_hanging_nodes.output b/tests/grid/grid_remove_hanging_nodes.output new file mode 100644 index 0000000000..704daab87c --- /dev/null +++ b/tests/grid/grid_remove_hanging_nodes.output @@ -0,0 +1,207 @@ +# vtk DataFile Version 3.0 +#This file was generated +ASCII +DATASET UNSTRUCTURED_GRID + +POINTS 144 double +0.5 2 0 +0.75 2 0 +0.5 3 0 +0.75 3 0 +0.75 2 0 +1 2 0 +0.75 3 0 +1 3 0 +0.5 3 0 +0.75 3 0 +0.5 4 0 +0.75 4 0 +0.75 3 0 +1 3 0 +0.75 4 0 +1 4 0 +0 0 0 +0.125 0 0 +0 0.5 0 +0.125 0.5 0 +0.125 0 0 +0.25 0 0 +0.125 0.5 0 +0.25 0.5 0 +0 0.5 0 +0.125 0.5 0 +0 1 0 +0.125 1 0 +0.125 0.5 0 +0.25 0.5 0 +0.125 1 0 +0.25 1 0 +0.25 0 0 +0.375 0 0 +0.25 0.5 0 +0.375 0.5 0 +0.375 0 0 +0.5 0 0 +0.375 0.5 0 +0.5 0.5 0 +0.25 0.5 0 +0.375 0.5 0 +0.25 1 0 +0.375 1 0 +0.375 0.5 0 +0.5 0.5 0 +0.375 1 0 +0.5 1 0 +0 1 0 +0.125 1 0 +0 1.5 0 +0.125 1.5 0 +0.125 1 0 +0.25 1 0 +0.125 1.5 0 +0.25 1.5 0 +0 1.5 0 +0.125 1.5 0 +0 2 0 +0.125 2 0 +0.125 1.5 0 +0.25 1.5 0 +0.125 2 0 +0.25 2 0 +0.25 1 0 +0.375 1 0 +0.25 1.5 0 +0.375 1.5 0 +0.375 1 0 +0.5 1 0 +0.375 1.5 0 +0.5 1.5 0 +0.25 1.5 0 +0.375 1.5 0 +0.25 2 0 +0.375 2 0 +0.375 1.5 0 +0.5 1.5 0 +0.375 2 0 +0.5 2 0 +0.5 0 0 +0.75 0 0 +0.5 0.5 0 +0.75 0.5 0 +0.5 0.5 0 +0.75 0.5 0 +0.5 1 0 +0.75 1 0 +0.5 1 0 +0.75 1 0 +0.5 1.5 0 +0.75 1.5 0 +0.5 1.5 0 +0.75 1.5 0 +0.5 2 0 +0.75 2 0 +0 2 0 +0.125 2 0 +0 3 0 +0.125 3 0 +0.125 2 0 +0.25 2 0 +0.125 3 0 +0.25 3 0 +0.25 2 0 +0.375 2 0 +0.25 3 0 +0.375 3 0 +0.375 2 0 +0.5 2 0 +0.375 3 0 +0.5 3 0 +0.75 0 0 +1 0 0 +0.75 0.5 0 +1 0.5 0 +0.75 0.5 0 +1 0.5 0 +0.75 1 0 +1 1 0 +0.75 1 0 +1 1 0 +0.75 1.5 0 +1 1.5 0 +0.75 1.5 0 +1 1.5 0 +0.75 2 0 +1 2 0 +0 3 0 +0.125 3 0 +0 4 0 +0.125 4 0 +0.125 3 0 +0.25 3 0 +0.125 4 0 +0.25 4 0 +0.25 3 0 +0.375 3 0 +0.25 4 0 +0.375 4 0 +0.375 3 0 +0.5 3 0 +0.375 4 0 +0.5 4 0 + +CELLS 36 180 +4 0 1 3 2 +4 4 5 7 6 +4 8 9 11 10 +4 12 13 15 14 +4 16 17 19 18 +4 20 21 23 22 +4 24 25 27 26 +4 28 29 31 30 +4 32 33 35 34 +4 36 37 39 38 +4 40 41 43 42 +4 44 45 47 46 +4 48 49 51 50 +4 52 53 55 54 +4 56 57 59 58 +4 60 61 63 62 +4 64 65 67 66 +4 68 69 71 70 +4 72 73 75 74 +4 76 77 79 78 +4 80 81 83 82 +4 84 85 87 86 +4 88 89 91 90 +4 92 93 95 94 +4 96 97 99 98 +4 100 101 103 102 +4 104 105 107 106 +4 108 109 111 110 +4 112 113 115 114 +4 116 117 119 118 +4 120 121 123 122 +4 124 125 127 126 +4 128 129 131 130 +4 132 133 135 134 +4 136 137 139 138 +4 140 141 143 142 + +CELL_TYPES 36 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 +POINT_DATA 144 +SCALARS level double 1 +LOOKUP_TABLE default +2 2 2 2 2 2 2 2 2 2 2 2 2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