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.
This commit is contained in:
Mark Olesen
2016-11-13 12:33:47 +01:00
parent eeedf4a35d
commit c09c8e36c7

View File

@ -67,11 +67,7 @@ bool Foam::triSurface::readVTK(const fileName& fName)
patches[zoneI] = geometricSurfacePatch patches[zoneI] = geometricSurfacePatch
( (
( zone.geometricType().size() ? zone.geometricType() : "empty",
zone.geometricType() != word::null
? zone.geometricType()
: "empty"
),
regionName, regionName,
zoneI zoneI
); );
@ -86,6 +82,7 @@ bool Foam::triSurface::readVTK(const fileName& fName)
else else
{ {
// Add single patch // Add single patch
patches.setSize(1);
patches[0] = geometricSurfacePatch("empty", "patch0", 0); patches[0] = geometricSurfacePatch("empty", "patch0", 0);
// Triangle regions already set to 0 // Triangle regions already set to 0