From: Peter Munch Date: Sat, 17 Aug 2019 04:22:18 +0000 (+0200) Subject: Implement DoFAccessor::set_mg_dof_indices and get_mg_dof_indices for 1D X-Git-Tag: v9.2.0-rc1~1227^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8593%2Fhead;p=dealii.git Implement DoFAccessor::set_mg_dof_indices and get_mg_dof_indices for 1D --- diff --git a/doc/news/changes/minor/20190818PeterMunch b/doc/news/changes/minor/20190818PeterMunch new file mode 100644 index 0000000000..ee11757db0 --- /dev/null +++ b/doc/news/changes/minor/20190818PeterMunch @@ -0,0 +1,3 @@ +New: Implement DoFAccessor::set_mg_dof_indices and get_mg_dof_indices for 1D. +
+(Peter Munch, 2019/08/18) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index be8285f8ba..bb90ee4087 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -1408,12 +1408,29 @@ namespace internal template static void set_mg_dof_indices( - const dealii::DoFAccessor<1, DoFHandlerType, level_dof_access> &, - const int, - const std::vector &, - const unsigned int) + const dealii::DoFAccessor<1, DoFHandlerType, level_dof_access> + & accessor, + const int level, + const std::vector &dof_indices, + const unsigned int fe_index) { - AssertThrow(false, ExcNotImplemented()); // TODO[TH]: implement + const FiniteElement &fe = + accessor.get_dof_handler().get_fe(fe_index); + std::vector::const_iterator next = + dof_indices.begin(); + + for (unsigned int vertex = 0; + vertex < GeometryInfo<1>::vertices_per_cell; + ++vertex) + for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + accessor.set_mg_vertex_dof_index( + level, vertex, dof, *next++, fe_index); + + for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + accessor.set_mg_dof_index(level, dof, *next++); + + Assert(next == dof_indices.end(), ExcInternalError()); } @@ -2509,18 +2526,16 @@ template