|
[Sponsors] |
November 16, 2015, 09:49 |
uniformSet constructor error
|
#1 |
Member
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11 |
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 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 Best, Sandra |
|
November 16, 2015, 10:43 |
|
#2 |
Senior Member
|
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. |
|
November 16, 2015, 11:01 |
|
#3 |
Member
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11 |
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 ); |
|
November 16, 2015, 11:13 |
|
#4 |
Senior Member
|
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 ); |
|
November 16, 2015, 11:29 |
|
#5 | |
Member
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11 |
Quote:
And thanks, your suggestion worked like a charm. I'm using Ubuntu 4.2. and gcc-4.8, g++-4.8. Sandra |
||
|
|