]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion that the number of subdivisions be reasonable.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Aug 2000 13:16:49 +0000 (13:16 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Aug 2000 13:16:49 +0000 (13:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@3229 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/include/numerics/data_out_stack.h
deal.II/deal.II/source/numerics/data_out.cc
deal.II/deal.II/source/numerics/data_out_stack.cc

index cf04324467395d1312f3c6ab037a4b4a7b182857..8c3e46229009b70e2359391b216f80a5f18d4076 100644 (file)
@@ -499,6 +499,14 @@ class DataOut : public DataOut_DoFData<dim>
     virtual typename DoFHandler<dim>::cell_iterator
     next_cell (const typename DoFHandler<dim>::cell_iterator &cell);
 
+                                    /**
+                                     * Exception
+                                     */
+    DeclException1 (ExcInvalidNumberOfSubdivisions,
+                   int,
+                   << "The number of subdivisions per patch, " << arg1
+                   << ", is not valid.");
+    
   private:
                                     /**
                                      * All data needed in one thread
index be16959583cb6715784b77e2b282044a10bf3cd3..d438ae55163701f8bdc60a60ecc3fd6ecbc94833 100644 (file)
@@ -323,6 +323,13 @@ class DataOutStack : public DataOutInterface<dim+1>
                    string,
                    << "You tried to declare a component of a data vector with "
                    << "the name <" << arg1 << ">, but that name is already used.");
+                                    /**
+                                     * Exception
+                                     */
+    DeclException1 (ExcInvalidNumberOfSubdivisions,
+                   int,
+                   << "The number of subdivisions per patch, " << arg1
+                   << ", is not valid.");
     
   private:
                                     /**
index e27355a9b2f8156ad651eea5f5a7dc310ef414bb..3a5bdb09b9f1f4510e9b228795c7393468e2ea80 100644 (file)
@@ -307,6 +307,9 @@ template <int dim>
 void DataOut<dim>::build_patches (const unsigned int n_subdivisions,
                                  const unsigned int n_threads_) 
 {
+  Assert (n_subdivisions >= 1,
+         ExcInvalidNumberOfSubdivisions(n_subdivisions));
+  
   Assert (dofs != 0, typename DataOut_DoFData<dim>::ExcNoDoFHandlerSelected());
 
 #ifdef DEAL_II_USE_MT
index 0bf77b4719cc1aeff415834c305cb9a09ddf1dc5..dd155aa13eed589c58c5b43277a2df7ba91349ba 100644 (file)
@@ -175,7 +175,8 @@ void DataOutStack<dim>::build_patches (const unsigned int n_subdivisions)
 {
                                   // this is mostly copied from the
                                   // DataOut class
-  
+  Assert (n_subdivisions >= 1,
+         ExcInvalidNumberOfSubdivisions(n_subdivisions));  
   Assert (dof_handler != 0, ExcNoDoFHandlerSelected());
   
   const unsigned int n_components   = dof_handler->get_fe().n_components();

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.