]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
towards unification
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Jul 1999 17:52:25 +0000 (17:52 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Jul 1999 17:52:25 +0000 (17:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@1609 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/point.h
deal.II/base/include/base/quadrature.h
deal.II/base/include/base/tensor.h
deal.II/base/include/base/tensor_base.h
deal.II/base/source/quadrature.cc

index 1ed8336cad2a021d50f7959b1857c86255d931a9..8627c475f3274dfc5b5f0f18ab1234df1e222e16 100644 (file)
@@ -134,12 +134,6 @@ class Point : public Tensor<1,dim> {
     DeclException1 (ExcDimTooSmall,
                    int,
                    << "Given dimensions must be >= 1, but was " << arg1);
-                                    /**
-                                     *  Exception
-                                     */
-    DeclException1 (ExcInvalidIndex,
-                   int,
-                   << "Invalid index " << arg1);
                                     /**
                                      * Exception
                                      */
@@ -223,7 +217,7 @@ Point<3>::Point (const double x, const double y, const double z) {
 template <int dim>
 inline
 double Point<dim>::operator () (const unsigned int index) const {
-  Assert (index<dim, ExcInvalidIndex (index));
+  Assert (index<dim, ExcIndexRange (index, 0, dim));
   return values[index];
 };
 
@@ -232,7 +226,7 @@ double Point<dim>::operator () (const unsigned int index) const {
 template <int dim>
 inline
 double & Point<dim>::operator () (const unsigned int index) {
-  Assert (index<dim, ExcInvalidIndex (index));
+  Assert (index<dim, ExcIndexRange (index, 0, dim));
   return values[index];
 };
 
index 85fc8b68f8499be0ebb81761f8411c394a546236..9db08d31e6e623db8a2eace4b6b37f0cb70c9833 100644 (file)
@@ -117,13 +117,6 @@ class Quadrature {
                                      */
     const vector<double> & get_weights () const;
     
-                                    /**
-                                     * Exception
-                                     */
-    DeclException2 (ExcInvalidIndex,
-                   int, int,
-                   << "The index " << arg1
-                   << " is out of range, it should be less than " << arg2);
                                     /**
                                      * Exception
                                      */
@@ -257,13 +250,6 @@ class QProjector {
                                    const unsigned int       subface_no,
                                    vector<Point<dim> >     &q_points);
 
-                                    /**
-                                     * Exception
-                                     */
-    DeclException2 (ExcInvalidIndex,
-                   int, int,
-                   << "The index " << arg1
-                   << " is out of range, it should be less than " << arg2);
                                     /**
                                      * Exception
                                      */
index c1249c3def14c6aead5485d8e1adfb925612f70c..8a155b1f9f01d6250a1fc1637f1ccdf96d08253f 100644 (file)
@@ -220,7 +220,7 @@ inline
 Tensor<rank_-1,dim> &
 Tensor<rank_,dim>::
 operator[] (const unsigned int i) {
-  Assert (i<dim, ExcInvalidIndex(i));
+  Assert (i<dim, ExcIndexRange(i, 0, dim));
   
   return subtensor[i];
 };
@@ -232,7 +232,7 @@ inline
 const Tensor<rank_-1,dim> &
 Tensor<rank_,dim>::
 operator[] (const unsigned int i) const {
-  Assert (i<dim, ExcInvalidIndex(i));
+  Assert (i<dim, ExcIndexRange(i, 0, dim));
   
   return subtensor[i];
 };
index be7087d42008612a20b17eb35bd6a010d68f18b1..ef005b9ab39a2ce5e2f936f2ace98ffcc732d40a 100644 (file)
@@ -224,11 +224,6 @@ DeclException2(ExcWrongVectorSize, int, int, << "Tensor has " << arg1
 DeclException1 (ExcDimTooSmall,
                int,
                << "Given dimensions must be >= 1, but was " << arg1);
-DeclException1 (ExcInvalidIndex,
-               int,
-               << "Invalid index " << arg1);
-
-
 
 
                                 /**
@@ -284,7 +279,7 @@ template <int dim>
 inline
 double Tensor<1,dim>::
 operator [] (const unsigned int index) const {
-  Assert (index<dim, ExcInvalidIndex (index));
+  Assert (index<dim, ExcIndexRange (index, 0, dim));
   return values[index];
 };
 
@@ -294,7 +289,7 @@ template <int dim>
 inline
 double & Tensor<1,dim>::
 operator [] (const unsigned int index) {
-  Assert (index<dim, ExcInvalidIndex (index));
+  Assert (index<dim, ExcIndexRange (index, 0, dim));
   return values[index];
 };
 
index 6c70bc76f9f2026326e602ee994418d6744765c5..3340f3de1051de8646235ae874cdcd37a6f24476 100644 (file)
@@ -91,7 +91,7 @@ const Point<0> & Quadrature<0>::quad_point (const unsigned int) const {
 
 template <int dim>
 const Point<dim> & Quadrature<dim>::quad_point (const unsigned int i) const {
-  Assert (i<n_quadrature_points, ExcInvalidIndex(i, n_quadrature_points));
+  Assert (i<n_quadrature_points, ExcIndexRange(i, 0, n_quadrature_points));
   return quadrature_points[i];
 };
 
@@ -122,7 +122,7 @@ double Quadrature<0>::weight (const unsigned int) const {
 
 template <int dim>
 double Quadrature<dim>::weight (const unsigned int i) const {
-  Assert (i<n_quadrature_points, ExcInvalidIndex(i, n_quadrature_points));
+  Assert (i<n_quadrature_points, ExcIndexRange(i, 0, n_quadrature_points));
   return weights[i];
 };
 
@@ -148,7 +148,7 @@ void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
                                     const unsigned int   face_no,
                                     vector<Point<2> >   &q_points) {
   const unsigned int dim=2;
-  Assert (face_no<2*dim, ExcInvalidIndex (face_no, 2*dim));
+  Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
   
   for (unsigned int p=0; p<quadrature.n_quadrature_points; ++p)
     switch (face_no)
@@ -177,7 +177,7 @@ void QProjector<3>::project_to_face (const Quadrature<2> &quadrature,
                                     const unsigned int   face_no,
                                     vector<Point<3> >   &q_points) {
   const unsigned int dim=3;
-  Assert (face_no<2*dim, ExcInvalidIndex (face_no, 2*dim));
+  Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
   
   for (unsigned int p=0; p<quadrature.n_quadrature_points; ++p)
     switch (face_no)
@@ -226,8 +226,8 @@ void QProjector<2>::project_to_subface (const Quadrature<1> &quadrature,
                                        const unsigned int   subface_no,
                                        vector<Point<2> >   &q_points) {
   const unsigned int dim=2;
-  Assert (face_no<2*dim, ExcInvalidIndex (face_no, 2*dim));
-  Assert (subface_no<(1<<(dim-1)), ExcInvalidIndex (face_no, 1<<(dim-1)));
+  Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
+  Assert (subface_no<(1<<(dim-1)), ExcIndexRange (face_no, 0, 1<<(dim-1)));
   
   for (unsigned int p=0; p<quadrature.n_quadrature_points; ++p)
     switch (face_no)
@@ -299,8 +299,8 @@ void QProjector<3>::project_to_subface (const Quadrature<2> &quadrature,
                                        const unsigned int   subface_no,
                                        vector<Point<3> >   &q_points) {
   const unsigned int dim=3;
-  Assert (face_no<2*dim, ExcInvalidIndex (face_no, 2*dim));
-  Assert (subface_no<(1<<(dim-1)), ExcInvalidIndex (face_no, 1<<(dim-1)));
+  Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
+  Assert (subface_no<(1<<(dim-1)), ExcIndexRange (face_no, 0, 1<<(dim-1)));
 
 
                                   // for all faces and subfaces: first project

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.