From: Wolfgang Bangerth Date: Fri, 16 Dec 2016 05:37:32 +0000 (-0700) Subject: Also check for the invalid FaceDescriptor that first_face() may return. X-Git-Tag: v8.5.0-rc1~327^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=080c77e33e9ac7cea62fe519b6c09b8545b83885;p=dealii.git Also check for the invalid FaceDescriptor that first_face() may return. This happens if a process has no faces to deal with. The bug was reported by Justin Kauffman . --- diff --git a/source/numerics/data_out_faces.cc b/source/numerics/data_out_faces.cc index a510aae6b0..cc999ba3f0 100644 --- a/source/numerics/data_out_faces.cc +++ b/source/numerics/data_out_faces.cc @@ -287,11 +287,15 @@ void DataOutFaces::build_patches (const Mapping & for (unsigned int i=0; idof_data.size(); ++i) n_datasets += this->dof_data[i]->n_output_variables; - // first count the cells we want to create patches of and make sure there is - // enough memory for that + // first collect the cells we want to create patches of; we will + // then iterate over them. the end-condition of the loop needs to + // test that next_face() returns an end iterator, as well as for the + // case that first_face() returns an invalid FaceDescriptor object std::vector all_faces; for (FaceDescriptor face=first_face(); - face.first != this->triangulation->end(); + ((face.first != this->triangulation->end()) + && + (face != FaceDescriptor())); face = next_face(face)) all_faces.push_back (face);