[cig-commits] commit 2330 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Wed Mar 5 07:57:36 PST 2014


Revision 2330

Provide a better error message in case someone wants to restart but nothing has been checkpointed.

U   trunk/aspect/source/simulator/checkpoint_restart.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2330&peg=2330

Diff:
Modified: trunk/aspect/source/simulator/checkpoint_restart.cc
===================================================================
--- trunk/aspect/source/simulator/checkpoint_restart.cc	2014-03-03 20:12:27 UTC (rev 2329)
+++ trunk/aspect/source/simulator/checkpoint_restart.cc	2014-03-05 15:57:33 UTC (rev 2330)
@@ -135,6 +135,32 @@
   template <int dim>
   void Simulator<dim>::resume_from_snapshot()
   {
+    // first check existence of the two restart files
+    {
+      const std::string filename = parameters.output_directory + "restart.mesh";
+      std::ifstream in (filename.c_str());
+      if (!in)
+        AssertThrow (false,
+                     ExcMessage (std::string("You are trying to restart a previous computation, "
+                                             "but the restart file <")
+                                 +
+                                 filename
+                                 +
+                                 "> does not appear to exist!"));
+    }
+    {
+      const std::string filename = parameters.output_directory + "restart.resume.z";
+      std::ifstream in (filename.c_str());
+      if (!in)
+        AssertThrow (false,
+                     ExcMessage (std::string("You are trying to restart a previous computation, "
+                                             "but the restart file <")
+                                 +
+                                 filename
+                                 +
+                                 "> does not appear to exist!"));
+    }
+
     pcout << "*** Resuming from snapshot!" << std::endl << std::endl;
 
     try


More information about the CIG-COMMITS mailing list