Skip to content
Snippets Groups Projects
Commit 2e4a1044 authored by mattijs's avatar mattijs Committed by Mattijs Janssens
Browse files

BUG: cyclicPeriodicAMI: incorrect faceCentres. See #2145

parent 1c2cff13
No related merge requests found
......@@ -374,12 +374,19 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI() const
{
if (direction)
{
// Note: primitive patch holds reference to external points so
// make sure to calculate stats before changing points
point oldAvg(Zero);
if (debug)
{
oldAvg = gAverage(thisPatch.points());
}
periodicPatch.transformPosition(thisPoints);
DebugInFunction
<< "patch:" << name()
<< " moving this side from:"
<< gAverage(thisPatch.points())
<< " moving this side from:" << oldAvg
<< " to:" << gAverage(thisPoints) << endl;
thisPatch.movePoints(thisPoints);
......@@ -398,12 +405,19 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI() const
}
else
{
// Note: primitive patch holds reference to external points so
// make sure to calculate stats before changing points
point oldAvg(Zero);
if (debug)
{
oldAvg = gAverage(nbrPatch.points());
}
periodicPatch.transformPosition(nbrPoints);
DebugInFunction
<< "patch:" << name()
<< " moving neighbour side from:"
<< gAverage(nbrPatch.points())
<< " moving neighbour side from:" << oldAvg
<< " to:" << gAverage(nbrPoints) << endl;
nbrPatch.movePoints(nbrPoints);
......
......@@ -54,11 +54,8 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicPeriodicAMIPolyPatch::interpolate
{
Pout<< "For patch " << this->name()
<< " found periodic:" << pp.name()
//<< " own:" << pp.owner()
<< " rank:" << pTraits<Type>::rank
<< " parallel:" << pp.parallel()
//<< " forwardT:" << pp.forwardT()
//<< " reverseT:" << pp.reverseT()
<< endl;
}
......@@ -130,7 +127,7 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicPeriodicAMIPolyPatch::interpolate
if (debug&2)
{
const pointField& nbrFc = nbrPp.faceCentres();
const vectorField::subField nbrFc(nbrPp.faceCentres());
Pout<< "On patch:" << this->name()
<< " size:" << this->size()
......@@ -147,17 +144,6 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicPeriodicAMIPolyPatch::interpolate
<< " cyli:" << localFld[i] << nl
<< endl;
}
if (defaultValues.size())
{
forAll(defaultValues, i)
{
Pout<< "Defaults At:" << nbrFc[i] << nl
<< " cart:" << defaultValues[i] << nl
<< " cyli:" << localDeflt[i] << nl
<< endl;
}
}
}
......@@ -165,23 +151,15 @@ Foam::tmp<Foam::Field<Type>> Foam::cyclicPeriodicAMIPolyPatch::interpolate
auto tinterp = cyclicAMIPolyPatch::interpolate(localFld, localDeflt);
// Transform back. Result is now at *this
List<Type> oldResult;
if (debug&2)
{
oldResult = tinterp();
}
const pointField& fc = this->faceCentres();
tmp<tensorField> T(cs.R(fc));
auto tresult = Foam::transform(T, tinterp);
const vectorField::subField fc(this->faceCentres());
auto tresult = Foam::transform(cs.R(fc), tinterp);
if (debug&2)
{
const pointField& fc = this->faceCentres();
forAll(fc, i)
{
Pout<< "Results: At local :" << fc[i] << nl
<< " cyli:" << oldResult[i] << nl
<< " cyli:" << tinterp()[i] << nl
<< " cart:" << tresult()[i] << nl
<< endl;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment