From: bangerth Date: Fri, 19 Aug 2011 04:43:48 +0000 (+0000) Subject: Use the main function of previous tutorial programs. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be0975469934a0270157a7f1968b824ad420500;p=dealii-svn.git Use the main function of previous tutorial programs. git-svn-id: https://svn.dealii.org/trunk@24116 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-10/step-10.cc b/deal.II/examples/step-10/step-10.cc index d3395c9d1d..4f651c1e39 100644 --- a/deal.II/examples/step-10/step-10.cc +++ b/deal.II/examples/step-10/step-10.cc @@ -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; }