From fed782148ea5c005d1e4a6cc2ba2975d0d978b0a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 21 Jul 2016 23:15:09 -0500 Subject: [PATCH] Improve an error message. Specifically, say early that using ::SolutionTransfer with parallel::distributed::Triangulation is likely going to lead to heartache. --- source/numerics/solution_transfer.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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.")); +} -- 2.39.5