CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Qtcreator cannot recongnize volScalarField (https://www.cfd-online.com/Forums/openfoam/236718-qtcreator-cannot-recongnize-volscalarfield.html)

ztdep June 12, 2021 01:46

Qtcreator cannot recongnize volScalarField
 
Dear sir:
I setup a oenfoam project with Qtcreator. I have include the header file for the volScalarField, but Qtcreator still prompt the error about "unknown type name 'volScalarField'.Could you please give me some adives abouth which header file should i inlclude further?

Code:

#include <argList.H>
#include <fvMesh.H>
#include <GeometricField.H>
#include <volFields.H>
#include <fvCFD.H>
#include <mathematicalConstants.H>
#include <fvOption.H>
#include <volFieldsFwd.H>
#include <rhoThermo.H>
#include <pimpleControl.H>
#include <surfFields.H>
#include <cpuInfo.H>
#include <linear.H>
#include <CodedSource.H>

using namespace Foam;

int main(int argc, char *argv[])

#include <setRootCase.H>
#include <createTime.H>

 fvMesh mesh
    (
        IOobject
        (
            fvMesh::defaultRegion,
            runTime.timeName(),
            runTime,
            IOobject::MUST_READ
          //IOobject::NO_READ
        )
    );


 volScalarField TA
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
 Info<<TA.size();
}

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


Rvadrabade June 12, 2021 03:25

Debugging-OpenFOAM-with-Visual-Studio-Code
 
Hi,

Apologies as the answer is not directly related to Qt creator. However, I think it is easier to setup project with vscode, nowadays. Check out as needed .

https://github.com/Rvadrabade/Debugg...al-Studio-Code


All times are GMT -4. The time now is 08:43.