From 39c7255f2e54a56479f4cffbcaddaeed6ffd69e0 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 20 Aug 2023 21:26:45 -0400 Subject: [PATCH] Improve aliasing by explicitly copying a value. --- source/fe/fe_values_views_internal.cc | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/fe/fe_values_views_internal.cc b/source/fe/fe_values_views_internal.cc index 4a038e2122..ab6abb8a6e 100644 --- a/source/fe/fe_values_views_internal.cc +++ b/source/fe/fe_values_views_internal.cc @@ -81,7 +81,7 @@ namespace FEValuesViews if (shape_function_data[shape_function] .is_nonzero_shape_function_component) { - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is // zero does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -122,7 +122,7 @@ namespace FEValuesViews if (shape_function_data[shape_function] .is_nonzero_shape_function_component) { - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is // zero does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -164,7 +164,7 @@ namespace FEValuesViews if (shape_function_data[shape_function] .is_nonzero_shape_function_component) { - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is // zero does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -212,7 +212,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -274,7 +274,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -340,7 +340,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -408,7 +408,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -485,7 +485,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value // is zero does not imply that its derivatives are zero as // well. So we can't filter by value for these number types. @@ -568,7 +568,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value // is zero does not imply that its derivatives are zero as // well. So we can't filter by value for these number types. @@ -731,7 +731,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -801,7 +801,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -870,7 +870,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -977,7 +977,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -1047,7 +1047,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -1117,7 +1117,7 @@ namespace FEValuesViews // shape function is zero for the selected components continue; - const Number &value = dof_values[shape_function]; + const Number value = dof_values[shape_function]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. -- 2.39.5