diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index ea3b05f0ca..a296fd336a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -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_);