Skip to content

silencing conversion warning due to double->float#5224

Merged
bska merged 1 commit into
OPM:masterfrom
GitPaean:silencing_warning
Jun 16, 2026
Merged

silencing conversion warning due to double->float#5224
bska merged 1 commit into
OPM:masterfrom
GitPaean:silencing_warning

Conversation

@GitPaean

Copy link
Copy Markdown
Member

when -DBUILD_FLOW_FLOAT_VARIANTS=ON

when -DBUILD_FLOW_FLOAT_VARIANTS=ON
@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Jun 16, 2026
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses build warnings when compiling with -DBUILD_FLOW_FLOAT_VARIANTS=ON by avoiding implicit/narrowing conversions from double-typed deck/component properties into Scalar (e.g., float) when initializing component parameters in GenericOilGasWaterFluidSystem.

Changes:

  • Add explicit static_cast<Scalar>(...) conversions for component properties passed into ComponentParam during initFromState().
  • Ensure the critical volume scaling (* 1.e3) is also explicitly converted to Scalar before being stored.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GitPaean

GitPaean commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

now I realized that it shows up when compiling with the PR OPM/opm-simulators#7145 .

@akva2

akva2 commented Jun 16, 2026

Copy link
Copy Markdown
Member

looks fine to me, i assume those data tables are doubles because they come from the parser?

@GitPaean

Copy link
Copy Markdown
Member Author

looks fine to me, i assume those data tables are doubles because they come from the parser?

Yes. They are from CompositionalConfig, which uses double.

@bska bska left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good. I'll merge into master.

@bska bska merged commit 86f97a5 into OPM:master Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants