]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a TODO by moving the exception class to the place it belongs to.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 12 Sep 2002 22:06:53 +0000 (22:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 12 Sep 2002 22:06:53 +0000 (22:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@6410 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor.h
deal.II/base/include/base/tensor_base.h

index 4530dbd91501f4d7275c2953893b35268e37e42e..2cd00e9ec366b17a69900d42f8eb70782381b5b1 100644 (file)
@@ -179,6 +179,13 @@ class Tensor
                                      */
     static unsigned int memory_consumption ();
 
+                                     /**
+                                      * Exception.
+                                      */
+    DeclException1 (ExcInvalidTensorIndex,
+                    int,
+                    << "Invalid tensor index " << arg1);
+
   private:
                                     /**
                                      * Array of tensors holding the
@@ -390,16 +397,6 @@ Tensor<rank_,dim>::memory_consumption ()
 /* ----------------- Non-member functions operating on tensors. ------------ */
 
 
-/*  Exception class. This is certainly not the best possible place for its
-    declaration, but at present, local classes to any of Tensor<> can't
-    be properly accessed (haven't investigated why). If anyone has a better
-    idea, realize it!
-*/
-//TODO:[WB] (compiler) move the exceptions back into the Tensor class, if the compiler allows to do so. Also rename them back (i.e. drop the initial Tensor* from the name)
-DeclException1 (ExcInvalidTensorIndex,
-               int,
-               << "Invalid tensor index " << arg1);
-
 
 /**
  * Output operator for tensors. Print the elements consecutively, with
@@ -552,7 +549,8 @@ void contract (Tensor<2,dim>       &dest,
                      break;
 
                default:
-                     Assert (false, ExcInvalidTensorIndex (index2));
+                     Assert (false,
+                              (typename Tensor<2,dim>::ExcInvalidTensorIndex (index2)));
              };
            break;
       case 2:
@@ -572,12 +570,13 @@ void contract (Tensor<2,dim>       &dest,
                      break;
 
                default:
-                     Assert (false, ExcInvalidTensorIndex (index2));
+                     Assert (false,
+                              (typename Tensor<2,dim>::ExcInvalidTensorIndex (index2)));
              };
            break;
 
       default:
-           Assert (false, ExcInvalidTensorIndex (index1));
+           Assert (false, (typename Tensor<2,dim>::ExcInvalidTensorIndex (index1)));
     };
 };
 
@@ -625,7 +624,8 @@ void contract (Tensor<2,dim>       &dest,
            break;
 
       default:
-           Assert (false, ExcInvalidTensorIndex (index1));
+           Assert (false,
+                    (typename Tensor<2,dim>::ExcInvalidTensorIndex (index1)));
     };
 };
 
index c5b36825ec46e75f8a92873d5147864832034014..af2f6b0ca7d55767bb234f762eb5d30b7eac8cef 100644 (file)
@@ -231,6 +231,13 @@ class Tensor<1,dim>
                                      */
     static unsigned int memory_consumption ();
 
+                                     /**
+                                      * Exception
+                                      */
+    DeclException1 (ExcDimTooSmall,
+                    int,
+                    << "Given dimensions must be >= 1, but was " << arg1);
+
   private:
                                     /**
                                      * Store the values in a simple
@@ -284,16 +291,6 @@ class Tensor<1,dim>
     friend class Point<dim>;
 };
 
-                                /**
-                                 * Exception
-                                 */
-//TODO:[WB] (compiler) move the exceptions back into the Tensor class, if the compiler allows to do so. Also rename them back (i.e. drop the initial Tensor* from the name)
-DeclException2(ExcWrongVectorSize, int, int, << "Tensor has " << arg1
-              << " entries, but vector has size " << arg2);
-DeclException1 (ExcDimTooSmall,
-               int,
-               << "Given dimensions must be >= 1, but was " << arg1);
-
 
                                 /**
                                  *  Prints the values of this point in the

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.