]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
two local exceptions eliminated
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Dec 2007 19:21:08 +0000 (19:21 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Dec 2007 19:21:08 +0000 (19:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@15602 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 8d6de51cab6b5cac05fcd71bd889154b775d07fb..69a0f943fefab805e92f39d6f50f1c4cbdf201f8 100644 (file)
@@ -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<dim> &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 <int dim>
 inline
 Point<dim>::Point (const double x)
 {
-  Assert (dim==1, ExcInvalidConstructorCalled());
+  Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall());
   this->values[0] = x;
 }
 
@@ -238,7 +222,7 @@ template <int dim>
 inline
 Point<dim>::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 <int dim>
 inline
 Point<dim>::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;
index f74daaf061fa87bf6c1db82656ff5603c61e8cd0..614f0936eb3ec7ffd9c6dfa3a7600e5d42df6cc5 100644 (file)
@@ -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 <tt>dim</tt> 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 <int dim>
 inline
 Tensor<1,dim>::Tensor (const array_type &initializer)
 {
+  Assert (dim>0, ExcDimTooSmall(dim));
+
   for (unsigned int i=0; i<dim; ++i)
     values[i] = initializer[i];
 }
@@ -409,6 +413,8 @@ template <int dim>
 inline
 Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
 {
+  Assert (dim>0, ExcDimTooSmall(dim));
+  
   for (unsigned int i=0; i<dim; ++i)
     values[i] = p.values[i];
 }

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.