From: kanschat Date: Tue, 4 Oct 2011 02:23:51 +0000 (+0000) Subject: eliminate interior boundaries X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd2019e1eb1f9cf704e8ed99777b8931d908586;p=dealii-svn.git eliminate interior boundaries git-svn-id: https://svn.dealii.org/trunk@24520 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index cd27f3b21d..e387e694c4 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -1464,6 +1464,16 @@ namespace DoFTools // @} /** * @name Dof indices for patches + * + * Create structures containing a + * large set of degrees of freedom + * for small patches of cells. The + * resulting objects can be used in + * RelaxationBlockSOR and related + * classes to implement Schwarz + * preconditioners and smoothers, + * where the subdomains consist of + * small numbers of cells only. */ //@{ /** @@ -1486,13 +1496,61 @@ namespace DoFTools * freedom associated to the * corresponding cells * corresponding to a vertex. + * + * The function has some boolean + * arguments (lsited below) + * controlling details of the + * generated patches. The default + * settings are those for + * Arnold-Falk-Winther type + * smoothers for divergence and + * curl conforming finite elements + * with essential boundary + * conditions. Other applications + * are possible, in particular + * changing + * boundary_patches for + * non-essential boundary conditions. + * + * @arg block_list: the + * SparsityPattern into which the + * patches will be stored. + * @arg dof_handler: The + * multilevel dof handler + * providing the topology operated + * on. + * @arg + * interior_dofs_only: + * for each patch of cells around + * a vertex, collect only the + * interior degrees of freedom of + * the patch and disregard those + * on the boundary of the + * patch. This is for instance the + * setting for smoothers of + * Arnold-Falk-Winther type. + * @arg boundary_patches: + * include patches around vertices + * at the boundary of the + * domain. If not, only patches + * around interior vertices will + * be generated. + * @arg + * level_boundary_patches: + * same for refinement edges + * towards coarser cells. + * @arg + * single_cell_patches: + * if not true, patches containing + * a single cell are eliminated. */ template void make_vertex_patches(SparsityPattern& block_list, const DH& dof_handler, const unsigned int level, const bool interior_dofs_only, - const bool boundary_patches = true, + const bool boundary_patches = false, + const bool level_boundary_patches = false, const bool single_cell_patches = false); //@} diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 2d4eb64933..c78b30e51d 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -5913,8 +5913,15 @@ namespace DoFTools vertex_dof_count[vg] += cell->get_fe().dofs_per_cell; ++vertex_cell_count[vg]; for (unsigned int d=0;dat_boundary(GeometryInfo::vertex_to_face[v][d])) - vertex_boundary[vg] = true; + { + const unsigned int face = GeometryInfo::vertex_to_face[v][d]; + if (cell->at_boundary(face)) + vertex_boundary[vg] = true; + else + if ((!level_boundary_patches) + && (cell->neighbor(face)->level() != (int) level)) + vertex_boundary[vg] = true; + } } // From now on, onlly vertices // with positive dof count are