CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

uniformSet constructor error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2015, 09:49
Default uniformSet constructor error
  #1
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Dear OFers!

Hope all is good. I'm getting an error when using the uniformSet from components construct that should take 7 arguments. I'm using OF 2.3.0.

Code:
createFields.H:672:5: error: no matching function for call to ‘Foam::uniformSet::uniformSet(const char [15], Foam::fvMesh&, Foam::meshSearch, const char [9], Foam::point, Foam::point, int)’
     );
     ^
createFields.H:672:5: note: candidates are:
In file included from xsofcFoam.C:36:0:
uniformSet.H:122:9: note: Foam::uniformSet::uniformSet(const Foam::word&, const Foam::polyMesh&, Foam::meshSearch&, const Foam::dictionary&)
         uniformSet
         ^
uniformSet.H:122:9: note:   candidate expects 4 arguments, 7 provided
uniformSet.H:110:9: note: Foam::uniformSet::uniformSet(const Foam::word&, const Foam::polyMesh&, Foam::meshSearch&, const Foam::word&, const point&, const point&, Foam::label)
         uniformSet
         ^
uniformSet.H:110:9: note:   no known conversion for argument 3 from ‘Foam::meshSearch’ to ‘Foam::meshSearch&’
uniformSet.H:43:7: note: Foam::uniformSet::uniformSet(const Foam::uniformSet&)
 class uniformSet
       ^
uniformSet.H:43:7: note:   candidate expects 1 argument, 7 provided
make: *** [Make/linux64GccDPOpt/xsofcFoam.o] Error 1
I know that there's a dictionary construct that takes 4 arguments. And that gives me the reverse error.

Code:
createFields.H:672:5: error: no matching function for call to ‘Foam::uniformSet::uniformSet(const char [15], Foam::fvMesh&, Foam::meshSearch, const char [9])’
     );
     ^
createFields.H:672:5: note: candidates are:
In file included from xsofcFoam.C:36:0:
uniformSet.H:122:9: note: Foam::uniformSet::uniformSet(const Foam::word&, const Foam::polyMesh&, Foam::meshSearch&, const Foam::dictionary&)
         uniformSet
         ^
uniformSet.H:122:9: note:   no known conversion for argument 3 from ‘Foam::meshSearch’ to ‘Foam::meshSearch&’
uniformSet.H:110:9: note: Foam::uniformSet::uniformSet(const Foam::word&, const Foam::polyMesh&, Foam::meshSearch&, const Foam::word&, const point&, const point&, Foam::label)
         uniformSet
         ^
uniformSet.H:110:9: note:   candidate expects 7 arguments, 4 provided
So, which constructor should I use?

Best,
Sandra
sabago is offline   Reply With Quote

Old   November 16, 2015, 10:43
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Maybe you can also post how you are calling constructor (i.e. part of createFields.H)? In both cases you have posted, the third argument causes error. So the question is how do you pass that third argument.
alexeym is offline   Reply With Quote

Old   November 16, 2015, 11:01
Default
  #3
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Hello again,
You're right, Alexey, meshSearch(mesh), seems to be the problem but how to fix it...

Code:
uniformSet line
    (
        "jcLine,  
        mesh,  
        meshSearch(mesh), 
        "axis"
        point(5e-5, 0, 2.5e-5),  // start point
        point(5e-5, 5e-5, 2.5e-5),  // end point
        20  // density of points on the line
    );
Sandra
sabago is offline   Reply With Quote

Old   November 16, 2015, 11:13
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Is it a problem of copy-paste or there is really no closing quote after jcLine? Also I did not find comma after "axis" in your snippet.

You can surely try to create object meshSearch myLovelyMesh(mesh) and then pass it to uniformSet constructor instead of creating object on the fly. I.e. your code should be something like:

Code:
    meshSearch myLovelyMeshSearch(mesh);
    uniformSet line
    (
        "jcLine",
        mesh,
        myLovelyMeshSearch,
        "axis",
        point(5e-5, 0, 2.5e-5),  // start point
        point(5e-5, 5e-5, 2.5e-5),  // end point
        20  // density of points on the line
    );
What compiler/OS do you use? I have tested constructor with clang-7.0.0/Darwin, gcc-5.1.1/Linux and everything compiles quite fine.
alexeym is offline   Reply With Quote

Old   November 16, 2015, 11:29
Default
  #5
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Is it a problem of copy-paste or there is really no closing quote after jcLine? Also I did not find comma after "axis" in your snippet.

You can surely try to create object meshSearch myLovelyMesh(mesh) and then pass it to uniformSet constructor instead of creating object on the fly. I.e. your code should be something like:

Code:
    meshSearch myLovelyMeshSearch(mesh);
    uniformSet line
    (
        "jcLine",
        mesh,
        myLovelyMeshSearch,
        "axis",
        point(5e-5, 0, 2.5e-5),  // start point
        point(5e-5, 5e-5, 2.5e-5),  // end point
        20  // density of points on the line
    );
What compiler/OS do you use? I have tested constructor with clang-7.0.0/Darwin, gcc-5.1.1/Linux and everything compiles quite fine.
my bad, I missed the closing quote but yeah, was actually missing the comma on line 4 as I had commented the remaining 3 arguments out but forgot to include it when I uncommented.

And thanks, your suggestion worked like a charm.

I'm using Ubuntu 4.2. and gcc-4.8, g++-4.8.

Sandra
sabago is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 19:26.