]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix particles data out for no particles.
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 2 Jun 2020 16:51:43 +0000 (09:51 -0700)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 2 Jun 2020 16:51:43 +0000 (09:51 -0700)
source/particles/data_out.cc

index 99d20548edda8aa75e2d99ede56dfd79e5ef70d9..9c016d5f0635d911e35c4d6deeef3312b1952554 100644 (file)
@@ -39,8 +39,16 @@ namespace Particles
         "names as interpretations. Provide the same name for components that "
         "belong to a single vector or tensor."));
 
-    if (data_component_names.size() > 0)
+    if ((data_component_names.size() > 0) &&
+        (particles.n_locally_owned_particles() > 0))
       {
+        Assert(
+          particles.begin()->has_properties(),
+          ExcMessage(
+            "You called Particles::DataOut::build_patches with data component "
+            "names and interpretations, but the particles do not seem to own "
+            "any properties."));
+
         Assert(
           data_component_names.size() ==
             particles.begin()->get_properties().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.