]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve SolutionTransfer exception
authorTimo Heister <timo.heister@gmail.com>
Wed, 24 Dec 2014 13:29:27 +0000 (08:29 -0500)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 26 Dec 2014 12:49:24 +0000 (13:49 +0100)
parallel::distributed::SolutionTransfer only works with parallel::distributed::Triangulation. This is now checked in the constructor.

source/distributed/solution_transfer.cc

index 27eee417eba0447ddedc141eea77183aed878d3f..3455251bf1ba9d89a3975196512a6a767f3b4812 100644 (file)
@@ -47,7 +47,13 @@ namespace parallel
     SolutionTransfer<dim, VECTOR, DH>::SolutionTransfer(const DH &dof)
       :
       dof_handler(&dof, typeid(*this).name())
-    {}
+    {
+      parallel::distributed::Triangulation<dim> *tria
+        = (dynamic_cast<parallel::distributed::Triangulation<dim>*>
+           (const_cast<dealii::Triangulation<dim>*>
+            (&dof_handler->get_tria())));
+      Assert (tria != 0, ExcMessage("parallel::distributed::SolutionTransfer requires a parallel::distributed::Triangulation object."));
+    }
 
 
 

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.