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

'Info' does not name a type

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 1, 2012, 14:13
Smile 'Info' does not name a type
  #1
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
When I insert in some .H and .C files a line such as:

Info<< "my text" << endl;

and then compile the file, I get the following error:

"error: 'Info' does not name a type"

In some other files, this works well.

Does anyone know how I can solve this problem?

Thanks,

Paulo
Bufacchi is offline   Reply With Quote

Old   February 1, 2012, 16:54
Default
  #2
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 101
Rep Power: 6
adhiraj is on a distinguished road
There must be some error in the lines before the Info statement.
I suggest redirecting the output from Allwmake to a text file and search for "error" from the top.
adhiraj is offline   Reply With Quote

Old   February 1, 2012, 17:09
Default
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
are you in the foam namespace?
niklas is offline   Reply With Quote

Old   February 1, 2012, 17:17
Default
  #4
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
Quote:
Originally Posted by adhiraj View Post
There must be some error in the lines before the Info statement.
I suggest redirecting the output from Allwmake to a text file and search for "error" from the top.

To isolate the problem, I made only one file change as below:

/*-----------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
--------------------------------------------------------------------
License
This file is part of OpenFOAM.

OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.

Class
Foam::solidChemistryModel

Description
Chemistry model for solid thermodynamics

SourceFiles
solidChemistryModelI.H
solidChemistryModel.C
newChemistrySolidModel.C

\*----------------------------------------------------------------*/

Info<< endl << "================================================= =="
<< endl << "Opening file: solidChemistryModel.H"
<< endl << "================================================= =="
<< endl;

#ifndef solidChemistryModel_H
#define solidChemistryModel_H

#include "basicChemistryModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "basicSolidThermo.H"


// * * ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


And the compilation result is as follows:

paulo@linux-f6wv:~/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/solidChemistryModel> wmake
Making dependency list for source file solidChemistrySolver/makeSolidChemistrySolvers.C
Making dependency list for source file solidChemistryModel/solidChemistryModels.C
Making dependency list for source file solidChemistryModel/solidChemistryModelNew.C
Making dependency list for source file solidChemistryModel/solidChemistryModel.C
SOURCE=solidChemistryModel/solidChemistryModel.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/specie/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/ODE/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/chemistryModel/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/basic/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/solid/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/basicSolidThermo/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/paulo/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPDebug/solidChemistryModel.o
In file included from solidChemistryModel/solidChemistryModel.C:26:0:
solidChemistryModel/solidChemistryModel.H:167:1: error: ‘Info’ does not name a type
make: *** [Make/linux64GccDPDebug/solidChemistryModel.o] Error 1
paulo@linux-f6wv:~/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/solidChemistryModel>

Bufacchi is offline   Reply With Quote

Old   February 1, 2012, 17:23
Default
  #5
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
Quote:
Originally Posted by niklas View Post
are you in the foam namespace?
Hi Niklas,

The file I changed is solidChemistryModel.H.

I placed the info statement in many places of the file, from start to end. In all locations, I got the same error message.

This error happened when I inserted the info statement in other files too.

When I made this inclusion in the file fireFoam.C, it didn't give me the error when the insert point was after the #include statements after main. If I insert the info statement before that point, it would give me the error.

Thanks,

Paulo
Bufacchi is offline   Reply With Quote

Old   February 1, 2012, 17:40
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
If you are placeing it before the #ifndef then you could indeed be out of the foam namespace as Niklas suggests. It could be because you are trying to compile a library and are using wmake instead of wmake libso. You probably need to to address both issues before the library will compile.
mturcios777 is offline   Reply With Quote

Old   February 1, 2012, 17:58
Default
  #7
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
If you are placeing it before the #ifndef then you could indeed be out of the foam namespace as Niklas suggests. It could be because you are trying to compile a library and are using wmake instead of wmake libso. You probably need to to address both issues before the library will compile.
Hi Marco,

I just placed the info statement after the #ifndef and compiled using wmake libso in the solidChemistryModel directory and got the same error. I tried using ./Allwmake from the thermophysicalModels directory and got the same error.

Thanks,

Paulo
Bufacchi is offline   Reply With Quote

Old   February 1, 2012, 18:30
Default
  #8
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
You need to place the statement after the namespace foam, because that is where "Info" is defined. However, if you are placing it in solidChemistryModel.H you may be disappointed that you will likely never see that statement execute. That file is used to define the solidChemistryModel class, and unless there are functions in that file that are executed that have the Info statement.

Looking at some of your previous posts, I'm curious as to why you want to know which *.C and *.H files are entered/executed. Is there a specific feature you want to uncover, or behaviour you need clarified?
mturcios777 is offline   Reply With Quote

Old   February 1, 2012, 19:55
Default
  #9
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
You need to place the statement after the namespace foam, because that is where "Info" is defined. However, if you are placing it in solidChemistryModel.H you may be disappointed that you will likely never see that statement execute. That file is used to define the solidChemistryModel class, and unless there are functions in that file that are executed that have the Info statement.

