From 5bdc5891ca66966ceacad41f4e5c78e0a1772b11 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Tue, 2 Jun 2020 09:51:43 -0700 Subject: [PATCH] Fix particles data out for no particles. --- source/particles/data_out.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(), -- 2.39.5