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

OpenFOAM class declaration error with volScalarField

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

Like Tree2Likes
  • 2 Post By raunakbardia

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2019, 16:46
Default OpenFOAM class declaration error with volScalarField
  #1
Member
 
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11
raunakbardia is on a distinguished road
Hi everyone,

I am currently using OpenFOAM v1706.

I am trying to declare a class with the internal field of a volScalarField object and a volVectorField object. During class instantiation, I simply want them to be initialized with a uniform zero value. Even though I have copied the constructors used in other OpenFOAM libraries, I am not able to make them work.

Here is the code definition for the volScalarField object.

In .H file, the variable is defined as:

Code:
volScalarField::Internal alphaSource_;
Class instantiation in the .C file uses the following code:
Code:
    alphaSource_
    (    
        IOobject
        (    
           "alphaSource",
            mesh_.time().timeName(),
            mesh_
        ),   
        mesh_,
        dimensionedScalar("zero", dimVol, 0)
    )
I have attached the error log, but I believe the main error is the following:
Quote:
In file included from /usr/local/openfoam/v1706/OpenFOAM-v1706/src/finiteVolume/lnInclude/fvMesh.H:58:0,
from phaseChangeAdvection.H:57,
from phaseChangeAdvection.C:29:
/usr/local/openfoam/v1706/OpenFOAM-v1706/src/OpenFOAM/lnInclude/DimensionedField.H: In instantiation of ‘class Foam:imensionedField<double, Foam::volMesh>’:
/usr/local/openfoam/v1706/OpenFOAM-v1706/src/OpenFOAM/lnInclude/GeometricField.H:81:7: required from ‘class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’
phaseChangeAdvection.H:110:23: required from here
/usr/local/openfoam/v1706/OpenFOAM-v1706/src/OpenFOAM/lnInclude/DimensionedField.H:84:40: error: invalid use of incomplete type ‘class Foam::volMesh’
typedef typename GeoMesh::Mesh Mesh;
Any help would be much appreciated. I have always come across some or the other error in instantiating a volScalarField object in a class but every time I have used a workaround. Don't want to keep ignoring this forever.
Attached Files
File Type: c phaseChangeAdvection.C (4.6 KB, 2 views)
File Type: h phaseChangeAdvection.H (10.4 KB, 1 views)
File Type: txt error.txt (43.2 KB, 1 views)
daamec and vivek05 like this.
raunakbardia 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
Conflicting declaration of "typedef" class in OpenFOAM SKLee OpenFOAM Programming & Development 1 March 10, 2018 06:19
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
Possible bug in OpenFoam Interpolation class MMC15 OpenFOAM Bugs 2 March 23, 2014 13:55
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


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