|
[Sponsors] |
compilation problem with "fvPatch::lookupPatchField" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 23, 2010, 10:41 |
compilation problem with "fvPatch::lookupPatchField"
|
#1 |
Member
YS
Join Date: Jan 2010
Posts: 96
Rep Power: 16 |
Hi,
I experienced a weired problem when compiling a self-made BC, which is basically a hybrid of fixedvalues and mixed(inletoutlet). The problem comes from the invoking of function 'lookupPatchField' in my implementation of virtual function : updateCoeffs, as highlighted as follows: template<class Type> void regularWaveMakerVectorFixedValueFvPatchField<Type> ::updateCoeffs() { if (this->updated()) { return; } const fvsPatchField<scalar>& phip = this->patch().lookupPatchField ( "phi", reinterpret_cast<const surfaceScalarField*>(0), reinterpret_cast<const scalar*>(0) ); this->valueFraction() = 1.0 - pos(phip); // the rest code is irrelevant here... ... ... } But I copied the code exactly the same from the inletOutletFvPatchField.C file. Please advise what's going wrong here, many thanks!!! The error msg are as follows: /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.H: At global scope: /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.H: In instantiation of ‘Foam:: DimensionedField<double, Foam::surfaceMesh>’: /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/pointFieldsFwd.H:53: instantiated from ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:653 : instantiated from ‘void Foam::regularWaveMakerScalarFixedValueFvPatchField <Type>::updateCoeffs() [with Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:248 : instantiated from ‘Foam::regularWaveMakerScalarFixedValueFvPatchFiel d<Type>::regularWaveMakerScalarFixedValueFvPatchFi eld(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]’ lnInclude/fvPatchField.H:143: instantiated from ‘static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::adddictionaryConstructor ToTable<fvPatchFieldType>::New(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ lnInclude/fvPatchField.H:154: instantiated from ‘Foam::fvPatchField<Type>::adddictionaryConstructo rToTable<fvPatchFieldType>::adddictionaryConstruct orToTable(const Foam::word&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchFields.C:38 : instantiated from here /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.H:83: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.H:92: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.C:58: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.C:86: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedField.C:101: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedFieldIO.C:59: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/DimensionedFieldI.H:44: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H: In instantiation of ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>’: fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:653 : instantiated from ‘void Foam::regularWaveMakerScalarFixedValueFvPatchField <Type>::updateCoeffs() [with Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:248 : instantiated from ‘Foam::regularWaveMakerScalarFixedValueFvPatchFiel d<Type>::regularWaveMakerScalarFixedValueFvPatchFi eld(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]’ lnInclude/fvPatchField.H:143: instantiated from ‘static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::adddictionaryConstructor ToTable<fvPatchFieldType>::New(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ lnInclude/fvPatchField.H:154: instantiated from ‘Foam::fvPatchField<Type>::adddictionaryConstructo rToTable<fvPatchFieldType>::adddictionaryConstruct orToTable(const Foam::word&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchFields.C:38 : instantiated from here /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H:98: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H:99: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H: In instantiation of ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField’: /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H:238: instantiated from ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:653 : instantiated from ‘void Foam::regularWaveMakerScalarFixedValueFvPatchField <Type>::updateCoeffs() [with Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:248 : instantiated from ‘Foam::regularWaveMakerScalarFixedValueFvPatchFiel d<Type>::regularWaveMakerScalarFixedValueFvPatchFi eld(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]’ lnInclude/fvPatchField.H:143: instantiated from ‘static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::adddictionaryConstructor ToTable<fvPatchFieldType>::New(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ lnInclude/fvPatchField.H:154: instantiated from ‘Foam::fvPatchField<Type>::adddictionaryConstructo rToTable<fvPatchFieldType>::adddictionaryConstruct orToTable(const Foam::word&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchFields.C:38 : instantiated from here /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.H:113: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:40: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:77: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:129: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:212: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C: In instantiation of ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>’: fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:653 : instantiated from ‘void Foam::regularWaveMakerScalarFixedValueFvPatchField <Type>::updateCoeffs() [with Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchField.C:248 : instantiated from ‘Foam::regularWaveMakerScalarFixedValueFvPatchFiel d<Type>::regularWaveMakerScalarFixedValueFvPatchFi eld(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]’ lnInclude/fvPatchField.H:143: instantiated from ‘static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::adddictionaryConstructor ToTable<fvPatchFieldType>::New(const Foam::fvPatch&, const Foam:: DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ lnInclude/fvPatchField.H:154: instantiated from ‘Foam::fvPatchField<Type>::adddictionaryConstructo rToTable<fvPatchFieldType>::adddictionaryConstruct orToTable(const Foam::word&) [with fvPatchFieldType = Foam::regularWaveMakerScalarFixedValueFvPatchField <double>, Type = double]’ fields/fvPatchFields/derived/regularWaveMakerScalarFixedValue/regularWaveMakerScalarFixedValueFvPatchFields.C:38 : instantiated from here /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:193: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:223: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:250: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:279: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:309: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:333: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ /home/ys/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:374: error: invalid use of incomplete type ‘struct Foam::surfaceMesh’ lnInclude/surfaceFieldsFwd.H:47: error: forward declaration of ‘struct Foam::surfaceMesh’ make: *** [Make/linux64GccDPOpt/regularWaveMakerScalarFixedValueFvPatchFields.o] error 1 |
|
May 24, 2010, 07:57 |
|
#2 |
Member
YS
Join Date: Jan 2010
Posts: 96
Rep Power: 16 |
forgot to say that I'm using OF 1.6. The compiling passes without errors if I remove the red part.
|
|
May 25, 2010, 06:28 |
|
#3 |
Member
YS
Join Date: Jan 2010
Posts: 96
Rep Power: 16 |
problem solved.
|
|
May 25, 2010, 09:48 |
|
#4 |
New Member
Misha Marie Gregersen
Join Date: Nov 2009
Posts: 7
Rep Power: 17 |
Hi, I am having the exact same problem with the compilation of an equivalent boundary condition. Could you please tell me what solved your problem?
|
|
May 25, 2010, 10:29 |
|
#5 |
Member
YS
Join Date: Jan 2010
Posts: 96
Rep Power: 16 |
check you Fields.C file and make sure to include relevant header files. In my case, I just forgot to include the "surfaceFields.H" file.
|
|
October 20, 2014, 13:06 |
|
#6 |
New Member
Join Date: Oct 2014
Posts: 2
Rep Power: 0 |
Dear all,
I have a similar problem. I want to modify the boundary conditions for scalarTransportFoam. I took the fixedValueFvPatchField.C and added a function updateCoeffs(); in this function i wrote const scalarField& PField = patch().lookupPatchField<volScalarField, scalar>("p") The problem is, that i can't compile it. The compiler said, that he has a problem with patch(). (the entire text of error is following). Does anybody have an idea? My OF version is 2.3.0. |
|
October 23, 2014, 06:16 |
|
#7 |
New Member
Join Date: Oct 2014
Posts: 2
Rep Power: 0 |
So here is the complete error:
error: there are no arguments to 'patch' that depend on a template parameter, so a declaration of 'patch' must be available Why I have to declare patch()? I thought it is declared. Can anybody help? |
|
October 27, 2014, 11:24 |
|
#8 |
New Member
Song
Join Date: Nov 2011
Posts: 12
Rep Power: 15 |
you'd better give more information.:)
|
|
June 19, 2021, 10:51 |
|
#9 |
New Member
Outside US and Canada
Join Date: Apr 2020
Posts: 11
Rep Power: 6 |
Can you please tell how did you include this file?
|
|
November 15, 2021, 23:01 |
|
#10 |
New Member
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 5 |
Hello,
I am doing a similar work to build a new BC, which is basically a hybrid of fixedvalues and mixed(inletoutlet). The Compilation has been successful but I get the error message as belows when I run "decomposePar" on a test case based on pimpleFoam: Code:
--> FOAM FATAL ERROR: request for surfaceScalarField phi from objectRegistry region0 failed available objects of type surfaceScalarField are 0() From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>] in file /home/gareth/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 211. Best wishes Gareth |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compilation problem on Linux System | Nitin Pathak | Fluent UDF and Scheme Programming | 6 | September 29, 2018 21:26 |
[Commercial meshers] Handling cyclic BC from gambit to openfoam for a cascade airfoil problem - OF 1.6 | maverick | OpenFOAM Meshing & Mesh Conversion | 2 | June 18, 2011 05:36 |
Velocity profiles problem behind the elbow (3D problem) | kabat73 | FLUENT | 8 | May 9, 2010 05:26 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |