From 368c5d81706921c16b2786ddc0cd8c8d33b62009 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Mon, 9 Nov 2020 23:55:08 -0700 Subject: [PATCH] Deprecate MatrixFree::get_dof_handler. Removing the instantiation will throw an error if someone writes matrix_free.template get_dof_handler>(); which will probably never happen as the default template is way more convenient. --- .../changes/incompatibilities/20201113Fehling | 5 +++++ include/deal.II/matrix_free/matrix_free.h | 15 ++++++++++++--- .../deal.II/matrix_free/matrix_free.templates.h | 12 ++++++++++++ source/matrix_free/matrix_free.inst.in | 6 ------ 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20201113Fehling diff --git a/doc/news/changes/incompatibilities/20201113Fehling b/doc/news/changes/incompatibilities/20201113Fehling new file mode 100644 index 0000000000..75bff197a8 --- /dev/null +++ b/doc/news/changes/incompatibilities/20201113Fehling @@ -0,0 +1,5 @@ +Deprecated: The variant of the function MatrixFree::get_dof_handler +expecting a DoFHandlerType template has been deprecated. Use the +template-less variant returning a DoFHandler instead. +
+(Marc Fehling, 2020/11/13) diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 25ad250d0f..b4f1b3a821 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -1689,6 +1689,13 @@ public: get_faces_by_cells_boundary_id(const unsigned int macro_cell, const unsigned int face_number) const; + /** + * Return the DoFHandler with the index as given to the respective + * `std::vector` argument in the reinit() function. + */ + const DoFHandler & + get_dof_handler(const unsigned int dof_handler_index = 0) const; + /** * Return the DoFHandler with the index as given to the respective * `std::vector` argument in the reinit() function. Note that if you want to @@ -1696,10 +1703,12 @@ public: * one, you will need to use the `template` before the function call, i.e., * you will have something like `matrix_free.template * get_dof_handler>()`. + * + * @deprecated Use the non-templated equivalent of this function. */ - template > - const DoFHandlerType & - get_dof_handler(const unsigned int dof_handler_index = 0) const; + template + DEAL_II_DEPRECATED const DoFHandlerType & + get_dof_handler(const unsigned int dof_handler_index = 0) const; /** * Return the cell iterator in deal.II speak to a given cell in the diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index fdd4febe56..bbb211e0b9 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -134,6 +134,18 @@ MatrixFree::renumber_dofs( +template +const DoFHandler & +MatrixFree::get_dof_handler( + const unsigned int dof_handler_index) const +{ + AssertIndexRange(dof_handler_index, n_components()); + + return *(dof_handlers[dof_handler_index]); +} + + + template template const DoFHandlerType & diff --git a/source/matrix_free/matrix_free.inst.in b/source/matrix_free/matrix_free.inst.in index b256093dcb..aaacd0001c 100644 --- a/source/matrix_free/matrix_free.inst.in +++ b/source/matrix_free/matrix_free.inst.in @@ -42,12 +42,6 @@ for (deal_II_dimension : DIMENSIONS; const std::vector &, const std::vector> &, const AdditionalData &); - - template const DoFHandler & - MatrixFree:: - get_dof_handler>(const unsigned int) const; } -- 2.39.5