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

gSum: no matching function call

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By alexeym

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 20, 2017, 08:16
Default gSum: no matching function call
  #1
New Member
 
Gunther
Join Date: Jan 2017
Posts: 2
Rep Power: 0
Gunther is on a distinguished road
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

Last edited by Gunther; January 21, 2017 at 10:24.
Gunther is offline   Reply With Quote

 

Tags
error, gsum, incompatible code


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
Elementwise multiplication operator johndeas OpenFOAM Running, Solving & CFD 3 March 9, 2019 13:03
Compiling User Fortran with CFX 14.0 on Win64 Raijin Thunderkeg CFX 29 March 9, 2016 11:45
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 06:27


All times are GMT -4. The time now is 16:05.