mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: mapped: make consistent with AMI. Fixes #2275
This commit is contained in:
@ -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_);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user