]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed: DerivativeApproximation for distributed computations.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Dec 2011 16:44:58 +0000 (16:44 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Dec 2011 16:44:58 +0000 (16:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@24829 0785d39b-7218-0410-832d-ea1e28bc413d

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

index cb8d133bcbc7ebfd4a151910fb81fd374c2fc186..0425b486e467a9b7964225dbd8b2951eb835f1b5 100644 (file)
@@ -73,6 +73,10 @@ enabled due to a missing include file in file
 <h3>Specific improvements</h3>
 
 <ol>
+<li> Fixed: DerivativeApproximation for distributed computations.
+<br>
+(Timo Heister, 2011/12/15)
+
 <li> Changed: The ExcMessage exception class took an argument of
 type <code>char*</code> that was displayed when the exception
 was raised. However, character pointers are awkward to work with
index db140b69a612cbd7d829cf832dfafcbd98b2d19d..3a02db12cd04737ca95bf8c971bcbcb63698ec95 100644 (file)
@@ -19,6 +19,8 @@
 #include <deal.II/lac/block_vector.h>
 #include <deal.II/lac/petsc_vector.h>
 #include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/trilinos_block_vector.h>
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/dofs/dof_accessor.h>
@@ -675,22 +677,23 @@ DerivativeApproximation::approximate (const Mapping<dim,spacedim>    &mapping,
   std::advance (endc, static_cast<int>(index_interval.second));
 
   for (; cell!=endc; ++cell, ++derivative_norm_on_this_cell)
-    {
-      typename DerivativeDescription::Derivative derivative;
-                                      // call the function doing the actual
-                                      // work on this cell
-      DerivativeApproximation::
-       template approximate_cell<DerivativeDescription,dim,DH,InputVector>
-       (mapping,
-        dof_handler,
-        solution,
-        component,
-        cell,
-        derivative);
-                                      // evaluate the norm and fill the vector
-      *derivative_norm_on_this_cell
-       = DerivativeDescription::derivative_norm (derivative);
-    }
+    if (cell->is_locally_owned())
+      {
+       typename DerivativeDescription::Derivative derivative;
+                                        // call the function doing the actual
+                                        // work on this cell
+       DerivativeApproximation::
+         template approximate_cell<DerivativeDescription,dim,DH,InputVector>
+         (mapping,
+          dof_handler,
+          solution,
+          component,
+          cell,
+          derivative);
+                                        // evaluate the norm and fill the vector
+       *derivative_norm_on_this_cell
+         = DerivativeDescription::derivative_norm (derivative);
+      }
 }
 
 
index 3723b4e8e5a30032b4824adece430569c622a57b..92905d5b5df68570ab52881a22f1ea169b518bec 100644 (file)
@@ -101,6 +101,15 @@ INSTANTIATE(PETScWrappers::Vector, hp::DoFHandler);
 INSTANTIATE(PETScWrappers::BlockVector, hp::DoFHandler);
 #endif
 
+#ifdef DEAL_II_USE_TRILINOS
+INSTANTIATE(TrilinosWrappers::Vector, DoFHandler);
+INSTANTIATE(TrilinosWrappers::BlockVector, DoFHandler);
+INSTANTIATE(TrilinosWrappers::MPI::Vector, DoFHandler);
+INSTANTIATE(TrilinosWrappers::MPI::BlockVector, DoFHandler);
+
+//TODO: test hp before instantiating
+#endif
+
 #undef INSTANTIATE
 
 template

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.