]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change initialization to avoid a static variable.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 20 Feb 2016 18:12:33 +0000 (13:12 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 20 Feb 2016 18:12:33 +0000 (13:12 -0500)
m_inverse depends on inner_control, so initialize inner_control first
rather than making it static.

examples/step-20/step-20.cc

index b63de089de989d3def27fb470553abd5de4bdbe4..d754d3549799f25928f9db5c554eb7c0c5c1d068 100644 (file)
@@ -700,11 +700,11 @@ namespace Step20
   template <int dim>
   void MixedLaplaceProblem<dim>::solve ()
   {
+    ReductionControl inner_control(1000, 0., 1.e-13);
     PreconditionIdentity identity;
     IterativeInverse<Vector<double> > m_inverse;
     m_inverse.initialize(system_matrix.block(0,0), identity);
     m_inverse.solver.select("cg");
-    static ReductionControl inner_control(1000, 0., 1.e-13);
     m_inverse.solver.set_control(inner_control);
 
     Vector<double> tmp (solution.block(0).size());

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.