From: 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-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88827c24e1d932d9c6cd8db0b6df477004614a7a;p=dealii-svn.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 {