View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001539 | OpenFOAM | Bug | public | 2015-02-17 19:27 | 2015-02-17 23:35 |
Reporter | wyldckat | Assigned To | henry | ||
Priority | low | Severity | text | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Summary | 0001539: Unable to derive a class from outletInletFvPatchField.C as "outletInletFvPatchScalarField" | ||||
Description | If we copy-change the class "turbulentMixingLengthDissipationRateInlet" to create "turbulentMixingLengthDissipationRateOutlet", which derives from "outletInletFvPatchScalarField", it's will result in a compile error: outletInletFvPatchField.C:129:37: error: no matching function for call to ‘pos(const Foam::fvsPatchField<double>&)’ The reason for this can be seen if we compare the source codes from each original parent classes: - inletOutletFvPatchField: const Field<scalar>& phip = this->patch().template lookupPatchField<surfaceScalarField, scalar> ( phiName_ ); - outletInletFvPatchField: const fvsPatchField<scalar>& phip = this->patch().template lookupPatchField<surfaceScalarField, scalar> ( phiName_ ); If we change "fvsPatchField" to "Field" in "outletInletFvPatchField.C", it works fine: --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C @@ -120,7 +120,7 @@ void Foam::outletInletFvPatchField<Type>::updateCoeffs() return; } - const fvsPatchField<scalar>& phip = + const Field<scalar>& phip = this->patch().template lookupPatchField<surfaceScalarField, scalar> ( phiName_ | ||||
Steps To Reproduce | Attached is the source code ready for testing. Unpack and run "wmake libso" on it to trigger the error. | ||||
Additional Information | This first happened to us around 19 months ago and only today was I able to double-check if this still occurs, how and why. The provided example class might not make much sense, since there are other ways to get similar results, but still, it's a bug we (accidentally) managed to trigger. | ||||
Tags | No tags attached. | ||||
|
|
|
There are two possible solutions: either a reference to Field rather than fvsPatchField is used or fvsPatchField.H in included so that the pos function is known. For consistency with inletOutlet I have changed outletInlet to use Field as you propose. Resolved by commit ba8c218ad5d49e28719d7489e4119eb59c6f5733 |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-02-17 19:27 | wyldckat | New Issue | |
2015-02-17 19:27 | wyldckat | File Added: turbulentMixingLengthDissipationRateOutlet.tar.gz | |
2015-02-17 23:35 | henry | Note Added: 0003818 | |
2015-02-17 23:35 | henry | Status | new => resolved |
2015-02-17 23:35 | henry | Resolution | open => fixed |
2015-02-17 23:35 | henry | Assigned To | => henry |