Added check for faces with insufficient points
This commit is contained in:
parent
52f4078d64
commit
ba3d7f689b
1 changed files with 8 additions and 2 deletions
|
@ -479,6 +479,12 @@ Foam::point Foam::face::centre(const pointField& meshPoints) const
|
||||||
{
|
{
|
||||||
// Calculate the centre by breaking the face into triangles and
|
// Calculate the centre by breaking the face into triangles and
|
||||||
// area-weighted averaging their centres
|
// area-weighted averaging their centres
|
||||||
|
if (size() < 3)
|
||||||
|
{
|
||||||
|
FatalErrorIn("point face::centre(const pointField& meshPoints) const")
|
||||||
|
<< "Face with fewer than 3 points detected: " << *this
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
// If the face is a triangle, do a direct calculation
|
// If the face is a triangle, do a direct calculation
|
||||||
if (size() == 3)
|
if (size() == 3)
|
||||||
|
|
Reference in a new issue