BUG: mapped: make consistent with AMI. Fixes #2275

This commit is contained in:
mattijs
2021-11-22 12:21:13 +00:00
parent 39d244ad91
commit bb7d8d0f4d
3 changed files with 43 additions and 14 deletions

View File

@ -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_);

View File

@ -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

View File

@ -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);
}
}
}