From 75945b507fee1ecec2865a94355583b2914b9dff Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 23 Jun 2009 13:16:00 +0100 Subject: [PATCH] error check for zero cells --- .../utilities/mesh/conversion/gmshToFoam/gmshToFoam.C | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 68eb9c46cf..23aec54cd8 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -657,6 +657,16 @@ void readCells << " tet :" << nTet << endl << endl; + if (cells.size() == 0) + { + FatalErrorIn("readCells(..)") + << "No cells read from file " << inFile.name() << nl + << "Does your file specify any 3D elements (hex=" << MSHHEX + << ", prism=" << MSHPRISM << ", pyramid=" << MSHPYR + << ", tet=" << MSHTET << ")?" << nl + << "Perhaps you have not exported the 3D elements?" + << exit(FatalError); + } Info<< "CellZones:" << nl << "Zone\tSize" << endl;