View Issue Details

IDProjectCategoryView StatusLast Update
0003434ThirdPartyBugpublic2020-01-24 12:00
Reporterfantaz Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformlinuxOSUbuntuOS Version19.10
Fixed in Versiondev 
Summary0003434: Foam::sampledSurfaces::plane ctor compiler error
DescriptionWhen declaring the Foam::sampledSurfaces::plane instance with ctor with five arguments (take a look at the Steps to Reproduce), the compiler spits out an error:
...
error: no matching function for call to ‘Foam::sampledSurfaces::plane::plane(const Foam::word&, const Foam::fvMesh&, const Foam::plane&)
...
<dir_to_OF>/OpenFOAM-7/src/sampling/lnInclude/sampledPlane.H:100:26: note: no known conversion for argument 3 from ‘const Foam::plane’ to ‘const Foam::sampledSurfaces::plane&’
  100 | const plane& planeDesc,
      | ~~~~~~~~~~~~~^~~~~~~~~
<dir_to_OF>/OpenFOAM-7/src/sampling/lnInclude/sampledPlane.H:56:7: note: candidate: ‘Foam::sampledSurfaces::plane::plane(const Foam::sampledSurfaces::plane&)’
   56 | class plane
      | ^~~~~

Maybe I'm using the sampledSurfaces::plane wrong, bit it seems to me that the const plane& planeDesc argument in the Foam::sampledSurfaces::plane ctor should be of type Foam::plane, since the sampledSurfaces::plane ctor with three arguments, uses cuttingPlane constructor as shown below (copied from sampledPlane.C, lines 66-74), i.e.
Foam::sampledSurfaces::plane::plane
(
    const word& name,
    const polyMesh& mesh,
    const dictionary& dict
)
:
    sampledSurface(name, mesh, dict),
    cuttingPlane(Foam::plane(dict)),
...

I'm by no means an advanced user, but it seems to me that the argument
const plane& planeDesc
should be
const Foam::plane& planeDesc
Steps To Reproduce// Wherever in code, providing that the -I$(LIB_SRC)/sampling/lnInclude and -lsampling are added to EXE_INC to LIB_LIBS in options file, respectively.

...
#include "plane.H"
#include "sampledPlane.H"
...
void fun()
{
const point xyz(-1.5, 0, 0);
const vector dir(0, 1, 0);
const Foam::plane p(xyz, dir);
const word pname = "left";

// the last two arguments, zoneKey and triangulate are word::null and true, respectively
Foam::sampledSurfaces::plane sp(pname, mesh_, p);
}
TagsNo tags attached.

Activities

henry

2020-01-23 11:48

manager   ~0011097

User support request.

will

2020-01-24 12:00

manager   ~0011103

On further consideration we have concluded that the constructor in question is in fact in error. It does not function as intended since the rename of the class has caused a clash with the Foam::plane class.

This issue has not surfaced previously because the constructor in question is not used anywhere. I have therefore removed it, and I consider that change to have resolved this report. See https://github.com/OpenFOAM/OpenFOAM-dev/commit/8e6d792ff5b6ece4b48a223bda526999a059ebca.

Issue History

Date Modified Username Field Change
2020-01-23 10:54 fantaz New Issue
2020-01-23 11:48 henry Assigned To => henry
2020-01-23 11:48 henry Status new => closed
2020-01-23 11:48 henry Resolution open => no change required
2020-01-23 11:48 henry Note Added: 0011097
2020-01-24 12:00 will Status closed => resolved
2020-01-24 12:00 will Resolution no change required => fixed
2020-01-24 12:00 will Fixed in Version => dev
2020-01-24 12:00 will Note Added: 0011103