]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add the missing assertion in DataOutReader::merge ensuring that the two sources for...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Oct 2007 23:45:03 +0000 (23:45 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Oct 2007 23:45:03 +0000 (23:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@15297 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/data_out_base.cc

index 3d40d928723ea6a4f95d4638dad217b967b46293..19727a1ad38f8414f52064ce60b687329dec7b05 100644 (file)
@@ -4589,6 +4589,28 @@ merge (const DataOutReader<dim,spacedim> &source)
                                    // names
   Assert (get_dataset_names() == source.get_dataset_names(),
           ExcIncompatibleDatasetNames());
+
+                                  // check equality of the vector data
+                                  // specifications
+  Assert (get_vector_data_ranges().size() == source.get_vector_data_ranges().size(),
+         ExcMessage ("Both sources need to declare the same components "
+                     "as vectors."));
+  for (unsigned int i=0; i<get_vector_data_ranges().size(); ++i)
+    {
+      Assert (get_vector_data_ranges()[i].template get<0>() ==
+             source.get_vector_data_ranges()[i].template get<0>(),
+             ExcMessage ("Both sources need to declare the same components "
+                         "as vectors."));
+      Assert (get_vector_data_ranges()[i].template get<1>() ==
+             source.get_vector_data_ranges()[i].template get<1>(),
+             ExcMessage ("Both sources need to declare the same components "
+                         "as vectors."));
+      Assert (get_vector_data_ranges()[i].template get<2>() ==
+             source.get_vector_data_ranges()[i].template get<2>(),
+             ExcMessage ("Both sources need to declare the same components "
+                         "as vectors."));
+    }
+  
                                    // make sure patches are compatible
   Assert (patches[0].n_subdivisions == source_patches[0].n_subdivisions,
           ExcIncompatiblePatchLists());

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.