From c09c8e36c70c2ec0db1ad5cb0132f3bb1fbc7760 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 13 Nov 2016 12:33:47 +0100 Subject: [PATCH] BUG: unallocated list in triSurface vtk reader (issue #297) - Condition is there to catch cases where the vtkSurfaceFormat returns no zones (which should never be the case), but assigns a fallback value without first resizing. --- src/triSurface/triSurface/interfaces/VTK/readVTK.C | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/triSurface/triSurface/interfaces/VTK/readVTK.C b/src/triSurface/triSurface/interfaces/VTK/readVTK.C index 8279f5f834..a28570164b 100644 --- a/src/triSurface/triSurface/interfaces/VTK/readVTK.C +++ b/src/triSurface/triSurface/interfaces/VTK/readVTK.C @@ -67,11 +67,7 @@ bool Foam::triSurface::readVTK(const fileName& fName) patches[zoneI] = geometricSurfacePatch ( - ( - zone.geometricType() != word::null - ? zone.geometricType() - : "empty" - ), + zone.geometricType().size() ? zone.geometricType() : "empty", regionName, zoneI ); @@ -86,6 +82,7 @@ bool Foam::triSurface::readVTK(const fileName& fName) else { // Add single patch + patches.setSize(1); patches[0] = geometricSurfacePatch("empty", "patch0", 0); // Triangle regions already set to 0