From ab1f1db424654e1907a1d5b4861da029a8a66d47 Mon Sep 17 00:00:00 2001 From: kanschat Date: Thu, 7 Mar 2013 21:40:48 +0000 Subject: [PATCH] remove competing local indices git-svn-id: https://svn.dealii.org/trunk@28802 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/meshworker/dof_info.h | 42 +++++++------------ deal.II/include/deal.II/meshworker/simple.h | 39 ++++++++--------- 2 files changed, 31 insertions(+), 50 deletions(-) diff --git a/deal.II/include/deal.II/meshworker/dof_info.h b/deal.II/include/deal.II/meshworker/dof_info.h index 0f5ba9d67d..46116bd4e2 100644 --- a/deal.II/include/deal.II/meshworker/dof_info.h +++ b/deal.II/include/deal.II/meshworker/dof_info.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors +// Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -100,9 +100,8 @@ namespace MeshWorker std::vector indices; /** - * The DoF indices on the - * current cell, organized by - * local blocks + * The DoF indices on the current cell, organized by local blocks. + * The size of this vector is zero, unless local blocks are used. */ std::vector > indices_by_block; @@ -129,9 +128,7 @@ namespace MeshWorker void reinit(const DHCellIterator &c); /** - * Set the current face and - * fill @p indices if the #cell - * changed. + * Set the current face and fill @p indices if the #cell changed. */ template void reinit(const DHCellIterator &c, @@ -139,9 +136,8 @@ namespace MeshWorker const unsigned int n); /** - * Set the current subface - * and fill @p indices if the - * #cell changed. + * Set the current subface and fill @p indices if the #cell + * changed. */ template void reinit(const DHCellIterator &c, @@ -150,19 +146,16 @@ namespace MeshWorker const unsigned int s); /** - * Switch to a new face of the - * same cell. Does not change - * @p indices and does not reset - * data in LocalResults. + * Switch to a new face of the same cell. Does not change @p + * indices and does not reset data in LocalResults. */ template void set_face (const DHFaceIterator &f, const unsigned int n); + /** - * Switch to a new subface of the - * same cell. Does not change - * @p indices and does not reset - * data in LocalResults. + * Switch to a new subface of the same cell. Does not change @p + * indices and does not reset data in LocalResults. */ template void set_subface (const DHFaceIterator &f, @@ -178,13 +171,9 @@ namespace MeshWorker bool level_cell; private: /** - * Standard constructor, not - * setting any block - * indices. Use of this - * constructor is not - * recommended, but it is - * needed for the arrays in - * DoFInfoBox. + * Standard constructor, not setting any block indices. Use of + * this constructor is not recommended, but it is needed for the + * arrays in DoFInfoBox. */ DoFInfo (); @@ -194,9 +183,6 @@ namespace MeshWorker template void get_indices(const DHCellIterator &c); - /// Fill index vector with level indices - //void get_indices(const typename MGDoFHandler::cell_iterator& c); - /// Auxiliary vector std::vector indices_org; diff --git a/deal.II/include/deal.II/meshworker/simple.h b/deal.II/include/deal.II/meshworker/simple.h index 27aa1fe81a..fb1d30fca7 100644 --- a/deal.II/include/deal.II/meshworker/simple.h +++ b/deal.II/include/deal.II/meshworker/simple.h @@ -177,6 +177,9 @@ namespace MeshWorker void initialize(const ConstraintMatrix &constraints); /** + * @deprecated This function is of no effect. Only the block info + * structure in DoFInfo is being used. + * * Store information on the local block structure. If the * assembler is inititialized with this function, * initialize_info() will generate one local matrix for each @@ -196,15 +199,11 @@ namespace MeshWorker void initialize_local_blocks(const BlockIndices &local_indices); /** - * Initialize the local data - * in the DoFInfo object used - * later for assembling. + * Initialize the local data in the DoFInfo object used later + * for assembling. * - * The info object refers to - * a cell if - * !face, or - * else to an interior or - * boundary face. + * The info object refers to a cell if !face, or + * else to an interior or boundary face. */ template void initialize_info(DOFINFO &info, bool face) const; @@ -242,12 +241,6 @@ namespace MeshWorker */ SmartPointer > constraints; - /** - * The object containing the local block structure. Set by - * initialize_local_blocks() and used by assembling functions. - */ - BlockIndices local_indices; - /** * The smallest positive number that will be entered into the * global matrix. All smaller absolute values will be treated as @@ -643,10 +636,8 @@ namespace MeshWorker template inline void - MatrixSimple::initialize_local_blocks(const BlockIndices &b) - { - local_indices = b; - } + MatrixSimple::initialize_local_blocks(const BlockIndices &) + {} template @@ -654,7 +645,7 @@ namespace MeshWorker inline void MatrixSimple::initialize_info(DOFINFO &info, bool face) const { - const unsigned int n = local_indices.size(); + const unsigned int n = dof_info.indices_by_block.size(); if (n == 0) info.initialize_matrices(1, face); @@ -706,7 +697,7 @@ namespace MeshWorker { Assert(!info.level_cell, ExcMessage("Cell may not access level dofs")); - if (local_indices.size() == 0) + if (info.indices_by_block.size() == 0) assemble(info.matrix(0,false).matrix, info.indices, info.indices); else { @@ -728,14 +719,14 @@ namespace MeshWorker Assert(!info1.level_cell, ExcMessage("Cell may not access level dofs")); Assert(!info2.level_cell, ExcMessage("Cell may not access level dofs")); - if (local_indices.size() == 0) + if (info1.indices_by_block.size() == 0 && info2.indices_by_block.size() == 0) { assemble(info1.matrix(0,false).matrix, info1.indices, info1.indices); assemble(info1.matrix(0,true).matrix, info1.indices, info2.indices); assemble(info2.matrix(0,false).matrix, info2.indices, info2.indices); assemble(info2.matrix(0,true).matrix, info2.indices, info1.indices); } - else + else if (info1.indices_by_block.size() != 0 && info2.indices_by_block.size() != 0) for (unsigned int k=0; k