mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
avoid DynamicList::setSize()
This commit is contained in:
@ -135,26 +135,27 @@ bool Foam::fileFormats::STARCDsurfaceFormat<Face>::read
|
||||
label regionI = 0;
|
||||
|
||||
label lineLabel, shapeId, nLabels, cellTableId, typeId;
|
||||
labelList starLabels(64);
|
||||
DynamicList<label> vertexLabels(64);
|
||||
|
||||
while ((is >> lineLabel).good())
|
||||
{
|
||||
is >> shapeId >> nLabels >> cellTableId >> typeId;
|
||||
|
||||
if (nLabels > starLabels.size())
|
||||
{
|
||||
starLabels.setSize(nLabels);
|
||||
}
|
||||
starLabels = -1;
|
||||
vertexLabels.clear();
|
||||
vertexLabels.reserve(nLabels);
|
||||
|
||||
// read indices - max 8 per line
|
||||
for (label i = 0; i < nLabels; ++i)
|
||||
{
|
||||
label vrtId;
|
||||
if ((i % 8) == 0)
|
||||
{
|
||||
is >> lineLabel;
|
||||
}
|
||||
is >> starLabels[i];
|
||||
is >> vrtId;
|
||||
|
||||
// convert original vertex id to point label
|
||||
vertexLabels.append(mapPointId[vrtId]);
|
||||
}
|
||||
|
||||
if (typeId == starcdShellType_)
|
||||
@ -178,14 +179,7 @@ bool Foam::fileFormats::STARCDsurfaceFormat<Face>::read
|
||||
dynSizes.append(0);
|
||||
}
|
||||
|
||||
SubList<label> vertices(starLabels, nLabels);
|
||||
|
||||
// convert orig vertex id to point label
|
||||
forAll(vertices, i)
|
||||
{
|
||||
vertices[i] = mapPointId[vertices[i]];
|
||||
}
|
||||
|
||||
SubList<label> vertices(vertexLabels, vertexLabels.size());
|
||||
if (mustTriangulate && nLabels > 3)
|
||||
{
|
||||
face f(vertices);
|
||||
|
||||
@ -175,7 +175,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
||||
}
|
||||
}
|
||||
// truncate addressed size
|
||||
dynSizes.setSize(nPatch);
|
||||
dynSizes.setCapacity(nPatch);
|
||||
|
||||
// transfer to normal lists
|
||||
points_.transfer(dynPoints);
|
||||
|
||||
Reference in New Issue
Block a user