]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
documentation of exceptions
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Sep 2011 19:07:29 +0000 (19:07 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Sep 2011 19:07:29 +0000 (19:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@24348 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_handler.h
deal.II/include/deal.II/dofs/dof_tools.h
deal.II/source/dofs/dof_renumbering.cc
deal.II/source/dofs/dof_tools.cc

index 5daca5c76861f3a1515ddfb5a50ecd0e6f6004d1..b8ee55a3e293c4fe8d0b2873e2933c4c0d5438fb 100644 (file)
@@ -1238,26 +1238,28 @@ class DoFHandler  :  public Subscriptor
 
    BOOST_SERIALIZATION_SPLIT_MEMBER()
 
-                                    /**
-                                     * @todo Replace by ExcInternalError.
+                                    /**
+                                     * We are trying to renumber the
+                                     * degrees of freedom, but
+                                     * somehow did not count
+                                     * correctly.
+                                     *
+                                     * @ingroup Exceptions
                                      */
     DeclException0 (ExcRenumberingIncomplete);
                                     /**
                                      * Exception
+                                     * @ingroup Exceptions
                                      */
     DeclException0 (ExcGridsDoNotMatch);
                                     /**
                                      * Exception
+                                     * @ingroup Exceptions
                                      */
     DeclException0 (ExcInvalidBoundaryIndicator);
                                     /**
                                      * Exception
-                                     */
-    DeclException1 (ExcMatrixHasWrongSize,
-                   int,
-                   << "The matrix has the wrong dimension " << arg1);
-                                    /**
-                                     * Exception
+                                     * @ingroup Exceptions
                                      */
     DeclException1 (ExcNewNumbersNotConsecutive,
                    int,
@@ -1265,6 +1267,7 @@ class DoFHandler  :  public Subscriptor
                    << "the index " << arg1 << " does not exist.");
                                     /**
                                      *  Exception
+                                     * @ingroup Exceptions
                                      */
     DeclException1 (ExcInvalidLevel,
                    int,
@@ -1272,11 +1275,13 @@ class DoFHandler  :  public Subscriptor
                    << " is not in the valid range!");
                                     /**
                                      * Exception
+                                     * @ingroup Exceptions
                                      */
     DeclException0 (ExcFacesHaveNoLevel);
                                     /**
                                      * The triangulation level you
                                      * accessed is empty.
+                                     * @ingroup Exceptions
                                      */
     DeclException1 (ExcEmptyLevel,
                    int,
index fbdb26a2931c6c98e3c600bb4e6ee47bad9774f4..6ec1ef45f3c2767f306637d7f9de258db22c1e8a 100644 (file)
@@ -2106,49 +2106,29 @@ namespace DoFTools
   std::vector<Table<2,Coupling> >
   dof_couplings_from_component_couplings (const hp::FECollection<dim,spacedim> &fe,
                                          const Table<2,Coupling> &component_couplings);
-
-                                  /**
-                                   * Exception
-                                   */
-  DeclException0 (ExcFEHasNoSupportPoints);
-                                  /**
-                                   * Exception
-                                   */
-  DeclException0 (ExcFENotPrimitive);
-                                  /**
-                                   * Exception
-                                   */
-  DeclException2 (ExcWrongSize,
-                 int, int,
-                 << "The dimension " << arg1 << " of the vector is wrong. "
-                 << "It should be " << arg2);
-                                  /**
-                                   * Exception
-                                   */
-  DeclException2 (ExcInvalidComponent,
-                 int, int,
-                 << "The component you gave (" << arg1 << ") "
-                 << "is invalid with respect to the number "
-                 << "of components in the finite element "
-                 << "(" << arg2 << ")");
                                   /**
                                    * Exception
+                                   * @ingroup Exceptions
                                    */
   DeclException0 (ExcFiniteElementsDontMatch);
                                   /**
                                    * Exception
+                                   * @ingroup Exceptions
                                    */
   DeclException0 (ExcGridNotCoarser);
                                   /**
                                    * Exception
+                                   * @ingroup Exceptions
                                    */
   DeclException0 (ExcGridsDontMatch);
                                   /**
                                    * Exception
+                                   * @ingroup Exceptions
                                    */
   DeclException0 (ExcNoFESelected);
                                   /**
                                    * Exception
+                                   * @ingroup Exceptions
                                    */
   DeclException0 (ExcInvalidBoundaryIndicator);
 }
index dfa196c5cafb94fb437db34bb02ce8c2866181a6..45cbff50821fe64266182d5624a808137b0f8b3a 100644 (file)
@@ -1483,12 +1483,12 @@ namespace DoFRenumbering
 
        const hp::FECollection<dim> fe_collection (dof.get_fe ());
        Assert (fe_collection[0].has_support_points(),
-               DoFTools::ExcFEHasNoSupportPoints());
+               typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
        hp::QCollection<dim> quadrature_collection;
        for (unsigned int comp=0; comp<fe_collection.size(); ++comp)
          {
            Assert (fe_collection[comp].has_support_points(),
-                   DoFTools::ExcFEHasNoSupportPoints());
+                   typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
            quadrature_collection.push_back
              (Quadrature<DH::dimension> (fe_collection[comp].
                                          get_unit_support_points()));
@@ -1614,7 +1614,7 @@ namespace DoFRenumbering
     else
       {
        Assert (dof.get_fe().has_support_points(),
-               DoFTools::ExcFEHasNoSupportPoints());
+               typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
        const unsigned int n_dofs = dof.n_dofs(level);
        std::vector<std::pair<Point<dim>,unsigned int> > support_point_list
          (n_dofs);
index 62792b03209bb0368486cf3ec5805bddf83257a5..637bb7467c432c40813c89b2cc30b79c43a18bfe 100644 (file)
@@ -3400,16 +3400,15 @@ namespace DoFTools
     Vector<double>       &dof_data,
     const unsigned int    component)
   {
-    const Triangulation<DH::dimension,DH::space_dimension> &tria = dof_handler.get_tria();
-
-    Assert (cell_data.size()==tria.n_active_cells(),
-           ExcWrongSize (cell_data.size(), tria.n_active_cells()));
-    Assert (dof_data.size()==dof_handler.n_dofs(),
-           ExcWrongSize (dof_data.size(), dof_handler.n_dofs()));
-    Assert (component < n_components(dof_handler),
-           ExcInvalidComponent(component, n_components(dof_handler)));
+    const unsigned int dim = DH::dimension;
+    const unsigned int spacedim = DH::space_dimension;
+    const Triangulation<dim,spacedim> &tria = dof_handler.get_tria();
+
+    AssertDimension (cell_data.size(), tria.n_active_cells());
+    AssertDimension (dof_data.size(), dof_handler.n_dofs());
+    AssertIndexRange (component, n_components(dof_handler));
     Assert (fe_is_primitive(dof_handler) == true,
-           ExcFENotPrimitive());
+           typename FiniteElement<dim>::ExcFENotPrimitive());
 
                                     // store a flag whether we should care
                                     // about different components. this is
@@ -3733,9 +3732,7 @@ namespace DoFTools
                         std::vector<bool>             &selected_dofs,
                         const std::set<unsigned char> &boundary_indicators)
   {
-    Assert (component_select.size() == n_components(dof_handler),
-           ExcWrongSize (component_select.size(),
-                         n_components(dof_handler)));
+    AssertDimension (component_select.size(),n_components(dof_handler));
     Assert (boundary_indicators.find (255) == boundary_indicators.end(),
            ExcInvalidBoundaryIndicator());
     const unsigned int dim=DH::dimension;
@@ -3859,9 +3856,7 @@ namespace DoFTools
                                         std::vector<bool>             &selected_dofs,
                                         const std::set<unsigned char> &boundary_indicators)
   {
-    Assert (component_select.size() == n_components(dof_handler),
-           ExcWrongSize (component_select.size(),
-                         n_components(dof_handler)));
+    AssertDimension (component_select.size(), n_components(dof_handler));
     Assert (boundary_indicators.find (255) == boundary_indicators.end(),
            ExcInvalidBoundaryIndicator());
 
@@ -4263,9 +4258,7 @@ namespace DoFTools
   get_active_fe_indices (const DH                  &dof_handler,
                         std::vector<unsigned int> &active_fe_indices)
   {
-    Assert (active_fe_indices.size() == dof_handler.get_tria().n_active_cells(),
-           ExcWrongSize (active_fe_indices.size(),
-                         dof_handler.get_tria().n_active_cells()));
+    AssertDimension (active_fe_indices.size(), dof_handler.get_tria().n_active_cells());
 
     typename DH::active_cell_iterator
       cell = dof_handler.begin_active(),
@@ -5073,10 +5066,8 @@ namespace DoFTools
 
                                         // check whether component numbers
                                         // are valid
-       Assert (coarse_component < coarse_fe.n_components(),
-               ExcInvalidComponent (coarse_component, coarse_fe.n_components()));
-       Assert (fine_component < fine_fe.n_components(),
-               ExcInvalidComponent (fine_component, fine_fe.n_components()));
+       AssertIndexRange (coarse_component,coarse_fe.n_components());
+       AssertIndexRange (fine_component, fine_fe.n_components());
                                         // check whether respective finite
                                         // elements are equal
        Assert (coarse_fe.base_element (coarse_fe.component_to_base_index(coarse_component).first)
@@ -5706,9 +5697,8 @@ namespace DoFTools
                                     // check whether fe has support
                                     // points
     Assert (dof_handler.get_fe().has_support_points(),
-           ExcFEHasNoSupportPoints());
-    Assert (support_points.size() == dof_handler.n_dofs(),
-           ExcWrongSize (support_points.size(), dof_handler.n_dofs()));
+           typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
+    AssertDimension (support_points.size(), dof_handler.n_dofs());
 
                                     // now loop over all cells and
                                     // enquire the support points on

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.