From 51f9b7facb30bd398bcfd81dfdb127d56a3620ef Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 14 Oct 2015 14:46:11 +0100 Subject: [PATCH] ENH: polyTopoChange: improved error message --- .../polyTopoChange/polyTopoChange.C | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 97a4ddc11f..0cbef35a12 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -498,6 +498,21 @@ void Foam::polyTopoChange::makeCells { if (faceOwner_[faceI] < 0) { + pointField newPoints; + if (faceI < faces_.size()) + { + const face& f = faces_[faceI]; + newPoints.setSize(f.size(), vector::max); + forAll(f, fp) + { + if (f[fp] < points_.size()) + { + newPoints[fp] = points_[f[fp]]; + } + } + } + + FatalErrorIn ( "polyTopoChange::makeCells\n" @@ -506,7 +521,9 @@ void Foam::polyTopoChange::makeCells " labelList&,\n" " labelList&\n" ") const\n" - ) << "Face " << faceI << " is active but its owner has" + ) << "Face " << faceI + << " with vertices " << newPoints + << " is active but its owner has" << " been deleted. This is usually due to deleting cells" << " without modifying exposed faces to be boundary faces." << exit(FatalError);