]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix DerivativeApproximation in parallel
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2013 21:06:47 +0000 (21:06 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2013 21:06:47 +0000 (21:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@31473 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/numerics/derivative_approximation.h
deal.II/source/numerics/derivative_approximation.cc

index a2277474cbb794d69856e2411c984268c7f997ce..ac3ebd69e19a26b6c490ef1fbd67a4568a2b40b3 100644 (file)
@@ -174,6 +174,12 @@ inconvenience this causes.
 <h3>Specific improvements</h3>
 
 <ol>
+  <li>
+  Fixed: the DerivativeApproximation class was not working correctly when
+  used with parallel vectors.
+  (Timo Heister, 2013/10/28)
+  </li>
+
   <li>
   ~Subscriptor and ~GrowingVectorMemory no longer throw an exception (the
   former if disable_abort_on_exception was called) to be compatible with the
index 3b47dd39041b1dd677e1e54af54aab27b6442367..72dbe95895e29efd537382e7ad61b6f5866bf85e 100644 (file)
@@ -24,6 +24,8 @@
 #include <deal.II/fe/fe_update_flags.h>
 #include <deal.II/fe/mapping.h>
 #include <deal.II/lac/vector.h>
+#include <deal.II/grid/filtered_iterator.h>
+
 #include <utility>
 
 DEAL_II_NAMESPACE_OPEN
@@ -676,8 +678,8 @@ private:
   template <class DerivativeDescription, int dim,
            template <int, int> class DH, class InputVector, int spacedim>
   static void
-  approximate (SynchronousIterators<std_cxx1x::tuple<typename DH<dim,spacedim>
-               ::active_cell_iterator,Vector<float>::iterator> > const &cell,
+  approximate (SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DH<dim,spacedim>::active_cell_iterator>,
+                Vector<float>::iterator> > const &cell,
                const Mapping<dim,spacedim>    &mapping,
                const DH<dim,spacedim>         &dof,
                const InputVector     &solution,
index cb8825c807ca698c97508bdd92e82adea7420ee9..a3311a49611d400036887ac68d4db9dc86d56680 100644 (file)
@@ -651,7 +651,7 @@ approximate_derivative (const Mapping<dim,spacedim>    &mapping,
   // Only act on the locally owned cells
   typedef FilteredIterator<typename DH<dim,spacedim>::active_cell_iterator> CellFilter;
   
-  typedef std_cxx1x::tuple<typename DH<dim,spacedim>::active_cell_iterator,Vector<float>::iterator>
+  typedef std_cxx1x::tuple<CellFilter,Vector<float>::iterator>
     Iterators;
   SynchronousIterators<Iterators> begin(Iterators (CellFilter(IteratorFilters::LocallyOwnedCell(),
             dof_handler.begin_active()),derivative_norm.begin())),
@@ -679,8 +679,7 @@ approximate_derivative (const Mapping<dim,spacedim>    &mapping,
 template <class DerivativeDescription, int dim,
          template <int, int> class DH, class InputVector, int spacedim>
 void
-DerivativeApproximation::approximate (SynchronousIterators<std_cxx1x::tuple<typename DH<dim,spacedim>
-                                      ::active_cell_iterator,Vector<float>::iterator> > const &cell,
+DerivativeApproximation::approximate (SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DH<dim,spacedim>::active_cell_iterator>,Vector<float>::iterator> > const &cell,
                                       const Mapping<dim,spacedim>                  &mapping,
                                       const DH<dim,spacedim>                       &dof_handler,
                                       const InputVector                            &solution,
@@ -760,7 +759,6 @@ approximate_cell (const Mapping<dim,spacedim>                   &mapping,
   // ...and the place where it lives
   const Point<dim> this_center = fe_midpoint_value.quadrature_point(0);
 
-
   // loop over all neighbors and
   // accumulate the difference
   // quotients from them. note

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.