From 885f23480cae594bc1dcc3f4cfd42813df882010 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 28 Jun 2022 11:27:42 -0400 Subject: [PATCH] Revert "Remove deprecated XDMFEntry::get_xdmf_content" This reverts commit d9fad9fa023d2702df1677b8522f17536c74b5e7. --- .../changes/incompatibilities/20220627Arndt-1 | 4 --- include/deal.II/base/data_out_base.h | 11 ++++++++ source/base/data_out_base.cc | 26 +++++++++++++++++++ tests/data_out/data_out_hdf5_02.cc | 2 +- tests/mpi/data_out_hdf5_02.cc | 2 +- tests/serialization/xdmf_entry.cc | 6 ++--- 6 files changed, 41 insertions(+), 10 deletions(-) delete mode 100644 doc/news/changes/incompatibilities/20220627Arndt-1 diff --git a/doc/news/changes/incompatibilities/20220627Arndt-1 b/doc/news/changes/incompatibilities/20220627Arndt-1 deleted file mode 100644 index 68a5b163fe..0000000000 --- a/doc/news/changes/incompatibilities/20220627Arndt-1 +++ /dev/null @@ -1,4 +0,0 @@ -Removed: The deprecated overload of XDMFEntry::get_xdmf_content() -has been removed. -
-(Daniel Arndt, 2022/06/27) diff --git a/include/deal.II/base/data_out_base.h b/include/deal.II/base/data_out_base.h index 96737d245e..dc35266b27 100644 --- a/include/deal.II/base/data_out_base.h +++ b/include/deal.II/base/data_out_base.h @@ -3369,6 +3369,17 @@ public: &num_cells &dimension &space_dimension &attribute_dims; } + /** + * Get the XDMF content associated with this entry. + * If the entry is not valid, this returns an empty string. + * + * @deprecated Use the overload taking an `unsigned int` and a + * `const ReferenceCell &` instead. + */ + DEAL_II_DEPRECATED + std::string + get_xdmf_content(const unsigned int indent_level) const; + /** * Get the XDMF content associated with this entry. * If the entry is not valid, this returns an empty string. diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 3c2c15d92e..41bb8954cf 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -9199,6 +9199,32 @@ namespace +std::string +XDMFEntry::get_xdmf_content(const unsigned int indent_level) const +{ + switch (dimension) + { + case 0: + return get_xdmf_content(indent_level, + ReferenceCells::get_hypercube<0>()); + case 1: + return get_xdmf_content(indent_level, + ReferenceCells::get_hypercube<1>()); + case 2: + return get_xdmf_content(indent_level, + ReferenceCells::get_hypercube<2>()); + case 3: + return get_xdmf_content(indent_level, + ReferenceCells::get_hypercube<3>()); + default: + Assert(false, ExcNotImplemented()); + } + + return ""; +} + + + std::string XDMFEntry::get_xdmf_content(const unsigned int indent_level, const ReferenceCell &reference_cell) const diff --git a/tests/data_out/data_out_hdf5_02.cc b/tests/data_out/data_out_hdf5_02.cc index be2ce5b040..f2c1cd6ad4 100644 --- a/tests/data_out/data_out_hdf5_02.cc +++ b/tests/data_out/data_out_hdf5_02.cc @@ -134,7 +134,7 @@ check() << " \n"; // Write out the entry - xdmf_file << entry.get_xdmf_content(3, ReferenceCells::get_hypercube()); + xdmf_file << entry.get_xdmf_content(3); xdmf_file << " \n"; xdmf_file << " \n"; diff --git a/tests/mpi/data_out_hdf5_02.cc b/tests/mpi/data_out_hdf5_02.cc index 04c84bcaa7..05003706dd 100644 --- a/tests/mpi/data_out_hdf5_02.cc +++ b/tests/mpi/data_out_hdf5_02.cc @@ -86,7 +86,7 @@ check() << " \n"; // Write out the entry - xdmf_file << entry.get_xdmf_content(3, ReferenceCells::get_hypercube()); + xdmf_file << entry.get_xdmf_content(3); xdmf_file << " \n"; xdmf_file << " \n"; diff --git a/tests/serialization/xdmf_entry.cc b/tests/serialization/xdmf_entry.cc index 9dea0a6174..2a3c3b5948 100644 --- a/tests/serialization/xdmf_entry.cc +++ b/tests/serialization/xdmf_entry.cc @@ -54,13 +54,11 @@ test() deallog << "XDMFEntry before serialization: " << std::endl << std::endl - << entry1.get_xdmf_content(0, ReferenceCells::get_hypercube()) - << std::endl; + << entry1.get_xdmf_content(0) << std::endl; deallog << "XDMFEntry after de-serialization: " << std::endl << std::endl - << entry2.get_xdmf_content(0, ReferenceCells::get_hypercube()) - << std::endl; + << entry2.get_xdmf_content(0) << std::endl; } -- 2.39.5