mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: polyMeshIO: clear storage before reading points; added check on sizes
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -407,9 +407,12 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
|
||||
clearGeom();
|
||||
|
||||
points_.instance() = pointsInst;
|
||||
|
||||
points_ = pointIOField
|
||||
label nOldPoints = points_.size();
|
||||
|
||||
points_.clear();
|
||||
|
||||
pointIOField newPoints
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -423,6 +426,19 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
)
|
||||
);
|
||||
|
||||
if (nOldPoints != 0 && nOldPoints != newPoints.size())
|
||||
{
|
||||
FatalErrorIn("polyMesh::readUpdate()")
|
||||
<< "Point motion detected but number of points "
|
||||
<< newPoints.size() << " in "
|
||||
<< newPoints.objectPath() << " does not correspond to "
|
||||
<< " current " << nOldPoints
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
points_.transfer(newPoints);
|
||||
points_.instance() = pointsInst;
|
||||
|
||||
// Derived info
|
||||
bounds_ = boundBox(points_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user