From: Wolfgang Bangerth Date: Tue, 20 Mar 2018 23:11:51 +0000 (-0600) Subject: Do not make a variable in step-35 static. X-Git-Tag: v9.0.0-rc1~296^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfffa3c611d735f599fc6a18582af0357197cf0b;p=dealii.git 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. --- 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);