Skip to content

BUG: fvsPatchFields reading/writing the "value" entry

This seems to have been around for a very long time (commit 44d0fbd5 from 2011) but recently encountered by @Serge while trying to adapt surface fields to ADIOS writing.

In the example of an empty patch, the input requirements are as per emptyFvPatchField:

<patchName>
{
    type  empty;
}

and the constructor from dictionary explicitly ignores all entries (including the "value" entry) and even goes as far as creating the patch with a zero size:

template<class Type>
Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
(
    const fvPatch& p,
    const DimensionedField<Type, surfaceMesh>& iF,
    const dictionary& dict
)
:
    fvsPatchField<Type>(p, iF, Field<Type>(0))
{

However, the writing will call the base fvsPatchField (see previously mentioned commit), which will write the "value" of that zero-sized field.

This is normally not an issue, but for the ADIOS integration there is now a complete mismatch in the sizes, which is triggered by the writeEntry() call.

Proposed fix:

  • partial revert of the mentioned commit and introduce read/write of "value" where it is actually needed.