diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 7f6d4ea5406d924cfad6fa1397a10d1fe24a6ea7..36887ad927e793a2d522c044ffea9f9da863bbb1 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2020 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -1244,6 +1244,11 @@ void Foam::AMIInterpolation::write(Ostream& os) const { os.writeEntry("AMIMethod", type()); + if (!requireMatch_) + { + os.writeEntry("requireMatch", requireMatch_); + } + if (reverseTarget_) { os.writeEntry("reverseTarget", reverseTarget_); diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H index 1bdf85457f778b28199f2991c38dcdfc1c031249..5111a50ff2c521bcd4418cf6bc1e590ae84dec7c 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H @@ -102,7 +102,7 @@ protected: const bool reverseTarget_; //- Threshold weight below which interpolation is deactivated - scalar lowWeightCorrection_; + const scalar lowWeightCorrection_; //- Index of processor that holds all of both sides. -1 in all other //- cases diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C index e02312a9113438187f4fab1567d8594ca587c0f4..ebbd171087c40d5c14e7b1f718d306bccf930578 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C @@ -1341,7 +1341,18 @@ Foam::mappedPatchBase::mappedPatchBase && sampleRegion_ == patch_.boundaryMesh().mesh().name() ), mapPtr_(nullptr), - AMIReverse_(dict.getOrDefault("flipNormals", false)), + AMIReverse_ + ( + dict.getOrDefault + ( + "reverseTarget", // AMIInterpolation uses this keyword + dict.getOrDefault + ( + "flipNormals", + false + ) + ) + ), AMIPtr_ ( AMIInterpolation::New @@ -1433,7 +1444,18 @@ Foam::mappedPatchBase::mappedPatchBase && sampleRegion_ == patch_.boundaryMesh().mesh().name() ), mapPtr_(nullptr), - AMIReverse_(dict.getOrDefault("flipNormals", false)), + AMIReverse_ + ( + dict.getOrDefault + ( + "reverseTarget", // AMIInterpolation uses this keyword + dict.getOrDefault + ( + "flipNormals", + false + ) + ) + ), AMIPtr_ ( AMIInterpolation::New @@ -1968,18 +1990,20 @@ void Foam::mappedPatchBase::write(Ostream& os) const break; } } + } - if (mode_ == NEARESTPATCHFACEAMI) + if (mode_ == NEARESTPATCHFACEAMI) + { + if (AMIPtr_) { - if (AMIReverse_) - { - os.writeEntry("flipNormals", AMIReverse_); - } - - if (!surfDict_.empty()) - { - surfDict_.writeEntry(surfDict_.dictName(), os); - } + // Use AMI to write itself. Problem: outputs: + // - restartUncoveredSourceFace + // - reverseTarget (instead of flipNormals) + AMIPtr_->write(os); + } + if (!surfDict_.empty()) + { + surfDict_.writeEntry(surfDict_.dictName(), os); } } }