Looking at some of your previous posts, I'm curious as to why you want to know which *.C and *.H files are entered/executed. Is there a specific feature you want to uncover, or behaviour you need clarified?
Well Marco, I'm using fireFoam solver to simulate forest fires. This solver is very complex, as it uses combustion, radiation, turbulence, pyrolysis, and so on. It is very challenging to understand all the steps taken by the solvers and libraries. My guess was that if I could log all .C and .H files that are called in a specific order, that would make me better understand the whole thing. My previous post was a tentative to have that in place, but it seems I have to program the feature (which I thing I don't have enough skills to do). Akidess mentioned that creating a comment line to be written to the solver log file would be an option, so that's what I'm trying to do.

Do you happen to have another idea on how to better understand the solver?

Thanks,

Paulo
Bufacchi is offline   Reply With Quote

Old   February 1, 2012, 20:07
Default
  #10
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
Looking at the source as you are doing is always helpful, but it can be difficult to keep track of when everything is executed. I would suggest looking at the source through the on-line Doxygen documentation:

http://www.openfoam.org/docs/cpp/

Do a search for fireFoam and it will allow you to go to the fireFoam.C file. From there, many of the source files will be linked in a way that you can click on them and get the Doxygen documentation that explains what they do. For the files that aren't linked (like UEqn.H), there may be multiple instances throughout OF, so you can search for them as well, or go to the fireFoam directory (in Doxygen) and see what local files are there.

Its a different approach than I was used to at first, but once I got the hang of the online documentation it became way faster than trying to do things in code or just looking at the code locally. If you want you can also build a local version of the Doxygen docs should you need them.
mturcios777 is offline   Reply With Quote

Old   February 1, 2012, 21:05
Default
  #11
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
I'm already using Doxygen, but I was having a hard time to find out where some variables were defined or calculated. There are so many files in the execution chain that is almost impossible to follow all of them.

Then, I started checking fireFoam log file for the case, to understand what file was in use when some actions were taken. I thought that this would give me a hint on where to look for a specific information.

As an example, the log file presents the following info:

Creating pyrolysis model
Selecting pyrolysisModel reactingOneDim
Selecting solidChemistryModel "ODESolidChemistryModel<constSolidThermoPhysics>ga sThermoPhysics"
ODESolidChemistryModel: Number of solids = 2 and reactions = 1
Number of gases from pyrolysis = 1
Reaction 0
irreversibleSolidArrheniusReaction
v = char + gas
Reaction order: 4.86
(7.83e+10 15274.6 400)

The chemistryProperties dictionary in the constant directory of the case has the following sub-dictionary:

reactions
(
irreversibleSolidArrheniusReaction
v = gas + char
(7.83e10 15274.57 400 4.86)
);

And I already know that (7.83e+10 15274.6 400) is related to the protected variable k_

What I couldn't find yet is the place where k_ reads the info from the dictionary. I have made searches for dict lookups and many others, but couldn't find the info yet. If I had a way to log what file was used before the information was written to the log file, that would help me.

Thanks,

Paulo
Bufacchi is offline   Reply With Quote

Old   February 2, 2012, 08:50
Default
  #12
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 8
kathrin_kissling is on a distinguished road
Hi Paulo,

check the forum for Astrid Marlah's topic about eclipse. You can just dig in all files while executing. The thing you are doing by hand is automated there.

Hope this helps

Kathrin
kathrin_kissling is offline   Reply With Quote

Old   February 2, 2012, 14:19
Default
  #13
Member
 
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 7
Bufacchi is on a distinguished road
Thank you Kathrin. I'll read all documentation and install Eclipse. For what I could get from the post this is what I'm looking for.
Bufacchi is offline   Reply With Quote

Old   February 3, 2012, 04:22
Default
  #14
Senior Member
 
Join Date: Mar 2011
Posts: 174
Rep Power: 6
anon_a is on a distinguished road
I have also found that stepping through the execution with nemiver (a GUI for gdb) helped me a lot to understand various details. But I am sure Eclipse has more advanced tools.
anon_a is offline   Reply With Quote

Old   July 12, 2014, 03:38
Default
  #15
New Member
 
Zacarias Carral
Join Date: Sep 2012
Posts: 27
Rep Power: 4
zcarral is on a distinguished road
Dear Buraffi,

Have you solved your problem? I also need to implement Info into a thermophysical model and I have the same error “Info does name a type”
zcarral is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
boundary conditions for simpleFoam calculation foam_noob OpenFOAM Running, Solving & CFD 8 July 1, 2015 08:07
second order schemes marine OpenFOAM 66 October 26, 2014 12:10
Need help with boundary conditions: open to atmosphere Wolle OpenFOAM 2 April 11, 2011 07:32
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 18:08
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


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