From: kanschat Date: Mon, 17 Dec 2007 19:21:08 +0000 (+0000) Subject: two local exceptions eliminated X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b9e42c039671e84817f5a9cf74944128243b29a;p=dealii-svn.git two local exceptions eliminated git-svn-id: https://svn.dealii.org/trunk@15602 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index 8d6de51cab..69a0f943fe 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -177,22 +177,6 @@ class Point : public Tensor<1,dim> * representing the two points. */ double distance (const Point &p) const; - - /** @addtogroup Exceptions - * @{ */ - - /** - * Exception - */ - DeclException1 (ExcDimTooSmall, - int, - << "Given dimensions must be >= 1, but was " << arg1); - /** - * Exception - */ - DeclException0 (ExcInvalidConstructorCalled); - //@} - }; /*------------------------------- Inline functions: Point ---------------------------*/ @@ -228,7 +212,7 @@ template inline Point::Point (const double x) { - Assert (dim==1, ExcInvalidConstructorCalled()); + Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall()); this->values[0] = x; } @@ -238,7 +222,7 @@ template inline Point::Point (const double x, const double y) { - Assert (dim==2, ExcInvalidConstructorCalled()); + Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall()); this->values[0] = x; this->values[1] = y; } @@ -249,7 +233,7 @@ template inline Point::Point (const double x, const double y, const double z) { - Assert (dim==3, ExcInvalidConstructorCalled()); + Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall()); this->values[0] = x; this->values[1] = y; this->values[2] = z; diff --git a/deal.II/base/include/base/tensor_base.h b/deal.II/base/include/base/tensor_base.h index f74daaf061..614f0936eb 100644 --- a/deal.II/base/include/base/tensor_base.h +++ b/deal.II/base/include/base/tensor_base.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -305,17 +305,19 @@ class Tensor<1,dim> */ static unsigned int memory_consumption (); - /** @addtogroup Exceptions - * @{ */ - /** - * Exception + * Only tensors with a positive + * dimension are implemented. This + * exception is thrown by the + * constructor if the template + * argument dim is zero or + * less. + * + * @ingroup Exceptions */ DeclException1 (ExcDimTooSmall, int, - << "Given dimensions must be >= 1, but was " << arg1); - - //@} + << "dim must be positive, but was " << arg1); private: /** * Store the values in a simple @@ -399,6 +401,8 @@ template inline Tensor<1,dim>::Tensor (const array_type &initializer) { + Assert (dim>0, ExcDimTooSmall(dim)); + for (unsigned int i=0; i inline Tensor<1,dim>::Tensor (const Tensor<1,dim> &p) { + Assert (dim>0, ExcDimTooSmall(dim)); + for (unsigned int i=0; i