From: Wolfgang Bangerth Date: Tue, 14 Sep 2010 15:09:12 +0000 (+0000) Subject: Fix a typo in the computation of the curl in 2d. X-Git-Tag: v8.0.0~5514 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e1a03dfd28ca9eec8c8a2ca9affc9644a21fc2e;p=dealii.git Fix a typo in the computation of the curl in 2d. git-svn-id: https://svn.dealii.org/trunk@21959 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 08c0c2ad57..c26b382a4a 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -3870,17 +3870,16 @@ namespace FEValuesViews if (snc != -1) { curl_type return_value; - switch (shape_function_data[shape_function].single_nonzero_component_index) { - case 0: { - return_value[0] = -1.0 * fe_values.shape_gradients[snc][q_point][1]; - return return_value; - } - - default: { - return_value[0] = fe_values.shape_gradients[snc][q_point][2]; - return return_value; - } - } + // the single + // nonzero component + // can only be zero + // or one in 2d + if (shape_function_data[shape_function].single_nonzero_component_index == 0) + return_value[0] = -1.0 * fe_values.shape_gradients[snc][q_point][1]; + else + return_value[0] = fe_values.shape_gradients[snc][q_point][0]; + + return return_value; } else {