From 708f67b506465a15fcb90e340af0ec2e012562d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 16 Mar 2018 18:32:21 -0600 Subject: [PATCH] Minor update to FETools::get_interpolation_difference_matrix(). In particular, (i) update the documentation slightly, and (ii) simplify the logic of the implementation by using IdentityMatrix. This also fixes the bug that there was an assumption that the matrix was all zeros beforehand. --- include/deal.II/fe/fe_tools.h | 11 ++++++----- include/deal.II/fe/fe_tools.templates.h | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/deal.II/fe/fe_tools.h b/include/deal.II/fe/fe_tools.h index 312e9663af..eb5991591c 100644 --- a/include/deal.II/fe/fe_tools.h +++ b/include/deal.II/fe/fe_tools.h @@ -210,14 +210,15 @@ namespace FETools FullMatrix &interpolation_matrix); /** - * Compute the identity matrix minus the back interpolation matrix. The @p - * difference_matrix needs to be of size (fe1.dofs_per_cell, - * fe1.dofs_per_cell). + * Compute the identity matrix minus the back interpolation matrix. + * The @p difference_matrix will be of size (fe1.dofs_per_cell, + * fe1.dofs_per_cell) after this function. Previous content + * of the argument will be overwritten. * * This function computes the matrix that transforms a @p fe1 function $z$ to * $z-I_hz$ where $I_h$ denotes the interpolation operator from the @p fe1 - * space to the @p fe2 space. This matrix hence is useful to evaluate error- - * representations where $z$ denotes the dual solution. + * space to the @p fe2 space. This matrix hence is useful to evaluate + * error-representations where $z$ denotes the dual solution. */ template void diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 7be75da35c..785d87879f 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -1512,10 +1512,8 @@ namespace FETools FullMatrix interpolation_matrix(fe1.dofs_per_cell); get_back_interpolation_matrix(fe1, fe2, interpolation_matrix); - for (unsigned int i=0; i