From addcd5fcc8330acbaec4cf3851ed31f329f43595 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Mar 2018 17:18:14 -0600 Subject: [PATCH] Do not make a variable 'static' in the elastoplastic code gallery. Static variables are only initialized once at the beginning of the run. Here, the value of a variable depends on a function argument, and so it will only be computed based on the argument passed to the function *the first time around*, and will never be updated again in later calls. This is almost certainly not the desired behavior. --- goal_oriented_elastoplasticity/elastoplastic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goal_oriented_elastoplasticity/elastoplastic.cc b/goal_oriented_elastoplasticity/elastoplastic.cc index ad0c270..dc497b7 100644 --- a/goal_oriented_elastoplasticity/elastoplastic.cc +++ b/goal_oriented_elastoplasticity/elastoplastic.cc @@ -662,7 +662,7 @@ namespace ElastoPlastic { static const double rotation[3][3] = {{ 1, 0, 0}, { 0, 1, 0 }, { 0, 0, 1 } }; - static const Tensor<2,3> rot(rotation); + const Tensor<2,3> rot(rotation); return rot; } -- 2.39.5