]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clarify an exception message.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 18 Mar 2015 23:38:30 +0000 (18:38 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 18 Mar 2015 23:38:30 +0000 (18:38 -0500)
include/deal.II/base/tensor.h

index c0a24c90990d7a26ecb3917ed799a0e3ade2d45d..f013d7c58dd4276f6459f1489a03e1ba15c5d5fc 100644 (file)
@@ -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)));
     }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.