Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Varnish WELSPECS Report Implementation #4530

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bska
Copy link
Member

@bska bska commented Mar 19, 2025

In particular,

  • Split long lines.
  • Switch to initialising objects, especially references, using assignment syntax (=) instead of construction ({}).
  • Move function opening braces to next line.
  • Remove blanks before semicolons.
  • Apply const where reasonable.
  • Move static objects into function-local scopes where reasonable.
  • Reverse conditionals to enable "early continue".
  • Rename workers::write_WELSPECS() to workers::wellSpecification().

This is in preparation to replacing hard-coded date stamps with dynamic information.

@bska
Copy link
Member Author

bska commented Mar 19, 2025

I'm creating this PR in draft mode because it depends on, and contains, the earlier PR #4526. I will keep the PR in a draft state until such time as it is ready for review and merging.

@bska bska force-pushed the varnish-welspecs-report-impl branch 8 times, most recently from e79ea68 to 0dd194c Compare March 26, 2025 16:07
bska added 2 commits March 27, 2025 12:58
The "integer control" format support in RPTSCHED influenced only the
restart-like processing in RSTConfig and had no counterpart in the
RPTConfig class.  This commit corrects this omission and restores
PRT file report generation for the older style RPTSCHED keyword.  As
an example, the NORNE_ATW2013 example model now gets injection,
production, cumulative and WELSPECS reports whereas this was missing
before.

We don't expect that there are many new cases using this format, but
this commit does at ensure that we don't remove useful reports for
some existing simulation models.

To this end, extract the restart-like integer control handling to a
new helper class, RPTKeywordNormalisation, which consumes both
mnemonics and integer controls and generates a map<string,int> of
strictly mnemonic-like values.  This class uses a callback function
to process integer controls and we extract the RPTSCHED format
handling to another pair of helper components

  - SimpleRPTIntegerControls
  - RptschedKeywordNormalisation

The former is constructed from an ordered list of mnemonic strings
and assigns the mnemonic map given a vector of integer control
values.  The latter uses the RPTKeywordNormalisation and an instance
of the SimpleRPTIntegerControls constructed from RPTSCHED's curated
list extracted from RSTConfig.cpp.

We then use these components to form the RPTConfig instance in the
RPTSCHED keyword handler while preserving the single argument
RPTConfig constructor for use in the context of RPTSOL handling.
This constructor does currently not support integer controls.
In particular,

  - Split long lines.
  - Switch to initialising objects, especially references, using
    assignment syntax ('=') instead of construction ('{}').
  - Move function opening braces to next line.
  - Remove blanks before semicolons.
  - Apply 'const' where reasonable.
  - Move static objects into function-local scopes where reasonable.
  - Reverse conditionals to enable "early continue".
  - Rename workers::write_WELSPECS() to workers::wellSpecification().

This is in preparation to replacing hard-coded date stamps with
dynamic information.
@bska bska force-pushed the varnish-welspecs-report-impl branch from 0dd194c to 5468499 Compare March 27, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant