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

Using PtrList<volScalarField> as an inline function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2020, 14:59
Default Using PtrList<volScalarField> as an inline function
  #1
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
Dear Friends
I have a problem in defining PtrList<volScalarField> in KinematicCloudI.H and KinematicCloud.H.

When I define Yi() in KinematicCloudI.H as below
Code:
template<class CloudType>
inline Foam::PtrList<Foam::volScalarField>& Foam::KinematicCloud<CloudType>::Yi() const
{
    return Yi_;
}
And in KinematicCloud.H as below;
Code:
inline const Foam::PtrList<Foam::volScalarField>& Yi() const;
I get below errors;

Code:
lnInclude/KinematicCloudI.H:123:45: error: prototype for ‘Foam::PtrList<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >& Foam::KinematicCloud<CloudType>::Yi() const’ does not match any in class ‘Foam::KinematicCloud<CloudType>’
 inline Foam::PtrList<Foam::volScalarField>& Foam::KinematicCloud<CloudType>::Yi() const
                                             ^
In file included from lnInclude/basicKinematicCloud.H:36:0,
                 from parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C:26:
lnInclude/KinematicCloud.H:409:66: error: candidate is: const Foam::PtrList<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >& Foam::KinematicCloud<CloudType>::Yi() const
                inline const Foam::PtrList<Foam::volScalarField>& Yi() const;
                                                                  ^
In file included from lnInclude/KinematicCloud.H:677:0,
                 from lnInclude/basicKinematicCloud.H:36,
                 from parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C:26:
lnInclude/KinematicCloudI.H:136:1: error: ‘PtrList’ does not name a type
 PtrList<volScalarField>& Y
Could you please tell me what is my problem?


Thanks,
Farzad Farajidizaji
farzadmech is offline   Reply With Quote

Old   January 26, 2020, 20:17
Default answer, yet another error
  #2
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
Dear Friends
I have solved above error using below piece of codes;

in KinematicCloudI.H as below
Code:
template<class CloudType>
inline const Foam::PtrList<Foam::volScalarField>& Foam::KinematicCloud<CloudType>::Yi() const
{
    return Yi_;
}

And in KinematicCloud.H as below;
Code:
 inline const PtrList<volScalarField>& Yi() const;
Now, another error happened in the KinematicParcelTrackingDataI.H as below;

Code:
./../../../../src/lagrangian/intermediateBFD/lnInclude/KinematicParcelTrackingDataI.H:63:9: error: no matching function for call to ‘Foam::interpolation<double>::New(const Foam::dictionary&, const Foam::PtrList<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&)’
the code lines in KinematicParcelTrackingDataI.H are:
Code:
YiInterp_
    (
        interpolation<scalar>::New              
        (
            cloud.solution().interpolationSchemes(),
            cloud.Yi()
        )
    ),
Now, the question is where should I add PtrList?


Thanks,
Farzad Farajidizaji
farzadmech is offline   Reply With Quote

Reply


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 02:27
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 04:17.