From: Wolfgang Bangerth Date: Mon, 30 May 2022 17:10:36 +0000 (-0600) Subject: Add a missing assertion in the XDMF writer. X-Git-Tag: v9.4.0-rc1~111^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f845a1e4c54480409025224dbae086e7ab601890;p=dealii.git Add a missing assertion in the XDMF writer. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 5db3b1bcb6..a6794da7ba 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -8007,8 +8007,7 @@ DataOutInterface::write_xdmf_file( // Only rank 0 process writes the XDMF file if (myrank == 0) { - std::ofstream xdmf_file(filename.c_str()); - std::vector::const_iterator it; + std::ofstream xdmf_file(filename.c_str()); xdmf_file << "\n"; xdmf_file << "\n"; @@ -8021,9 +8020,16 @@ DataOutInterface::write_xdmf_file( const auto &patches = get_patches(); Assert(patches.size() > 0, DataOutBase::ExcNoPatches()); - for (it = entries.begin(); it != entries.end(); ++it) + // We currently don't support writing mixed meshes: +#ifdef DEBUG + for (const auto &patch : patches) + Assert(patch.reference_cell == patches[0].reference_cell, + ExcNotImplemented()); +#endif + + for (const auto &entry : entries) { - xdmf_file << it->get_xdmf_content(3, patches[0].reference_cell); + xdmf_file << entry.get_xdmf_content(3, patches[0].reference_cell); } xdmf_file << " \n";