From 9a08ec548a951ba28d78b099fdab378cc4ff8bf7 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 29 Jun 2012 08:51:32 +0000 Subject: [PATCH] Fix a couple other places where using FE_Nothing triggered assertions that weren't warranted here. git-svn-id: https://svn.dealii.org/trunk@25661 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/dofs/dof_accessor.cc | 21 +++++++++++++++----- deal.II/source/numerics/solution_transfer.cc | 11 +++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/deal.II/source/dofs/dof_accessor.cc b/deal.II/source/dofs/dof_accessor.cc index 1082bedd5e..49e76304e5 100644 --- a/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/source/dofs/dof_accessor.cc @@ -236,12 +236,23 @@ set_dof_values_by_interpolation (const Vector &local_values, for (unsigned int child=0; childn_children(); ++child) { - // prolong the given data - // to the present cell - this->get_fe().get_prolongation_matrix(child, this->refinement_case()) - .vmult (tmp, local_values); + Assert (this->child(child)->get_fe().dofs_per_cell == dofs_per_cell, + ExcNotImplemented()); - this->child(child)->set_dof_values_by_interpolation (tmp, values); + // prolong the given data + // to the present + // cell. FullMatrix only + // wants us to call vmult + // if the matrix size is + // actually non-zero, so + // check that case + if (tmp.size() > 0) + { + this->get_fe().get_prolongation_matrix(child, this->refinement_case()) + .vmult (tmp, local_values); + + this->child(child)->set_dof_values_by_interpolation (tmp, values); + } } } } diff --git a/deal.II/source/numerics/solution_transfer.cc b/deal.II/source/numerics/solution_transfer.cc index f779990306..c449e9384b 100644 --- a/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/source/numerics/solution_transfer.cc @@ -434,11 +434,16 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) else tmp2.swap (tmp); - // now do the interpolation operation + // now do the interpolation + // operation. FullMatrix only wants us + // to call vmult if the matrix size is + // actually non-zero, so check that + // case const unsigned int dofs_per_cell = tmp2.size(); tmp.reinit (dofs_per_cell, true); - cell->child(most_general_child)->get_fe(). - get_restriction_matrix(child, cell->refinement_case()).vmult (tmp, tmp2); + if (dofs_per_cell > 0) + cell->child(most_general_child)->get_fe(). + get_restriction_matrix(child, cell->refinement_case()).vmult (tmp, tmp2); for (unsigned int i=0; i