]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use the standard form main() function.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Sep 2011 03:57:13 +0000 (03:57 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Sep 2011 03:57:13 +0000 (03:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@24294 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 687e11fb83867c25cb1df5742efd029adc2ca616..6ad001a3699fdd6e069867efd111c6f4e931b397 100644 (file)
@@ -1149,12 +1149,40 @@ InteriorPenaltyProblem<dim>::run(unsigned int n_steps)
 
 int main()
 {
-  using namespace dealii;
-  using namespace Step39;
+  try
+    {
+      using namespace dealii;
+      using namespace Step39;
+
+      std::ofstream logfile("deallog");
+      deallog.attach(logfile);
+      FE_DGQ<2> fe1(3);
+      InteriorPenaltyProblem<2> test1(fe1);
+      test1.run(12);
+    }
+  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;
+    }
 
-  std::ofstream logfile("deallog");
-  deallog.attach(logfile);
-  FE_DGQ<2> fe1(3);
-  InteriorPenaltyProblem<2> test1(fe1);
-  test1.run(12);
+  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.