From 38d0e8c0e3a2e637f9805f0f888db80a7074874f Mon Sep 17 00:00:00 2001 From: kanschat Date: Thu, 7 Mar 2013 23:20:54 +0000 Subject: [PATCH] remove unneeded local indices from other simple assemblers git-svn-id: https://svn.dealii.org/trunk@28806 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/meshworker/simple.h | 73 +++++++-------------- 1 file changed, 25 insertions(+), 48 deletions(-) diff --git a/deal.II/include/deal.II/meshworker/simple.h b/deal.II/include/deal.II/meshworker/simple.h index 8142d182da..3858b436ad 100644 --- a/deal.II/include/deal.II/meshworker/simple.h +++ b/deal.II/include/deal.II/meshworker/simple.h @@ -63,6 +63,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 @@ -72,14 +75,9 @@ namespace MeshWorker * In spite of using local block structure, all blocks will be * enteres into the same global matrix, disregarding any global * block structure. - * - * @note The argument of this function will be copied into the - * member object #local_indices. Thus, every subsequent change - * in the block structure must be initialzied or will not be - * used by the assembler. */ - void initialize_local_blocks(const BlockIndices &local_indices); + void initialize_local_blocks(const BlockIndices &); /** * Initialize the local data in the DoFInfo object used later @@ -108,12 +106,6 @@ namespace MeshWorker void assemble(const DOFINFO &info1, const DOFINFO &info2); private: - /** - * The object containing the local block structure. Set by - * initialize_local_blocks() and used by assembling functions. - */ - BlockIndices local_indices; - /** * The global residal vectors filled by assemble(). */ @@ -144,11 +136,9 @@ namespace MeshWorker * by default, the obvious choice of taking a single local matrix with * dimensions equal to the number of degrees of freedom of the * cell. Alternatively, a local block structure can be initialized - * with initialize_local_blocks(). After this, the local data will be + * in DoFInfo. After this, the local data will be * arranged as an array of n by n FullMatrix blocks, which are - * ordered lexicographically in DoFInfo. Note that - * initialize_local_blocks() has to be called before initialize_info() - * to take the desired effect. + * ordered lexicographically in DoFInfo. * * @ingroup MeshWorker * @author Guido Kanschat, 2009 @@ -189,14 +179,9 @@ namespace MeshWorker * In spite of using local block structure, all blocks will be * enteres into the same global matrix, disregarding any global * block structure. - * - * @note The argument of this function will be copied into the - * member object #local_indices. Thus, every subsequent change - * in the block structure must be initialzied or will not be - * used by the assembler. */ - void initialize_local_blocks(const BlockIndices &local_indices); + void initialize_local_blocks(const BlockIndices &); /** * Initialize the local data in the DoFInfo object used later @@ -287,6 +272,9 @@ namespace MeshWorker void initialize(const MGConstrainedDoFs &mg_constrained_dofs); /** + * @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 @@ -296,13 +284,8 @@ namespace MeshWorker * In spite of using local block structure, all blocks will be * enteres into the same global matrix, disregarding any global * block structure. - * - * @note The argument of this function will be copied into the - * member object #local_indices. Thus, every subsequent change - * in the block structure must be initialzied or will not be - * used by the assembler. */ - void initialize_local_blocks(const BlockIndices &local_indices); + void initialize_local_blocks(const BlockIndices &); /** * Initialize the matrices #flux_up and #flux_down used for @@ -431,12 +414,6 @@ namespace MeshWorker */ SmartPointer > mg_constrained_dofs; - /** - * 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 @@ -531,10 +508,8 @@ namespace MeshWorker template inline void - ResidualSimple::initialize_local_blocks(const BlockIndices &b) - { - local_indices = b; - } + ResidualSimple::initialize_local_blocks(const BlockIndices &) + {} template @@ -560,7 +535,7 @@ namespace MeshWorker } else { - if (local_indices.size() == 0) + if (info.indices_by_block.size() == 0) constraints->distribute_local_to_global(info.vector(k).block(0), info.indices, (*residuals(k))); else for (unsigned int i=0;i != info.vector(k).n_blocks();++i) @@ -586,14 +561,14 @@ namespace MeshWorker } else { - if (local_indices.size() == 0) + if (info1.indices_by_block.size() == 0 && info2.indices_by_block.size() == 0) { constraints->distribute_local_to_global (info1.vector(k).block(0), info1.indices, (*residuals(k))); constraints->distribute_local_to_global (info2.vector(k).block(0), info2.indices, (*residuals(k))); } - else + else if (info1.indices_by_block.size() != 0 && info2.indices_by_block.size() != 0) { for (unsigned int i=0;i inline void - MGMatrixSimple::initialize_local_blocks(const BlockIndices &b) - { - local_indices = b; - } + MGMatrixSimple::initialize_local_blocks(const BlockIndices &) + {} template @@ -805,7 +782,7 @@ namespace MeshWorker inline void MGMatrixSimple::initialize_info(DOFINFO &info, bool face) const { - const unsigned int n = local_indices.size(); + const unsigned int n = info.indices_by_block.size(); if (n == 0) info.initialize_matrices(1, face); @@ -1067,7 +1044,7 @@ namespace MeshWorker Assert(info.level_cell, ExcMessage("Cell must access level dofs")); const unsigned int level = info.cell->level(); - if (local_indices.size() == 0) + if (info.indices_by_block.size() == 0) { assemble((*matrix)[level], info.matrix(0,false).matrix, info.indices, info.indices, level); @@ -1110,7 +1087,7 @@ namespace MeshWorker const unsigned int level1 = info1.cell->level(); const unsigned int level2 = info2.cell->level(); - if (local_indices.size() == 0) + if (info1.indices_by_block.size() == 0) { if (level1 == level2) { -- 2.39.5