From: bangerth Date: Fri, 9 Feb 2007 05:35:51 +0000 (+0000) Subject: cache the last field for which we didn't do this yet. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c489c03feeaa6c420fe82df2027395917ed8f2d;p=dealii-svn.git cache the last field for which we didn't do this yet. git-svn-id: https://svn.dealii.org/trunk@14434 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 92364f3df4..95c8367d1d 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1112,6 +1112,32 @@ namespace internal master_dof_mask[*i] = true; } + + + /** + * Make sure that the mask exists that + * determines which dofs will be the + * masters on refined faces where an + * fe1 and a fe2 meet. + */ + template + void + ensure_existence_of_master_dof_mask (const FiniteElement &fe1, + const FiniteElement &fe2, + const FullMatrix &face_interpolation_matrix, + boost::shared_ptr > &master_dof_mask) + { + if (master_dof_mask == 0) + { + master_dof_mask = boost::shared_ptr > + (new std::vector (fe1.dofs_per_face)); + select_master_dofs_for_face_restriction (fe1, + fe2, + face_interpolation_matrix, + *master_dof_mask); + } + } + /** * Make sure that the given @p @@ -1924,6 +1950,15 @@ namespace internal Table<2,boost::shared_ptr,FullMatrix > > > split_face_interpolation_matrices (n_finite_elements (dof_handler), n_finite_elements (dof_handler)); + + // finally, for each pair of finite + // elements, have a mask that states + // which of the degrees of freedom on + // the coarse side of a refined face + // will act as master dofs. + Table<2,boost::shared_ptr > > + master_dof_masks (n_finite_elements (dof_handler), + n_finite_elements (dof_handler)); // loop over all faces // @@ -2191,19 +2226,21 @@ namespace internal // master and slave // components. invert the // master component -//TODO[WB]: cache this mask as well - std::vector master_dof_mask (cell->get_fe().dofs_per_face); - select_master_dofs_for_face_restriction (cell->get_fe(), - dominating_fe, - (*face_interpolation_matrices - [dominating_fe_index] - [cell->active_fe_index()]), - master_dof_mask); + ensure_existence_of_master_dof_mask + (cell->get_fe(), + dominating_fe, + (*face_interpolation_matrices + [dominating_fe_index] + [cell->active_fe_index()]), + master_dof_masks + [dominating_fe_index] + [cell->active_fe_index()]); ensure_existence_of_split_face_matrix (*face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()], - master_dof_mask, + (*master_dof_masks + [dominating_fe_index][cell->active_fe_index()]), split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()]); @@ -2246,7 +2283,8 @@ namespace internal master_dofs.clear (); slave_dofs.clear (); for (unsigned int i=0; iget_fe().dofs_per_face; ++i) - if (master_dof_mask[i] == true) + if ((*master_dof_masks + [dominating_fe_index][cell->active_fe_index()])[i] == true) master_dofs.push_back (scratch_dofs[i]); else slave_dofs.push_back (scratch_dofs[i]); @@ -2493,6 +2531,7 @@ namespace internal + template void DoFTools::make_hanging_node_constraints (const DH &dof_handler,