From: Wolfgang Bangerth Date: Wed, 13 Sep 2017 19:46:51 +0000 (-0600) Subject: Implement set_dof_indices() also for the hp case. X-Git-Tag: v9.0.0-rc1~1066^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82b520eecd524931a36e42a68aa9d988eaf3a101;p=dealii.git Implement set_dof_indices() also for the hp case. This is a trivial copy of the non-hp case as long as we provide the appropriate active_fe_index. --- diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index c04fc4d8e9..b4a3e0cb7b 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -2950,15 +2950,83 @@ namespace internal } - // implementation for the case of hp::DoFHandler objects. it's - // not implemented there, for no space dimension + // implementation for the case of hp::DoFHandler objects template static void - set_dof_indices (const DoFCellAccessor, level_dof_access> &, - const std::vector &) + set_dof_indices (const DoFCellAccessor, level_dof_access> &accessor, + const std::vector &local_dof_indices) { - Assert (false, ExcNotImplemented()); + Assert (accessor.has_children() == false, + ExcInternalError()); + + const unsigned int dofs_per_vertex = accessor.get_fe().template n_dofs_per_object<0>(), + dofs_per_line = accessor.get_fe().template n_dofs_per_object<1>(), + dofs_per_quad = accessor.get_fe().template n_dofs_per_object<2>(), + dofs_per_hex = accessor.get_fe().template n_dofs_per_object<3>(), + dofs_per_cell = accessor.get_fe().dofs_per_cell; + (void)dofs_per_cell; + + Assert (local_dof_indices.size() == dofs_per_cell, + ExcInternalError()); + + unsigned int index = 0; + + for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) + for (unsigned int d=0; d::lines_per_cell; ++line) + for (unsigned int d=0; dset_dof_index(dim < 3 + ? + d + : + accessor.get_fe(). + adjust_line_dof_index_for_line_orientation(d, + accessor.line_orientation(line)), + local_dof_indices[index], + accessor.active_fe_index()); + // now copy dof numbers into the face. for faces in 3d with the + // wrong orientation, we have already made sure that we're ok + // by picking the correct lines and vertices (this happens + // automatically in the line() and vertex() + // functions). however, if the face is in wrong orientation, + // we look at it in flipped orientation and we will have to + // adjust the shape function indices that we see to correspond + // to the correct (cell-local) ordering. The same applies, if + // the face_rotation or face_orientation is non-standard + // + // again, if dim<3, then there is nothing to adjust + for (unsigned int quad=0; quad::quads_per_cell; ++quad) + for (unsigned int d=0; dset_dof_index(dim < 3 + ? + d + : + accessor.get_fe(). + adjust_quad_dof_index_for_face_orientation(d, + accessor.face_orientation(quad), + accessor.face_flip(quad), + accessor.face_rotation(quad)), + local_dof_indices[index], + accessor.active_fe_index()); + for (unsigned int d=0; d