From 91e879c13a50aafdb4f4315fa3e9c98d848f0d53 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 11 Apr 2009 00:03:21 +0000 Subject: [PATCH] Don't use static variables for anything that depends on some input parameter and/or may be non-constant. The use of static variables otherwise leads to surprising results if the same code is run twice within the same program execution but using different input files, and it is dangerous if code is run in a multi-threaded context. git-svn-id: https://svn.dealii.org/trunk@18583 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-34/step-34.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deal.II/examples/step-34/step-34.cc b/deal.II/examples/step-34/step-34.cc index d1491ce28b..602ca7163f 100644 --- a/deal.II/examples/step-34/step-34.cc +++ b/deal.II/examples/step-34/step-34.cc @@ -398,7 +398,7 @@ void BEMProblem::read_parameters(std::string filename) { "d simulation"); prm.enter_subsection("Quadrature rules"); - static QuadratureSelector quadrature + QuadratureSelector quadrature (prm.get("Quadrature type"), prm.get_integer("Quadrature order")); singular_quadrature_order = prm.get_integer("Singular quadrature order"); @@ -490,8 +490,7 @@ void BEMProblem::read_domain() { // template parameter that specifies the embedding space // dimension. - Point p; - static HyperBallBoundary boundary(p,1.); + static HyperBallBoundary boundary(Point(),1.); GridIn gi; gi.attach_triangulation (tria); @@ -721,8 +720,8 @@ void BEMProblem::assemble_system() { fe_v_singular.reinit(cell); - static std::vector > singular_cell_wind( (*singular_quadrature).size(), - Vector(dim) ); + std::vector > singular_cell_wind( (*singular_quadrature).size(), + Vector(dim) ); const std::vector > &singular_normals = fe_v_singular.get_cell_normal_vectors(); const std::vector > &singular_q_points = fe_v_singular.get_quadrature_points(); -- 2.39.5