diff --git a/META-INFO/api-info b/META-INFO/api-info index 81ff764f65..55b4efecf6 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2102 -patch=210210 +patch=210414 diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index df0ce71fe0..73cbe376ca 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,7 +26,7 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // template Foam::autoPtr> Foam::pointPatchField::New @@ -55,20 +55,22 @@ Foam::autoPtr> Foam::pointPatchField::New if ( - actualPatchType == word::null + actualPatchType.empty() || actualPatchType != p.type() ) { if (pfPtr().constraintType() != p.constraintType()) { - // Use default constraint type + // Incompatible (constraint-wise) with the patch type + // - use default constraint type + auto patchTypeCstrIter = pointPatchConstructorTablePtr_->cfind(p.type()); if (!patchTypeCstrIter.found()) { FatalErrorInFunction - << "inconsistent patch and patchField types for \n" + << "Inconsistent patch and patchField types for\n" << " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalError); @@ -138,20 +140,17 @@ Foam::autoPtr> Foam::pointPatchField::New if ( - !dict.found("patchType") + !dict.found("patchType") || dict.get("patchType") != p.type() ) { - if (pfPtr().constraintType() == p.constraintType()) + if (pfPtr().constraintType() != p.constraintType()) { - // Compatible (constraint-wise) with the patch type - return pfPtr; - } - else - { - // Use default constraint type - auto patchTypeCstrIter - = dictionaryConstructorTablePtr_->cfind(p.type()); + // Incompatible (constraint-wise) with the patch type + // - use default constraint type + + auto patchTypeCstrIter = + dictionaryConstructorTablePtr_->cfind(p.type()); if (!patchTypeCstrIter.found()) { @@ -166,7 +165,7 @@ Foam::autoPtr> Foam::pointPatchField::New } } - return cstrIter()(p, iF, dict); + return pfPtr; }