Commit 0f646646 authored by mattijs's avatar mattijs
Browse files

resetting zones upon reading

parent 536269a2
......@@ -284,12 +284,34 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
*this
);
label oldSize = pointZones_.size();
if (newPointZones.size() <= pointZones_.size())
{
pointZones_.setSize(newPointZones.size());
}
// Reset existing ones
forAll (pointZones_, czI)
{
pointZones_[czI] = newPointZones[czI];
}
// Extend with extra ones
pointZones_.setSize(newPointZones.size());
for (label czI = oldSize; czI < newPointZones.size(); czI++)
{
pointZones_.set(czI, newPointZones[czI].clone(pointZones_));
}
pointZones_.setSize(newPointZones.size());
forAll (pointZones_, pzI)
{
pointZones_[pzI] = newPointZones[pzI];
}
faceZoneMesh newFaceZones
(
IOobject
......@@ -305,7 +327,14 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
*this
);
faceZones_.setSize(newFaceZones.size());
oldSize = faceZones_.size();
if (newFaceZones.size() <= faceZones_.size())
{
faceZones_.setSize(newFaceZones.size());
}
// Reset existing ones
forAll (faceZones_, fzI)
{
faceZones_[fzI].resetAddressing
......@@ -315,6 +344,15 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
);
}
// Extend with extra ones
faceZones_.setSize(newFaceZones.size());
for (label fzI = oldSize; fzI < newFaceZones.size(); fzI++)
{
faceZones_.set(fzI, newFaceZones[fzI].clone(faceZones_));
}
cellZoneMesh newCellZones
(
IOobject
......@@ -330,12 +368,28 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
*this
);
cellZones_.setSize(newCellZones.size());
oldSize = cellZones_.size();
if (newCellZones.size() <= cellZones_.size())
{
cellZones_.setSize(newCellZones.size());
}
// Reset existing ones
forAll (cellZones_, czI)
{
cellZones_[czI] = newCellZones[czI];
}
// Extend with extra ones
cellZones_.setSize(newCellZones.size());
for (label czI = oldSize; czI < newCellZones.size(); czI++)
{
cellZones_.set(czI, newCellZones[czI].clone(cellZones_));
}
if (boundaryChanged)
{
return polyMesh::TOPO_PATCH_CHANGE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment