From: Spencer Patty Date: Wed, 10 Feb 2016 16:53:21 +0000 (-0600) Subject: run indent and add comments to describe test X-Git-Tag: v8.4.0-rc2~19^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2131%2Fhead;p=dealii.git run indent and add comments to describe test --- diff --git a/tests/grid/get_dof_to_support_patch_map_01.cc b/tests/grid/get_dof_to_support_patch_map_01.cc index fee6dd97e3..adf0ca5c52 100644 --- a/tests/grid/get_dof_to_support_patch_map_01.cc +++ b/tests/grid/get_dof_to_support_patch_map_01.cc @@ -16,7 +16,11 @@ // --------------------------------------------------------------------- -// Test GridTools::map_dof_to_support_patch () +// Test GridTools::map_dof_to_support_patch () using a quadratic FE_Q +// space. We output the barycenter of each cell in the patch around the dof +// for a few dofs in the triangulation. We have three layers of refinement in +// the triangulation which represents the various patches that could arise in +// practice. @@ -28,7 +32,6 @@ #include #include #include - #include #include @@ -49,39 +52,41 @@ void test() triangulation.refine_global (2); { + // choose barycenters of cells to refine or coarsen to end up with + // a three level triangulation. std::vector > refine_centers; std::vector > coarsen_centers; - if(dim==1) - { - refine_centers.push_back(Point (1./8.)); + if (dim==1) + { + refine_centers.push_back(Point (1./8.)); - coarsen_centers.push_back(Point (5./8.)); - coarsen_centers.push_back(Point (7./8.)); - } + coarsen_centers.push_back(Point (5./8.)); + coarsen_centers.push_back(Point (7./8.)); + } else if (dim==2) - { - refine_centers.push_back(Point (1./8., 7./8.)); + { + refine_centers.push_back(Point (1./8., 7./8.)); - coarsen_centers.push_back(Point (5./8., 5./8.)); - coarsen_centers.push_back(Point (5./8., 7./8.)); - coarsen_centers.push_back(Point (7./8., 5./8.)); - coarsen_centers.push_back(Point (7./8., 7./8.)); + coarsen_centers.push_back(Point (5./8., 5./8.)); + coarsen_centers.push_back(Point (5./8., 7./8.)); + coarsen_centers.push_back(Point (7./8., 5./8.)); + coarsen_centers.push_back(Point (7./8., 7./8.)); - } + } else if (dim==3) - { - refine_centers.push_back(Point (1./8., 7./8., 1./8.)); - - coarsen_centers.push_back(Point (7./8., 7./8., 7./8.)); - coarsen_centers.push_back(Point (5./8., 7./8., 7./8.)); - coarsen_centers.push_back(Point (7./8., 5./8., 7./8.)); - coarsen_centers.push_back(Point (5./8., 5./8., 7./8.)); - coarsen_centers.push_back(Point (7./8., 7./8., 5./8.)); - coarsen_centers.push_back(Point (5./8., 7./8., 5./8.)); - coarsen_centers.push_back(Point (7./8., 5./8., 5./8.)); - coarsen_centers.push_back(Point (5./8., 5./8., 5./8.)); - } + { + refine_centers.push_back(Point (1./8., 7./8., 1./8.)); + + coarsen_centers.push_back(Point (7./8., 7./8., 7./8.)); + coarsen_centers.push_back(Point (5./8., 7./8., 7./8.)); + coarsen_centers.push_back(Point (7./8., 5./8., 7./8.)); + coarsen_centers.push_back(Point (5./8., 5./8., 7./8.)); + coarsen_centers.push_back(Point (7./8., 7./8., 5./8.)); + coarsen_centers.push_back(Point (5./8., 7./8., 5./8.)); + coarsen_centers.push_back(Point (7./8., 5./8., 5./8.)); + coarsen_centers.push_back(Point (5./8., 5./8., 5./8.)); + } else Assert(false, ExcNotImplemented() ); @@ -90,38 +95,38 @@ void test() cell = triangulation.begin_active(); cell != triangulation.end(); ++cell, ++index) - { - Point cell_bary = cell->barycenter(); - - // refine cells - for (unsigned int i=0; iset_refine_flag (); - break; - } - } - // coarsen cells - for (unsigned int i=0; iset_coarsen_flag (); - break; - } + Point cell_bary = cell->barycenter(); + + // refine cells + for (unsigned int i=0; iset_refine_flag (); + break; + } + } + // coarsen cells + for (unsigned int i=0; iset_coarsen_flag (); + break; + } + } } - } triangulation.execute_coarsening_and_refinement (); } @@ -136,28 +141,28 @@ void test() dof_to_cell_map = GridTools::get_dof_to_support_patch_map(dof_handler); for (unsigned int i=0; i::active_cell_iterator>::iterator - patch_iter = dof_to_cell_map[i].begin(), - patch_iter_end = dof_to_cell_map[i].end(); - for (; patch_iter != patch_iter_end ; ++patch_iter ) - { - typename dealii::DoFHandler::active_cell_iterator patch_cell = *(patch_iter); - Point cell_bary = patch_cell->barycenter(); - deallog << "(" ; - for (unsigned int d=0; d::active_cell_iterator>::iterator + patch_iter = dof_to_cell_map[i].begin(), + patch_iter_end = dof_to_cell_map[i].end(); + for (; patch_iter != patch_iter_end ; ++patch_iter ) + { + typename dealii::DoFHandler::active_cell_iterator patch_cell = *(patch_iter); + Point cell_bary = patch_cell->barycenter(); + deallog << "(" ; + for (unsigned int d=0; d