Gunther |
January 20, 2017 08:16 |
gSum: no matching function call
Hey,
I try to compile a code which used to compile in OF 2.3, but in version 4.1 it doesn't do so any more. I receive the error: no matching function for call to gSum... (see below) Does anyone know if a gSum function is relocated or removed in the latest OF? Many thanks in advance!
The piece of the code which the error is called from is as follows:
Code:
#include "pollutant.H"
#include "fvCFD.H"
#include "IOmanip.H"
void pollutant::balance()
{
forAllConstIter(HashTable<isotope*>, isotopes_, iter)
{
const isotope& nuclide = *iter();
const volScalarField& Ci = nuclide.C();
Info << "Total amount of " << Ci.name()
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
<< endl;
}
}
The complete error message is the following:
HTML Code:
pollutant.C: In member function ‘void Foam::pollutant::balance()’:
pollutant/pollutant.C:443:72: error: no matching function for call to ‘gSum(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)’
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
^
pollutant/pollutant.C:443:72: note: candidates are:
In file included from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.C:870:0,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.H:405,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/scalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionSet.H:46,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedType.H:40,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedTypes.H:31,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricField.H:43,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/volFields.H:37,
from pollutant/pollutant.H:37,
from pollutant/pollutant.C:26:
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: template<class Type> Type Foam::gSum(const Foam::UList<T>&, Foam::label)
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:533:12: note: in definition of macro ‘G_UNARY_FUNCTION’
ReturnType gFunc(const UList<Type>& f, const label comm) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: template argument deduction/substitution failed:
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:533:12: note: in definition of macro ‘G_UNARY_FUNCTION’
ReturnType gFunc(const UList<Type>& f, const label comm) \
^
pollutant/pollutant.C:443:72: note: ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::UList<T>’
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
^
In file included from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.C:870:0,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.H:405,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/scalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionSet.H:46,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedType.H:40,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedTypes.H:31,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricField.H:43,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/volFields.H:37,
from pollutant/pollutant.H:37,
from pollutant/pollutant.C:26:
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: template<class Type> Type Foam::gSum(const Foam::tmp<Foam::Field<Type> >&)
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:303:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
ReturnType Func(const tmp<Field<Type>>& tf1) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: template argument deduction/substitution failed:
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:303:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
ReturnType Func(const tmp<Field<Type>>& tf1) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFunctions.C:543:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
pollutant/pollutant.C:443:72: note: mismatched types ‘Foam::Field<Type>’ and ‘Foam::DimensionedField<double, Foam::volMesh>’
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
^
pollutant/pollutant.C:443:72: note: ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::tmp<Foam::Field<Type> >’
In file included from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldField.C:390:0,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldField.H:198,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricField.H:45,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/volFields.H:37,
from pollutant/pollutant.H:37,
from pollutant/pollutant.C:26:
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::FieldField<Field, Type>&)
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:549:12: note: in definition of macro ‘G_UNARY_FUNCTION’
returnType gFunc(const FieldField<Field, Type>& f) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: template argument deduction/substitution failed:
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:549:12: note: in definition of macro ‘G_UNARY_FUNCTION’
returnType gFunc(const FieldField<Field, Type>& f) \
^
pollutant/pollutant.C:443:72: note: ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::FieldField<Field, Type>’
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
^
In file included from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldField.C:390:0,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldField.H:198,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricField.H:45,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/volFields.H:37,
from pollutant/pollutant.H:37,
from pollutant/pollutant.C:26:
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::tmp<Foam::FieldField<Field, Type> >&)
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:400:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
returnType func(const tmp<FieldField<Field, Type>>& tf1) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: template argument deduction/substitution failed:
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:400:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
returnType func(const tmp<FieldField<Field, Type>>& tf1) \
^
OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
G_UNARY_FUNCTION(Type, gSum, sum, sum)
^
pollutant/pollutant.C:443:72: note: mismatched types ‘Foam::FieldField<Field, Type>’ and ‘Foam::DimensionedField<double, Foam::volMesh>’
<< " in the system: " << gSum(Ci.internalField()*mesh_.V())
^
pollutant/pollutant.C:443:72: note: ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::tmp<Foam::FieldField<Field, Type> >’
make: *** [Make/linux64GccDPInt32Opt/pollutant/pollutant.o] Error 1
|