]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make get_interpolated_dof_values aware of FEs with additive restriction.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 9 Aug 1999 15:56:24 +0000 (15:56 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 9 Aug 1999 15:56:24 +0000 (15:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@1648 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b02207d5cff82ba16dd434b8ac09cbbca1435e85..7689fcd553279ebd30700c32713688d6a7b3eca5 100644 (file)
@@ -680,6 +680,9 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const Vector<number> &values,
       
       interpolated_values.clear ();
 
+      const bool restriction_is_additive 
+       = dof_handler->get_fe().restriction_is_additive;
+
       for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell;
           ++child)
        {
@@ -699,9 +702,17 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const Vector<number> &values,
                                           // end in adding up the contribution
                                           // from nodes on boundaries of
                                           // children more than once.
-         for (unsigned int i=0; i<total_dofs; ++i)
-           if (tmp2(i) != 0)
-             interpolated_values(i) = tmp2(i);
+         if (restriction_is_additive) 
+           {
+             for (unsigned int i=0; i<total_dofs; ++i)
+               interpolated_values(i) += tmp2(i);
+           } 
+         else
+           {  
+             for (unsigned int i=0; i<total_dofs; ++i)
+               if (tmp2(i) != 0)
+                 interpolated_values(i) = tmp2(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.