From 2be46094200872ffa8cc9f63d20d20926cb392eb Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Mon, 11 Feb 2019 18:02:27 +0100 Subject: [PATCH] Add warning to set_fe. --- include/deal.II/dofs/dof_handler.h | 5 +++++ include/deal.II/hp/dof_handler.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 1da5931739..d07ecf0738 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -487,6 +487,11 @@ public: * main class and refer to it directly whenever you need to access * properties of the finite element (such as * FiniteElementData::dofs_per_cell). This is what all tutorial programs do. + * + * @warning This function only sets a FiniteElement. Degrees of freedom have + * either not been distributed yet, or are distributed using a previously set + * element. In both cases, accessing degrees of freedom will lead to invalid + * results. To restore consistency, call distribute_dofs(). */ virtual void set_fe(const FiniteElement &fe); diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index 3b73789941..e16a524952 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -426,6 +426,12 @@ namespace hp * * @note In accordance with dealii::DoFHandler::set_fe(), * this function also makes a copy of the object given as argument. + * + * @warning This function only sets a hp::FECollection. Degrees of freedom + * have either not been distributed yet, or are distributed using a + * previously set collection. In both cases, accessing degrees of freedom + * will lead to invalid results. To restore consistency, call + * distribute_dofs(). */ virtual void set_fe(const hp::FECollection &fe); -- 2.39.5