mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
resetting zones upon reading
This commit is contained in:
@ -284,12 +284,34 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
|||||||
*this
|
*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());
|
pointZones_.setSize(newPointZones.size());
|
||||||
forAll (pointZones_, pzI)
|
forAll (pointZones_, pzI)
|
||||||
{
|
{
|
||||||
pointZones_[pzI] = newPointZones[pzI];
|
pointZones_[pzI] = newPointZones[pzI];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
faceZoneMesh newFaceZones
|
faceZoneMesh newFaceZones
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -305,7 +327,14 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
|||||||
*this
|
*this
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oldSize = faceZones_.size();
|
||||||
|
|
||||||
|
if (newFaceZones.size() <= faceZones_.size())
|
||||||
|
{
|
||||||
faceZones_.setSize(newFaceZones.size());
|
faceZones_.setSize(newFaceZones.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset existing ones
|
||||||
forAll (faceZones_, fzI)
|
forAll (faceZones_, fzI)
|
||||||
{
|
{
|
||||||
faceZones_[fzI].resetAddressing
|
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
|
cellZoneMesh newCellZones
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -330,12 +368,28 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
|||||||
*this
|
*this
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oldSize = cellZones_.size();
|
||||||
|
|
||||||
|
if (newCellZones.size() <= cellZones_.size())
|
||||||
|
{
|
||||||
cellZones_.setSize(newCellZones.size());
|
cellZones_.setSize(newCellZones.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset existing ones
|
||||||
forAll (cellZones_, czI)
|
forAll (cellZones_, czI)
|
||||||
{
|
{
|
||||||
cellZones_[czI] = newCellZones[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)
|
if (boundaryChanged)
|
||||||
{
|
{
|
||||||
return polyMesh::TOPO_PATCH_CHANGE;
|
return polyMesh::TOPO_PATCH_CHANGE;
|
||||||
|
|||||||
Reference in New Issue
Block a user