From 6d1f0ec2a693999aefe7bc0ca497d691ccf570d5 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 17 Aug 2019 06:22:18 +0200 Subject: [PATCH] Implement DoFAccessor::set_mg_dof_indices and get_mg_dof_indices for 1D --- doc/news/changes/minor/20190818PeterMunch | 3 ++ include/deal.II/dofs/dof_accessor.templates.h | 41 +++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 doc/news/changes/minor/20190818PeterMunch 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