cyclicRepeatAMI: Added error message for zero-sized transform patch

Sometimes decomposition can remove a cyclic patch entirely, converting
it into a processor cyclic. If this patch is being used to specify the
transform for a cyclicRepeatAMI patch then the calculation will fail.
This change adds a check for this situation, and errors with the
suggestion that the transform patch be preserved during decomposition.
This commit is contained in:
Will Bainbridge
2018-06-04 10:47:49 +01:00
parent 7a93d91a80
commit 1223da98f7

View File

@ -82,8 +82,9 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
}
Info<< indent << typeName <<" : Creating addressing and weights between "
<< this->size() << " source faces and " << neighbPatch().size()
<< " target faces" << endl;
<< returnReduce(this->size(), sumOp<label>()) << " source faces and "
<< returnReduce(neighbPatch().size(), sumOp<label>()) << " target faces"
<< endl;
// Get the transform associated with the transform patch
vectorTensorTransform t;
@ -129,6 +130,17 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const
reduce(bt, keepIfTrueOp<vectorTensorTransform>());
if (!bt.first())
{
FatalErrorInFunction
<< "Transform patch " << transformPatch.name() << " for "
<< typeName << " patch " << name() << " has zero faces. It may "
<< "have been converted to a processor cyclic during "
<< "decomposition. Consider adding " << transformPatch.name()
<< " and it's neighbour to the list of preserved patches."
<< exit(FatalError);
}
t = bt.second();
}
const vectorTensorTransform tInv(inv(t));