View Issue Details

IDProjectCategoryView StatusLast Update
0003304OpenFOAMBugpublic2019-07-11 11:00
Reporterhandrake0724Assigned Towill 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSCentOSOS Version7.3
Product Version7 
Fixed in Version7 
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

   fixedValueFvPatchField
   (
        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
  fvPatchField
  (
        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.

Activities

will

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 https://bugs.openfoam.org/view.php?id=3144. 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)).

will

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.

https://github.com/OpenFOAM/OpenFOAM-dev/commit/4e902bf4502070fb6ab86d6112114167a7c6731e
https://github.com/OpenFOAM/OpenFOAM-7/commit/0ebbff061746c26788cc5d54b1fbc70799fa9428

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