From cfffa3c611d735f599fc6a18582af0357197cf0b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Mar 2018 17:11:51 -0600 Subject: [PATCH] Do not make a variable in step-35 static. Static variables are only initialized once at the beginning of the run. Here, we have a vector that is marked as 'static' but this really only works because we never do mesh refinement in this program and consequently (i) the originally set size continues to be correct, and (ii) the code below sets every vector element, rather than add to it. --- examples/step-35/step-35.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index 99558bb7ad..7b7f08cff9 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -1298,7 +1298,7 @@ namespace Step35 ((dim + 1)*dof_handler_velocity.n_dofs() + dof_handler_pressure.n_dofs()), ExcInternalError()); - static Vector joint_solution (joint_dof_handler.n_dofs()); + Vector joint_solution (joint_dof_handler.n_dofs()); std::vector loc_joint_dof_indices (joint_fe.dofs_per_cell), loc_vel_dof_indices (fe_velocity.dofs_per_cell), loc_pres_dof_indices (fe_pressure.dofs_per_cell); -- 2.39.5