|
[Sponsors] |
February 1, 2012, 13:13 |
'Info' does not name a type
|
#1 |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
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 |
|
February 1, 2012, 15:54 |
|
#2 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
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. |
|
February 1, 2012, 16:09 |
|
#3 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
are you in the foam namespace?
|
|
February 1, 2012, 16:17 |
|
#4 | |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
Quote:
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> |
||
February 1, 2012, 16:23 |
|
#5 |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
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 |
|
February 1, 2012, 16:40 |
|
#6 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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.
|
|
February 1, 2012, 16:58 |
|
#7 | |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
Quote:
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 |
||
February 1, 2012, 17:30 |
|
#8 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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? |
|
February 1, 2012, 18:55 |
|
#9 | |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
Quote:
Do you happen to have another idea on how to better understand the solver? Thanks, Paulo |
||
February 1, 2012, 19:07 |
|
#10 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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. |
|
February 1, 2012, 20:05 |
|
#11 |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
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 |
|
February 2, 2012, 07:50 |
|
#12 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
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 |
|
February 2, 2012, 13:19 |
|
#13 |
Member
Paulo Bufacchi
Join Date: Jun 2010
Posts: 50
Rep Power: 16 |
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.
|
|
February 3, 2012, 03:22 |
|
#14 |
Disabled
Join Date: Mar 2011
Posts: 174
Rep Power: 15 |
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.
|
|
July 12, 2014, 03:38 |
|
#15 |
Member
Zacarias Carral
Join Date: Sep 2012
Posts: 35
Rep Power: 14 |
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” |
|
June 20, 2018, 12:29 |
|
#16 |
New Member
Nilay Kulkarni
Join Date: May 2018
Posts: 24
Rep Power: 8 |
Hello,
I'm trying to change my .C file and want to check if a particular loop runs. For that I want to use an Info <<. There is no error while compiling but there is no output either. I've attached the line from reactingParcel.C below, could you please you please tell me what is going wrong? { scalar addedMass = 0.0; scalar maxMassI = 0.0; forAll(td.cloud().rhoTrans(), i) { Info << << "cells with particles are " << celli << nl << endl; scalar dm = td.cloud().rhoTrans(i)[celli]; maxMassI = max(maxMassI, mag(dm)); addedMass += dm; } Thank you. |
|
January 3, 2022, 05:16 |
|
#17 |
Member
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 97
Rep Power: 5 |
Hello neilk,
I think problem might be solved by declaring info statement outside for loop might work. I don't know weather it will work or not. Last edited by saicharan662000@gmail.com; January 5, 2022 at 01:11. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
second order schemes | marine | OpenFOAM | 67 | April 11, 2022 18:19 |
boundary conditions for simpleFoam calculation | foam_noob | OpenFOAM Running, Solving & CFD | 8 | July 1, 2015 08:07 |
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 17:08 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 20:50 |