BUG: ensightSurfaceReader - corrected initial list sizing

This commit is contained in:
Andrew Heather 2017-11-30 08:36:07 +00:00 committed by Mark Olesen
parent 74248c7469
commit d88d1d53aa

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. \\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,7 +75,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
std::ostringstream oss; std::ostringstream oss;
label nMask = 0; label nMask = 0;
for (size_t chari = 0; chari < fieldFileName.size(); chari++) for (size_t chari = 0; chari < fieldFileName.size(); ++chari)
{ {
if (fieldFileName[chari] == '*') if (fieldFileName[chari] == '*')
{ {
@ -130,7 +130,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
label n = surfPtr_->size(); label n = surfPtr_->size();
forAll(values, cmptI) forAll(values, cmptI)
{ {
values.setSize(n); values[cmptI].setCapacity(n);
} }
// Read data file using schema generated while reading the surface // Read data file using schema generated while reading the surface