mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: symmetryPolyPatch: handle zero faces case
This commit is contained in:
@ -113,6 +113,14 @@ const Foam::vector& Foam::symmetryPlanePolyPatch::n() const
|
||||
// If the symmetry normal is not set calculate it
|
||||
// as the average face-normal
|
||||
if (magSqr(n_) < 0.5)
|
||||
{
|
||||
if (returnReduce(size(), sumOp<label>()) == 0)
|
||||
{
|
||||
// No faces in patch. Avoid gAverage complaining and set
|
||||
// normal to nonsense value to catch any use
|
||||
n_ = vector::rootMax;
|
||||
}
|
||||
else
|
||||
{
|
||||
const vectorField& nf(faceNormals());
|
||||
n_ = gAverage(nf);
|
||||
@ -128,6 +136,7 @@ const Foam::vector& Foam::symmetryPlanePolyPatch::n() const
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return n_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user