BUG: fvsPatchFields reading/writing the "value" entry (fixes #3144)

- manual revert for 44d0fbd594.

  Unless required for post-processing the "value" entry should not
  written if it is not mandatory for reading.

  This is especially crucial with an 'empty' patch field where the
  field (size 0) has a different size from the patch.

- the changes made align fvsPatchField behaviour with fvPatchField
This commit is contained in:
Mark Olesen
2024-04-18 12:55:40 +02:00
parent 5fb1181bb2
commit 8a8b5db977
77 changed files with 525 additions and 327 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,7 +58,8 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
const dictionary& dict,
IOobjectOption::readOption requireValue
)
:
fvsPatchField<Type>(p, iF, dict, IOobjectOption::MUST_READ)
@ -80,21 +82,21 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
template<class Type>
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
(
const fixedValueFvsPatchField<Type>& ptf
const fixedValueFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
)
:
fvsPatchField<Type>(ptf)
fvsPatchField<Type>(ptf, iF)
{}
template<class Type>
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
(
const fixedValueFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
const fixedValueFvsPatchField<Type>& ptf
)
:
fvsPatchField<Type>(ptf, iF)
fixedValueFvsPatchField<Type>(ptf, ptf.internalField())
{}
@ -138,4 +140,12 @@ Foam::fixedValueFvsPatchField<Type>::gradientBoundaryCoeffs() const
}
template<class Type>
void Foam::fixedValueFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
fvsPatchField<Type>::writeValueEntry(os);
}
// ************************************************************************* //