From: guido Date: Fri, 11 Jul 2003 18:51:32 +0000 (+0000) Subject: MGTransferBlock with target_component X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a52c4bc1ba762cab5d8bca7fef4ab722821b1b34;p=dealii-svn.git MGTransferBlock with target_component git-svn-id: https://svn.dealii.org/trunk@7875 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.templates.h b/deal.II/deal.II/include/multigrid/mg_transfer.templates.h index 1e4bee572c..173ad81027 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.templates.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.templates.h @@ -624,7 +624,7 @@ copy_to_mg (const MGDoFHandler &mg_dof_handler, { //TODO:[GK] Not sure if this works if components are selected dst[level](level_dof_indices[i]) - = src(global_dof_indices[i]); + = src(global_dof_indices[i]); } //TODO: Special treatment of faces? Copy from MGTransferPrebuilt when done there. } diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index a3ba71f313..42bc9452af 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -388,8 +388,9 @@ MGTools::reinit_vector (const MGDoFHandler& mg_dof, } - - +//TODO:[GK] Check if this function can be simplified +// It took quite a lot of try and error to make it work with +// target_component, so it is more grown than designed template void @@ -418,25 +419,33 @@ MGTools::reinit_vector (const MGDoFHandler& mg_dof, Assert (selected.size() == target_component.size(), ExcDimensionMismatch(selected.size(), target_component.size())); - unsigned int n_selected = std::accumulate (selected.begin(), - selected.end(), - 0U); - + std::vector target_selected(selected.size(), false); + for (unsigned int i=0;i > ndofs(mg_dof.get_tria().n_levels(), std::vector(target_component.size())); - count_dofs_per_component (mg_dof, ndofs); + count_dofs_per_component (mg_dof, ndofs, target_component); for (unsigned int level=v.get_minlevel(); level<=v.get_maxlevel();++level) { v[level].reinit(n_selected, 0); unsigned int k=0; - for (unsigned int i=0;i::build_matrices ( s[select] = true; target_component = t_component; - if (target_component.size() == 0) - { - target_component.resize(ncomp); - for (unsigned int i=0;i