]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do not access the first element if the vector is empty.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 7 Jul 2011 14:53:20 +0000 (14:53 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 7 Jul 2011 14:53:20 +0000 (14:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@23929 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/numerics/data_out.cc

index 7ddccfe5d00c9715e6f801ea197f8d3ac3bb4985..f5bd839985e19a432e3432122adf75cbc43ad73a 100644 (file)
@@ -1094,15 +1094,16 @@ void DataOut<dim,DH>::build_patches (const Mapping<DH::dimension,DH::space_dimen
 
 
                                   // now build the patches in parallel
-  WorkStream::run (&all_cells[0],
-                  &all_cells[0]+all_cells.size(),
-                  std_cxx1x::bind(&DataOut<dim,DH>::build_one_patch,
-                                  *this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3,
-                                  curved_cell_region),
-                  std_cxx1x::bind(&internal::DataOut::append_patch_to_list<dim,DH::space_dimension>,
-                                  std_cxx1x::_1, std_cxx1x::ref(this->patches)),
-                  thread_data,
-                  sample_patch);
+  if (all_cells.size() > 0)
+    WorkStream::run (&all_cells[0],
+                    &all_cells[0]+all_cells.size(),
+                    std_cxx1x::bind(&DataOut<dim,DH>::build_one_patch,
+                                    *this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3,
+                                    curved_cell_region),
+                    std_cxx1x::bind(&internal::DataOut::append_patch_to_list<dim,DH::space_dimension>,
+                                    std_cxx1x::_1, std_cxx1x::ref(this->patches)),
+                    thread_data,
+                    sample_patch);
 }
 
 

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.