From: kanschat Date: Sat, 25 May 2013 20:58:04 +0000 (+0000) Subject: do elimination of boundary columns locally X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477ad8ccfe2d09aedda56e2af0069c479744c832;p=dealii-svn.git do elimination of boundary columns locally git-svn-id: https://svn.dealii.org/trunk@29601 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index 4415dc60fd..2d687da908 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -185,7 +185,9 @@ void MGTransferPrebuilt::build_matrices ( csp, mg_dof); csp.reinit(0,0); - + + FullMatrix prolongation; + // now actually build the matrices for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell) @@ -203,9 +205,15 @@ void MGTransferPrebuilt::build_matrices ( // set an alias to the // prolongation matrix for // this child - const FullMatrix &prolongation + prolongation = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); + + if (mg_constrained_dofs != 0 && mg_constrained_dofs->set_boundary_values()) + for (unsigned int j=0;jis_boundary_index(level, dof_indices_parent[j])) + for (unsigned int i=0; ichild(child)->get_mg_dof_indices (dof_indices_child); @@ -222,46 +230,6 @@ void MGTransferPrebuilt::build_matrices ( } - // impose boundary conditions - // but only in the column of - // the prolongation matrix - if (mg_constrained_dofs != 0) - if (mg_constrained_dofs->set_boundary_values()) - { - std::vector constrain_indices; - for (int level=n_levels-2; level>=0; --level) - { - if (mg_constrained_dofs->get_boundary_indices()[level].size() == 0) - continue; - - // need to delete all the columns in the - // matrix that are on the boundary. to achieve - // this, create an array as long as there are - // matrix columns, and find which columns we - // need to filter away. - constrain_indices.resize (0); - constrain_indices.resize (prolongation_matrices[level]->n(), 0); - 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; i::Matrix::iterator - start_row = prolongation_matrices[level]->begin(i), - end_row = prolongation_matrices[level]->end(i); - for (; start_row != end_row; ++start_row) - { - if (constrain_indices[start_row->column()] == 1) - start_row->value() = 0; - } - } - } - } - // to find the indices that describe the // relation between global dofs and local // numbering on the individual level, first