BUG: remove overly optimistic short-cut when reading BCs

- had an optimisation to skip attempted reading for zero-sized
  patches. But this leads to inconsistency in the code branching, thus
  removing it.
This commit is contained in:
Mark Olesen 2023-03-22 14:56:03 +01:00
parent f6969631a6
commit 726787b0d2
7 changed files with 7 additions and 21 deletions

View File

@ -38,10 +38,8 @@ bool Foam::valuePointPatchField<Type>::readValueEntry
IOobjectOption::readOption readOpt
)
{
const auto& p = pointPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = pointPatchFieldBase::patch();
const auto* eptr = dict.findEntry("value", keyType::LITERAL);

View File

@ -37,10 +37,8 @@ bool Foam::mixedFaPatchField<Type>::readMixedEntries
IOobjectOption::readOption readOpt
)
{
const auto& p = faPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = faPatchFieldBase::patch();
// If there is a 'refValue', also require all others

View File

@ -39,10 +39,8 @@ bool Foam::faPatchField<Type>::readValueEntry
IOobjectOption::readOption readOpt
)
{
const auto& p = faPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = faPatchFieldBase::patch();
const auto* eptr = dict.findEntry("value", keyType::LITERAL);

View File

@ -38,10 +38,8 @@ bool Foam::faePatchField<Type>::readValueEntry
IOobjectOption::readOption readOpt
)
{
const auto& p = faePatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = faePatchFieldBase::patch();
const auto* eptr = dict.findEntry("value", keyType::LITERAL);

View File

@ -37,10 +37,8 @@ bool Foam::mixedFvPatchField<Type>::readMixedEntries
IOobjectOption::readOption readOpt
)
{
const auto& p = fvPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = fvPatchFieldBase::patch();
// If there is a 'refValue', also require all others

View File

@ -41,10 +41,8 @@ bool Foam::fvPatchField<Type>::readValueEntry
IOobjectOption::readOption readOpt
)
{
const auto& p = fvPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = fvPatchFieldBase::patch();
const auto* eptr = dict.findEntry("value", keyType::LITERAL);

View File

@ -41,10 +41,8 @@ bool Foam::fvsPatchField<Type>::readValueEntry
IOobjectOption::readOption readOpt
)
{
const auto& p = fvsPatchFieldBase::patch();
if (!p.size()) return true; // Can be exceptionally lazy
if (!IOobjectOption::isAnyRead(readOpt)) return false;
const auto& p = fvsPatchFieldBase::patch();
const auto* eptr = dict.findEntry("value", keyType::LITERAL);