]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add exception if there are no patches.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Jan 2000 15:26:08 +0000 (15:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Jan 2000 15:26:08 +0000 (15:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@2188 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/data_out_base.h
deal.II/base/source/data_out_base.cc

index d91f7c0470640a5953fdba08807bb92f7c6f441b..ae78bcb3f33c1307fd978bab71d19fe539faa7e6 100644 (file)
@@ -960,6 +960,10 @@ class DataOutBase
                                     /**
                                      * Exception
                                      */
+    DeclException0 (ExcNoPatches);
+                                    /**
+                                     * Exception
+                                     */
     DeclException0 (ExcIO);
 
   private:
index f2f12611c1c26fcbb7f3f7dfa7067852537985d3..e8d936b14202eaa87498a8906ff58fdb4209473e 100644 (file)
@@ -27,6 +27,8 @@ void DataOutBase::write_ucd (const vector<Patch<dim> > &patches,
 {
   AssertThrow (out, ExcIO());
 
+  Assert (patches.size() > 0, ExcNoPatches());
+  
   const unsigned int n_data_sets = data_names.size();
   
                                   // first count the number of cells
@@ -403,6 +405,8 @@ void DataOutBase::write_gnuplot (const vector<Patch<dim> > &patches,
 {
   AssertThrow (out, ExcIO());
   
+  Assert (patches.size() > 0, ExcNoPatches());
+
   const unsigned int n_data_sets = data_names.size();
   
                                   // write preamble
@@ -687,8 +691,9 @@ void DataOutBase::write_povray (const vector<Patch<dim> > &patches,
                                const PovrayFlags         &flags,
                                ostream                   &out) 
 {
-
   AssertThrow (out, ExcIO());
+  
+  Assert (patches.size() > 0, ExcNoPatches());
   Assert (dim==2, ExcNotImplemented());        // only for 2-D  
 
   const unsigned int n_data_sets = data_names.size();
@@ -988,6 +993,10 @@ void DataOutBase::write_eps (const vector<Patch<dim> > &patches,
                             const EpsFlags            &flags,
                             ostream                   &out) 
 {
+  Assert (out, ExcIO());
+  
+  Assert (patches.size() > 0, ExcNoPatches());
+  
   switch (dim) 
     {
       case 2:
@@ -1324,6 +1333,8 @@ void DataOutBase::write_gmv (const vector<Patch<dim> > &patches,
 {
   AssertThrow (out, ExcIO());
 
+  Assert (patches.size() > 0, ExcNoPatches());
   const unsigned int n_data_sets = data_names.size();
   
                                   ///////////////////////

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.