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

Cannot compile a solver containing the "gSum" function

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2016, 03:28
Default Cannot compile a solver containing the "gSum" function
  #1
New Member
 
Manuel do Nascimento
Join Date: May 2012
Posts: 14
Rep Power: 13
MdoNascimento is on a distinguished road
Hello, I was trying to compile a solver which contains the function "gSum". There is an error saying there is no proper function for calling gSum.
Any suggestions?
Thanks
MdoNascimento is offline   Reply With Quote

Old   February 11, 2016, 03:42
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
I suggest you include the relevant code you wrote and the exact error message.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   February 11, 2016, 03:58
Default
  #3
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
gSum works only with basic arrays - Field<T>, List<T> and so on. gSum doesn't work with complex fields, like GeometricField, i.e. volVectorField, surfaceScalarField.
mkraposhin is offline   Reply With Quote

Old   February 11, 2016, 04:55
Default
  #4
New Member
 
Manuel do Nascimento
Join Date: May 2012
Posts: 14
Rep Power: 13
MdoNascimento is on a distinguished road
Sorry!

The line in the code that gives the error message:

sumV = gSum(alpha1*mesh.V());

(solver based on interFoam)

in createfields: const volVectorField& C = mesh.C();



The error message was given in german, that's why I tried to translate it as well as possible:

filename.H: in function "int main(int char**)":

filename.H: error: no proper function for calling gSum(Foam::tmp<Foam:: DimensionedField<double, Foam::volMesh> >)«
readMRFControls.H:26:31: note: candidates are:
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C:490:1: note: template<class Type> Type Foam::gSum(const Foam::UList<T>&)
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C:490:1: note: template<class Type> Type Foam::gSum(const Foam::tmp<Foam::Field<Type> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:564:1: note: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::FieldField<Field, Type>&)
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:564:1: note: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::tmp<Foam::FieldField<Field, Type> >&)

Last edited by MdoNascimento; February 11, 2016 at 06:06.
MdoNascimento is offline   Reply With Quote

Old   February 11, 2016, 10:08
Default
  #5
New Member
 
Manuel do Nascimento
Join Date: May 2012
Posts: 14
Rep Power: 13
MdoNascimento is on a distinguished road
Problem solved! Had to use

sumC = gSum(C.internalField()*alpha1.internalField()*mesh .V());

instead of

sumC = gSum(C.internalField()*alpha1*mesh.V());
MdoNascimento is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 121 June 11, 2021 10:05
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 10:20
function within solver lindstroem OpenFOAM Programming & Development 8 November 30, 2012 11:20
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31


All times are GMT -4. The time now is 07:38.