From: Wolfgang Bangerth Date: Fri, 22 Jul 2016 04:15:09 +0000 (-0500) Subject: Improve an error message. X-Git-Tag: v8.5.0-rc1~856^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2852%2Fhead;p=dealii.git Improve an error message. Specifically, say early that using ::SolutionTransfer with parallel::distributed::Triangulation is likely going to lead to heartache. --- diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 6e1dc4def2..77deb0f9eb 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 1999 - 2015 by the deal.II authors +// Copyright (C) 1999 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -15,10 +15,11 @@ #include #include -#include #include -#include #include +#include +#include +#include #include #include #include @@ -35,12 +36,22 @@ DEAL_II_NAMESPACE_OPEN template -SolutionTransfer::SolutionTransfer(const DoFHandlerType &dof) +SolutionTransfer:: +SolutionTransfer(const DoFHandlerType &dof) : dof_handler(&dof, typeid(*this).name()), n_dofs_old(0), prepared_for(none) -{} +{ + Assert ((dynamic_cast*> + (&dof_handler->get_tria()) + == 0), + ExcMessage ("You are calling the dealii::SolutionTransfer class " + "with a DoF handler that is built on a " + "parallel::distributed::Triangulation. This will not " + "work for parallel computations. You probably want to " + "use the parallel::distributed::SolutionTransfer class.")); +}