From bc8fceaccfd8b369ff18862b881f6876d52cd108 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 7 Oct 2011 21:17:33 +0000 Subject: [PATCH] Silence a warning in icc and provide a default path for switches over 'dim'. git-svn-id: https://svn.dealii.org/trunk@24561 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/base/symmetric_tensor.h | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/deal.II/include/deal.II/base/symmetric_tensor.h b/deal.II/include/deal.II/base/symmetric_tensor.h index 2bd7a3d17d..fcbdb526cd 100644 --- a/deal.II/include/deal.II/base/symmetric_tensor.h +++ b/deal.II/include/deal.II/base/symmetric_tensor.h @@ -1640,19 +1640,19 @@ namespace internal { switch (dim) { - case 1: - return data[0][0]; - - case 2: - // each entry of the tensor can be - // thought of as an entry in a - // matrix that maps the rolled-out - // rank-2 tensors into rolled-out - // rank-2 tensors. this is the - // format in which we store rank-4 - // tensors. determine which - // position the present entry is - // stored in + case 1: + return data[0][0]; + + case 2: + // each entry of the tensor can be + // thought of as an entry in a + // matrix that maps the rolled-out + // rank-2 tensors into rolled-out + // rank-2 tensors. this is the + // format in which we store rank-4 + // tensors. determine which + // position the present entry is + // stored in { unsigned int base_index[2] ; if ((indices[0] == 0) && (indices[1] == 0)) @@ -1672,16 +1672,16 @@ namespace internal return data[base_index[0]][base_index[1]]; } - case 3: - // each entry of the tensor can be - // thought of as an entry in a - // matrix that maps the rolled-out - // rank-2 tensors into rolled-out - // rank-2 tensors. this is the - // format in which we store rank-4 - // tensors. determine which - // position the present entry is - // stored in + case 3: + // each entry of the tensor can be + // thought of as an entry in a + // matrix that maps the rolled-out + // rank-2 tensors into rolled-out + // rank-2 tensors. this is the + // format in which we store rank-4 + // tensors. determine which + // position the present entry is + // stored in { unsigned int base_index[2] ; if ((indices[0] == 0) && (indices[1] == 0)) @@ -1726,7 +1726,12 @@ namespace internal return data[base_index[0]][base_index[1]]; } + + default: + Assert (false, ExcNotImplemented()); } + + return Number(); } -- 2.39.5