From: wolf Date: Fri, 24 Jan 2003 15:58:23 +0000 (+0000) Subject: Introduce an abbreviation. Work around a problem on AIX by a really unnecessary hack... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d721e386721964a6e8cbc772e0bbe8fff7c715a;p=dealii-svn.git Introduce an abbreviation. Work around a problem on AIX by a really unnecessary hack, which, however, also doesn't hurt on other systems. git-svn-id: https://svn.dealii.org/trunk@6957 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index 545b8f2ca2..0b0b790c32 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -868,7 +868,7 @@ void LaplaceProblem::assemble_system () // would to go other ways here, of // course. Solution exact_solution; - + // Now for the main loop over all // cells. This is mostly unchanged // from previous examples, so we @@ -1771,6 +1771,21 @@ int main () { deallog.depth_console (0); + // Since we instantiate the + // several template classes + // below for two space + // dimensions, let us make this + // more generic by having a + // constant denoting the number + // of space dimensions. If you + // want to run the program in + // 1d or 2d, you will then only + // have to change this one + // instance, rather than all + // uses below: + const int dim = 2; + + // Now for the three calls to // the main class. Each call is // blocked into curly braces in @@ -1786,8 +1801,8 @@ int main () << "=============================================" << std::endl << std::endl; - FE_Q<2> fe(1); - LaplaceProblem<2> laplace_problem_2d (fe, LaplaceProblem<2>::adaptive_refinement); + FE_Q fe(1); + LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::adaptive_refinement); laplace_problem_2d.run (); std::cout << std::endl; @@ -1798,8 +1813,8 @@ int main () << "===========================================" << std::endl << std::endl; - FE_Q<2> fe(1); - LaplaceProblem<2> laplace_problem_2d (fe, LaplaceProblem<2>::global_refinement); + FE_Q fe(1); + LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::global_refinement); laplace_problem_2d.run (); std::cout << std::endl; @@ -1810,8 +1825,8 @@ int main () << "===========================================" << std::endl << std::endl; - FE_Q<2> fe(2); - LaplaceProblem<2> laplace_problem_2d (fe, LaplaceProblem<2>::global_refinement); + FE_Q fe(2); + LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::global_refinement); laplace_problem_2d.run (); std::cout << std::endl; @@ -1844,3 +1859,22 @@ int main () return 0; } + + + // What comes here is basically just + // an annoyance that you can ignore + // if you are not working on an AIX + // system: on this system, static + // member variables are not + // instantiated automatically when + // their enclosing class is + // instantiated. This leads to linker + // errors if these variables are not + // explicitly instantiated. As said, + // this is, strictly C++ standards + // speaking, not necessary, but it + // doesn't hurt either on other + // systems, and since it is necessary + // to get things running on AIX, why + // not do it: +template double SolutionBase<2>::width;