mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
The schedule generator previously concatenated full keyword blocks (`KEYWORD ... /\n/\n`) — one per well — producing verbose output where each WELSPECS / COMPDAT / WCONHIST / WELSEGS / COMPSEGS / etc. block appeared once per contributing well. Eclipse keywords are designed to hold multiple records under a single header; the per-well repetition is syntactically valid but bloats the file and obscures intent. Switch `RicScheduleDataGenerator` to accumulate `std::map<QString, Opm::DeckKeyword>` instead of raw concatenated text. Each per-well helper now returns an `Opm::DeckKeyword`, and a new `mergeKeyword` primitive appends its records into the accumulator entry, creating the entry from the helper's keyword on first encounter. At emission time each accumulated keyword is serialised once. To support this, `RifEventKeywordFormatter` is split: each `format*` QString function now wraps a corresponding `build*` function that returns `std::optional<Opm::DeckKeyword>`. `RimWellEventKeyword` and `RimKeywordEvent` expose a parallel `generateDeckKeyword` accessor. The text-scraping `extractKeywordName` helper becomes dead code and is removed.