From e35bfec121f330f2ce545d78e18ee341e7b4002d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 18 Mar 2015 18:38:30 -0500 Subject: [PATCH] Clarify an exception message. --- include/deal.II/base/tensor.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index c0a24c9099..f013d7c58d 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -294,9 +294,11 @@ public: /** * Exception. */ - DeclException1 (ExcInvalidTensorIndex, + DeclException1 (ExcInvalidTensorContractionIndex, int, - << "Invalid tensor index " << arg1); + << "You have requested contraction of tensors over index " + << arg1 + << ", but this is not possible for tensors of the current type."); /** * Read or write the data of this object to or from a stream for the purpose @@ -1023,7 +1025,7 @@ void contract (Tensor<2,dim,Number> &dest, default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index2))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index2))); }; break; case 2: @@ -1044,12 +1046,12 @@ void contract (Tensor<2,dim,Number> &dest, default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index2))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index2))); }; break; default: - Assert (false, (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index1))); + Assert (false, (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index1))); }; } @@ -1097,7 +1099,7 @@ void contract (Tensor<2,dim,Number> &dest, default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index1))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index1))); }; } @@ -1166,7 +1168,7 @@ void contract (Tensor<3,dim,Number> &dest, break; default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index2))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index2))); } break; @@ -1189,7 +1191,7 @@ void contract (Tensor<3,dim,Number> &dest, break; default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index2))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index2))); } break; @@ -1212,13 +1214,13 @@ void contract (Tensor<3,dim,Number> &dest, break; default: Assert (false, - (typename Tensor<2,dim,Number>::ExcInvalidTensorIndex (index2))); + (typename Tensor<2,dim,Number>::ExcInvalidTensorContractionIndex (index2))); } break; default: Assert (false, - (typename Tensor<3,dim,Number>::ExcInvalidTensorIndex (index1))); + (typename Tensor<3,dim,Number>::ExcInvalidTensorContractionIndex (index1))); } } -- 2.39.5