From eaa05204d89333a17568d442aad35ec2d25a1e6d Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 11 Dec 2008 21:48:56 +0000 Subject: [PATCH] Do some common subexpression elimination by hand. git-svn-id: https://svn.dealii.org/trunk@17919 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_values.h | 71 ++++++++++++++++---------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 4fc65ba2c1..1342484710 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -3457,9 +3457,10 @@ namespace FEValuesViews // component as fixed and we have // pre-computed and cached a bunch of // information. see the comments there - if (shape_function_data[shape_function].is_nonzero_shape_function_component) - return fe_values.shape_values(shape_function_data[shape_function] - .row_index, + const ShapeFunctionData &this_shape_function + = shape_function_data[shape_function]; + if (this_shape_function.is_nonzero_shape_function_component) + return fe_values.shape_values(this_shape_function.row_index, q_point); else return 0; @@ -3486,9 +3487,10 @@ namespace FEValuesViews // component as fixed and we have // pre-computed and cached a bunch of // information. see the comments there - if (shape_function_data[shape_function].is_nonzero_shape_function_component) - return fe_values.shape_gradients[shape_function_data[shape_function] - .row_index][q_point]; + const ShapeFunctionData &this_shape_function + = shape_function_data[shape_function]; + if (this_shape_function.is_nonzero_shape_function_component) + return fe_values.shape_gradients[this_shape_function.row_index][q_point]; else return gradient_type(); } @@ -3513,8 +3515,10 @@ namespace FEValuesViews // component as fixed and we have // pre-computed and cached a bunch of // information. see the comments there - if (shape_function_data[shape_function].is_nonzero_shape_function_component) - return fe_values.shape_hessians[shape_function_data[shape_function].row_index][q_point]; + const ShapeFunctionData &this_shape_function + = shape_function_data[shape_function]; + if (this_shape_function.is_nonzero_shape_function_component) + return fe_values.shape_hessians[this_shape_function.row_index][q_point]; else return hessian_type(); } @@ -3535,13 +3539,15 @@ namespace FEValuesViews // same as for the scalar case except // that we have one more index - const int snc = shape_function_data[shape_function].single_nonzero_component; + const ShapeFunctionData &this_shape_function + = shape_function_data[shape_function]; + const int snc = this_shape_function.single_nonzero_component; if (snc == -2) return value_type(); else if (snc != -1) { value_type return_value; - return_value[shape_function_data[shape_function].single_nonzero_component_index] + return_value[this_shape_function.single_nonzero_component_index] = fe_values.shape_values(snc,q_point); return return_value; } @@ -3549,9 +3555,10 @@ namespace FEValuesViews { value_type return_value; for (unsigned int d=0; d