From 49d0cbfd65fb90d3846baa0230281d689c9db61f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 19 Dec 2000 13:50:54 +0000 Subject: [PATCH] Fix more bugs. git-svn-id: https://svn.dealii.org/trunk@3572 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_tools.cc | 91 ++++++++++++++++-------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index a787ec7eb4..ce4e671172 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1151,7 +1151,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa // to true if this is an // interesting dof. finally count // how many true's there - vector dof_is_interesting (fine_grid.n_dofs(), false); + vector dof_is_interesting (fine_grid.n_dofs(), false); vector local_dof_indices (fine_fe.dofs_per_cell); for (DoFHandler::active_cell_iterator cell=fine_grid.begin_active(); @@ -1164,10 +1164,23 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa }; n_parameters_on_fine_grid = count (dof_is_interesting.begin(), - dof_is_interesting.end(), - true); + dof_is_interesting.end(), + true); }; + // get an array in which we store + // which dof on the coarse grid is + // a parameter and which is not + vector coarse_dof_is_parameter (coarse_grid.n_dofs()); + if (true) + { + vector mask (coarse_grid.get_fe().n_components(), + false); + mask[coarse_component] = true; + extract_dofs (coarse_grid, mask, coarse_dof_is_parameter); + }; + + // store the weights with which a dof // on the parameter grid contributes @@ -1296,28 +1309,40 @@ DoFTools::compute_intergrid_constraints (const DoFHandler &coa // possibly others) vector representants(weights.m(), -1); for (unsigned int parameter_dof=0; parameter_dof(column)) - break; - Assert (global_dof < weight_mapping.size(), ExcInternalError()); - - // now enter the representants global - // index into our list - representants[parameter_dof] = global_dof; - }; + if (coarse_dof_is_parameter[parameter_dof] == true) + { + unsigned int column=0; + for (; column(column)) + break; + Assert (global_dof < weight_mapping.size(), ExcInternalError()); + + // now enter the representants global + // index into our list + representants[parameter_dof] = global_dof; + } + else + { + // consistency check: if this + // is no parameter dof on the + // coarse grid, then the + // respective row must be + // empty! + for (unsigned int col=0; col &coars // loop over all dofs on this // cell and check whether they // are interesting for us - for (unsigned int local_parameter_dof=0; - local_parameter_dof &coars // zero if (global_parameter_representation(i) != 0) { - const unsigned int wi = parameter_dof_indices[local_parameter_dof], + const unsigned int wi = parameter_dof_indices[local_dof], wj = weight_mapping[i]; weights(wi,wj) = global_parameter_representation(i); }; -- 2.39.5