]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use the main function of previous tutorial programs.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Aug 2011 04:43:48 +0000 (04:43 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Aug 2011 04:43:48 +0000 (04:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@24116 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-10/step-10.cc

index d3395c9d1d47b2c34b0302b807f99b5995394df9..4f651c1e3918fc46874eeefa9948a0fc5eea0018 100644 (file)
@@ -644,17 +644,46 @@ namespace Step10
 }
 
 
-                                // The following main function just
-                                // calls the above functions in the
-                                // order of their appearance.
+                                // The following main function just calls the
+                                // above functions in the order of their
+                                // appearance. Apart from this, it looks just
+                                // like the main functions of previous
+                                // tutorial programs.
 int main ()
 {
-  std::cout.precision (16);
-
-  Step10::gnuplot_output<2>();
-
-  Step10::compute_pi_by_area<2> ();
-  Step10::compute_pi_by_perimeter<2> ();
+  try
+    {
+      std::cout.precision (16);
+
+      Step10::gnuplot_output<2>();
+
+      Step10::compute_pi_by_area<2> ();
+      Step10::compute_pi_by_perimeter<2> ();
+    }
+  catch (std::exception &exc)
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Exception on processing: " << std::endl
+               << exc.what() << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+
+      return 1;
+    }
+  catch (...)
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Unknown exception!" << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      return 1;
+    }
 
   return 0;
 }

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.