From 6c8f8024440fc801a48f27fd7bff020bb40aaf94 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 12 Nov 2020 00:27:49 +0100 Subject: [PATCH] Correct production of ghost cells for OASIS --- .../streamers/oasis/db_plugin/dbOASISWriter.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc index 358018f4e..667c80b80 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc @@ -1152,8 +1152,14 @@ OASISWriter::reset_modal_variables () static bool must_write_cell (const db::Cell &cref) { - // don't write ghost cells if not empty and don't write proxy cells which are not employed - return (! cref.is_ghost_cell () || ! cref.empty ()) && (! cref.is_proxy () || ! cref.is_top ()); + // Don't write proxy cells which are not employed + return ! cref.is_proxy () || ! cref.is_top (); +} + +static bool skip_cell_body (const db::Cell &cref) +{ + // Skip cell bodies for ghost cells unless empty (they are not longer ghost cells in this case) + return cref.is_ghost_cell () && cref.empty (); } void @@ -1600,6 +1606,11 @@ OASISWriter::write (db::Layout &layout, tl::OutputStream &stream, const db::Save const db::Cell &cref (layout.cell (*cell)); mp_cell = &cref; + // skip cell body if the cell is not to be written + if (skip_cell_body (cref)) { + continue; + } + // cell header cell_positions.insert (std::make_pair (*cell, mp_stream->pos ()));