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

Solved: "error: no matching function for call to ... <double,..> candidate is <Type>

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By banji

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2016, 08:37
Default Solved: "error: no matching function for call to ... <double,..> candidate is <Type>
  #1
Member
 
Olabanji
Join Date: Jan 2013
Location: U.S.A
Posts: 31
Rep Power: 13
banji is on a distinguished road
Hi Foamers,

Recently, I was trying to compile a part of the OpenFOAM library for fast and easy profiling and error message below kept recurring

Code:
fvmwLaplacian.C: In function 'Foam::tmp<Foam::fvMatrix<Type> > Foam::fvmw::laplacianw(const Foam::GeometricField<GType, Foam::fvsPatchField, Foam::surfaceMesh>&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double, GType = double]':
banola.C:70:32:   instantiated from here
fvmwLaplacian.C:131:70: error: no matching function for call to 'fvmLaplacianUncorrected(const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&)'
fvmwLaplacian.C:131:70: note: candidate is:
fvmwLaplacian.C:45:26: note: template<class Type, class GType> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvmw::fvmLaplacianUncorrected(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
Spent some time on it and didn't believe what caused the problem. This is the reason why I thought I should share my solution path with whomever faces similar problem.

When you look into the fvmLaplacian.H file (see below)

Code:
namespace fvmw
{

   ...


    template<class Type, class GType> //Here is the problem :confused:
    tmp<fvMatrix<Type> > fvmLaplacianUncorrected
    (
        const surfaceScalarField& gammaMagSf,
    const GeometricField<Type, fvPatchField, volMesh>&
    );
All I did was change the template part of the snippet shown above to the new one below since I observed the extra "class GType" was kind of redundant (not used at all in the function.

Code:
namespace fvmw
{

   ...


    //template<class Type, class GType> //Here is the problem :confused:
    template<class Type>  //New
    tmp<fvMatrix<Type> > fvmLaplacianUncorrected
    (
        const surfaceScalarField& gammaMagSf,
    const GeometricField<Type, fvPatchField, volMesh>&
    );
Hopefully this helped someone.
TeddyL likes this.
banji is offline   Reply With Quote

Reply

Tags
double, error, matching, type


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with if statement CHARLES OpenFOAM Programming & Development 17 August 22, 2021 04:14
Error no matching function zoptirik OpenFOAM Programming & Development 3 January 24, 2018 10:11
[Commercial meshers] star-ccm mesh to O\/F DLC OpenFOAM Meshing & Mesh Conversion 77 September 19, 2016 10:25
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23


All times are GMT -4. The time now is 17:11.