From: bangerth Date: Fri, 9 Sep 2011 03:57:13 +0000 (+0000) Subject: Use the standard form main() function. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06d797ea8cb22cdac022a93f17038d0604459859;p=dealii-svn.git Use the standard form main() function. git-svn-id: https://svn.dealii.org/trunk@24294 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index 687e11fb83..6ad001a369 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -1149,12 +1149,40 @@ InteriorPenaltyProblem::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; }