From: Rene Gassmoeller Date: Tue, 2 Jun 2020 16:51:43 +0000 (-0700) Subject: Fix particles data out for no particles. X-Git-Tag: v9.3.0-rc1~1495^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bdc5891ca66966ceacad41f4e5c78e0a1772b11;p=dealii.git Fix particles data out for no particles. --- diff --git a/source/particles/data_out.cc b/source/particles/data_out.cc index 99d20548ed..9c016d5f06 100644 --- a/source/particles/data_out.cc +++ b/source/particles/data_out.cc @@ -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(),