From: wolf Date: Thu, 12 Sep 2002 22:06:53 +0000 (+0000) Subject: Fix a TODO by moving the exception class to the place it belongs to. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e04bad15c181df704032610ae5f488a260d661bd;p=dealii-svn.git Fix a TODO by moving the exception class to the place it belongs to. git-svn-id: https://svn.dealii.org/trunk@6410 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 4530dbd915..2cd00e9ec3 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -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::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))); }; }; diff --git a/deal.II/base/include/base/tensor_base.h b/deal.II/base/include/base/tensor_base.h index c5b36825ec..af2f6b0ca7 100644 --- a/deal.II/base/include/base/tensor_base.h +++ b/deal.II/base/include/base/tensor_base.h @@ -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; }; - /** - * 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