View Issue Details

IDProjectCategoryView StatusLast Update
0003304OpenFOAMBugpublic2019-07-11 11:00
Reporterhandrake0724 Assigned Towill  
Status resolvedResolutionfixed 
Platformx86_64OSCentOSOS Version7.3
Summary0003304: fvPatchField does not have a constructor with const Type& parameter
DescriptionI have tested my boundary condition class which was derived from fixedValueFvPatchScalarField.
the class worked well in OpenFOAM 6 but it failed to compile in OpenFOAM 7.

compile error was related to a missing constructor of fvPatchField shown in

        const fvPatch& p,
        const DimensionedField<Type, volMesh>& iF,
        const Type& value
   fvPatchField<Type>(p, iF, value)

so I compared fixedValueFvPatchField and fvPatchField classes shown in OpenFOAM 6 and 7.

it turns out that fvPatchField constructor experienced change in OpenFOAM 7.

in OpenFOAM7, fvPatchField is missing a constructor corresponding to
        const fvPatch& p,
        const DimensionedField<Type, volMesh>& iF,
        const Type& value

I have checked if Field<Type> has a constructor from constant value to Field<Type> value but it was not found.
I am not sure the removal of the constructor is intended but at the moment it looks like a bug.
TagsNo tags attached.



2019-07-11 09:11

manager   ~0010555

The change was intended. The value constructor isn't actually being used anywhere (in OpenFOAM; clearly it was in your developments) so it was removed when a bunch of changes to the constructors were made to more correctly propagate "patchType" settings. See I must have missed removing the equivalent constructor from fixedValueFvPatchField. I don't really want to put the constructor back in when there is nothing in OpenFOAM that requires it and that will test it regularly.

Unless you are doing something quite specific at a higher level, your boundary condition probably doesn't need a value constructor either. Have you tried removing it?

If that doesn't work, just construct the field locally and use the field constructor; i.e., fvPatchField<Type>(p, iF, Field<Type>(p.size(), value)).


2019-07-11 11:00

manager   ~0010556

I've removed the offending constructors from fixedValueFvPatchField in both version 7 and in dev, so it is now consistent with fvPatchField, which I think means this issue is now resolved. The fixes I proposed to your code in my previous message should still work, and will still be necessary.

Issue History

Date Modified Username Field Change
2019-07-09 23:19 handrake0724 New Issue
2019-07-11 09:11 will Note Added: 0010555
2019-07-11 11:00 will Assigned To => will
2019-07-11 11:00 will Status new => resolved
2019-07-11 11:00 will Resolution open => fixed
2019-07-11 11:00 will Fixed in Version => 7
2019-07-11 11:00 will Note Added: 0010556