April 21, 2016, 08:37
|
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: 14
|
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.
|
|
|