compilation problem with "fvPatch::lookupPatchField"
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!!!:confused: 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 |
forgot to say that I'm using OF 1.6. The compiling passes without errors if I remove the red part.
|
problem solved.
|
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?
|
Quote:
|
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. |
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? |
you'd better give more information.:)
|
Can you please tell how did you include this file?
|
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: Best wishes Gareth |
All times are GMT -4. The time now is 06:16. |