From f845a1e4c54480409025224dbae086e7ab601890 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 30 May 2022 11:10:36 -0600 Subject: [PATCH] Add a missing assertion in the XDMF writer. --- source/base/data_out_base.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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"; -- 2.39.5