]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a couple other places where using FE_Nothing triggered assertions that weren...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 29 Jun 2012 08:51:32 +0000 (08:51 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 29 Jun 2012 08:51:32 +0000 (08:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@25661 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_accessor.cc
deal.II/source/numerics/solution_transfer.cc

index 1082bedd5ef610213445832cc75208561ed1870a..49e76304e5a37a462bff8485d73e7ed69508a6fd 100644 (file)
@@ -236,12 +236,23 @@ set_dof_values_by_interpolation (const Vector<number> &local_values,
 
       for (unsigned int child=0; child<this->n_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);
+           }
         }
     }
 }
index f7799903067eecea4999d101cef9769145f2b5e1..c449e9384b0c42630ac0ccf6f59fddf524a40cde 100644 (file)
@@ -434,11 +434,16 @@ prepare_for_coarsening_and_refinement(const std::vector<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<dofs_per_cell; ++i)
                         if (restriction_is_additive[fe_ind_general][i])
                           dof_values_on_cell[n_cf][j](i) += tmp(i);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.