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 regionI = 0;
|
||||||
|
|
||||||
label lineLabel, shapeId, nLabels, cellTableId, typeId;
|
label lineLabel, shapeId, nLabels, cellTableId, typeId;
|
||||||
labelList starLabels(64);
|
DynamicList<label> vertexLabels(64);
|
||||||
|
|
||||||
while ((is >> lineLabel).good())
|
while ((is >> lineLabel).good())
|
||||||
{
|
{
|
||||||
is >> shapeId >> nLabels >> cellTableId >> typeId;
|
is >> shapeId >> nLabels >> cellTableId >> typeId;
|
||||||
|
|
||||||
if (nLabels > starLabels.size())
|
vertexLabels.clear();
|
||||||
{
|
vertexLabels.reserve(nLabels);
|
||||||
starLabels.setSize(nLabels);
|
|
||||||
}
|
|
||||||
starLabels = -1;
|
|
||||||
|
|
||||||
// read indices - max 8 per line
|
// read indices - max 8 per line
|
||||||
for (label i = 0; i < nLabels; ++i)
|
for (label i = 0; i < nLabels; ++i)
|
||||||
{
|
{
|
||||||
|
label vrtId;
|
||||||
if ((i % 8) == 0)
|
if ((i % 8) == 0)
|
||||||
{
|
{
|
||||||
is >> lineLabel;
|
is >> lineLabel;
|
||||||
}
|
}
|
||||||
is >> starLabels[i];
|
is >> vrtId;
|
||||||
|
|
||||||
|
// convert original vertex id to point label
|
||||||
|
vertexLabels.append(mapPointId[vrtId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeId == starcdShellType_)
|
if (typeId == starcdShellType_)
|
||||||
@ -178,14 +179,7 @@ bool Foam::fileFormats::STARCDsurfaceFormat<Face>::read
|
|||||||
dynSizes.append(0);
|
dynSizes.append(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SubList<label> vertices(starLabels, nLabels);
|
SubList<label> vertices(vertexLabels, vertexLabels.size());
|
||||||
|
|
||||||
// convert orig vertex id to point label
|
|
||||||
forAll(vertices, i)
|
|
||||||
{
|
|
||||||
vertices[i] = mapPointId[vertices[i]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mustTriangulate && nLabels > 3)
|
if (mustTriangulate && nLabels > 3)
|
||||||
{
|
{
|
||||||
face f(vertices);
|
face f(vertices);
|
||||||
|
|||||||
@ -175,7 +175,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// truncate addressed size
|
// truncate addressed size
|
||||||
dynSizes.setSize(nPatch);
|
dynSizes.setCapacity(nPatch);
|
||||||
|
|
||||||
// transfer to normal lists
|
// transfer to normal lists
|
||||||
points_.transfer(dynPoints);
|
points_.transfer(dynPoints);
|
||||||
|
|||||||
Reference in New Issue
Block a user