From: heister Date: Thu, 15 Dec 2011 16:44:58 +0000 (+0000) Subject: Fixed: DerivativeApproximation for distributed computations. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0002ff8d06716afb76e4a56d4439c2482a3499a;p=dealii-svn.git Fixed: DerivativeApproximation for distributed computations. git-svn-id: https://svn.dealii.org/trunk@24829 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index cb8d133bcb..0425b486e4 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -73,6 +73,10 @@ enabled due to a missing include file in file

Specific improvements

    +
  1. Fixed: DerivativeApproximation for distributed computations. +
    +(Timo Heister, 2011/12/15) +
  2. Changed: The ExcMessage exception class took an argument of type char* that was displayed when the exception was raised. However, character pointers are awkward to work with diff --git a/deal.II/source/numerics/derivative_approximation.cc b/deal.II/source/numerics/derivative_approximation.cc index db140b69a6..3a02db12cd 100644 --- a/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/source/numerics/derivative_approximation.cc @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -675,22 +677,23 @@ DerivativeApproximation::approximate (const Mapping &mapping, std::advance (endc, static_cast(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 - (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 + (mapping, + dof_handler, + solution, + component, + cell, + derivative); + // evaluate the norm and fill the vector + *derivative_norm_on_this_cell + = DerivativeDescription::derivative_norm (derivative); + } } diff --git a/deal.II/source/numerics/derivative_approximation.inst.in b/deal.II/source/numerics/derivative_approximation.inst.in index 3723b4e8e5..92905d5b5d 100644 --- a/deal.II/source/numerics/derivative_approximation.inst.in +++ b/deal.II/source/numerics/derivative_approximation.inst.in @@ -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