From: kainan.wang Date: Mon, 25 Feb 2013 05:19:15 +0000 (+0000) Subject: changes in include/deal.II/multigrid/ and source/multigrid/ directories X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb5a4b597d94b1358bd787d3456b54c2307cdec0;p=dealii-svn.git changes in include/deal.II/multigrid/ and source/multigrid/ directories git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28545 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/files b/deal.II/files index da5d3954fe..5d4151b773 100644 --- a/deal.II/files +++ b/deal.II/files @@ -1,4 +1,4 @@ -TH: things to check: +gTH: things to check: 1. std::accumulate with different data types 2. numbers::invalid_unsigned_int @@ -171,14 +171,14 @@ BRUNO source/lac/trilinos_vector.cc BRUNO source/lac/vector.cc BRUNO source/lac/vector_memory.cc BRUNO source/lac/vector_view.cc -source/multigrid/mg_base.cc +KAINAN source/multigrid/mg_base.cc source/multigrid/mg_dof_accessor.cc -source/multigrid/mg_dof_handler.cc -source/multigrid/mg_tools.cc -source/multigrid/mg_transfer_block.cc -source/multigrid/mg_transfer_component.cc -source/multigrid/mg_transfer_prebuilt.cc -source/multigrid/multigrid.cc +KAINAN source/multigrid/mg_dof_handler.cc +KAINAN source/multigrid/mg_tools.cc +KAINAN source/multigrid/mg_transfer_block.cc +KAINAN source/multigrid/mg_transfer_component.cc +KAINAN source/multigrid/mg_transfer_prebuilt.cc +KAINAN source/multigrid/multigrid.cc UWE source/numerics/data_out.cc UWE source/numerics/data_out_faces.cc UWE source/numerics/data_out_rotation.cc @@ -489,20 +489,20 @@ KAINAN include/deal.II/multigrid/mg_base.h KAINAN include/deal.II/multigrid/mg_block_smoother.h KAINAN include/deal.II/multigrid/mg_coarse.h KAINAN include/deal.II/multigrid/mg_constrained_dofs.h -include/deal.II/multigrid/mg_dof_accessor.h -include/deal.II/multigrid/mg_dof_handler.h -include/deal.II/multigrid/mg_dof_iterator_selector.h -include/deal.II/multigrid/mg_matrix.h -include/deal.II/multigrid/mg_smoother.h -include/deal.II/multigrid/mg_tools.h -include/deal.II/multigrid/mg_transfer_block.h -include/deal.II/multigrid/mg_transfer_block.templates.h -include/deal.II/multigrid/mg_transfer_component.h -include/deal.II/multigrid/mg_transfer_component.templates.h -include/deal.II/multigrid/mg_transfer.h -include/deal.II/multigrid/mg_transfer.templates.h -include/deal.II/multigrid/multigrid.h -include/deal.II/multigrid/multigrid.templates.h +KAINAN include/deal.II/multigrid/mg_dof_accessor.h +KAINAN include/deal.II/multigrid/mg_dof_handler.h +KAINAN include/deal.II/multigrid/mg_dof_iterator_selector.h +KAINAN include/deal.II/multigrid/mg_matrix.h +KAINAN include/deal.II/multigrid/mg_smoother.h +KAINAN include/deal.II/multigrid/mg_tools.h +KAINAN include/deal.II/multigrid/mg_transfer_block.h +KAINAN include/deal.II/multigrid/mg_transfer_block.templates.h +KAINAN include/deal.II/multigrid/mg_transfer_component.h +KAINAN include/deal.II/multigrid/mg_transfer_component.templates.h +KAINAN include/deal.II/multigrid/mg_transfer.h +KAINAN include/deal.II/multigrid/mg_transfer.templates.h +KAINAN include/deal.II/multigrid/multigrid.h +KAINAN include/deal.II/multigrid/multigrid.templates.h UWE include/deal.II/numerics/data_component_interpretation.h UWE include/deal.II/numerics/data_out_faces.h UWE include/deal.II/numerics/data_out.h diff --git a/deal.II/include/deal.II/multigrid/mg_tools.h b/deal.II/include/deal.II/multigrid/mg_tools.h index 27df82e897..532d90a419 100644 --- a/deal.II/include/deal.II/multigrid/mg_tools.h +++ b/deal.II/include/deal.II/multigrid/mg_tools.h @@ -176,8 +176,8 @@ namespace MGTools template void count_dofs_per_block (const DH &dof_handler, - std::vector > &dofs_per_block, - std::vector target_block = std::vector()); + std::vector > &dofs_per_block, + std::vector target_block = std::vector()); /** * Count the dofs component-wise @@ -192,7 +192,7 @@ namespace MGTools template void count_dofs_per_component (const DoFHandler &mg_dof, - std::vector > &result, + std::vector > &result, const bool only_once = false, std::vector target_component = std::vector()); @@ -204,7 +204,7 @@ namespace MGTools template void count_dofs_per_component (const DoFHandler &mg_dof, - std::vector > &result, + std::vector > &result, std::vector target_component) DEAL_II_DEPRECATED; /** @@ -233,7 +233,7 @@ namespace MGTools void make_boundary_list (const DoFHandler &mg_dof, const typename FunctionMap::type &function_map, - std::vector > &boundary_indices, + std::vector > &boundary_indices, const ComponentMask &component_mask = ComponentMask()); /** @@ -253,7 +253,7 @@ namespace MGTools */ template void - apply_boundary_values (const std::set &boundary_dofs, + apply_boundary_values (const std::set &boundary_dofs, SparseMatrix &matrix, const bool preserve_symmetry, const bool ignore_zeros = false) DEAL_II_DEPRECATED; @@ -263,7 +263,7 @@ namespace MGTools */ template void - apply_boundary_values (const std::set &boundary_dofs, + apply_boundary_values (const std::set &boundary_dofs, BlockSparseMatrix &matrix, const bool preserve_symmetry) DEAL_II_DEPRECATED; @@ -302,7 +302,7 @@ namespace MGTools template void extract_non_interface_dofs (const DoFHandler &mg_dof_handler, - std::vector > &non_interface_dofs); + std::vector > &non_interface_dofs); } /* @} */ diff --git a/deal.II/include/deal.II/multigrid/mg_transfer.h b/deal.II/include/deal.II/multigrid/mg_transfer.h index b4117d4ea0..3cb255c1f2 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer.h @@ -242,7 +242,7 @@ private: * The data is first the global * index, then the level index. */ - std::vector > > + std::vector > > copy_indices; /** diff --git a/deal.II/include/deal.II/multigrid/mg_transfer.templates.h b/deal.II/include/deal.II/multigrid/mg_transfer.templates.h index 5b00fb46c6..c02da23a5b 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer.templates.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer.templates.h @@ -69,7 +69,7 @@ namespace template void reinit_vector (const dealii::DoFHandler &mg_dof, - std::vector target_component, + std::vector target_component, MGLevelObject > &v) { const unsigned int n_blocks = mg_dof.get_fe().n_blocks(); @@ -86,9 +86,9 @@ namespace target_component.end()); const unsigned int n_target_blocks = max_block + 1; - std::vector > + std::vector > ndofs(mg_dof.get_tria().n_levels(), - std::vector(n_target_blocks)); + std::vector(n_target_blocks)); MGTools::count_dofs_per_block (mg_dof, ndofs, target_component); for (unsigned int level=v.min_level(); @@ -156,7 +156,7 @@ MGTransferPrebuilt::copy_to_mg ( --level; VECTOR &dst_level = dst[level]; - typedef std::vector >::const_iterator IT; + typedef std::vector >::const_iterator IT; for (IT i= copy_indices[level].begin(); i != copy_indices[level].end(); ++i) dst_level(i->second) = src(i->first); @@ -195,7 +195,7 @@ MGTransferPrebuilt::copy_from_mg( dst = 0; for (unsigned int level=0; level >::const_iterator IT; + typedef std::vector >::const_iterator IT; if (constraints == 0) for (IT i= copy_indices[level].begin(); @@ -227,7 +227,7 @@ MGTransferPrebuilt::copy_from_mg_add ( // functions for (unsigned int level=0; level >::const_iterator IT; + typedef std::vector >::const_iterator IT; for (IT i= copy_indices[level].begin(); i != copy_indices[level].end(); ++i) dst(i->first) += src[level](i->second); diff --git a/deal.II/include/deal.II/multigrid/mg_transfer_block.h b/deal.II/include/deal.II/multigrid/mg_transfer_block.h index c348a24308..19b97e44b7 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer_block.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer_block.h @@ -123,7 +123,7 @@ protected: /** * Sizes of the multi-level vectors. */ - mutable std::vector > sizes; + mutable std::vector > sizes; /** * Start index of each block. @@ -520,7 +520,7 @@ private: /*@}*/ -//--------------------------------------------------------------------------- +//----------inline function definition-------------------------------------------------- template inline void MGTransferBlockSelect::select(const unsigned int block) diff --git a/deal.II/include/deal.II/multigrid/mg_transfer_block.templates.h b/deal.II/include/deal.II/multigrid/mg_transfer_block.templates.h index b3acd4e31d..7b7886bd41 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer_block.templates.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer_block.templates.h @@ -33,7 +33,6 @@ DEAL_II_NAMESPACE_OPEN typedef std::vector >::const_iterator IT; - template template void diff --git a/deal.II/include/deal.II/multigrid/mg_transfer_component.h b/deal.II/include/deal.II/multigrid/mg_transfer_component.h index 708175b29a..eb2a520bb1 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer_component.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer_component.h @@ -125,18 +125,18 @@ protected: /** * Sizes of the multi-level vectors. */ - mutable std::vector > sizes; + mutable std::vector > sizes; /** * Start index of each component. */ - std::vector component_start; + std::vector component_start; /** * Start index of each component on * all levels. */ - std::vector > mg_component_start; + std::vector > mg_component_start; /** * Call build_matrices() @@ -165,7 +165,7 @@ protected: * The data is first the global * index, then the level index. */ - std::vector > > + std::vector > > copy_to_and_from_indices; /** @@ -174,7 +174,7 @@ protected: * boundary values in the * restriction matrix. */ - std::vector > boundary_indices; + std::vector > boundary_indices; }; //TODO:[GK] Update documentation for copy_* functions @@ -268,8 +268,8 @@ public: = std::vector(), const std::vector &mg_target_component = std::vector(), - const std::vector > &boundary_indices - = std::vector >() + const std::vector > &boundary_indices + = std::vector >() ); /** diff --git a/deal.II/include/deal.II/multigrid/mg_transfer_component.templates.h b/deal.II/include/deal.II/multigrid/mg_transfer_component.templates.h index 4745515668..6e55196f1e 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer_component.templates.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer_component.templates.h @@ -169,7 +169,7 @@ MGTransferSelect::do_copy_from_mg ( for (; level_cell != endc; ++level_cell) { const unsigned int level = level_cell->level(); - typedef std::vector >::const_iterator IT; + typedef std::vector >::const_iterator IT; for (IT i=copy_to_and_from_indices[level].begin(); i != copy_to_and_from_indices[level].end(); ++i) dst(i->first) = src[level](i->second); @@ -188,8 +188,8 @@ MGTransferSelect::do_copy_from_mg_add ( const FiniteElement &fe = mg_dof_handler.get_fe(); const unsigned int dofs_per_cell = fe.dofs_per_cell; - std::vector global_dof_indices (dofs_per_cell); - std::vector level_dof_indices (dofs_per_cell); + std::vector global_dof_indices (dofs_per_cell); + std::vector level_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator level_cell = mg_dof_handler.begin_active(); @@ -206,7 +206,7 @@ MGTransferSelect::do_copy_from_mg_add ( for (; level_cell != endc; ++level_cell) { const unsigned int level = level_cell->level(); - typedef std::vector >::const_iterator IT; + typedef std::vector >::const_iterator IT; for (IT i=copy_to_and_from_indices[level].begin(); i != copy_to_and_from_indices[level].end(); ++i) dst(i->first) += src[level](i->second); diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 1fe5ef922d..1ed223ab8c 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -130,8 +130,8 @@ namespace MGTools const typename DoFHandler::cell_iterator end = dofs.end(level); typename DoFHandler::active_cell_iterator cell; - std::vector cell_indices; - std::vector neighbor_indices; + std::vector cell_indices; + std::vector neighbor_indices; // We loop over cells and go from // cells to lower dimensional @@ -304,8 +304,8 @@ namespace MGTools const typename DoFHandler::cell_iterator end = dofs.end(level); typename DoFHandler::active_cell_iterator cell; - std::vector cell_indices; - std::vector neighbor_indices; + std::vector cell_indices; + std::vector neighbor_indices; // We have to translate the // couplings from components to @@ -542,7 +542,7 @@ namespace MGTools SparsityPattern &sparsity, const unsigned int level) { - const unsigned int n_dofs = dof.n_dofs(level); + const types::global_dof_index n_dofs = dof.n_dofs(level); Assert (sparsity.n_rows() == n_dofs, ExcDimensionMismatch (sparsity.n_rows(), n_dofs)); @@ -550,7 +550,7 @@ namespace MGTools ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; - std::vector dofs_on_this_cell(dofs_per_cell); + std::vector dofs_on_this_cell(dofs_per_cell); typename DH::cell_iterator cell = dof.begin(level), endc = dof.end(level); for (; cell!=endc; ++cell) @@ -574,7 +574,7 @@ namespace MGTools SparsityPattern &sparsity, const unsigned int level) { - const unsigned int n_dofs = dof.n_dofs(level); + const types::global_dof_index n_dofs = dof.n_dofs(level); Assert (sparsity.n_rows() == n_dofs, ExcDimensionMismatch (sparsity.n_rows(), n_dofs)); @@ -634,8 +634,8 @@ namespace MGTools Assert ((level>=1) && (level dofs_on_this_cell(dofs_per_cell); - std::vector dofs_on_other_cell(dofs_per_cell); + std::vector dofs_on_this_cell(dofs_per_cell); + std::vector dofs_on_other_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), endc = dof.end(level); for (; cell!=endc; ++cell) @@ -693,7 +693,7 @@ namespace MGTools const Table<2,DoFTools::Coupling> &flux_mask) { const FiniteElement &fe = dof.get_fe(); - const unsigned int n_dofs = dof.n_dofs(level); + const types::global_dof_index n_dofs = dof.n_dofs(level); const unsigned int n_comp = fe.n_components(); Assert (sparsity.n_rows() == n_dofs, @@ -710,8 +710,8 @@ namespace MGTools ExcDimensionMismatch (flux_mask.n_cols(), n_comp)); const unsigned int total_dofs = fe.dofs_per_cell; - std::vector dofs_on_this_cell(total_dofs); - std::vector dofs_on_other_cell(total_dofs); + std::vector dofs_on_this_cell(total_dofs); + std::vector dofs_on_other_cell(total_dofs); Table<2,bool> support_on_face(total_dofs, GeometryInfo::faces_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -874,8 +874,8 @@ namespace MGTools Assert ((level>=1) && (level dofs_on_this_cell(dofs_per_cell); - std::vector dofs_on_other_cell(dofs_per_cell); + std::vector dofs_on_this_cell(dofs_per_cell); + std::vector dofs_on_other_cell(dofs_per_cell); Table<2,bool> support_on_face(dofs_per_cell, GeometryInfo::faces_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -943,9 +943,9 @@ namespace MGTools template void count_dofs_per_component (const DoFHandler &dof_handler, - std::vector > &result, + std::vector > &result, bool only_once, - std::vector target_component) + std::vector target_component) { const FiniteElement &fe = dof_handler.get_fe(); const unsigned int n_components = fe.n_components(); @@ -1045,8 +1045,8 @@ namespace MGTools template void count_dofs_per_component (const DoFHandler &dof_handler, - std::vector > &result, - std::vector target_component) + std::vector > &result, + std::vector target_component) { count_dofs_per_component (dof_handler, result, false, target_component); @@ -1058,8 +1058,8 @@ namespace MGTools void count_dofs_per_block ( const DH &dof_handler, - std::vector > &dofs_per_block, - std::vector target_block) + std::vector > &dofs_per_block, + std::vector target_block) { const FiniteElement &fe = dof_handler.get_fe(); const unsigned int n_blocks = fe.n_blocks(); @@ -1141,7 +1141,7 @@ namespace MGTools make_boundary_list( const DoFHandler<1,1> &, const FunctionMap<1>::type &, - std::vector > &, + std::vector > &, const ComponentMask &) { Assert(false, ExcNotImplemented()); @@ -1154,7 +1154,7 @@ namespace MGTools make_boundary_list( const DoFHandler<1,2> &, const FunctionMap<1>::type &, - std::vector > &, + std::vector > &, const ComponentMask &) { Assert(false, ExcNotImplemented()); @@ -1167,7 +1167,7 @@ namespace MGTools make_boundary_list( const DoFHandler &dof, const typename FunctionMap::type &function_map, - std::vector > &boundary_indices, + std::vector > &boundary_indices, const ComponentMask &component_mask) { // if for whatever reason we were @@ -1185,7 +1185,7 @@ namespace MGTools AssertDimension (boundary_indices.size(), n_levels); - std::vector local_dofs; + std::vector local_dofs; local_dofs.reserve (DoFTools::max_dofs_per_face(dof)); std::fill (local_dofs.begin (), local_dofs.end (), @@ -1383,7 +1383,7 @@ namespace MGTools ExcDimensionMismatch (boundary_indices.size(), dof.get_tria().n_levels())); - std::vector > + std::vector > my_boundary_indices (dof.get_tria().n_levels()); make_boundary_list (dof, function_map, my_boundary_indices, component_mask); for (unsigned int i=0; i local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); std::vector cell_dofs(dofs_per_cell, false); typename DoFHandler::cell_iterator cell = mg_dof_handler.begin(), @@ -1463,7 +1463,7 @@ namespace MGTools template void extract_non_interface_dofs (const DoFHandler &mg_dof_handler, - std::vector > &non_interface_dofs) + std::vector > &non_interface_dofs) { Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(), ExcDimensionMismatch (non_interface_dofs.size(), @@ -1474,7 +1474,7 @@ namespace MGTools const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); std::vector cell_dofs(dofs_per_cell, false); std::vector cell_dofs_interface(dofs_per_cell, false); @@ -1560,8 +1560,8 @@ namespace MGTools const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; - std::vector local_dof_indices (dofs_per_cell); - std::vector face_dof_indices (dofs_per_face); + std::vector local_dof_indices (dofs_per_cell); + std::vector face_dof_indices (dofs_per_face); std::vector cell_dofs(dofs_per_cell, false); std::vector boundary_cell_dofs(dofs_per_cell, false); @@ -1623,7 +1623,7 @@ namespace MGTools template void apply_boundary_values ( - const std::set &boundary_dofs, + const std::set &boundary_dofs, SparseMatrix &matrix, const bool preserve_symmetry, const bool /*ignore_zeros*/) @@ -1634,8 +1634,8 @@ namespace MGTools // a deprecated function, I therefore threw away the original function // and replaced it by the following, which I believe should work - std::map boundary_values; - for (std::set::const_iterator p=boundary_dofs.begin(); + std::map boundary_values; + for (std::set::const_iterator p=boundary_dofs.begin(); p != boundary_dofs.end(); ++p) boundary_values[*p] = 0; @@ -1650,7 +1650,7 @@ namespace MGTools template void apply_boundary_values ( - const std::set &boundary_dofs, + const std::set &boundary_dofs, BlockSparseMatrix &matrix, const bool preserve_symmetry) { @@ -1666,8 +1666,8 @@ namespace MGTools // a deprecated function, I therefore threw away the original function // and replaced it by the following, which I believe should work - std::map boundary_values; - for (std::set::const_iterator p=boundary_dofs.begin(); + std::map boundary_values; + for (std::set::const_iterator p=boundary_dofs.begin(); p != boundary_dofs.end(); ++p) boundary_values[*p] = 0; @@ -1689,16 +1689,16 @@ namespace MGTools namespace MGTools { template void apply_boundary_values ( - const std::set &, + const std::set &, SparseMatrix &, const bool, const bool); template void apply_boundary_values ( - const std::set &, + const std::set &, SparseMatrix &, const bool, const bool); template void apply_boundary_values ( - const std::set &, + const std::set &, BlockSparseMatrix &, const bool); template void apply_boundary_values ( - const std::set &, + const std::set &, BlockSparseMatrix &, const bool); } diff --git a/deal.II/source/multigrid/mg_transfer_block.cc b/deal.II/source/multigrid/mg_transfer_block.cc index acf82b29ea..3db1882b7c 100644 --- a/deal.II/source/multigrid/mg_transfer_block.cc +++ b/deal.II/source/multigrid/mg_transfer_block.cc @@ -49,7 +49,7 @@ namespace const dealii::DoFHandler &mg_dof, MGLevelObject > &v, const std::vector &sel, - std::vector > &ndofs) + std::vector > &ndofs) { std::vector selected=sel; // Compute the number of blocks needed @@ -60,9 +60,9 @@ namespace if (ndofs.size() == 0) { - std::vector > + std::vector > new_dofs(mg_dof.get_tria().n_levels(), - std::vector(selected.size())); + std::vector(selected.size())); std::swap(ndofs, new_dofs); MGTools::count_dofs_per_block (mg_dof, ndofs); } @@ -96,7 +96,7 @@ namespace const dealii::DoFHandler &mg_dof, MGLevelObject > &v, const unsigned int selected_block, - std::vector > &ndofs) + std::vector > &ndofs) { const unsigned int n_blocks = mg_dof.get_fe().n_blocks(); Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks)); @@ -106,9 +106,9 @@ namespace if (ndofs.size() == 0) { - std::vector > + std::vector > new_dofs(mg_dof.get_tria().n_levels(), - std::vector(selected.size())); + std::vector(selected.size())); std::swap(ndofs, new_dofs); MGTools::count_dofs_per_block (mg_dof, ndofs); } @@ -229,7 +229,7 @@ void MGTransferBlockBase::build_matrices ( // Compute the lengths of all blocks sizes.clear (); - sizes.resize(n_levels, std::vector(fe.n_blocks())); + sizes.resize(n_levels, std::vector(fe.n_blocks())); MGTools::count_dofs_per_block(mg_dof, sizes); // Fill some index vectors @@ -238,10 +238,10 @@ void MGTransferBlockBase::build_matrices ( // Compute start indices from sizes for (unsigned int l=0; l&>(mg_dof), block_start); - unsigned int k=0; + types::global_dof_index k=0; for (unsigned int i=0; i dof_indices_parent (dofs_per_cell); - std::vector dof_indices_child (dofs_per_cell); + std::vector dof_indices_parent (dofs_per_cell); + std::vector dof_indices_child (dofs_per_cell); // for each level: first build the // sparsity pattern of the matrices @@ -411,7 +411,7 @@ void MGTransferBlockBase::build_matrices ( if (mg_constrained_dofs != 0) if (mg_constrained_dofs->set_boundary_values()) { - std::vector constrain_indices; + std::vector constrain_indices; std::vector > constraints_per_block (n_blocks); for (int level=n_levels-2; level>=0; --level) { @@ -425,7 +425,7 @@ void MGTransferBlockBase::build_matrices ( // need to filter away. constrain_indices.resize (0); constrain_indices.resize (prolongation_matrices[level]->n(), 0); - std::set::const_iterator dof + std::set::const_iterator dof = mg_constrained_dofs->get_boundary_indices()[level].begin(), endd = mg_constrained_dofs->get_boundary_indices()[level].end(); for (; dof != endd; ++dof) @@ -434,13 +434,13 @@ void MGTransferBlockBase::build_matrices ( unsigned int index = 0; for (unsigned int block=0; blockblock(block, block).m(); + const types::global_dof_index n_dofs = prolongation_matrices[level]->block(block, block).m(); constraints_per_block[block].resize(0); constraints_per_block[block].resize(n_dofs, 0); - for (unsigned int i=0; i::iterator start_row = prolongation_matrices[level]->block(block, block).begin(i), @@ -474,9 +474,9 @@ void MGTransferBlockSelect::build_matrices ( MGTransferBlockBase::build_matrices (dof, mg_dof); - std::vector temp_copy_indices; - std::vector global_dof_indices (fe.dofs_per_cell); - std::vector level_dof_indices (fe.dofs_per_cell); + std::vector temp_copy_indices; + std::vector global_dof_indices (fe.dofs_per_cell); + std::vector level_dof_indices (fe.dofs_per_cell); for (int level=dof.get_tria().n_levels()-1; level>=0; --level) { @@ -524,16 +524,16 @@ void MGTransferBlockSelect::build_matrices ( // copy_indices object. Then, insert the pairs // of global index and level index into // copy_indices. - const unsigned int n_active_dofs = + const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), - std::bind2nd(std::not_equal_to(), + std::bind2nd(std::not_equal_to(), numbers::invalid_unsigned_int)); copy_indices[selected_block][level].resize (n_active_dofs); - unsigned int counter = 0; - for (unsigned int i=0; i (temp_copy_indices[i], i); + std::pair (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); } } @@ -562,9 +562,9 @@ void MGTransferBlock::build_matrices ( MGTransferBlockBase::build_matrices (dof, mg_dof); - std::vector > temp_copy_indices (n_blocks); - std::vector global_dof_indices (fe.dofs_per_cell); - std::vector level_dof_indices (fe.dofs_per_cell); + std::vector > temp_copy_indices (n_blocks); + std::vector global_dof_indices (fe.dofs_per_cell); + std::vector level_dof_indices (fe.dofs_per_cell); for (int level=dof.get_tria().n_levels()-1; level>=0; --level) { typename DoFHandler::active_cell_iterator @@ -603,17 +603,17 @@ void MGTransferBlock::build_matrices ( for (unsigned int block=0; block(), + std::bind2nd(std::not_equal_to(), numbers::invalid_unsigned_int)); copy_indices[block][level].resize (n_active_dofs); - unsigned int counter = 0; - for (unsigned int i=0; i + std::pair (temp_copy_indices[block][i], i); Assert (counter == n_active_dofs, ExcInternalError()); } diff --git a/deal.II/source/multigrid/mg_transfer_component.cc b/deal.II/source/multigrid/mg_transfer_component.cc index 74d58198ab..c0eab83665 100644 --- a/deal.II/source/multigrid/mg_transfer_component.cc +++ b/deal.II/source/multigrid/mg_transfer_component.cc @@ -79,7 +79,7 @@ namespace MGLevelObject > &v, const std::vector &sel, const std::vector &target_comp, - std::vector > &ndofs) + std::vector > &ndofs) { std::vector selected=sel; std::vector target_component=target_comp; @@ -122,9 +122,9 @@ namespace if (ndofs.size() == 0) { - std::vector > + std::vector > new_dofs(mg_dof.get_tria().n_levels(), - std::vector(target_component.size())); + std::vector(target_component.size())); std::swap(ndofs, new_dofs); MGTools::count_dofs_per_block (mg_dof, ndofs, target_component); } @@ -179,7 +179,7 @@ namespace MGLevelObject > &v, const ComponentMask &component_mask, const std::vector &target_component, - std::vector > &ndofs) + std::vector > &ndofs) { Assert (component_mask.represents_n_components(target_component.size()), ExcMessage ("The component mask does not have the correct size.")); @@ -191,9 +191,9 @@ namespace if (ndofs.size() == 0) { - std::vector > + std::vector > new_dofs(mg_dof.get_tria().n_levels(), - std::vector(target_component.size())); + std::vector(target_component.size())); std::swap(ndofs, new_dofs); MGTools::count_dofs_per_block (mg_dof, ndofs, target_component); @@ -241,7 +241,7 @@ MGTransferSelect::do_copy_to_mg ( { --level; - typedef std::vector >::const_iterator IT; + typedef std::vector >::const_iterator IT; for (IT i=copy_to_and_from_indices[level].begin(); i != copy_to_and_from_indices[level].end(); ++i) dst[level](i->second) = src(i->first); @@ -334,10 +334,10 @@ void MGTransferComponentBase::build_matrices ( // Compute start indices from sizes for (unsigned int l=0; l dof_indices_parent (dofs_per_cell); - std::vector dof_indices_child (dofs_per_cell); + std::vector dof_indices_parent (dofs_per_cell); + std::vector dof_indices_child (dofs_per_cell); // for each level: first build the // sparsity pattern of the matrices @@ -503,9 +503,9 @@ void MGTransferComponentBase::build_matrices ( if (boundary_indices.size() != 0) { - std::vector > + std::vector > dofs_per_component(mg_dof.get_tria().n_levels(), - std::vector(n_components)); + std::vector(n_components)); MGTools::count_dofs_per_block (mg_dof, dofs_per_component, mg_target_component); for (unsigned int level=0; levelblock(iblock,jblock).m(); - for (unsigned int i=0; iblock(iblock,jblock).m(); + for (types::global_dof_index i=0; i::iterator anfang = prolongation_matrices[level]->block(iblock,jblock).begin(i), ende = prolongation_matrices[level]->block(iblock,jblock).end(i); @@ -530,7 +530,7 @@ void MGTransferComponentBase::build_matrices ( const BlockIndices block_indices_coarse (dofs_per_component[level]); const unsigned int global_j = block_indices_coarse.local_to_global(iblock, column_number); - std::set::const_iterator found_dof = + std::set::const_iterator found_dof = boundary_indices[level].find(global_j); const bool is_boundary_index = @@ -558,7 +558,7 @@ void MGTransferSelect::build_matrices ( unsigned int mg_select, const std::vector &t_component, const std::vector &mg_t_component, - const std::vector > &bdry_indices) + const std::vector > &bdry_indices) { const FiniteElement &fe = mg_dof.get_fe(); unsigned int ncomp = mg_dof.get_fe().n_components(); @@ -617,9 +617,9 @@ void MGTransferSelect::build_matrices ( // use a temporary vector to create the // relation between global and level dofs - std::vector temp_copy_indices; - std::vector global_dof_indices (fe.dofs_per_cell); - std::vector level_dof_indices (fe.dofs_per_cell); + std::vector temp_copy_indices; + std::vector global_dof_indices (fe.dofs_per_cell); + std::vector level_dof_indices (fe.dofs_per_cell); for (int level=dof.get_tria().n_levels()-1; level>=0; --level) { copy_to_and_from_indices[level].clear(); @@ -649,9 +649,9 @@ void MGTransferSelect::build_matrices ( if (component_mask[component] && !interface_dofs[level][level_dof_indices[i]]) { - const unsigned int level_start + const types::global_dof_index level_start = mg_component_start[level][mg_target_component[component]]; - const unsigned int global_start + const types::global_dof_index global_start = component_start[target_component[component]]; temp_copy_indices[level_dof_indices[i]-level_start] = global_dof_indices[i] - global_start; @@ -661,16 +661,16 @@ void MGTransferSelect::build_matrices ( // write indices from vector into the map from // global to level dofs - const unsigned int n_active_dofs = + const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), - std::bind2nd(std::not_equal_to(), + std::bind2nd(std::not_equal_to(), numbers::invalid_unsigned_int)); copy_to_and_from_indices[level].resize (n_active_dofs); - unsigned int counter = 0; - for (unsigned int i=0; i (temp_copy_indices[i], i); + std::pair (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); } } diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index 5d834c3e96..72b9b2e933 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -116,8 +116,8 @@ void MGTransferPrebuilt::build_matrices ( // two fields which will store the // indices of the multigrid dofs // for a cell and one of its children - std::vector dof_indices_parent (dofs_per_cell); - std::vector dof_indices_child (dofs_per_cell); + std::vector dof_indices_parent (dofs_per_cell); + std::vector dof_indices_child (dofs_per_cell); // for each level: first build the sparsity // pattern of the matrices and then build the @@ -139,7 +139,7 @@ void MGTransferPrebuilt::build_matrices ( // element will be stored CompressedSimpleSparsityPattern csp (sizes[level+1], sizes[level]); - std::vector entries (dofs_per_cell); + std::vector entries (dofs_per_cell); for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell) if (cell->has_children()) @@ -219,7 +219,7 @@ void MGTransferPrebuilt::build_matrices ( if (mg_constrained_dofs != 0) if (mg_constrained_dofs->set_boundary_values()) { - std::vector constrain_indices; + std::vector constrain_indices; for (int level=n_levels-2; level>=0; --level) { if (mg_constrained_dofs->get_boundary_indices()[level].size() == 0) @@ -232,14 +232,14 @@ void MGTransferPrebuilt::build_matrices ( // need to filter away. constrain_indices.resize (0); constrain_indices.resize (prolongation_matrices[level]->n(), 0); - std::set::const_iterator dof + std::set::const_iterator dof = mg_constrained_dofs->get_boundary_indices()[level].begin(), endd = mg_constrained_dofs->get_boundary_indices()[level].end(); for (; dof != endd; ++dof) constrain_indices[*dof] = 1; - const unsigned int n_dofs = prolongation_matrices[level]->m(); - for (unsigned int i=0; im(); + for (types::global_dof_index i=0; i::Matrix::iterator start_row = prolongation_matrices[level]->begin(i), @@ -265,9 +265,9 @@ void MGTransferPrebuilt::build_matrices ( // levels. copy_indices.resize(n_levels); - std::vector temp_copy_indices; - std::vector global_dof_indices (dofs_per_cell); - std::vector level_dof_indices (dofs_per_cell); + std::vector temp_copy_indices; + std::vector global_dof_indices (dofs_per_cell); + std::vector level_dof_indices (dofs_per_cell); for (int level=mg_dof.get_tria().n_levels()-1; level>=0; --level) { copy_indices[level].clear(); @@ -308,16 +308,16 @@ void MGTransferPrebuilt::build_matrices ( // copy_indices object. Then, insert the pairs // of global index and level index into // copy_indices. - const unsigned int n_active_dofs = + const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), - std::bind2nd(std::not_equal_to(), + std::bind2nd(std::not_equal_to(), numbers::invalid_unsigned_int)); copy_indices[level].resize (n_active_dofs); - unsigned int counter = 0; - for (unsigned int i=0; i (temp_copy_indices[i], i); + std::pair (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); } }