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

Avoid ambiguous type conversion when accessing tmp<vectorField> #359

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MakisH
Copy link
Member

@MakisH MakisH commented Mar 21, 2025

Reported by a user using the Intel compiler (OneAPI 2023.2, RHEL 8, OpenFOAM v2406) in the forum.

Resolves errors such as:

In file included from FF/ModuleFF.C:3:
FF/Velocity.C:95:25: error: conversion from 'tmp<vectorField>' (aka 'tmp<Field<Vector<double>>>') to 'vectorField' (aka 'Field<Vector<double>>') is ambiguous
            vectorField n = U_->boundaryField()[patchID].patch().nf();
                        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/leonardo/prod/spack/05/install/0.21/linux-rhel8-icelake/oneapi-2023.2.0/openfoam-2406-psbdrns5bo35czf4hemtwyre65rfdf32/src/OpenFOAM/lnInclude/tmp.H:320:9: note: candidate function
        operator const T&() const { return cref(); }
        ^
/leonardo/prod/spack/05/install/0.21/linux-rhel8-icelake/oneapi-2023.2.0/openfoam-2406-psbdrns5bo35czf4hemtwyre65rfdf32/src/OpenFOAM/lnInclude/Field.H:266:16: note: candidate constructor
        inline Field(const tmp<Field<Type>>& tfld);
               ^

(same as #358, different repository)

Edit: The system tests pass after fixing the Git reference of preCICE, but I realize that they don't test anything related to the fluid-fluid module yet. I have, however, run the partitioned-pipe tutorial locally and it looks correct.

@MakisH MakisH self-assigned this Mar 21, 2025
@MakisH MakisH changed the title Cref Avoid ambiguous type conversion when accessing tmp<vectorField> Mar 21, 2025
@MakisH
Copy link
Member Author

MakisH commented Mar 21, 2025

@vidulejs I am not exactly sure if cref() is the right function to call here (suggested by the compiler error). Does this change make sense to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant